Skip to content

Commit

Permalink
feat(ui): TE-2610 show workspace switcher if workspace count is more …
Browse files Browse the repository at this point in the history
…than 0
  • Loading branch information
nalin-patidar committed Jan 7, 2025
1 parent 4b61aa4 commit 4aae711
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
24 changes: 11 additions & 13 deletions thirdeye-ui/src/app/components/app-bar/app-header/workspace.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -98,19 +98,17 @@ export const WorkspaceSwitcher = ({
value={selectedWorkspace.id || ""}
onClick={() => setOpen(!open)}
>
{workspaces.length > 1 && (
<ListItem>
<TextField
fullWidth
placeholder="Search workspace"
onChange={(e) => {
handleFilter(e.target.value);
}}
// prevent selecting search box
onClick={(e) => e.stopPropagation()}
/>
</ListItem>
)}
<ListItem>
<TextField
fullWidth
placeholder="Search workspace"
onChange={(e) => {
handleFilter(e.target.value);
}}
// prevent selecting search box
onClick={(e) => e.stopPropagation()}
/>
</ListItem>
<div style={{ maxHeight: "400px", overflow: "auto" }}>
{filteredWorkspaces.map((workspace, index) => (
<MenuItem
Expand Down

0 comments on commit 4aae711

Please sign in to comment.