From 7be04e3e3bdc899c52ffea1f6e11731771903f93 Mon Sep 17 00:00:00 2001 From: "andre.schmid" Date: Mon, 25 Jul 2022 10:41:31 +0100 Subject: Centralize TOSCA function validation The validation happening in the component instance properties, should also be applied for the Group instance properties and Policy instance properties. Fixes some other problems related to the TOSCA function. Change-Id: I4b69da57a8444b78c72561f49146d32c6911482e Issue-ID: SDC-4114 Signed-off-by: andre.schmid --- .../component-property-form/property-form-view-model.ts | 5 +++-- .../property-forms/component-property-form/property-form-view.html | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) (limited to 'catalog-ui/src/app/view-models/forms') 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 5ea1106a8f..fbd9408ea8 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 @@ -32,6 +32,7 @@ import {Observable} from "rxjs"; import {TopologyTemplateService} from "app/ng2/services/component-services/topology-template.service"; 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"; export interface IEditPropertyModel { property:PropertyModel; @@ -457,8 +458,8 @@ export class PropertyFormViewModel { this.$scope.editPropertyModel.property.toscaFunction = toscaGetFunction; } - this.$scope.onGetFunctionValidityChange = (isValid): void => { - if (isValid.isValid) { + this.$scope.onToscaFunctionValidityChange = (validationEvent: ToscaFunctionValidationEvent): void => { + if (validationEvent.isValid) { this.$scope.editPropertyModel.isGetFunctionValid = true; return; } diff --git a/catalog-ui/src/app/view-models/forms/property-forms/component-property-form/property-form-view.html b/catalog-ui/src/app/view-models/forms/property-forms/component-property-form/property-form-view.html index cb46abee56..67fce08311 100644 --- a/catalog-ui/src/app/view-models/forms/property-forms/component-property-form/property-form-view.html +++ b/catalog-ui/src/app/view-models/forms/property-forms/component-property-form/property-form-view.html @@ -156,7 +156,7 @@ [component-instance-map]="componentInstanceMap" [allow-clear]="false" (on-valid-function)="onGetFunctionValidFunction($event)" - (on-validity-change)="onGetFunctionValidityChange($event)" + (on-validity-change)="onToscaFunctionValidityChange($event)" > -- cgit 1.2.3-korg