From ce78a6683ab8648ed90e944cd23ed7c01205fce6 Mon Sep 17 00:00:00 2001 From: Aijana Schumann Date: Fri, 13 Mar 2020 10:39:11 +0100 Subject: Fix odlux bugs Fix help and about app not scrollable Fix filter hiding and showing without user interaction and default sort in all tables Issue-ID: SDNC-1117 Signed-off-by: Aijana Schumann Change-Id: I5c6ff86c73a3b222a8d9022125454788496f6399 --- .../src/views/networkElementSelector.tsx | 9 ++++- .../src/components/connectionStatusLog.tsx | 12 ++++++ .../connectApp/src/components/networkElements.tsx | 9 ++++- .../apps/connectApp/src/views/connectView.tsx | 4 +- .../odlux/apps/eventLogApp/src/views/eventLog.tsx | 11 +++++- .../faultApp/src/actions/partialUpdatesAction.ts | 25 +++++++++++++ .../faultApp/src/handlers/faultAppRootHandler.ts | 24 +++++++----- sdnr/wt/odlux/apps/faultApp/src/pluginFault.tsx | 20 ++++++---- .../apps/faultApp/src/views/faultApplication.tsx | 43 ++++++++++++---------- .../apps/helpApp/src/views/helpApplication.tsx | 18 ++++++++- .../maintenanceApp/src/views/maintenenceView.tsx | 15 ++++++-- .../mediatorApp/src/views/mediatorApplication.tsx | 2 +- .../src/views/mediatorServerSelection.tsx | 10 ++++- 13 files changed, 152 insertions(+), 50 deletions(-) create mode 100644 sdnr/wt/odlux/apps/faultApp/src/actions/partialUpdatesAction.ts (limited to 'sdnr/wt/odlux/apps') diff --git a/sdnr/wt/odlux/apps/configurationApp/src/views/networkElementSelector.tsx b/sdnr/wt/odlux/apps/configurationApp/src/views/networkElementSelector.tsx index c153ed5a1..503133b0f 100644 --- a/sdnr/wt/odlux/apps/configurationApp/src/views/networkElementSelector.tsx +++ b/sdnr/wt/odlux/apps/configurationApp/src/views/networkElementSelector.tsx @@ -39,10 +39,17 @@ const ConnectedElementTable = MaterialTable as MaterialTableCtorType; +let initialSorted = false; + class NetworkElementSelectorComponent extends React.Component { componentDidMount() { - this.props.connectedNetworkElementsActions.onRefresh(); + + if (!initialSorted) { + initialSorted = true; + this.props.connectedNetworkElementsActions.onHandleRequestSort("node-id"); + } else + this.props.connectedNetworkElementsActions.onRefresh(); } render() { diff --git a/sdnr/wt/odlux/apps/connectApp/src/components/connectionStatusLog.tsx b/sdnr/wt/odlux/apps/connectApp/src/components/connectionStatusLog.tsx index ad7b247b0..96f6c8a6b 100644 --- a/sdnr/wt/odlux/apps/connectApp/src/components/connectionStatusLog.tsx +++ b/sdnr/wt/odlux/apps/connectApp/src/components/connectionStatusLog.tsx @@ -35,6 +35,9 @@ const ConnectionStatusTable = MaterialTable as MaterialTableCtorType; +let initialSorted = false; + + class ConnectionStatusLogComponent extends React.Component { render(): JSX.Element { return ( @@ -46,6 +49,15 @@ class ConnectionStatusLogComponent extends React.Component ); }; + + componentDidMount() { + if (!initialSorted) { + initialSorted = true; + this.props.connectionStatusLogActions.onHandleExplicitRequestSort("timestamp", "desc"); + } else { + this.props.connectionStatusLogActions.onRefresh(); + } + } } export const ConnectionStatusLog = connect(mapProps, mapDispatch)(ConnectionStatusLogComponent); diff --git a/sdnr/wt/odlux/apps/connectApp/src/components/networkElements.tsx b/sdnr/wt/odlux/apps/connectApp/src/components/networkElements.tsx index d50a81ed5..53e10481a 100644 --- a/sdnr/wt/odlux/apps/connectApp/src/components/networkElements.tsx +++ b/sdnr/wt/odlux/apps/connectApp/src/components/networkElements.tsx @@ -83,7 +83,7 @@ type NetworkElementsListComponentState = { } const emptyRequireNetworkElement: NetworkElementConnection = { id: "", nodeId: "", host: "", port: 0, status: "Disconnected", isRequired: false }; - +let initialSorted = false; const NetworkElementTable = MaterialTable as MaterialTableCtorType; export class NetworkElementsListComponent extends React.Component { @@ -173,7 +173,12 @@ export class NetworkElementsListComponent extends React.Component, element: NetworkElementConnection) => { diff --git a/sdnr/wt/odlux/apps/connectApp/src/views/connectView.tsx b/sdnr/wt/odlux/apps/connectApp/src/views/connectView.tsx index a96d3d635..a7feae923 100644 --- a/sdnr/wt/odlux/apps/connectApp/src/views/connectView.tsx +++ b/sdnr/wt/odlux/apps/connectApp/src/views/connectView.tsx @@ -61,8 +61,8 @@ class ConnectApplicationComponent extends React.Component { diff --git a/sdnr/wt/odlux/apps/eventLogApp/src/views/eventLog.tsx b/sdnr/wt/odlux/apps/eventLogApp/src/views/eventLog.tsx index 5993bb5c4..aa9027206 100644 --- a/sdnr/wt/odlux/apps/eventLogApp/src/views/eventLog.tsx +++ b/sdnr/wt/odlux/apps/eventLogApp/src/views/eventLog.tsx @@ -35,6 +35,8 @@ const mapDispatch = (dispatcher: IDispatcher) => ({ eventLogActions: createEventLogActions(dispatcher.dispatch) }); +let initalSorted = false; + class EventLogComponent extends React.Component> { render() { return = (state = panelInitState, action) => { +const currentOpenPanelHandler: IActionHandler = (state = null, action) => { if (action instanceof SetPanelAction) { - state = { ...state, openPanel: action.panelId }; - } else if (action instanceof RememberCurrentPanelAction) { - state = { ...state, savedPanel: action.panelId }; + state = action.panelId; + } + return state; +} + +const arePartialUpdatesActiveHandler: IActionHandler = (state = false, action) => { + if (action instanceof SetPartialUpdatesAction) { + state = action.isActive; } return state; } @@ -62,7 +67,8 @@ const actionHandlers = { alarmLogEntries: alarmLogEntriesActionHandler, currentOpenPanel: currentOpenPanelHandler, faultStatus: faultStatusHandler, - stuckAlarms: stuckAlarmHandler + stuckAlarms: stuckAlarmHandler, + listenForPartialUpdates: arePartialUpdatesActiveHandler }; export const faultAppRootHandler = combineActionHandler(actionHandlers); diff --git a/sdnr/wt/odlux/apps/faultApp/src/pluginFault.tsx b/sdnr/wt/odlux/apps/faultApp/src/pluginFault.tsx index 666667e40..2056976d9 100644 --- a/sdnr/wt/odlux/apps/faultApp/src/pluginFault.tsx +++ b/sdnr/wt/odlux/apps/faultApp/src/pluginFault.tsx @@ -62,8 +62,12 @@ const FaultApplicationRouteAdapter = connect(mapProps, mapDisp)((props: RouteCom if (currentMountId) { props.setCurrentPanel("CurrentProblem"); props.currentProblemsActions.onFilterChanged("nodeId", currentMountId); - props.currentProblemsProperties.showFilter; // || (props.currentProblemsActions.onToggleFilter()); - props.currentProblemsActions.onRefresh(); + if (!props.currentProblemsProperties.showFilter) { + props.currentProblemsActions.onToggleFilter(false); + props.currentProblemsActions.onRefresh(); + } + else + props.currentProblemsActions.onRefresh(); } }); } @@ -95,11 +99,13 @@ export function register() { if (fault && store) { store.dispatch(new AddFaultNotificationAction(fault)); - //reload fault data if tab is open - if (store.state.fault.currentOpenPanel.openPanel === "AlarmLog") { - store.dispatch(alarmLogEntriesReloadAction); - } else if (store.state.fault.currentOpenPanel.openPanel === "CurrentProblem") { - store.dispatch(currentProblemsReloadAction); + // reload fault data if the view is displayed + if (store.state.fault.listenForPartialUpdates) { + if (store.state.fault.currentOpenPanel === "AlarmLog") { + store.dispatch(alarmLogEntriesReloadAction); + } else if (store.state.fault.currentOpenPanel === "CurrentProblem") { + store.dispatch(currentProblemsReloadAction); + } } } })); diff --git a/sdnr/wt/odlux/apps/faultApp/src/views/faultApplication.tsx b/sdnr/wt/odlux/apps/faultApp/src/views/faultApplication.tsx index ed395d2e4..10721549c 100644 --- a/sdnr/wt/odlux/apps/faultApp/src/views/faultApplication.tsx +++ b/sdnr/wt/odlux/apps/faultApp/src/views/faultApplication.tsx @@ -33,14 +33,14 @@ import { PanelId } from '../models/panelId'; import { createCurrentProblemsProperties, createCurrentProblemsActions, currentProblemsReloadAction } from '../handlers/currentProblemsHandler'; import { createAlarmLogEntriesProperties, createAlarmLogEntriesActions, alarmLogEntriesReloadAction } from '../handlers/alarmLogEntriesHandler'; -import { setPanelAction, RememberCurrentPanelAction } from '../actions/panelChangeActions'; +import { setPanelAction } from '../actions/panelChangeActions'; import { Tooltip, IconButton, AppBar, Tabs, Tab } from '@material-ui/core'; import RefreshIcon from '@material-ui/icons/Refresh'; import ClearStuckAlarmsDialog, { ClearStuckAlarmsDialogMode } from '../components/clearStuckAlarmsDialog'; +import { SetPartialUpdatesAction } from '../actions/partialUpdatesAction'; const mapProps = (state: IApplicationStoreState) => ({ - panelId: state.fault.currentOpenPanel.openPanel, - savedPanel: state.fault.currentOpenPanel.savedPanel, + panelId: state.fault.currentOpenPanel, currentProblemsProperties: createCurrentProblemsProperties(state), faultNotifications: state.fault.faultNotifications, alarmLogEntriesProperties: createAlarmLogEntriesProperties(state) @@ -54,7 +54,7 @@ const mapDisp = (dispatcher: IDispatcher) => ({ switchActivePanel: (panelId: PanelId) => { dispatcher.dispatch(setPanelAction(panelId)); }, - rememberCurrentPanel: (panelId: PanelId) => dispatcher.dispatch(new RememberCurrentPanelAction(panelId)) + setPartialUpdates: (active: boolean) => dispatcher.dispatch(new SetPartialUpdatesAction(active)) }); type FaultApplicationComponentProps = RouteComponentProps & Connect; @@ -68,6 +68,8 @@ type FaultApplicationState = { const FaultTable = MaterialTable as MaterialTableCtorType; const FaultAlarmNotificationTable = MaterialTable as MaterialTableCtorType; +let currentProblemsInitalSorted = false; +let alarmLogInitialSorted = false; class FaultApplicationComponent extends React.Component{ @@ -97,10 +99,20 @@ class FaultApplicationComponent extends React.Component { return ( diff --git a/sdnr/wt/odlux/apps/helpApp/src/views/helpApplication.tsx b/sdnr/wt/odlux/apps/helpApp/src/views/helpApplication.tsx index b4de26d50..eab44b4ca 100644 --- a/sdnr/wt/odlux/apps/helpApp/src/views/helpApplication.tsx +++ b/sdnr/wt/odlux/apps/helpApp/src/views/helpApplication.tsx @@ -32,6 +32,18 @@ const mapProps = (state: IApplicationStoreState) => ({ currentPath: state.help.currentPath }); +const containerStyle = { + overflow: "auto", + height: "100%", + width: "100%" +}; + +const styles = { + maxWidth: "960px", + margin: "1.5em auto", + +}; + type HelpApplicationComponentProps = Connect; class HelpApplicationComponent extends React.Component { @@ -58,8 +70,10 @@ class HelpApplicationComponent extends React.Component +
+ +
) : (

Loading ...

) } diff --git a/sdnr/wt/odlux/apps/maintenanceApp/src/views/maintenenceView.tsx b/sdnr/wt/odlux/apps/maintenanceApp/src/views/maintenenceView.tsx index 350bac221..f087ed2e4 100644 --- a/sdnr/wt/odlux/apps/maintenanceApp/src/views/maintenenceView.tsx +++ b/sdnr/wt/odlux/apps/maintenanceApp/src/views/maintenenceView.tsx @@ -81,7 +81,9 @@ type MaintenenceViewComponentProps = Connect { @@ -148,8 +150,15 @@ class MaintenenceViewComponent extends React.Component, entry: MaintenenceEntry) => { diff --git a/sdnr/wt/odlux/apps/mediatorApp/src/views/mediatorApplication.tsx b/sdnr/wt/odlux/apps/mediatorApp/src/views/mediatorApplication.tsx index d422a0c3b..f96223297 100644 --- a/sdnr/wt/odlux/apps/mediatorApp/src/views/mediatorApplication.tsx +++ b/sdnr/wt/odlux/apps/mediatorApp/src/views/mediatorApplication.tsx @@ -161,7 +161,7 @@ class MediatorApplicationComponent extends React.Component rowData.pid ? (Running) : (Stopped) }, { property: "DeviceIp", title: "IP Adress", type: ColumnType.text }, diff --git a/sdnr/wt/odlux/apps/mediatorApp/src/views/mediatorServerSelection.tsx b/sdnr/wt/odlux/apps/mediatorApp/src/views/mediatorServerSelection.tsx index aaade65db..c16906ad0 100644 --- a/sdnr/wt/odlux/apps/mediatorApp/src/views/mediatorServerSelection.tsx +++ b/sdnr/wt/odlux/apps/mediatorApp/src/views/mediatorServerSelection.tsx @@ -70,6 +70,8 @@ type MediatorServerSelectionComponentState = { mediatorServerEditorMode: EditMediatorServerDialogMode } +let initialSorted = false; + class MediatorServerSelectionComponent extends React.Component { constructor(props: MediatorServerSelectionComponentProps) { @@ -116,7 +118,13 @@ class MediatorServerSelectionComponent extends React.Component, server: MediatorServer) => { -- cgit 1.2.3-korg