refactor: platform default event types (#19225)

* feat: add areDefaultEventTypesEnabled to PlatformOAuthClient

* feat: specify areDefaultEventTypesEnabled when creating OAuth client

* feat: specify areDefaultEventTypesEnabled when updating OAuth client

* feat: display areDefaultEventTypesEnabled in OAuth clients list

* refactor: set areDefaultEventTypesEnabled by default to false on API level

* feat: v2 API CREATE managed user toggle default event types

* refactor: centralize OAuth inputs and outputs in platform/types

* fix: correct response types for OAuth hooks

* refactor: web/lib/hooks/settings/platform/oauth-clients/useOAuthClients.ts

* refactor: web/lib/hooks/settings/platform/oauth-clients/useOAuthClients.ts

* refactor: split web OAuth hooks into separate files

* refactor: split web OAuth hooks into separate files

* docs: v2 OAuth client inputs and outputs

* refactor: update and create oauth client inputs
This commit is contained in:
Lauris Skraucis
2025-02-26 12:06:08 -03:00
committed by GitHub
parent 07789ba697
commit e437dfa000
35 changed files with 519 additions and 138 deletions
@@ -9,8 +9,8 @@ import { useLocale } from "@calcom/lib/hooks/useLocale";
import { PERMISSIONS_GROUPED_MAP } from "@calcom/platform-constants";
import { showToast } from "@calcom/ui";
import { useOAuthClient } from "@lib/hooks/settings/platform/oauth-clients/useOAuthClients";
import { useUpdateOAuthClient } from "@lib/hooks/settings/platform/oauth-clients/usePersistOAuthClient";
import { useOAuthClient } from "@lib/hooks/settings/platform/oauth-clients/useOAuthClient";
import { useUpdateOAuthClient } from "@lib/hooks/settings/platform/oauth-clients/useUpdateOAuthClient";
import NoPlatformPlan from "@components/settings/platform/dashboard/NoPlatformPlan";
import { useGetUserAttributes } from "@components/settings/platform/hooks/useGetUserAttributes";
@@ -59,6 +59,7 @@ export default function EditOAuthClient() {
bookingCancelRedirectUri: data.bookingCancelRedirectUri,
bookingRescheduleRedirectUri: data.bookingRescheduleRedirectUri,
areEmailsEnabled: data.areEmailsEnabled,
areDefaultEventTypesEnabled: data.areDefaultEventTypesEnabled,
});
};
@@ -85,6 +86,7 @@ export default function EditOAuthClient() {
defaultValues={{
name: data?.name ?? "",
areEmailsEnabled: data.areEmailsEnabled ?? false,
areDefaultEventTypesEnabled: data.areDefaultEventTypesEnabled ?? false,
redirectUris: data?.redirectUris?.map((uri) => ({ uri })) ?? [{ uri: "" }],
bookingRedirectUri: data?.bookingRedirectUri ?? "",
bookingCancelRedirectUri: data?.bookingCancelRedirectUri ?? "",
@@ -10,7 +10,7 @@ import type { PERMISSION_MAP } from "@calcom/platform-constants";
import { PERMISSIONS_GROUPED_MAP } from "@calcom/platform-constants/permissions";
import { showToast } from "@calcom/ui";
import { useCreateOAuthClient } from "@lib/hooks/settings/platform/oauth-clients/usePersistOAuthClient";
import { useCreateOAuthClient } from "@lib/hooks/settings/platform/oauth-clients/useCreateOAuthClient";
import NoPlatformPlan from "@components/settings/platform/dashboard/NoPlatformPlan";
import { useGetUserAttributes } from "@components/settings/platform/hooks/useGetUserAttributes";
@@ -55,6 +55,7 @@ export default function CreateOAuthClient() {
bookingCancelRedirectUri: data.bookingCancelRedirectUri,
bookingRescheduleRedirectUri: data.bookingRescheduleRedirectUri,
areEmailsEnabled: data.areEmailsEnabled,
areDefaultEventTypesEnabled: data.areDefaultEventTypesEnabled,
});
};
@@ -7,8 +7,8 @@ import Shell from "@calcom/features/shell/Shell";
import { useLocale } from "@calcom/lib/hooks/useLocale";
import { showToast } from "@calcom/ui";
import { useDeleteOAuthClient } from "@lib/hooks/settings/platform/oauth-clients/useDeleteOAuthClient";
import { useOAuthClients } from "@lib/hooks/settings/platform/oauth-clients/useOAuthClients";
import { useDeleteOAuthClient } from "@lib/hooks/settings/platform/oauth-clients/usePersistOAuthClient";
import { HelpCards } from "@components/settings/platform/dashboard/HelpCards";
import NoPlatformPlan from "@components/settings/platform/dashboard/NoPlatformPlan";