diff --git a/frontend/src/_components/OrganizationManager/CustomSelect.jsx b/frontend/src/_components/OrganizationManager/CustomSelect.jsx index 967319fd02..dc9f132b4e 100644 --- a/frontend/src/_components/OrganizationManager/CustomSelect.jsx +++ b/frontend/src/_components/OrganizationManager/CustomSelect.jsx @@ -4,30 +4,36 @@ import { components } from 'react-select'; import { EditOrganization } from './EditOrganization'; import { CreateOrganization } from './CreateOrganization'; import { useTranslation } from 'react-i18next'; +import { authenticationService } from '@/_services'; const Menu = (props) => { const { t } = useTranslation(); + const { admin } = authenticationService.currentUserValue; return (
-
props.selectProps.setShowEditOrg(true)}> -
-
{props?.selectProps?.value?.label}
-
- - - - + {admin && ( + <> +
props.selectProps.setShowEditOrg(true)}> +
+
{props?.selectProps?.value?.label}
+
+ + + + +
+
-
-
-
+
+ + )}
{props.children}
{ const [showEditOrg, setShowEditOrg] = useState(false); const [showCreateOrg, setShowCreateOrg] = useState(false); + const isSingleOrganization = window.public_config?.DISABLE_MULTI_WORKSPACE === 'true'; + const { organization, admin } = authenticationService.currentUserValue; + return ( <> - + )} ); }; diff --git a/frontend/src/_ui/Header/index.jsx b/frontend/src/_ui/Header/index.jsx index a974f44c33..02fb10c8ba 100644 --- a/frontend/src/_ui/Header/index.jsx +++ b/frontend/src/_ui/Header/index.jsx @@ -2,23 +2,16 @@ import React from 'react'; import cx from 'classnames'; import Breadcrumbs from '../Breadcrumbs'; import { OrganizationList } from '@/_components/OrganizationManager/List'; -import { authenticationService } from '@/_services'; function Header() { const currentVersion = localStorage.getItem('currentVersion'); const darkMode = localStorage.getItem('darkMode') === 'true'; - const isSingleOrganization = window.public_config?.DISABLE_MULTI_WORKSPACE === 'true'; - const { organization } = authenticationService.currentUserValue; return (
- {isSingleOrganization ? ( - {organization} - ) : ( - - )} +