summaryrefslogtreecommitdiffstats
path: root/sdnr/wt/odlux/apps/faultApp/src/pluginFault.tsx
diff options
context:
space:
mode:
authorAijana Schumann <aijana.schumann@highstreet-technologies.com>2021-05-19 11:21:26 +0200
committerAijana Schumann <aijana.schumann@highstreet-technologies.com>2021-05-19 11:21:26 +0200
commit6a7fab9a12eebe7fd902c9e04f516fa9c1ae5820 (patch)
tree065888e5dd135318b99d5ca91a95f0f8284deb5e /sdnr/wt/odlux/apps/faultApp/src/pluginFault.tsx
parentcaaf7cf0edd7c605c9d57c0470806d2a13ebe773 (diff)
FaultApp bugfixes
Fix alarm notifications not displayed, too many data-provider requests Issue-ID: CCSDK-3310 Signed-off-by: Aijana Schumann <aijana.schumann@highstreet-technologies.com> Change-Id: I5f5433c8aed9d7c00d33cea5d3ee7ea7c01d0d03
Diffstat (limited to 'sdnr/wt/odlux/apps/faultApp/src/pluginFault.tsx')
-rw-r--r--sdnr/wt/odlux/apps/faultApp/src/pluginFault.tsx26
1 files changed, 13 insertions, 13 deletions
diff --git a/sdnr/wt/odlux/apps/faultApp/src/pluginFault.tsx b/sdnr/wt/odlux/apps/faultApp/src/pluginFault.tsx
index 2056976d9..bf96fe38d 100644
--- a/sdnr/wt/odlux/apps/faultApp/src/pluginFault.tsx
+++ b/sdnr/wt/odlux/apps/faultApp/src/pluginFault.tsx
@@ -31,7 +31,7 @@ import { IApplicationStoreState } from "../../../framework/src/store/application
import { faultAppRootHandler } from './handlers/faultAppRootHandler';
import { FaultApplication } from "./views/faultApplication";
-import { FaultAlarmNotification } from "./models/fault";
+import { FaultAlarmNotificationWS } from "./models/fault";
import { PanelId } from "./models/panelId";
import { SetPanelAction } from "./actions/panelChangeActions";
@@ -40,7 +40,6 @@ import { AddFaultNotificationAction } from "./actions/notificationActions";
import { createCurrentProblemsProperties, createCurrentProblemsActions, currentProblemsReloadAction } from "./handlers/currentProblemsHandler";
import { FaultStatus } from "./components/faultStatus";
import { refreshFaultStatusAsyncAction } from "./actions/statusActions";
-import { alarmLogEntriesReloadAction } from "./handlers/alarmLogEntriesHandler";
let currentMountId: string | undefined = undefined;
@@ -93,20 +92,21 @@ export function register() {
menuEntry: "Fault"
});
+ let counter = 0;
// subscribe to the websocket notifications
- subscribe<FaultAlarmNotification & IFormatedMessage>("ProblemNotification", (fault => {
+ subscribe<FaultAlarmNotificationWS & IFormatedMessage>("problem-notification", (fault => {
const store = applicationApi && applicationApi.applicationStore;
if (fault && store) {
- store.dispatch(new AddFaultNotificationAction(fault));
-
- // reload fault data if the view is displayed
- if (store.state.fault.listenForPartialUpdates) {
- if (store.state.fault.currentOpenPanel === "AlarmLog") {
- store.dispatch(alarmLogEntriesReloadAction);
- } else if (store.state.fault.currentOpenPanel === "CurrentProblem") {
- store.dispatch(currentProblemsReloadAction);
- }
- }
+
+ store.dispatch(new AddFaultNotificationAction({
+ id: String(counter++),
+ nodeName: fault["node-id"],
+ counter: +fault.data.counter,
+ objectId: fault.data["object-id-ref"],
+ problem: fault.data.problem,
+ severity: fault.data.severity || '',
+ timeStamp: fault.data["time-stamp"],
+ }));
}
}));