diff options
author | Aijana Schumann <aijana.schumann@highstreet-technologies.com> | 2021-07-06 16:01:10 +0200 |
---|---|---|
committer | Aijana Schumann <aijana.schumann@highstreet-technologies.com> | 2021-07-06 16:01:10 +0200 |
commit | 7152b77370d1989e4429ce37ec25b1e1baace0da (patch) | |
tree | 1c257a260cc85f05faba58c905a39b3a81dc12ed /sdnr/wt/odlux/apps/faultApp/src/pluginFault.tsx | |
parent | 6950b473ff100653cf726ce2c3f8fe54a8076cfa (diff) |
Add dashboard to odlux
Add connected element and fault info to home page
Issue-ID: CCSDK-3238
Signed-off-by: Aijana Schumann <aijana.schumann@highstreet-technologies.com>
Change-Id: Ia47442fd0877b721d25d9f97e3a19088df193439
Diffstat (limited to 'sdnr/wt/odlux/apps/faultApp/src/pluginFault.tsx')
-rw-r--r-- | sdnr/wt/odlux/apps/faultApp/src/pluginFault.tsx | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/sdnr/wt/odlux/apps/faultApp/src/pluginFault.tsx b/sdnr/wt/odlux/apps/faultApp/src/pluginFault.tsx index bf96fe38d..06299417d 100644 --- a/sdnr/wt/odlux/apps/faultApp/src/pluginFault.tsx +++ b/sdnr/wt/odlux/apps/faultApp/src/pluginFault.tsx @@ -42,6 +42,7 @@ import { FaultStatus } from "./components/faultStatus"; import { refreshFaultStatusAsyncAction } from "./actions/statusActions"; let currentMountId: string | undefined = undefined; +let currentSeverity: string | undefined = undefined; const mapProps = (state: IApplicationStoreState) => ({ currentProblemsProperties: createCurrentProblemsProperties(state), @@ -75,8 +76,30 @@ const FaultApplicationRouteAdapter = connect(mapProps, mapDisp)((props: RouteCom ) }); +const FaulttApplicationAlarmStatusRouteAdapter = connect(mapProps, mapDisp)((props: RouteComponentProps<{ severity?: string }> & Connect<typeof mapProps, typeof mapDisp>) => { + if (currentSeverity !== props.match.params.severity) { + currentSeverity = props.match.params.severity || undefined; + window.setTimeout(() => { + if (currentSeverity) { + props.setCurrentPanel("CurrentProblem"); + props.currentProblemsActions.onFilterChanged("severity", currentSeverity); + if (!props.currentProblemsProperties.showFilter) { + props.currentProblemsActions.onToggleFilter(false); + props.currentProblemsActions.onRefresh(); + } + else + props.currentProblemsActions.onRefresh(); + } + }); + } + return ( + <FaultApplication /> + ) +}); + const App = withRouter((props: RouteComponentProps) => ( <Switch> + <Route path={`${props.match.path}/alarmStatus/:severity?`} component={FaulttApplicationAlarmStatusRouteAdapter} /> <Route path={`${props.match.path}/:mountId?`} component={FaultApplicationRouteAdapter} /> <Redirect to={`${props.match.path}`} /> </Switch> |