summaryrefslogtreecommitdiffstats
path: root/ui-react/src/components/loop_viewer/svg/LoopComponentConverter.js
blob: 5b0dc1e01f8b1999efa6186139bd3fb23f33dd6d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
export default class LoopComponentConverter {

	static buildMapOfComponents(loopCache) {
		var componentsMap = new Map([]);
		if (typeof (loopCache.getMicroServicePolicies()) !== "undefined") {
			loopCache.getMicroServicePolicies().forEach(ms => {
				componentsMap.set(ms.name, "/policyModal/MICRO-SERVICE-POLICY/"+ms.name);
			})
		}
		if (typeof (loopCache.getOperationalPolicies()) !== "undefined") {
			loopCache.getOperationalPolicies().forEach(op => {
				if (op.name.includes("legacy")) {
					componentsMap.set(op.name,"/operationalPolicyModal");
				} else {
					componentsMap.set(op.name, "/policyModal/OPERATIONAL-POLICY/"+op.name);
				}
			})
		}
		return componentsMap;
	}
}