From 5c93d66bd76bafca89d95b6da83e5d9220b48531 Mon Sep 17 00:00:00 2001 From: FancMa01 Date: Fri, 3 Jan 2025 08:46:43 -0700 Subject: [PATCH] Mfancher/owner left nav fix (#982) * Wire Password Reset * Remove unecessary reset temp password code that isn't used with temp password. We use the link and token method for resetting temp passwords, no need to have temporary password code any longer * Flag session from the requested token with current * Allow owners to view users even before applications or clusters are visible * Small Bug Fix Small bug fix for when you remove the last application, have it re-disable left nav menu items. --- .../layout/Header/ApplicationMenu.js | 1 - .../src/components/layout/LeftNav.js | 20 +++++++++---------- .../src/redux/actions/Application.js | 4 ++++ 3 files changed, 14 insertions(+), 11 deletions(-) diff --git a/Tombolo/client-reactjs/src/components/layout/Header/ApplicationMenu.js b/Tombolo/client-reactjs/src/components/layout/Header/ApplicationMenu.js index db462a93..982cfd2f 100644 --- a/Tombolo/client-reactjs/src/components/layout/Header/ApplicationMenu.js +++ b/Tombolo/client-reactjs/src/components/layout/Header/ApplicationMenu.js @@ -17,7 +17,6 @@ const ApplicationMenu = ({ applications, selected, handleApplicationChange }) => menu={{ items: getApplicationItems(applications), onClick: (e) => { - console.log(e); handleApplicationChange(e.key); }, }} diff --git a/Tombolo/client-reactjs/src/components/layout/LeftNav.js b/Tombolo/client-reactjs/src/components/layout/LeftNav.js index da344d65..91c2e8ab 100644 --- a/Tombolo/client-reactjs/src/components/layout/LeftNav.js +++ b/Tombolo/client-reactjs/src/components/layout/LeftNav.js @@ -50,7 +50,7 @@ const LeftNav = ({ collapsed, onCollapse, clusterLinkRef, appLinkRef }) => { //control the disabled state of the menu items based on the application and cluster states useEffect(() => { - if (applicationId && applicationId) { + if (application && applicationId) { setDisabled(false); } else { setDisabled(true); @@ -366,23 +366,23 @@ const LeftNav = ({ collapsed, onCollapse, clusterLinkRef, appLinkRef }) => { ), getItem( <> - {disabled || clusterDisabled ? ( + {/* {disabled || clusterDisabled ? ( <> Users - ) : ( - - - Users - - )} + ) : ( */} + + + Users + + {/* )} */} , '11', null, null, - null, - clusterDisabled + null + // clusterDisabled ), getItem( <> diff --git a/Tombolo/client-reactjs/src/redux/actions/Application.js b/Tombolo/client-reactjs/src/redux/actions/Application.js index 6e92b40c..7e1aa9cc 100644 --- a/Tombolo/client-reactjs/src/redux/actions/Application.js +++ b/Tombolo/client-reactjs/src/redux/actions/Application.js @@ -116,6 +116,10 @@ function getApplications() { if (applicationsFinal.length === 0) { dispatch({ type: Constants.NO_APPLICATION_FOUND, noApplication: true }); dispatch({ type: Constants.APPLICATIONS_RETRIEVED, payload: applicationsFinal }); + dispatch({ + type: Constants.APPLICATION_SELECTED, + application: { applicationId: null, applicationTitle: null }, + }); return; } dispatch({ type: Constants.APPLICATIONS_RETRIEVED, payload: applicationsFinal });