From 2c1f3727a703634cf62c63cfc4a3d4bb30fe2d9c Mon Sep 17 00:00:00 2001
From: Aijana Schumann <aijana.schumann@highstreet-technologies.com>
Date: Fri, 7 May 2021 13:56:52 +0200
Subject: Add customization of networkmap

Add customization capabilities to the networkmap

Issue-ID: CCSDK-2938
Signed-off-by: Aijana Schumann <aijana.schumann@highstreet-technologies.com>
Change-Id: Ibd3fe258d02939ea69b21de25569f20d9087f693
---
 .../apps/networkMapApp/src/pluginTransport.tsx     | 44 ++++++++++++++++++----
 1 file changed, 37 insertions(+), 7 deletions(-)

(limited to 'sdnr/wt/odlux/apps/networkMapApp/src/pluginTransport.tsx')

diff --git a/sdnr/wt/odlux/apps/networkMapApp/src/pluginTransport.tsx b/sdnr/wt/odlux/apps/networkMapApp/src/pluginTransport.tsx
index 3ce435f9b..e93368524 100644
--- a/sdnr/wt/odlux/apps/networkMapApp/src/pluginTransport.tsx
+++ b/sdnr/wt/odlux/apps/networkMapApp/src/pluginTransport.tsx
@@ -30,17 +30,46 @@ import applicationApi from "../../../framework/src/services/applicationApi";
 import { UpdateDetailsView } from "./actions/detailsAction";
 import { findSiteToAlarm } from "./actions/mapActions";
 import { URL_BASEPATH } from "./config";
+import { Redirect, Route, RouteComponentProps, Switch, withRouter } from "react-router-dom";
+import CustomizationView from "./components/customize/customizationView";
+import { getSettings } from "./actions/settingsAction";
+import connect, { Connect, IDispatcher } from "../../../framework/src/flux/connect";
+import { IApplicationStoreState } from "../../../framework/src/store/applicationStore";
 
-const App : React.SFC = (props) => {
-  return <MainView />
-};
+const mapProps = (state: IApplicationStoreState) => ({
+});
+
+const mapDisp = (dispatcher: IDispatcher) => ({
+  getSettings: () => dispatcher.dispatch(getSettings())
+
+});
+
+
+const NetworkRouterApp = withRouter(connect(mapProps, mapDisp)((props: RouteComponentProps & Connect<typeof mapProps, typeof mapDisp>) => {
+
+  React.useLayoutEffect(() => {
+    (async function waitFor() {
+      await  props.getSettings();
+    })();
+   
+  }, []);
+
+  //props.history.action = "POP";
+  return (
+    <Switch>
+      <Route path={`${props.match.path}/customize`} component={CustomizationView} />
+      <Route path={`${props.match.path}`} component={MainView} />
+      <Redirect to={`${props.match.path}`} />
+    </Switch>
+  )
+}));
 
 export function register() {
   applicationManager.registerApplication({
     name: URL_BASEPATH, // used as name of state as well
     icon: faMapMarked,
     rootActionHandler: networkmapRootHandler,
-    rootComponent: App,
+    rootComponent: NetworkRouterApp,
     menuEntry: "Network Map"
   });
 }
@@ -73,12 +102,13 @@ subscribe<ObjectNotification & IFormatedMessage>(["ObjectCreationNotification",
 }));
 */
 
+/*
 subscribe<FaultAlarmNotification & IFormatedMessage>("ProblemNotification", (fault => {
   const store = applicationApi && applicationApi.applicationStore;
   if (fault && store) {
-     store.dispatch(findSiteToAlarm(fault.nodeName));
+    store.dispatch(findSiteToAlarm(fault.nodeName));
+
 
-  
   }
-}));
+}));*/
 
-- 
cgit 1.2.3-korg

