diff options
Diffstat (limited to 'catalog-ui/src/app/view-models')
2 files changed, 22 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; } 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 d7c2af5b6e..bd2126b369 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 @@ -263,6 +263,15 @@ </app-constraints> </ng-container> </div> + <div class="constraints-section i-sdc-form-item" data-ng-if="editPropertyModel.property.propertyView || editPropertyModel.property.metadata || !(isViewOnly || componentMetadata.isService)"> + <label class="i-sdc-form-label">Metadata</label> + <ng-container> + <app-property-metadata [property-metadata]="editPropertyModel.property.metadata" + [is-view-only]="editPropertyModel.property.propertyView? !editPropertyModel.property.propertyView : (isViewOnly || componentMetadata.isService)" + (on-property-metadata-change)="onPropertyMetadataChange($event)"> + </app-property-metadata> + </ng-container> + </div> <span class="w-sdc-form-note" data-ng-show="forms.editForm.$invalid && false" translate="LABEL_ALL_FIELDS_ARE_MANDATORY"></span> </form> </perfect-scrollbar> |