diff options
author | KrupaNagabhushan <krupa.nagabhushan@est.tech> | 2021-01-12 13:41:59 +0000 |
---|---|---|
committer | Christophe Closset <christophe.closset@intl.att.com> | 2021-04-09 06:46:27 +0000 |
commit | 6d65fde29c1859a7099d91ed0e8911bcb1823a38 (patch) | |
tree | a570de61d7bc39ccfdc2590d4813c97c2d58c18a /catalog-ui/src/app/models | |
parent | 74f9a13c4211c5d75bbcff1ceb794bd060c6a49f (diff) |
Allow property to take its value from defined input list
Issue-ID: SDC-3547
Change-Id: Ic438e8f8943d0f1c656e386611b88b25f879e83b
Signed-off-by: KrupaNagabhushan <krupa.nagabhushan@est.tech>
Signed-off-by: andre.schmid <andre.schmid@est.tech>
Diffstat (limited to 'catalog-ui/src/app/models')
3 files changed, 40 insertions, 5 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 aea5707d89..bd65c3a70a 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 @@ -18,11 +18,12 @@ * ============LICENSE_END========================================================= */ -import { PROPERTY_DATA, PROPERTY_TYPES } from 'app/utils/constants'; -import { SchemaProperty, SchemaPropertyGroupModel } from '../schema-property'; -import { ToscaPresentationData } from '../tosca-presentation'; -import { PropertyInputDetail } from './property-input-detail'; -import { Metadata } from '../metadata'; +import {PROPERTY_DATA, PROPERTY_TYPES} from 'app/utils/constants'; +import {SchemaProperty, SchemaPropertyGroupModel} from '../schema-property'; +import {ToscaPresentationData} from '../tosca-presentation'; +import {PropertyInputDetail} from './property-input-detail'; +import {Metadata} from '../metadata'; +import {ToscaGetFunctionType} from "../tosca-get-function-type.enum"; export enum DerivedPropertyType { SIMPLE, @@ -65,6 +66,7 @@ export class PropertyBEModel { inputPath: string; toscaPresentation: ToscaPresentationData; metadata: Metadata; + toscaGetFunctionType: ToscaGetFunctionType; constructor(property?: PropertyBEModel) { if (property) { @@ -90,6 +92,7 @@ export class PropertyBEModel { this.getPolicyValues = property.getPolicyValues; this.inputPath = property.inputPath; this.metadata = property.metadata; + this.toscaGetFunctionType = property.toscaGetFunctionType; } if (!this.schema || !this.schema.property) { @@ -117,5 +120,12 @@ export class PropertyBEModel { return DerivedPropertyType.COMPLEX; } } + + /** + * Checks whether the property value is a tosca get function (e.g. get_input, get_property, get_attribute) + */ + public isToscaGetFunction(): boolean { + return this.toscaGetFunctionType != null; + } } diff --git a/catalog-ui/src/app/models/properties-inputs/property-input-detail.ts b/catalog-ui/src/app/models/properties-inputs/property-input-detail.ts index 8c1028c45b..38a14e607d 100644 --- a/catalog-ui/src/app/models/properties-inputs/property-input-detail.ts +++ b/catalog-ui/src/app/models/properties-inputs/property-input-detail.ts @@ -21,6 +21,7 @@ export class PropertyInputDetail { inputId: string; inputName: string; + inputType: string; inputPath: string; list: boolean; } diff --git a/catalog-ui/src/app/models/tosca-get-function-type.enum.ts b/catalog-ui/src/app/models/tosca-get-function-type.enum.ts new file mode 100644 index 0000000000..1ee4ae1eae --- /dev/null +++ b/catalog-ui/src/app/models/tosca-get-function-type.enum.ts @@ -0,0 +1,24 @@ +/* + * ============LICENSE_START======================================================= + * Copyright (C) 2021 Nordix Foundation + * ================================================================================ + * 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. + * + * SPDX-License-Identifier: Apache-2.0 + * ============LICENSE_END========================================================= + */ + +export enum ToscaGetFunctionType { + GET_INPUT = 'GET_INPUT', + GET_ATTRIBUTE = 'GET_ATTRIBUTE', + GET_PROPERTY = 'GET_PROPERTY' +} |