From 21e4a946cd24b8a03ea577352f0271ebf7669ffa Mon Sep 17 00:00:00 2001 From: Michael DÜrre Date: Thu, 8 Apr 2021 07:27:18 +0200 Subject: update odlux for notification change MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit update due new notification protocol Issue-ID: CCSDK-3253 Signed-off-by: Michael DÜrre Change-Id: Iad65459fdc18603cd1ddbd97bb2211308744bd8b --- .../apps/inventoryApp/src/views/dashboard.tsx | 80 +++++++++++++++------- 1 file changed, 57 insertions(+), 23 deletions(-) (limited to 'sdnr/wt/odlux/apps/inventoryApp/src/views/dashboard.tsx') diff --git a/sdnr/wt/odlux/apps/inventoryApp/src/views/dashboard.tsx b/sdnr/wt/odlux/apps/inventoryApp/src/views/dashboard.tsx index f5ada22ab..11427fba9 100644 --- a/sdnr/wt/odlux/apps/inventoryApp/src/views/dashboard.tsx +++ b/sdnr/wt/odlux/apps/inventoryApp/src/views/dashboard.tsx @@ -23,6 +23,7 @@ import connect, { IDispatcher, Connect } from "../../../../framework/src/flux/co import { IApplicationStoreState } from "../../../../framework/src/store/applicationStore"; import { MaterialTable, MaterialTableCtorType, ColumnType } from "../../../../framework/src/components/material-table"; import { AppBar, Tabs, Tab, MenuItem, Typography } from "@material-ui/core"; +import Refresh from '@material-ui/icons/Refresh'; import { PanelId } from "../models/panelId"; import { setPanelAction } from "../actions/panelActions"; @@ -36,6 +37,7 @@ import { InventoryType } from '../models/inventory'; import { createInventoryElementsProperties, createInventoryElementsActions } from "../handlers/inventoryElementsHandler"; import { NavigateToApplication } from '../../../../framework/src/actions/navigationActions'; import { updateInventoryTreeAsyncAction } from '../actions/inventoryTreeActions'; +import RefreshInventoryDialog, { RefreshInventoryDialogMode } from '../components/refreshInventoryDialog'; const InventoryTable = MaterialTable as MaterialTableCtorType; @@ -49,7 +51,7 @@ const mapProps = (state: IApplicationStoreState) => ({ const mapDispatch = (dispatcher: IDispatcher) => ({ connectedNetworkElementsActions: createConnectedNetworkElementsActions(dispatcher.dispatch), switchActivePanel: (panelId: PanelId) => { - dispatcher.dispatch(setPanelAction(panelId)); + dispatcher.dispatch(setPanelAction(panelId)); }, inventoryElementsActions: createInventoryElementsActions(dispatcher.dispatch), navigateToApplication: (applicationName: string, path?: string) => dispatcher.dispatch(new NavigateToApplication(applicationName, path)), @@ -62,8 +64,18 @@ let inventoryInitialSorted = false; const ConnectedElementTable = MaterialTable as MaterialTableCtorType; type DashboardComponentProps = RouteComponentProps & Connect; +type DashboardComponentState = { + refreshInventoryEditorMode: RefreshInventoryDialogMode +} + +class DashboardSelectorComponent extends React.Component { + constructor(props: DashboardComponentProps) { + super(props); -class DashboardSelectorComponent extends React.Component { + this.state = { + refreshInventoryEditorMode: RefreshInventoryDialogMode.None + }; + } private onHandleTabChange = (event: React.ChangeEvent<{}>, newValue: PanelId) => { this.onTogglePanel(newValue); @@ -111,6 +123,13 @@ class DashboardSelectorComponent extends React.Component { + this.setState({ + refreshInventoryEditorMode: RefreshInventoryDialogMode.RefreshInventoryTable + }); + } + }; const { panelId: activePanelId } = this.props; return ( <> @@ -124,32 +143,42 @@ class DashboardSelectorComponent extends React.Component { - - return this.getContextMenu(rowData); - }} > - + <> + { + + return this.getContextMenu(rowData); + }} > + + + } { activePanelId === "TreeviewTable" && - { this.props.history.push(`${this.props.match.path}/${row.nodeId}`) }} columns={[ + { + this.props.history.push(`${this.props.match.path}/${row.nodeId}`); + this.props.updateInventoryTree(row.nodeId, '*'); + }} + columns={[ { property: "nodeId", title: "Node Name", type: ColumnType.text }, { property: "isRequired", title: "Required", type: ColumnType.boolean }, { property: "host", title: "Host", type: ColumnType.text }, @@ -163,6 +192,11 @@ class DashboardSelectorComponent extends React.Component { + this.setState({ + refreshInventoryEditorMode: RefreshInventoryDialogMode.None + }); + } componentDidMount() { if (this.props.panelId === null) { //set default tab if none is set -- cgit 1.2.3-korg