aboutsummaryrefslogtreecommitdiffstats
path: root/catalog-ui/src/app/models
diff options
context:
space:
mode:
authorimamSidero <imam.hussain@est.tech>2023-04-12 16:02:46 +0100
committerMichael Morris <michael.morris@est.tech>2023-05-09 14:33:29 +0000
commita1ba3abf29613ee9e576a7c96a76ceb921086044 (patch)
treef3f9e4d9c98c6b5bc2d8aba1be01b327dd36b31d /catalog-ui/src/app/models
parent3bc3a5c724e9a6ea8a112dca72a9a3128eddca19 (diff)
Support for addition of INDEX token to tosca functions
Providing the capability to add the index token to th tosca function of all types Issue-ID: SDC-4472 Signed-off-by: Imam hussain <imam.hussain@est.tech> Change-Id: Ib7ac80f31710101f50de76bdb7c79abdc637cfe3
Diffstat (limited to 'catalog-ui/src/app/models')
-rw-r--r--catalog-ui/src/app/models/tosca-get-function.ts12
1 files changed, 7 insertions, 5 deletions
diff --git a/catalog-ui/src/app/models/tosca-get-function.ts b/catalog-ui/src/app/models/tosca-get-function.ts
index 7e6c5ad739..3bb207700b 100644
--- a/catalog-ui/src/app/models/tosca-get-function.ts
+++ b/catalog-ui/src/app/models/tosca-get-function.ts
@@ -34,7 +34,8 @@ export class ToscaGetFunction implements ToscaFunction, ToscaFunctionParameter {
sourceName: string;
functionType: ToscaGetFunctionType;
propertyPathFromSource: Array<string>;
- value: any
+ value: any;
+ toscaIndex: string;
constructor(toscaGetFunction?: ToscaGetFunction) {
if (!toscaGetFunction) {
@@ -48,6 +49,7 @@ export class ToscaGetFunction implements ToscaFunction, ToscaFunctionParameter {
this.sourceUniqueId = toscaGetFunction.sourceUniqueId;
this.sourceName = toscaGetFunction.sourceName;
this.functionType = toscaGetFunction.functionType;
+ this.toscaIndex = toscaGetFunction.toscaIndex;
if (toscaGetFunction.propertyPathFromSource) {
this.propertyPathFromSource = [...toscaGetFunction.propertyPathFromSource];
}
@@ -69,20 +71,20 @@ export class ToscaGetFunction implements ToscaFunction, ToscaFunctionParameter {
private buildGetInputFunctionValue(): Object {
if (this.propertyPathFromSource.length === 1) {
- return {[this.functionType.toLowerCase()]: this.propertyPathFromSource[0]};
+ return {[this.functionType.toLowerCase()]: [this.propertyPathFromSource[0], this.toscaIndex]};
}
- return {[this.functionType.toLowerCase()]: this.propertyPathFromSource};
+ return {[this.functionType.toLowerCase()]: [this.propertyPathFromSource, this.toscaIndex]};
}
private buildFunctionValueWithPropertySource(): Object {
if (this.propertySource == PropertySource.SELF) {
return {
- [this.functionType.toLowerCase()]: [PropertySource.SELF, ...this.propertyPathFromSource]
+ [this.functionType.toLowerCase()]: [PropertySource.SELF, ...this.propertyPathFromSource, this.toscaIndex]
};
}
if (this.propertySource == PropertySource.INSTANCE) {
return {
- [this.functionType.toLowerCase()]: [this.sourceName, ...this.propertyPathFromSource]
+ [this.functionType.toLowerCase()]: [this.sourceName, ...this.propertyPathFromSource,this.toscaIndex]
};
}
}