diff options
author | Michael Lando <ml636r@att.com> | 2017-07-17 21:12:03 +0300 |
---|---|---|
committer | Michael Lando <ml636r@att.com> | 2017-07-17 21:12:03 +0300 |
commit | 75aacbbe1acf78fa53378f07f0a8c7769449a17e (patch) | |
tree | 68a9799eb8f4704dd9a3d513401df9bb11af7739 /catalog-ui/src/app/view-models/forms | |
parent | dec02e7cc74e1c401be51bd9d266575e1e008f5f (diff) |
[SDC] rebase 1710 code
Change-Id: I532ed68979fee7840ea8a5395e7e965b155fb9f9
Signed-off-by: Michael Lando <ml636r@att.com>
Diffstat (limited to 'catalog-ui/src/app/view-models/forms')
2 files changed, 14 insertions, 1 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 8b9acbcab7..ee2e94f934 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 @@ -23,6 +23,7 @@ import { PROPERTY_TYPES, ModalsHandler, ValidationUtils, PROPERTY_VALUE_CONSTRAINTS, FormState, PROPERTY_DATA} from "app/utils"; import {DataTypesService} from "app/services"; import {PropertyModel, DataTypesMap, Component} from "app/models"; +import {ComponentInstance} from "../../../../models/componentsInstances/componentInstance"; export interface IEditPropertyModel { property:PropertyModel; @@ -50,6 +51,7 @@ interface IPropertyFormViewModelScope extends ng.IScope { isTypeDataType:boolean; maxLength:number; isPropertyValueOwner:boolean; + isVnfConfiguration:boolean; validateJson(json:string):boolean; save(doNotCloseModal?:boolean):void; @@ -192,6 +194,17 @@ export class PropertyFormViewModel { this.$scope.isPropertyValueOwner = this.isPropertyValueOwner; this.initEditPropertyModel(); + //check if property of VnfConfiguration + this.$scope.isVnfConfiguration = false; + if(angular.isArray(this.component.componentInstances)) { + var componentPropertyOwner:ComponentInstance = this.component.componentInstances.find((ci:ComponentInstance) => { + return ci.uniqueId === this.property.resourceInstanceUniqueId; + }); + if (componentPropertyOwner.componentName === 'vnfConfiguration') { + this.$scope.isVnfConfiguration = true; + } + } + this.$scope.nonPrimitiveTypes = _.filter(Object.keys(this.$scope.dataTypes), (type:string)=> { return this.$scope.editPropertyModel.types.indexOf(type) == -1; }); 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 f92d9a5ddc..743de298cd 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 @@ -142,7 +142,7 @@ schema-property="editPropertyModel.property.schema.property" parent-form-obj="forms.editForm" fields-prefix-name="currentPropertyIndex" - read-only="editPropertyModel.property.readonly && !isPropertyValueOwner" + read-only="(editPropertyModel.property.readonly && !isPropertyValueOwner) || isVnfConfiguration" default-value="{{getDefaultValue()}}" max-length="maxLength"></type-map> </div> |