aboutsummaryrefslogtreecommitdiffstats
path: root/ui-react/src/api/LoopCache.js
diff options
context:
space:
mode:
authorXue Gao <xg353y@intl.att.com>2020-05-26 07:22:41 +0000
committerGerrit Code Review <gerrit@onap.org>2020-05-26 07:22:41 +0000
commit3521f1dd8b2447d5225c51acdf1472c4c94a3ed3 (patch)
tree28f5a6f0c94c499f71d28be043884ef5e1868ea6 /ui-react/src/api/LoopCache.js
parenta1668ebbcf5c010a495c56e78178a615f52c655b (diff)
parentc0ec0fc448af1c5d6eacb195e95938c921ba1bce (diff)
Merge "Create SVG in UI"
Diffstat (limited to 'ui-react/src/api/LoopCache.js')
-rw-r--r--ui-react/src/api/LoopCache.js27
1 files changed, 25 insertions, 2 deletions
diff --git a/ui-react/src/api/LoopCache.js b/ui-react/src/api/LoopCache.js
index 4f22dc2b..3e19b4fc 100644
--- a/ui-react/src/api/LoopCache.js
+++ b/ui-react/src/api/LoopCache.js
@@ -221,9 +221,32 @@ export default class LoopCache {
}
getTemplateName() {
- if (this.loopJsonCache["loopTemplate"] !== undefined) {
- return this.loopJsonCache["loopTemplate"].name;
+ if (this.getLoopTemplate() !== undefined) {
+ return this.getLoopTemplate().name;
}
return null;
}
+
+ getLoopTemplate() {
+ return this.loopJsonCache["loopTemplate"];
+ }
+
+ isOpenLoopTemplate() {
+ var loopTemplate = this.getLoopTemplate();
+ if(loopTemplate != null && loopTemplate["allowedLoopType"] === "OPEN") {
+ return true;
+ }
+ return false;
+ }
+
+ getAllLoopElementModels() {
+ var loopTemplate = this.getLoopTemplate();
+ var loopElementModels = [];
+ if(loopTemplate != null) {
+ for (var element of loopTemplate['loopElementModelsUsed']) {
+ loopElementModels.push(element['loopElementModel'])
+ }
+ }
+ return loopElementModels;
+ }
}