From 3d6dd098db8ec243ca716a09fc55decbdd23b726 Mon Sep 17 00:00:00 2001 From: Herbert Eiselt Date: Wed, 3 Apr 2019 17:03:52 +0200 Subject: SDN-R Inventory export Add inventory export and search Change-Id: Ib9541cea9be1bd7628f5e89ba17a65439f98a5bf Issue-ID: SDNC-494 Signed-off-by: Herbert Eiselt --- .../src/handlers/inventoryAppRootHandler.ts | 27 ++++++++++++++++++++++ .../src/handlers/inventoryElementsHandler.tsx | 19 +++++++++++++++ 2 files changed, 46 insertions(+) create mode 100644 sdnr/wt/odlux/apps/inventoryApp/src/handlers/inventoryAppRootHandler.ts create mode 100644 sdnr/wt/odlux/apps/inventoryApp/src/handlers/inventoryElementsHandler.tsx (limited to 'sdnr/wt/odlux/apps/inventoryApp/src/handlers') diff --git a/sdnr/wt/odlux/apps/inventoryApp/src/handlers/inventoryAppRootHandler.ts b/sdnr/wt/odlux/apps/inventoryApp/src/handlers/inventoryAppRootHandler.ts new file mode 100644 index 000000000..6330e7e87 --- /dev/null +++ b/sdnr/wt/odlux/apps/inventoryApp/src/handlers/inventoryAppRootHandler.ts @@ -0,0 +1,27 @@ +// main state handler + +import { combineActionHandler } from '../../../../framework/src/flux/middleware'; + +// ** do not remove ** +import { IApplicationStoreState } from '../../../../framework/src/store/applicationStore'; +import { IActionHandler } from '../../../../framework/src/flux/action'; +import { IInventoryElementsState, inventoryElementsActionHandler } from './inventoryElementsHandler'; + + +export interface IInventoryAppStateState { + inventoryElements: IInventoryElementsState +} + + +declare module '../../../../framework/src/store/applicationStore' { + interface IApplicationStoreState { + inventory: IInventoryAppStateState; + } +} + +const actionHandlers = { + inventoryElements: inventoryElementsActionHandler +}; + +export const faultAppRootHandler = combineActionHandler(actionHandlers); +export default faultAppRootHandler; diff --git a/sdnr/wt/odlux/apps/inventoryApp/src/handlers/inventoryElementsHandler.tsx b/sdnr/wt/odlux/apps/inventoryApp/src/handlers/inventoryElementsHandler.tsx new file mode 100644 index 000000000..5673d1778 --- /dev/null +++ b/sdnr/wt/odlux/apps/inventoryApp/src/handlers/inventoryElementsHandler.tsx @@ -0,0 +1,19 @@ +import { createExternal,IExternalTableState } from '../../../../framework/src/components/material-table/utilities'; +import { createSearchDataHandler } from '../../../../framework/src/utilities/elasticSearch'; + +import { InventoryType } from '../models/inventory'; + +export interface IInventoryElementsState extends IExternalTableState { } + +// create eleactic search material data fetch handler +const inventoryElementsSearchHandler = createSearchDataHandler("sdnevents/inventoryequipment"); + +export const { + actionHandler: inventoryElementsActionHandler, + createActions: createInventoryElementsActions, + createProperties: createInventoryElementsProperties, + reloadAction: inventoryElementsReloadAction, + + // set value action, to change a value +} = createExternal(inventoryElementsSearchHandler, appState => appState.inventory.inventoryElements); + -- cgit 1.2.3-korg