Managed event-types (#6876)
* WIP * Locked fields manager * Leftovers * Bad merge fix * Type import fix * Moving away from classes * Progress refactoring locked logic * Covering apps, webhooks and workflows * Supporting webhooks and workflows (TBT) * Restoring yarn.lock * Progress * Refactoring code, adding default values * Fixing CRUD for children * Connect app link and case-sensitive lib renaming * Translation missing * Locked indicators, empty screens, locations * Member card and hidden status + missing i18n * Missing existent children shown * Showing preview for already created children * Email notification almost in place * Making progress over notif email * Fixing nodemailer by mixed FE/BE mixup * Delete dialog * Adding tests * New test * Reverting unneeded change * Removed console.log * Tweaking email * Reverting not applicable webhook changes * Reverting dev email api * Fixing last changes due to tests * Changing user-evType relationship * Availability and slug replacement tweaks * Fixing event type delete * Sometimes slug is not there... * Removing old webhooks references Changed slug hint * Fixing types * Fixing hiding event types actions * Changing delete dialog text * Removing unneeded code * Applying feedback * Update yarn.lock * Making sure locked fields values are static * Applying feedback * Feedback + relying on children list, not users * Removing console.log * PR Feedback * Telemetry for slug replacement action * More unit tests * Relying on schedule and editor tweaks * Fixing conteiner classname * PR Feedback * PR Feedback * Updating unit tests * Moving stuff to ee, added feature flag * type fix * Including e2e * Reverting unneeded changes in EmptyScreen * Fixing some UI issues after merging tokens * Fixing missing disabled locked fields * Theme fixes + e2e potential fix * Fixing e2e * Fixing login relying on network * Tweaking e2e * Removing unneeded code --------- Co-authored-by: Peer Richelsen <[email protected]> Co-authored-by: zomars <[email protected]>
This commit is contained in:
66 files changed
+2798
-655
No files matched your search
@@ -1,11 +1,11 @@
|
||||
import { CSSProperties } from "react";
|
||||
import type { CSSProperties } from "react";
|
||||
|
||||
import { BASE_URL, IS_PRODUCTION } from "@calcom/lib/constants";
|
||||
|
||||
import EmailCommonDivider from "./EmailCommonDivider";
|
||||
import Row from "./Row";
|
||||
|
||||
export type BodyHeadType = "checkCircle" | "xCircle" | "calendarCircle";
|
||||
export type BodyHeadType = "checkCircle" | "xCircle" | "calendarCircle" | "teamCircle";
|
||||
|
||||
export const getHeadImage = (headerType: BodyHeadType): string => {
|
||||
switch (headerType) {
|
||||
@@ -21,6 +21,10 @@ export const getHeadImage = (headerType: BodyHeadType): string => {
|
||||
return IS_PRODUCTION
|
||||
? BASE_URL + "/emails/[email protected]"
|
||||
: "https://app.cal.com/emails/[email protected]";
|
||||
case "teamCircle":
|
||||
return IS_PRODUCTION
|
||||
? BASE_URL + "/emails/[email protected]"
|
||||
: "https://app.cal.com/emails/[email protected]";
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -0,0 +1,80 @@
|
||||
import type { TFunction } from "next-i18next";
|
||||
import { Trans } from "next-i18next";
|
||||
|
||||
import { CAL_URL } from "@calcom/lib/constants";
|
||||
|
||||
import { BaseEmailHtml, CallToAction } from "../components";
|
||||
|
||||
export const SlugReplacementEmail = (
|
||||
props: {
|
||||
slug: string;
|
||||
name: string;
|
||||
teamName: string;
|
||||
t: TFunction;
|
||||
} & Partial<React.ComponentProps<typeof BaseEmailHtml>>
|
||||
) => {
|
||||
const { slug, name, teamName, t } = props;
|
||||
|
||||
return (
|
||||
<BaseEmailHtml
|
||||
subject={t("email_subject_slug_replacement", { slug: slug })}
|
||||
headerType="teamCircle"
|
||||
title={t("event_replaced_notice")}>
|
||||
<>
|
||||
<Trans i18nKey="hi_user_name" name={name}>
|
||||
<p style={{ fontWeight: 400, lineHeight: "24px", display: "inline-block" }}>Hi {name}</p>
|
||||
<p style={{ display: "inline" }}>,</p>
|
||||
</Trans>
|
||||
<Trans i18nKey="email_body_slug_replacement_notice" slug={slug}>
|
||||
<p style={{ fontWeight: 400, lineHeight: "24px" }}>
|
||||
An administrator on the <strong>{teamName}</strong> team has replaced your event type{" "}
|
||||
<strong>/{slug}</strong> with a managed event type that they control.
|
||||
</p>
|
||||
</Trans>
|
||||
<Trans i18nKey="email_body_slug_replacement_info">
|
||||
<p style={{ fontWeight: 400, lineHeight: "24px" }}>
|
||||
Your link will continue to work but somesettings for it may have changed. You can review it in
|
||||
event types.
|
||||
</p>
|
||||
</Trans>
|
||||
<table
|
||||
role="presentation"
|
||||
border={0}
|
||||
style={{ verticalAlign: "top", marginTop: "25px" }}
|
||||
width="100%">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td align="center">
|
||||
<CallToAction
|
||||
label={t("review_event_type")}
|
||||
href={`${CAL_URL}/event-types`}
|
||||
endIconName="white-arrow-right"
|
||||
/>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<p
|
||||
style={{
|
||||
borderTop: "solid 1px #E1E1E1",
|
||||
fontSize: 1,
|
||||
margin: "35px auto",
|
||||
width: "100%",
|
||||
}}
|
||||
/>
|
||||
<Trans i18nKey="email_body_slug_replacement_suggestion">
|
||||
<p style={{ fontWeight: 400, lineHeight: "24px" }}>
|
||||
If you have any questions about the event type, please reach out to your administrator.
|
||||
<br />
|
||||
<br />
|
||||
Happy scheduling, <br />
|
||||
The Cal.com team
|
||||
</p>
|
||||
</Trans>
|
||||
{/*<p style={{ fontWeight: 400, lineHeight: "24px" }}>
|
||||
<>{t("email_body_slug_replacement_suggestion")}</>
|
||||
</p>*/}
|
||||
</>
|
||||
</BaseEmailHtml>
|
||||
);
|
||||
};
|
||||
@@ -8,6 +8,7 @@ export { AttendeeWasRequestedToRescheduleEmail } from "./AttendeeWasRequestedToR
|
||||
export { AttendeeRescheduledEmail } from "./AttendeeRescheduledEmail";
|
||||
export { AttendeeScheduledEmail } from "./AttendeeScheduledEmail";
|
||||
export { DisabledAppEmail } from "./DisabledAppEmail";
|
||||
export { SlugReplacementEmail } from "./SlugReplacementEmail";
|
||||
export { FeedbackEmail } from "./FeedbackEmail";
|
||||
export { ForgotPasswordEmail } from "./ForgotPasswordEmail";
|
||||
export { OrganizerCancelledEmail } from "./OrganizerCancelledEmail";
|
||||
|
||||
Reference in new issue
Block a user