diff options
author | Tal Gitelman <tg851x@intl.att.com> | 2017-07-03 20:16:55 +0300 |
---|---|---|
committer | Tal Gitelman <tg851x@intl.att.com> | 2017-07-03 20:16:55 +0300 |
commit | 153a35821f0d25ce23cca467b76c5a7c5092c744 (patch) | |
tree | 0c66c4d1310019479e446ea3a4c26faffb0aa33f /catalog-ui/src/app/models/properties-inputs/input-fe-model.ts | |
parent | ffdda7d685029d6a88ac82ac637e43bba96423cb (diff) |
[sdc] - last merges before moving to LF
Change-Id: I0df3ec795f0de84229ea4bb4806ec8f959243557
Signed-off-by: Tal Gitelman <tg851x@intl.att.com>
Diffstat (limited to 'catalog-ui/src/app/models/properties-inputs/input-fe-model.ts')
-rw-r--r-- | catalog-ui/src/app/models/properties-inputs/input-fe-model.ts | 39 |
1 files changed, 8 insertions, 31 deletions
diff --git a/catalog-ui/src/app/models/properties-inputs/input-fe-model.ts b/catalog-ui/src/app/models/properties-inputs/input-fe-model.ts index 3af4431b55..f79a7e6317 100644 --- a/catalog-ui/src/app/models/properties-inputs/input-fe-model.ts +++ b/catalog-ui/src/app/models/properties-inputs/input-fe-model.ts @@ -5,42 +5,19 @@ import {InputBEModel} from "./input-be-model"; export class InputFEModel extends InputBEModel { isSimpleType: boolean; - relatedProperty: SimpleRelatedProperty; + relatedPropertyValue: any; + relatedPropertyName: string; constructor(input?: InputBEModel) { super(input); if (input) { this.isSimpleType = PROPERTY_DATA.SIMPLE_TYPES.indexOf(this.type) > -1; - this.relatedProperty = new SimpleRelatedProperty(input); + let relatedProperty = input.properties && input.properties[0] || input.inputs && input.inputs[0]; + if (relatedProperty) { + this.relatedPropertyValue = relatedProperty.value; + this.relatedPropertyName = relatedProperty.name; + } } } -} - -export class SimpleRelatedProperty { - name: string; - value: string; - nestedPath: string; - - constructor(input: InputBEModel) { - if(!input.instanceUniqueId){ - return; - } - //Check if input is on DerivedFEProperty level, in which case we want to set a nested path - let instanceName = input.instanceUniqueId.split('.').pop(); - if (input.inputPath && input.inputPath.indexOf('#') > -1 - && instanceName + "_" + input.inputPath.split('#').join('_') == input.name) { //Ignore inputPath for a complex child on VL that was declared within VF, that was then dragged into service. For that case, input.name will be missing the vl name, so we'll know to ignore the path and fall into else case. - this.nestedPath = input.inputPath; - this.name = input.inputPath.substring(0, input.inputPath.indexOf('#')); - } else { //PropertyFEModel level. Can parse input name to get prop name. - let propNameLength = input.name.length - instanceName.length + 1; - this.name = input.name.substr(instanceName.length + 1, propNameLength); - } - - //In declare response, input contains nested property, and we need to extract value so we can update our prop. - let nestedProperty = input.properties && input.properties[0] || input.inputs && input.inputs[0]; - if (nestedProperty) { - this.value = nestedProperty.value; - } - } -}; +}
\ No newline at end of file |