X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=ui-react%2Fsrc%2Fapi%2FLoopCache.js;h=3e19b4fc752d251333a8af918ef248c6f8276188;hb=c0ec0fc448af1c5d6eacb195e95938c921ba1bce;hp=5eaa79a64584a5ca17861f0ff766dd61011da435;hpb=2dd4e997c1ccf5dab4dfb7665ce74c0fd1f13e49;p=clamp.git diff --git a/ui-react/src/api/LoopCache.js b/ui-react/src/api/LoopCache.js index 5eaa79a6..3e19b4fc 100644 --- a/ui-react/src/api/LoopCache.js +++ b/ui-react/src/api/LoopCache.js @@ -70,10 +70,6 @@ export default class LoopCache { return this.loopJsonCache["name"]; } - getOperationalPolicyConfigurationJson() { - return this.loopJsonCache["operationalPolicies"]["0"]["configurationsJson"]; - } - getOperationalPolicyJsonSchema() { return this.loopJsonCache["operationalPolicies"]["0"]["jsonRepresentation"]; } @@ -223,4 +219,34 @@ export default class LoopCache { getComponentStates() { return this.loopJsonCache.components; } + + getTemplateName() { + 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; + } }