diff options
Diffstat (limited to 'sdnr/wt/odlux/apps/faultApp/src/handlers/currentProblemsHandler.ts')
-rw-r--r-- | sdnr/wt/odlux/apps/faultApp/src/handlers/currentProblemsHandler.ts | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/sdnr/wt/odlux/apps/faultApp/src/handlers/currentProblemsHandler.ts b/sdnr/wt/odlux/apps/faultApp/src/handlers/currentProblemsHandler.ts new file mode 100644 index 000000000..6bbe2976f --- /dev/null +++ b/sdnr/wt/odlux/apps/faultApp/src/handlers/currentProblemsHandler.ts @@ -0,0 +1,24 @@ +import { createExternal,IExternalTableState } from '../../../../framework/src/components/material-table/utilities'; +import { createSearchDataHandler } from '../../../../framework/src/utilities/elasticSearch'; + +import { FaultResult, Fault } from '../models/fault'; + +export interface ICurrentProblemsState extends IExternalTableState<Fault> { } + +// create eleactic search material data fetch handler +const currentProblemsSearchHandler = createSearchDataHandler<FaultResult, Fault>( + 'sdnevents/faultcurrent', + null, + (hit) => ({ _id: hit._id, ...hit._source.faultCurrent }), + (name) => `faultCurrent.${name}` + ); + +export const { + actionHandler: currentProblemsActionHandler, + createActions: createCurrentProblemsActions, + createProperties: createCurrentProblemsProperties, + reloadAction: currentProblemsReloadAction, + + // set value action, to change a value +} = createExternal<Fault>(currentProblemsSearchHandler, appState => appState.faultApp.currentProblems); + |