aboutsummaryrefslogtreecommitdiffstats
path: root/catalog-ui/src/app/ng2/pages/service-dependencies-editor
diff options
context:
space:
mode:
authorJvD_Ericsson <jeff.van.dam@est.tech>2023-04-13 08:28:45 +0100
committerMichael Morris <michael.morris@est.tech>2023-05-04 15:43:18 +0000
commitaf3fdfce91aeea1804c76a8571c102b78dde3794 (patch)
tree208b175c5a4b4d9522bdd7577a34722daab25137 /catalog-ui/src/app/ng2/pages/service-dependencies-editor
parentc4de5390c2a396e9ea88061454e40a92cea57ce1 (diff)
UI support for default custom function names
Issue-ID: SDC-4473 Signed-off-by: JvD_Ericsson <jeff.van.dam@est.tech> Change-Id: Ie4d002989857029300f0cc88123a5616a453aef0
Diffstat (limited to 'catalog-ui/src/app/ng2/pages/service-dependencies-editor')
-rw-r--r--catalog-ui/src/app/ng2/pages/service-dependencies-editor/service-dependencies-editor.component.html1
-rw-r--r--catalog-ui/src/app/ng2/pages/service-dependencies-editor/service-dependencies-editor.component.ts15
2 files changed, 15 insertions, 1 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 922cda6982..8024eb1615 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
@@ -73,6 +73,7 @@
<div class="i-sdc-form-item rule-input-field">
<tosca-function [property]="selectedProperty"
[componentInstanceMap]="componentInstanceMap"
+ [customToscaFunctions]="customToscaFunctions"
[allowClear]="false"
(onValidityChange)="onToscaFunctionValidityChange($event)"
>
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 5666bf595b..39609a5fbd 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
@@ -28,6 +28,9 @@ import {ToscaGetFunction} from "../../../models/tosca-get-function";
import {PropertyFilterConstraintUi} from "../../../models/ui-models/property-filter-constraint-ui";
import {ConstraintOperatorType, FilterConstraintHelper} from "../../../utils/filter-constraint-helper";
import {ToscaFunctionHelper} from "../../../utils/tosca-function-helper";
+import {TopologyTemplateService} from "app/ng2/services/component-services/topology-template.service";
+import {CustomToscaFunction} from "../../../models/default-custom-functions";
+import {ToscaFunctionType} from "../../../models/tosca-function-type.enum";
@Component({
selector: 'service-dependencies-editor',
@@ -72,6 +75,7 @@ export class ServiceDependenciesEditorComponent implements OnInit {
selectedProperty: PropertyFEModel;
selectedSourceType: string;
componentInstanceMap: Map<string, InstanceFeDetails> = new Map<string, InstanceFeDetails>();
+ customToscaFunctions: Array<CustomToscaFunction>;
capabilityDropdownList: DropdownValue[] = [];
SOURCE_TYPES = {
@@ -79,7 +83,7 @@ export class ServiceDependenciesEditorComponent implements OnInit {
TOSCA_FUNCTION: {label: 'Tosca Function', value: SourceType.TOSCA_FUNCTION}
};
- constructor(private propertiesUtils: PropertiesUtils, private compositionService: CompositionService) {}
+ constructor(private propertiesUtils: PropertiesUtils, private compositionService: CompositionService, private topologyTemplateService: TopologyTemplateService) {}
ngOnInit(): void {
if (this.compositionService.componentInstances) {
@@ -89,6 +93,7 @@ export class ServiceDependenciesEditorComponent implements OnInit {
});
});
}
+ this.initCustomToscaFunctions();
this.initCapabilityDropdown();
this.initCurrentRule();
this.initConstraintOperatorOptions();
@@ -97,6 +102,14 @@ export class ServiceDependenciesEditorComponent implements OnInit {
this.syncRuleData();
}
+ private initCustomToscaFunctions() {
+ 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) {