Merge branch 'main' into v2/teams-billing

This commit is contained in:
Peer Richelsen 2022-10-26 14:45:55 +01:00 committed by GitHub
commit 0372e3eb26
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 44 additions and 25 deletions

View File

@ -2,7 +2,6 @@ import DailyIframe from "@daily-co/daily-js";
import { NextPageContext } from "next";
import { getSession } from "next-auth/react";
import Head from "next/head";
import Link from "next/link";
import { useEffect } from "react";
import { SEO_IMG_OGIMG_VIDEO, WEBSITE_URL } from "@calcom/lib/constants";
@ -64,20 +63,15 @@ export default function JoinCall(props: JoinCallPageProps) {
<meta property="twitter:description" content={t("quick_video_meeting")} />
</Head>
<div style={{ zIndex: 2, position: "relative" }}>
<Link href="/" passHref>
{
// eslint-disable-next-line @next/next/no-img-element
<img
className="h-5·w-auto fixed z-10 hidden sm:inline-block"
src={`${WEBSITE_URL}/cal-logo-word-dark.svg`}
alt="Cal.com Logo"
style={{
top: 46,
left: 24,
}}
/>
}
</Link>
<img
className="h-5·w-auto fixed z-10 hidden sm:inline-block"
src={`${WEBSITE_URL}/cal-logo-word-dark.svg`}
alt="Cal.com Logo"
style={{
top: 46,
left: 24,
}}
/>
</div>
</>
);

View File

@ -187,23 +187,49 @@ export default abstract class BaseCalendarService implements Calendar {
additionalInfo: {},
};
}
let calendarEvent: CalendarEventType;
const eventsToUpdate = events.filter((e) => e.uid === uid);
return Promise.all(
eventsToUpdate.map((e) => {
eventsToUpdate.map((eventItem) => {
calendarEvent = eventItem;
return updateCalendarObject({
calendarObject: {
url: e.url,
data: iCalString,
etag: e?.etag,
url: calendarEvent.url,
// ensures compliance with standard iCal string (known as iCal2.0 by some) required by various providers
data: iCalString?.replace(/METHOD:[^\r\n]+\r\n/g, ""),
etag: calendarEvent?.etag,
},
headers: this.headers,
});
})
).then((p) => p.map((r) => r.json() as unknown as NewCalendarEventType));
).then((responses) =>
responses.map((response) => {
if (response.status >= 200 && response.status < 300) {
return {
uid,
type: this.credentials.type,
id: typeof calendarEvent.uid === "string" ? calendarEvent.uid : "-1",
password: "",
url: calendarEvent.url,
additionalInfo:
typeof event.additionalInformation === "string" ? event.additionalInformation : {},
};
} else {
this.log.error("Error: Status Code", response.status);
return {
uid,
type: event.type,
id: typeof event.uid === "string" ? event.uid : "-1",
password: "",
url: typeof event.location === "string" ? event.location : "-1",
additionalInfo:
typeof event.additionalInformation === "string" ? event.additionalInformation : {},
};
}
})
);
} catch (reason) {
this.log.error(reason);
throw reason;
}
}
@ -213,7 +239,6 @@ export default abstract class BaseCalendarService implements Calendar {
const events = await this.getEventsByUID(uid);
const eventsToDelete = events.filter((event) => event.uid === uid);
await Promise.all(
eventsToDelete.map((event) => {
return deleteCalendarObject({
@ -275,7 +300,7 @@ export default abstract class BaseCalendarService implements Calendar {
const events: { start: string; end: string }[] = [];
objects.forEach((object) => {
if (object.data == null) return;
if (object.data == null || JSON.stringify(object.data) == "{}") return;
const jcalData = ICAL.parse(sanitizeCalendarObject(object));
const vcalendar = new ICAL.Component(jcalData);
@ -330,7 +355,7 @@ export default abstract class BaseCalendarService implements Calendar {
} catch (error) {
if (error instanceof Error && error.message !== currentError) {
currentError = error.message;
console.log("error", error);
this.log.error("error", error);
}
}
if (!currentEvent) return;