From e6d0d67fdbe3fc70c996c8df33bd65d3b151dfad Mon Sep 17 00:00:00 2001 From: herbert Date: Sat, 14 Dec 2019 01:05:47 +0100 Subject: update odlux and featureaggregator v2 update odlux and featureaggregator bundles Issue-ID: SDNC-1008 Signed-off-by: herbert Change-Id: I0018d7bfa3a0e6896c1b210b539a574af9808e22 Signed-off-by: herbert --- .../src/handlers/deviceDescriptionHandler.ts | 30 ++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 sdnr/wt/odlux/apps/configurationApp/src/handlers/deviceDescriptionHandler.ts (limited to 'sdnr/wt/odlux/apps/configurationApp/src/handlers/deviceDescriptionHandler.ts') diff --git a/sdnr/wt/odlux/apps/configurationApp/src/handlers/deviceDescriptionHandler.ts b/sdnr/wt/odlux/apps/configurationApp/src/handlers/deviceDescriptionHandler.ts new file mode 100644 index 000000000..3cc27aa95 --- /dev/null +++ b/sdnr/wt/odlux/apps/configurationApp/src/handlers/deviceDescriptionHandler.ts @@ -0,0 +1,30 @@ +import { Module } from "../models/yang"; +import { ViewSpecification } from "../models/uiModels"; +import { IActionHandler } from "../../../../framework/src/flux/action"; +import { UpdateDeviceDescription } from "../actions/deviceActions"; + +export interface IDeviceDescriptionState { + nodeId: string, + modules: { + [name: string]: Module + }, + views: ViewSpecification[], +} + +const deviceDescriptionStateInit: IDeviceDescriptionState = { + nodeId: "", + modules: {}, + views: [] +}; + +export const deviceDescriptionHandler: IActionHandler = (state = deviceDescriptionStateInit, action) => { + if (action instanceof UpdateDeviceDescription) { + state = { + ...state, + nodeId: action.nodeId, + modules: action.modules, + views: action.views + }; + } + return state; +}; -- cgit 1.2.3-korg