From 4aae711a0dd5e81c291a90fff6fc09238d978ac4 Mon Sep 17 00:00:00 2001 From: Nalin Patidar Date: Tue, 7 Jan 2025 12:26:54 +0530 Subject: [PATCH] feat(ui): TE-2610 show workspace switcher if workspace count is more than 0 --- .../app-header/app-header.component.tsx | 2 +- .../app-bar/app-header/workspace.tsx | 24 +++++++++---------- 2 files changed, 12 insertions(+), 14 deletions(-) diff --git a/thirdeye-ui/src/app/components/app-bar/app-header/app-header.component.tsx b/thirdeye-ui/src/app/components/app-bar/app-header/app-header.component.tsx index 97d30118a4..6fe48e30dc 100644 --- a/thirdeye-ui/src/app/components/app-bar/app-header/app-header.component.tsx +++ b/thirdeye-ui/src/app/components/app-bar/app-header/app-header.component.tsx @@ -29,7 +29,7 @@ export const Appheader = ({ }: AppHeaderprops): ReactElement => { const { t } = useTranslation(); const [navBarMinimized] = useNavBarV1((state) => [state.navBarMinimized]); - const showWorkspaceSwitcher = Boolean(workspaces && workspaces?.length > 1); + const showWorkspaceSwitcher = Boolean(workspaces); const compoenentStyles = useAppHeaderStyles({ showWorkspaceSwitcher, isFullScreen, diff --git a/thirdeye-ui/src/app/components/app-bar/app-header/workspace.tsx b/thirdeye-ui/src/app/components/app-bar/app-header/workspace.tsx index c1baf661b3..8ad8a6a0c2 100644 --- a/thirdeye-ui/src/app/components/app-bar/app-header/workspace.tsx +++ b/thirdeye-ui/src/app/components/app-bar/app-header/workspace.tsx @@ -98,19 +98,17 @@ export const WorkspaceSwitcher = ({ value={selectedWorkspace.id || ""} onClick={() => setOpen(!open)} > - {workspaces.length > 1 && ( - - { - handleFilter(e.target.value); - }} - // prevent selecting search box - onClick={(e) => e.stopPropagation()} - /> - - )} + + { + handleFilter(e.target.value); + }} + // prevent selecting search box + onClick={(e) => e.stopPropagation()} + /> +
{filteredWorkspaces.map((workspace, index) => (