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/components | |
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/components')
-rw-r--r-- | catalog-ui/src/app/ng2/components/logic/service-dependencies/service-dependencies.component.ts | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/catalog-ui/src/app/ng2/components/logic/service-dependencies/service-dependencies.component.ts b/catalog-ui/src/app/ng2/components/logic/service-dependencies/service-dependencies.component.ts index 9a63dff739..a0588c0daa 100644 --- a/catalog-ui/src/app/ng2/components/logic/service-dependencies/service-dependencies.component.ts +++ b/catalog-ui/src/app/ng2/components/logic/service-dependencies/service-dependencies.component.ts @@ -30,6 +30,7 @@ import {CompositionService} from "../../../pages/composition/composition.service import {FilterConstraint} from "app/models/filter-constraint"; import {PropertyFilterConstraintUi} from "../../../../models/ui-models/property-filter-constraint-ui"; import {ConstraintOperatorType, FilterConstraintHelper} from "../../../../utils/filter-constraint-helper"; +import {CustomToscaFunction} from "../../../../models/default-custom-functions"; export enum SourceType { STATIC = 'static', @@ -99,6 +100,7 @@ export class ServiceDependenciesComponent implements OnInit, OnChanges { properties: string = ToscaFilterConstraintType.PROPERTIES; private componentInstancesConstraints: FilterConstraint[] = []; isEditable: boolean; + customToscaFunctions: Array<CustomToscaFunction>; @Input() readonly: boolean; @Input() compositeService: ComponentMetadata; @@ -138,12 +140,24 @@ export class ServiceDependenciesComponent implements OnInit, OnChanges { this.parentServiceInputs = result.inputs; this.parentServiceProperties = result.properties; }); + this.initCustomToscaFunctions(); this.loadNodeFilter(); this.translateService.languageChangedObservable.subscribe((lang) => { I18nTexts.translateTexts(this.translateService); }); } + private initCustomToscaFunctions() { + if (!this.customToscaFunctions) { + this.customToscaFunctions = []; + this.topologyTemplateService.getDefaultCustomFunction().toPromise().then((data) => { + for (let customFunction of data) { + this.customToscaFunctions.push(new CustomToscaFunction(customFunction)); + } + }); + } + } + ngOnChanges(changes): void { if (changes.currentServiceInstance) { this.currentServiceInstance = changes.currentServiceInstance.currentValue; @@ -264,6 +278,7 @@ export class ServiceDependenciesComponent implements OnInit, OnChanges { 'parentServiceInputs': this.parentServiceInputs, 'parentServiceProperties': this.parentServiceProperties, 'selectedInstanceProperties': this.selectedInstanceProperties, + 'customToscaFunctions': this.customToscaFunctions, 'filterType': FilterType.PROPERTY, } ); @@ -298,6 +313,7 @@ export class ServiceDependenciesComponent implements OnInit, OnChanges { } createNodeFilter = (constraintType: string): void => { + this.customToscaFunctions = this.modalInstance.instance.dynamicContent.instance.customToscaFunctions; this.isLoading = true; this.topologyTemplateService.createServiceFilterConstraints( this.compositeService.uniqueId, @@ -372,9 +388,11 @@ export class ServiceDependenciesComponent implements OnInit, OnChanges { 'parentServiceInputs': this.parentServiceInputs, 'parentServiceProperties': this.parentServiceProperties, 'selectedInstanceProperties': this.selectedInstanceProperties, + 'customToscaFunctions': this.customToscaFunctions, 'filterType': FilterType.PROPERTY } ); + this.modalInstance.instance.open(); } |