diff --git a/components/dashboard/src/menu/Menu.tsx b/components/dashboard/src/menu/Menu.tsx index 773adef745f16e..2a4406ddcd298a 100644 --- a/components/dashboard/src/menu/Menu.tsx +++ b/components/dashboard/src/menu/Menu.tsx @@ -22,6 +22,8 @@ import { User, RoleOrPermission } from "@gitpod/public-api/lib/gitpod/v1/user_pb import { getPrimaryEmail } from "@gitpod/public-api-common/lib/user-utils"; import { ConfigurationsMigrationCoachmark } from "../repositories/coachmarks/MigrationCoachmark"; import { useInstallationConfiguration } from "../data/installation/installation-config-query"; +import { useIsDataOps } from "../data/featureflag-query"; +import { ProductLogo } from "../components/ProductLogo"; interface Entry { title: string; @@ -34,9 +36,7 @@ export default function Menu() { const location = useLocation(); const { setCurrency } = useContext(PaymentContext); const [isFeedbackFormVisible, setFeedbackFormVisible] = useState(false); - - const { data: installationConfig, isLoading: isInstallationConfigLoading } = useInstallationConfiguration(); - const isGitpodIo = isInstallationConfigLoading ? false : !installationConfig?.isDedicatedInstallation; + const isDataOps = useIsDataOps(); useEffect(() => { const { server } = getGitpodService(); @@ -79,16 +79,24 @@ export default function Menu() { - {/* hidden on smaller screens (in its own menu below on smaller screens) */} -
- + {/* Mobile Only Divider and User Menu */} +
+
+ +
+ {/* Desktop Only Divider, User Menu, and Workspaces Nav */} +
+
+ +
+ +
{isFeedbackFormVisible && }
- {/* only shown on small screens */} + {/* Mobile-only OrgPagesNav and Separator */} - {/* only shown on small screens */} ); @@ -162,14 +171,13 @@ type UserMenuProps = { user?: User; className?: string; withAdminLink?: boolean; - withFeedbackLink?: boolean; onFeedback?: () => void; }; -const UserMenu: FC = ({ user, className, withAdminLink, withFeedbackLink, onFeedback }) => { +const UserMenu: FC = ({ user, className, withAdminLink, onFeedback }) => { const { data: installationConfig, isLoading: isInstallationConfigLoading } = useInstallationConfiguration(); const isGitpodIo = isInstallationConfigLoading ? false : !installationConfig?.isDedicatedInstallation; - const extraSection = useMemo(() => { + const adminSection = useMemo(() => { const items: ContextMenuEntry[] = []; if (withAdminLink && user?.rolesOrPermissions?.includes(RoleOrPermission.ADMIN)) { @@ -178,12 +186,6 @@ const UserMenu: FC = ({ user, className, withAdminLink, withFeedb link: "/admin", }); } - if (withFeedbackLink && isGitpodIo) { - items.push({ - title: "Feedback", - onClick: onFeedback, - }); - } // Add a separator to the last item if (items.length > 0) { @@ -191,10 +193,10 @@ const UserMenu: FC = ({ user, className, withAdminLink, withFeedb } return items; - }, [isGitpodIo, onFeedback, user?.rolesOrPermissions, withAdminLink, withFeedbackLink]); + }, [user?.rolesOrPermissions, withAdminLink]); const menuEntries = useMemo(() => { - return [ + const entries: ContextMenuEntry[] = [ { title: (user && (getPrimaryEmail(user) || user?.name)) || "User", customFontStyle: "text-gray-400", @@ -215,15 +217,27 @@ const UserMenu: FC = ({ user, className, withAdminLink, withFeedb href: "https://www.gitpod.io/support/", target: "_blank", rel: "noreferrer", - separator: true, - }, - ...extraSection, - { - title: "Log out", - href: gitpodHostUrl.asApiLogout().toString(), + separator: !isGitpodIo, }, ]; - }, [extraSection, user]); + + if (isGitpodIo) { + entries.push({ + title: "Feedback", + onClick: onFeedback, + separator: true, + }); + } + + entries.push(...adminSection); + + entries.push({ + title: "Log out", + href: gitpodHostUrl.asApiLogout().toString(), + }); + + return entries; + }, [adminSection, user, isGitpodIo, onFeedback]); return (
= ({ user, className, withAdminLink, withFeedb function isSelected(entry: Entry, location: Location) { const all = [entry.link, ...(entry.alternatives || [])].map((l) => l.toLowerCase()); const path = location.pathname.toLowerCase(); - return all.some((n) => n === path || n + "/" === path); + return all.some((n) => n === path || n + "/" === path || path.startsWith(n + "/")); } diff --git a/components/dashboard/src/start/StartPage.tsx b/components/dashboard/src/start/StartPage.tsx index e17b6df243c61a..5fcc96d4c9d877 100644 --- a/components/dashboard/src/start/StartPage.tsx +++ b/components/dashboard/src/start/StartPage.tsx @@ -14,6 +14,7 @@ import { VerifyModal } from "./VerifyModal"; import { useWorkspaceDefaultImageQuery } from "../data/workspaces/default-workspace-image-query"; import { GetWorkspaceDefaultImageResponse_Source } from "@gitpod/public-api/lib/gitpod/v1/workspace_pb"; import { ProductLogo } from "../components/ProductLogo"; +import { useIsDataOps } from "../data/featureflag-query"; export enum StartPhase { Checking = 0, @@ -96,6 +97,8 @@ export function StartPage(props: StartPageProps) { const { phase, error, workspaceId } = props; let title = props.title || getPhaseTitle(phase, error); useDocumentTitle("Starting"); + const isDataOps = useIsDataOps(); + return (
@@ -105,6 +108,7 @@ export function StartPage(props: StartPageProps) { error || phase === StartPhase.Stopped || phase === StartPhase.IdeReady ? "" : "animate-bounce" }`} /> + {!isDataOps && Gitpod Classic} {title} {typeof phase === "number" && phase < StartPhase.IdeReady && (