From 3ae53a4b6e8438ed05e12eaa341bd364237098c5 Mon Sep 17 00:00:00 2001 From: Benny Joo Date: Thu, 19 Sep 2024 04:59:32 -0400 Subject: [PATCH] chore: App router - Fix errors in settings pages & add remaining pages (#16648) * fix settings/admin/page * remove references to pages for settings/teams * remove double layouts * move pages that do not need layout out of (settings) group * fix * fix * fix * fix * add sso page and fix layouts --- .../future/settings/(admin)/admin/page.tsx | 7 +- .../organizations/appearance/layout.tsx | 5 -- .../organizations/billing/layout.tsx | 5 -- .../(settings)/organizations/billing/page.tsx | 12 +--- .../organizations/general/layout.tsx | 5 -- .../(settings)/organizations/general/page.tsx | 17 ++++- .../organizations/members/layout.tsx | 5 -- .../(settings)/organizations/members/page.tsx | 17 ++++- .../organizations/profile/layout.tsx | 5 -- .../(settings)/organizations/profile/page.tsx | 20 +++++- .../(settings)/organizations/sso/page.tsx | 24 +++++++ .../teams/other/[id]/appearance/layout.tsx | 5 -- .../teams/other/[id]/appearance/page.tsx | 20 +++++- .../teams/other/[id]/members/layout.tsx | 5 -- .../teams/other/[id]/members/page.tsx | 18 ++++- .../teams/other/[id]/profile/layout.tsx | 5 -- .../teams/other/[id]/profile/page.tsx | 17 ++++- .../organizations/teams/other/layout.tsx | 5 -- .../organizations/teams/other/page.ts | 11 --- .../organizations/teams/other/page.tsx | 24 +++++++ .../(settings)/teams/[id]/appearance/page.tsx | 20 +++++- .../(settings)/teams/[id]/billing/page.tsx | 13 +--- .../(settings)/teams/[id]/members/page.tsx | 17 ++++- .../(settings)/teams/[id]/profile/page.tsx | 20 +++++- .../future/settings/(settings)/teams/page.ts | 11 --- .../future/settings/(settings)/teams/page.tsx | 24 +++++++ .../organizations/[id]/about/page.tsx | 6 ++ .../organizations/[id]/add-teams/page.tsx | 6 ++ .../[id]/onboard-members/page.tsx | 6 ++ .../organizations/appearance/page.tsx | 3 +- .../teams/[id]/event-type/page.tsx | 5 +- .../teams/[id]/onboard-members/page.tsx | 5 +- .../{(settings) => }/teams/new/page.tsx | 5 +- .../settings/teams/[id]/event-types-view.tsx | 67 +++++++++++++++++++ .../teams/[id]/onboard-members-view.tsx | 12 ++++ .../teams/new/create-new-team-view.tsx | 62 +++++++++++++++++ .../pages/settings/organizations/billing.tsx | 8 +-- .../pages/settings/organizations/general.tsx | 6 +- .../pages/settings/organizations/members.tsx | 6 +- .../pages/settings/organizations/profile.tsx | 6 +- apps/web/pages/settings/organizations/sso.tsx | 6 +- .../teams/other/[id]/appearance.tsx | 6 +- .../teams/other/[id]/members.tsx | 6 +- .../teams/other/[id]/profile.tsx | 6 +- .../teams/other/{index.ts => index.tsx} | 6 +- .../pages/settings/teams/[id]/appearance.tsx | 6 +- .../web/pages/settings/teams/[id]/billing.tsx | 8 +-- .../pages/settings/teams/[id]/event-type.tsx | 61 +---------------- .../web/pages/settings/teams/[id]/members.tsx | 6 +- .../settings/teams/[id]/onboard-members.tsx | 10 +-- .../web/pages/settings/teams/[id]/profile.tsx | 6 +- apps/web/pages/settings/teams/index.ts | 9 --- apps/web/pages/settings/teams/index.tsx | 11 +++ apps/web/pages/settings/teams/new/index.tsx | 51 +------------- .../ee/components/CommonSkeletonLoaders.tsx | 12 +++- .../ee/organizations/pages/organization.tsx | 6 +- .../organizations/pages/settings/general.tsx | 36 +++++++--- .../organizations/pages/settings/members.tsx | 8 +-- .../settings/other-team-listing-view.tsx | 9 ++- .../settings/other-team-members-view.tsx | 45 ++++++------- .../settings/other-team-profile-view.tsx | 7 +- .../organizations/pages/settings/profile.tsx | 25 ++++--- .../features/ee/sso/page/orgs-sso-view.tsx | 9 ++- .../ee/teams/pages/team-appearance-view.tsx | 29 ++++---- .../ee/teams/pages/team-billing-view.tsx | 34 ---------- .../ee/teams/pages/team-listing-view.tsx | 7 +- .../ee/teams/pages/team-members-view.tsx | 9 ++- .../ee/teams/pages/team-profile-view.tsx | 26 ++++--- 68 files changed, 590 insertions(+), 410 deletions(-) delete mode 100644 apps/web/app/future/settings/(settings)/organizations/appearance/layout.tsx delete mode 100644 apps/web/app/future/settings/(settings)/organizations/billing/layout.tsx delete mode 100644 apps/web/app/future/settings/(settings)/organizations/general/layout.tsx delete mode 100644 apps/web/app/future/settings/(settings)/organizations/members/layout.tsx delete mode 100644 apps/web/app/future/settings/(settings)/organizations/profile/layout.tsx create mode 100644 apps/web/app/future/settings/(settings)/organizations/sso/page.tsx delete mode 100644 apps/web/app/future/settings/(settings)/organizations/teams/other/[id]/appearance/layout.tsx delete mode 100644 apps/web/app/future/settings/(settings)/organizations/teams/other/[id]/members/layout.tsx delete mode 100644 apps/web/app/future/settings/(settings)/organizations/teams/other/[id]/profile/layout.tsx delete mode 100644 apps/web/app/future/settings/(settings)/organizations/teams/other/layout.tsx delete mode 100644 apps/web/app/future/settings/(settings)/organizations/teams/other/page.ts create mode 100644 apps/web/app/future/settings/(settings)/organizations/teams/other/page.tsx delete mode 100644 apps/web/app/future/settings/(settings)/teams/page.ts create mode 100644 apps/web/app/future/settings/(settings)/teams/page.tsx rename apps/web/app/future/settings/{(settings) => }/organizations/appearance/page.tsx (77%) rename apps/web/app/future/settings/{(settings) => }/teams/[id]/event-type/page.tsx (59%) rename apps/web/app/future/settings/{(settings) => }/teams/[id]/onboard-members/page.tsx (58%) rename apps/web/app/future/settings/{(settings) => }/teams/new/page.tsx (57%) create mode 100644 apps/web/modules/settings/teams/[id]/event-types-view.tsx create mode 100644 apps/web/modules/settings/teams/[id]/onboard-members-view.tsx create mode 100644 apps/web/modules/settings/teams/new/create-new-team-view.tsx rename apps/web/pages/settings/organizations/teams/other/{index.ts => index.tsx} (58%) delete mode 100644 apps/web/pages/settings/teams/index.ts create mode 100644 apps/web/pages/settings/teams/index.tsx delete mode 100644 packages/features/ee/teams/pages/team-billing-view.tsx diff --git a/apps/web/app/future/settings/(admin)/admin/page.tsx b/apps/web/app/future/settings/(admin)/admin/page.tsx index 77f09f99a3dba7..4efacc89bb0189 100644 --- a/apps/web/app/future/settings/(admin)/admin/page.tsx +++ b/apps/web/app/future/settings/(admin)/admin/page.tsx @@ -1,8 +1,4 @@ -import LegacyPage from "@pages/settings/admin/index"; import { _generateMetadata } from "app/_utils"; -import { WithLayout } from "app/layoutHOC"; - -import { getLayout } from "@components/auth/layouts/AdminLayoutAppDir"; export const generateMetadata = async () => await _generateMetadata( @@ -10,4 +6,5 @@ export const generateMetadata = async () => () => "admin_description" ); -export default WithLayout({ getServerLayout: getLayout, Page: LegacyPage })<"P">; +const Page = () =>

Admin index

; +export default Page; diff --git a/apps/web/app/future/settings/(settings)/organizations/appearance/layout.tsx b/apps/web/app/future/settings/(settings)/organizations/appearance/layout.tsx deleted file mode 100644 index 9da17cb2818d7b..00000000000000 --- a/apps/web/app/future/settings/(settings)/organizations/appearance/layout.tsx +++ /dev/null @@ -1,5 +0,0 @@ -import { WithLayout } from "app/layoutHOC"; - -import { getLayout } from "@calcom/features/settings/appDir/SettingsLayoutAppDir"; - -export default WithLayout({ getServerLayout: getLayout }); diff --git a/apps/web/app/future/settings/(settings)/organizations/billing/layout.tsx b/apps/web/app/future/settings/(settings)/organizations/billing/layout.tsx deleted file mode 100644 index 9da17cb2818d7b..00000000000000 --- a/apps/web/app/future/settings/(settings)/organizations/billing/layout.tsx +++ /dev/null @@ -1,5 +0,0 @@ -import { WithLayout } from "app/layoutHOC"; - -import { getLayout } from "@calcom/features/settings/appDir/SettingsLayoutAppDir"; - -export default WithLayout({ getServerLayout: getLayout }); diff --git a/apps/web/app/future/settings/(settings)/organizations/billing/page.tsx b/apps/web/app/future/settings/(settings)/organizations/billing/page.tsx index 52080e55f5b6c8..7993b194a42783 100644 --- a/apps/web/app/future/settings/(settings)/organizations/billing/page.tsx +++ b/apps/web/app/future/settings/(settings)/organizations/billing/page.tsx @@ -1,11 +1,5 @@ -import { _generateMetadata } from "app/_utils"; +import BillingPage, { generateMetadata } from "../../billing/page"; -import Page from "~/settings/billing/billing-view"; +export { generateMetadata }; -export const generateMetadata = async () => - await _generateMetadata( - (t) => t("billing"), - (t) => t("manage_billing_description") - ); - -export default Page; +export default BillingPage; diff --git a/apps/web/app/future/settings/(settings)/organizations/general/layout.tsx b/apps/web/app/future/settings/(settings)/organizations/general/layout.tsx deleted file mode 100644 index 9da17cb2818d7b..00000000000000 --- a/apps/web/app/future/settings/(settings)/organizations/general/layout.tsx +++ /dev/null @@ -1,5 +0,0 @@ -import { WithLayout } from "app/layoutHOC"; - -import { getLayout } from "@calcom/features/settings/appDir/SettingsLayoutAppDir"; - -export default WithLayout({ getServerLayout: getLayout }); diff --git a/apps/web/app/future/settings/(settings)/organizations/general/page.tsx b/apps/web/app/future/settings/(settings)/organizations/general/page.tsx index e55435094bf079..30416c6daa3c08 100644 --- a/apps/web/app/future/settings/(settings)/organizations/general/page.tsx +++ b/apps/web/app/future/settings/(settings)/organizations/general/page.tsx @@ -1,6 +1,8 @@ -import { _generateMetadata } from "app/_utils"; +import { _generateMetadata, getFixedT } from "app/_utils"; -import Page from "@calcom/features/ee/organizations/pages/settings/general"; +import { getServerSessionForAppDir } from "@calcom/features/auth/lib/get-server-session-for-app-dir"; +import LegacyPage from "@calcom/features/ee/organizations/pages/settings/general"; +import SettingsHeader from "@calcom/features/settings/appDir/SettingsHeader"; export const generateMetadata = async () => await _generateMetadata( @@ -8,4 +10,15 @@ export const generateMetadata = async () => (t) => t("general_description") ); +const Page = async () => { + const session = await getServerSessionForAppDir(); + const t = await getFixedT(session?.user.locale || "en"); + + return ( + + + + ); +}; + export default Page; diff --git a/apps/web/app/future/settings/(settings)/organizations/members/layout.tsx b/apps/web/app/future/settings/(settings)/organizations/members/layout.tsx deleted file mode 100644 index 9da17cb2818d7b..00000000000000 --- a/apps/web/app/future/settings/(settings)/organizations/members/layout.tsx +++ /dev/null @@ -1,5 +0,0 @@ -import { WithLayout } from "app/layoutHOC"; - -import { getLayout } from "@calcom/features/settings/appDir/SettingsLayoutAppDir"; - -export default WithLayout({ getServerLayout: getLayout }); diff --git a/apps/web/app/future/settings/(settings)/organizations/members/page.tsx b/apps/web/app/future/settings/(settings)/organizations/members/page.tsx index 5c90c6869eac7c..e4ee4b40d1400b 100644 --- a/apps/web/app/future/settings/(settings)/organizations/members/page.tsx +++ b/apps/web/app/future/settings/(settings)/organizations/members/page.tsx @@ -1,6 +1,8 @@ -import { _generateMetadata } from "app/_utils"; +import { _generateMetadata, getFixedT } from "app/_utils"; -import Page from "@calcom/features/ee/organizations/pages/settings/members"; +import { getServerSessionForAppDir } from "@calcom/features/auth/lib/get-server-session-for-app-dir"; +import LegacyPage from "@calcom/features/ee/organizations/pages/settings/members"; +import SettingsHeader from "@calcom/features/settings/appDir/SettingsHeader"; export const generateMetadata = async () => await _generateMetadata( @@ -8,4 +10,15 @@ export const generateMetadata = async () => (t) => t("organization_description") ); +const Page = async () => { + const session = await getServerSessionForAppDir(); + const t = await getFixedT(session?.user.locale || "en"); + + return ( + + + + ); +}; + export default Page; diff --git a/apps/web/app/future/settings/(settings)/organizations/profile/layout.tsx b/apps/web/app/future/settings/(settings)/organizations/profile/layout.tsx deleted file mode 100644 index 9da17cb2818d7b..00000000000000 --- a/apps/web/app/future/settings/(settings)/organizations/profile/layout.tsx +++ /dev/null @@ -1,5 +0,0 @@ -import { WithLayout } from "app/layoutHOC"; - -import { getLayout } from "@calcom/features/settings/appDir/SettingsLayoutAppDir"; - -export default WithLayout({ getServerLayout: getLayout }); diff --git a/apps/web/app/future/settings/(settings)/organizations/profile/page.tsx b/apps/web/app/future/settings/(settings)/organizations/profile/page.tsx index 3450c5abddde9b..a9e54e098b3c53 100644 --- a/apps/web/app/future/settings/(settings)/organizations/profile/page.tsx +++ b/apps/web/app/future/settings/(settings)/organizations/profile/page.tsx @@ -1,6 +1,8 @@ -import { _generateMetadata } from "app/_utils"; +import { _generateMetadata, getFixedT } from "app/_utils"; -import Page from "@calcom/features/ee/organizations/pages/settings/profile"; +import { getServerSessionForAppDir } from "@calcom/features/auth/lib/get-server-session-for-app-dir"; +import LegacyPage from "@calcom/features/ee/organizations/pages/settings/profile"; +import SettingsHeader from "@calcom/features/settings/appDir/SettingsHeader"; export const generateMetadata = async () => await _generateMetadata( @@ -8,4 +10,18 @@ export const generateMetadata = async () => (t) => t("profile_org_description") ); +const Page = async () => { + const session = await getServerSessionForAppDir(); + const t = await getFixedT(session?.user.locale || "en"); + + return ( + + + + ); +}; + export default Page; diff --git a/apps/web/app/future/settings/(settings)/organizations/sso/page.tsx b/apps/web/app/future/settings/(settings)/organizations/sso/page.tsx new file mode 100644 index 00000000000000..55c561e75baf31 --- /dev/null +++ b/apps/web/app/future/settings/(settings)/organizations/sso/page.tsx @@ -0,0 +1,24 @@ +import { _generateMetadata, getFixedT } from "app/_utils"; + +import { getServerSessionForAppDir } from "@calcom/features/auth/lib/get-server-session-for-app-dir"; +import OrgSSOView from "@calcom/features/ee/sso/page/orgs-sso-view"; +import SettingsHeader from "@calcom/features/settings/appDir/SettingsHeader"; + +export const generateMetadata = async () => + await _generateMetadata( + (t) => t("sso_configuration"), + (t) => t("sso_configuration_description_orgs") + ); + +const Page = async () => { + const session = await getServerSessionForAppDir(); + const t = await getFixedT(session?.user.locale || "en"); + + return ( + + + + ); +}; + +export default Page; diff --git a/apps/web/app/future/settings/(settings)/organizations/teams/other/[id]/appearance/layout.tsx b/apps/web/app/future/settings/(settings)/organizations/teams/other/[id]/appearance/layout.tsx deleted file mode 100644 index 9da17cb2818d7b..00000000000000 --- a/apps/web/app/future/settings/(settings)/organizations/teams/other/[id]/appearance/layout.tsx +++ /dev/null @@ -1,5 +0,0 @@ -import { WithLayout } from "app/layoutHOC"; - -import { getLayout } from "@calcom/features/settings/appDir/SettingsLayoutAppDir"; - -export default WithLayout({ getServerLayout: getLayout }); diff --git a/apps/web/app/future/settings/(settings)/organizations/teams/other/[id]/appearance/page.tsx b/apps/web/app/future/settings/(settings)/organizations/teams/other/[id]/appearance/page.tsx index ac76104d07a5f0..25f31d3027b6d4 100644 --- a/apps/web/app/future/settings/(settings)/organizations/teams/other/[id]/appearance/page.tsx +++ b/apps/web/app/future/settings/(settings)/organizations/teams/other/[id]/appearance/page.tsx @@ -1,6 +1,8 @@ -import { _generateMetadata } from "app/_utils"; +import { _generateMetadata, getFixedT } from "app/_utils"; -import Page from "@calcom/features/ee/teams/pages/team-appearance-view"; +import { getServerSessionForAppDir } from "@calcom/features/auth/lib/get-server-session-for-app-dir"; +import LegacyPage from "@calcom/features/ee/teams/pages/team-appearance-view"; +import SettingsHeader from "@calcom/features/settings/appDir/SettingsHeader"; export const generateMetadata = async () => await _generateMetadata( @@ -8,4 +10,18 @@ export const generateMetadata = async () => (t) => t("appearance_team_description") ); +const Page = async () => { + const session = await getServerSessionForAppDir(); + const t = await getFixedT(session?.user.locale || "en"); + + return ( + + + + ); +}; + export default Page; diff --git a/apps/web/app/future/settings/(settings)/organizations/teams/other/[id]/members/layout.tsx b/apps/web/app/future/settings/(settings)/organizations/teams/other/[id]/members/layout.tsx deleted file mode 100644 index 9da17cb2818d7b..00000000000000 --- a/apps/web/app/future/settings/(settings)/organizations/teams/other/[id]/members/layout.tsx +++ /dev/null @@ -1,5 +0,0 @@ -import { WithLayout } from "app/layoutHOC"; - -import { getLayout } from "@calcom/features/settings/appDir/SettingsLayoutAppDir"; - -export default WithLayout({ getServerLayout: getLayout }); diff --git a/apps/web/app/future/settings/(settings)/organizations/teams/other/[id]/members/page.tsx b/apps/web/app/future/settings/(settings)/organizations/teams/other/[id]/members/page.tsx index 9e5018ada3668e..1896558bec3d29 100644 --- a/apps/web/app/future/settings/(settings)/organizations/teams/other/[id]/members/page.tsx +++ b/apps/web/app/future/settings/(settings)/organizations/teams/other/[id]/members/page.tsx @@ -1,6 +1,8 @@ -import { _generateMetadata } from "app/_utils"; +import { _generateMetadata, getFixedT } from "app/_utils"; -import Page from "@calcom/features/ee/organizations/pages/settings/other-team-members-view"; +import { getServerSessionForAppDir } from "@calcom/features/auth/lib/get-server-session-for-app-dir"; +import LegacyPage from "@calcom/features/ee/organizations/pages/settings/other-team-members-view"; +import SettingsHeader from "@calcom/features/settings/appDir/SettingsHeader"; export const generateMetadata = async () => await _generateMetadata( @@ -8,4 +10,16 @@ export const generateMetadata = async () => (t) => t("members_team_description") ); +const Page = async () => { + const session = await getServerSessionForAppDir(); + const t = await getFixedT(session?.user.locale || "en"); + + return ( + // TODO: Add CTA Button + + + + ); +}; + export default Page; diff --git a/apps/web/app/future/settings/(settings)/organizations/teams/other/[id]/profile/layout.tsx b/apps/web/app/future/settings/(settings)/organizations/teams/other/[id]/profile/layout.tsx deleted file mode 100644 index 9da17cb2818d7b..00000000000000 --- a/apps/web/app/future/settings/(settings)/organizations/teams/other/[id]/profile/layout.tsx +++ /dev/null @@ -1,5 +0,0 @@ -import { WithLayout } from "app/layoutHOC"; - -import { getLayout } from "@calcom/features/settings/appDir/SettingsLayoutAppDir"; - -export default WithLayout({ getServerLayout: getLayout }); diff --git a/apps/web/app/future/settings/(settings)/organizations/teams/other/[id]/profile/page.tsx b/apps/web/app/future/settings/(settings)/organizations/teams/other/[id]/profile/page.tsx index 66cf714fbcc5b5..11a5626af0b206 100644 --- a/apps/web/app/future/settings/(settings)/organizations/teams/other/[id]/profile/page.tsx +++ b/apps/web/app/future/settings/(settings)/organizations/teams/other/[id]/profile/page.tsx @@ -1,6 +1,8 @@ -import { _generateMetadata } from "app/_utils"; +import { _generateMetadata, getFixedT } from "app/_utils"; -import Page from "@calcom/features/ee/organizations/pages/settings/other-team-profile-view"; +import { getServerSessionForAppDir } from "@calcom/features/auth/lib/get-server-session-for-app-dir"; +import LegacyPage from "@calcom/features/ee/organizations/pages/settings/other-team-profile-view"; +import SettingsHeader from "@calcom/features/settings/appDir/SettingsHeader"; export const generateMetadata = async () => await _generateMetadata( @@ -8,4 +10,15 @@ export const generateMetadata = async () => (t) => t("profile_team_description") ); +const Page = async () => { + const session = await getServerSessionForAppDir(); + const t = await getFixedT(session?.user.locale || "en"); + + return ( + + + + ); +}; + export default Page; diff --git a/apps/web/app/future/settings/(settings)/organizations/teams/other/layout.tsx b/apps/web/app/future/settings/(settings)/organizations/teams/other/layout.tsx deleted file mode 100644 index 9da17cb2818d7b..00000000000000 --- a/apps/web/app/future/settings/(settings)/organizations/teams/other/layout.tsx +++ /dev/null @@ -1,5 +0,0 @@ -import { WithLayout } from "app/layoutHOC"; - -import { getLayout } from "@calcom/features/settings/appDir/SettingsLayoutAppDir"; - -export default WithLayout({ getServerLayout: getLayout }); diff --git a/apps/web/app/future/settings/(settings)/organizations/teams/other/page.ts b/apps/web/app/future/settings/(settings)/organizations/teams/other/page.ts deleted file mode 100644 index ffaf5302cb166b..00000000000000 --- a/apps/web/app/future/settings/(settings)/organizations/teams/other/page.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { _generateMetadata } from "app/_utils"; - -import Page from "@calcom/features/ee/organizations/pages/settings/other-team-listing-view"; - -export const generateMetadata = async () => - await _generateMetadata( - (t) => t("org_admin_other_teams"), - (t) => t("org_admin_other_teams_description") - ); - -export default Page; diff --git a/apps/web/app/future/settings/(settings)/organizations/teams/other/page.tsx b/apps/web/app/future/settings/(settings)/organizations/teams/other/page.tsx new file mode 100644 index 00000000000000..b68b2199cd27cf --- /dev/null +++ b/apps/web/app/future/settings/(settings)/organizations/teams/other/page.tsx @@ -0,0 +1,24 @@ +import { _generateMetadata, getFixedT } from "app/_utils"; + +import { getServerSessionForAppDir } from "@calcom/features/auth/lib/get-server-session-for-app-dir"; +import LegacyPage from "@calcom/features/ee/organizations/pages/settings/other-team-listing-view"; +import SettingsHeader from "@calcom/features/settings/appDir/SettingsHeader"; + +export const generateMetadata = async () => + await _generateMetadata( + (t) => t("org_admin_other_teams"), + (t) => t("org_admin_other_teams_description") + ); + +const Page = async () => { + const session = await getServerSessionForAppDir(); + const t = await getFixedT(session?.user.locale || "en"); + + return ( + + + + ); +}; + +export default Page; diff --git a/apps/web/app/future/settings/(settings)/teams/[id]/appearance/page.tsx b/apps/web/app/future/settings/(settings)/teams/[id]/appearance/page.tsx index ac76104d07a5f0..25f31d3027b6d4 100644 --- a/apps/web/app/future/settings/(settings)/teams/[id]/appearance/page.tsx +++ b/apps/web/app/future/settings/(settings)/teams/[id]/appearance/page.tsx @@ -1,6 +1,8 @@ -import { _generateMetadata } from "app/_utils"; +import { _generateMetadata, getFixedT } from "app/_utils"; -import Page from "@calcom/features/ee/teams/pages/team-appearance-view"; +import { getServerSessionForAppDir } from "@calcom/features/auth/lib/get-server-session-for-app-dir"; +import LegacyPage from "@calcom/features/ee/teams/pages/team-appearance-view"; +import SettingsHeader from "@calcom/features/settings/appDir/SettingsHeader"; export const generateMetadata = async () => await _generateMetadata( @@ -8,4 +10,18 @@ export const generateMetadata = async () => (t) => t("appearance_team_description") ); +const Page = async () => { + const session = await getServerSessionForAppDir(); + const t = await getFixedT(session?.user.locale || "en"); + + return ( + + + + ); +}; + export default Page; diff --git a/apps/web/app/future/settings/(settings)/teams/[id]/billing/page.tsx b/apps/web/app/future/settings/(settings)/teams/[id]/billing/page.tsx index 34e7f004a4d0a0..e88787f0b75dd1 100644 --- a/apps/web/app/future/settings/(settings)/teams/[id]/billing/page.tsx +++ b/apps/web/app/future/settings/(settings)/teams/[id]/billing/page.tsx @@ -1,11 +1,4 @@ -import { _generateMetadata } from "app/_utils"; +import BillingPage, { generateMetadata } from "../../../billing/page"; -import Page from "~/settings/billing/billing-view"; - -export const generateMetadata = async () => - await _generateMetadata( - (t) => t("billing"), - (t) => t("team_billing_description") - ); - -export default Page; +export { generateMetadata }; +export default BillingPage; diff --git a/apps/web/app/future/settings/(settings)/teams/[id]/members/page.tsx b/apps/web/app/future/settings/(settings)/teams/[id]/members/page.tsx index 0f38c54f5975d2..711a118776de23 100644 --- a/apps/web/app/future/settings/(settings)/teams/[id]/members/page.tsx +++ b/apps/web/app/future/settings/(settings)/teams/[id]/members/page.tsx @@ -1,6 +1,8 @@ -import { _generateMetadata } from "app/_utils"; +import { _generateMetadata, getFixedT } from "app/_utils"; -import Page from "@calcom/features/ee/teams/pages/team-members-view"; +import { getServerSessionForAppDir } from "@calcom/features/auth/lib/get-server-session-for-app-dir"; +import LegacyPage from "@calcom/features/ee/teams/pages/team-members-view"; +import SettingsHeader from "@calcom/features/settings/appDir/SettingsHeader"; export const generateMetadata = async () => await _generateMetadata( @@ -8,4 +10,15 @@ export const generateMetadata = async () => (t) => t("members_team_description") ); +const Page = async () => { + const session = await getServerSessionForAppDir(); + const t = await getFixedT(session?.user.locale || "en"); + + return ( + + + + ); +}; + export default Page; diff --git a/apps/web/app/future/settings/(settings)/teams/[id]/profile/page.tsx b/apps/web/app/future/settings/(settings)/teams/[id]/profile/page.tsx index b2e02352ef39f2..b08a143563289d 100644 --- a/apps/web/app/future/settings/(settings)/teams/[id]/profile/page.tsx +++ b/apps/web/app/future/settings/(settings)/teams/[id]/profile/page.tsx @@ -1,6 +1,8 @@ -import { _generateMetadata } from "app/_utils"; +import { _generateMetadata, getFixedT } from "app/_utils"; -import Page from "@calcom/features/ee/teams/pages/team-profile-view"; +import { getServerSessionForAppDir } from "@calcom/features/auth/lib/get-server-session-for-app-dir"; +import LegacyPage from "@calcom/features/ee/teams/pages/team-profile-view"; +import SettingsHeader from "@calcom/features/settings/appDir/SettingsHeader"; export const generateMetadata = async () => await _generateMetadata( @@ -8,4 +10,18 @@ export const generateMetadata = async () => (t) => t("profile_team_description") ); +const Page = async () => { + const session = await getServerSessionForAppDir(); + const t = await getFixedT(session?.user.locale || "en"); + + return ( + + + + ); +}; + export default Page; diff --git a/apps/web/app/future/settings/(settings)/teams/page.ts b/apps/web/app/future/settings/(settings)/teams/page.ts deleted file mode 100644 index 6175f853ecda7e..00000000000000 --- a/apps/web/app/future/settings/(settings)/teams/page.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { _generateMetadata } from "app/_utils"; - -import Page from "@calcom/features/ee/teams/pages/team-listing-view"; - -export const generateMetadata = async () => - await _generateMetadata( - (t) => t("teams"), - (t) => t("create_manage_teams_collaborative") - ); - -export default Page; diff --git a/apps/web/app/future/settings/(settings)/teams/page.tsx b/apps/web/app/future/settings/(settings)/teams/page.tsx new file mode 100644 index 00000000000000..6aa5cd10734c4a --- /dev/null +++ b/apps/web/app/future/settings/(settings)/teams/page.tsx @@ -0,0 +1,24 @@ +import { _generateMetadata, getFixedT } from "app/_utils"; + +import { getServerSessionForAppDir } from "@calcom/features/auth/lib/get-server-session-for-app-dir"; +import LegacyPage from "@calcom/features/ee/teams/pages/team-listing-view"; +import SettingsHeader from "@calcom/features/settings/appDir/SettingsHeader"; + +export const generateMetadata = async () => + await _generateMetadata( + (t) => t("teams"), + (t) => t("create_manage_teams_collaborative") + ); + +const Page = async () => { + const session = await getServerSessionForAppDir(); + const t = await getFixedT(session?.user.locale || "en"); + + return ( + + + + ); +}; + +export default Page; diff --git a/apps/web/app/future/settings/organizations/[id]/about/page.tsx b/apps/web/app/future/settings/organizations/[id]/about/page.tsx index 42fca898e47d46..cb899d1e0b6a62 100644 --- a/apps/web/app/future/settings/organizations/[id]/about/page.tsx +++ b/apps/web/app/future/settings/organizations/[id]/about/page.tsx @@ -1,6 +1,9 @@ +import { withAppDirSsr } from "app/WithAppDirSsr"; import { _generateMetadata } from "app/_utils"; import { WithLayout } from "app/layoutHOC"; +import { getServerSideProps } from "@calcom/features/ee/organizations/pages/organization"; + import LegacyPage, { LayoutWrapper } from "~/settings/organizations/[id]/about-view"; export const generateMetadata = async () => @@ -9,7 +12,10 @@ export const generateMetadata = async () => (t) => t("about_your_organization_description") ); +const getData = withAppDirSsr(getServerSideProps); + export default WithLayout({ Page: LegacyPage, getLayout: LayoutWrapper, + getData, }); diff --git a/apps/web/app/future/settings/organizations/[id]/add-teams/page.tsx b/apps/web/app/future/settings/organizations/[id]/add-teams/page.tsx index 0fd0d5d11b8809..86c8f3296295a8 100644 --- a/apps/web/app/future/settings/organizations/[id]/add-teams/page.tsx +++ b/apps/web/app/future/settings/organizations/[id]/add-teams/page.tsx @@ -1,6 +1,9 @@ +import { withAppDirSsr } from "app/WithAppDirSsr"; import { _generateMetadata } from "app/_utils"; import { WithLayout } from "app/layoutHOC"; +import { getServerSideProps } from "@calcom/features/ee/organizations/pages/organization"; + import LegacyPage, { LayoutWrapper } from "~/settings/organizations/[id]/add-teams-view"; export const generateMetadata = async () => @@ -9,7 +12,10 @@ export const generateMetadata = async () => (t) => t("create_your_teams_description") ); +const getData = withAppDirSsr(getServerSideProps); + export default WithLayout({ Page: LegacyPage, getLayout: LayoutWrapper, + getData, }); diff --git a/apps/web/app/future/settings/organizations/[id]/onboard-members/page.tsx b/apps/web/app/future/settings/organizations/[id]/onboard-members/page.tsx index 113cd399bec7f2..56be6482e10470 100644 --- a/apps/web/app/future/settings/organizations/[id]/onboard-members/page.tsx +++ b/apps/web/app/future/settings/organizations/[id]/onboard-members/page.tsx @@ -1,6 +1,9 @@ +import { withAppDirSsr } from "app/WithAppDirSsr"; import { _generateMetadata } from "app/_utils"; import { WithLayout } from "app/layoutHOC"; +import { getServerSideProps } from "@calcom/features/ee/organizations/pages/organization"; + import LegacyPage, { LayoutWrapper } from "~/settings/organizations/[id]/onboard-members-view"; export const generateMetadata = async () => @@ -9,7 +12,10 @@ export const generateMetadata = async () => (t) => t("invite_organization_admins_description") ); +const getData = withAppDirSsr(getServerSideProps); + export default WithLayout({ Page: LegacyPage, getLayout: LayoutWrapper, + getData, }); diff --git a/apps/web/app/future/settings/(settings)/organizations/appearance/page.tsx b/apps/web/app/future/settings/organizations/appearance/page.tsx similarity index 77% rename from apps/web/app/future/settings/(settings)/organizations/appearance/page.tsx rename to apps/web/app/future/settings/organizations/appearance/page.tsx index 5f8b2547f0a43e..84acb6502b503c 100644 --- a/apps/web/app/future/settings/(settings)/organizations/appearance/page.tsx +++ b/apps/web/app/future/settings/organizations/appearance/page.tsx @@ -1,4 +1,5 @@ import { _generateMetadata } from "app/_utils"; +import { WithLayout } from "app/layoutHOC"; import Page from "@calcom/features/ee/organizations/pages/settings/appearance"; @@ -8,4 +9,4 @@ export const generateMetadata = async () => (t) => t("appearance_org_description") ); -export default Page; +export default WithLayout({ Page }); diff --git a/apps/web/app/future/settings/(settings)/teams/[id]/event-type/page.tsx b/apps/web/app/future/settings/teams/[id]/event-type/page.tsx similarity index 59% rename from apps/web/app/future/settings/(settings)/teams/[id]/event-type/page.tsx rename to apps/web/app/future/settings/teams/[id]/event-type/page.tsx index c741324ceb8596..47e5b8b8c12a6a 100644 --- a/apps/web/app/future/settings/(settings)/teams/[id]/event-type/page.tsx +++ b/apps/web/app/future/settings/teams/[id]/event-type/page.tsx @@ -1,11 +1,12 @@ -import LegacyPage, { GetLayout } from "@pages/settings/teams/[id]/event-type"; import { _generateMetadata } from "app/_utils"; import { WithLayout } from "app/layoutHOC"; +import CreateTeamEventType, { GetLayout } from "~/settings/teams/[id]/event-types-view"; + export const generateMetadata = async () => await _generateMetadata( (t) => t("add_new_team_event_type"), (t) => t("new_event_type_to_book_description") ); -export default WithLayout({ Page: LegacyPage, getLayout: GetLayout })<"P">; +export default WithLayout({ Page: CreateTeamEventType, getLayout: GetLayout })<"P">; diff --git a/apps/web/app/future/settings/(settings)/teams/[id]/onboard-members/page.tsx b/apps/web/app/future/settings/teams/[id]/onboard-members/page.tsx similarity index 58% rename from apps/web/app/future/settings/(settings)/teams/[id]/onboard-members/page.tsx rename to apps/web/app/future/settings/teams/[id]/onboard-members/page.tsx index adb33f8b63788d..cf2117b4ad0ef7 100644 --- a/apps/web/app/future/settings/(settings)/teams/[id]/onboard-members/page.tsx +++ b/apps/web/app/future/settings/teams/[id]/onboard-members/page.tsx @@ -1,11 +1,12 @@ -import LegacyPage, { GetLayout } from "@pages/settings/teams/[id]/onboard-members"; import { _generateMetadata } from "app/_utils"; import { WithLayout } from "app/layoutHOC"; +import AddNewTeamMembers, { GetLayout } from "~/settings/teams/[id]/onboard-members-view"; + export const generateMetadata = async () => await _generateMetadata( (t) => t("add_team_members"), (t) => t("add_team_members_description") ); -export default WithLayout({ Page: LegacyPage, getLayout: GetLayout })<"P">; +export default WithLayout({ Page: AddNewTeamMembers, getLayout: GetLayout })<"P">; diff --git a/apps/web/app/future/settings/(settings)/teams/new/page.tsx b/apps/web/app/future/settings/teams/new/page.tsx similarity index 57% rename from apps/web/app/future/settings/(settings)/teams/new/page.tsx rename to apps/web/app/future/settings/teams/new/page.tsx index 592517ab488227..160d6559d102c6 100644 --- a/apps/web/app/future/settings/(settings)/teams/new/page.tsx +++ b/apps/web/app/future/settings/teams/new/page.tsx @@ -1,11 +1,12 @@ -import LegacyPage, { LayoutWrapper } from "@pages/settings/teams/new/index"; import { _generateMetadata } from "app/_utils"; import { WithLayout } from "app/layoutHOC"; +import CreateNewTeamView, { LayoutWrapper } from "~/settings/teams/new/create-new-team-view"; + export const generateMetadata = async () => await _generateMetadata( (t) => t("create_new_team"), (t) => t("create_new_team_description") ); -export default WithLayout({ Page: LegacyPage, getLayout: LayoutWrapper })<"P">; +export default WithLayout({ Page: CreateNewTeamView, getLayout: LayoutWrapper })<"P">; diff --git a/apps/web/modules/settings/teams/[id]/event-types-view.tsx b/apps/web/modules/settings/teams/[id]/event-types-view.tsx new file mode 100644 index 00000000000000..5478f25c9145a0 --- /dev/null +++ b/apps/web/modules/settings/teams/[id]/event-types-view.tsx @@ -0,0 +1,67 @@ +"use client"; + +import { useRouter } from "next/navigation"; + +import { TeamEventTypeForm } from "@calcom/features/ee/teams/components/TeamEventTypeForm"; +import { useCompatSearchParams } from "@calcom/lib/hooks/useCompatSearchParams"; +import { useLocale } from "@calcom/lib/hooks/useLocale"; +import { WizardLayout } from "@calcom/ui"; +import { Button, showToast } from "@calcom/ui"; + +export const CreateTeamEventType = () => { + const searchParams = useCompatSearchParams(); + const { t } = useLocale(); + const router = useRouter(); + const teamId = searchParams?.get("id") ? Number(searchParams.get("id")) : -1; + + const onSuccessMutation = () => { + router.push(`/settings/teams/${teamId}/profile`); + }; + + const onErrorMutation = (err: string) => { + showToast(err, "error"); + }; + + const SubmitButton = (isPending: boolean) => { + return ( + + ); + }; + + return ( + + ); +}; + +export const GetLayout = (page: React.ReactElement) => { + const router = useRouter(); + const searchParams = useCompatSearchParams(); + const teamId = searchParams?.get("id") ? Number(searchParams.get("id")) : -1; + + return ( + { + router.push(`/settings/teams/${teamId}/profile`); + }}> + {page} + + ); +}; + +export default CreateTeamEventType; diff --git a/apps/web/modules/settings/teams/[id]/onboard-members-view.tsx b/apps/web/modules/settings/teams/[id]/onboard-members-view.tsx new file mode 100644 index 00000000000000..3fae7f5e6e589a --- /dev/null +++ b/apps/web/modules/settings/teams/[id]/onboard-members-view.tsx @@ -0,0 +1,12 @@ +"use client"; + +import AddNewTeamMembers from "@calcom/features/ee/teams/components/AddNewTeamMembers"; +import { WizardLayout } from "@calcom/ui"; + +export const GetLayout = (page: React.ReactElement) => ( + + {page} + +); + +export default AddNewTeamMembers; diff --git a/apps/web/modules/settings/teams/new/create-new-team-view.tsx b/apps/web/modules/settings/teams/new/create-new-team-view.tsx new file mode 100644 index 00000000000000..dce0adafc574f3 --- /dev/null +++ b/apps/web/modules/settings/teams/new/create-new-team-view.tsx @@ -0,0 +1,62 @@ +"use client"; + +import { useRouter } from "next/navigation"; +import React from "react"; +import { z } from "zod"; + +import { CreateANewTeamForm } from "@calcom/features/ee/teams/components"; +import { HOSTED_CAL_FEATURES } from "@calcom/lib/constants"; +import { getSafeRedirectUrl } from "@calcom/lib/getSafeRedirectUrl"; +import { useParamsWithFallback } from "@calcom/lib/hooks/useParamsWithFallback"; +import { telemetryEventTypes, useTelemetry } from "@calcom/lib/telemetry"; +import type { RouterOutputs } from "@calcom/trpc/react"; +import { WizardLayout } from "@calcom/ui"; + +const querySchema = z.object({ + returnTo: z.string().optional(), + slug: z.string().optional(), +}); + +const CreateNewTeamPage = () => { + const params = useParamsWithFallback(); + const parsedQuery = querySchema.safeParse(params); + const router = useRouter(); + const telemetry = useTelemetry(); + + const isTeamBillingEnabledClient = !!process.env.NEXT_PUBLIC_STRIPE_PUBLIC_KEY && HOSTED_CAL_FEATURES; + const flag = isTeamBillingEnabledClient + ? { + telemetryEvent: telemetryEventTypes.team_checkout_session_created, + submitLabel: "checkout", + } + : { + telemetryEvent: telemetryEventTypes.team_created, + submitLabel: "continue", + }; + + const returnToParam = + (parsedQuery.success ? getSafeRedirectUrl(parsedQuery.data.returnTo) : "/teams") || "/teams"; + + const onSuccess = (data: RouterOutputs["viewer"]["teams"]["create"]) => { + telemetry.event(flag.telemetryEvent); + router.push(data.url); + }; + + return ( + router.push(returnToParam)} + submitLabel={flag.submitLabel} + onSuccess={onSuccess} + /> + ); +}; +export const LayoutWrapper = (page: React.ReactElement) => { + return ( + + {page} + + ); +}; + +export default CreateNewTeamPage; diff --git a/apps/web/pages/settings/organizations/billing.tsx b/apps/web/pages/settings/organizations/billing.tsx index d830b3f3ac597b..d44849eea252a1 100644 --- a/apps/web/pages/settings/organizations/billing.tsx +++ b/apps/web/pages/settings/organizations/billing.tsx @@ -1,9 +1,3 @@ -import type { CalPageWrapper } from "@components/PageWrapper"; -import PageWrapper from "@components/PageWrapper"; - import BillingPage from "../../settings/billing/index"; -const Page = BillingPage as CalPageWrapper; -Page.PageWrapper = PageWrapper; - -export default Page; +export default BillingPage; diff --git a/apps/web/pages/settings/organizations/general.tsx b/apps/web/pages/settings/organizations/general.tsx index 308eecf72ff6a1..e5d5cefb108785 100644 --- a/apps/web/pages/settings/organizations/general.tsx +++ b/apps/web/pages/settings/organizations/general.tsx @@ -1,9 +1,11 @@ import OrgGeneralView from "@calcom/features/ee/organizations/pages/settings/general"; +import { getLayout } from "@calcom/features/settings/layouts/SettingsLayout"; -import type { CalPageWrapper } from "@components/PageWrapper"; import PageWrapper from "@components/PageWrapper"; -const Page = OrgGeneralView as CalPageWrapper; +const Page = () => ; + +Page.getLayout = getLayout; Page.PageWrapper = PageWrapper; export default Page; diff --git a/apps/web/pages/settings/organizations/members.tsx b/apps/web/pages/settings/organizations/members.tsx index a175173e5d1a85..34061d4a8c4331 100644 --- a/apps/web/pages/settings/organizations/members.tsx +++ b/apps/web/pages/settings/organizations/members.tsx @@ -1,6 +1,6 @@ import MembersView from "@calcom/features/ee/organizations/pages/settings/members"; +import { getLayout } from "@calcom/features/settings/layouts/SettingsLayout"; -import type { CalPageWrapper } from "@components/PageWrapper"; import PageWrapper from "@components/PageWrapper"; export { @@ -8,7 +8,9 @@ export { type PageProps, } from "@calcom/features/ee/organizations/pages/settings/getServerSidePropsMembers"; -const Page = MembersView as unknown as CalPageWrapper; +const Page = () => ; + +Page.getLayout = getLayout; Page.PageWrapper = PageWrapper; export default Page; diff --git a/apps/web/pages/settings/organizations/profile.tsx b/apps/web/pages/settings/organizations/profile.tsx index ef14c3b95711a6..e6bc8e8c1a0a95 100644 --- a/apps/web/pages/settings/organizations/profile.tsx +++ b/apps/web/pages/settings/organizations/profile.tsx @@ -1,9 +1,11 @@ import OrgProfileView from "@calcom/features/ee/organizations/pages/settings/profile"; +import { getLayout } from "@calcom/features/settings/layouts/SettingsLayout"; -import type { CalPageWrapper } from "@components/PageWrapper"; import PageWrapper from "@components/PageWrapper"; -const Page = OrgProfileView as CalPageWrapper; +const Page = () => ; + +Page.getLayout = getLayout; Page.PageWrapper = PageWrapper; export default Page; diff --git a/apps/web/pages/settings/organizations/sso.tsx b/apps/web/pages/settings/organizations/sso.tsx index 5b3b506c42e0b2..96f87e2077f5e9 100644 --- a/apps/web/pages/settings/organizations/sso.tsx +++ b/apps/web/pages/settings/organizations/sso.tsx @@ -1,9 +1,11 @@ import OrgSSOView from "@calcom/features/ee/sso/page/orgs-sso-view"; +import { getLayout } from "@calcom/features/settings/layouts/SettingsLayout"; -import type { CalPageWrapper } from "@components/PageWrapper"; import PageWrapper from "@components/PageWrapper"; -const Page = OrgSSOView as CalPageWrapper; +const Page = () => ; + +Page.getLayout = getLayout; Page.PageWrapper = PageWrapper; export default Page; diff --git a/apps/web/pages/settings/organizations/teams/other/[id]/appearance.tsx b/apps/web/pages/settings/organizations/teams/other/[id]/appearance.tsx index 6c6343e79198ad..ea0d5d2cc0fd83 100644 --- a/apps/web/pages/settings/organizations/teams/other/[id]/appearance.tsx +++ b/apps/web/pages/settings/organizations/teams/other/[id]/appearance.tsx @@ -1,9 +1,11 @@ import TeamAppearenceView from "@calcom/features/ee/teams/pages/team-appearance-view"; +import { getLayout } from "@calcom/features/settings/layouts/SettingsLayout"; -import type { CalPageWrapper } from "@components/PageWrapper"; import PageWrapper from "@components/PageWrapper"; -const Page = TeamAppearenceView as CalPageWrapper; +const Page = () => ; + +Page.getLayout = getLayout; Page.PageWrapper = PageWrapper; export default Page; diff --git a/apps/web/pages/settings/organizations/teams/other/[id]/members.tsx b/apps/web/pages/settings/organizations/teams/other/[id]/members.tsx index 14c0026a467879..fb4357175d1440 100644 --- a/apps/web/pages/settings/organizations/teams/other/[id]/members.tsx +++ b/apps/web/pages/settings/organizations/teams/other/[id]/members.tsx @@ -1,9 +1,11 @@ import TeamMembersView from "@calcom/features/ee/organizations/pages/settings/other-team-members-view"; +import { getLayout } from "@calcom/features/settings/layouts/SettingsLayout"; -import type { CalPageWrapper } from "@components/PageWrapper"; import PageWrapper from "@components/PageWrapper"; -const Page = TeamMembersView as CalPageWrapper; +const Page = () => ; + +Page.getLayout = getLayout; Page.PageWrapper = PageWrapper; export default Page; diff --git a/apps/web/pages/settings/organizations/teams/other/[id]/profile.tsx b/apps/web/pages/settings/organizations/teams/other/[id]/profile.tsx index ad4cba98e58a5a..c24a0104b0f9f6 100644 --- a/apps/web/pages/settings/organizations/teams/other/[id]/profile.tsx +++ b/apps/web/pages/settings/organizations/teams/other/[id]/profile.tsx @@ -1,9 +1,11 @@ import OtherTeamProfileView from "@calcom/features/ee/organizations/pages/settings/other-team-profile-view"; +import { getLayout } from "@calcom/features/settings/layouts/SettingsLayout"; -import type { CalPageWrapper } from "@components/PageWrapper"; import PageWrapper from "@components/PageWrapper"; -const Page = OtherTeamProfileView as CalPageWrapper; +const Page = () => ; + +Page.getLayout = getLayout; Page.PageWrapper = PageWrapper; export default Page; diff --git a/apps/web/pages/settings/organizations/teams/other/index.ts b/apps/web/pages/settings/organizations/teams/other/index.tsx similarity index 58% rename from apps/web/pages/settings/organizations/teams/other/index.ts rename to apps/web/pages/settings/organizations/teams/other/index.tsx index 06052c1f3e1fbc..84b951e9e86685 100644 --- a/apps/web/pages/settings/organizations/teams/other/index.ts +++ b/apps/web/pages/settings/organizations/teams/other/index.tsx @@ -1,9 +1,11 @@ import OtherTeamListView from "@calcom/features/ee/organizations/pages/settings/other-team-listing-view"; +import { getLayout } from "@calcom/features/settings/layouts/SettingsLayout"; import PageWrapper from "@components/PageWrapper"; -import type { CalPageWrapper } from "@components/PageWrapper"; -const Page = OtherTeamListView as CalPageWrapper; +const Page = () => ; + +Page.getLayout = getLayout; Page.PageWrapper = PageWrapper; export default Page; diff --git a/apps/web/pages/settings/teams/[id]/appearance.tsx b/apps/web/pages/settings/teams/[id]/appearance.tsx index 6c6343e79198ad..ea0d5d2cc0fd83 100644 --- a/apps/web/pages/settings/teams/[id]/appearance.tsx +++ b/apps/web/pages/settings/teams/[id]/appearance.tsx @@ -1,9 +1,11 @@ import TeamAppearenceView from "@calcom/features/ee/teams/pages/team-appearance-view"; +import { getLayout } from "@calcom/features/settings/layouts/SettingsLayout"; -import type { CalPageWrapper } from "@components/PageWrapper"; import PageWrapper from "@components/PageWrapper"; -const Page = TeamAppearenceView as CalPageWrapper; +const Page = () => ; + +Page.getLayout = getLayout; Page.PageWrapper = PageWrapper; export default Page; diff --git a/apps/web/pages/settings/teams/[id]/billing.tsx b/apps/web/pages/settings/teams/[id]/billing.tsx index baa9b4a4275683..ccd9d3c3693f48 100644 --- a/apps/web/pages/settings/teams/[id]/billing.tsx +++ b/apps/web/pages/settings/teams/[id]/billing.tsx @@ -1,9 +1,3 @@ -import type { CalPageWrapper } from "@components/PageWrapper"; -import PageWrapper from "@components/PageWrapper"; - import BillingPage from "../../billing"; -const Page = BillingPage as CalPageWrapper; -Page.PageWrapper = PageWrapper; - -export default Page; +export default BillingPage; diff --git a/apps/web/pages/settings/teams/[id]/event-type.tsx b/apps/web/pages/settings/teams/[id]/event-type.tsx index 101fa610423ddc..ec0a2b1c3bbc34 100644 --- a/apps/web/pages/settings/teams/[id]/event-type.tsx +++ b/apps/web/pages/settings/teams/[id]/event-type.tsx @@ -1,54 +1,12 @@ "use client"; import Head from "next/head"; -import { useRouter } from "next/navigation"; -import { TeamEventTypeForm } from "@calcom/features/ee/teams/components/TeamEventTypeForm"; -import { useCompatSearchParams } from "@calcom/lib/hooks/useCompatSearchParams"; import { useLocale } from "@calcom/lib/hooks/useLocale"; -import { WizardLayout } from "@calcom/ui"; -import { Button, showToast } from "@calcom/ui"; import PageWrapper from "@components/PageWrapper"; -export const CreateTeamEventType = () => { - const searchParams = useCompatSearchParams(); - const { t } = useLocale(); - const router = useRouter(); - const teamId = searchParams?.get("id") ? Number(searchParams.get("id")) : -1; - - const onSuccessMutation = () => { - router.push(`/settings/teams/${teamId}/profile`); - }; - - const onErrorMutation = (err: string) => { - showToast(err, "error"); - }; - - const SubmitButton = (isPending: boolean) => { - return ( - - ); - }; - - return ( - - ); -}; +import CreateTeamEventType, { GetLayout } from "~/settings/teams/[id]/event-types-view"; const TeamEventTypePage = () => { const { t } = useLocale(); @@ -63,23 +21,6 @@ const TeamEventTypePage = () => { ); }; -export const GetLayout = (page: React.ReactElement) => { - const router = useRouter(); - const searchParams = useCompatSearchParams(); - const teamId = searchParams?.get("id") ? Number(searchParams.get("id")) : -1; - - return ( - { - router.push(`/settings/teams/${teamId}/profile`); - }}> - {page} - - ); -}; - TeamEventTypePage.getLayout = GetLayout; TeamEventTypePage.PageWrapper = PageWrapper; diff --git a/apps/web/pages/settings/teams/[id]/members.tsx b/apps/web/pages/settings/teams/[id]/members.tsx index 5381265926a595..3a56a6025c8991 100644 --- a/apps/web/pages/settings/teams/[id]/members.tsx +++ b/apps/web/pages/settings/teams/[id]/members.tsx @@ -1,9 +1,11 @@ import TeamMembersView from "@calcom/features/ee/teams/pages/team-members-view"; +import { getLayout } from "@calcom/features/settings/layouts/SettingsLayout"; -import type { CalPageWrapper } from "@components/PageWrapper"; import PageWrapper from "@components/PageWrapper"; -const Page = TeamMembersView as CalPageWrapper; +const Page = () => ; + +Page.getLayout = getLayout; Page.PageWrapper = PageWrapper; export default Page; diff --git a/apps/web/pages/settings/teams/[id]/onboard-members.tsx b/apps/web/pages/settings/teams/[id]/onboard-members.tsx index aaf3dd9bfaf359..ca352381b85d9f 100644 --- a/apps/web/pages/settings/teams/[id]/onboard-members.tsx +++ b/apps/web/pages/settings/teams/[id]/onboard-members.tsx @@ -2,12 +2,12 @@ import Head from "next/head"; -import AddNewTeamMembers from "@calcom/features/ee/teams/components/AddNewTeamMembers"; import { useLocale } from "@calcom/lib/hooks/useLocale"; -import { WizardLayout } from "@calcom/ui"; import PageWrapper from "@components/PageWrapper"; +import AddNewTeamMembers, { GetLayout } from "~/settings/teams/[id]/onboard-members-view"; + const OnboardTeamMembersPage = () => { const { t } = useLocale(); return ( @@ -21,12 +21,6 @@ const OnboardTeamMembersPage = () => { ); }; -export const GetLayout = (page: React.ReactElement) => ( - - {page} - -); - OnboardTeamMembersPage.getLayout = GetLayout; OnboardTeamMembersPage.PageWrapper = PageWrapper; diff --git a/apps/web/pages/settings/teams/[id]/profile.tsx b/apps/web/pages/settings/teams/[id]/profile.tsx index 9845bac378b0bc..d69987c83a1d52 100644 --- a/apps/web/pages/settings/teams/[id]/profile.tsx +++ b/apps/web/pages/settings/teams/[id]/profile.tsx @@ -1,9 +1,11 @@ import TeamProfileView from "@calcom/features/ee/teams/pages/team-profile-view"; +import { getLayout } from "@calcom/features/settings/layouts/SettingsLayout"; -import type { CalPageWrapper } from "@components/PageWrapper"; import PageWrapper from "@components/PageWrapper"; -const Page = TeamProfileView as CalPageWrapper; +const Page = () => ; + +Page.getLayout = getLayout; Page.PageWrapper = PageWrapper; export default Page; diff --git a/apps/web/pages/settings/teams/index.ts b/apps/web/pages/settings/teams/index.ts deleted file mode 100644 index 2f00167179c5f7..00000000000000 --- a/apps/web/pages/settings/teams/index.ts +++ /dev/null @@ -1,9 +0,0 @@ -import TeamListView from "@calcom/features/ee/teams/pages/team-listing-view"; - -import PageWrapper from "@components/PageWrapper"; -import type { CalPageWrapper } from "@components/PageWrapper"; - -const Page = TeamListView as CalPageWrapper; -Page.PageWrapper = PageWrapper; - -export default Page; diff --git a/apps/web/pages/settings/teams/index.tsx b/apps/web/pages/settings/teams/index.tsx new file mode 100644 index 00000000000000..ba0d9b85e23d5a --- /dev/null +++ b/apps/web/pages/settings/teams/index.tsx @@ -0,0 +1,11 @@ +import TeamListingView from "@calcom/features/ee/teams/pages/team-listing-view"; +import { getLayout } from "@calcom/features/settings/layouts/SettingsLayout"; + +import PageWrapper from "@components/PageWrapper"; + +const Page = () => ; + +Page.getLayout = getLayout; +Page.PageWrapper = PageWrapper; + +export default Page; diff --git a/apps/web/pages/settings/teams/new/index.tsx b/apps/web/pages/settings/teams/new/index.tsx index a019cdfbbe2b8c..07cacbfee557a9 100644 --- a/apps/web/pages/settings/teams/new/index.tsx +++ b/apps/web/pages/settings/teams/new/index.tsx @@ -1,50 +1,15 @@ "use client"; import Head from "next/head"; -import { useRouter } from "next/navigation"; -import { z } from "zod"; -import { CreateANewTeamForm } from "@calcom/features/ee/teams/components"; -import { HOSTED_CAL_FEATURES } from "@calcom/lib/constants"; -import { getSafeRedirectUrl } from "@calcom/lib/getSafeRedirectUrl"; import { useLocale } from "@calcom/lib/hooks/useLocale"; -import { useParamsWithFallback } from "@calcom/lib/hooks/useParamsWithFallback"; -import { telemetryEventTypes, useTelemetry } from "@calcom/lib/telemetry"; -import type { RouterOutputs } from "@calcom/trpc/react"; -import { WizardLayout } from "@calcom/ui"; import PageWrapper from "@components/PageWrapper"; -const querySchema = z.object({ - returnTo: z.string().optional(), - slug: z.string().optional(), -}); +import CreateNewTeamView, { LayoutWrapper } from "~/settings/teams/new/create-new-team-view"; const CreateNewTeamPage = () => { const { t } = useLocale(); - const params = useParamsWithFallback(); - const parsedQuery = querySchema.safeParse(params); - const router = useRouter(); - const telemetry = useTelemetry(); - - const isTeamBillingEnabledClient = !!process.env.NEXT_PUBLIC_STRIPE_PUBLIC_KEY && HOSTED_CAL_FEATURES; - const flag = isTeamBillingEnabledClient - ? { - telemetryEvent: telemetryEventTypes.team_checkout_session_created, - submitLabel: "checkout", - } - : { - telemetryEvent: telemetryEventTypes.team_created, - submitLabel: "continue", - }; - - const returnToParam = - (parsedQuery.success ? getSafeRedirectUrl(parsedQuery.data.returnTo) : "/teams") || "/teams"; - - const onSuccess = (data: RouterOutputs["viewer"]["teams"]["create"]) => { - telemetry.event(flag.telemetryEvent); - router.push(data.url); - }; return ( <> @@ -52,22 +17,10 @@ const CreateNewTeamPage = () => { {t("create_new_team")} - router.push(returnToParam)} - submitLabel={flag.submitLabel} - onSuccess={onSuccess} - /> + ); }; -export const LayoutWrapper = (page: React.ReactElement) => { - return ( - - {page} - - ); -}; CreateNewTeamPage.getLayout = LayoutWrapper; CreateNewTeamPage.PageWrapper = PageWrapper; diff --git a/packages/features/ee/components/CommonSkeletonLoaders.tsx b/packages/features/ee/components/CommonSkeletonLoaders.tsx index 38bdaf8785abad..ad6d363c8f20d3 100644 --- a/packages/features/ee/components/CommonSkeletonLoaders.tsx +++ b/packages/features/ee/components/CommonSkeletonLoaders.tsx @@ -1,10 +1,18 @@ import SectionBottomActions from "@calcom/features/settings/SectionBottomActions"; import { Meta, SkeletonButton, SkeletonContainer, SkeletonText } from "@calcom/ui"; -export const AppearanceSkeletonLoader = ({ title, description }: { title: string; description: string }) => { +export const AppearanceSkeletonLoader = ({ + title, + description, + isAppDir, +}: { + title: string; + description: string; + isAppDir?: boolean; +}) => { return ( - + {!isAppDir ? : null}
diff --git a/packages/features/ee/organizations/pages/organization.tsx b/packages/features/ee/organizations/pages/organization.tsx index 954cba42f37be1..5b3dceae1d8d67 100644 --- a/packages/features/ee/organizations/pages/organization.tsx +++ b/packages/features/ee/organizations/pages/organization.tsx @@ -11,7 +11,7 @@ export const getServerSideProps = async ({ req, res }: GetServerSidePropsContext if (!organizationsEnabled) { return { notFound: true, - }; + } as const; } // Check if logged in user has an organization assigned @@ -20,7 +20,7 @@ export const getServerSideProps = async ({ req, res }: GetServerSidePropsContext if (!session?.user.profile?.organizationId) { return { notFound: true, - }; + } as const; } // Check if logged in user has OWNER/ADMIN role in organization @@ -36,7 +36,7 @@ export const getServerSideProps = async ({ req, res }: GetServerSidePropsContext if (!membership?.role || membership?.role === MembershipRole.MEMBER) { return { notFound: true, - }; + } as const; } // Otherwise, all good diff --git a/packages/features/ee/organizations/pages/settings/general.tsx b/packages/features/ee/organizations/pages/settings/general.tsx index 18e10f642c85cc..6c1173c20f535e 100644 --- a/packages/features/ee/organizations/pages/settings/general.tsx +++ b/packages/features/ee/organizations/pages/settings/general.tsx @@ -7,7 +7,6 @@ import { Controller, useForm } from "react-hook-form"; import LicenseRequired from "@calcom/features/ee/common/components/LicenseRequired"; import SectionBottomActions from "@calcom/features/settings/SectionBottomActions"; -import { getLayout } from "@calcom/features/settings/layouts/SettingsLayout"; import { useLocale } from "@calcom/lib/hooks/useLocale"; import { nameOfDay } from "@calcom/lib/weekday"; import { MembershipRole } from "@calcom/prisma/enums"; @@ -29,10 +28,18 @@ import { import { LockEventTypeSwitch } from "../components/LockEventTypeSwitch"; import { NoSlotsNotificationSwitch } from "../components/NoSlotsNotificationSwitch"; -const SkeletonLoader = ({ title, description }: { title: string; description: string }) => { +const SkeletonLoader = ({ + title, + description, + isAppDir, +}: { + title: string; + description: string; + isAppDir?: boolean; +}) => { return ( - + {!isAppDir ? : null}
@@ -51,7 +58,7 @@ interface GeneralViewProps { localeProp: string; } -const OrgGeneralView = () => { +const OrgGeneralView = ({ isAppDir }: { isAppDir?: boolean }) => { const { t } = useLocale(); const router = useRouter(); const session = useSession(); @@ -85,6 +92,7 @@ const OrgGeneralView = () => { currentOrg={currentOrg} isAdminOrOwner={isAdminOrOwner} localeProp={user?.locale ?? "en"} + isAppDir={isAppDir} /> @@ -93,7 +101,12 @@ const OrgGeneralView = () => { ); }; -const GeneralView = ({ currentOrg, isAdminOrOwner, localeProp }: GeneralViewProps) => { +const GeneralView = ({ + currentOrg, + isAdminOrOwner, + localeProp, + isAppDir, +}: GeneralViewProps & { isAppDir?: boolean }) => { const { t } = useLocale(); const mutation = trpc.viewer.organizations.update.useMutation({ @@ -152,11 +165,13 @@ const GeneralView = ({ currentOrg, isAdminOrOwner, localeProp }: GeneralViewProp weekStart: values.weekStart.value, }); }}> - + {!isAppDir ? ( + + ) : null}
{ +const MembersView = ({ isAppDir }: { isAppDir?: boolean }) => { const { t } = useLocale(); const { data: currentOrg, isPending } = trpc.viewer.organizations.listCurrent.useQuery(); @@ -21,7 +20,9 @@ const MembersView = () => { return ( - + {!isAppDir ? ( + + ) : null}
{!isPending && canLoggedInUserSeeMembers && }
{!canLoggedInUserSeeMembers && (
@@ -31,6 +32,5 @@ const MembersView = () => { ); }; -MembersView.getLayout = getLayout; export default MembersView; diff --git a/packages/features/ee/organizations/pages/settings/other-team-listing-view.tsx b/packages/features/ee/organizations/pages/settings/other-team-listing-view.tsx index ea4fc7a39b7511..40d75f0a57ddf6 100644 --- a/packages/features/ee/organizations/pages/settings/other-team-listing-view.tsx +++ b/packages/features/ee/organizations/pages/settings/other-team-listing-view.tsx @@ -3,19 +3,18 @@ import { useLocale } from "@calcom/lib/hooks/useLocale"; import { Meta } from "@calcom/ui"; -import { getLayout } from "../../../../settings/layouts/SettingsLayout"; import { OtherTeamsListing } from "./../components/OtherTeamsListing"; -const OtherTeamListingView = (): React.ReactElement => { +const OtherTeamListingView = ({ isAppDir }: { isAppDir?: boolean }): React.ReactElement => { const { t } = useLocale(); return ( <> - + {!isAppDir ? ( + + ) : null} ); }; -OtherTeamListingView.getLayout = getLayout; - export default OtherTeamListingView; diff --git a/packages/features/ee/organizations/pages/settings/other-team-members-view.tsx b/packages/features/ee/organizations/pages/settings/other-team-members-view.tsx index 3108552b1453a8..5636bc1068b818 100644 --- a/packages/features/ee/organizations/pages/settings/other-team-members-view.tsx +++ b/packages/features/ee/organizations/pages/settings/other-team-members-view.tsx @@ -14,7 +14,6 @@ import { trpc } from "@calcom/trpc/react"; import type { RouterOutputs } from "@calcom/trpc/react"; import { Meta, showToast, Button } from "@calcom/ui"; -import { getLayout } from "../../../../settings/layouts/SettingsLayout"; import MakeTeamPrivateSwitch from "../../../teams/components/MakeTeamPrivateSwitch"; import MemberListItem from "../components/MemberListItem"; @@ -60,7 +59,7 @@ function MembersList(props: MembersListProps) { ); } -const MembersView = () => { +const MembersView = ({ isAppDir }: { isAppDir?: boolean }) => { const { t, i18n } = useLocale(); const router = useRouter(); const params = useParamsWithFallback(); @@ -136,25 +135,27 @@ const MembersView = () => { return ( <> - setShowMemberInvitationModal(true)} - data-testid="new-member-button"> - {t("add")} - - ) : ( - <> - ) - } - /> + {!isAppDir ? ( + setShowMemberInvitationModal(true)} + data-testid="new-member-button"> + {t("add")} + + ) : ( + <> + ) + } + /> + ) : null} {!isPending && ( <>
@@ -246,6 +247,4 @@ const MembersView = () => { ); }; -MembersView.getLayout = getLayout; - export default MembersView; diff --git a/packages/features/ee/organizations/pages/settings/other-team-profile-view.tsx b/packages/features/ee/organizations/pages/settings/other-team-profile-view.tsx index acd6b63af1a9a9..c030fa568e0ea2 100644 --- a/packages/features/ee/organizations/pages/settings/other-team-profile-view.tsx +++ b/packages/features/ee/organizations/pages/settings/other-team-profile-view.tsx @@ -38,7 +38,6 @@ import { TextField, } from "@calcom/ui"; -import { getLayout } from "../../../../settings/layouts/SettingsLayout"; import { subdomainSuffix } from "../../../organizations/lib/orgDomains"; const regex = new RegExp("^[a-zA-Z0-9-]*$"); @@ -55,7 +54,7 @@ const teamProfileFormSchema = z.object({ bio: z.string(), }); -const OtherTeamProfileView = () => { +const OtherTeamProfileView = ({ isAppDir }: { isAppDir?: boolean }) => { const { t } = useLocale(); const router = useRouter(); const utils = trpc.useUtils(); @@ -170,7 +169,7 @@ const OtherTeamProfileView = () => { return ( <> - + {!isAppDir ? : null} {!isPending ? ( <> {isAdmin ? ( @@ -369,6 +368,4 @@ const OtherTeamProfileView = () => { ); }; -OtherTeamProfileView.getLayout = getLayout; - export default OtherTeamProfileView; diff --git a/packages/features/ee/organizations/pages/settings/profile.tsx b/packages/features/ee/organizations/pages/settings/profile.tsx index f30bf59ea36b34..e1fc469e3b651a 100644 --- a/packages/features/ee/organizations/pages/settings/profile.tsx +++ b/packages/features/ee/organizations/pages/settings/profile.tsx @@ -38,7 +38,6 @@ import { // if I include this in the above barrel import, I get a runtime error that the component is not exported. import { OrgBanner } from "@calcom/ui"; -import { getLayout } from "../../../../settings/layouts/SettingsLayout"; import { useOrgBranding } from "../../../organizations/context/provider"; const orgProfileFormSchema = z.object({ @@ -58,10 +57,18 @@ type FormValues = { calVideoLogo: string | null; }; -const SkeletonLoader = ({ title, description }: { title: string; description: string }) => { +const SkeletonLoader = ({ + title, + description, + isAppDir, +}: { + title: string; + description: string; + isAppDir?: boolean; +}) => { return ( - + {!isAppDir ? : null}
@@ -77,7 +84,7 @@ const SkeletonLoader = ({ title, description }: { title: string; description: st ); }; -const OrgProfileView = () => { +const OrgProfileView = ({ isAppDir }: { isAppDir?: boolean }) => { const { t } = useLocale(); const router = useRouter(); @@ -103,7 +110,9 @@ const OrgProfileView = () => { ); if (isPending || !orgBranding || !currentOrganisation) { - return ; + return ( + + ); } const isOrgAdminOrOwner = @@ -129,7 +138,9 @@ const OrgProfileView = () => { return ( - + {!isAppDir ? ( + + ) : null} <> {isOrgAdminOrOwner ? ( <> @@ -399,6 +410,4 @@ const OrgProfileForm = ({ defaultValues }: { defaultValues: FormValues }) => { ); }; -OrgProfileView.getLayout = getLayout; - export default OrgProfileView; diff --git a/packages/features/ee/sso/page/orgs-sso-view.tsx b/packages/features/ee/sso/page/orgs-sso-view.tsx index 9d42e9e0f66232..35c45111878b6f 100644 --- a/packages/features/ee/sso/page/orgs-sso-view.tsx +++ b/packages/features/ee/sso/page/orgs-sso-view.tsx @@ -6,10 +6,9 @@ import { useLocale } from "@calcom/lib/hooks/useLocale"; import { MembershipRole } from "@calcom/prisma/enums"; import { AppSkeletonLoader as SkeletonLoader, Meta } from "@calcom/ui"; -import { getLayout } from "../../../settings/layouts/SettingsLayout"; import SSOConfiguration from "../components/SSOConfiguration"; -const SAMLSSO = () => { +const SAMLSSO = ({ isAppDir }: { isAppDir?: boolean }) => { const { t } = useLocale(); const { data, status } = useSession(); @@ -26,7 +25,9 @@ const SAMLSSO = () => { return !!isAdminOrOwner ? (
- + {!isAppDir ? ( + + ) : null}
) : ( @@ -36,6 +37,4 @@ const SAMLSSO = () => { ); }; -SAMLSSO.getLayout = getLayout; - export default SAMLSSO; diff --git a/packages/features/ee/teams/pages/team-appearance-view.tsx b/packages/features/ee/teams/pages/team-appearance-view.tsx index dbfc19dbc68f26..4997866dbd477a 100644 --- a/packages/features/ee/teams/pages/team-appearance-view.tsx +++ b/packages/features/ee/teams/pages/team-appearance-view.tsx @@ -17,16 +17,15 @@ import type { RouterOutputs } from "@calcom/trpc/react"; import { Button, Form, Meta, showToast, SettingsToggle } from "@calcom/ui"; import ThemeLabel from "../../../settings/ThemeLabel"; -import { getLayout } from "../../../settings/layouts/SettingsLayout"; type BrandColorsFormValues = { brandColor: string; darkBrandColor: string; }; -type ProfileViewProps = { team: RouterOutputs["viewer"]["teams"]["getMinimal"] }; +type ProfileViewProps = { team: RouterOutputs["viewer"]["teams"]["getMinimal"] } & { isAppDir?: boolean }; -const ProfileView = ({ team }: ProfileViewProps) => { +const ProfileView = ({ team, isAppDir }: ProfileViewProps) => { const { t } = useLocale(); const utils = trpc.useUtils(); @@ -80,11 +79,13 @@ const ProfileView = ({ team }: ProfileViewProps) => { return ( <> - + {!isAppDir ? ( + + ) : null} {isAdmin ? ( <>
{ ); }; -const ProfileViewWrapper = () => { +const ProfileViewWrapper = ({ isAppDir }: { isAppDir?: boolean }) => { const router = useRouter(); const params = useParamsWithFallback(); @@ -210,14 +211,16 @@ const ProfileViewWrapper = () => { if (isPending) return ( - + ); if (!team) return null; - return ; + return ; }; -ProfileViewWrapper.getLayout = getLayout; - export default ProfileViewWrapper; diff --git a/packages/features/ee/teams/pages/team-billing-view.tsx b/packages/features/ee/teams/pages/team-billing-view.tsx deleted file mode 100644 index 3e1a938c7b32f5..00000000000000 --- a/packages/features/ee/teams/pages/team-billing-view.tsx +++ /dev/null @@ -1,34 +0,0 @@ -import { usePathname } from "next/navigation"; - -import { WEBAPP_URL } from "@calcom/lib/constants"; -import { useLocale } from "@calcom/lib/hooks/useLocale"; -import { Button, Meta } from "@calcom/ui"; - -import { getLayout } from "../../../settings/layouts/SettingsLayout"; - -const BillingView = () => { - const pathname = usePathname(); - const { t } = useLocale(); - const returnTo = pathname; - const billingHref = `/api/integrations/stripepayment/portal?returnTo=${WEBAPP_URL}${returnTo}`; - return ( - <> - -
-
-

{t("view_and_manage_billing_details")}

-

{t("view_and_edit_billing_details")}

-
-
- -
-
- - ); -}; - -BillingView.getLayout = getLayout; - -export default BillingView; diff --git a/packages/features/ee/teams/pages/team-listing-view.tsx b/packages/features/ee/teams/pages/team-listing-view.tsx index 2047a2d0042e6c..a1595f4d2dd096 100644 --- a/packages/features/ee/teams/pages/team-listing-view.tsx +++ b/packages/features/ee/teams/pages/team-listing-view.tsx @@ -3,19 +3,16 @@ import { useLocale } from "@calcom/lib/hooks/useLocale"; import { Meta } from "@calcom/ui"; -import { getLayout } from "../../../settings/layouts/SettingsLayout"; import { TeamsListing } from "../components"; -const TeamListingView = () => { +const TeamListingView = ({ isAppDir }: { isAppDir?: boolean }) => { const { t } = useLocale(); return ( <> - + {!isAppDir ? : null} ); }; -TeamListingView.getLayout = getLayout; - export default TeamListingView; diff --git a/packages/features/ee/teams/pages/team-members-view.tsx b/packages/features/ee/teams/pages/team-members-view.tsx index 3f05eda1f3667d..b4695cdcbb5f60 100644 --- a/packages/features/ee/teams/pages/team-members-view.tsx +++ b/packages/features/ee/teams/pages/team-members-view.tsx @@ -10,7 +10,6 @@ import { MembershipRole } from "@calcom/prisma/enums"; import { trpc } from "@calcom/trpc/react"; import { Meta } from "@calcom/ui"; -import { getLayout } from "../../../settings/layouts/SettingsLayout"; import DisableTeamImpersonation from "../components/DisableTeamImpersonation"; import InviteLinkSettingsModal from "../components/InviteLinkSettingsModal"; import MakeTeamPrivateSwitch from "../components/MakeTeamPrivateSwitch"; @@ -18,7 +17,7 @@ import { MemberInvitationModalWithoutMembers } from "../components/MemberInvitat import MemberListItem from "../components/MemberListItem"; import TeamInviteList from "../components/TeamInviteList"; -const MembersView = () => { +const MembersView = ({ isAppDir }: { isAppDir?: boolean }) => { const { t } = useLocale(); const [showMemberInvitationModal, setShowMemberInvitationModal] = useState(false); const [showInviteLinkSettingsModal, setInviteLinkSettingsModal] = useState(false); @@ -63,7 +62,9 @@ const MembersView = () => { return ( <> - } /> + {!isAppDir ? ( + } /> + ) : null} {!isPending && ( <>
@@ -140,6 +141,4 @@ const MembersView = () => { ); }; -MembersView.getLayout = getLayout; - export default MembersView; diff --git a/packages/features/ee/teams/pages/team-profile-view.tsx b/packages/features/ee/teams/pages/team-profile-view.tsx index e3ce4a6c617ec9..004af63b840c71 100644 --- a/packages/features/ee/teams/pages/team-profile-view.tsx +++ b/packages/features/ee/teams/pages/team-profile-view.tsx @@ -44,8 +44,6 @@ import { TextField, } from "@calcom/ui"; -import { getLayout } from "../../../settings/layouts/SettingsLayout"; - const regex = new RegExp("^[a-zA-Z0-9-]*$"); const teamProfileFormSchema = z.object({ @@ -62,10 +60,18 @@ const teamProfileFormSchema = z.object({ type FormValues = z.infer; -const SkeletonLoader = ({ title, description }: { title: string; description: string }) => { +const SkeletonLoader = ({ + isAppDir, + title, + description, +}: { + isAppDir?: boolean; + title: string; + description: string; +}) => { return ( - + {!isAppDir ? : null}
@@ -81,7 +87,7 @@ const SkeletonLoader = ({ title, description }: { title: string; description: st ); }; -const ProfileView = () => { +const ProfileView = ({ isAppDir }: { isAppDir?: boolean }) => { const params = useParamsWithFallback(); const teamId = Number(params.id); const { t } = useLocale(); @@ -159,12 +165,16 @@ const ProfileView = () => { } if (isPending) { - return ; + return ( + + ); } return ( <> - + {!isAppDir ? ( + + ) : null} {isAdmin ? ( @@ -438,6 +448,4 @@ const TeamProfileForm = ({ team }: TeamProfileFormProps) => { ); }; -ProfileView.getLayout = getLayout; - export default ProfileView;