feat: Upgrade to Next 15 (#18834)

* wip

* update layoutHOC

* wip

* remove app router related code no longer used

* remove more

* await cookies, headers, params, serachparams

* update yarn.lock

* await cookies, headers, params, serachparams more

* update yarn lock again

* downgrade next-auth to 4.22.1

* update yarn lock

* fix

* update yarn lock

* fix type checks

* update yarn lock

* await headers and cookies

* restore pages folder

* restore yarn.lock

* update yarn.lock

* await headers and cookies

* remove

* await params in API routes

* updates

* restore next.config.js

* remove i18n from next.config.js

* Fixed tests

* Fixed types

* Removed duplicate favicon.ico

* Fixing more types

* ImageResponse moved to next/og

* Fixed prisma import issues

* dynamic import for @ewsjs/xhr

* remove deasync dep

* dynamic import for @tryvital/vital-node

* fix type checks

* add back turbopack command

* Type fix

* Removed unneeded file

* fix turbopack relative path errors

* add comments

* remove unneeded code

* Fixed build errors

* await apis

* use Promise<Params> type in defaultResponderForAppDir util

* refactor scim api route

* fix type checks

* separate app-routing.config into client-config and server-config

* wip

* refactor routing forms components

* revert unneeded changes for easier review

* fix

* fix

* use CustomTrans

* fix type

* fix unit tests

* fix type error

* fix build error

* fix build error

* fix build error

* fix warnings

* fix warnings

* upgrade @tremor/react and tailwindcss

* numCols -> numItems

* fix forgot-password e2e test

* fix 1 more e2e test

* fix login e2e test

* fix e2e tests

* fix e2e tests

* clean up

* remove error

* use tremor/react 2.11.0

* fix

* rename CustomTrans to ServerTrans

* address comment

* fix test

* fix ServerTrans

* fix

* fix type

* fix ServerTrans usages 1

* fix translations

* fix type checks

* fix type checks

* link styling

* fix

---------

Co-authored-by: Keith Williams <[email protected]>
Co-authored-by: Anik Dhabal Babu <[email protected]>
This commit is contained in:
authored and GitHub committed 2025-03-20 21:30:51 -03:00
1 parent 695a4d7a59
commit 8ad442f2be
263 files changed
+2002 -1663

No files matched your search

@@ -1,6 +1,5 @@
"use client";
import { Trans } from "next-i18next";
import Link from "next/link";
import { useState, useEffect, useRef, useMemo } from "react";
@@ -24,6 +23,7 @@ import {
SheetTitle,
} from "@calcom/ui/components/sheet";
import { showToast } from "@calcom/ui/components/toast";
import ServerTrans from "@calcom/web/components/ServerTrans";
type TeamMemberItemProps = {
member: Omit<TeamMember, "defaultScheduleId"> & { weight?: number };
@@ -302,15 +302,19 @@ export const EditWeightsForAllTeamMembers = ({
<SheetHeader>
<SheetTitle>{t("edit_team_member_weights")}</SheetTitle>
<div className="text-subtle text-sm">
<Trans i18nKey="weights_description">
Weights determine how meetings are distributed among hosts.
<Link
className="underline underline-offset-2"
target="_blank"
href="https://cal.com/docs/enterprise-features/teams/round-robin-scheduling#weights">
Learn more
</Link>
</Trans>
<ServerTrans
t={t}
i18nKey="weights_description"
components={[
<Link
key="weights_description"
className="underline underline-offset-2"
target="_blank"
href="https://cal.com/docs/enterprise-features/teams/round-robin-scheduling#weights">
Learn more
</Link>,
]}
/>
</div>
</SheetHeader>
@@ -1,5 +1,3 @@
import { Trans } from "next-i18next";
import Link from "next/link";
import type { Dispatch, SetStateAction } from "react";
import { useState } from "react";
import { useFormContext } from "react-hook-form";
@@ -19,6 +17,7 @@ import classNames from "@calcom/ui/classNames";
import { Dialog, DialogContent, DialogFooter, DialogClose } from "@calcom/ui/components/dialog";
import type { CheckedSelectOption } from "./CheckedTeamSelect";
import WeightDescription from "./WeightDescription";
interface IDialog {
isOpenDialog: boolean;
@@ -99,18 +98,6 @@ export const PriorityDialog = (
);
};
export const weightDescription = (
<Trans i18nKey="weights_description">
Weights determine how meetings are distributed among hosts.
<Link
className="underline underline-offset-2"
target="_blank"
href="https://cal.com/docs/enterprise-features/teams/round-robin-scheduling#weights">
Learn more
</Link>
</Trans>
);
export function sortHosts(
hostA: { priority: number | null; weight: number | null },
hostB: { priority: number | null; weight: number | null },
@@ -167,7 +154,7 @@ export const WeightDialog = (props: IDialog & { customClassNames?: WeightDialogC
return (
<Dialog open={isOpenDialog} onOpenChange={setIsOpenDialog}>
<DialogContent title={t("set_weight")} description={weightDescription}>
<DialogContent title={t("set_weight")} description={<WeightDescription t={t} />}>
<div className={classNames("mb-4 mt-2", customClassNames?.container)}>
<Label className={customClassNames?.label}>
{t("weight_for_user", { userName: option.label })}
@@ -1,6 +1,5 @@
import { useAutoAnimate } from "@formkit/auto-animate/react";
import { ErrorMessage } from "@hookform/error-message";
import { Trans } from "next-i18next";
import Link from "next/link";
import { useEffect, useState } from "react";
import { Controller, useFieldArray } from "react-hook-form";
@@ -23,11 +22,12 @@ import type {
import LocationSelect from "@calcom/features/form/components/LocationSelect";
import { WEBAPP_URL } from "@calcom/lib/constants";
import { useLocale } from "@calcom/lib/hooks/useLocale";
import { Input } from "@calcom/ui/components/form";
import { Button } from "@calcom/ui/components/button";
import classNames from "@calcom/ui/classNames";
import { Button } from "@calcom/ui/components/button";
import { Input } from "@calcom/ui/components/form";
import { Icon } from "@calcom/ui/components/icon";
import { showToast } from "@calcom/ui/components/toast";
import ServerTrans from "@calcom/web/components/ServerTrans";
export type TEventTypeLocation = Pick<EventTypeSetupProps["eventType"], "locations">;
export type TLocationOptions = Pick<EventTypeSetupProps, "locationOptions">["locationOptions"];
@@ -443,14 +443,18 @@ const Locations: React.FC<LocationsProps> = ({
<Icon name="check" className="h-3 w-3" />
</div>
<p className="text-default text-sm">
<Trans i18nKey="event_type_requires_google_calendar">
The “Add to calendar” for this event type needs to be a Google Calendar for Meet to work.
Connect it
<Link className="cursor-pointer text-blue-500 underline" href="/apps/google-calendar">
here
</Link>
.
</Trans>
<ServerTrans
t={t}
i18nKey="event_type_requires_google_calendar"
components={[
<Link
key="event_type_requires_google_calendar"
className="cursor-pointer text-blue-500 underline"
href="/apps/google-calendar">
here
</Link>,
]}
/>
</p>
</div>
)}
@@ -480,13 +484,18 @@ const Locations: React.FC<LocationsProps> = ({
</ul>
{props.showAppStoreLink && !isPlatorm && (
<p className="text-default mt-2 text-sm">
<Trans i18nKey="cant_find_the_right_conferencing_app_visit_our_app_store">
Can&apos;t find the right conferencing app? Visit our
<Link className="cursor-pointer text-blue-500 underline" href="/apps/categories/conferencing">
App Store
</Link>
.
</Trans>
<ServerTrans
t={t}
i18nKey="cant_find_the_right_conferencing_app_visit_our_app_store"
components={[
<Link
key="cant_find_the_right_conferencing_app_visit_our_app_store"
className="cursor-pointer text-blue-500 underline"
href="/apps/categories/conferencing">
App Store
</Link>,
]}
/>
</p>
)}
</div>
@@ -0,0 +1,22 @@
import type { TFunction } from "i18next";
import Link from "next/link";
import ServerTrans from "@calcom/web/components/ServerTrans";
export default function WeightDescription({ t }: { t: TFunction }) {
return (
<ServerTrans
t={t}
i18nKey="weights_description"
components={[
<Link
key="weights_description"
className="underline underline-offset-2"
target="_blank"
href="https://cal.com/docs/enterprise-features/teams/round-robin-scheduling#weights">
Learn more
</Link>,
]}
/>
);
}
@@ -1,8 +1,8 @@
import { Trans } from "next-i18next";
import { useLocale } from "@calcom/lib/hooks/useLocale";
import classNames from "@calcom/ui/classNames";
import type { DialogProps } from "@calcom/ui/components/dialog";
import { ConfirmationDialogContent, Dialog } from "@calcom/ui/components/dialog";
import ServerTrans from "@calcom/web/components/ServerTrans";
export function DeleteDialog({
isManagedEvent,
@@ -32,14 +32,14 @@ export function DeleteDialog({
onDelete(eventTypeId);
}}>
<p className="mt-5">
<Trans
i18nKey={`delete${isManagedEvent}_event_type_description`}
components={{ li: <li />, ul: <ul className="ml-4 list-disc" /> }}>
<ul>
<li>Members assigned to this event type will also have their event types deleted.</li>
<li>Anyone who they&apos;ve shared their link with will no longer be able to book using it.</li>
{isManagedEvent ? (
<ul className="ml-4 list-disc">
<li>{t("delete_managed_event_type_description_1")}</li>
<li>{t("delete_managed_event_type_description_2")}</li>
</ul>
</Trans>
) : (
t("delete_event_type_description")
)}
</p>
</ConfirmationDialogContent>
</Dialog>
@@ -1,8 +1,7 @@
import { Trans } from "next-i18next";
import type { ChildrenEventType } from "@calcom/features/eventtypes/components/ChildrenEventTypeSelect";
import { useLocale } from "@calcom/lib/hooks/useLocale";
import { ConfirmationDialogContent, Dialog } from "@calcom/ui/components/dialog";
import ServerTrans from "@calcom/web/components/ServerTrans";
interface ManagedEventDialogProps {
slugExistsChildrenDialogOpen: ChildrenEventType[];
@@ -31,8 +30,13 @@ export default function ManagedEventDialog(props: ManagedEventDialogProps) {
cancelBtnText={t("go_back")}
onConfirm={onConfirm}>
<p className="mt-5">
<Trans
i18nKey="managed_event_dialog_information"
<ServerTrans
t={t}
i18nKey={
slugExistsChildrenDialogOpen.length > 1
? "managed_event_dialog_information_other"
: "managed_event_dialog_information_one"
}
values={{
names: `${slugExistsChildrenDialogOpen
.map((ch) => ch.owner.name)
@@ -42,7 +46,6 @@ export default function ManagedEventDialog(props: ManagedEventDialogProps) {
} ${slugExistsChildrenDialogOpen.map((ch) => ch.owner.name).slice(-1)}`,
slug,
}}
count={slugExistsChildrenDialogOpen.length}
/>
</p>{" "}
<p className="mt-5">{t("managed_event_dialog_clarification")}</p>
@@ -1,13 +1,13 @@
import type { TFunction } from "next-i18next";
import { Trans } from "next-i18next";
import type { TFunction } from "i18next";
import { useState } from "react";
import type { InputClassNames, SettingsToggleClassNames } from "@calcom/features/eventtypes/lib/types";
import { InputField } from "@calcom/ui/components/form";
import { Button } from "@calcom/ui/components/button";
import classNames from "@calcom/ui/classNames";
import { Button } from "@calcom/ui/components/button";
import { Dialog, DialogContent, DialogFooter, DialogClose } from "@calcom/ui/components/dialog";
import { InputField } from "@calcom/ui/components/form";
import { SettingsToggle } from "@calcom/ui/components/form";
import ServerTrans from "@calcom/web/components/ServerTrans";
export type EmailNotificationToggleCustomClassNames = SettingsToggleClassNames & {
confirmationDialog?: {
@@ -53,15 +53,7 @@ export const DisableAllEmailsSetting = ({
className={customClassNames?.confirmationDialog?.container}>
<p
className={classNames("text-default text-sm", customClassNames?.confirmationDialog?.description)}>
<Trans i18nKey="disable_attendees_emails_description">
This will disable all emails to {recipient}. This includes booking confirmations, requests,
reschedules and reschedule requests, cancellation emails, and any other emails related to
booking updates.
<br />
<br />
It is your responsibility to ensure that your {recipient} are aware of any bookings and changes
to their bookings.
</Trans>
<ServerTrans t={t} i18nKey="disable_attendees_emails_description" values={{ recipient }} />
</p>
<p
className={classNames(
@@ -1,6 +1,5 @@
import * as RadioGroup from "@radix-ui/react-radio-group";
import type { UnitTypeLongPlural } from "dayjs";
import { Trans } from "next-i18next";
import type { Dispatch, SetStateAction } from "react";
import { useEffect, useState } from "react";
import { Controller, useFormContext } from "react-hook-form";
@@ -17,6 +16,7 @@ import { CheckboxField } from "@calcom/ui/components/form";
import { Input } from "@calcom/ui/components/form";
import { SettingsToggle } from "@calcom/ui/components/form";
import { RadioField } from "@calcom/ui/components/radio";
import ServerTrans from "@calcom/web/components/ServerTrans";
export type RequiresConfirmationCustomClassNames = SettingsToggleClassNames & {
radioGroupContainer?: string;
@@ -163,70 +163,70 @@ export default function RequiresConfirmationController({
)}
label={
<>
<Trans
<ServerTrans
t={t}
i18nKey="when_booked_with_less_than_notice"
defaults="When booked with less than <time></time> notice"
components={{
time: (
<div className="mx-2 inline-flex items-center">
<Input
type="number"
min={1}
disabled={requiresConfirmationLockedProps.disabled}
onChange={(evt) => {
const val = Number(evt.target?.value);
components={[
<div
key="when_booked_with_less_than_notice"
className="mx-2 inline-flex items-center">
<Input
type="number"
min={1}
disabled={requiresConfirmationLockedProps.disabled}
onChange={(evt) => {
const val = Number(evt.target?.value);
setRequiresConfirmationSetup({
unit:
requiresConfirmationSetup?.unit ??
defaultRequiresConfirmationSetup.unit,
time: val,
});
formMethods.setValue(
"metadata.requiresConfirmationThreshold.time",
val,
{ shouldDirty: true }
);
}}
className={classNames(
"border-default h-9! !m-0 block w-16 rounded-r-none border-r-0 text-sm [appearance:textfield] focus:z-10 focus:border-r",
customClassNames?.conditionalConfirmationRadio?.timeInput
)}
defaultValue={metadata?.requiresConfirmationThreshold?.time || 30}
/>
<label
className={classNames(
requiresConfirmationLockedProps.disabled && "cursor-not-allowed"
)}>
<Select
inputId="notice"
options={options}
isSearchable={false}
isDisabled={requiresConfirmationLockedProps.disabled}
className={
customClassNames?.conditionalConfirmationRadio?.timeUnitSelect
}
innerClassNames={{
control: "rounded-l-none max-h-4 px-3 bg-subtle",
}}
onChange={(opt) => {
setRequiresConfirmationSetup({
unit:
requiresConfirmationSetup?.unit ??
defaultRequiresConfirmationSetup.unit,
time: val,
time:
requiresConfirmationSetup?.time ??
defaultRequiresConfirmationSetup.time,
unit: opt?.value as UnitTypeLongPlural,
});
formMethods.setValue(
"metadata.requiresConfirmationThreshold.time",
val,
"metadata.requiresConfirmationThreshold.unit",
opt?.value as UnitTypeLongPlural,
{ shouldDirty: true }
);
}}
className={classNames(
"border-default h-9! !m-0 block w-16 rounded-r-none border-r-0 text-sm [appearance:textfield] focus:z-10 focus:border-r",
customClassNames?.conditionalConfirmationRadio?.timeInput
)}
defaultValue={metadata?.requiresConfirmationThreshold?.time || 30}
defaultValue={defaultValue}
/>
<label
className={classNames(
requiresConfirmationLockedProps.disabled && "cursor-not-allowed"
)}>
<Select
inputId="notice"
options={options}
isSearchable={false}
isDisabled={requiresConfirmationLockedProps.disabled}
className={
customClassNames?.conditionalConfirmationRadio?.timeUnitSelect
}
innerClassNames={{
control: "rounded-l-none max-h-4 px-3 bg-subtle",
}}
onChange={(opt) => {
setRequiresConfirmationSetup({
time:
requiresConfirmationSetup?.time ??
defaultRequiresConfirmationSetup.time,
unit: opt?.value as UnitTypeLongPlural,
});
formMethods.setValue(
"metadata.requiresConfirmationThreshold.unit",
opt?.value as UnitTypeLongPlural,
{ shouldDirty: true }
);
}}
defaultValue={defaultValue}
/>
</label>
</div>
),
}}
</label>
</div>,
]}
/>
</>
}
@@ -1,4 +1,3 @@
import { Trans } from "next-i18next";
import Link from "next/link";
import { useFormContext } from "react-hook-form";
@@ -10,9 +9,10 @@ import type { FormValues, EventTypeSetupProps } from "@calcom/features/eventtype
import useAppsData from "@calcom/lib/hooks/useAppsData";
import { useLocale } from "@calcom/lib/hooks/useLocale";
import { trpc } from "@calcom/trpc/react";
import { EmptyScreen } from "@calcom/ui/components/empty-screen";
import { Alert } from "@calcom/ui/components/alert";
import { Button } from "@calcom/ui/components/button";
import { EmptyScreen } from "@calcom/ui/components/empty-screen";
import ServerTrans from "@calcom/web/components/ServerTrans";
export type EventType = Pick<EventTypeSetupProps, "eventType">["eventType"] &
EventTypeAppCardComponentProps["eventType"];
@@ -97,22 +97,19 @@ export const EventAppsTab = ({ eventType }: { eventType: EventType }) => {
severity={appsDisableProps.isLocked ? "neutral" : "info"}
className="mb-2"
title={
<Trans i18nKey={`${lockedText}_${isManagedEventType ? "for_members" : "by_team_admins"}`}>
{lockedText[0].toUpperCase()}
{lockedText.slice(1)} {isManagedEventType ? "for members" : "by team admins"}
</Trans>
<ServerTrans
t={t}
i18nKey={`${lockedText}_${isManagedEventType ? "for_members" : "by_team_admins"}`}
/>
}
actions={<div className="flex h-full items-center">{appsDisableProps.LockedIcon}</div>}
message={
<Trans
<ServerTrans
t={t}
i18nKey={`apps_${lockedText}_${
isManagedEventType ? "for_members" : "by_team_admins"
}_description`}>
{isManagedEventType ? "Members" : "You"}{" "}
{appsDisableProps.isLocked
? "will be able to see the active apps but will not be able to edit any app settings"
: "will be able to see the active apps and will be able to edit any app settings"}
</Trans>
}_description`}
/>
}
/>
)}
@@ -162,12 +159,15 @@ export const EventAppsTab = ({ eventType }: { eventType: EventType }) => {
{t("available_apps_lower_case")}
</h2>
<p className="text-default mb-6 text-sm font-normal">
<Trans i18nKey="available_apps_desc">
View popular apps below and explore more in our &nbsp;
<Link className="cursor-pointer underline" href="/apps">
App Store
</Link>
</Trans>
<ServerTrans
t={t}
i18nKey="available_apps_desc"
components={[
<Link key="available_apps_desc" className="cursor-pointer underline" href="/apps">
App Store
</Link>,
]}
/>
</p>
</>
) : null}
@@ -1,4 +1,4 @@
import { Trans } from "next-i18next";
import type { TFunction } from "i18next";
import Link from "next/link";
import { useEffect, useRef, useState } from "react";
import type { ComponentProps, Dispatch, SetStateAction } from "react";
@@ -12,7 +12,7 @@ import AddMembersWithSwitch, {
import AssignAllTeamMembers from "@calcom/features/eventtypes/components/AssignAllTeamMembers";
import type { ChildrenEventTypeSelectCustomClassNames } from "@calcom/features/eventtypes/components/ChildrenEventTypeSelect";
import ChildrenEventTypeSelect from "@calcom/features/eventtypes/components/ChildrenEventTypeSelect";
import { sortHosts, weightDescription } from "@calcom/features/eventtypes/components/HostEditDialogs";
import { sortHosts } from "@calcom/features/eventtypes/components/HostEditDialogs";
import type {
FormValues,
TeamMember,
@@ -28,8 +28,10 @@ import { Label } from "@calcom/ui/components/form";
import { Select } from "@calcom/ui/components/form";
import { SettingsToggle } from "@calcom/ui/components/form";
import { RadioAreaGroup as RadioArea } from "@calcom/ui/components/radio";
import ServerTrans from "@calcom/web/components/ServerTrans";
import { EditWeightsForAllTeamMembers } from "../../EditWeightsForAllTeamMembers";
import WeightDescription from "../../WeightDescription";
export type EventTeamAssignmentTabCustomClassNames = {
assignmentType?: {
@@ -114,16 +116,20 @@ const ChildrenEventTypesList = ({
);
};
const FixedHostHelper = (
<Trans i18nKey="fixed_host_helper">
Add anyone who needs to attend the event.
<Link
className="underline underline-offset-2"
target="_blank"
href="https://cal.com/docs/enterprise-features/teams/round-robin-scheduling#fixed-hosts">
Learn more
</Link>
</Trans>
const FixedHostHelper = ({ t }: { t: TFunction }) => (
<ServerTrans
t={t}
i18nKey="fixed_host_helper"
components={[
<Link
key="fixed_host_helper"
className="underline underline-offset-2"
target="_blank"
href="https://cal.com/docs/enterprise-features/teams/round-robin-scheduling#fixed-hosts">
Learn more
</Link>,
]}
/>
);
type FixedHostsCustomClassNames = SettingsToggleClassNames & {
@@ -172,7 +178,7 @@ const FixedHosts = ({
"text-subtle max-w-full break-words text-sm leading-tight",
customClassNames?.description
)}>
{FixedHostHelper}
<FixedHostHelper t={t} />
</p>
</div>
<div className="border-subtle rounded-b-md border border-t-0 px-6">
@@ -212,7 +218,7 @@ const FixedHosts = ({
data-testid="fixed-hosts-switch"
toggleSwitchAtTheEnd={true}
title={t("fixed_hosts")}
description={FixedHostHelper}
description={<FixedHostHelper t={t} />}
checked={isDisabled && !assignAllTeamMembers}
hideSwitch={assignAllTeamMembers}
labelClassName={classNames("text-sm", customClassNames?.label)}
@@ -334,7 +340,7 @@ const RoundRobinHosts = ({
render={({ field: { value: isRRWeightsEnabled, onChange } }) => (
<SettingsToggle
title={t("enable_weights")}
description={weightDescription}
description={<WeightDescription t={t} />}
checked={isRRWeightsEnabled}
switchContainerClassName={customClassNames?.enableWeights?.container}
labelClassName={customClassNames?.enableWeights?.label}
@@ -1,5 +1,4 @@
import type { Webhook } from "@prisma/client";
import { Trans } from "next-i18next";
import Link from "next/link";
import { useState } from "react";
import { useFormContext } from "react-hook-form";
@@ -13,11 +12,12 @@ import { subscriberUrlReserved } from "@calcom/features/webhooks/lib/subscriberU
import { APP_NAME } from "@calcom/lib/constants";
import { useLocale } from "@calcom/lib/hooks/useLocale";
import { trpc } from "@calcom/trpc/react";
import { showToast } from "@calcom/ui/components/toast";
import { Alert } from "@calcom/ui/components/alert";
import { Button } from "@calcom/ui/components/button";
import { Dialog, DialogContent } from "@calcom/ui/components/dialog";
import { EmptyScreen } from "@calcom/ui/components/empty-screen";
import { showToast } from "@calcom/ui/components/toast";
import ServerTrans from "@calcom/web/components/ServerTrans";
export const EventWebhooksTab = ({ eventType }: Pick<EventTypeSetupProps, "eventType">) => {
const { t } = useLocale();
@@ -122,25 +122,21 @@ export const EventWebhooksTab = ({ eventType }: Pick<EventTypeSetupProps, "event
severity={webhooksDisableProps.isLocked ? "neutral" : "info"}
className="mb-2"
title={
<Trans
i18nKey={`${lockedText}_${isManagedEventType ? "for_members" : "by_team_admins"}`}>
{lockedText[0].toUpperCase()}
{lockedText.slice(1)} {isManagedEventType ? "for members" : "by team admins"}
</Trans>
<ServerTrans
t={t}
i18nKey={`${lockedText}_${isManagedEventType ? "for_members" : "by_team_admins"}`}
/>
}
actions={
<div className="flex h-full items-center">{webhooksDisableProps.LockedIcon}</div>
}
message={
<Trans
<ServerTrans
t={t}
i18nKey={`webhooks_${lockedText}_${
isManagedEventType ? "for_members" : "by_team_admins"
}_description`}>
{isManagedEventType ? "Members" : "You"}{" "}
{webhooksDisableProps.isLocked
? "will be able to see the active webhooks but will not be able to edit any webhook settings"
: "will be able to see the active webhooks and will be able to edit any webhook settings"}
</Trans>
}_description`}
/>
}
/>
)}
@@ -181,14 +177,18 @@ export const EventWebhooksTab = ({ eventType }: Pick<EventTypeSetupProps, "event
</div>
<p className="text-default text-sm font-normal">
<Trans i18nKey="edit_or_manage_webhooks">
If you wish to edit or manage your web hooks, please head over to &nbsp;
<Link
className="cursor-pointer font-semibold underline"
href="/settings/developer/webhooks">
webhooks settings
</Link>
</Trans>
<ServerTrans
t={t}
i18nKey="edit_or_manage_webhooks"
components={[
<Link
key="edit_or_manage_webhooks"
className="cursor-pointer font-semibold underline"
href="/settings/developer/webhooks">
webhooks settings
</Link>,
]}
/>
</p>
</div>
</>
@@ -2,7 +2,6 @@ import Link from "next/link";
import { useRouter } from "next/navigation";
import { useEffect, useState } from "react";
import { useFormContext } from "react-hook-form";
import { Trans } from "react-i18next";
import LicenseRequired from "@calcom/features/ee/common/components/LicenseRequired";
import useLockedFieldsManager from "@calcom/features/ee/managed-event-types/hooks/useLockedFieldsManager";
@@ -15,14 +14,15 @@ import { HttpError } from "@calcom/lib/http-error";
import { WorkflowActions } from "@calcom/prisma/enums";
import type { RouterOutputs } from "@calcom/trpc/react";
import { trpc } from "@calcom/trpc/react";
import { Icon } from "@calcom/ui/components/icon";
import { Tooltip } from "@calcom/ui/components/tooltip";
import classNames from "@calcom/ui/classNames";
import { Alert } from "@calcom/ui/components/alert";
import { Button } from "@calcom/ui/components/button";
import classNames from "@calcom/ui/classNames";
import { EmptyScreen } from "@calcom/ui/components/empty-screen";
import { Switch } from "@calcom/ui/components/form";
import { Icon } from "@calcom/ui/components/icon";
import { showToast } from "@calcom/ui/components/toast";
import { Tooltip } from "@calcom/ui/components/tooltip";
import ServerTrans from "@calcom/web/components/ServerTrans";
type PartialWorkflowType = Pick<WorkflowType, "name" | "activeOn" | "isOrg" | "steps" | "id" | "readOnly">;
@@ -252,22 +252,19 @@ function EventWorkflowsTab(props: Props) {
severity={workflowsDisableProps.isLocked ? "neutral" : "info"}
className="mb-2"
title={
<Trans i18nKey={`${lockedText}_${isManagedEventType ? "for_members" : "by_team_admins"}`}>
{lockedText[0].toUpperCase()}
{lockedText.slice(1)} {isManagedEventType ? "for members" : "by team admins"}
</Trans>
<ServerTrans
t={t}
i18nKey={`${lockedText}_${isManagedEventType ? "for_members" : "by_team_admins"}`}
/>
}
actions={<div className="flex h-full items-center">{workflowsDisableProps.LockedIcon}</div>}
message={
<Trans
<ServerTrans
t={t}
i18nKey={`workflows_${lockedText}_${
isManagedEventType ? "for_members" : "by_team_admins"
}_description`}>
{isManagedEventType ? "Members" : "You"}{" "}
{workflowsDisableProps.isLocked
? "will be able to see the active workflows but will not be able to edit any workflow settings"
: "will be able to see the active workflow and will be able to edit any workflow settings"}
</Trans>
}_description`}
/>
}
/>
)}