summaryrefslogtreecommitdiffstats
path: root/ui-react/src/components/loop_viewer/svg/LoopComponentConverter.js
diff options
context:
space:
mode:
authorsebdet <sebastien.determe@intl.att.com>2019-07-18 15:23:13 +0200
committersebdet <sebastien.determe@intl.att.com>2019-07-18 15:23:58 +0200
commit5f6c178c3eaea6fffe7d46ca3c75dcb0ffa92755 (patch)
tree1712c36074719f4a8eaf3dd601b3cf29a88d685a /ui-react/src/components/loop_viewer/svg/LoopComponentConverter.js
parent0ce38c26f68efa97f7d16ec9bbba5888982d97ba (diff)
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 <sebastien.determe@intl.att.com>
Diffstat (limited to 'ui-react/src/components/loop_viewer/svg/LoopComponentConverter.js')
-rw-r--r--ui-react/src/components/loop_viewer/svg/LoopComponentConverter.js18
1 files changed, 18 insertions, 0 deletions
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 00000000..b737f3e1
--- /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