From d0fc4329aa47fa3fdcc3a9f3af31e977ad21b979 Mon Sep 17 00:00:00 2001 From: Aijana Schumann Date: Wed, 12 Feb 2020 09:08:39 +0100 Subject: Update odlux Fix scrolling and resizing bug in all tables, update the ui, minior bugfixes Issue-ID: SDNC-1067 Signed-off-by: Aijana Schumann Change-Id: I6322d5f612dcbc0c044b4b67ef3c73d6d2c90949 --- .../src/components/connectionStatusLog.tsx | 2 +- .../connectApp/src/components/networkElements.tsx | 87 ++++++++-------------- .../apps/connectApp/src/views/connectView.tsx | 43 +++++++---- 3 files changed, 61 insertions(+), 71 deletions(-) (limited to 'sdnr/wt/odlux/apps/connectApp/src') diff --git a/sdnr/wt/odlux/apps/connectApp/src/components/connectionStatusLog.tsx b/sdnr/wt/odlux/apps/connectApp/src/components/connectionStatusLog.tsx index 4e5ca65e1..ad7b247b0 100644 --- a/sdnr/wt/odlux/apps/connectApp/src/components/connectionStatusLog.tsx +++ b/sdnr/wt/odlux/apps/connectApp/src/components/connectionStatusLog.tsx @@ -38,7 +38,7 @@ type ConnectionStatusLogComponentProps = Connect { render(): JSX.Element { return ( - createStyles({ connectionStatusConnected: { @@ -68,6 +64,7 @@ const styles = (theme: Theme) => createStyles({ const mapProps = (state: IApplicationStoreState) => ({ networkElementsProperties: createNetworkElementsProperties(state), + applicationState: state, }); const mapDispatch = (dispatcher: IDispatcher) => ({ @@ -105,6 +102,7 @@ export class NetworkElementsListComponent extends React.Component { @@ -117,7 +115,7 @@ export class NetworkElementsListComponent extends React.Component - { - counter++; - return ( - <> -
- { - rowData.webUri && { console.log(rowData); window.open(rowData.webUri, "_blank") }}> - } - - this.onOpenMountdNetworkElementsDialog(event, rowData)} > - - - - this.onOpenUnmountdNetworkElementsDialog(event, rowData)} > - - - this.onOpenInfoNetworkElementDialog(event, rowData)} disabled={rowData.status === "Connecting" || rowData.status === "Disconnected"} > - - - this.onOpenEditNetworkElementDialog(event, rowData)} > - this.onOpenRemoveNetworkElementDialog(event, rowData)} > -
-
- -
-
- - - - - -
- - ) - } - }, - ]} idProperty="id" {...this.props.networkElementsActions} {...this.props.networkElementsProperties} asynchronus > + ]} idProperty="id" {...this.props.networkElementsActions} {...this.props.networkElementsProperties} asynchronus createContextMenu={rowData => { + return [ + this.onOpenMountdNetworkElementsDialog(event, rowData)} >Mount, + this.onOpenUnmountdNetworkElementsDialog(event, rowData)}>Unmount, + , + this.onOpenInfoNetworkElementDialog(event, rowData)} disabled={rowData.status === "Connecting" || rowData.status === "Disconnected"} >Info, + this.onOpenEditNetworkElementDialog(event, rowData)}>Edit, + !rowData.isRequired + ? this.onOpenAddNetworkElementDialog(event, rowData)} >Add + : this.onOpenRemoveNetworkElementDialog(event, rowData)} >Remove, + , + this.navigateToApplicationHandlerCreator("inventory", rowData)} disabled={rowData.status === "Connecting" || rowData.status === "Disconnected" || !inventory}>Inventory, + , + this.navigateToApplicationHandlerCreator("fault", rowData)} disabled={rowData.status === "Connecting" || rowData.status === "Disconnected" || !fault}>Fault, + this.navigateToApplicationHandlerCreator("configuration", rowData)} disabled={rowData.status === "Connecting" || rowData.status === "Disconnected" || !configuration}>Configure, + this.navigateToApplicationHandlerCreator("accounting", rowData)} disabled={true}>Accounting, + this.navigateToApplicationHandlerCreator("performanceHistory", rowData)} disabled={true}>Performance, + this.navigateToApplicationHandlerCreator("security", rowData)} disabled={true} >Security, + ]; + }} >
, element: NetworkElementConnection) => { + this.setState({ + networkElementToEdit: element, + networkElementEditorMode: EditNetworkElementDialogMode.AddNewNetworkElement + }); + } + private onOpenRemoveNetworkElementDialog = (event: React.MouseEvent, element: NetworkElementConnection) => { this.setState({ networkElementToEdit: element, networkElementEditorMode: EditNetworkElementDialogMode.RemoveNetworkElement }); - event.preventDefault(); - event.stopPropagation(); } private onOpenEditNetworkElementDialog = (event: React.MouseEvent, element: NetworkElementConnection) => { @@ -203,8 +188,6 @@ export class NetworkElementsListComponent extends React.Component, element: NetworkElementConnection) => { @@ -212,8 +195,6 @@ export class NetworkElementsListComponent extends React.Component, element: NetworkElementConnection) => { @@ -221,8 +202,6 @@ export class NetworkElementsListComponent extends React.Component, element: NetworkElementConnection) => { @@ -231,8 +210,6 @@ export class NetworkElementsListComponent extends React.Component { @@ -250,8 +227,6 @@ export class NetworkElementsListComponent extends React.Component (event: React.MouseEvent) => { this.props.navigateToApplication(applicationName, element.nodeId); - event.preventDefault(); - event.stopPropagation(); } } diff --git a/sdnr/wt/odlux/apps/connectApp/src/views/connectView.tsx b/sdnr/wt/odlux/apps/connectApp/src/views/connectView.tsx index f8c0f3a82..a96d3d635 100644 --- a/sdnr/wt/odlux/apps/connectApp/src/views/connectView.tsx +++ b/sdnr/wt/odlux/apps/connectApp/src/views/connectView.tsx @@ -28,6 +28,7 @@ import { ConnectionStatusLog } from '../components/connectionStatusLog'; import { setPanelAction, findWebUrisForGuiCutThroughAsyncAction, SetWeburiSearchBusy } from '../actions/commonNetworkElementsActions'; import { PanelId } from '../models/panelId'; import { NetworkElementConnection } from 'models/networkElementConnection'; +import { AppBar, Tabs, Tab } from '@material-ui/core'; const mapProps = (state: IApplicationStoreState) => ({ panelId: state.connect.currentOpenPanel, @@ -56,7 +57,15 @@ type ConnectApplicationComponentProps = Connect{ - componentDidUpdate = async () => { + public componentDidMount() { + if (this.props.panelId === null) { //don't change tabs, if one is selected already + this.onTogglePanel("NetworkElements"); + } + this.props.networkElementsActions.onToggleFilter(); + this.props.connectionStatusLogActions.onToggleFilter(); + } + + public componentDidUpdate = async () => { // search for guicutthroughs after networkelements were found const networkElements = this.props.netWorkElements; @@ -66,7 +75,7 @@ class ConnectApplicationComponent extends React.Component { - const nextActivePanel = panelId === this.props.panelId ? null : panelId; + const nextActivePanel = panelId; this.props.switchActivePanel(nextActivePanel); switch (nextActivePanel) { @@ -86,25 +95,31 @@ class ConnectApplicationComponent extends React.Component, newValue: PanelId) => { + this.props.switchActivePanel(newValue); + } + render(): JSX.Element { - const { panelId } = this.props; + const { panelId: activePanelId } = this.props; return ( <> - - - - - - + + + + + + + {activePanelId === 'NetworkElements' + ? + : activePanelId === 'ConnectionStatusLog' + ? + : null} ); }; - public componentDidMount() { - this.onTogglePanel("NetworkElements"); - this.props.networkElementsActions.onToggleFilter(); - this.props.connectionStatusLogActions.onToggleFilter(); - } + + } export const ConnectApplication = (connect(mapProps, mapDispatcher)(ConnectApplicationComponent)); -- cgit 1.2.3-korg