From c0ec0fc448af1c5d6eacb195e95938c921ba1bce Mon Sep 17 00:00:00 2001 From: sebdet Date: Mon, 18 May 2020 12:31:11 +0200 Subject: Create SVG in UI Remove the SVG generation from the backend and put it in the UI Issue-ID: CLAMP-854 Signed-off-by: sebdet Change-Id: Icfa9e107d83bb244ac3d87300d013555bfa0b037 --- ui-react/src/api/LoopCache.js | 27 +++++++++++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) (limited to 'ui-react/src/api/LoopCache.js') diff --git a/ui-react/src/api/LoopCache.js b/ui-react/src/api/LoopCache.js index 4f22dc2bb..3e19b4fc7 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; + } } -- cgit 1.2.3-korg