Skip to content

Commit

Permalink
chore: settings/teams and settings/billing - remove pages router …
Browse files Browse the repository at this point in the history
…and use app router (#16751)

* remove pages router and use app router

* revert yarn.lock

* remove line break from yarn lock

* Add booking limits page to app dir

* revert yarn.lock

* do not render bookingLimits from pages router

* clean up code

* remove isAppDir

* revert unneeded change

* add layout to billing page

* remove files not needed

* rename imports

* remove APP_ROUTER_SETTINGS_DEVELOPER

* remove layout
  • Loading branch information
hbjORbj authored Dec 4, 2024
1 parent 9085287 commit d60b6c6
Show file tree
Hide file tree
Showing 41 changed files with 51 additions and 353 deletions.
1 change: 0 additions & 1 deletion .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -357,7 +357,6 @@ APP_ROUTER_APPS_CATEGORIES_CATEGORY_ENABLED=0
APP_ROUTER_BOOKING_ENABLED=0
APP_ROUTER_BOOKINGS_STATUS_ENABLED=0
APP_ROUTER_WORKFLOWS_ENABLED=0
APP_ROUTER_SETTINGS_TEAMS_ENABLED=0
APP_ROUTER_GETTING_STARTED_STEP_ENABLED=0
APP_ROUTER_APPS_ENABLED=0
APP_ROUTER_VIDEO_ENABLED=0
Expand Down
1 change: 0 additions & 1 deletion apps/web/abTest/middlewareFactory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ const ROUTES: [URLPattern, boolean][] = [
["/auth/platform/:path*", process.env.APP_ROUTER_AUTH_PLATFORM_ENABLED === "1"] as const,
["/auth/oauth2/:path*", process.env.APP_ROUTER_AUTH_OAUTH2_ENABLED === "1"] as const,
["/workflows/:path*", process.env.APP_ROUTER_WORKFLOWS_ENABLED === "1"] as const,
["/settings/teams/:path*", process.env.APP_ROUTER_SETTINGS_TEAMS_ENABLED === "1"] as const,
["/getting-started/:step", process.env.APP_ROUTER_GETTING_STARTED_STEP_ENABLED === "1"] as const,
["/apps", process.env.APP_ROUTER_APPS_ENABLED === "1"] as const,
["/bookings/:status", process.env.APP_ROUTER_BOOKINGS_STATUS_ENABLED === "1"] as const,
Expand Down
5 changes: 0 additions & 5 deletions apps/web/app/future/settings/(settings)/layout.tsx

This file was deleted.

This file was deleted.

21 changes: 0 additions & 21 deletions apps/web/app/future/settings/platform/new/page.tsx

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

16 changes: 0 additions & 16 deletions apps/web/app/future/settings/platform/page.tsx

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,7 @@ export const generateMetadata = async () =>
);

const Page = async () => {
// FIXME: Refactor me once next-auth endpoint is migrated to App Router
const session = await getServerSessionForAppDir();

const t = await getFixedT(session?.user.locale || "en");

return (
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import BillingPage, { generateMetadata } from "app/future/settings/(settings)/billing/page";
import BillingPage, { generateMetadata } from "app/settings/(settings-layout)/billing/page";

export { generateMetadata };

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ const Page = async () => {
title={t("booking_appearance")}
description={t("appearance_team_description")}
borderInShellHeader={false}>
<LegacyPage isAppDir={true} />
<LegacyPage />
</SettingsHeader>
);
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ const Page = async () => {
title={t("booking_appearance")}
description={t("appearance_team_description")}
borderInShellHeader={false}>
<LegacyPage isAppDir={true} />
<LegacyPage />
</SettingsHeader>
);
};
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import BillingPage, { generateMetadata } from "app/settings/(settings-layout)/billing/page";

export { generateMetadata };
export default BillingPage;
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import { _generateMetadata, getFixedT } from "app/_utils";

import { getServerSessionForAppDir } from "@calcom/features/auth/lib/get-server-session-for-app-dir";
import TeamBookingLimitsView from "@calcom/features/ee/teams/pages/team-booking-limits-view";
import SettingsHeader from "@calcom/features/settings/appDir/SettingsHeader";

export const generateMetadata = async () =>
await _generateMetadata(
(t) => t("booking_limits"),
(t) => t("booking_limits_team_description")
);

const Page = async () => {
const session = await getServerSessionForAppDir();
const t = await getFixedT(session?.user.locale || "en");

return (
<SettingsHeader
title={t("booking_limits")}
description={t("booking_limits_team_description")}
borderInShellHeader={false}>
<TeamBookingLimitsView />
</SettingsHeader>
);
};

export default Page;
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ const Page = async () => {

return (
<SettingsHeader title={t("team_members")} description={t("members_team_description")}>
<LegacyPage isAppDir={true} />
<LegacyPage />
</SettingsHeader>
);
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ const Page = async () => {
title={t("profile")}
description={t("profile_team_description")}
borderInShellHeader={true}>
<LegacyPage isAppDir={true} />
<LegacyPage />
</SettingsHeader>
);
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ const Page = async () => {

return (
<SettingsHeader title={t("teams")} description={t("create_manage_teams_collaborative")}>
<LegacyPage isAppDir={true} />
<LegacyPage />
</SettingsHeader>
);
};
Expand Down
File renamed without changes.
1 change: 0 additions & 1 deletion apps/web/middleware.ts
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,6 @@ export const config = {
"/workflows/:path*",
"/future/workflows/:path*",
"/settings/teams/:path*",
"/future/settings/teams/:path*",
"/getting-started/:step/",
"/future/getting-started/:step/",
"/apps",
Expand Down
23 changes: 0 additions & 23 deletions apps/web/pages/settings/billing/index.tsx

This file was deleted.

11 changes: 0 additions & 11 deletions apps/web/pages/settings/teams/[id]/appearance.tsx

This file was deleted.

3 changes: 0 additions & 3 deletions apps/web/pages/settings/teams/[id]/billing.tsx

This file was deleted.

24 changes: 0 additions & 24 deletions apps/web/pages/settings/teams/[id]/bookingLimits.tsx

This file was deleted.

27 changes: 0 additions & 27 deletions apps/web/pages/settings/teams/[id]/event-type.tsx

This file was deleted.

11 changes: 0 additions & 11 deletions apps/web/pages/settings/teams/[id]/members.tsx

This file was deleted.

27 changes: 0 additions & 27 deletions apps/web/pages/settings/teams/[id]/onboard-members.tsx

This file was deleted.

11 changes: 0 additions & 11 deletions apps/web/pages/settings/teams/[id]/profile.tsx

This file was deleted.

11 changes: 0 additions & 11 deletions apps/web/pages/settings/teams/index.tsx

This file was deleted.

Loading

0 comments on commit d60b6c6

Please sign in to comment.