From 889c7fbc0f78eadc302e8849ea7e6cad795e0d6e Mon Sep 17 00:00:00 2001 From: Aijana Schumann Date: Fri, 28 Feb 2020 15:15:26 +0100 Subject: update odlux stage 3 PerformanceApp: Add filter to chart view add scrolling header to tables, add basic validation to editNetworkElementDialog bugfixes Issue-ID: SDNC-1087 Signed-off-by: Aijana Schumann Change-Id: I585bd6cfeb11b867cd630e96e6479170d2f92fe8 --- .../src/handlers/availableLtpsActionHandler.ts | 34 ++++++++++++++- .../src/handlers/performanceHistoryRootHandler.ts | 48 ++++++++++++++++------ 2 files changed, 67 insertions(+), 15 deletions(-) (limited to 'sdnr/wt/odlux/apps/performanceHistoryApp/src/handlers') diff --git a/sdnr/wt/odlux/apps/performanceHistoryApp/src/handlers/availableLtpsActionHandler.ts b/sdnr/wt/odlux/apps/performanceHistoryApp/src/handlers/availableLtpsActionHandler.ts index fd137fe37..4605efdb0 100644 --- a/sdnr/wt/odlux/apps/performanceHistoryApp/src/handlers/availableLtpsActionHandler.ts +++ b/sdnr/wt/odlux/apps/performanceHistoryApp/src/handlers/availableLtpsActionHandler.ts @@ -21,6 +21,8 @@ import { AllAvailableLtpsLoadedAction, LoadAllAvailableLtpsAction, SetInitialLoadedAction, + NoLtpsFoundAction, + ResetLtpsAction, } from '../actions/ltpAction'; import { LtpIds } from '../models/availableLtps'; @@ -29,12 +31,14 @@ export interface IAvailableLtpsState { distinctLtps: LtpIds[]; busy: boolean; loadedOnce: boolean; + error: string | undefined; } const ltpListStateInit: IAvailableLtpsState = { distinctLtps: [], busy: false, - loadedOnce: false + loadedOnce: false, + error: undefined }; export const availableLtpsActionHandler: IActionHandler = (state = ltpListStateInit, action) => { @@ -51,8 +55,16 @@ export const availableLtpsActionHandler: IActionHandler = ( ...state, distinctLtps: action.availableLtps, busy: false, + error: undefined, loadedOnce: true }; + } else if (action.error) { + state = { + ...state, + busy: false, + loadedOnce: true, + error: action.error + } } } else if (action instanceof SetInitialLoadedAction) { @@ -60,7 +72,25 @@ export const availableLtpsActionHandler: IActionHandler = ( ...state, loadedOnce: action.initialLoaded }; - } else { + } else if (action instanceof NoLtpsFoundAction) { + state = { + ...state, + busy: false, + error: undefined, + loadedOnce: true, + distinctLtps: [] + } + } else if (action instanceof ResetLtpsAction) { + state = { + ...state, + busy: false, + error: undefined, + loadedOnce: false, + distinctLtps: [] + } + } + + else { state = { ...state, busy: false diff --git a/sdnr/wt/odlux/apps/performanceHistoryApp/src/handlers/performanceHistoryRootHandler.ts b/sdnr/wt/odlux/apps/performanceHistoryApp/src/handlers/performanceHistoryRootHandler.ts index e57f3860c..6b9081502 100644 --- a/sdnr/wt/odlux/apps/performanceHistoryApp/src/handlers/performanceHistoryRootHandler.ts +++ b/sdnr/wt/odlux/apps/performanceHistoryApp/src/handlers/performanceHistoryRootHandler.ts @@ -37,8 +37,8 @@ import { IAvailableLtpsState, availableLtpsActionHandler } from './availableLtps import { PmDataInterval } from '../models/performanceDataType'; import { TimeChangeAction } from '../actions/timeChangeAction'; import { UpdateMountId } from '../actions/deviceListActions'; -import { SetSubViewAction, ResetAllSubViewsAction } from '../actions/toggleActions'; -import { SubTabType } from '../models/toggleDataType'; +import { SetSubViewAction, ResetAllSubViewsAction, SetFilterVisibility } from '../actions/toggleActions'; +import { SubTabType, currentViewType } from '../models/toggleDataType'; export interface IPerformanceHistoryStoreState { nodeId: string; @@ -81,24 +81,46 @@ const currentPMDataIntervalHandler: IActionHandler = (state = Pm return state; } +type filterableSubview = { subView: SubTabType, isFilterVisible: boolean }; +type toggleViewDataType = { currentSubView: currentViewType, performanceData: filterableSubview, receiveLevel: filterableSubview, transmissionPower: filterableSubview, adaptiveModulation: filterableSubview, temperatur: filterableSubview, SINR: filterableSubview, CPD: filterableSubview }; -type toggleViewDataType = { performanceDataSelection: SubTabType, receiveLevelDataSelection: SubTabType, transmissionPower: SubTabType, adaptiveModulation: SubTabType, temperatur: SubTabType, SINR: SubTabType, CPD: SubTabType }; - -const toogleViewDataHandler: IActionHandler = (state = { performanceDataSelection: "chart", receiveLevelDataSelection: "chart", adaptiveModulation: "chart", transmissionPower: "chart", temperatur: "chart", SINR: "chart", CPD: "chart" }, action) => { +const toogleViewDataHandler: IActionHandler = (state = { currentSubView: "performanceData", performanceData: { subView: "chart", isFilterVisible: true }, receiveLevel: { subView: "chart", isFilterVisible: true }, adaptiveModulation: { subView: "chart", isFilterVisible: true }, transmissionPower: { subView: "chart", isFilterVisible: true }, temperatur: { subView: "chart", isFilterVisible: true }, SINR: { subView: "chart", isFilterVisible: true }, CPD: { subView: "chart", isFilterVisible: true } }, action) => { if (action instanceof SetSubViewAction) { switch (action.currentView) { - case "performanceData": state = { ...state, performanceDataSelection: action.selectedTab }; break; - case "adaptiveModulation": state = { ...state, adaptiveModulation: action.selectedTab }; break; - case "receiveLevel": state = { ...state, receiveLevelDataSelection: action.selectedTab }; break; - case "transmissionPower": state = { ...state, transmissionPower: action.selectedTab }; break; - case "Temp": state = { ...state, temperatur: action.selectedTab }; break; - case "SINR": state = { ...state, SINR: action.selectedTab }; break; - case "CPD": state = { ...state, CPD: action.selectedTab }; break; + case "performanceData": state = { ...state, performanceData: { ...state.performanceData, subView: action.selectedTab } }; break; + case "adaptiveModulation": state = { ...state, adaptiveModulation: { ...state.adaptiveModulation, subView: action.selectedTab } }; break; + case "receiveLevel": state = { ...state, receiveLevel: { ...state.receiveLevel, subView: action.selectedTab } }; break; + case "transmissionPower": state = { ...state, transmissionPower: { ...state.transmissionPower, subView: action.selectedTab } }; break; + case "Temp": state = { ...state, temperatur: { ...state.temperatur, subView: action.selectedTab } }; break; + case "SINR": state = { ...state, SINR: { ...state.SINR, subView: action.selectedTab } }; break; + case "CPD": state = { ...state, CPD: { ...state.CPD, subView: action.selectedTab } }; break; + } + } + else if (action instanceof SetFilterVisibility) { + switch (action.currentView) { + case "performanceData": state = { + ...state, performanceData: { ...state.performanceData, isFilterVisible: action.isVisible } + }; break; + case "adaptiveModulation": state = { ...state, adaptiveModulation: { ...state.performanceData, isFilterVisible: action.isVisible } }; break; + case "receiveLevel": state = { ...state, receiveLevel: { ...state.receiveLevel, isFilterVisible: action.isVisible } }; break; + case "transmissionPower": state = { ...state, transmissionPower: { ...state.transmissionPower, isFilterVisible: action.isVisible } }; break; + case "Temp": state = { ...state, temperatur: { ...state.temperatur, isFilterVisible: action.isVisible } }; break; + case "SINR": state = { ...state, SINR: { ...state.SINR, isFilterVisible: action.isVisible } }; break; + case "CPD": state = { ...state, CPD: { ...state.CPD, isFilterVisible: action.isVisible } }; break; } + } else if (action instanceof ResetAllSubViewsAction) { - state = { performanceDataSelection: "chart", adaptiveModulation: "chart", receiveLevelDataSelection: "chart", transmissionPower: "chart", temperatur: "chart", SINR: "chart", CPD: "chart" } + state = { + ...state, performanceData: { ...state.performanceData, subView: "chart" }, + adaptiveModulation: { ...state.adaptiveModulation, subView: "chart" }, + receiveLevel: { ...state.receiveLevel, subView: "chart" }, + transmissionPower: { ...state.transmissionPower, subView: "chart" }, + temperatur: { ...state.temperatur, subView: "chart" }, + SINR: { ...state.SINR, subView: "chart" }, + CPD: { ...state.CPD, subView: "chart" } + } } return state; -- cgit 1.2.3-korg