Skip to content

Commit

Permalink
fix #227 Fix indentation
Browse files Browse the repository at this point in the history
  • Loading branch information
TerranceKhumalo-absa committed Feb 22, 2023
1 parent f73604c commit ccfc6c5
Show file tree
Hide file tree
Showing 4 changed files with 64 additions and 69 deletions.
10 changes: 4 additions & 6 deletions ui/src/modules/plans/models/operation/operation-info.models.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,9 +90,8 @@ export function toDataViewSchema(operation: Operation): SplineDataViewSchema {
]
}

export function toInputsDvs(
operationDetails: OperationDetails,
selectedAttributeId$: Observable<string | null>): SplineDataViewSchema | null {
export function toInputsDvs(operationDetails: OperationDetails,
selectedAttributeId$: Observable<string | null>): SplineDataViewSchema | null {

if (!operationDetails.inputs || !operationDetails.inputs?.length) {
return null
Expand All @@ -106,9 +105,8 @@ export function toInputsDvs(
)
}

export function toOutputsDvs(
operationDetails: OperationDetails,
selectedAttributeId$: Observable<string | null>): SplineDataViewSchema | null {
export function toOutputsDvs(operationDetails: OperationDetails,
selectedAttributeId$: Observable<string | null>): SplineDataViewSchema | null {

if (operationDetails.output === null) {
return null
Expand Down
79 changes: 39 additions & 40 deletions ui/src/modules/plans/models/operation/operation-property.models.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,39 +54,39 @@ export type ExtraProperties = {

export function parseExtraOptions(nativeProperties: NativeProperties): ExtraProperties {
return Object.entries(nativeProperties)
.filter(([, v]) => v != null)
.reduce(
(acc, [key, value]) => {
if (typeof value === 'string' || typeof value === 'number' || typeof value === 'boolean') {
const primitiveValue: ExtraPropertyValuePrimitive = {
label: key,
value: value,
}
return {...acc, primitive: [...acc.primitive, primitiveValue]}
}
else if (isPlainObject(value) && isExpresionProperty(value)) {
return {...acc, expression: [...acc.expression, toExpressionValue(key, [value])]}
}
else if (typeof Array.isArray(value) && value.length && isExpresionProperty(value[0])) {
return {...acc, expression: [...acc.expression, toExpressionValue(key, value)]}
}
else if (typeof Array.isArray(value) && value.length && isOrderSpecProperty(value[0])) {
return {...acc, expression: [...acc.expression, toOrderSpecValue(key, value)]}
}
else {
const jsonValue: ExtraPropertyValueJson = {
label: humanizeCase(key),
value,
}
return {...acc, json: [...acc.json, jsonValue]}
}
},
{
primitive: [],
expression: [],
json: [],
},
)
.filter(([, v]) => v != null)
.reduce(
(acc, [key, value]) => {
if (typeof value === 'string' || typeof value === 'number' || typeof value === 'boolean') {
const primitiveValue: ExtraPropertyValuePrimitive = {
label: key,
value: value,
}
return {...acc, primitive: [...acc.primitive, primitiveValue]}
}
else if (isPlainObject(value) && isExpresionProperty(value)) {
return {...acc, expression: [...acc.expression, toExpressionValue(key, [value])]}
}
else if (typeof Array.isArray(value) && value.length && isExpresionProperty(value[0])) {
return {...acc, expression: [...acc.expression, toExpressionValue(key, value)]}
}
else if (typeof Array.isArray(value) && value.length && isOrderSpecProperty(value[0])) {
return {...acc, expression: [...acc.expression, toOrderSpecValue(key, value)]}
}
else {
const jsonValue: ExtraPropertyValueJson = {
label: humanizeCase(key),
value,
}
return {...acc, json: [...acc.json, jsonValue]}
}
},
{
primitive: [],
expression: [],
json: [],
},
)
}

export function primitivePropsToDvs(props: ExtraPropertyValuePrimitive[]): SdWidgetSchema[] {
Expand All @@ -100,8 +100,7 @@ export function primitivePropsToDvs(props: ExtraPropertyValuePrimitive[]): SdWid
]
}

export function expressionPropsToDvs(
props: ExtraPropertyValueExpression[],
export function expressionPropsToDvs(props: ExtraPropertyValueExpression[],
attrSchemasCollection: AttrSchemasCollection): SdWidgetSchema[] {
return props.map(
item => SdWidgetExpansionPanel.toSchema(
Expand All @@ -112,11 +111,11 @@ export function expressionPropsToDvs(
},
item.value.map(
expressionInfo => SdWidgetExpression.toSchema({
expression: expressionInfo.expression,
prefix: expressionInfo.prefix,
suffix: expressionInfo.suffix,
attrSchemasCollection
}),
expression: expressionInfo.expression,
prefix: expressionInfo.prefix,
suffix: expressionInfo.suffix,
attrSchemasCollection
}),
),
),
)
Expand Down
5 changes: 2 additions & 3 deletions ui/src/modules/plans/models/plan/plan-node-control.models.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,8 @@ export function extractNodeName(nodeSource: ExecutionPlanLineageNode): string {
return nodeSource.name
}

export function toSgNode(
nodeSource: ExecutionPlanLineageNode,
nodeView: NodeView = NodeView.Detailed): SgNode {
export function toSgNode(nodeSource: ExecutionPlanLineageNode,
nodeView: NodeView = NodeView.Detailed): SgNode {
const nodeStyles = getNodeStyles(nodeSource?.type, nodeSource.name)

const defaultActions = [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,19 +36,19 @@ import NavTabInfo = SplineTabsNavBar.NavTabInfo


@Component({
selector: 'plan-overview-page',
templateUrl: './plan-overview.page.component.html',
styleUrls: ['./plan-overview.page.component.scss'],
providers: [
{
provide: ExecutionPlanOverviewFactoryStore,
useFactory: (executionPlanApiService: ExecutionPlanApiService) => {
return new ExecutionPlanOverviewFactoryStore(executionPlanApiService)
},
deps: [ExecutionPlanApiService]
}
]
})
selector: 'plan-overview-page',
templateUrl: './plan-overview.page.component.html',
styleUrls: ['./plan-overview.page.component.scss'],
providers: [
{
provide: ExecutionPlanOverviewFactoryStore,
useFactory: (executionPlanApiService: ExecutionPlanApiService) => {
return new ExecutionPlanOverviewFactoryStore(executionPlanApiService)
},
deps: [ExecutionPlanApiService]
}
]
})
export class PlanOverviewPageComponent extends BaseComponent implements OnInit {

@ViewChild(SgContainerComponent) readonly sgContainer: SgContainerComponent
Expand All @@ -66,11 +66,10 @@ export class PlanOverviewPageComponent extends BaseComponent implements OnInit {
eventId: string
isGraphFullScreen = false

constructor(
private readonly activatedRoute: ActivatedRoute,
private readonly router: Router,
private readonly matDialog: MatDialog,
readonly store: ExecutionPlanOverviewFactoryStore
constructor(private readonly activatedRoute: ActivatedRoute,
private readonly router: Router,
private readonly matDialog: MatDialog,
readonly store: ExecutionPlanOverviewFactoryStore
) {
super()

Expand Down Expand Up @@ -196,7 +195,7 @@ export class PlanOverviewPageComponent extends BaseComponent implements OnInit {
})
)
.subscribe(selectedNodeId =>
this.updateQueryParams(PlanOverview.QueryParamAlis.SelectedNodeId, selectedNodeId)
this.updateQueryParams(PlanOverview.QueryParamAlis.SelectedNodeId, selectedNodeId)
)

//
Expand All @@ -214,7 +213,7 @@ export class PlanOverviewPageComponent extends BaseComponent implements OnInit {
})
)
.subscribe(attrId =>
this.updateQueryParams(PlanOverview.QueryParamAlis.SelectedAttributeId, attrId)
this.updateQueryParams(PlanOverview.QueryParamAlis.SelectedAttributeId, attrId)
)
}

Expand Down

0 comments on commit ccfc6c5

Please sign in to comment.