From b3d4898d9e8452ea0b8d848c048e712d43b8d9a3 Mon Sep 17 00:00:00 2001 From: Michael Lando Date: Sun, 11 Jun 2017 14:22:02 +0300 Subject: [SDC-29] rebase continue work to align source Change-Id: I218f1c5ee23fb2c8314f1c70921d3ad8682c10f4 Signed-off-by: Michael Lando --- .../models/properties-inputs/property-be-model.ts | 25 +++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) (limited to 'catalog-ui/src/app/models/properties-inputs/property-be-model.ts') 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; + } + } + } -- cgit 1.2.3-korg