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 (#1738)

* feat(ui): TE-2610 show workspace switcher if workspace count is more than 0

* review changes
  • Loading branch information
nalin-patidar authored Jan 10, 2025
1 parent be82371 commit e14ebf4
Show file tree
Hide file tree
Showing 3 changed files with 15 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
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,9 @@ export const useWorkpsaceSwitcherStyles = makeStyles({
"&:hover .copy-icon-button": {
visibility: "visible",
},
"& .MuiListItemText-primary": {
fontSize: "14px",
},
},
noResults: {
display: "flex",
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 e14ebf4

Please sign in to comment.