From 5f6c178c3eaea6fffe7d46ca3c75dcb0ffa92755 Mon Sep 17 00:00:00 2001 From: sebdet Date: Thu, 18 Jul 2019 15:23:13 +0200 Subject: Add generic svg selection Add a converter that maps each component to a dialog type, so that each component in the SVG can be mapped to a dialog if needed Issue-ID: CLAMP-423 Change-Id: I2dc2517048ffd911f70c64b07216aa988bcb4fe0 Signed-off-by: sebdet --- .../loop_viewer/svg/LoopComponentConverter.js | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 ui-react/src/components/loop_viewer/svg/LoopComponentConverter.js (limited to 'ui-react/src/components/loop_viewer/svg/LoopComponentConverter.js') diff --git a/ui-react/src/components/loop_viewer/svg/LoopComponentConverter.js b/ui-react/src/components/loop_viewer/svg/LoopComponentConverter.js new file mode 100644 index 000000000..b737f3e19 --- /dev/null +++ b/ui-react/src/components/loop_viewer/svg/LoopComponentConverter.js @@ -0,0 +1,18 @@ +export default class LoopComponentConverter { + + static buildMapOfComponents(loopCache) { + var componentsMap = new Map([]); + if (typeof (loopCache.getMicroServicePolicies()) !== "undefined") { + loopCache.getMicroServicePolicies().map(ms => { + componentsMap.set(ms.name, "/configurationPolicyModal/"+ms.name); + }) + } + if (typeof (loopCache.getOperationalPolicies()) !== "undefined") { + loopCache.getOperationalPolicies().map(op => { + componentsMap.set(op.name, "/operationalPolicyModal"); + }) + } + componentsMap.set("OperationalPolicy","/operationalPolicyModal"); + return componentsMap; + } +} \ No newline at end of file -- cgit 1.2.3-korg