From 87fb2140798d1aef9a3ba223b60f20a4ebb6e92d Mon Sep 17 00:00:00 2001 From: MichaelMorris Date: Thu, 12 May 2022 15:42:40 +0100 Subject: Fix edit operation artifact and data types Signed-off-by: MichaelMorris Issue-ID: SDC-4000 Change-Id: I62d1be04c4995ccf5385ec6c5fd6e5673ac5c85c --- .../interface-operation-handler.component.ts | 26 +++++++++++++--------- 1 file changed, 15 insertions(+), 11 deletions(-) (limited to 'catalog-ui/src/app/ng2/pages/composition/interface-operatons/operation-creator/interface-operation-handler.component.ts') diff --git a/catalog-ui/src/app/ng2/pages/composition/interface-operatons/operation-creator/interface-operation-handler.component.ts b/catalog-ui/src/app/ng2/pages/composition/interface-operatons/operation-creator/interface-operation-handler.component.ts index 5cc7f691aa..fd745ff311 100644 --- a/catalog-ui/src/app/ng2/pages/composition/interface-operatons/operation-creator/interface-operation-handler.component.ts +++ b/catalog-ui/src/app/ng2/pages/composition/interface-operatons/operation-creator/interface-operation-handler.component.ts @@ -42,7 +42,6 @@ import {DataTypeModel} from "../../../../../models/data-types"; }) export class InterfaceOperationHandlerComponent { - @Input() private modelName: string; @Output('propertyChanged') emitter: EventEmitter = new EventEmitter(); @ViewChild('interfaceOperationDropDown') interfaceOperationDropDown: DropDownComponent; @@ -53,6 +52,7 @@ export class InterfaceOperationHandlerComponent { validityChangedCallback: Function; isViewOnly: boolean; isEdit: boolean; + modelName: string; }; dataTypeMap$: Observable>; @@ -74,6 +74,7 @@ export class InterfaceOperationHandlerComponent { interfaceOperationMap: Map> = new Map>(); interfaceOperationOptions: Array = []; selectedInterfaceOperation: DropDownOption = undefined; + modelName: string; toscaArtifactTypeSelected: string; toscaArtifactTypeProperties: Array = []; @@ -87,15 +88,7 @@ export class InterfaceOperationHandlerComponent { inputTypeOptions: any[]; constructor(private dataTypeService: DataTypeService, private componentServiceNg2: ComponentServiceNg2) { - this.dataTypeMap$ = new Observable>(subscriber => { - this.dataTypeService.findAllDataTypesByModel(this.modelName) - .then((dataTypesMap: Map) => { - subscriber.next(dataTypesMap); - }); - }); - this.dataTypeMap$.subscribe(value => { - this.dataTypeMap = value; - }); + } @@ -106,10 +99,21 @@ export class InterfaceOperationHandlerComponent { this.operationToUpdate = this.input.selectedInterfaceOperation; this.operationToUpdate.interfaceId = this.input.selectedInterface.uniqueId; this.operationToUpdate.interfaceType = this.input.selectedInterface.type; + this.modelName = this.input.modelName; this.initInputs(); this.removeImplementationQuote(); this.validityChanged(); this.loadInterfaceOperationImplementation(); + + this.dataTypeMap$ = new Observable>(subscriber => { + this.dataTypeService.findAllDataTypesByModel(this.modelName) + .then((dataTypesMap: Map) => { + subscriber.next(dataTypesMap); + }); + }); + this.dataTypeMap$.subscribe(value => { + this.dataTypeMap = value; + }); } private initInputs() { @@ -127,7 +131,7 @@ export class InterfaceOperationHandlerComponent { } private loadInterfaceType() { - this.componentServiceNg2.getInterfaceTypesByModel(undefined) + this.componentServiceNg2.getInterfaceTypesByModel(this.modelName) .subscribe(response => { if (response) { this.interfaceOperationMap = new Map>(); -- cgit 1.2.3-korg