diff --git a/Tombolo/client-reactjs/src/components/layout/LeftNav.js b/Tombolo/client-reactjs/src/components/layout/LeftNav.js index 06edb12d..7b4cf9d8 100644 --- a/Tombolo/client-reactjs/src/components/layout/LeftNav.js +++ b/Tombolo/client-reactjs/src/components/layout/LeftNav.js @@ -17,7 +17,6 @@ import { } from '@ant-design/icons'; import { hasEditPermission } from '../common/AuthUtil.js'; -import Text from '../common/Text'; function getItem(label, key, icon, children, type, disabled) { return { @@ -34,27 +33,29 @@ const { Sider } = Layout; class LeftNav extends Component { state = { - current: '1', + current: '0', }; - componentDidUpdate(prevProps) { - const applicationId = this.props?.applicationId; - const prevApplicationId = prevProps?.applicationId; - if (applicationId !== prevApplicationId) { - // if current app and prev app is not same we are redirected to /appid/asset page, so we will reset menu highlight - this.setState({ current: '1' }); - } - } - componentDidMount() { const options = { + assets: '1', dataflow: '2', dataflowinstances: '3', - actions: '4', - clusters: '5', - github: '6', - consumers: '7', - applications: '8', + fileMonitoring: '4a', + directoryMonitoring: '4b', + clustermonitoring: '4c', + jobmonitoring: '4d', + superfileMonitoring: '4e', + orbitMonitoring: '4f', + notifications: '5a', + clusterUsage: '5b', + Orbit: '5c', + clusters: '6', + github: '8', + consumers: '9', + applications: '10', + integrations: '11', + msTeams: '12a', }; // on init we check pathname if it contains options key in name, if it does => highlight that menu item @@ -96,7 +97,7 @@ class LeftNav extends Component { else return ''; }; - const items = [ + const workflowItems = [ getItem( <> {disabled || clusterDisabled ? ( @@ -157,6 +158,9 @@ class LeftNav extends Component { null, clusterDisabled ), + ]; + + const monitoringItems = [ getItem( <> @@ -289,7 +293,7 @@ class LeftNav extends Component { ), ]; - const settingItems = [ + const connectionItems = [ getItem( <> {disabled ? ( @@ -310,28 +314,6 @@ class LeftNav extends Component { null, clusterDisabled ), - getItem( - <> - - Notifications - , - '7', - null, - [ - getItem( - - - MS Teams - - , - '7a', - null, - null - ), - ], - null, - clusterDisabled - ), getItem( <> {disabled || clusterDisabled ? ( @@ -352,26 +334,6 @@ class LeftNav extends Component { null, clusterDisabled ), - getItem( - <> - {disabled || clusterDisabled ? ( - <> - - Collaborator - - ) : ( - - - Collaborator - - )} - , - '9', - null, - null, - null, - clusterDisabled - ), ]; const adminItems = [ @@ -403,6 +365,28 @@ class LeftNav extends Component { null, clusterDisabled ), + getItem( + <> + + Notifications + , + '12', + null, + [ + getItem( + + + MS Teams + + , + '12a', + null, + null + ), + ], + null, + clusterDisabled + ), //TODO: Uncomment when compliance is ready // getItem( // @@ -418,6 +402,18 @@ class LeftNav extends Component { this.setState({ current: e.key }); }; + const title = (title) => { + return ( + + {title} + + ); + }; + + const menu = (items) => { + return ; + }; + return ( - - - {canEdit && this.props.collapsed ? null : ( - - {} - - )} - - {canEdit ? ( - - ) : null} - - {canEdit && this.props.collapsed ? null : ( - - {} - - )} - - {canEdit ? ( - - ) : null} + {this.props.collapsed ? null : title('Workflows')} + {menu(workflowItems)} + {this.props.collapsed ? null : title('Monitoring')} + {menu(monitoringItems)} + {canEdit && this.props.collapsed ? null : title('Connections')} + {menu(connectionItems)} + {canEdit && this.props.collapsed ? null : title('Admin')} + {canEdit && menu(adminItems)} ); }