aboutsummaryrefslogtreecommitdiffstats
path: root/catalog-ui/src
diff options
context:
space:
mode:
authorandre.schmid <andre.schmid@est.tech>2022-07-25 10:41:31 +0100
committerMichael Morris <michael.morris@est.tech>2022-07-29 20:09:49 +0000
commit7be04e3e3bdc899c52ffea1f6e11731771903f93 (patch)
treef18c4579d22587a8efd904b62d8d1878b2de8a2b /catalog-ui/src
parent3f9669fdae5f7c6cb1bfe34742df35dfe3a14aa7 (diff)
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 <andre.schmid@est.tech>
Diffstat (limited to 'catalog-ui/src')
-rw-r--r--catalog-ui/src/app/view-models/forms/property-forms/component-property-form/property-form-view-model.ts5
-rw-r--r--catalog-ui/src/app/view-models/forms/property-forms/component-property-form/property-form-view.html2
2 files changed, 4 insertions, 3 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 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)"
>
</tosca-function>
</div>