From ccfc6c579e2d63aeccf9946d684f7e9fef348161 Mon Sep 17 00:00:00 2001 From: TerranceKhumalo-absa Date: Wed, 22 Feb 2023 16:18:42 +0200 Subject: [PATCH] fix #227 Fix indentation --- .../models/operation/operation-info.models.ts | 10 +-- .../operation/operation-property.models.ts | 79 +++++++++---------- .../models/plan/plan-node-control.models.ts | 5 +- .../plan-overview.page.component.ts | 39 +++++---- 4 files changed, 64 insertions(+), 69 deletions(-) diff --git a/ui/src/modules/plans/models/operation/operation-info.models.ts b/ui/src/modules/plans/models/operation/operation-info.models.ts index 9cfe105a..163b4682 100644 --- a/ui/src/modules/plans/models/operation/operation-info.models.ts +++ b/ui/src/modules/plans/models/operation/operation-info.models.ts @@ -90,9 +90,8 @@ export function toDataViewSchema(operation: Operation): SplineDataViewSchema { ] } -export function toInputsDvs( - operationDetails: OperationDetails, - selectedAttributeId$: Observable): SplineDataViewSchema | null { +export function toInputsDvs(operationDetails: OperationDetails, + selectedAttributeId$: Observable): SplineDataViewSchema | null { if (!operationDetails.inputs || !operationDetails.inputs?.length) { return null @@ -106,9 +105,8 @@ export function toInputsDvs( ) } -export function toOutputsDvs( - operationDetails: OperationDetails, - selectedAttributeId$: Observable): SplineDataViewSchema | null { +export function toOutputsDvs(operationDetails: OperationDetails, + selectedAttributeId$: Observable): SplineDataViewSchema | null { if (operationDetails.output === null) { return null diff --git a/ui/src/modules/plans/models/operation/operation-property.models.ts b/ui/src/modules/plans/models/operation/operation-property.models.ts index d3114e61..63ae6afe 100644 --- a/ui/src/modules/plans/models/operation/operation-property.models.ts +++ b/ui/src/modules/plans/models/operation/operation-property.models.ts @@ -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[] { @@ -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( @@ -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 + }), ), ), ) diff --git a/ui/src/modules/plans/models/plan/plan-node-control.models.ts b/ui/src/modules/plans/models/plan/plan-node-control.models.ts index 1341f29e..919c44d6 100644 --- a/ui/src/modules/plans/models/plan/plan-node-control.models.ts +++ b/ui/src/modules/plans/models/plan/plan-node-control.models.ts @@ -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 = [ diff --git a/ui/src/modules/plans/pages/plan-overview/plan-overview.page.component.ts b/ui/src/modules/plans/pages/plan-overview/plan-overview.page.component.ts index 2e732ce0..3960993a 100644 --- a/ui/src/modules/plans/pages/plan-overview/plan-overview.page.component.ts +++ b/ui/src/modules/plans/pages/plan-overview/plan-overview.page.component.ts @@ -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 @@ -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() @@ -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) ) // @@ -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) ) }