+ );
}
diff --git a/pages/auth/signup.tsx b/pages/auth/signup.tsx
index dfb4d7a9..c446fc85 100644
--- a/pages/auth/signup.tsx
+++ b/pages/auth/signup.tsx
@@ -1,27 +1,25 @@
-import Head from 'next/head';
-import {useRouter} from "next/router";
-import {signIn} from 'next-auth/client'
+import Head from "next/head";
+import { useRouter } from "next/router";
+import { signIn } from "next-auth/client";
import ErrorAlert from "../../components/ui/alerts/Error";
-import {useState} from "react";
-import {UsernameInput} from "../../components/ui/UsernameInput";
+import { useState } from "react";
+import { UsernameInput } from "../../components/ui/UsernameInput";
import prisma from "../../lib/prisma";
export default function Signup(props) {
-
const router = useRouter();
- const [ hasErrors, setHasErrors ] = useState(false);
- const [ errorMessage, setErrorMessage ] = useState('');
+ const [hasErrors, setHasErrors] = useState(false);
+ const [errorMessage, setErrorMessage] = useState("");
const handleErrors = async (resp) => {
if (!resp.ok) {
const err = await resp.json();
throw new Error(err.message);
}
- }
+ };
const signUp = (e) => {
-
e.preventDefault();
if (e.target.password.value !== e.target.passwordcheck.value) {
@@ -31,39 +29,37 @@ export default function Signup(props) {
const email: string = e.target.email.value;
const password: string = e.target.password.value;
- fetch('/api/auth/signup',
- {
- body: JSON.stringify({
- username: e.target.username.value,
- password,
- email,
- }),
- headers: {
- 'Content-Type': 'application/json',
- },
- method: 'POST'
- }
- )
+ fetch("/api/auth/signup", {
+ body: JSON.stringify({
+ username: e.target.username.value,
+ password,
+ email,
+ }),
+ headers: {
+ "Content-Type": "application/json",
+ },
+ method: "POST",
+ })
.then(handleErrors)
- .then(
- () => signIn('Calendso', { callbackUrl: (router.query.callbackUrl || '') as string })
- )
- .catch( (err) => {
+ .then(() => signIn("Calendso", { callbackUrl: (router.query.callbackUrl || "") as string }))
+ .catch((err) => {
setHasErrors(true);
setErrorMessage(err.message);
});
};
return (
-
+
Sign up
-
- Create your account
-
+ Create your account
@@ -103,39 +136,41 @@ export async function getServerSideProps(ctx) {
if (!ctx.query.token) {
return {
notFound: true,
- }
+ };
}
const verificationRequest = await prisma.verificationRequest.findUnique({
where: {
token: ctx.query.token,
- }
+ },
});
// for now, disable if no verificationRequestToken given or token expired
- if ( ! verificationRequest || verificationRequest.expires < new Date() ) {
+ if (!verificationRequest || verificationRequest.expires < new Date()) {
return {
notFound: true,
- }
+ };
}
const existingUser = await prisma.user.findFirst({
where: {
AND: [
{
- email: verificationRequest.identifier
+ email: verificationRequest.identifier,
},
{
emailVerified: {
not: null,
},
- }
- ]
- }
+ },
+ ],
+ },
});
if (existingUser) {
- return { redirect: { permanent: false, destination: '/auth/login?callbackUrl=' + ctx.query.callbackUrl } };
+ return {
+ redirect: { permanent: false, destination: "/auth/login?callbackUrl=" + ctx.query.callbackUrl },
+ };
}
return { props: { email: verificationRequest.identifier } };
-}
\ No newline at end of file
+}
diff --git a/pages/availability/index.tsx b/pages/availability/index.tsx
index c6a25f55..701dd74f 100644
--- a/pages/availability/index.tsx
+++ b/pages/availability/index.tsx
@@ -7,7 +7,7 @@ import { useRouter } from "next/router";
import { useRef, useState } from "react";
import { getSession, useSession } from "next-auth/client";
import { ClockIcon } from "@heroicons/react/outline";
-import Loader from '@components/Loader';
+import Loader from "@components/Loader";
export default function Availability(props) {
// eslint-disable-next-line @typescript-eslint/no-unused-vars
@@ -53,7 +53,7 @@ export default function Availability(props) {
m = m < 10 ? "0" + m : m;
return `${h}:${m}`;
}
-
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
async function createEventTypeHandler(event) {
event.preventDefault();
@@ -64,7 +64,7 @@ export default function Availability(props) {
const enteredIsHidden = isHiddenRef.current.checked;
// TODO: Add validation
-
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
const response = await fetch("/api/availability/eventtype", {
method: "POST",
body: JSON.stringify({
@@ -100,7 +100,7 @@ export default function Availability(props) {
const bufferMins = enteredBufferHours * 60 + enteredBufferMins;
// TODO: Add validation
-
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
const response = await fetch("/api/availability/day", {
method: "PATCH",
body: JSON.stringify({ start: startMins, end: endMins, buffer: bufferMins }),
diff --git a/pages/availability/troubleshoot.tsx b/pages/availability/troubleshoot.tsx
index cf33092b..b8100908 100644
--- a/pages/availability/troubleshoot.tsx
+++ b/pages/availability/troubleshoot.tsx
@@ -6,13 +6,15 @@ import dayjs from "dayjs";
import utc from "dayjs/plugin/utc";
import { GetServerSideProps } from "next";
import prisma from "@lib/prisma";
-import Loader from '@components/Loader';
+import Loader from "@components/Loader";
+
dayjs.extend(utc);
export default function Troubleshoot({ user }) {
// eslint-disable-next-line @typescript-eslint/no-unused-vars
const [session, loading] = useSession();
const [availability, setAvailability] = useState([]);
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
const [selectedDate, setSelectedDate] = useState(dayjs());
if (loading) {
diff --git a/pages/cancel/[uid].tsx b/pages/cancel/[uid].tsx
index bf1ebb32..06af00d1 100644
--- a/pages/cancel/[uid].tsx
+++ b/pages/cancel/[uid].tsx
@@ -1,14 +1,14 @@
-import {useState} from 'react';
-import Head from 'next/head';
-import prisma from '../../lib/prisma';
-import {useRouter} from 'next/router';
-import dayjs from 'dayjs';
-import {CalendarIcon, ClockIcon, XIcon} from '@heroicons/react/solid';
-import isSameOrBefore from 'dayjs/plugin/isSameOrBefore';
-import isBetween from 'dayjs/plugin/isBetween';
-import utc from 'dayjs/plugin/utc';
-import timezone from 'dayjs/plugin/timezone';
-import {collectPageParameters, telemetryEventTypes, useTelemetry} from "../../lib/telemetry";
+import { useState } from "react";
+import Head from "next/head";
+import prisma from "../../lib/prisma";
+import { useRouter } from "next/router";
+import dayjs from "dayjs";
+import { CalendarIcon, ClockIcon, XIcon } from "@heroicons/react/solid";
+import isSameOrBefore from "dayjs/plugin/isSameOrBefore";
+import isBetween from "dayjs/plugin/isBetween";
+import utc from "dayjs/plugin/utc";
+import timezone from "dayjs/plugin/timezone";
+import { collectPageParameters, telemetryEventTypes, useTelemetry } from "../../lib/telemetry";
dayjs.extend(isSameOrBefore);
dayjs.extend(isBetween);
@@ -16,153 +16,164 @@ dayjs.extend(utc);
dayjs.extend(timezone);
export default function Type(props) {
- // Get router variables
- const router = useRouter();
- const { uid } = router.query;
+ // Get router variables
+ const router = useRouter();
+ const { uid } = router.query;
- const [is24h, setIs24h] = useState(false);
- const [loading, setLoading] = useState(false);
- const [error, setError] = useState(null);
- const telemetry = useTelemetry();
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
+ const [is24h, setIs24h] = useState(false);
+ const [loading, setLoading] = useState(false);
+ const [error, setError] = useState(null);
+ const telemetry = useTelemetry();
- const cancellationHandler = async (event) => {
- setLoading(true);
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
+ const cancellationHandler = async (event) => {
+ setLoading(true);
- let payload = {
- uid: uid
- };
+ const payload = {
+ uid: uid,
+ };
- telemetry.withJitsu(jitsu => jitsu.track(telemetryEventTypes.bookingCancelled, collectPageParameters()));
- const res = await fetch(
- '/api/cancel',
- {
- body: JSON.stringify(payload),
- headers: {
- 'Content-Type': 'application/json'
- },
- method: 'POST'
- }
- );
-
- if(res.status >= 200 && res.status < 300) {
- router.push('/cancel/success?user=' + props.user.username + '&title=' + props.eventType.title);
- } else {
- setLoading(false);
- setError("An error with status code " + res.status + " occurred. Please try again later.");
- }
- }
-
- return (
-
-
-
- Cancel {props.booking.title} | {props.user.name || props.user.username} |
- Calendso
-
-
-
-
-
-
-
-
-
- {error &&
-
-
-
-
-
- {error}
-
-
-
}
- {!error &&
-
-
-
-
-
- Really cancel your booking?
-
-
-
- Instead, you could also reschedule it.
-
-
-
-
{props.booking.title}
-
-
- {props.eventType.length} minutes
-
-
-
- {dayjs.utc(props.booking.startTime).format((is24h ? 'H:mm' : 'h:mma') + ", dddd DD MMMM YYYY")}
-
-
-
-
}
-
-
-
- Cancel
-
- router.push('/reschedule/' + uid)} disabled={loading} type="button"
- className="inline-flex items-center justify-center px-4 py-2 border border-transparent font-medium rounded-md text-gray-700 bg-gray-100 hover:bg-gray-200 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-gray-500 sm:text-sm mx-2 btn-white">
- Reschedule
-
-
-
-
-
-
-
-
-
+ telemetry.withJitsu((jitsu) =>
+ jitsu.track(telemetryEventTypes.bookingCancelled, collectPageParameters())
);
+ const res = await fetch("/api/cancel", {
+ body: JSON.stringify(payload),
+ headers: {
+ "Content-Type": "application/json",
+ },
+ method: "POST",
+ });
+
+ if (res.status >= 200 && res.status < 300) {
+ router.push("/cancel/success?user=" + props.user.username + "&title=" + props.eventType.title);
+ } else {
+ setLoading(false);
+ setError("An error with status code " + res.status + " occurred. Please try again later.");
+ }
+ };
+
+ return (
+
+
+
+ Cancel {props.booking.title} | {props.user.name || props.user.username} | Calendso
+
+
+
+
+
+
+
+
+
+
+
+ {error && (
+
+
+
+
+
+
+ {error}
+
+
+
+ )}
+ {!error && (
+
+
+
+
+
+
+ Really cancel your booking?
+
+
+
Instead, you could also reschedule it.
+
+
+
{props.booking.title}
+
+
+ {props.eventType.length} minutes
+
+
+
+ {dayjs
+ .utc(props.booking.startTime)
+ .format((is24h ? "H:mm" : "h:mma") + ", dddd DD MMMM YYYY")}
+
+
+
+
+ )}
+
+
+
+ Cancel
+
+ router.push("/reschedule/" + uid)}
+ disabled={loading}
+ type="button"
+ className="inline-flex items-center justify-center px-4 py-2 border border-transparent font-medium rounded-md text-gray-700 bg-gray-100 hover:bg-gray-200 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-gray-500 sm:text-sm mx-2 btn-white">
+ Reschedule
+
+
+
+
+
+
+
+
+
+ );
}
export async function getServerSideProps(context) {
- const booking = await prisma.booking.findFirst({
- where: {
- uid: context.query.uid,
- },
+ const booking = await prisma.booking.findFirst({
+ where: {
+ uid: context.query.uid,
+ },
+ select: {
+ id: true,
+ title: true,
+ description: true,
+ startTime: true,
+ endTime: true,
+ attendees: true,
+ eventType: true,
+ user: {
select: {
- id: true,
- title: true,
- description: true,
- startTime: true,
- endTime: true,
- attendees: true,
- eventType: true,
- user: {
- select: {
- id: true,
- username: true,
- name: true,
- }
- }
- }
- });
-
- // Workaround since Next.js has problems serializing date objects (see https://github.com/vercel/next.js/issues/11993)
- const bookingObj = Object.assign({}, booking, {
- startTime: booking.startTime.toString(),
- endTime: booking.endTime.toString()
- });
-
- return {
- props: {
- user: booking.user,
- eventType: booking.eventType,
- booking: bookingObj
+ id: true,
+ username: true,
+ name: true,
},
- }
+ },
+ },
+ });
+
+ // Workaround since Next.js has problems serializing date objects (see https://github.com/vercel/next.js/issues/11993)
+ const bookingObj = Object.assign({}, booking, {
+ startTime: booking.startTime.toString(),
+ endTime: booking.endTime.toString(),
+ });
+
+ return {
+ props: {
+ user: booking.user,
+ eventType: booking.eventType,
+ booking: bookingObj,
+ },
+ };
}
diff --git a/pages/cancel/success.tsx b/pages/cancel/success.tsx
index d6b597f1..cbb4f1f4 100644
--- a/pages/cancel/success.tsx
+++ b/pages/cancel/success.tsx
@@ -1,12 +1,12 @@
-import Head from 'next/head';
-import prisma from '../../lib/prisma';
-import {useRouter} from 'next/router';
-import dayjs from 'dayjs';
-import isSameOrBefore from 'dayjs/plugin/isSameOrBefore';
-import isBetween from 'dayjs/plugin/isBetween';
-import utc from 'dayjs/plugin/utc';
-import timezone from 'dayjs/plugin/timezone';
-import {CheckIcon} from "@heroicons/react/outline";
+import Head from "next/head";
+import prisma from "../../lib/prisma";
+import { useRouter } from "next/router";
+import dayjs from "dayjs";
+import isSameOrBefore from "dayjs/plugin/isSameOrBefore";
+import isBetween from "dayjs/plugin/isBetween";
+import utc from "dayjs/plugin/utc";
+import timezone from "dayjs/plugin/timezone";
+import { CheckIcon } from "@heroicons/react/outline";
dayjs.extend(isSameOrBefore);
dayjs.extend(isBetween);
@@ -14,78 +14,79 @@ dayjs.extend(utc);
dayjs.extend(timezone);
export default function Type(props) {
- // Get router variables
- const router = useRouter();
+ // Get router variables
+ const router = useRouter();
- return (
-
-
-
- Cancelled {props.title} | {props.user.name || props.user.username} |
- Calendso
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Cancellation successful
-
-
-
- Feel free to pick another event anytime.
-
-
-
-
-
-
- router.push('/' + props.user.username)} type="button"
- className="inline-flex items-center justify-center px-4 py-2 border border-transparent font-medium rounded-md text-gray-700 bg-gray-100 hover:bg-gray-200 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-gray-500 sm:text-sm mx-2 btn-white">
- Pick another
-
-
-
-
-
+ return (
+
+
+
+ Cancelled {props.title} | {props.user.name || props.user.username} | Calendso
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Cancellation successful
+
+
+
Feel free to pick another event anytime.
+
-
+
+
+ router.push("/" + props.user.username)}
+ type="button"
+ className="inline-flex items-center justify-center px-4 py-2 border border-transparent font-medium rounded-md text-gray-700 bg-gray-100 hover:bg-gray-200 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-gray-500 sm:text-sm mx-2 btn-white">
+ Pick another
+
+
+
+
+
+
- );
+
+
+ );
}
export async function getServerSideProps(context) {
- const user = await prisma.user.findFirst({
- where: {
- username: context.query.user,
- },
- select: {
- username: true,
- name: true,
- bio: true,
- avatar: true,
- eventTypes: true
- }
- });
+ const user = await prisma.user.findFirst({
+ where: {
+ username: context.query.user,
+ },
+ select: {
+ username: true,
+ name: true,
+ bio: true,
+ avatar: true,
+ eventTypes: true,
+ },
+ });
- return {
- props: {
- user,
- title: context.query.title
- },
- }
+ return {
+ props: {
+ user,
+ title: context.query.title,
+ },
+ };
}
diff --git a/pages/event-types/[type].tsx b/pages/event-types/[type].tsx
index 7acf719e..6042020f 100644
--- a/pages/event-types/[type].tsx
+++ b/pages/event-types/[type].tsx
@@ -9,19 +9,19 @@ import { LocationType } from "@lib/location";
import Shell from "@components/Shell";
import { getSession } from "next-auth/client";
import { Scheduler } from "@components/ui/Scheduler";
-import { Disclosure } from "@headlessui/react";
+import { Disclosure, RadioGroup } from "@headlessui/react";
import { PhoneIcon, XIcon } from "@heroicons/react/outline";
import { EventTypeCustomInput, EventTypeCustomInputType } from "@lib/eventTypeInput";
import {
- LocationMarkerIcon,
- LinkIcon,
- PlusIcon,
- DocumentIcon,
ChevronRightIcon,
ClockIcon,
- TrashIcon,
+ DocumentIcon,
ExternalLinkIcon,
+ LinkIcon,
+ LocationMarkerIcon,
+ PlusIcon,
+ TrashIcon,
} from "@heroicons/react/solid";
import dayjs from "dayjs";
@@ -29,7 +29,6 @@ import utc from "dayjs/plugin/utc";
import timezone from "dayjs/plugin/timezone";
import { Availability, EventType, User } from "@prisma/client";
import { validJson } from "@lib/jsonUtils";
-import { RadioGroup } from "@headlessui/react";
import classnames from "classnames";
import throttle from "lodash.throttle";
import "react-dates/initialize";
diff --git a/pages/index.tsx b/pages/index.tsx
index 9901e8a0..f99ba8b4 100644
--- a/pages/index.tsx
+++ b/pages/index.tsx
@@ -7,9 +7,7 @@ function RedirectPage() {
router.push("/event-types");
return;
}
- return (
-
- );
+ return
;
}
RedirectPage.getInitialProps = (ctx) => {
diff --git a/pages/integrations/[integration].tsx b/pages/integrations/[integration].tsx
index 9c24e777..56541be7 100644
--- a/pages/integrations/[integration].tsx
+++ b/pages/integrations/[integration].tsx
@@ -4,7 +4,7 @@ import { getIntegrationName, getIntegrationType } from "../../lib/integrations";
import Shell from "../../components/Shell";
import { useState } from "react";
import { useRouter } from "next/router";
-import { useSession, getSession } from "next-auth/client";
+import { getSession, useSession } from "next-auth/client";
import Loader from "@components/Loader";
export default function Integration(props) {
diff --git a/pages/integrations/index.tsx b/pages/integrations/index.tsx
index eeda59d2..2b318e02 100644
--- a/pages/integrations/index.tsx
+++ b/pages/integrations/index.tsx
@@ -9,7 +9,7 @@ import { InformationCircleIcon } from "@heroicons/react/outline";
import { Switch } from "@headlessui/react";
import Loader from "@components/Loader";
import classNames from "@lib/classNames";
-import { Dialog, DialogClose, DialogContent, DialogTrigger, DialogHeader } from "@components/Dialog";
+import { Dialog, DialogClose, DialogContent, DialogHeader, DialogTrigger } from "@components/Dialog";
export default function IntegrationHome({ integrations }) {
// eslint-disable-next-line @typescript-eslint/no-unused-vars
diff --git a/pages/settings/embed.tsx b/pages/settings/embed.tsx
index 643350e6..259a7a66 100644
--- a/pages/settings/embed.tsx
+++ b/pages/settings/embed.tsx
@@ -2,8 +2,8 @@ import Head from "next/head";
import prisma from "../../lib/prisma";
import Shell from "../../components/Shell";
import SettingsShell from "../../components/Settings";
-import { useSession, getSession } from "next-auth/client";
-import Loader from '@components/Loader';
+import { getSession, useSession } from "next-auth/client";
+import Loader from "@components/Loader";
export default function Embed(props) {
// eslint-disable-next-line @typescript-eslint/no-unused-vars
diff --git a/pages/settings/password.tsx b/pages/settings/password.tsx
index b7cb51cb..cd4fd241 100644
--- a/pages/settings/password.tsx
+++ b/pages/settings/password.tsx
@@ -4,7 +4,7 @@ import prisma from "../../lib/prisma";
import Modal from "../../components/Modal";
import Shell from "../../components/Shell";
import SettingsShell from "../../components/Settings";
-import { useSession, getSession } from "next-auth/client";
+import { getSession, useSession } from "next-auth/client";
import Loader from "@components/Loader";
export default function Settings() {
diff --git a/prisma/migrations/20210725123357_add_location_to_booking/migration.sql b/prisma/migrations/20210725123357_add_location_to_booking/migration.sql
new file mode 100644
index 00000000..f2874f5e
--- /dev/null
+++ b/prisma/migrations/20210725123357_add_location_to_booking/migration.sql
@@ -0,0 +1,2 @@
+-- AlterTable
+ALTER TABLE "Booking" ADD COLUMN "location" TEXT;
diff --git a/prisma/schema.prisma b/prisma/schema.prisma
index 409c68af..62e93561 100644
--- a/prisma/schema.prisma
+++ b/prisma/schema.prisma
@@ -133,6 +133,7 @@ model Booking {
endTime DateTime
attendees Attendee[]
+ location String?
createdAt DateTime @default(now())
updatedAt DateTime?
diff --git a/public/calendso-logo-white-word.svg b/public/calendso-logo-white-word.svg
index b6195547..0e7421f3 100644
--- a/public/calendso-logo-white-word.svg
+++ b/public/calendso-logo-white-word.svg
@@ -1,7 +1,7 @@
-
+
diff --git a/public/calendso-logo-word-dark.svg b/public/calendso-logo-word-dark.svg
index 676c2c1c..ec011227 100644
--- a/public/calendso-logo-word-dark.svg
+++ b/public/calendso-logo-word-dark.svg
@@ -1,7 +1,7 @@
-
+
diff --git a/public/calendso-logo-word.svg b/public/calendso-logo-word.svg
index e4592085..1a195915 100644
--- a/public/calendso-logo-word.svg
+++ b/public/calendso-logo-word.svg
@@ -1,7 +1,7 @@
-
+
diff --git a/public/integrations/go-to-meeting.svg b/public/integrations/go-to-meeting.svg
index 8b17d3bf..f18c92d4 100644
--- a/public/integrations/go-to-meeting.svg
+++ b/public/integrations/go-to-meeting.svg
@@ -1,7 +1,7 @@
-
+
diff --git a/public/integrations/microsoft-teams.svg b/public/integrations/microsoft-teams.svg
index 90b3444b..8df7db32 100644
--- a/public/integrations/microsoft-teams.svg
+++ b/public/integrations/microsoft-teams.svg
@@ -10,9 +10,9 @@
]>
-
+
diff --git a/public/integrations/zoom.svg b/public/integrations/zoom.svg
index 57c3b2cf..10f80a1d 100644
--- a/public/integrations/zoom.svg
+++ b/public/integrations/zoom.svg
@@ -1 +1 @@
-
\ No newline at end of file
+