diff options
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 | 55 |
1 files changed, 27 insertions, 28 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 03c923c228..630374aac3 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 @@ -1,3 +1,23 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + import { SchemaPropertyGroupModel, SchemaProperty } from "../aschema-property"; import { PropertyBEModel } from "../../models"; import {PROPERTY_DATA} from "../../utils/constants"; @@ -5,40 +25,19 @@ import {InputBEModel} from "./input-be-model"; export class InputFEModel extends InputBEModel { isSimpleType: boolean; - isDataType: boolean; - instanceName: string; - instanceId: string; - propertyName: string; - + relatedPropertyValue: any; + relatedPropertyName: string; constructor(input?: InputBEModel) { super(input); if (input) { this.isSimpleType = PROPERTY_DATA.SIMPLE_TYPES.indexOf(this.type) > -1; - this.isDataType = PROPERTY_DATA.TYPES.indexOf(this.type) == -1; - - let propNameIndex:number = this.name.indexOf('_'); - this.instanceName = this.name.substring(0, propNameIndex); - - if(input.properties && input.properties.length){ - this.instanceId = input.properties[0].componentInstanceId; - this.propertyName = input.properties[0].name; - }else if(input.inputs && input.inputs.length){ - this.instanceId = input.inputs[0].componentInstanceId; - this.propertyName = input.inputs[0].name; - }else{ - if (input.inputPath) { - this.propertyName = input.inputPath.substring(0, input.inputPath.indexOf('#')) - } else { - this.propertyName = this.name.substring(propNameIndex + 1); - } + let relatedProperty = input.properties && input.properties[0] || input.inputs && input.inputs[0]; + if (relatedProperty) { + this.relatedPropertyValue = relatedProperty.value; + this.relatedPropertyName = relatedProperty.name; } } } - - - public toJSON = (): any => { - }; - -} +}
\ No newline at end of file |