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';
13 import { IFaultStatus, faultStatusHandler } from './faultStatusHandler';
15 export interface IFaultAppStoreState {
16 currentProblems: ICurrentProblemsState;
17 faultNotifications: IFaultNotifications;
18 alarmLogEntries: IAlarmLogEntriesState;
19 currentOpenPanel: string|null;
20 faultStatus: IFaultStatus;
23 const currentOpenPanelHandler: IActionHandler<string | null> = (state = null, action) => {
24 if (action instanceof SetPanelAction) {
25 state = action.panelId;
30 declare module '../../../../framework/src/store/applicationStore' {
31 interface IApplicationStoreState {
32 fault: IFaultAppStoreState;
36 const actionHandlers = {
37 currentProblems: currentProblemsActionHandler,
38 faultNotifications: faultNotificationsHandler,
39 alarmLogEntries: alarmLogEntriesActionHandler,
40 currentOpenPanel: currentOpenPanelHandler,
41 faultStatus: faultStatusHandler
44 export const faultAppRootHandler = combineActionHandler<IFaultAppStoreState>(actionHandlers);
45 export default faultAppRootHandler;