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:
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 0be5193298..faf2a0fb88 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
@@ -537,6 +537,19 @@ export class PropertyFormViewModel {
this.$scope.editPropertyModel.property.constraints = constraints.constraints;
}
+ this.$scope.onPropertyMetadataChange = (metadata: any): void => {
+ if (!this.$scope.invalidMandatoryFields) {
+ this.$scope.footerButtons[0].disabled = !metadata.valid;
+ } else {
+ this.$scope.footerButtons[0].disabled = this.$scope.invalidMandatoryFields;
+ }
+ if (!metadata.metadata || metadata.metadata.length == 0) {
+ this.$scope.editPropertyModel.property.metadata = null;
+ return;
+ }
+ this.$scope.editPropertyModel.property.metadata = metadata.metadata;
+ }
+
this.$scope.onGetFunctionValidFunction = (toscaGetFunction: ToscaGetFunction): void => {
this.$scope.editPropertyModel.property.toscaFunction = toscaGetFunction;
}