From c53d40dd69c956dabfd30eb7dcecad03151747fe Mon Sep 17 00:00:00 2001 From: JvD_Ericsson Date: Wed, 5 Oct 2022 14:54:09 +0100 Subject: Support viewing of VFC property details when checked in Issue-ID: SDC-4208 Signed-off-by: JvD_Ericsson Change-Id: I4c16ca4058716bfee6a52b37604a045ecabc975c --- catalog-ui/src/app/utils/modals-handler.ts | 7 +++++-- .../property-form-view-model.ts | 12 +++++++---- .../property-form-view.html | 24 +++++++++++----------- .../tabs/properties/properties-view-model.ts | 2 +- .../workspace/tabs/properties/properties-view.html | 3 +-- 5 files changed, 27 insertions(+), 21 deletions(-) (limited to 'catalog-ui/src/app') diff --git a/catalog-ui/src/app/utils/modals-handler.ts b/catalog-ui/src/app/utils/modals-handler.ts index 342f03f290..6813d53884 100644 --- a/catalog-ui/src/app/utils/modals-handler.ts +++ b/catalog-ui/src/app/utils/modals-handler.ts @@ -24,7 +24,7 @@ import { ComponentMetadata } from '../models/component-metadata'; export interface IModalsHandler { openEditPropertyModal(property: PropertyModel, component: Component, filteredProperties: PropertyModel[], isPropertyOwnValue: boolean, - propertyOwnerType: string, propertyOwnerId: string): ng.IPromise; + propertyOwnerType: string, propertyOwnerId: string, isViewOnly: boolean): ng.IPromise; } export class ModalsHandler implements IModalsHandler { @@ -67,7 +67,7 @@ export class ModalsHandler implements IModalsHandler { * @returns {IPromise} - Promise telling if the modal has opened or not */ openEditPropertyModal = (property: PropertyModel, component: Component | ComponentMetadata, filteredProperties: PropertyModel[], - isPropertyValueOwner: boolean, propertyOwnerType: string, propertyOwnerId: string): ng.IPromise => { + isPropertyValueOwner: boolean, propertyOwnerType: string, propertyOwnerId: string, isViewOnly: boolean = false): ng.IPromise => { const deferred = this.$q.defer(); const modalOptions: ng.ui.bootstrap.IModalSettings = { @@ -94,6 +94,9 @@ export class ModalsHandler implements IModalsHandler { }, propertyOwnerId: (): string => { return propertyOwnerId; + }, + isViewOnly: (): boolean => { + return isViewOnly; } } }; 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 17e82099ab..103b1341c0 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 @@ -62,6 +62,7 @@ interface IPropertyFormViewModelScope extends ng.IScope { dataTypes:DataTypesMap; isTypeDataType:boolean; maxLength:number; + isViewOnly:boolean; isPropertyValueOwner:boolean; isVnfConfiguration:boolean; constraints:string[]; @@ -101,6 +102,7 @@ export class PropertyFormViewModel { 'ModalServiceSdcUI', 'filteredProperties', '$timeout', + 'isViewOnly', 'isPropertyValueOwner', 'propertyOwnerType', 'propertyOwnerId', @@ -125,6 +127,7 @@ export class PropertyFormViewModel { private modalService:SdcUiServices.ModalService, private filteredProperties:Array, private $timeout:ng.ITimeoutService, + private isViewOnly:boolean, private isPropertyValueOwner:boolean, private propertyOwnerType:string, private propertyOwnerId:string, @@ -232,6 +235,7 @@ export class PropertyFormViewModel { private initScope = ():void => { //scope properties + this.$scope.isViewOnly = this.isViewOnly; this.$scope.isLoading = true; this.$scope.forms = {}; this.$scope.validationPattern = this.ValidationPattern; @@ -398,17 +402,17 @@ export class PropertyFormViewModel { this.$scope.$watch("forms.editForm.$invalid", (newVal) => { if (this.$scope.editPropertyModel.hasGetFunctionValue) { - this.$scope.footerButtons[0].disabled = newVal || !this.$scope.editPropertyModel.property.toscaFunction; + this.$scope.footerButtons[0].disabled = newVal || !this.$scope.editPropertyModel.property.toscaFunction || this.isViewOnly; } else { - this.$scope.footerButtons[0].disabled = newVal; + this.$scope.footerButtons[0].disabled = newVal || this.isViewOnly; } }); this.$scope.$watch("forms.editForm.$valid", (newVal) => { if (this.$scope.editPropertyModel.hasGetFunctionValue) { - this.$scope.footerButtons[0].disabled = !newVal || !this.$scope.editPropertyModel.property.toscaFunction; + this.$scope.footerButtons[0].disabled = !newVal || !this.$scope.editPropertyModel.property.toscaFunction || this.isViewOnly; } else { - this.$scope.footerButtons[0].disabled = !newVal; + this.$scope.footerButtons[0].disabled = !newVal || this.isViewOnly; } }); 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 67fce08311..a6fd69755a 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 @@ -13,11 +13,11 @@ ~ See the License for the specific language governing permissions and ~ limitations under the License. --> - +
- Delete + Delete Previous Next @@ -38,7 +38,7 @@ @@ -88,7 +88,7 @@