diff options
author | franciscovila <javier.paradela.vila@est.tech> | 2023-06-20 10:38:45 +0100 |
---|---|---|
committer | Michael Morris <michael.morris@est.tech> | 2023-06-23 18:55:13 +0000 |
commit | df1d6ebebe45708040048abc33aebb8980a0c9f2 (patch) | |
tree | 38b49640c955eb0e36878145b0568d60f6c46bb2 /catalog-ui/src/app/ng2/pages/service-dependencies-editor | |
parent | dfcf12ff9461b8c508d5932cf210e9a8203e7ea1 (diff) |
Support custom tosca functions in operation input values1.13.1
Issue-ID: SDC-4545
Signed-off-by: franciscovila <javier.paradela.vila@est.tech>
Change-Id: Icd466d4e2e1d2136f6e41b5c345e9244d5f295f6
Diffstat (limited to 'catalog-ui/src/app/ng2/pages/service-dependencies-editor')
2 files changed, 15 insertions, 8 deletions
diff --git a/catalog-ui/src/app/ng2/pages/service-dependencies-editor/service-dependencies-editor.component.html b/catalog-ui/src/app/ng2/pages/service-dependencies-editor/service-dependencies-editor.component.html index c90cfd8210..b5cc0cdc9e 100644 --- a/catalog-ui/src/app/ng2/pages/service-dependencies-editor/service-dependencies-editor.component.html +++ b/catalog-ui/src/app/ng2/pages/service-dependencies-editor/service-dependencies-editor.component.html @@ -77,6 +77,8 @@ <tosca-function [property]="selectedProperty" [overridingType] = "isLengthOperator() ? overridingType : undefined" [componentInstanceMap]="componentInstanceMap" + [customToscaFunctions]="customToscaFunctions" + [overridingType]="overridingType" [allowClear]="false" (onValidityChange)="onToscaFunctionValidityChange($event)" > @@ -103,6 +105,7 @@ <tosca-function [property]="selectedProperty" [inToscaFunction]="val" [componentInstanceMap]="componentInstanceMap" + [customToscaFunctions]="customToscaFunctions" [allowClear]="false" (onValidityChange)="onToscaRangeFunctionListValidityChange($event, valueIndex)" > @@ -123,6 +126,7 @@ <tosca-function [property]="selectedProperty" [inToscaFunction]="val" [componentInstanceMap]="componentInstanceMap" + [customToscaFunctions]="customToscaFunctions" [allowClear]="false" (onValidityChange)="onToscaFunctionListValidityChange($event, valueIndex)" > 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<string, PropertyModel[]>; @Input() filterType: FilterType; @Input() filterConstraint: PropertyFilterConstraintUi; + @Input() customToscaFunctions: Array<CustomToscaFunction>; //output currentRule: PropertyFilterConstraintUi; @@ -100,7 +101,7 @@ export class ServiceDependenciesEditorComponent implements OnInit { selectedProperty: PropertyFEModel; selectedSourceType: string; componentInstanceMap: Map<string, InstanceFeDetails> = new Map<string, InstanceFeDetails>(); - customToscaFunctions: Array<CustomToscaFunction>; + 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) { |