From e3f5545168163fdbf0d83314ee9dd51983e4bcc8 Mon Sep 17 00:00:00 2001 From: imamSidero Date: Thu, 18 May 2023 17:56:32 +0100 Subject: Provide index token to tosca function for nested lists Index token capability is provided in tosca function for all nested levels of list and custom types Issue-ID: SDC-4505 Signed-off-by: Imam hussain Change-Id: If21c0078e0d17c44b5a31b00d6fac3e18ff6831d --- catalog-ui/src/app/models/tosca-get-function.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'catalog-ui/src/app/models') diff --git a/catalog-ui/src/app/models/tosca-get-function.ts b/catalog-ui/src/app/models/tosca-get-function.ts index 3bb207700b..67d9b0a836 100644 --- a/catalog-ui/src/app/models/tosca-get-function.ts +++ b/catalog-ui/src/app/models/tosca-get-function.ts @@ -35,7 +35,7 @@ export class ToscaGetFunction implements ToscaFunction, ToscaFunctionParameter { functionType: ToscaGetFunctionType; propertyPathFromSource: Array; value: any; - toscaIndex: string; + toscaIndexList: Array; constructor(toscaGetFunction?: ToscaGetFunction) { if (!toscaGetFunction) { @@ -49,7 +49,7 @@ export class ToscaGetFunction implements ToscaFunction, ToscaFunctionParameter { this.sourceUniqueId = toscaGetFunction.sourceUniqueId; this.sourceName = toscaGetFunction.sourceName; this.functionType = toscaGetFunction.functionType; - this.toscaIndex = toscaGetFunction.toscaIndex; + this.toscaIndexList = toscaGetFunction.toscaIndexList; if (toscaGetFunction.propertyPathFromSource) { this.propertyPathFromSource = [...toscaGetFunction.propertyPathFromSource]; } @@ -71,20 +71,20 @@ export class ToscaGetFunction implements ToscaFunction, ToscaFunctionParameter { private buildGetInputFunctionValue(): Object { if (this.propertyPathFromSource.length === 1) { - return {[this.functionType.toLowerCase()]: [this.propertyPathFromSource[0], this.toscaIndex]}; + return {[this.functionType.toLowerCase()]: [this.propertyPathFromSource[0], this.toscaIndexList]}; } - return {[this.functionType.toLowerCase()]: [this.propertyPathFromSource, this.toscaIndex]}; + return {[this.functionType.toLowerCase()]: [this.propertyPathFromSource, this.toscaIndexList]}; } private buildFunctionValueWithPropertySource(): Object { if (this.propertySource == PropertySource.SELF) { return { - [this.functionType.toLowerCase()]: [PropertySource.SELF, ...this.propertyPathFromSource, this.toscaIndex] + [this.functionType.toLowerCase()]: [PropertySource.SELF, ...this.propertyPathFromSource, this.toscaIndexList] }; } if (this.propertySource == PropertySource.INSTANCE) { return { - [this.functionType.toLowerCase()]: [this.sourceName, ...this.propertyPathFromSource,this.toscaIndex] + [this.functionType.toLowerCase()]: [this.sourceName, ...this.propertyPathFromSource,this.toscaIndexList] }; } } -- cgit 1.2.3-korg