summaryrefslogtreecommitdiffstats
path: root/catalog-ui/src/app/view-models/forms/property-forms/component-property-form/property-form-view-model.ts
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/view-models/forms/property-forms/component-property-form/property-form-view-model.ts
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/view-models/forms/property-forms/component-property-form/property-form-view-model.ts')
-rw-r--r--catalog-ui/src/app/view-models/forms/property-forms/component-property-form/property-form-view-model.ts13
1 files changed, 13 insertions, 0 deletions
diff --git a/catalog-ui/src/app/view-models/forms/property-forms/component-property-form/property-form-view-model.ts b/catalog-ui/src/app/view-models/forms/property-forms/component-property-form/property-form-view-model.ts
index 4b41e7ab25..39f008a688 100644
--- a/catalog-ui/src/app/view-models/forms/property-forms/component-property-form/property-form-view-model.ts
+++ b/catalog-ui/src/app/view-models/forms/property-forms/component-property-form/property-form-view-model.ts
@@ -34,6 +34,8 @@ import {TopologyTemplateService} from "app/ng2/services/component-services/topol
import {InstanceFeDetails} from "../../../../models/instance-fe-details";
import {ToscaGetFunction} from "../../../../models/tosca-get-function";
import {ToscaFunctionValidationEvent} from "../../../../ng2/pages/properties-assignment/tosca-function/tosca-function.component";
+import {CustomToscaFunction} from "../../../../models/default-custom-functions";
+import {ToscaFunctionType} from "../../../../models/tosca-function-type.enum";
export interface IEditPropertyModel {
property:PropertyModel;
@@ -56,6 +58,7 @@ interface IPropertyFormViewModelScope extends ng.IScope {
commentValidationPattern:RegExp;
editPropertyModel: IEditPropertyModel;
componentInstanceMap: Map<string, InstanceFeDetails>;
+ customToscaFunctions: Array<CustomToscaFunction>;
modalInstanceProperty:ng.ui.bootstrap.IModalServiceInstance;
currentPropertyIndex:number;
isLastProperty:boolean;
@@ -228,6 +231,15 @@ export class PropertyFormViewModel {
}
}
+ private initCustomToscaFunctions() {
+ this.$scope.customToscaFunctions = [];
+ this.topologyTemplateService.getDefaultCustomFunction().toPromise().then((data) => {
+ for (let customFunction of data) {
+ this.$scope.customToscaFunctions.push(new CustomToscaFunction(customFunction));
+ }
+ });
+ }
+
private initEmptyComplexValue(type: string): any {
switch (type) {
case PROPERTY_TYPES.MAP:
@@ -308,6 +320,7 @@ export class PropertyFormViewModel {
this.initResource();
this.initForNotSimpleType();
this.initComponentInstanceMap();
+ this.initCustomToscaFunctions();
this.$scope.validateJson = (json:string):boolean => {
if (!json) {