From f333557c8bf0a74eb7b88d6294dea2a420b1ec61 Mon Sep 17 00:00:00 2001 From: Aijana Schumann Date: Thu, 18 Feb 2021 10:55:11 +0100 Subject: Update NetworkMap and LinkCalculator Update NetworkMap and LinkCalculator to use the topology-server-v2 API, minior bugfixes for NetworkMap Issue-ID: CCSDK-3172 Signed-off-by: Aijana Schumann Change-Id: Ia5690c5039d7a9431443bc131fe398cc79d08287 --- .../apps/networkMapApp/src/handlers/detailsReducer.ts | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'sdnr/wt/odlux/apps/networkMapApp/src/handlers/detailsReducer.ts') diff --git a/sdnr/wt/odlux/apps/networkMapApp/src/handlers/detailsReducer.ts b/sdnr/wt/odlux/apps/networkMapApp/src/handlers/detailsReducer.ts index f573009bd..67e10e629 100644 --- a/sdnr/wt/odlux/apps/networkMapApp/src/handlers/detailsReducer.ts +++ b/sdnr/wt/odlux/apps/networkMapApp/src/handlers/detailsReducer.ts @@ -18,15 +18,15 @@ import { IActionHandler } from '../../../../framework/src/flux/action'; import { link } from "../model/link"; -import { site, Device } from "../model/site"; +import { Site, Device } from "../model/site"; import { HistoryEntry } from "../model/historyEntry"; -import { SelectSiteAction, SelectLinkAction, AddToHistoryAction, ClearHistoryAction, IsBusyCheckingDeviceListAction, FinishedLoadingDeviceListAction, ClearLoadedDevicesAction, ClearDetailsAction } from '../actions/detailsAction'; +import { SelectSiteAction, SelectLinkAction, AddToHistoryAction, ClearHistoryAction, IsBusyCheckingDeviceListAction, FinishedLoadingDeviceListAction, ClearLoadedDevicesAction, ClearDetailsAction, InitializeLoadedDevicesAction } from '../actions/detailsAction'; export type DetailsStoreState={ - data: site | link | null, + data: Site | link | null, history: HistoryEntry[], isBusyCheckingDeviceList: boolean, - checkedDevices: Device[] | null + checkedDevices: Device[] } @@ -34,7 +34,7 @@ const initialState: DetailsStoreState = { data: null, history:[], isBusyCheckingDeviceList: false, - checkedDevices: null + checkedDevices: [] } export const DetailsReducer:IActionHandler=(state = initialState, action)=>{ @@ -59,8 +59,10 @@ export const DetailsReducer:IActionHandler=(state = initialSt state = Object.assign({}, state, {checkedDevices: action.devices}); }else if(action instanceof ClearLoadedDevicesAction){ - state = Object.assign({}, state, {checkedDevices: null}); + state = Object.assign({}, state, {checkedDevices: []}); + }else if(action instanceof InitializeLoadedDevicesAction){ + state = Object.assign({}, state, {checkedDevices: action.devices}); } -- cgit 1.2.3-korg