diff --git a/frontend/src/App/App.jsx b/frontend/src/App/App.jsx index 151d9c4512..f5261122e3 100644 --- a/frontend/src/App/App.jsx +++ b/frontend/src/App/App.jsx @@ -32,6 +32,10 @@ import { getWorkspaceIdOrSlugFromURL } from '@/_helpers/routes'; import ErrorPage from '@/_components/ErrorComponents/ErrorPage'; import WorkspaceConstants from '@/WorkspaceConstants'; import { useAppDataStore } from '@/_stores/appDataStore'; +import { ManageOrgUsers } from '@/ManageOrgUsers'; +import { ManageGroupPermissions } from '@/ManageGroupPermissions'; +import OrganizationLogin from '@/_components/OrganizationLogin/OrganizationLogin'; +import { ManageOrgVars } from '@/ManageOrgVars'; const AppWrapper = (props) => { return ( @@ -225,7 +229,36 @@ class AppComponent extends React.Component { } - /> + > + + + + } + /> + + + + } + /> + + + + } + /> + } + /> + { switch (groupName) { - case 'Users': - return 'Users & permissions'; - case 'Groups': - return 'manageGroups'; - case 'Workspace login': - return 'manageWorkspaceLogin'; - case 'Workspace variables': - return 'manageEnvVars'; + case 'users': + return 'Users'; + case 'groups': + return 'Groups'; + case 'workspace-login': + return 'Workspace login'; + case 'workspace-variables': + return 'Workspace variables'; default: return groupName; } @@ -43,15 +41,20 @@ export function OrganizationSettings(props) { const subscription = authenticationService.currentSession.subscribe((newOrd) => { setAdmin(newOrd?.admin); }); - updateSidebarNAV('Users'); + admin ? updateSidebarNAV('Users') : updateSidebarNAV('Workspace variables'); () => subscription.unsubsciption(); - // eslint-disable-next-line react-hooks/exhaustive-deps - }, [authenticationService.currentSessionValue?.admin]); - - const goTooOrgConstantsDashboard = () => { - navigate(`/${getWorkspaceId()}/workspace-constants`); - }; + const selectedTabFromRoute = location.pathname.split('/').pop(); + if (selectedTabFromRoute === 'workspace-settings') { + setSelectedTab(admin ? 'Users' : 'Workspace variables'); + window.location.href = admin + ? `/${workspaceId}/workspace-settings/users` + : `/${workspaceId}/workspace-settings/workspace-variables`; + } else { + setSelectedTab(defaultOrgName(selectedTabFromRoute)); + } + updateSidebarNAV(defaultOrgName(selectedTabFromRoute)); + }, [navigate, workspaceId, authenticationService.currentSessionValue?.admin]); return ( @@ -60,33 +63,46 @@ export function OrganizationSettings(props) {
{sideBarNavs.map((item, index) => { + const Wrapper = ({ children }) => <>{children}; return ( - <> - {admin && ( - { - setSelectedTab(defaultOrgName(item)); - if (item == 'Users') updateSidebarNAV('Users'); - else updateSidebarNAV(item); - }} - selectedItem={selectedTab == defaultOrgName(item)} - renderBadgeForItems={['Workspace constants']} - renderBadge={() => ( - - new - - )} - dataCy={item.toLowerCase().replace(/\s+/g, '-')} - > - {item} - - )} - + + + {admin && ( + { + setSelectedTab(defaultOrgName(item)); + if (item == 'Users') updateSidebarNAV('Users'); + else updateSidebarNAV(item); + }} + selectedItem={selectedTab == defaultOrgName(item)} + renderBadgeForItems={['Workspace constants']} + renderBadge={() => ( + + new + + )} + dataCy={item.toLowerCase().replace(/\s+/g, '-')} + > + {item} + + )} + + ); })}
@@ -95,13 +111,7 @@ export function OrganizationSettings(props) {
- {selectedTab === 'Users & permissions' && } - {selectedTab === 'manageGroups' && } - {selectedTab === 'manageWorkspaceLogin' && } - {selectedTab === 'manageEnvVars' && ( - - )} - {selectedTab === 'manageCopilot' && } +
diff --git a/frontend/src/_ui/Breadcrumbs/index.jsx b/frontend/src/_ui/Breadcrumbs/index.jsx index 8b369ffa46..ec6879e9c9 100644 --- a/frontend/src/_ui/Breadcrumbs/index.jsx +++ b/frontend/src/_ui/Breadcrumbs/index.jsx @@ -18,12 +18,7 @@ export const Breadcrumbs = ({ darkMode, dataCy }) => {

{breadcrumb}

{sidebarNav?.length > 0 && } -
  • - - {' '} - {sidebarNav} - -
  • +
  • {sidebarNav}
  • {beta && beta}
    ); diff --git a/frontend/src/_ui/Header/index.jsx b/frontend/src/_ui/Header/index.jsx index baa2959fca..e46f74da08 100644 --- a/frontend/src/_ui/Header/index.jsx +++ b/frontend/src/_ui/Header/index.jsx @@ -16,6 +16,10 @@ function Header({ enableCollapsibleSidebar = false, collapseSidebar = false, tog case 'database': return 'Database'; case 'workspace-settings': + case 'users': + case 'workspace-variables': + case 'groups': + case 'workspace-login': return 'Workspace settings'; case 'data-sources': return 'Data sources';