Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 0 additions & 19 deletions apps/web/app/(use-page-wrapper)/auth/platform/authorize/page.tsx

This file was deleted.

28 changes: 0 additions & 28 deletions apps/web/app/notFoundClient.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ export function NotFound({ host }: { host: string }) {
const { username, pageType, url } = getPageInfo(pathname);
const isBookingSuccessPage = pathname?.startsWith("/booking");
const isSubpage = pathname?.includes("/", 2) || isBookingSuccessPage;
const isInsights = pathname?.startsWith("/insights");

useLayoutEffect(() => {
if (typeof window !== "undefined") {
Expand All @@ -50,33 +49,6 @@ export function NotFound({ host }: { host: string }) {
},
];

/**
* If we're on 404 and the route is insights it means it is disabled
* TODO: Abstract this for all disabled features
**/
if (isInsights) {
return (
<div className="min-h-screen bg-white px-4" data-testid="404-page">
<main className="mx-auto max-w-xl pt-16 pb-6 sm:pt-24">
<div className="text-center">
<p className="font-semibold text-black text-sm uppercase tracking-wide">{t("error_404")}</p>
<h1 className="mt-2 font-cal font-extrabold text-4xl text-gray-900 sm:text-5xl">
{t("feature_currently_disabled") ?? "Feature is currently disabled"}
</h1>
</div>
<div className="mt-12">
<div className="mt-8">
<Link href={WEBSITE_URL} className="font-medium text-base text-black hover:text-gray-500">
{t("or_go_back_home")}
<span aria-hidden="true"> &rarr;</span>
</Link>
</div>
</div>
</main>
</div>
);
}

return (
<div className="min-h-screen bg-default px-4" data-testid="404-page">
<main className="mx-auto max-w-xl pt-16 pb-6 sm:pt-24">
Expand Down
126 changes: 0 additions & 126 deletions apps/web/modules/auth/platform/authorize-view.tsx

This file was deleted.

6 changes: 2 additions & 4 deletions apps/web/modules/shell/Shell.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,13 @@ const Layout = (props: LayoutProps) => {
<DynamicModals />

<div className="flex min-h-screen flex-col">
{banners && !props.isPlatformUser && <BannerContainer banners={banners} />}
{banners && <BannerContainer banners={banners} />}

<div className="flex flex-1" data-testid="dashboard-shell">
{props.SidebarContainer ? (
cloneElement(props.SidebarContainer, { bannersHeight })
) : (
<SideBarContainer isPlatformUser={props.isPlatformUser} bannersHeight={bannersHeight} />
<SideBarContainer bannersHeight={bannersHeight} />
)}
<div className="flex w-0 flex-1 flex-col">
<MainContainer {...props} />
Expand Down Expand Up @@ -86,7 +86,6 @@ export type LayoutProps = {
beforeCTAactions?: JSX.Element;
afterHeading?: ReactNode;
smallHeading?: boolean;
isPlatformUser?: boolean;
disableSticky?: boolean;
};

Expand Down Expand Up @@ -198,7 +197,6 @@ export function ShellMain(props: LayoutProps) {
}

function MainContainer({
isPlatformUser,
MobileNavigationContainer: MobileNavigationContainerProp = <MobileNavigationContainer />,
TopNavContainer: TopNavContainerProp = <TopNavContainer />,
...props
Expand Down
93 changes: 43 additions & 50 deletions apps/web/modules/shell/SideBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import { SkeletonText } from "@calcom/ui/components/skeleton";
import { Tooltip } from "@calcom/ui/components/tooltip";
import { ArrowLeftIcon, ArrowRightIcon } from "@coss/ui/icons";
import Link from "next/link";
import { usePathname } from "next/navigation";
import type { User as UserAuth } from "next-auth";
import { useSession } from "next-auth/react";
import { KBarTrigger } from "./Kbar";
Expand All @@ -23,16 +22,14 @@ import { UserDropdown } from "./user-dropdown/UserDropdown";

export type SideBarContainerProps = {
bannersHeight: number;
isPlatformUser?: boolean;
};

export type SideBarProps = {
bannersHeight: number;
user?: UserAuth | null;
isPlatformUser?: boolean;
};

export function SideBarContainer({ bannersHeight, isPlatformUser = false }: SideBarContainerProps) {
export function SideBarContainer({ bannersHeight }: SideBarContainerProps) {
const { status, data } = useSession();
const isStandalone = useIsStandalone();

Expand All @@ -41,13 +38,11 @@ export function SideBarContainer({ bannersHeight, isPlatformUser = false }: Side
// Though when logged out, app store pages would temporarily show SideBar until session status is confirmed.
if (status !== "loading" && status !== "authenticated") return null;
if (isStandalone) return null;
return <SideBar isPlatformUser={isPlatformUser} bannersHeight={bannersHeight} user={data?.user} />;
return <SideBar bannersHeight={bannersHeight} user={data?.user} />;
}

export function SideBar({ bannersHeight, user }: SideBarProps) {
const { t, isLocaleReady } = useLocale();
const pathname = usePathname();
const isPlatformPages = pathname?.startsWith("/settings/platform");

const publicPageUrl = `${WEBAPP_URL}/${user?.orgAwareUsername}`;

Expand All @@ -63,10 +58,10 @@ export function SideBar({ bannersHeight, user }: SideBarProps) {
return (
<div className="relative">
<aside
style={!isPlatformPages ? sidebarStylingAttributes : {}}
style={sidebarStylingAttributes}
className={classNames(
"fixed left-0 hidden h-full w-14 flex-col overflow-y-auto overflow-x-hidden border-muted border-r bg-cal-muted md:sticky md:flex lg:w-56 lg:px-3",
!isPlatformPages && "max-h-screen"
"max-h-screen"
)}>
<div className="flex h-full flex-col justify-between py-3 lg:pt-4">
<header className="todesktop:-mt-3 todesktop:flex-col-reverse items-center justify-between todesktop:[-webkit-app-region:drag] md:hidden lg:flex">
Expand Down Expand Up @@ -125,47 +120,45 @@ export function SideBar({ bannersHeight, user }: SideBarProps) {
<Navigation />
</div>

{!isPlatformPages && (
<div className="md:px-2 md:pb-4 lg:p-0">
{bottomNavItems.map((item, index) => (
<Tooltip side="right" content={t(item.name)} className="lg:hidden" key={item.name}>
<ButtonOrLink
id={item.name}
href={item.href || undefined}
aria-label={t(item.name)}
target={item.target}
className={classNames(
"text-left",
"justify-right group flex items-center rounded-md px-2 py-1.5 font-medium text-default text-sm transition [&[aria-current='page']]:bg-emphasis",
"mt-0.5 w-full text-sm [&[aria-current='page']]:text-emphasis",
isLocaleReady ? "hover:bg-subtle hover:text-emphasis" : "",
index === 0 && "mt-3"
)}
onClick={item.onClick}>
{!!item.icon && (
<Icon
name={item.isLoading ? "rotate-cw" : item.icon}
className={classNames(
"h-4 w-4 shrink-0 aria-[aria-current='page']:text-inherit",
"ml-3 md:mx-auto lg:ltr:mr-2 lg:rtl:ml-2",
item.isLoading && "animate-spin"
)}
aria-hidden="true"
/>
)}
{isLocaleReady ? (
<span className="hidden w-full justify-between lg:flex">
<div className="flex">{t(item.name)}</div>
</span>
) : (
<SkeletonText className="h-[20px] w-full" />
)}
</ButtonOrLink>
</Tooltip>
))}
{!IS_VISUAL_REGRESSION_TESTING && <Credits />}
</div>
)}
<div className="md:px-2 md:pb-4 lg:p-0">
{bottomNavItems.map((item, index) => (
<Tooltip side="right" content={t(item.name)} className="lg:hidden" key={item.name}>
<ButtonOrLink
id={item.name}
href={item.href || undefined}
aria-label={t(item.name)}
target={item.target}
className={classNames(
"text-left",
"justify-right group flex items-center rounded-md px-2 py-1.5 font-medium text-default text-sm transition [&[aria-current='page']]:bg-emphasis",
"mt-0.5 w-full text-sm [&[aria-current='page']]:text-emphasis",
isLocaleReady ? "hover:bg-subtle hover:text-emphasis" : "",
index === 0 && "mt-3"
)}
onClick={item.onClick}>
{!!item.icon && (
<Icon
name={item.isLoading ? "rotate-cw" : item.icon}
className={classNames(
"h-4 w-4 shrink-0 aria-[aria-current='page']:text-inherit",
"ml-3 md:mx-auto lg:ltr:mr-2 lg:rtl:ml-2",
item.isLoading && "animate-spin"
)}
aria-hidden="true"
/>
)}
{isLocaleReady ? (
<span className="hidden w-full justify-between lg:flex">
<div className="flex">{t(item.name)}</div>
</span>
) : (
<SkeletonText className="h-[20px] w-full" />
)}
</ButtonOrLink>
</Tooltip>
))}
{!IS_VISUAL_REGRESSION_TESTING && <Credits />}
</div>
</aside>
</div>
);
Expand Down
10 changes: 0 additions & 10 deletions apps/web/modules/shell/user-dropdown/UserDropdown.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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>,
}));
Expand Down
Loading
Loading