cleanup(workspace-platform): remove entrypoints (#29035)

* refactor: remove workspace platform entrypoints

* cleanup
This commit is contained in:
Romit
2026-05-01 02:46:18 +00:00
committed by GitHub
parent 91341cbba4
commit 9cd1f34f16
8 changed files with 60 additions and 249 deletions
@@ -6,10 +6,6 @@ vi.mock("next-auth/react", () => ({
signOut: vi.fn(),
}));
vi.mock("next/navigation", () => ({
usePathname: () => "/settings",
}));
vi.mock("@calcom/lib/hooks/useLocale", () => ({
useLocale: () => ({
t: (key: string) => key,
@@ -29,12 +25,6 @@ vi.mock("@calcom/trpc/react/hooks/useMeQuery", () => ({
default: () => mockUseMeQuery(),
}));
vi.mock("@calcom/web/components/settings/platform/hooks/useGetUserAttributes", () => ({
useGetUserAttributes: () => ({
isPlatformUser: false,
}),
}));
vi.mock("@calcom/web/modules/api-keys/support/lib/freshchat/FreshChatProvider", () => ({
default: ({ children }: { children: React.ReactNode }) => <div>{children}</div>,
}));
@@ -14,7 +14,6 @@ import {
MenuTrigger,
} from "@coss/ui/components/menu";
import {
BlocksIcon,
ChevronDownIcon,
ChevronUpIcon,
CircleHelpIcon,
@@ -25,7 +24,6 @@ import {
UserIcon,
} from "@coss/ui/icons";
import Link from "next/link";
import { usePathname } from "next/navigation";
import { signOut } from "next-auth/react";
import type { MouseEvent } from "react";
import { useEffect, useState } from "react";
@@ -51,11 +49,8 @@ interface UserDropdownProps {
}
export function UserDropdown({ small }: UserDropdownProps) {
const isPlatformUser = false;
const { t } = useLocale();
const { data: user, isPending } = useMeQuery();
const pathname = usePathname();
const isPlatformPages = pathname?.startsWith("/settings/platform");
useEffect(() => {
if (typeof window === "undefined") return;
@@ -166,23 +161,21 @@ export function UserDropdown({ small }: UserDropdownProps) {
<>
<MenuPopup align="start">
{!isPlatformPages && (
<>
<MenuItem render={<Link href="/settings/my-account/profile" />}>
<UserIcon />
{t("my_profile")}
</MenuItem>
<MenuItem render={<Link href="/settings/my-account/general" />}>
<SettingsIcon />
{t("my_settings")}
</MenuItem>
<MenuItem render={<Link href="/settings/my-account/out-of-office" />}>
<MoonIcon />
{t("out_of_office")}
</MenuItem>
<MenuSeparator />
</>
)}
<>
<MenuItem render={<Link href="/settings/my-account/profile" />}>
<UserIcon />
{t("my_profile")}
</MenuItem>
<MenuItem render={<Link href="/settings/my-account/general" />}>
<SettingsIcon />
{t("my_settings")}
</MenuItem>
<MenuItem render={<Link href="/settings/my-account/out-of-office" />}>
<MoonIcon />
{t("out_of_office")}
</MenuItem>
<MenuSeparator />
</>
<MenuItem render={<a href={ROADMAP} target="_blank" rel="noreferrer" />}>
<MapIcon />
@@ -192,12 +185,6 @@ export function UserDropdown({ small }: UserDropdownProps) {
<CircleHelpIcon />
{t("help")}
</MenuItem>
{!isPlatformPages && isPlatformUser && (
<MenuItem render={<Link href="/settings/platform" />} className="todesktop:hidden hidden lg:flex">
<BlocksIcon />
{t("platform")}
</MenuItem>
)}
<MenuSeparator />
<MenuItem