Apps Status + Updates to non-traditional calendars (#5034)

* Apps Status + Updates to non-traditional calendars

* Recurring booking tweaks

* Last tweaks

* Fixing checks

* Fixing eslint

* Reverting unneeded changes, using plain text email

* More unneeded changes revert

* Update packages/features/bookings/lib/handleNewBooking.ts

Co-authored-by: Omar López <[email protected]>

* Fixing lint

* Refactored appsStatus in emails

* Update packages/emails/src/templates/OrganizerScheduledEmail.tsx

Co-authored-by: Omar López <[email protected]>
This commit is contained in:
Leo GiovanettiandOmar López authored and GitHub committed 2022-10-19 13:11:50 -03:00
1 parent f298865d9e
commit b6be94fd14
16 files changed
+220 -38

No files matched your search

@@ -0,0 +1,27 @@
import { TFunction } from "next-i18next";
import type { CalendarEvent } from "@calcom/types/Calendar";
import { Info } from "./Info";
export const AppsStatus = (props: { calEvent: CalendarEvent; t: TFunction }) => {
const { t } = props;
if (!props.calEvent.appsStatus) return null;
return (
<Info
label={t("apps_status")}
description={
<ul style={{ lineHeight: "24px" }}>
{props.calEvent.appsStatus.map((status) => (
<li key={status.type} style={{ fontWeight: 400 }}>
{status.appName}{" "}
{status.success >= 1 && `✅ ${status.success > 1 ? `(x${status.success})` : ""}`}{" "}
{status.failures >= 1 && `❌ ${status.failures > 1 ? `(x${status.failures})` : ""}`}
</li>
))}
</ul>
}
withSpacer
/>
);
};
+1
View File
@@ -9,3 +9,4 @@ export { ManageLink } from "./ManageLink";
export { default as RawHtml } from "./RawHtml";
export { WhenInfo } from "./WhenInfo";
export { WhoInfo } from "./WhoInfo";
export { AppsStatus } from "./AppsStatus";
@@ -1,7 +1,7 @@
import type { TFunction } from "next-i18next";
import dayjs from "@calcom/dayjs";
import type { CalendarEvent, Person } from "@calcom/types/Calendar";
import type { AppsStatus as AppsStatusType, CalendarEvent, Person } from "@calcom/types/Calendar";
import {
BaseEmailHtml,
@@ -11,6 +11,7 @@ import {
ManageLink,
WhenInfo,
WhoInfo,
AppsStatus,
} from "../components";
export const BaseScheduledEmail = (
@@ -18,6 +19,7 @@ export const BaseScheduledEmail = (
calEvent: CalendarEvent;
attendee: Person;
timeZone: string;
includeAppsStatus?: boolean;
t: TFunction;
} & Partial<React.ComponentProps<typeof BaseEmailHtml>>
) => {
@@ -70,6 +72,7 @@ export const BaseScheduledEmail = (
<LocationInfo calEvent={props.calEvent} t={t} />
<Info label={t("description")} description={props.calEvent.description} withSpacer />
<Info label={t("additional_notes")} description={props.calEvent.additionalNotes} withSpacer />
{props.includeAppsStatus && <AppsStatus calEvent={props.calEvent} t={t} />}
<CustomInputs calEvent={props.calEvent} />
</BaseEmailHtml>
);
@@ -33,6 +33,7 @@ export const OrganizerScheduledEmail = (
t={t}
subject={t(subject)}
title={t(title)}
includeAppsStatus
{...props}
/>
);