From df1d6ebebe45708040048abc33aebb8980a0c9f2 Mon Sep 17 00:00:00 2001 From: franciscovila Date: Tue, 20 Jun 2023 10:38:45 +0100 Subject: Support custom tosca functions in operation input values Issue-ID: SDC-4545 Signed-off-by: franciscovila Change-Id: Icd466d4e2e1d2136f6e41b5c345e9244d5f295f6 --- .../service-dependencies-editor.component.ts | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) (limited to 'catalog-ui/src/app/ng2/pages/service-dependencies-editor/service-dependencies-editor.component.ts') diff --git a/catalog-ui/src/app/ng2/pages/service-dependencies-editor/service-dependencies-editor.component.ts b/catalog-ui/src/app/ng2/pages/service-dependencies-editor/service-dependencies-editor.component.ts index 5897f272b3..d560285be9 100644 --- a/catalog-ui/src/app/ng2/pages/service-dependencies-editor/service-dependencies-editor.component.ts +++ b/catalog-ui/src/app/ng2/pages/service-dependencies-editor/service-dependencies-editor.component.ts @@ -72,6 +72,7 @@ export class ServiceDependenciesEditorComponent implements OnInit { @Input() capabilityNameAndPropertiesMap: Map; @Input() filterType: FilterType; @Input() filterConstraint: PropertyFilterConstraintUi; + @Input() customToscaFunctions: Array; //output currentRule: PropertyFilterConstraintUi; @@ -100,7 +101,7 @@ export class ServiceDependenciesEditorComponent implements OnInit { selectedProperty: PropertyFEModel; selectedSourceType: string; componentInstanceMap: Map = new Map(); - customToscaFunctions: Array; + capabilityDropdownList: DropdownValue[] = []; validValuesToscaFunctionList: ToscaFunction[]; rangeToscaFunctionList: ToscaFunction[]; @@ -133,13 +134,15 @@ export class ServiceDependenciesEditorComponent implements OnInit { } private initCustomToscaFunctions() { - this.customToscaFunctions = []; - this.topologyTemplateService.getDefaultCustomFunction().toPromise().then((data) => { - for (let customFunction of data) { - this.customToscaFunctions.push(new CustomToscaFunction(customFunction)); - } - }); -} + if (!this.customToscaFunctions) { + this.customToscaFunctions = []; + this.topologyTemplateService.getDefaultCustomFunction().toPromise().then((data) => { + for (let customFunction of data) { + this.customToscaFunctions.push(new CustomToscaFunction(customFunction)); + } + }); + } + } private initCapabilityDropdown(): void { if (this.filterType == FilterType.CAPABILITY) { -- cgit 1.2.3-korg