chore: rename DWD to DelegationCredential (#19703)

* chore: rename DWD to DelegationCredential

* fixup! chore: rename DWD to DelegationCredential

* fixup! fixup! chore: rename DWD to DelegationCredential

* fixup! Merge branch 'main' into rename-domain-wide-delegation

* fixup! fixup! Merge branch 'main' into rename-domain-wide-delegation

* fixup! fixup! fixup! Merge branch 'main' into rename-domain-wide-delegation
This commit is contained in:
Morgan authored and GitHub committed 2025-03-04 09:45:39 -03:00
1 parent a39b5e47a7
commit 7a9ddf2194
167 files changed
+4232 -2356

No files matched your search

@@ -186,7 +186,7 @@ function CreateDelegationDialog({
return (
<Dialog open={isOpen} onOpenChange={onClose}>
<DialogContent enableOverflow title={t("add_domain_wide_delegation")}>
<DialogContent enableOverflow title={t("add_delegation_credential")}>
<Form form={form} handleSubmit={handleSubmit}>
<DelegationFormFields workspacePlatforms={workspacePlatforms} isCreate={true} />
<DialogFooter>
@@ -226,7 +226,7 @@ function EditDelegationDialog({
return (
<Dialog open={isOpen} onOpenChange={onClose}>
<DialogContent title={t("edit_domain_wide_delegation")}>
<DialogContent title={t("edit_delegation_credential")}>
<Form form={form} handleSubmit={handleEdit}>
<DelegationFormFields workspacePlatforms={workspacePlatforms} isCreate={false} />
<DialogFooter>
@@ -282,26 +282,26 @@ function DelegationFormFields({
);
}
function DomainWideDelegationList() {
function DelegationCredentialList() {
const { t } = useLocale();
const utils = trpc.useContext();
const { data: delegations, isLoading, error } = trpc.viewer.domainWideDelegation.list.useQuery();
const { data: delegations, isLoading, error } = trpc.viewer.delegationCredential.list.useQuery();
const updateMutation = trpc.viewer.domainWideDelegation.update.useMutation({
onSuccess: () => utils.viewer.domainWideDelegation.list.invalidate(),
const updateMutation = trpc.viewer.delegationCredential.update.useMutation({
onSuccess: () => utils.viewer.delegationCredential.list.invalidate(),
onError: (error) => {
showToast(error.message, "error");
},
});
const toggleEnabledMutation = trpc.viewer.domainWideDelegation.toggleEnabled.useMutation({
const toggleEnabledMutation = trpc.viewer.delegationCredential.toggleEnabled.useMutation({
onSuccess: (data) => {
if (data) {
showToast(
data.enabled ? t("domain_wide_delegation_enabled") : t("domain_wide_delegation_disabled"),
data.enabled ? t("delegation_credential_enabled") : t("delegation_credential_disabled"),
"success"
);
utils.viewer.domainWideDelegation.list.invalidate();
utils.viewer.delegationCredential.list.invalidate();
}
},
onError: (error) => {
@@ -309,15 +309,15 @@ function DomainWideDelegationList() {
},
});
const createMutation = trpc.viewer.domainWideDelegation.add.useMutation({
onSuccess: () => utils.viewer.domainWideDelegation.list.invalidate(),
const createMutation = trpc.viewer.delegationCredential.add.useMutation({
onSuccess: () => utils.viewer.delegationCredential.list.invalidate(),
onError: (error) => {
showToast(error.message, "error");
},
});
const deleteMutation = trpc.viewer.domainWideDelegation.delete.useMutation({
onSuccess: () => utils.viewer.domainWideDelegation.list.invalidate(),
const deleteMutation = trpc.viewer.delegationCredential.delete.useMutation({
onSuccess: () => utils.viewer.delegationCredential.list.invalidate(),
onError: (error) => {
showToast(error.message, "error");
},
@@ -345,7 +345,7 @@ function DomainWideDelegationList() {
});
const { data: workspacePlatforms, isLoading: isLoadingWorkspacePlatforms } =
trpc.viewer.domainWideDelegation.listWorkspacePlatforms.useQuery();
trpc.viewer.delegationCredential.listWorkspacePlatforms.useQuery();
const enabledWorkspacePlatforms = workspacePlatforms?.filter((platform) => platform.enabled) || [];
@@ -379,7 +379,7 @@ function DomainWideDelegationList() {
const AddDwDButton = () => {
return (
<Button type="button" color="secondary" StartIcon="plus" className="mt-6" onClick={onCreateClick}>
{t("add_domain_wide_delegation")}
{t("add_delegation_credential")}
</Button>
);
};
@@ -419,8 +419,8 @@ function DomainWideDelegationList() {
) : (
<EmptyScreen
Icon="link"
headline={t("add_domain_wide_delegation")}
description={t("domain_wide_delegation_description")}
headline={t("add_delegation_credential")}
description={t("delegation_credential_description")}
className="rounded-b-lg rounded-t-none border-t-0"
buttonRaw={<AddDwDButton />}
/>
@@ -446,6 +446,6 @@ function DomainWideDelegationList() {
);
}
export default function DomainWideDelegationListPage() {
return <DomainWideDelegationList />;
export default function DelegationCredentialListPage() {
return <DelegationCredentialList />;
}
@@ -20,7 +20,7 @@ import { scheduleWorkflowReminders } from "@calcom/features/ee/workflows/lib/rem
import { isPrismaObjOrUndefined } from "@calcom/lib";
import { getVideoCallUrlFromCalEvent } from "@calcom/lib/CalEventParser";
import { SENDER_NAME } from "@calcom/lib/constants";
import { enrichUserWithDwdCredentialsWithoutOrgId } from "@calcom/lib/domainWideDelegation/server";
import { enrichUserWithDelegationCredentialsWithoutOrgId } from "@calcom/lib/delegationCredential/server";
import { getEventName } from "@calcom/lib/event";
import { getBookerBaseUrl } from "@calcom/lib/getBookerUrl/server";
import logger from "@calcom/lib/logger";
@@ -275,7 +275,7 @@ export const roundRobinManualReassignment = async ({
include: { user: { select: { email: true } } },
});
const newUserWithCredentials = await enrichUserWithDwdCredentialsWithoutOrgId({
const newUserWithCredentials = await enrichUserWithDelegationCredentialsWithoutOrgId({
user: { ...newUser, credentials },
});
@@ -22,9 +22,9 @@ import { isPrismaObjOrUndefined } from "@calcom/lib";
import { getVideoCallUrlFromCalEvent } from "@calcom/lib/CalEventParser";
import { SENDER_NAME } from "@calcom/lib/constants";
import {
enrichHostsWithDwdCredentials,
enrichUserWithDwdCredentialsWithoutOrgId,
} from "@calcom/lib/domainWideDelegation/server";
enrichHostsWithDelegationCredentials,
enrichUserWithDelegationCredentialsWithoutOrgId,
} from "@calcom/lib/delegationCredential/server";
import { getEventName } from "@calcom/lib/event";
import { getBookerBaseUrl } from "@calcom/lib/getBookerUrl/server";
import logger from "@calcom/lib/logger";
@@ -119,7 +119,7 @@ export const roundRobinReassignment = async ({
const previousRRHostT = await getTranslation(previousRRHost?.locale || "en", "common");
const eventTypeHosts = await enrichHostsWithDwdCredentials({
const eventTypeHosts = await enrichHostsWithDelegationCredentials({
orgId,
hosts: eventType.hosts,
});
@@ -320,7 +320,7 @@ export const roundRobinReassignment = async ({
},
});
const organizerWithCredentials = await enrichUserWithDwdCredentialsWithoutOrgId({
const organizerWithCredentials = await enrichUserWithDelegationCredentialsWithoutOrgId({
user: { ...organizer, credentials },
});