From 386f2f744b2bde30d62bc2bbb873055a882e5508 Mon Sep 17 00:00:00 2001 From: George Tsiolis Date: Fri, 27 May 2022 17:44:04 +0000 Subject: [PATCH] Update dashboard navigation --- components/dashboard/src/Menu.tsx | 119 ++++++++++-------- .../dashboard/src/components/PillMenuItem.tsx | 6 +- .../dashboard/src/icons/CaretUpDown.svg | 3 - 3 files changed, 72 insertions(+), 56 deletions(-) delete mode 100644 components/dashboard/src/icons/CaretUpDown.svg diff --git a/components/dashboard/src/Menu.tsx b/components/dashboard/src/Menu.tsx index 2d7207fb3529ab..77b25c1761ed67 100644 --- a/components/dashboard/src/Menu.tsx +++ b/components/dashboard/src/Menu.tsx @@ -11,8 +11,6 @@ import { useLocation, useRouteMatch } from "react-router"; import { Location } from "history"; import { countries } from "countries-list"; import gitpodIcon from "./icons/gitpod.svg"; -import CaretDown from "./icons/CaretDown.svg"; -import CaretUpDown from "./icons/CaretUpDown.svg"; import { getGitpodService, gitpodHostUrl } from "./service/service"; import { UserContext } from "./user-context"; import { TeamsContext, getCurrentTeam } from "./teams/teams-context"; @@ -108,6 +106,8 @@ export default function Menu() { // Hide most of the top menu when in a full-page form. const isMinimalUI = ["/new", "/teams/new", "/open"].includes(location.pathname); + const isWorkspacesUI = ["/workspaces"].includes(location.pathname); + const isAdminUI = window.location.pathname.startsWith("/admin"); const [teamMembers, setTeamMembers] = useState>({}); useEffect(() => { @@ -228,11 +228,6 @@ export default function Menu() { } // User menu return [ - { - title: "Workspaces", - link: "/workspaces", - alternatives: ["/"], - }, { title: "Projects", link: "/projects", @@ -255,8 +250,9 @@ export default function Menu() { ] : []), { - title: "Docs", - link: "https://www.gitpod.io/docs/", + title: "Workspaces", + link: "/workspaces", + alternatives: ["/"], }, ]; @@ -269,24 +265,29 @@ export default function Menu() { }; const renderTeamMenu = () => { return ( -
+
{projectSlug && ( -
- - - {team?.name || userFullName} - - -
+ + + {team?.name || userFullName} + + )} -
+ {!projectSlug && ( + + + {team?.name || userFullName} + + + )} +
+
{userFullName} @@ -295,7 +296,7 @@ export default function Menu() { ), active: !team, separator: true, - link: "/", + link: "/projects", }, ...(teams || []) .map((t) => ({ @@ -343,35 +344,50 @@ export default function Menu() { }, ]} > -
- {!projectSlug && ( - - {team?.name || userFullName} - - )} - +
+ + + Toggle team selection menu +
- {projectSlug && ( -
- - - {project?.name} - - -
+ {projectSlug && !prebuildId && !isAdminUI && ( + + + {project?.name} + + )} {prebuildId && ( -
- - {prebuildId} + + + {project?.name} + + + )} + {prebuildId && ( +
+
+ + + +
+ + + {prebuildId.substring(0, 8).trimEnd()} + +
)}
@@ -380,11 +396,8 @@ export default function Menu() { return ( <> -
-
+
+
Gitpod's logo @@ -393,7 +406,7 @@ export default function Menu() {
{isFeedbackFormVisible && }
- {!isMinimalUI && !prebuildId && ( + {!isMinimalUI && !prebuildId && !isWorkspacesUI && !isAdminUI && (