cal.pub0.org/apps/web/pages/video/meeting-not-started/[uid].tsx

121 lines
3.5 KiB
TypeScript
Raw Normal View History

Add Modals for Daily Video Calls and updates to Video Call colors (#1027) * :arrow_up: Bump tailwindcss from 2.2.14 to 2.2.15 Bumps [tailwindcss](https://github.com/tailwindlabs/tailwindcss) from 2.2.14 to 2.2.15. - [Release notes](https://github.com/tailwindlabs/tailwindcss/releases) - [Changelog](https://github.com/tailwindlabs/tailwindcss/blob/master/CHANGELOG.md) - [Commits](https://github.com/tailwindlabs/tailwindcss/compare/v2.2.14...v2.2.15) --- updated-dependencies: - dependency-name: tailwindcss dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> * updating cal will provide a zoom meeting url * updating cal will provide a zoom meeting url * modifying how daily emails send * modifying how daily emails send * daily table * migration updates * rebasing updates * updating Daily references to a new table * merge updates, adding Daily references to book/events.ts * updated video email templates to remove Daily specific references * updating the events.ts and refactoring in the event manager * removing the package-lock * updating some of the internal Daily notes * removing handle errors raw from the Daily video client * prettier formatting fixes * Added the Daily location to calendar events and updated Cal video references to Daily.co video * updating references to create in event manager to check for Daily video * adding a daily interface in the event manager * adding daily to the location labels * resolving yarn merge conflicts * removing prettier auto and refactoring integrations: daily in the event manager * removing changes to estlintrc.json * updating message when daily video call meeting has not started * updated modal time buffer * changed video calls to Cal colors * removing change to undoing change to lodash/merge on the event manager * removing change on the event-types to match the main repo * updating the border color in daily video calls Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Lola-Ojabowale <lola.ojabowale@gmail.com>
2021-10-26 13:10:55 +00:00
import { CalendarIcon, XIcon } from "@heroicons/react/outline";
import { ArrowRightIcon } from "@heroicons/react/solid";
import dayjs from "dayjs";
import { NextPageContext } from "next";
import { getSession } from "next-auth/react";
Add Modals for Daily Video Calls and updates to Video Call colors (#1027) * :arrow_up: Bump tailwindcss from 2.2.14 to 2.2.15 Bumps [tailwindcss](https://github.com/tailwindlabs/tailwindcss) from 2.2.14 to 2.2.15. - [Release notes](https://github.com/tailwindlabs/tailwindcss/releases) - [Changelog](https://github.com/tailwindlabs/tailwindcss/blob/master/CHANGELOG.md) - [Commits](https://github.com/tailwindlabs/tailwindcss/compare/v2.2.14...v2.2.15) --- updated-dependencies: - dependency-name: tailwindcss dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> * updating cal will provide a zoom meeting url * updating cal will provide a zoom meeting url * modifying how daily emails send * modifying how daily emails send * daily table * migration updates * rebasing updates * updating Daily references to a new table * merge updates, adding Daily references to book/events.ts * updated video email templates to remove Daily specific references * updating the events.ts and refactoring in the event manager * removing the package-lock * updating some of the internal Daily notes * removing handle errors raw from the Daily video client * prettier formatting fixes * Added the Daily location to calendar events and updated Cal video references to Daily.co video * updating references to create in event manager to check for Daily video * adding a daily interface in the event manager * adding daily to the location labels * resolving yarn merge conflicts * removing prettier auto and refactoring integrations: daily in the event manager * removing changes to estlintrc.json * updating message when daily video call meeting has not started * updated modal time buffer * changed video calls to Cal colors * removing change to undoing change to lodash/merge on the event manager * removing change on the event-types to match the main repo * updating the border color in daily video calls Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Lola-Ojabowale <lola.ojabowale@gmail.com>
2021-10-26 13:10:55 +00:00
import { useRouter } from "next/router";
import { useEffect } from "react";
import { useLocale } from "@calcom/lib/hooks/useLocale";
import Button from "@calcom/ui/Button";
import { Dialog, DialogContent, DialogFooter, DialogHeader } from "@calcom/ui/Dialog";
Add Modals for Daily Video Calls and updates to Video Call colors (#1027) * :arrow_up: Bump tailwindcss from 2.2.14 to 2.2.15 Bumps [tailwindcss](https://github.com/tailwindlabs/tailwindcss) from 2.2.14 to 2.2.15. - [Release notes](https://github.com/tailwindlabs/tailwindcss/releases) - [Changelog](https://github.com/tailwindlabs/tailwindcss/blob/master/CHANGELOG.md) - [Commits](https://github.com/tailwindlabs/tailwindcss/compare/v2.2.14...v2.2.15) --- updated-dependencies: - dependency-name: tailwindcss dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> * updating cal will provide a zoom meeting url * updating cal will provide a zoom meeting url * modifying how daily emails send * modifying how daily emails send * daily table * migration updates * rebasing updates * updating Daily references to a new table * merge updates, adding Daily references to book/events.ts * updated video email templates to remove Daily specific references * updating the events.ts and refactoring in the event manager * removing the package-lock * updating some of the internal Daily notes * removing handle errors raw from the Daily video client * prettier formatting fixes * Added the Daily location to calendar events and updated Cal video references to Daily.co video * updating references to create in event manager to check for Daily video * adding a daily interface in the event manager * adding daily to the location labels * resolving yarn merge conflicts * removing prettier auto and refactoring integrations: daily in the event manager * removing changes to estlintrc.json * updating message when daily video call meeting has not started * updated modal time buffer * changed video calls to Cal colors * removing change to undoing change to lodash/merge on the event manager * removing change on the event-types to match the main repo * updating the border color in daily video calls Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Lola-Ojabowale <lola.ojabowale@gmail.com>
2021-10-26 13:10:55 +00:00
import prisma from "@lib/prisma";
import { detectBrowserTimeFormat } from "@lib/timeFormat";
import { inferSSRProps } from "@lib/types/inferSSRProps";
Add Modals for Daily Video Calls and updates to Video Call colors (#1027) * :arrow_up: Bump tailwindcss from 2.2.14 to 2.2.15 Bumps [tailwindcss](https://github.com/tailwindlabs/tailwindcss) from 2.2.14 to 2.2.15. - [Release notes](https://github.com/tailwindlabs/tailwindcss/releases) - [Changelog](https://github.com/tailwindlabs/tailwindcss/blob/master/CHANGELOG.md) - [Commits](https://github.com/tailwindlabs/tailwindcss/compare/v2.2.14...v2.2.15) --- updated-dependencies: - dependency-name: tailwindcss dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> * updating cal will provide a zoom meeting url * updating cal will provide a zoom meeting url * modifying how daily emails send * modifying how daily emails send * daily table * migration updates * rebasing updates * updating Daily references to a new table * merge updates, adding Daily references to book/events.ts * updated video email templates to remove Daily specific references * updating the events.ts and refactoring in the event manager * removing the package-lock * updating some of the internal Daily notes * removing handle errors raw from the Daily video client * prettier formatting fixes * Added the Daily location to calendar events and updated Cal video references to Daily.co video * updating references to create in event manager to check for Daily video * adding a daily interface in the event manager * adding daily to the location labels * resolving yarn merge conflicts * removing prettier auto and refactoring integrations: daily in the event manager * removing changes to estlintrc.json * updating message when daily video call meeting has not started * updated modal time buffer * changed video calls to Cal colors * removing change to undoing change to lodash/merge on the event manager * removing change on the event-types to match the main repo * updating the border color in daily video calls Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Lola-Ojabowale <lola.ojabowale@gmail.com>
2021-10-26 13:10:55 +00:00
import { HeadSeo } from "@components/seo/head-seo";
export default function MeetingNotStarted(props: inferSSRProps<typeof getServerSideProps>) {
Add Modals for Daily Video Calls and updates to Video Call colors (#1027) * :arrow_up: Bump tailwindcss from 2.2.14 to 2.2.15 Bumps [tailwindcss](https://github.com/tailwindlabs/tailwindcss) from 2.2.14 to 2.2.15. - [Release notes](https://github.com/tailwindlabs/tailwindcss/releases) - [Changelog](https://github.com/tailwindlabs/tailwindcss/blob/master/CHANGELOG.md) - [Commits](https://github.com/tailwindlabs/tailwindcss/compare/v2.2.14...v2.2.15) --- updated-dependencies: - dependency-name: tailwindcss dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> * updating cal will provide a zoom meeting url * updating cal will provide a zoom meeting url * modifying how daily emails send * modifying how daily emails send * daily table * migration updates * rebasing updates * updating Daily references to a new table * merge updates, adding Daily references to book/events.ts * updated video email templates to remove Daily specific references * updating the events.ts and refactoring in the event manager * removing the package-lock * updating some of the internal Daily notes * removing handle errors raw from the Daily video client * prettier formatting fixes * Added the Daily location to calendar events and updated Cal video references to Daily.co video * updating references to create in event manager to check for Daily video * adding a daily interface in the event manager * adding daily to the location labels * resolving yarn merge conflicts * removing prettier auto and refactoring integrations: daily in the event manager * removing changes to estlintrc.json * updating message when daily video call meeting has not started * updated modal time buffer * changed video calls to Cal colors * removing change to undoing change to lodash/merge on the event manager * removing change on the event-types to match the main repo * updating the border color in daily video calls Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Lola-Ojabowale <lola.ojabowale@gmail.com>
2021-10-26 13:10:55 +00:00
const router = useRouter();
const { t } = useLocale();
Add Modals for Daily Video Calls and updates to Video Call colors (#1027) * :arrow_up: Bump tailwindcss from 2.2.14 to 2.2.15 Bumps [tailwindcss](https://github.com/tailwindlabs/tailwindcss) from 2.2.14 to 2.2.15. - [Release notes](https://github.com/tailwindlabs/tailwindcss/releases) - [Changelog](https://github.com/tailwindlabs/tailwindcss/blob/master/CHANGELOG.md) - [Commits](https://github.com/tailwindlabs/tailwindcss/compare/v2.2.14...v2.2.15) --- updated-dependencies: - dependency-name: tailwindcss dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> * updating cal will provide a zoom meeting url * updating cal will provide a zoom meeting url * modifying how daily emails send * modifying how daily emails send * daily table * migration updates * rebasing updates * updating Daily references to a new table * merge updates, adding Daily references to book/events.ts * updated video email templates to remove Daily specific references * updating the events.ts and refactoring in the event manager * removing the package-lock * updating some of the internal Daily notes * removing handle errors raw from the Daily video client * prettier formatting fixes * Added the Daily location to calendar events and updated Cal video references to Daily.co video * updating references to create in event manager to check for Daily video * adding a daily interface in the event manager * adding daily to the location labels * resolving yarn merge conflicts * removing prettier auto and refactoring integrations: daily in the event manager * removing changes to estlintrc.json * updating message when daily video call meeting has not started * updated modal time buffer * changed video calls to Cal colors * removing change to undoing change to lodash/merge on the event manager * removing change on the event-types to match the main repo * updating the border color in daily video calls Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Lola-Ojabowale <lola.ojabowale@gmail.com>
2021-10-26 13:10:55 +00:00
//if no booking redirectis to the 404 page
const emptyBooking = props.booking === null;
useEffect(() => {
if (emptyBooking) {
router.push("/video/no-meeting-found");
Add Modals for Daily Video Calls and updates to Video Call colors (#1027) * :arrow_up: Bump tailwindcss from 2.2.14 to 2.2.15 Bumps [tailwindcss](https://github.com/tailwindlabs/tailwindcss) from 2.2.14 to 2.2.15. - [Release notes](https://github.com/tailwindlabs/tailwindcss/releases) - [Changelog](https://github.com/tailwindlabs/tailwindcss/blob/master/CHANGELOG.md) - [Commits](https://github.com/tailwindlabs/tailwindcss/compare/v2.2.14...v2.2.15) --- updated-dependencies: - dependency-name: tailwindcss dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> * updating cal will provide a zoom meeting url * updating cal will provide a zoom meeting url * modifying how daily emails send * modifying how daily emails send * daily table * migration updates * rebasing updates * updating Daily references to a new table * merge updates, adding Daily references to book/events.ts * updated video email templates to remove Daily specific references * updating the events.ts and refactoring in the event manager * removing the package-lock * updating some of the internal Daily notes * removing handle errors raw from the Daily video client * prettier formatting fixes * Added the Daily location to calendar events and updated Cal video references to Daily.co video * updating references to create in event manager to check for Daily video * adding a daily interface in the event manager * adding daily to the location labels * resolving yarn merge conflicts * removing prettier auto and refactoring integrations: daily in the event manager * removing changes to estlintrc.json * updating message when daily video call meeting has not started * updated modal time buffer * changed video calls to Cal colors * removing change to undoing change to lodash/merge on the event manager * removing change on the event-types to match the main repo * updating the border color in daily video calls Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Lola-Ojabowale <lola.ojabowale@gmail.com>
2021-10-26 13:10:55 +00:00
}
});
if (!emptyBooking) {
return (
<div>
<HeadSeo title={`Meeting Unavaialble`} description={`Meeting Unavailable`} />
<main className="mx-auto my-24 max-w-3xl">
<Dialog defaultOpen={true}>
<DialogContent
onInteractOutside={(e) => {
e.preventDefault();
}}>
<div className="mx-auto mb-5 flex h-12 w-12 items-center justify-center rounded-full bg-red-100">
<XIcon className="h-6 w-6 text-red-600" />
</div>
<div className="mt-5 flex justify-center">
<DialogHeader title={props.booking.title} />
</div>
<p className="-mt-4 flex items-center justify-center text-sm text-gray-500">
<CalendarIcon className="mr-1 inline-block h-4 w-4" />
{dayjs(props.booking.startTime).format(detectBrowserTimeFormat + ", dddd DD MMMM YYYY")}
</p>
<p className="flex justify-center text-center text-sm text-gray-500">
This meeting will be accessible 60 minutes in advance.
</p>
<div className="flex justify-center">
<DialogFooter>
<Button data-testid="return-home" href="/event-types" EndIcon={ArrowRightIcon}>
{t("go_back_home")}
</Button>
</DialogFooter>
Add Modals for Daily Video Calls and updates to Video Call colors (#1027) * :arrow_up: Bump tailwindcss from 2.2.14 to 2.2.15 Bumps [tailwindcss](https://github.com/tailwindlabs/tailwindcss) from 2.2.14 to 2.2.15. - [Release notes](https://github.com/tailwindlabs/tailwindcss/releases) - [Changelog](https://github.com/tailwindlabs/tailwindcss/blob/master/CHANGELOG.md) - [Commits](https://github.com/tailwindlabs/tailwindcss/compare/v2.2.14...v2.2.15) --- updated-dependencies: - dependency-name: tailwindcss dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> * updating cal will provide a zoom meeting url * updating cal will provide a zoom meeting url * modifying how daily emails send * modifying how daily emails send * daily table * migration updates * rebasing updates * updating Daily references to a new table * merge updates, adding Daily references to book/events.ts * updated video email templates to remove Daily specific references * updating the events.ts and refactoring in the event manager * removing the package-lock * updating some of the internal Daily notes * removing handle errors raw from the Daily video client * prettier formatting fixes * Added the Daily location to calendar events and updated Cal video references to Daily.co video * updating references to create in event manager to check for Daily video * adding a daily interface in the event manager * adding daily to the location labels * resolving yarn merge conflicts * removing prettier auto and refactoring integrations: daily in the event manager * removing changes to estlintrc.json * updating message when daily video call meeting has not started * updated modal time buffer * changed video calls to Cal colors * removing change to undoing change to lodash/merge on the event manager * removing change on the event-types to match the main repo * updating the border color in daily video calls Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Lola-Ojabowale <lola.ojabowale@gmail.com>
2021-10-26 13:10:55 +00:00
</div>
</DialogContent>
</Dialog>
Add Modals for Daily Video Calls and updates to Video Call colors (#1027) * :arrow_up: Bump tailwindcss from 2.2.14 to 2.2.15 Bumps [tailwindcss](https://github.com/tailwindlabs/tailwindcss) from 2.2.14 to 2.2.15. - [Release notes](https://github.com/tailwindlabs/tailwindcss/releases) - [Changelog](https://github.com/tailwindlabs/tailwindcss/blob/master/CHANGELOG.md) - [Commits](https://github.com/tailwindlabs/tailwindcss/compare/v2.2.14...v2.2.15) --- updated-dependencies: - dependency-name: tailwindcss dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> * updating cal will provide a zoom meeting url * updating cal will provide a zoom meeting url * modifying how daily emails send * modifying how daily emails send * daily table * migration updates * rebasing updates * updating Daily references to a new table * merge updates, adding Daily references to book/events.ts * updated video email templates to remove Daily specific references * updating the events.ts and refactoring in the event manager * removing the package-lock * updating some of the internal Daily notes * removing handle errors raw from the Daily video client * prettier formatting fixes * Added the Daily location to calendar events and updated Cal video references to Daily.co video * updating references to create in event manager to check for Daily video * adding a daily interface in the event manager * adding daily to the location labels * resolving yarn merge conflicts * removing prettier auto and refactoring integrations: daily in the event manager * removing changes to estlintrc.json * updating message when daily video call meeting has not started * updated modal time buffer * changed video calls to Cal colors * removing change to undoing change to lodash/merge on the event manager * removing change on the event-types to match the main repo * updating the border color in daily video calls Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Lola-Ojabowale <lola.ojabowale@gmail.com>
2021-10-26 13:10:55 +00:00
</main>
</div>
);
}
return null;
}
export async function getServerSideProps(context: NextPageContext) {
Add Modals for Daily Video Calls and updates to Video Call colors (#1027) * :arrow_up: Bump tailwindcss from 2.2.14 to 2.2.15 Bumps [tailwindcss](https://github.com/tailwindlabs/tailwindcss) from 2.2.14 to 2.2.15. - [Release notes](https://github.com/tailwindlabs/tailwindcss/releases) - [Changelog](https://github.com/tailwindlabs/tailwindcss/blob/master/CHANGELOG.md) - [Commits](https://github.com/tailwindlabs/tailwindcss/compare/v2.2.14...v2.2.15) --- updated-dependencies: - dependency-name: tailwindcss dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> * updating cal will provide a zoom meeting url * updating cal will provide a zoom meeting url * modifying how daily emails send * modifying how daily emails send * daily table * migration updates * rebasing updates * updating Daily references to a new table * merge updates, adding Daily references to book/events.ts * updated video email templates to remove Daily specific references * updating the events.ts and refactoring in the event manager * removing the package-lock * updating some of the internal Daily notes * removing handle errors raw from the Daily video client * prettier formatting fixes * Added the Daily location to calendar events and updated Cal video references to Daily.co video * updating references to create in event manager to check for Daily video * adding a daily interface in the event manager * adding daily to the location labels * resolving yarn merge conflicts * removing prettier auto and refactoring integrations: daily in the event manager * removing changes to estlintrc.json * updating message when daily video call meeting has not started * updated modal time buffer * changed video calls to Cal colors * removing change to undoing change to lodash/merge on the event manager * removing change on the event-types to match the main repo * updating the border color in daily video calls Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Lola-Ojabowale <lola.ojabowale@gmail.com>
2021-10-26 13:10:55 +00:00
const booking = await prisma.booking.findUnique({
where: {
uid: context.query.uid as string,
Add Modals for Daily Video Calls and updates to Video Call colors (#1027) * :arrow_up: Bump tailwindcss from 2.2.14 to 2.2.15 Bumps [tailwindcss](https://github.com/tailwindlabs/tailwindcss) from 2.2.14 to 2.2.15. - [Release notes](https://github.com/tailwindlabs/tailwindcss/releases) - [Changelog](https://github.com/tailwindlabs/tailwindcss/blob/master/CHANGELOG.md) - [Commits](https://github.com/tailwindlabs/tailwindcss/compare/v2.2.14...v2.2.15) --- updated-dependencies: - dependency-name: tailwindcss dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> * updating cal will provide a zoom meeting url * updating cal will provide a zoom meeting url * modifying how daily emails send * modifying how daily emails send * daily table * migration updates * rebasing updates * updating Daily references to a new table * merge updates, adding Daily references to book/events.ts * updated video email templates to remove Daily specific references * updating the events.ts and refactoring in the event manager * removing the package-lock * updating some of the internal Daily notes * removing handle errors raw from the Daily video client * prettier formatting fixes * Added the Daily location to calendar events and updated Cal video references to Daily.co video * updating references to create in event manager to check for Daily video * adding a daily interface in the event manager * adding daily to the location labels * resolving yarn merge conflicts * removing prettier auto and refactoring integrations: daily in the event manager * removing changes to estlintrc.json * updating message when daily video call meeting has not started * updated modal time buffer * changed video calls to Cal colors * removing change to undoing change to lodash/merge on the event manager * removing change on the event-types to match the main repo * updating the border color in daily video calls Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Lola-Ojabowale <lola.ojabowale@gmail.com>
2021-10-26 13:10:55 +00:00
},
select: {
uid: true,
id: true,
title: true,
description: true,
startTime: true,
endTime: true,
user: {
select: {
credentials: true,
},
},
attendees: true,
dailyRef: {
select: {
dailyurl: true,
dailytoken: true,
},
},
references: {
select: {
uid: true,
type: true,
},
},
},
});
if (!booking) {
// TODO: Booking is already cancelled
return {
props: { booking: null },
};
}
const bookingObj = Object.assign({}, booking, {
startTime: booking.startTime.toString(),
endTime: booking.endTime.toString(),
});
const session = await getSession();
return {
props: {
booking: bookingObj,
session: session,
},
};
}