From ebc70feef0d55b8ca033d30f9a853f8ff987c6dd Mon Sep 17 00:00:00 2001 From: Udit Takkar <53316345+Udit-takkar@users.noreply.github.com> Date: Wed, 11 Oct 2023 14:34:54 +0530 Subject: [PATCH] refactor: org settings (#11682) --- apps/web/pages/settings/billing/index.tsx | 2 +- .../web/pages/settings/developer/api-keys.tsx | 6 +- .../pages/settings/my-account/appearance.tsx | 30 +- .../pages/settings/my-account/calendars.tsx | 14 +- .../settings/my-account/conferencing.tsx | 4 +- .../web/pages/settings/my-account/general.tsx | 6 +- .../web/pages/settings/my-account/profile.tsx | 4 +- .../pages/settings/organizations/billing.tsx | 6 +- .../pages/settings/security/impersonation.tsx | 2 +- .../settings/security/two-factor-auth.tsx | 2 +- .../web/pages/settings/teams/[id]/billing.tsx | 6 +- apps/web/public/static/locales/en/common.json | 4 + .../calendars/DestinationCalendarSelector.tsx | 4 +- .../pages/settings/appearance.tsx | 402 ++++++++++++------ .../organizations/pages/settings/general.tsx | 131 +++--- .../organizations/pages/settings/profile.tsx | 385 ++++++++++------- .../ee/teams/pages/team-billing-view.tsx | 2 +- .../settings/SectionBottomActions.tsx | 2 +- .../settings/layouts/SettingsLayout.tsx | 10 +- .../components/WebhookTestDisclosure.tsx | 8 +- .../webhooks/pages/webhook-edit-view.tsx | 1 + .../webhooks/pages/webhook-new-view.tsx | 2 +- .../features/webhooks/pages/webhooks-view.tsx | 8 +- packages/lib/constants.ts | 3 + .../viewer/organizations/update.handler.ts | 2 +- packages/ui/components/form/select/Select.tsx | 2 +- .../components/form/switch/SettingsToggle.tsx | 7 +- 27 files changed, 653 insertions(+), 402 deletions(-) diff --git a/apps/web/pages/settings/billing/index.tsx b/apps/web/pages/settings/billing/index.tsx index acf3b30578..501c405a25 100644 --- a/apps/web/pages/settings/billing/index.tsx +++ b/apps/web/pages/settings/billing/index.tsx @@ -45,7 +45,7 @@ const BillingView = () => { return ( <> -
+
-
+

{t("check_for_conflicts")}

-

{t("select_calendars")}

+

{t("select_calendars")}

{data.connectedCalendars.map((item) => ( @@ -173,7 +173,7 @@ const CalendarsView = () => { /> )} {item?.error === undefined && item.calendars && ( - +
{ // eslint-disable-next-line @next/next/no-img-element diff --git a/apps/web/pages/settings/my-account/conferencing.tsx b/apps/web/pages/settings/my-account/conferencing.tsx index 9617369037..58691f1643 100644 --- a/apps/web/pages/settings/my-account/conferencing.tsx +++ b/apps/web/pages/settings/my-account/conferencing.tsx @@ -16,7 +16,7 @@ const SkeletonLoader = ({ title, description }: { title: string; description: st return ( -
+
@@ -100,7 +100,7 @@ const ConferencingLayout = () => { } return ( { setIsAllowDynamicBookingChecked(checked); mutation.mutate({ allowDynamicBooking: checked }); }} - switchContainerClassName="border-subtle mt-6 rounded-xl border py-6 px-4 sm:px-6" + switchContainerClassName="mt-6" /> { setIsAllowSEOIndexingChecked(checked); mutation.mutate({ allowSEOIndexing: checked }); }} - switchContainerClassName="border-subtle mt-6 rounded-xl border py-6 px-4 sm:px-6" + switchContainerClassName="mt-6" /> { setIsReceiveMonthlyDigestEmailChecked(checked); mutation.mutate({ receiveMonthlyDigestEmail: checked }); }} - switchContainerClassName="border-subtle mt-6 rounded-xl border py-6 px-4 sm:px-6" + switchContainerClassName="mt-6" />
); diff --git a/apps/web/pages/settings/my-account/profile.tsx b/apps/web/pages/settings/my-account/profile.tsx index 33084f4369..6b57135292 100644 --- a/apps/web/pages/settings/my-account/profile.tsx +++ b/apps/web/pages/settings/my-account/profile.tsx @@ -50,7 +50,7 @@ const SkeletonLoader = ({ title, description }: { title: string; description: st return ( -
+
@@ -279,7 +279,7 @@ const ProfileView = () => { } /> -
+

{t("account_deletion_cannot_be_undone")}

diff --git a/apps/web/pages/settings/organizations/billing.tsx b/apps/web/pages/settings/organizations/billing.tsx index abf744c320..d830b3f3ac 100644 --- a/apps/web/pages/settings/organizations/billing.tsx +++ b/apps/web/pages/settings/organizations/billing.tsx @@ -1,9 +1,9 @@ -import TeamBillingView from "@calcom/features/ee/teams/pages/team-billing-view"; - import type { CalPageWrapper } from "@components/PageWrapper"; import PageWrapper from "@components/PageWrapper"; -const Page = TeamBillingView as CalPageWrapper; +import BillingPage from "../../settings/billing/index"; + +const Page = BillingPage as CalPageWrapper; Page.PageWrapper = PageWrapper; export default Page; diff --git a/apps/web/pages/settings/security/impersonation.tsx b/apps/web/pages/settings/security/impersonation.tsx index d3afab267e..f23b358f72 100644 --- a/apps/web/pages/settings/security/impersonation.tsx +++ b/apps/web/pages/settings/security/impersonation.tsx @@ -66,8 +66,8 @@ const ProfileImpersonationView = ({ user }: { user: RouterOutputs["viewer"]["me" onCheckedChange={(checked) => { mutation.mutate({ disableImpersonation: !checked }); }} + switchContainerClassName="rounded-t-none border-t-0" disabled={mutation.isLoading} - switchContainerClassName="py-6 px-4 sm:px-6 border-subtle rounded-b-xl border border-t-0" />
diff --git a/apps/web/pages/settings/security/two-factor-auth.tsx b/apps/web/pages/settings/security/two-factor-auth.tsx index 7cd47f3317..1feca6152a 100644 --- a/apps/web/pages/settings/security/two-factor-auth.tsx +++ b/apps/web/pages/settings/security/two-factor-auth.tsx @@ -63,7 +63,7 @@ const TwoFactorAuthView = () => { {user?.twoFactorEnabled ? t("enabled") : t("disabled")} } - switchContainerClassName="border-subtle rounded-b-xl border border-t-0 px-5 py-6 sm:px-6" + switchContainerClassName="rounded-t-none border-t-0" /> +

{t("add_events_to")}

{ - if (event) formMethods.setValue("timeFormat", { ...event }, { shouldDirty: true }); - }} - /> - - )} - /> -
- {t("timeformat_profile_hint")} +
+ ( + <> + + { + if (event) formMethods.setValue("timeZone", event.value, { shouldDirty: true }); + }} + /> + + )} + /> + ( + <> + + { + if (event) formMethods.setValue("weekStart", { ...event }, { shouldDirty: true }); + }} + /> + + )} + />
- ( - <> - -