3 import { combineActionHandler } from '../../../../framework/src/flux/middleware';
6 import { IApplicationStoreState } from '../../../../framework/src/store/applicationStore';
7 import { IActionHandler } from '../../../../framework/src/flux/action';
9 import { IFaultNotifications, faultNotificationsHandler } from './notificationsHandler';
10 import { ICurrentProblemsState, currentProblemsActionHandler } from './currentProblemsHandler';
11 import { IAlarmLogEntriesState, alarmLogEntriesActionHandler } from './alarmLogEntriesHandler';
12 import { SetPanelAction } from '../actions/panelChangeActions';
14 export interface IFaultAppStoreState {
15 currentProblems: ICurrentProblemsState;
16 faultNotifications: IFaultNotifications;
17 alarmLogEntries: IAlarmLogEntriesState;
18 currentOpenPanel: string|null;
21 const currentOpenPanelHandler: IActionHandler<string | null> = (state = null, action) => {
22 if (action instanceof SetPanelAction) {
23 state = action.panelId;
28 declare module '../../../../framework/src/store/applicationStore' {
29 interface IApplicationStoreState {
30 fault: IFaultAppStoreState;
34 const actionHandlers = {
35 currentProblems: currentProblemsActionHandler,
36 faultNotifications: faultNotificationsHandler,
37 alarmLogEntries: alarmLogEntriesActionHandler,
38 currentOpenPanel: currentOpenPanelHandler
41 export const faultAppRootHandler = combineActionHandler<IFaultAppStoreState>(actionHandlers);
42 export default faultAppRootHandler;