diff options
author | Michael Lando <ml636r@att.com> | 2017-06-11 14:22:02 +0300 |
---|---|---|
committer | Michael Lando <ml636r@att.com> | 2017-06-11 17:48:32 +0300 |
commit | b3d4898d9e8452ea0b8d848c048e712d43b8d9a3 (patch) | |
tree | 0609319203be13f6c29ccbe24cb39c9d64f90095 /catalog-ui/src/app/models/properties-inputs/property-be-model.ts | |
parent | af9929df75604ce407d0ca542b200630164e0ae6 (diff) |
[SDC-29] rebase continue work to align source
Change-Id: I218f1c5ee23fb2c8314f1c70921d3ad8682c10f4
Signed-off-by: Michael Lando <ml636r@att.com>
Diffstat (limited to 'catalog-ui/src/app/models/properties-inputs/property-be-model.ts')
-rw-r--r-- | catalog-ui/src/app/models/properties-inputs/property-be-model.ts | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/catalog-ui/src/app/models/properties-inputs/property-be-model.ts b/catalog-ui/src/app/models/properties-inputs/property-be-model.ts index a5279d0668..f5cd4094f5 100644 --- a/catalog-ui/src/app/models/properties-inputs/property-be-model.ts +++ b/catalog-ui/src/app/models/properties-inputs/property-be-model.ts @@ -1,4 +1,11 @@ import { SchemaPropertyGroupModel, SchemaProperty } from "../aschema-property"; +import { PROPERTY_DATA, PROPERTY_TYPES } from 'app/utils'; +export enum DerivedPropertyType { + SIMPLE, + LIST, + MAP, + COMPLEX +} export class PropertyBEModel { @@ -16,6 +23,7 @@ export class PropertyBEModel { definition: boolean; inputPath: string; propertiesName: string; + ownerId: string; input: PropertyBEModel; constructor(property?: PropertyBEModel, childProperty?:PropertyBEModel) { @@ -32,6 +40,7 @@ export class PropertyBEModel { this.uniqueId = property.uniqueId; this.value = property.value ? property.value : property.defaultValue; this.definition = property.definition; + this.ownerId = property.ownerId; if (property.inputPath) { this.inputPath = property.inputPath; } @@ -39,6 +48,8 @@ export class PropertyBEModel { if (childProperty) { this.input = childProperty; this.propertiesName = childProperty.propertiesName; + } else { + this.propertiesName = this.name; } if (!this.schema || !this.schema.property) { @@ -48,7 +59,7 @@ export class PropertyBEModel { } } - + public toJSON = (): any => { let temp = angular.copy(this); @@ -57,6 +68,18 @@ export class PropertyBEModel { return temp; }; + public getDerivedPropertyType = () => { + if (PROPERTY_DATA.SIMPLE_TYPES.indexOf(this.type) > -1) { + return DerivedPropertyType.SIMPLE; + } else if (this.type == PROPERTY_TYPES.LIST) { + return DerivedPropertyType.LIST; + } else if (this.type == PROPERTY_TYPES.MAP) { + return DerivedPropertyType.MAP; + } else { + return DerivedPropertyType.COMPLEX; + } + } + } |