From f097f852ad12aa9a1614d2f097bfeb70a0ae49e0 Mon Sep 17 00:00:00 2001 From: Benny Joo Date: Mon, 25 Nov 2024 16:49:00 -0500 Subject: [PATCH] chore: `settings/organizations` - remove pages router and use app router (#16774) * remove pages router and use app router * remove future/settings/organizations files * fix billing page * sync SettingsLayoutAppDirClient and fix members page * fix attribute pages * remove isAppDir where not needed anymore * add CTA button for members view --- .env.example | 1 - apps/web/abTest/middlewareFactory.ts | 1 - .../attributes/[id]/edit/page.tsx | 11 --- .../organizations/attributes/create/page.tsx | 11 --- .../organizations/attributes/page.tsx | 11 --- .../(settings)/organizations/billing/page.tsx | 5 -- .../organizations/admin-api/page.tsx | 0 .../attributes/[id]/edit/page.tsx | 24 +++++++ .../organizations/attributes/create/page.tsx | 24 +++++++ .../organizations/attributes/page.tsx | 24 +++++++ .../organizations/billing/page.tsx | 5 ++ .../organizations/dsync/page.tsx | 0 .../organizations/general/page.tsx | 2 +- .../organizations/privacy/page.tsx | 0 .../organizations/profile/page.tsx | 2 +- .../organizations/sso/page.tsx | 4 +- .../teams/other/[id]/appearance/page.tsx | 0 .../teams/other/[id]/members/page.tsx | 12 ++-- .../teams/other/[id]/profile/page.tsx | 2 +- .../organizations/teams/other/page.tsx | 2 +- .../organizations/[id]/about/page.tsx | 0 .../organizations/[id]/add-teams/page.tsx | 0 .../[id]/onboard-members/page.tsx | 0 .../organizations/appearance/page.tsx | 0 .../organizations/members/page.tsx | 9 ++- .../settings/organizations/new/page.tsx | 0 .../settings/organizations/[id]/about.tsx | 23 ------- .../settings/organizations/[id]/add-teams.tsx | 24 ------- .../organizations/[id]/onboard-members.tsx | 27 -------- .../settings/organizations/admin-api.tsx | 25 ------- .../settings/organizations/appearance.tsx | 9 --- .../organizations/attributes/[id]/edit.tsx | 24 ------- .../organizations/attributes/create.tsx | 20 ------ .../organizations/attributes/index.tsx | 21 ------ .../pages/settings/organizations/billing.tsx | 3 - .../pages/settings/organizations/dsync.tsx | 22 ------ .../pages/settings/organizations/general.tsx | 11 --- .../pages/settings/organizations/members.tsx | 20 ------ .../settings/organizations/new/index.tsx | 26 ------- .../pages/settings/organizations/privacy.tsx | 27 -------- .../pages/settings/organizations/profile.tsx | 11 --- apps/web/pages/settings/organizations/sso.tsx | 11 --- .../teams/other/[id]/appearance.tsx | 11 --- .../teams/other/[id]/members.tsx | 11 --- .../teams/other/[id]/profile.tsx | 11 --- .../organizations/teams/other/index.tsx | 11 --- apps/web/public/static/locales/en/common.json | 3 + apps/web/scripts/vercel-app-router-deploy.sh | 1 - .../pages/components/MemberListItem.tsx | 2 +- .../attributes/attributes-create-view.tsx | 4 -- .../attributes/attributes-edit-view.tsx | 5 -- .../attributes/attributes-list-view.tsx | 5 -- .../organizations/pages/settings/general.tsx | 28 +------- .../organizations/pages/settings/members.tsx | 5 +- .../settings/other-team-listing-view.tsx | 5 +- .../settings/other-team-members-view.tsx | 69 +++++++++++-------- .../settings/other-team-profile-view.tsx | 3 +- .../organizations/pages/settings/profile.tsx | 20 +----- .../features/ee/sso/page/orgs-sso-view.tsx | 5 +- .../appDir/SettingsLayoutAppDirClient.tsx | 4 +- turbo.json | 1 - 61 files changed, 154 insertions(+), 504 deletions(-) delete mode 100644 apps/web/app/future/settings/(settings)/organizations/attributes/[id]/edit/page.tsx delete mode 100644 apps/web/app/future/settings/(settings)/organizations/attributes/create/page.tsx delete mode 100644 apps/web/app/future/settings/(settings)/organizations/attributes/page.tsx delete mode 100644 apps/web/app/future/settings/(settings)/organizations/billing/page.tsx rename apps/web/app/{future/settings/(settings) => settings/(settings-layout)}/organizations/admin-api/page.tsx (100%) create mode 100644 apps/web/app/settings/(settings-layout)/organizations/attributes/[id]/edit/page.tsx create mode 100644 apps/web/app/settings/(settings-layout)/organizations/attributes/create/page.tsx create mode 100644 apps/web/app/settings/(settings-layout)/organizations/attributes/page.tsx create mode 100644 apps/web/app/settings/(settings-layout)/organizations/billing/page.tsx rename apps/web/app/{future/settings/(settings) => settings/(settings-layout)}/organizations/dsync/page.tsx (100%) rename apps/web/app/{future/settings/(settings) => settings/(settings-layout)}/organizations/general/page.tsx (95%) rename apps/web/app/{future/settings/(settings) => settings/(settings-layout)}/organizations/privacy/page.tsx (100%) rename apps/web/app/{future/settings/(settings) => settings/(settings-layout)}/organizations/profile/page.tsx (95%) rename apps/web/app/{future/settings/(settings) => settings/(settings-layout)}/organizations/sso/page.tsx (84%) rename apps/web/app/{future/settings/(settings) => settings/(settings-layout)}/organizations/teams/other/[id]/appearance/page.tsx (100%) rename apps/web/app/{future/settings/(settings) => settings/(settings-layout)}/organizations/teams/other/[id]/members/page.tsx (68%) rename apps/web/app/{future/settings/(settings) => settings/(settings-layout)}/organizations/teams/other/[id]/profile/page.tsx (95%) rename apps/web/app/{future/settings/(settings) => settings/(settings-layout)}/organizations/teams/other/page.tsx (95%) rename apps/web/app/{future => }/settings/organizations/[id]/about/page.tsx (100%) rename apps/web/app/{future => }/settings/organizations/[id]/add-teams/page.tsx (100%) rename apps/web/app/{future => }/settings/organizations/[id]/onboard-members/page.tsx (100%) rename apps/web/app/{future => }/settings/organizations/appearance/page.tsx (100%) rename apps/web/app/{future/settings/(settings) => settings}/organizations/members/page.tsx (66%) rename apps/web/app/{future => }/settings/organizations/new/page.tsx (100%) delete mode 100644 apps/web/pages/settings/organizations/[id]/about.tsx delete mode 100644 apps/web/pages/settings/organizations/[id]/add-teams.tsx delete mode 100644 apps/web/pages/settings/organizations/[id]/onboard-members.tsx delete mode 100644 apps/web/pages/settings/organizations/admin-api.tsx delete mode 100644 apps/web/pages/settings/organizations/appearance.tsx delete mode 100644 apps/web/pages/settings/organizations/attributes/[id]/edit.tsx delete mode 100644 apps/web/pages/settings/organizations/attributes/create.tsx delete mode 100644 apps/web/pages/settings/organizations/attributes/index.tsx delete mode 100644 apps/web/pages/settings/organizations/billing.tsx delete mode 100644 apps/web/pages/settings/organizations/dsync.tsx delete mode 100644 apps/web/pages/settings/organizations/general.tsx delete mode 100644 apps/web/pages/settings/organizations/members.tsx delete mode 100644 apps/web/pages/settings/organizations/new/index.tsx delete mode 100644 apps/web/pages/settings/organizations/privacy.tsx delete mode 100644 apps/web/pages/settings/organizations/profile.tsx delete mode 100644 apps/web/pages/settings/organizations/sso.tsx delete mode 100644 apps/web/pages/settings/organizations/teams/other/[id]/appearance.tsx delete mode 100644 apps/web/pages/settings/organizations/teams/other/[id]/members.tsx delete mode 100644 apps/web/pages/settings/organizations/teams/other/[id]/profile.tsx delete mode 100644 apps/web/pages/settings/organizations/teams/other/index.tsx diff --git a/.env.example b/.env.example index c39720440b09d6..962ac7267c1753 100644 --- a/.env.example +++ b/.env.example @@ -348,7 +348,6 @@ AB_TEST_BUCKET_PROBABILITY=50 # whether we redirect to the future/event-types from event-types or not APP_ROUTER_EVENT_TYPES_ENABLED=0 APP_ROUTER_SETTINGS_DEVELOPER_ENABLED=0 -APP_ROUTER_SETTINGS_ORG_ENABLED=0 APP_ROUTER_APPS_INSTALLED_CATEGORY_ENABLED=0 APP_ROUTER_APPS_SLUG_ENABLED=0 APP_ROUTER_APPS_SLUG_SETUP_ENABLED=0 diff --git a/apps/web/abTest/middlewareFactory.ts b/apps/web/abTest/middlewareFactory.ts index 65bdb7fc24d31f..d4ac233869afe7 100644 --- a/apps/web/abTest/middlewareFactory.ts +++ b/apps/web/abTest/middlewareFactory.ts @@ -8,7 +8,6 @@ import { FUTURE_ROUTES_ENABLED_COOKIE_NAME, FUTURE_ROUTES_OVERRIDE_COOKIE_NAME } const ROUTES: [URLPattern, boolean][] = [ ["/event-types", process.env.APP_ROUTER_EVENT_TYPES_ENABLED === "1"] as const, ["/settings/developer/:path*", process.env.APP_ROUTER_SETTINGS_DEVELOPER_ENABLED === "1"] as const, - ["/settings/organizations/:path*", process.env.APP_ROUTER_SETTINGS_ORG_ENABLED === "1"] as const, ["/apps/installed/:category", process.env.APP_ROUTER_APPS_INSTALLED_CATEGORY_ENABLED === "1"] as const, ["/apps/:slug", process.env.APP_ROUTER_APPS_SLUG_ENABLED === "1"] as const, ["/apps/:slug/setup", process.env.APP_ROUTER_APPS_SLUG_SETUP_ENABLED === "1"] as const, diff --git a/apps/web/app/future/settings/(settings)/organizations/attributes/[id]/edit/page.tsx b/apps/web/app/future/settings/(settings)/organizations/attributes/[id]/edit/page.tsx deleted file mode 100644 index 822e2d87d00302..00000000000000 --- a/apps/web/app/future/settings/(settings)/organizations/attributes/[id]/edit/page.tsx +++ /dev/null @@ -1,11 +0,0 @@ -import { _generateMetadata } from "app/_utils"; - -import Page from "@calcom/ee/organizations/pages/settings/attributes/attributes-edit-view"; - -export const generateMetadata = async () => - await _generateMetadata( - () => "Attribute", - (t) => t("edit_attribute_description") - ); - -export default Page; diff --git a/apps/web/app/future/settings/(settings)/organizations/attributes/create/page.tsx b/apps/web/app/future/settings/(settings)/organizations/attributes/create/page.tsx deleted file mode 100644 index 9319101bce5609..00000000000000 --- a/apps/web/app/future/settings/(settings)/organizations/attributes/create/page.tsx +++ /dev/null @@ -1,11 +0,0 @@ -import { _generateMetadata } from "app/_utils"; - -import Page from "@calcom/ee/organizations/pages/settings/attributes/attributes-create-view"; - -export const generateMetadata = async () => - await _generateMetadata( - () => "Attribute", - () => "Create an attribute for your team members" - ); - -export default Page; diff --git a/apps/web/app/future/settings/(settings)/organizations/attributes/page.tsx b/apps/web/app/future/settings/(settings)/organizations/attributes/page.tsx deleted file mode 100644 index 2901ca463d4c6d..00000000000000 --- a/apps/web/app/future/settings/(settings)/organizations/attributes/page.tsx +++ /dev/null @@ -1,11 +0,0 @@ -import { _generateMetadata } from "app/_utils"; - -import Page from "@calcom/ee/organizations/pages/settings/attributes/attributes-list-view"; - -export const generateMetadata = async () => - await _generateMetadata( - (t) => t("attributes"), - (t) => t("attribute_meta_description") - ); - -export default Page; diff --git a/apps/web/app/future/settings/(settings)/organizations/billing/page.tsx b/apps/web/app/future/settings/(settings)/organizations/billing/page.tsx deleted file mode 100644 index 7993b194a42783..00000000000000 --- a/apps/web/app/future/settings/(settings)/organizations/billing/page.tsx +++ /dev/null @@ -1,5 +0,0 @@ -import BillingPage, { generateMetadata } from "../../billing/page"; - -export { generateMetadata }; - -export default BillingPage; diff --git a/apps/web/app/future/settings/(settings)/organizations/admin-api/page.tsx b/apps/web/app/settings/(settings-layout)/organizations/admin-api/page.tsx similarity index 100% rename from apps/web/app/future/settings/(settings)/organizations/admin-api/page.tsx rename to apps/web/app/settings/(settings-layout)/organizations/admin-api/page.tsx diff --git a/apps/web/app/settings/(settings-layout)/organizations/attributes/[id]/edit/page.tsx b/apps/web/app/settings/(settings-layout)/organizations/attributes/[id]/edit/page.tsx new file mode 100644 index 00000000000000..4e039d80c84f36 --- /dev/null +++ b/apps/web/app/settings/(settings-layout)/organizations/attributes/[id]/edit/page.tsx @@ -0,0 +1,24 @@ +import { _generateMetadata, getFixedT } from "app/_utils"; + +import OrgAttributesEditPage from "@calcom/ee/organizations/pages/settings/attributes/attributes-edit-view"; +import { getServerSessionForAppDir } from "@calcom/features/auth/lib/get-server-session-for-app-dir"; +import SettingsHeader from "@calcom/features/settings/appDir/SettingsHeader"; + +export const generateMetadata = async () => + await _generateMetadata( + (t) => t("attribute"), + (t) => t("edit_attribute_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/settings/(settings-layout)/organizations/attributes/create/page.tsx b/apps/web/app/settings/(settings-layout)/organizations/attributes/create/page.tsx new file mode 100644 index 00000000000000..f6dbec3f363bad --- /dev/null +++ b/apps/web/app/settings/(settings-layout)/organizations/attributes/create/page.tsx @@ -0,0 +1,24 @@ +import { _generateMetadata, getFixedT } from "app/_utils"; + +import OrgAttributesCreatePage from "@calcom/ee/organizations/pages/settings/attributes/attributes-create-view"; +import { getServerSessionForAppDir } from "@calcom/features/auth/lib/get-server-session-for-app-dir"; +import SettingsHeader from "@calcom/features/settings/appDir/SettingsHeader"; + +export const generateMetadata = async () => + await _generateMetadata( + (t) => t("attribute"), + (t) => t("create_attribute_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/settings/(settings-layout)/organizations/attributes/page.tsx b/apps/web/app/settings/(settings-layout)/organizations/attributes/page.tsx new file mode 100644 index 00000000000000..f8735f603a0dbc --- /dev/null +++ b/apps/web/app/settings/(settings-layout)/organizations/attributes/page.tsx @@ -0,0 +1,24 @@ +import { _generateMetadata, getFixedT } from "app/_utils"; + +import OrgSettingsAttributesPage from "@calcom/ee/organizations/pages/settings/attributes/attributes-list-view"; +import { getServerSessionForAppDir } from "@calcom/features/auth/lib/get-server-session-for-app-dir"; +import SettingsHeader from "@calcom/features/settings/appDir/SettingsHeader"; + +export const generateMetadata = async () => + await _generateMetadata( + (t) => t("attributes"), + (t) => t("attribute_meta_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/settings/(settings-layout)/organizations/billing/page.tsx b/apps/web/app/settings/(settings-layout)/organizations/billing/page.tsx new file mode 100644 index 00000000000000..77c80668ccecca --- /dev/null +++ b/apps/web/app/settings/(settings-layout)/organizations/billing/page.tsx @@ -0,0 +1,5 @@ +import BillingPage, { generateMetadata } from "app/future/settings/(settings)/billing/page"; + +export { generateMetadata }; + +export default BillingPage; diff --git a/apps/web/app/future/settings/(settings)/organizations/dsync/page.tsx b/apps/web/app/settings/(settings-layout)/organizations/dsync/page.tsx similarity index 100% rename from apps/web/app/future/settings/(settings)/organizations/dsync/page.tsx rename to apps/web/app/settings/(settings-layout)/organizations/dsync/page.tsx diff --git a/apps/web/app/future/settings/(settings)/organizations/general/page.tsx b/apps/web/app/settings/(settings-layout)/organizations/general/page.tsx similarity index 95% rename from apps/web/app/future/settings/(settings)/organizations/general/page.tsx rename to apps/web/app/settings/(settings-layout)/organizations/general/page.tsx index 30416c6daa3c08..3fc868c3181bca 100644 --- a/apps/web/app/future/settings/(settings)/organizations/general/page.tsx +++ b/apps/web/app/settings/(settings-layout)/organizations/general/page.tsx @@ -16,7 +16,7 @@ const Page = async () => { return ( - + ); }; diff --git a/apps/web/app/future/settings/(settings)/organizations/privacy/page.tsx b/apps/web/app/settings/(settings-layout)/organizations/privacy/page.tsx similarity index 100% rename from apps/web/app/future/settings/(settings)/organizations/privacy/page.tsx rename to apps/web/app/settings/(settings-layout)/organizations/privacy/page.tsx diff --git a/apps/web/app/future/settings/(settings)/organizations/profile/page.tsx b/apps/web/app/settings/(settings-layout)/organizations/profile/page.tsx similarity index 95% rename from apps/web/app/future/settings/(settings)/organizations/profile/page.tsx rename to apps/web/app/settings/(settings-layout)/organizations/profile/page.tsx index a9e54e098b3c53..dec1986af43863 100644 --- a/apps/web/app/future/settings/(settings)/organizations/profile/page.tsx +++ b/apps/web/app/settings/(settings-layout)/organizations/profile/page.tsx @@ -19,7 +19,7 @@ const Page = async () => { title={t("profile")} description={t("profile_org_description")} borderInShellHeader={true}> - + ); }; diff --git a/apps/web/app/future/settings/(settings)/organizations/sso/page.tsx b/apps/web/app/settings/(settings-layout)/organizations/sso/page.tsx similarity index 84% rename from apps/web/app/future/settings/(settings)/organizations/sso/page.tsx rename to apps/web/app/settings/(settings-layout)/organizations/sso/page.tsx index 55c561e75baf31..6e624d73dfbe7c 100644 --- a/apps/web/app/future/settings/(settings)/organizations/sso/page.tsx +++ b/apps/web/app/settings/(settings-layout)/organizations/sso/page.tsx @@ -15,8 +15,8 @@ const Page = async () => { const t = await getFixedT(session?.user.locale || "en"); return ( - - + + ); }; diff --git a/apps/web/app/future/settings/(settings)/organizations/teams/other/[id]/appearance/page.tsx b/apps/web/app/settings/(settings-layout)/organizations/teams/other/[id]/appearance/page.tsx similarity index 100% rename from apps/web/app/future/settings/(settings)/organizations/teams/other/[id]/appearance/page.tsx rename to apps/web/app/settings/(settings-layout)/organizations/teams/other/[id]/appearance/page.tsx diff --git a/apps/web/app/future/settings/(settings)/organizations/teams/other/[id]/members/page.tsx b/apps/web/app/settings/(settings-layout)/organizations/teams/other/[id]/members/page.tsx similarity index 68% rename from apps/web/app/future/settings/(settings)/organizations/teams/other/[id]/members/page.tsx rename to apps/web/app/settings/(settings-layout)/organizations/teams/other/[id]/members/page.tsx index 1896558bec3d29..f632e82b3f0e9c 100644 --- a/apps/web/app/future/settings/(settings)/organizations/teams/other/[id]/members/page.tsx +++ b/apps/web/app/settings/(settings-layout)/organizations/teams/other/[id]/members/page.tsx @@ -1,7 +1,9 @@ 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-members-view"; +import LegacyPage, { + TeamMembersCTA, +} from "@calcom/features/ee/organizations/pages/settings/other-team-members-view"; import SettingsHeader from "@calcom/features/settings/appDir/SettingsHeader"; export const generateMetadata = async () => @@ -15,9 +17,11 @@ const Page = async () => { const t = await getFixedT(session?.user.locale || "en"); return ( - // TODO: Add CTA Button - - + }> + ); }; diff --git a/apps/web/app/future/settings/(settings)/organizations/teams/other/[id]/profile/page.tsx b/apps/web/app/settings/(settings-layout)/organizations/teams/other/[id]/profile/page.tsx similarity index 95% rename from apps/web/app/future/settings/(settings)/organizations/teams/other/[id]/profile/page.tsx rename to apps/web/app/settings/(settings-layout)/organizations/teams/other/[id]/profile/page.tsx index 11a5626af0b206..1e38d3425c20e6 100644 --- a/apps/web/app/future/settings/(settings)/organizations/teams/other/[id]/profile/page.tsx +++ b/apps/web/app/settings/(settings-layout)/organizations/teams/other/[id]/profile/page.tsx @@ -16,7 +16,7 @@ const Page = async () => { return ( - + ); }; diff --git a/apps/web/app/future/settings/(settings)/organizations/teams/other/page.tsx b/apps/web/app/settings/(settings-layout)/organizations/teams/other/page.tsx similarity index 95% rename from apps/web/app/future/settings/(settings)/organizations/teams/other/page.tsx rename to apps/web/app/settings/(settings-layout)/organizations/teams/other/page.tsx index b68b2199cd27cf..3e546db05869fe 100644 --- a/apps/web/app/future/settings/(settings)/organizations/teams/other/page.tsx +++ b/apps/web/app/settings/(settings-layout)/organizations/teams/other/page.tsx @@ -16,7 +16,7 @@ const Page = async () => { return ( - + ); }; diff --git a/apps/web/app/future/settings/organizations/[id]/about/page.tsx b/apps/web/app/settings/organizations/[id]/about/page.tsx similarity index 100% rename from apps/web/app/future/settings/organizations/[id]/about/page.tsx rename to apps/web/app/settings/organizations/[id]/about/page.tsx diff --git a/apps/web/app/future/settings/organizations/[id]/add-teams/page.tsx b/apps/web/app/settings/organizations/[id]/add-teams/page.tsx similarity index 100% rename from apps/web/app/future/settings/organizations/[id]/add-teams/page.tsx rename to apps/web/app/settings/organizations/[id]/add-teams/page.tsx diff --git a/apps/web/app/future/settings/organizations/[id]/onboard-members/page.tsx b/apps/web/app/settings/organizations/[id]/onboard-members/page.tsx similarity index 100% rename from apps/web/app/future/settings/organizations/[id]/onboard-members/page.tsx rename to apps/web/app/settings/organizations/[id]/onboard-members/page.tsx diff --git a/apps/web/app/future/settings/organizations/appearance/page.tsx b/apps/web/app/settings/organizations/appearance/page.tsx similarity index 100% rename from apps/web/app/future/settings/organizations/appearance/page.tsx rename to apps/web/app/settings/organizations/appearance/page.tsx diff --git a/apps/web/app/future/settings/(settings)/organizations/members/page.tsx b/apps/web/app/settings/organizations/members/page.tsx similarity index 66% rename from apps/web/app/future/settings/(settings)/organizations/members/page.tsx rename to apps/web/app/settings/organizations/members/page.tsx index e4ee4b40d1400b..2a08ef68f76f1f 100644 --- a/apps/web/app/future/settings/(settings)/organizations/members/page.tsx +++ b/apps/web/app/settings/organizations/members/page.tsx @@ -1,8 +1,10 @@ import { _generateMetadata, getFixedT } from "app/_utils"; +import { WithLayout } from "app/layoutHOC"; 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"; +import SettingsLayoutAppDir from "@calcom/features/settings/appDir/SettingsLayoutAppDir"; export const generateMetadata = async () => await _generateMetadata( @@ -16,9 +18,12 @@ const Page = async () => { return ( - + ); }; -export default Page; +const getLayout = async (page: React.ReactElement) => + await SettingsLayoutAppDir({ children: page, containerClassName: "lg:max-w-screen-2xl" }); + +export default WithLayout({ ServerPage: Page, getServerLayout: getLayout })<"P">; diff --git a/apps/web/app/future/settings/organizations/new/page.tsx b/apps/web/app/settings/organizations/new/page.tsx similarity index 100% rename from apps/web/app/future/settings/organizations/new/page.tsx rename to apps/web/app/settings/organizations/new/page.tsx diff --git a/apps/web/pages/settings/organizations/[id]/about.tsx b/apps/web/pages/settings/organizations/[id]/about.tsx deleted file mode 100644 index 725ae41b08a613..00000000000000 --- a/apps/web/pages/settings/organizations/[id]/about.tsx +++ /dev/null @@ -1,23 +0,0 @@ -import { getServerSideProps } from "@calcom/features/ee/organizations/pages/organization"; -import { useLocale } from "@calcom/lib/hooks/useLocale"; -import { Meta } from "@calcom/ui"; - -import PageWrapper from "@components/PageWrapper"; - -import AboutOrganizationForm, { LayoutWrapper } from "~/settings/organizations/[id]/about-view"; - -const Page = () => { - const { t } = useLocale(); - return ( - <> - - - - ); -}; - -Page.getLayout = LayoutWrapper; -Page.PageWrapper = PageWrapper; - -export default Page; -export { getServerSideProps }; diff --git a/apps/web/pages/settings/organizations/[id]/add-teams.tsx b/apps/web/pages/settings/organizations/[id]/add-teams.tsx deleted file mode 100644 index b2d442267d8aa9..00000000000000 --- a/apps/web/pages/settings/organizations/[id]/add-teams.tsx +++ /dev/null @@ -1,24 +0,0 @@ -import { getServerSideProps } from "@calcom/features/ee/organizations/pages/organization"; -import { useLocale } from "@calcom/lib/hooks/useLocale"; -import { Meta } from "@calcom/ui"; - -import PageWrapper from "@components/PageWrapper"; - -import AddNewTeamsForm, { LayoutWrapper } from "~/settings/organizations/[id]/add-teams-view"; - -const Page = () => { - const { t } = useLocale(); - return ( - <> - - - - ); -}; - -Page.getLayout = LayoutWrapper; -Page.PageWrapper = PageWrapper; - -export default Page; - -export { getServerSideProps }; diff --git a/apps/web/pages/settings/organizations/[id]/onboard-members.tsx b/apps/web/pages/settings/organizations/[id]/onboard-members.tsx deleted file mode 100644 index 77832fe83922a8..00000000000000 --- a/apps/web/pages/settings/organizations/[id]/onboard-members.tsx +++ /dev/null @@ -1,27 +0,0 @@ -import { getServerSideProps } from "@calcom/features/ee/organizations/pages/organization"; -import { useLocale } from "@calcom/lib/hooks/useLocale"; -import { Meta } from "@calcom/ui"; - -import PageWrapper from "@components/PageWrapper"; - -import OrgAddNewTeamMembers, { LayoutWrapper } from "~/settings/organizations/[id]/onboard-members-view"; - -const Page = () => { - const { t } = useLocale(); - - return ( - <> - - - - ); -}; - -Page.getLayout = LayoutWrapper; -Page.PageWrapper = PageWrapper; - -export default Page; -export { getServerSideProps }; diff --git a/apps/web/pages/settings/organizations/admin-api.tsx b/apps/web/pages/settings/organizations/admin-api.tsx deleted file mode 100644 index 08a766232d8ca9..00000000000000 --- a/apps/web/pages/settings/organizations/admin-api.tsx +++ /dev/null @@ -1,25 +0,0 @@ -import AdminAPIView from "@calcom/features/ee/organizations/pages/settings/admin-api"; -import { getLayout } from "@calcom/features/settings/layouts/SettingsLayout"; -import { useLocale } from "@calcom/lib/hooks/useLocale"; -import { Meta } from "@calcom/ui"; - -import PageWrapper from "@components/PageWrapper"; - -const Page = () => { - const { t } = useLocale(); - return ( - <> - - - - ); -}; - -Page.PageWrapper = PageWrapper; -Page.getLayout = getLayout; - -export default Page; diff --git a/apps/web/pages/settings/organizations/appearance.tsx b/apps/web/pages/settings/organizations/appearance.tsx deleted file mode 100644 index bcfb2614d22cb6..00000000000000 --- a/apps/web/pages/settings/organizations/appearance.tsx +++ /dev/null @@ -1,9 +0,0 @@ -import OrgAppearanceView from "@calcom/features/ee/organizations/pages/settings/appearance"; - -import type { CalPageWrapper } from "@components/PageWrapper"; -import PageWrapper from "@components/PageWrapper"; - -const Page = OrgAppearanceView as CalPageWrapper; -Page.PageWrapper = PageWrapper; - -export default Page; diff --git a/apps/web/pages/settings/organizations/attributes/[id]/edit.tsx b/apps/web/pages/settings/organizations/attributes/[id]/edit.tsx deleted file mode 100644 index e711750d389a05..00000000000000 --- a/apps/web/pages/settings/organizations/attributes/[id]/edit.tsx +++ /dev/null @@ -1,24 +0,0 @@ -"use client"; - -import OrgAttributesEditPage, { - getLayout, -} from "@calcom/ee/organizations/pages/settings/attributes/attributes-edit-view"; -import { useLocale } from "@calcom/lib/hooks/useLocale"; -import { Meta } from "@calcom/ui"; - -import PageWrapper from "@components/PageWrapper"; - -const Page = () => { - const { t } = useLocale(); - return ( - <> - - - - ); -}; - -Page.getLayout = getLayout; -Page.PageWrapper = PageWrapper; - -export default Page; diff --git a/apps/web/pages/settings/organizations/attributes/create.tsx b/apps/web/pages/settings/organizations/attributes/create.tsx deleted file mode 100644 index 81c0b089e8bf5e..00000000000000 --- a/apps/web/pages/settings/organizations/attributes/create.tsx +++ /dev/null @@ -1,20 +0,0 @@ -import OrgAttributesCreatePage, { - getLayout, -} from "@calcom/ee/organizations/pages/settings/attributes/attributes-create-view"; -import { Meta } from "@calcom/ui"; - -import PageWrapper from "@components/PageWrapper"; - -const Page = () => { - return ( - <> - - - - ); -}; - -Page.getLayout = getLayout; -Page.PageWrapper = PageWrapper; - -export default Page; diff --git a/apps/web/pages/settings/organizations/attributes/index.tsx b/apps/web/pages/settings/organizations/attributes/index.tsx deleted file mode 100644 index 318a0d8f53f54a..00000000000000 --- a/apps/web/pages/settings/organizations/attributes/index.tsx +++ /dev/null @@ -1,21 +0,0 @@ -import OrgSettingsAttributesPage, { - getLayout, -} from "@calcom/ee/organizations/pages/settings/attributes/attributes-list-view"; -import { useLocale } from "@calcom/lib/hooks/useLocale"; -import { Meta } from "@calcom/ui"; - -import PageWrapper from "@components/PageWrapper"; - -const Page = () => { - const { t } = useLocale(); - return ( - <> - - - - ); -}; -Page.getLayout = getLayout; -Page.PageWrapper = PageWrapper; - -export default Page; diff --git a/apps/web/pages/settings/organizations/billing.tsx b/apps/web/pages/settings/organizations/billing.tsx deleted file mode 100644 index d44849eea252a1..00000000000000 --- a/apps/web/pages/settings/organizations/billing.tsx +++ /dev/null @@ -1,3 +0,0 @@ -import BillingPage from "../../settings/billing/index"; - -export default BillingPage; diff --git a/apps/web/pages/settings/organizations/dsync.tsx b/apps/web/pages/settings/organizations/dsync.tsx deleted file mode 100644 index bb5a427d01f2ed..00000000000000 --- a/apps/web/pages/settings/organizations/dsync.tsx +++ /dev/null @@ -1,22 +0,0 @@ -"use client"; - -import DirectorySyncTeamView from "@calcom/features/ee/dsync/page/team-dsync-view"; -import { getLayout } from "@calcom/features/settings/layouts/SettingsLayout"; -import { useLocale } from "@calcom/lib/hooks/useLocale"; -import { Meta } from "@calcom/ui"; - -import PageWrapper from "@components/PageWrapper"; - -const Page = () => { - const { t } = useLocale(); - return ( - <> - - - - ); -}; -Page.getLayout = getLayout; -Page.PageWrapper = PageWrapper; - -export default Page; diff --git a/apps/web/pages/settings/organizations/general.tsx b/apps/web/pages/settings/organizations/general.tsx deleted file mode 100644 index e5d5cefb108785..00000000000000 --- a/apps/web/pages/settings/organizations/general.tsx +++ /dev/null @@ -1,11 +0,0 @@ -import OrgGeneralView from "@calcom/features/ee/organizations/pages/settings/general"; -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/organizations/members.tsx b/apps/web/pages/settings/organizations/members.tsx deleted file mode 100644 index 970bfb8e311c86..00000000000000 --- a/apps/web/pages/settings/organizations/members.tsx +++ /dev/null @@ -1,20 +0,0 @@ -import MembersView from "@calcom/features/ee/organizations/pages/settings/members"; -import SettingsLayout from "@calcom/features/settings/layouts/SettingsLayout"; - -import PageWrapper from "@components/PageWrapper"; - -export { - getServerSidePropsForMembers as getServerSideProps, - type PageProps, -} from "@calcom/features/ee/organizations/pages/settings/getServerSidePropsMembers"; - -export const getLayout = (page: React.ReactElement) => ( - {page} -); - -const Page = () => ; - -Page.getLayout = getLayout; -Page.PageWrapper = PageWrapper; - -export default Page; diff --git a/apps/web/pages/settings/organizations/new/index.tsx b/apps/web/pages/settings/organizations/new/index.tsx deleted file mode 100644 index a2f41ca5a097ef..00000000000000 --- a/apps/web/pages/settings/organizations/new/index.tsx +++ /dev/null @@ -1,26 +0,0 @@ -import LicenseRequired from "@calcom/features/ee/common/components/LicenseRequired"; -import { useLocale } from "@calcom/lib/hooks/useLocale"; -import { Meta } from "@calcom/ui"; - -import { getServerSideProps } from "@lib/settings/organizations/new/getServerSideProps"; - -import PageWrapper from "@components/PageWrapper"; - -import CreateANewOrganizationForm, { LayoutWrapper } from "~/settings/organizations/new/create-new-view"; - -const Page = () => { - const { t } = useLocale(); - return ( - - - - - ); -}; - -Page.getLayout = LayoutWrapper; -Page.PageWrapper = PageWrapper; - -export default Page; - -export { getServerSideProps }; diff --git a/apps/web/pages/settings/organizations/privacy.tsx b/apps/web/pages/settings/organizations/privacy.tsx deleted file mode 100644 index 7f4a8c06f49986..00000000000000 --- a/apps/web/pages/settings/organizations/privacy.tsx +++ /dev/null @@ -1,27 +0,0 @@ -"use client"; - -import PrivacyView from "@calcom/features/ee/organizations/pages/settings/privacy"; -import { getLayout } from "@calcom/features/settings/layouts/SettingsLayout"; -import { useLocale } from "@calcom/lib/hooks/useLocale"; -import { Meta } from "@calcom/ui"; - -import PageWrapper from "@components/PageWrapper"; - -const Page = () => { - const { t } = useLocale(); - return ( - <> - - - - ); -}; - -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 deleted file mode 100644 index e6bc8e8c1a0a95..00000000000000 --- a/apps/web/pages/settings/organizations/profile.tsx +++ /dev/null @@ -1,11 +0,0 @@ -import OrgProfileView from "@calcom/features/ee/organizations/pages/settings/profile"; -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/organizations/sso.tsx b/apps/web/pages/settings/organizations/sso.tsx deleted file mode 100644 index 96f87e2077f5e9..00000000000000 --- a/apps/web/pages/settings/organizations/sso.tsx +++ /dev/null @@ -1,11 +0,0 @@ -import OrgSSOView from "@calcom/features/ee/sso/page/orgs-sso-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/organizations/teams/other/[id]/appearance.tsx b/apps/web/pages/settings/organizations/teams/other/[id]/appearance.tsx deleted file mode 100644 index ea0d5d2cc0fd83..00000000000000 --- a/apps/web/pages/settings/organizations/teams/other/[id]/appearance.tsx +++ /dev/null @@ -1,11 +0,0 @@ -import TeamAppearenceView from "@calcom/features/ee/teams/pages/team-appearance-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/organizations/teams/other/[id]/members.tsx b/apps/web/pages/settings/organizations/teams/other/[id]/members.tsx deleted file mode 100644 index fb4357175d1440..00000000000000 --- a/apps/web/pages/settings/organizations/teams/other/[id]/members.tsx +++ /dev/null @@ -1,11 +0,0 @@ -import TeamMembersView from "@calcom/features/ee/organizations/pages/settings/other-team-members-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/organizations/teams/other/[id]/profile.tsx b/apps/web/pages/settings/organizations/teams/other/[id]/profile.tsx deleted file mode 100644 index c24a0104b0f9f6..00000000000000 --- a/apps/web/pages/settings/organizations/teams/other/[id]/profile.tsx +++ /dev/null @@ -1,11 +0,0 @@ -import OtherTeamProfileView from "@calcom/features/ee/organizations/pages/settings/other-team-profile-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/organizations/teams/other/index.tsx b/apps/web/pages/settings/organizations/teams/other/index.tsx deleted file mode 100644 index 84b951e9e86685..00000000000000 --- a/apps/web/pages/settings/organizations/teams/other/index.tsx +++ /dev/null @@ -1,11 +0,0 @@ -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"; - -const Page = () => ; - -Page.getLayout = getLayout; -Page.PageWrapper = PageWrapper; - -export default Page; diff --git a/apps/web/public/static/locales/en/common.json b/apps/web/public/static/locales/en/common.json index f043c66a4b8019..e4da0bc5a9eb8e 100644 --- a/apps/web/public/static/locales/en/common.json +++ b/apps/web/public/static/locales/en/common.json @@ -2642,6 +2642,9 @@ "add_attributes_description": "Add attributes to your team members", "new_option": "New option", "update_profile": "Update member", + "attribute": "Attribute", + "create_attribute_description": "Create an attribute for your team members", + "edit_attribute_description": "Edit an attribute for your team members", "attribute_updated_successfully": "Attribute updated successfully", "attribute_deleted_successfully": "Attribute deleted successfully", "attributes_edited_successfully": "Attributes edited successfully", diff --git a/apps/web/scripts/vercel-app-router-deploy.sh b/apps/web/scripts/vercel-app-router-deploy.sh index 4f25330eeeaa13..ada94c4fe053c7 100755 --- a/apps/web/scripts/vercel-app-router-deploy.sh +++ b/apps/web/scripts/vercel-app-router-deploy.sh @@ -9,7 +9,6 @@ checkRoute () { checkRoute "$APP_ROUTER_EVENT_TYPES_ENABLED" app/future/event-types checkRoute "$APP_ROUTER_AVAILABILITY_ENABLED" app/future/availability checkRoute "$APP_ROUTER_SETTINGS_DEVELOPER_ENABLED" app/future/settings/developer -checkRoute "$APP_ROUTER_SETTINGS_ORG_ENABLED" app/future/settings/organizations checkRoute "$APP_ROUTER_APPS_INSTALLED_CATEGORY_ENABLED" app/future/apps/installed checkRoute "$APP_ROUTER_APPS_SLUG_ENABLED" app/future/apps/\[slug\] checkRoute "$APP_ROUTER_APPS_SLUG_SETUP_ENABLED" app/future/apps/\[slug\]/setup diff --git a/packages/features/ee/organizations/pages/components/MemberListItem.tsx b/packages/features/ee/organizations/pages/components/MemberListItem.tsx index 94158465be69a3..c41b3c9161ab73 100644 --- a/packages/features/ee/organizations/pages/components/MemberListItem.tsx +++ b/packages/features/ee/organizations/pages/components/MemberListItem.tsx @@ -37,7 +37,7 @@ export default function MemberListItem(props: Props) {
-
+
{name} {!props.member.accepted && } diff --git a/packages/features/ee/organizations/pages/settings/attributes/attributes-create-view.tsx b/packages/features/ee/organizations/pages/settings/attributes/attributes-create-view.tsx index 3c5da8911759eb..16f8518c9549d8 100644 --- a/packages/features/ee/organizations/pages/settings/attributes/attributes-create-view.tsx +++ b/packages/features/ee/organizations/pages/settings/attributes/attributes-create-view.tsx @@ -6,7 +6,6 @@ import { useFormContext } from "react-hook-form"; import { z } from "zod"; import LicenseRequired from "@calcom/features/ee/common/components/LicenseRequired"; -import SettingsLayout from "@calcom/features/settings/layouts/SettingsLayout"; import { useLocale } from "@calcom/lib/hooks/useLocale"; import { trpc } from "@calcom/trpc/react"; import { Button, useMeta, showToast } from "@calcom/ui"; @@ -89,8 +88,5 @@ function CreateAttributeHeader(props: { isPending: boolean }) { ); } -export function getLayout(page: React.ReactElement) { - return {page}; -} export default CreateAttributesPage; diff --git a/packages/features/ee/organizations/pages/settings/attributes/attributes-edit-view.tsx b/packages/features/ee/organizations/pages/settings/attributes/attributes-edit-view.tsx index 2550b8a6f6bc1f..60a5daa9f4bf65 100644 --- a/packages/features/ee/organizations/pages/settings/attributes/attributes-edit-view.tsx +++ b/packages/features/ee/organizations/pages/settings/attributes/attributes-edit-view.tsx @@ -6,7 +6,6 @@ import { useFormContext } from "react-hook-form"; import { z } from "zod"; import LicenseRequired from "@calcom/features/ee/common/components/LicenseRequired"; -import SettingsLayout from "@calcom/features/settings/layouts/SettingsLayout"; import { useLocale } from "@calcom/lib/hooks/useLocale"; import { trpc } from "@calcom/trpc/react"; import { Button, useMeta, showToast } from "@calcom/ui"; @@ -109,8 +108,4 @@ function EditAttributeHeader(props: { isPending: boolean }) { ); } -export function getLayout(page: React.ReactElement) { - return {page}; -} - export default CreateAttributesPage; diff --git a/packages/features/ee/organizations/pages/settings/attributes/attributes-list-view.tsx b/packages/features/ee/organizations/pages/settings/attributes/attributes-list-view.tsx index 41fe88b0aa2d53..00caf04f7cf53b 100644 --- a/packages/features/ee/organizations/pages/settings/attributes/attributes-list-view.tsx +++ b/packages/features/ee/organizations/pages/settings/attributes/attributes-list-view.tsx @@ -4,7 +4,6 @@ import type { Dispatch, SetStateAction } from "react"; import { useState } from "react"; import LicenseRequired from "@calcom/features/ee/common/components/LicenseRequired"; -import SettingsLayout from "@calcom/features/settings/layouts/SettingsLayout"; import { useLocale } from "@calcom/lib/hooks/useLocale"; import type { RouterOutputs } from "@calcom/trpc/react"; import { trpc } from "@calcom/trpc/react"; @@ -208,8 +207,4 @@ function ListAttributeHeader() { ); } -export function getLayout(page: React.ReactElement) { - return {page}; -} - export default OrganizationAttributesPage; diff --git a/packages/features/ee/organizations/pages/settings/general.tsx b/packages/features/ee/organizations/pages/settings/general.tsx index 6c1173c20f535e..1973a0f67294a9 100644 --- a/packages/features/ee/organizations/pages/settings/general.tsx +++ b/packages/features/ee/organizations/pages/settings/general.tsx @@ -28,18 +28,9 @@ import { import { LockEventTypeSwitch } from "../components/LockEventTypeSwitch"; import { NoSlotsNotificationSwitch } from "../components/NoSlotsNotificationSwitch"; -const SkeletonLoader = ({ - title, - description, - isAppDir, -}: { - title: string; - description: string; - isAppDir?: boolean; -}) => { +const SkeletonLoader = ({ title, description }: { title: string; description: string }) => { return ( - {!isAppDir ? : null}
@@ -58,7 +49,7 @@ interface GeneralViewProps { localeProp: string; } -const OrgGeneralView = ({ isAppDir }: { isAppDir?: boolean }) => { +const OrgGeneralView = () => { const { t } = useLocale(); const router = useRouter(); const session = useSession(); @@ -92,7 +83,6 @@ const OrgGeneralView = ({ isAppDir }: { isAppDir?: boolean }) => { currentOrg={currentOrg} isAdminOrOwner={isAdminOrOwner} localeProp={user?.locale ?? "en"} - isAppDir={isAppDir} /> @@ -101,12 +91,7 @@ const OrgGeneralView = ({ isAppDir }: { isAppDir?: boolean }) => { ); }; -const GeneralView = ({ - currentOrg, - isAdminOrOwner, - localeProp, - isAppDir, -}: GeneralViewProps & { isAppDir?: boolean }) => { +const GeneralView = ({ currentOrg, isAdminOrOwner, localeProp }: GeneralViewProps) => { const { t } = useLocale(); const mutation = trpc.viewer.organizations.update.useMutation({ @@ -165,13 +150,6 @@ const GeneralView = ({ weekStart: values.weekStart.value, }); }}> - {!isAppDir ? ( - - ) : null}
{ +const MembersView = () => { const { t } = useLocale(); const { data: currentOrg, isPending } = trpc.viewer.organizations.listCurrent.useQuery(); @@ -20,9 +20,6 @@ const MembersView = ({ isAppDir }: { isAppDir?: boolean }) => { return ( - {!isAppDir ? ( - - ) : null}
{!isPending && canLoggedInUserSeeMembers && }
{!canLoggedInUserSeeMembers && (
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 40d75f0a57ddf6..4ac2a087cfffca 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 @@ -5,13 +5,10 @@ import { Meta } from "@calcom/ui"; import { OtherTeamsListing } from "./../components/OtherTeamsListing"; -const OtherTeamListingView = ({ isAppDir }: { isAppDir?: boolean }): React.ReactElement => { +const OtherTeamListingView = (): React.ReactElement => { const { t } = useLocale(); return ( <> - {!isAppDir ? ( - - ) : null} ); 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 5636bc1068b818..ab569677060d27 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 @@ -12,7 +12,7 @@ import { useParamsWithFallback } from "@calcom/lib/hooks/useParamsWithFallback"; import { MembershipRole } from "@calcom/prisma/enums"; import { trpc } from "@calcom/trpc/react"; import type { RouterOutputs } from "@calcom/trpc/react"; -import { Meta, showToast, Button } from "@calcom/ui"; +import { showToast, Button } from "@calcom/ui"; import MakeTeamPrivateSwitch from "../../../teams/components/MakeTeamPrivateSwitch"; import MemberListItem from "../components/MemberListItem"; @@ -59,7 +59,37 @@ function MembersList(props: MembersListProps) { ); } -const MembersView = ({ isAppDir }: { isAppDir?: boolean }) => { +export const memberInvitationModalRef = { + current: null as null | ((show: boolean) => void), +}; + +export const TeamMembersCTA = () => { + const { t } = useLocale(); + const session = useSession(); + const { data: currentOrg } = trpc.viewer.organizations.listCurrent.useQuery(undefined, { + enabled: !!session.data?.user?.org, + }); + + const isOrgAdminOrOwner = + currentOrg && + (currentOrg.user.role === MembershipRole.OWNER || currentOrg.user.role === MembershipRole.ADMIN); + + if (!isOrgAdminOrOwner) return null; + + return ( + + ); +}; + +const MembersView = () => { const { t, i18n } = useLocale(); const router = useRouter(); const params = useParamsWithFallback(); @@ -71,9 +101,6 @@ const MembersView = ({ isAppDir }: { isAppDir?: boolean }) => { const limit = 20; const [showMemberInvitationModal, setShowMemberInvitationModal] = useState(false); - const { data: currentOrg } = trpc.viewer.organizations.listCurrent.useQuery(undefined, { - enabled: !!session.data?.user?.org, - }); const { data: team, isPending: isTeamLoading, @@ -119,6 +146,13 @@ const MembersView = ({ isAppDir }: { isAppDir?: boolean }) => { [router, otherMembersError, otherTeamError] ); + useEffect(() => { + memberInvitationModalRef.current = setShowMemberInvitationModal; + return () => { + memberInvitationModalRef.current = null; + }; + }, []); + const isPending = isTeamLoading || isOrgListLoading; const inviteMemberMutation = trpc.viewer.teams.inviteMember.useMutation({ onSuccess: () => { @@ -129,33 +163,8 @@ const MembersView = ({ isAppDir }: { isAppDir?: boolean }) => { }, }); - const isOrgAdminOrOwner = - currentOrg && - (currentOrg.user.role === MembershipRole.OWNER || currentOrg.user.role === MembershipRole.ADMIN); - return ( <> - {!isAppDir ? ( - setShowMemberInvitationModal(true)} - data-testid="new-member-button"> - {t("add")} - - ) : ( - <> - ) - } - /> - ) : null} {!isPending && ( <>
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 5becdbd1a5cd32..7ffb7f9ca9d194 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 @@ -54,7 +54,7 @@ const teamProfileFormSchema = z.object({ bio: z.string(), }); -const OtherTeamProfileView = ({ isAppDir }: { isAppDir?: boolean }) => { +const OtherTeamProfileView = () => { const { t } = useLocale(); const router = useRouter(); const utils = trpc.useUtils(); @@ -169,7 +169,6 @@ const OtherTeamProfileView = ({ isAppDir }: { isAppDir?: boolean }) => { return ( <> - {!isAppDir ? : null} {!isPending ? ( <> {isAdmin ? ( diff --git a/packages/features/ee/organizations/pages/settings/profile.tsx b/packages/features/ee/organizations/pages/settings/profile.tsx index e1fc469e3b651a..c9f4276aed38f0 100644 --- a/packages/features/ee/organizations/pages/settings/profile.tsx +++ b/packages/features/ee/organizations/pages/settings/profile.tsx @@ -57,18 +57,9 @@ type FormValues = { calVideoLogo: string | null; }; -const SkeletonLoader = ({ - title, - description, - isAppDir, -}: { - title: string; - description: string; - isAppDir?: boolean; -}) => { +const SkeletonLoader = ({ title, description }: { title: string; description: string }) => { return ( - {!isAppDir ? : null}
@@ -84,7 +75,7 @@ const SkeletonLoader = ({ ); }; -const OrgProfileView = ({ isAppDir }: { isAppDir?: boolean }) => { +const OrgProfileView = () => { const { t } = useLocale(); const router = useRouter(); @@ -110,9 +101,7 @@ const OrgProfileView = ({ isAppDir }: { isAppDir?: boolean }) => { ); if (isPending || !orgBranding || !currentOrganisation) { - return ( - - ); + return ; } const isOrgAdminOrOwner = @@ -138,9 +127,6 @@ const OrgProfileView = ({ isAppDir }: { isAppDir?: boolean }) => { return ( - {!isAppDir ? ( - - ) : null} <> {isOrgAdminOrOwner ? ( <> diff --git a/packages/features/ee/sso/page/orgs-sso-view.tsx b/packages/features/ee/sso/page/orgs-sso-view.tsx index 35c45111878b6f..9cf310984c70c1 100644 --- a/packages/features/ee/sso/page/orgs-sso-view.tsx +++ b/packages/features/ee/sso/page/orgs-sso-view.tsx @@ -8,7 +8,7 @@ import { AppSkeletonLoader as SkeletonLoader, Meta } from "@calcom/ui"; import SSOConfiguration from "../components/SSOConfiguration"; -const SAMLSSO = ({ isAppDir }: { isAppDir?: boolean }) => { +const SAMLSSO = () => { const { t } = useLocale(); const { data, status } = useSession(); @@ -25,9 +25,6 @@ const SAMLSSO = ({ isAppDir }: { isAppDir?: boolean }) => { return !!isAdminOrOwner ? (
- {!isAppDir ? ( - - ) : null}
) : ( diff --git a/packages/features/settings/appDir/SettingsLayoutAppDirClient.tsx b/packages/features/settings/appDir/SettingsLayoutAppDirClient.tsx index 6a2f2b061db6ca..52639c6e6726d3 100644 --- a/packages/features/settings/appDir/SettingsLayoutAppDirClient.tsx +++ b/packages/features/settings/appDir/SettingsLayoutAppDirClient.tsx @@ -672,6 +672,7 @@ export type SettingsLayoutProps = { children: React.ReactNode; currentOrg: Awaited> | null; otherTeams: Awaited> | null; + containerClassName?: string; } & ComponentProps; export default function SettingsLayoutAppDirClient({ @@ -723,7 +724,8 @@ export default function SettingsLayoutAppDirClient({ setSideContainerOpen(!sideContainerOpen)} /> }>
-
+
{children}
diff --git a/turbo.json b/turbo.json index 743703ad3810c0..f63f4916a394c2 100644 --- a/turbo.json +++ b/turbo.json @@ -243,7 +243,6 @@ "APP_ROUTER_EVENT_TYPES_ENABLED", "APP_ROUTER_GETTING_STARTED_STEP_ENABLED", "APP_ROUTER_SETTINGS_DEVELOPER_ENABLED", - "APP_ROUTER_SETTINGS_ORG_ENABLED", "APP_ROUTER_SETTINGS_TEAMS_ENABLED", "APP_ROUTER_WORKFLOWS_ENABLED", "APP_ROUTER_VIDEO_ENABLED",