diff options
author | JvD_Ericsson <jeff.van.dam@est.tech> | 2023-07-06 13:17:48 +0100 |
---|---|---|
committer | Michael Morris <michael.morris@est.tech> | 2023-07-13 15:05:06 +0000 |
commit | 825411a75557943e988d3601690cdf75c2bf0588 (patch) | |
tree | 76fcb694b9f224cb7138c4d25912b7ed8b406a1c /catalog-ui/src/app/view-models | |
parent | 7b8acdf5b70fdcda448fa1ae871df0e0723f08db (diff) |
UI support for metadata when editing properties of VFCs
Issue-ID: SDC-4561
Signed-off-by: JvD_Ericsson <jeff.van.dam@est.tech>
Change-Id: I642fa4ce09fe669e5722dbbf18dd23daa23761d3
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> |