summaryrefslogtreecommitdiffstats
path: root/catalog-ui/src/app/models/tosca-get-function.ts
diff options
context:
space:
mode:
authorfranciscovila <javier.paradela.vila@est.tech>2023-03-21 16:54:46 +0000
committerMichael Morris <michael.morris@est.tech>2023-05-25 09:26:35 +0000
commit468d0770593e167990df815e45cde717bd845d18 (patch)
treef4f6fd1838bdca5afa60295726acdd41de677980 /catalog-ui/src/app/models/tosca-get-function.ts
parent871b9813322801509a566b49a1cdcc65c052de29 (diff)
Support TOSCA functions in operation inputs
Issue-ID: SDC-4442 Signed-off-by: franciscovila <javier.paradela.vila@est.tech> Change-Id: I1e6135da6f41d512a7758d5494df12da874d7146
Diffstat (limited to 'catalog-ui/src/app/models/tosca-get-function.ts')
-rw-r--r--catalog-ui/src/app/models/tosca-get-function.ts20
1 files changed, 16 insertions, 4 deletions
diff --git a/catalog-ui/src/app/models/tosca-get-function.ts b/catalog-ui/src/app/models/tosca-get-function.ts
index 67d9b0a836..784c7ea407 100644
--- a/catalog-ui/src/app/models/tosca-get-function.ts
+++ b/catalog-ui/src/app/models/tosca-get-function.ts
@@ -71,22 +71,34 @@ export class ToscaGetFunction implements ToscaFunction, ToscaFunctionParameter {
private buildGetInputFunctionValue(): Object {
if (this.propertyPathFromSource.length === 1) {
- return {[this.functionType.toLowerCase()]: [this.propertyPathFromSource[0], this.toscaIndexList]};
+ if (this.toscaIndexList) {
+ return {[this.functionType.toLowerCase()]: [this.propertyPathFromSource[0], this.toscaIndexList]};
+ }
+ return {[this.functionType.toLowerCase()]: [this.propertyPathFromSource[0]]};
}
return {[this.functionType.toLowerCase()]: [this.propertyPathFromSource, this.toscaIndexList]};
}
private buildFunctionValueWithPropertySource(): Object {
if (this.propertySource == PropertySource.SELF) {
+ if (this.toscaIndexList) {
+ return {
+ [this.functionType.toLowerCase()]: [PropertySource.SELF, ...this.propertyPathFromSource, this.toscaIndexList]
+ };
+ }
return {
- [this.functionType.toLowerCase()]: [PropertySource.SELF, ...this.propertyPathFromSource, this.toscaIndexList]
+ [this.functionType.toLowerCase()]: [PropertySource.SELF, ...this.propertyPathFromSource]
};
}
if (this.propertySource == PropertySource.INSTANCE) {
+ if (this.toscaIndexList) {
+ return {
+ [this.functionType.toLowerCase()]: [this.sourceName, ...this.propertyPathFromSource, this.toscaIndexList]
+ };
+ }
return {
- [this.functionType.toLowerCase()]: [this.sourceName, ...this.propertyPathFromSource,this.toscaIndexList]
+ [this.functionType.toLowerCase()]: [this.sourceName, ...this.propertyPathFromSource]
};
}
}
-
} \ No newline at end of file