Suggestion: let prettier sort imports order (#673)
* Suggestion: let prettier sort imports order # Conflicts: # yarn.lock * AUTO SORT ALL THE IMPORTS * Linting * Fixes test
This commit is contained in:
parent
3add84a279
commit
d194878bb2
192 changed files with 921 additions and 577 deletions
|
@ -7,4 +7,6 @@ module.exports = {
|
|||
semi: true,
|
||||
printWidth: 110,
|
||||
arrowParens: "always",
|
||||
importOrder: ["^@ee/(.*)$", "^@lib/(.*)$", "^@components/(.*)$", "^[./]"],
|
||||
importOrderSeparation: true,
|
||||
};
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import { useRouter } from "next/router";
|
||||
import Link from "next/link";
|
||||
import { useRouter } from "next/router";
|
||||
import React, { Children } from "react";
|
||||
|
||||
const ActiveLink = ({ children, activeClassName, ...props }) => {
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import React from "react";
|
||||
import * as DialogPrimitive from "@radix-ui/react-dialog";
|
||||
import React from "react";
|
||||
|
||||
type DialogProps = React.ComponentProps<typeof DialogPrimitive["Root"]>;
|
||||
export function Dialog(props: DialogProps) {
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
import { GiftIcon } from "@heroicons/react/outline";
|
||||
|
||||
export default function DonateBanner() {
|
||||
if (location.hostname.endsWith(".cal.com")) {
|
||||
return null;
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
import { SVGComponent } from "@lib/types/SVGComponent";
|
||||
import React from "react";
|
||||
|
||||
import { SVGComponent } from "@lib/types/SVGComponent";
|
||||
|
||||
export default function EmptyScreen({
|
||||
Icon,
|
||||
headline,
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
import Cropper from "react-easy-crop";
|
||||
import { useCallback, useRef, useState } from "react";
|
||||
import Cropper from "react-easy-crop";
|
||||
|
||||
import Slider from "./Slider";
|
||||
|
||||
export default function ImageUploader({ target, id, buttonMsg, handleAvatarChange, imageRef }) {
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
/* legacy and soon deprecated, please refactor to use <Dialog> only */
|
||||
import { Fragment, ReactNode } from "react";
|
||||
import { Dialog, Transition } from "@headlessui/react";
|
||||
import { CheckIcon, InformationCircleIcon } from "@heroicons/react/outline";
|
||||
import { Fragment, ReactNode } from "react";
|
||||
|
||||
import classNames from "@lib/classNames";
|
||||
|
||||
export default function Modal(props: {
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
import Link from "next/link";
|
||||
import { CodeIcon, CreditCardIcon, KeyIcon, UserGroupIcon, UserIcon } from "@heroicons/react/solid";
|
||||
import Link from "next/link";
|
||||
import { useRouter } from "next/router";
|
||||
|
||||
import classNames from "@lib/classNames";
|
||||
|
||||
export default function SettingsShell(props) {
|
||||
|
|
|
@ -1,10 +1,5 @@
|
|||
import Link from "next/link";
|
||||
import React, { Fragment, useEffect, useState } from "react";
|
||||
import { useRouter } from "next/router";
|
||||
import { signOut, useSession } from "next-auth/client";
|
||||
// TODO: replace headlessui with radix-ui
|
||||
import { Menu, Transition } from "@headlessui/react";
|
||||
import { collectPageParameters, telemetryEventTypes, useTelemetry } from "@lib/telemetry";
|
||||
import { SelectorIcon } from "@heroicons/react/outline";
|
||||
import {
|
||||
CalendarIcon,
|
||||
|
@ -15,12 +10,20 @@ import {
|
|||
LogoutIcon,
|
||||
PuzzleIcon,
|
||||
} from "@heroicons/react/solid";
|
||||
import Logo from "./Logo";
|
||||
import classNames from "@lib/classNames";
|
||||
import { Toaster } from "react-hot-toast";
|
||||
import Avatar from "@components/ui/Avatar";
|
||||
import { User } from "@prisma/client";
|
||||
import { signOut, useSession } from "next-auth/client";
|
||||
import Link from "next/link";
|
||||
import { useRouter } from "next/router";
|
||||
import React, { Fragment, useEffect, useState } from "react";
|
||||
import { Toaster } from "react-hot-toast";
|
||||
|
||||
import classNames from "@lib/classNames";
|
||||
import { collectPageParameters, telemetryEventTypes, useTelemetry } from "@lib/telemetry";
|
||||
|
||||
import { HeadSeo } from "@components/seo/head-seo";
|
||||
import Avatar from "@components/ui/Avatar";
|
||||
|
||||
import Logo from "./Logo";
|
||||
|
||||
export default function Shell(props) {
|
||||
const router = useRouter();
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import React from "react";
|
||||
import * as SliderPrimitive from "@radix-ui/react-slider";
|
||||
import React from "react";
|
||||
|
||||
const Slider = ({ value, min, max, step, label, changeHandler }) => (
|
||||
<SliderPrimitive.Root
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import React from "react";
|
||||
import * as TooltipPrimitive from "@radix-ui/react-tooltip";
|
||||
import React from "react";
|
||||
|
||||
export function Tooltip({
|
||||
children,
|
||||
|
|
|
@ -1,10 +1,12 @@
|
|||
import { ExclamationIcon } from "@heroicons/react/solid";
|
||||
import { SchedulingType } from "@prisma/client";
|
||||
import Link from "next/link";
|
||||
import { useRouter } from "next/router";
|
||||
import { useSlots } from "@lib/hooks/useSlots";
|
||||
import { ExclamationIcon } from "@heroicons/react/solid";
|
||||
import React from "react";
|
||||
|
||||
import { useSlots } from "@lib/hooks/useSlots";
|
||||
|
||||
import Loader from "@components/Loader";
|
||||
import { SchedulingType } from "@prisma/client";
|
||||
|
||||
const AvailableTimes = ({
|
||||
date,
|
||||
|
|
|
@ -1,11 +1,12 @@
|
|||
import { ChevronLeftIcon, ChevronRightIcon } from "@heroicons/react/solid";
|
||||
import { useEffect, useState } from "react";
|
||||
import dayjs, { Dayjs } from "dayjs";
|
||||
import utc from "dayjs/plugin/utc";
|
||||
import timezone from "dayjs/plugin/timezone";
|
||||
import getSlots from "@lib/slots";
|
||||
import dayjsBusinessDays from "dayjs-business-days";
|
||||
import timezone from "dayjs/plugin/timezone";
|
||||
import utc from "dayjs/plugin/utc";
|
||||
import { useEffect, useState } from "react";
|
||||
|
||||
import classNames from "@lib/classNames";
|
||||
import getSlots from "@lib/slots";
|
||||
|
||||
dayjs.extend(dayjsBusinessDays);
|
||||
dayjs.extend(utc);
|
||||
|
|
|
@ -1,10 +1,12 @@
|
|||
// TODO: replace headlessui with radix-ui
|
||||
import { Switch } from "@headlessui/react";
|
||||
import TimezoneSelect from "react-timezone-select";
|
||||
import { useEffect, useState } from "react";
|
||||
import { is24h, timeZone } from "../../lib/clock";
|
||||
import TimezoneSelect from "react-timezone-select";
|
||||
|
||||
import classNames from "@lib/classNames";
|
||||
|
||||
import { is24h, timeZone } from "../../lib/clock";
|
||||
|
||||
const TimeOptions = (props) => {
|
||||
const [selectedTimeZone, setSelectedTimeZone] = useState("");
|
||||
const [is24hClock, setIs24hClock] = useState(false);
|
||||
|
|
|
@ -1,25 +1,27 @@
|
|||
// Get router variables
|
||||
import { useRouter } from "next/router";
|
||||
import { useEffect, useState, useMemo } from "react";
|
||||
import { ChevronDownIcon, ChevronUpIcon, ClockIcon, CreditCardIcon, GlobeIcon } from "@heroicons/react/solid";
|
||||
import { EventType } from "@prisma/client";
|
||||
import * as Collapsible from "@radix-ui/react-collapsible";
|
||||
import dayjs, { Dayjs } from "dayjs";
|
||||
import customParseFormat from "dayjs/plugin/customParseFormat";
|
||||
import utc from "dayjs/plugin/utc";
|
||||
import { collectPageParameters, telemetryEventTypes, useTelemetry } from "@lib/telemetry";
|
||||
import { ChevronDownIcon, ChevronUpIcon, ClockIcon, CreditCardIcon, GlobeIcon } from "@heroicons/react/solid";
|
||||
import DatePicker from "@components/booking/DatePicker";
|
||||
import { isBrandingHidden } from "@lib/isBrandingHidden";
|
||||
import PoweredByCalendso from "@components/ui/PoweredByCalendso";
|
||||
import { timeZone } from "@lib/clock";
|
||||
import AvailableTimes from "@components/booking/AvailableTimes";
|
||||
import TimeOptions from "@components/booking/TimeOptions";
|
||||
import * as Collapsible from "@radix-ui/react-collapsible";
|
||||
import { HeadSeo } from "@components/seo/head-seo";
|
||||
import { asStringOrNull } from "@lib/asStringOrNull";
|
||||
import useTheme from "@lib/hooks/useTheme";
|
||||
import AvatarGroup from "@components/ui/AvatarGroup";
|
||||
import { useRouter } from "next/router";
|
||||
import { useEffect, useState, useMemo } from "react";
|
||||
import { FormattedNumber, IntlProvider } from "react-intl";
|
||||
|
||||
import { asStringOrNull } from "@lib/asStringOrNull";
|
||||
import { timeZone } from "@lib/clock";
|
||||
import useTheme from "@lib/hooks/useTheme";
|
||||
import { isBrandingHidden } from "@lib/isBrandingHidden";
|
||||
import { collectPageParameters, telemetryEventTypes, useTelemetry } from "@lib/telemetry";
|
||||
|
||||
import AvailableTimes from "@components/booking/AvailableTimes";
|
||||
import DatePicker from "@components/booking/DatePicker";
|
||||
import TimeOptions from "@components/booking/TimeOptions";
|
||||
import { HeadSeo } from "@components/seo/head-seo";
|
||||
import AvatarGroup from "@components/ui/AvatarGroup";
|
||||
import PoweredByCalendso from "@components/ui/PoweredByCalendso";
|
||||
|
||||
dayjs.extend(utc);
|
||||
dayjs.extend(customParseFormat);
|
||||
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
import Head from "next/head";
|
||||
import { useRouter } from "next/router";
|
||||
import {
|
||||
CalendarIcon,
|
||||
ClockIcon,
|
||||
|
@ -8,26 +6,32 @@ import {
|
|||
LocationMarkerIcon,
|
||||
} from "@heroicons/react/solid";
|
||||
import { EventTypeCustomInputType } from "@prisma/client";
|
||||
import { collectPageParameters, telemetryEventTypes, useTelemetry } from "@lib/telemetry";
|
||||
import { useCallback, useEffect, useState } from "react";
|
||||
import dayjs from "dayjs";
|
||||
import "react-phone-number-input/style.css";
|
||||
import PhoneInput from "react-phone-number-input";
|
||||
import { LocationType } from "@lib/location";
|
||||
import { Button } from "@components/ui/Button";
|
||||
import Head from "next/head";
|
||||
import { useRouter } from "next/router";
|
||||
import { stringify } from "querystring";
|
||||
import { useCallback, useEffect, useState } from "react";
|
||||
import { FormattedNumber, IntlProvider } from "react-intl";
|
||||
import { ReactMultiEmail } from "react-multi-email";
|
||||
import PhoneInput from "react-phone-number-input";
|
||||
import "react-phone-number-input/style.css";
|
||||
|
||||
import { createPaymentLink } from "@ee/lib/stripe/client";
|
||||
|
||||
import { asStringOrNull } from "@lib/asStringOrNull";
|
||||
import { timeZone } from "@lib/clock";
|
||||
import useTheme from "@lib/hooks/useTheme";
|
||||
import AvatarGroup from "@components/ui/AvatarGroup";
|
||||
import { LocationType } from "@lib/location";
|
||||
import createBooking from "@lib/mutations/bookings/create-booking";
|
||||
import { parseZone } from "@lib/parseZone";
|
||||
import { createPaymentLink } from "@ee/lib/stripe/client";
|
||||
import { FormattedNumber, IntlProvider } from "react-intl";
|
||||
import { collectPageParameters, telemetryEventTypes, useTelemetry } from "@lib/telemetry";
|
||||
import { BookingCreateBody } from "@lib/types/booking";
|
||||
|
||||
import AvatarGroup from "@components/ui/AvatarGroup";
|
||||
import { Button } from "@components/ui/Button";
|
||||
|
||||
import { BookPageProps } from "../../../pages/[user]/book";
|
||||
import { TeamBookingPageProps } from "../../../pages/team/[slug]/book";
|
||||
import { stringify } from "querystring";
|
||||
import createBooking from "@lib/mutations/bookings/create-booking";
|
||||
import { BookingCreateBody } from "@lib/types/booking";
|
||||
|
||||
type BookingPageProps = BookPageProps | TeamBookingPageProps;
|
||||
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
import { DialogClose, DialogContent } from "@components/Dialog";
|
||||
import * as DialogPrimitive from "@radix-ui/react-dialog";
|
||||
import { ExclamationIcon } from "@heroicons/react/outline";
|
||||
import * as DialogPrimitive from "@radix-ui/react-dialog";
|
||||
import React, { PropsWithChildren } from "react";
|
||||
|
||||
import { DialogClose, DialogContent } from "@components/Dialog";
|
||||
import { Button } from "@components/ui/Button";
|
||||
|
||||
export type ConfirmationDialogContentProps = {
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
import React from "react";
|
||||
|
||||
import { HttpError } from "@lib/core/http/error";
|
||||
|
||||
type Props = {
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
import { SchedulingType } from "@prisma/client";
|
||||
import {
|
||||
ClockIcon,
|
||||
CreditCardIcon,
|
||||
|
@ -6,11 +5,13 @@ import {
|
|||
UserIcon,
|
||||
UsersIcon,
|
||||
} from "@heroicons/react/solid";
|
||||
import React from "react";
|
||||
import { SchedulingType } from "@prisma/client";
|
||||
import { Prisma } from "@prisma/client";
|
||||
import classNames from "@lib/classNames";
|
||||
import React from "react";
|
||||
import { FormattedNumber, IntlProvider } from "react-intl";
|
||||
|
||||
import classNames from "@lib/classNames";
|
||||
|
||||
const eventTypeData = Prisma.validator<Prisma.EventTypeArgs>()({
|
||||
select: {
|
||||
id: true,
|
||||
|
|
|
@ -1,7 +1,9 @@
|
|||
import React, { SyntheticEvent, useState } from "react";
|
||||
import Modal from "@components/Modal";
|
||||
|
||||
import { ErrorCode } from "@lib/auth";
|
||||
|
||||
import Modal from "@components/Modal";
|
||||
|
||||
const errorMessages: { [key: string]: string } = {
|
||||
[ErrorCode.IncorrectPassword]: "Current password is incorrect",
|
||||
[ErrorCode.NewPasswordMatchesOld]:
|
||||
|
|
|
@ -1,7 +1,10 @@
|
|||
import { SyntheticEvent, useState } from "react";
|
||||
import Button from "@components/ui/Button";
|
||||
import { Dialog, DialogContent } from "@components/Dialog";
|
||||
|
||||
import { ErrorCode } from "@lib/auth";
|
||||
|
||||
import { Dialog, DialogContent } from "@components/Dialog";
|
||||
import Button from "@components/ui/Button";
|
||||
|
||||
import TwoFactorAuthAPI from "./TwoFactorAuthAPI";
|
||||
import TwoFactorModalHeader from "./TwoFactorModalHeader";
|
||||
|
||||
|
|
|
@ -1,7 +1,10 @@
|
|||
import React, { SyntheticEvent, useState } from "react";
|
||||
import Button from "@components/ui/Button";
|
||||
import { Dialog, DialogContent } from "@components/Dialog";
|
||||
|
||||
import { ErrorCode } from "@lib/auth";
|
||||
|
||||
import { Dialog, DialogContent } from "@components/Dialog";
|
||||
import Button from "@components/ui/Button";
|
||||
|
||||
import TwoFactorAuthAPI from "./TwoFactorAuthAPI";
|
||||
import TwoFactorModalHeader from "./TwoFactorModalHeader";
|
||||
|
||||
|
|
|
@ -1,8 +1,10 @@
|
|||
import { useState } from "react";
|
||||
import Button from "@components/ui/Button";
|
||||
|
||||
import Badge from "@components/ui/Badge";
|
||||
import EnableTwoFactorModal from "./EnableTwoFactorModal";
|
||||
import Button from "@components/ui/Button";
|
||||
|
||||
import DisableTwoFactorModal from "./DisableTwoFactorModal";
|
||||
import EnableTwoFactorModal from "./EnableTwoFactorModal";
|
||||
|
||||
const TwoFactorAuthSection = ({ twoFactorEnabled }: { twoFactorEnabled: boolean }) => {
|
||||
const [enabled, setEnabled] = useState(twoFactorEnabled);
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import React from "react";
|
||||
import { ShieldCheckIcon } from "@heroicons/react/solid";
|
||||
import React from "react";
|
||||
|
||||
const TwoFactorModalHeader = ({ title, description }: { title: string; description: string }) => {
|
||||
return (
|
||||
|
|
|
@ -1,8 +1,9 @@
|
|||
import merge from "lodash.merge";
|
||||
import { NextSeo, NextSeoProps } from "next-seo";
|
||||
import React from "react";
|
||||
import { getBrowserInfo } from "@lib/core/browser/browser.utils";
|
||||
|
||||
import { getSeoImage, seoConfig } from "@lib/config/next-seo.config";
|
||||
import merge from "lodash.merge";
|
||||
import { getBrowserInfo } from "@lib/core/browser/browser.utils";
|
||||
|
||||
export type HeadSeoProps = {
|
||||
title: string;
|
||||
|
|
|
@ -1,18 +1,21 @@
|
|||
import React, { useEffect, useRef, useState } from "react";
|
||||
import { ArrowLeftIcon, PlusIcon, TrashIcon } from "@heroicons/react/outline";
|
||||
import ErrorAlert from "@components/ui/alerts/Error";
|
||||
import { UsernameInput } from "@components/ui/UsernameInput";
|
||||
import MemberList from "./MemberList";
|
||||
import Avatar from "@components/ui/Avatar";
|
||||
import ImageUploader from "@components/ImageUploader";
|
||||
import { Dialog, DialogTrigger } from "@components/Dialog";
|
||||
import ConfirmationDialogContent from "@components/dialog/ConfirmationDialogContent";
|
||||
import Modal from "@components/Modal";
|
||||
import MemberInvitationModal from "@components/team/MemberInvitationModal";
|
||||
import Button from "@components/ui/Button";
|
||||
import React, { useEffect, useRef, useState } from "react";
|
||||
|
||||
import { Member } from "@lib/member";
|
||||
import { Team } from "@lib/team";
|
||||
|
||||
import { Dialog, DialogTrigger } from "@components/Dialog";
|
||||
import ImageUploader from "@components/ImageUploader";
|
||||
import Modal from "@components/Modal";
|
||||
import ConfirmationDialogContent from "@components/dialog/ConfirmationDialogContent";
|
||||
import MemberInvitationModal from "@components/team/MemberInvitationModal";
|
||||
import Avatar from "@components/ui/Avatar";
|
||||
import Button from "@components/ui/Button";
|
||||
import { UsernameInput } from "@components/ui/UsernameInput";
|
||||
import ErrorAlert from "@components/ui/alerts/Error";
|
||||
|
||||
import MemberList from "./MemberList";
|
||||
|
||||
export default function EditTeam(props: { team: Team | undefined | null; onCloseEdit: () => void }) {
|
||||
const [members, setMembers] = useState([]);
|
||||
|
||||
|
|
|
@ -1,8 +1,10 @@
|
|||
import { UsersIcon } from "@heroicons/react/outline";
|
||||
import { useState } from "react";
|
||||
import Button from "@components/ui/Button";
|
||||
|
||||
import { Team } from "@lib/team";
|
||||
|
||||
import Button from "@components/ui/Button";
|
||||
|
||||
export default function MemberInvitationModal(props: { team: Team | undefined | null; onExit: () => void }) {
|
||||
const [errorMessage, setErrorMessage] = useState("");
|
||||
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
import MemberListItem from "./MemberListItem";
|
||||
import { Member } from "@lib/member";
|
||||
|
||||
import MemberListItem from "./MemberListItem";
|
||||
|
||||
export default function MemberList(props: {
|
||||
members: Member[];
|
||||
onRemoveMember: (text: Member) => void;
|
||||
|
|
|
@ -1,12 +1,15 @@
|
|||
import { DotsHorizontalIcon, UserRemoveIcon } from "@heroicons/react/outline";
|
||||
import Dropdown, { DropdownMenuContent, DropdownMenuItem, DropdownMenuTrigger } from "../ui/Dropdown";
|
||||
import { useState } from "react";
|
||||
|
||||
import { Member } from "@lib/member";
|
||||
|
||||
import { Dialog, DialogTrigger } from "@components/Dialog";
|
||||
import ConfirmationDialogContent from "@components/dialog/ConfirmationDialogContent";
|
||||
import Avatar from "@components/ui/Avatar";
|
||||
import { Member } from "@lib/member";
|
||||
import Button from "@components/ui/Button";
|
||||
|
||||
import Dropdown, { DropdownMenuContent, DropdownMenuItem, DropdownMenuTrigger } from "../ui/Dropdown";
|
||||
|
||||
export default function MemberListItem(props: {
|
||||
member: Member;
|
||||
onActionSelect: (text: string) => void;
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
import TeamListItem from "./TeamListItem";
|
||||
import { Team } from "@lib/team";
|
||||
|
||||
import TeamListItem from "./TeamListItem";
|
||||
|
||||
export default function TeamList(props: {
|
||||
teams: Team[];
|
||||
onChange: () => void;
|
||||
|
|
|
@ -5,15 +5,18 @@ import {
|
|||
PencilAltIcon,
|
||||
TrashIcon,
|
||||
} from "@heroicons/react/outline";
|
||||
import Dropdown, { DropdownMenuContent, DropdownMenuItem, DropdownMenuTrigger } from "../ui/Dropdown";
|
||||
import { useState } from "react";
|
||||
import { Tooltip } from "@components/Tooltip";
|
||||
import Link from "next/link";
|
||||
import { useState } from "react";
|
||||
|
||||
import showToast from "@lib/notification";
|
||||
|
||||
import { Dialog, DialogTrigger } from "@components/Dialog";
|
||||
import { Tooltip } from "@components/Tooltip";
|
||||
import ConfirmationDialogContent from "@components/dialog/ConfirmationDialogContent";
|
||||
import Avatar from "@components/ui/Avatar";
|
||||
import Button from "@components/ui/Button";
|
||||
import showToast from "@lib/notification";
|
||||
|
||||
import Dropdown, { DropdownMenuContent, DropdownMenuItem, DropdownMenuTrigger } from "../ui/Dropdown";
|
||||
|
||||
interface Team {
|
||||
id: number;
|
||||
|
|
|
@ -1,11 +1,12 @@
|
|||
import React from "react";
|
||||
import Text from "@components/ui/Text";
|
||||
import Link from "next/link";
|
||||
import Avatar from "@components/ui/Avatar";
|
||||
import { ArrowRightIcon } from "@heroicons/react/outline";
|
||||
import classnames from "classnames";
|
||||
import { ArrowLeftIcon } from "@heroicons/react/solid";
|
||||
import classnames from "classnames";
|
||||
import Link from "next/link";
|
||||
import React from "react";
|
||||
|
||||
import Avatar from "@components/ui/Avatar";
|
||||
import Button from "@components/ui/Button";
|
||||
import Text from "@components/ui/Text";
|
||||
|
||||
const Team = ({ team }) => {
|
||||
const Member = ({ member }) => {
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
import * as AvatarPrimitive from "@radix-ui/react-avatar";
|
||||
import * as Tooltip from "@radix-ui/react-tooltip";
|
||||
import { defaultAvatarSrc } from "@lib/profile";
|
||||
|
||||
import classNames from "@lib/classNames";
|
||||
import { defaultAvatarSrc } from "@lib/profile";
|
||||
|
||||
export type AvatarProps = {
|
||||
className?: string;
|
||||
|
|
|
@ -1,6 +1,9 @@
|
|||
import React from "react";
|
||||
import Avatar from "@components/ui/Avatar";
|
||||
|
||||
import classNames from "@lib/classNames";
|
||||
|
||||
import Avatar from "@components/ui/Avatar";
|
||||
|
||||
// import * as Tooltip from "@radix-ui/react-tooltip";
|
||||
|
||||
export type AvatarGroupProps = {
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
import classNames from "@lib/classNames";
|
||||
import React from "react";
|
||||
|
||||
import classNames from "@lib/classNames";
|
||||
|
||||
export type BadgeProps = {
|
||||
variant: "default" | "success" | "gray";
|
||||
} & JSX.IntrinsicElements["span"];
|
||||
|
|
|
@ -1,8 +1,9 @@
|
|||
import classNames from "@lib/classNames";
|
||||
import { SVGComponent } from "@lib/types/SVGComponent";
|
||||
import Link, { LinkProps } from "next/link";
|
||||
import React, { forwardRef } from "react";
|
||||
|
||||
import classNames from "@lib/classNames";
|
||||
import { SVGComponent } from "@lib/types/SVGComponent";
|
||||
|
||||
export type ButtonProps = {
|
||||
color?: "primary" | "secondary" | "minimal" | "warn";
|
||||
size?: "base" | "sm" | "lg" | "fab";
|
||||
|
|
|
@ -1,8 +1,9 @@
|
|||
import React from "react";
|
||||
import Text from "@components/ui/Text";
|
||||
import { PlusIcon, TrashIcon } from "@heroicons/react/outline";
|
||||
import dayjs, { Dayjs } from "dayjs";
|
||||
import classnames from "classnames";
|
||||
import dayjs, { Dayjs } from "dayjs";
|
||||
import React from "react";
|
||||
|
||||
import Text from "@components/ui/Text";
|
||||
|
||||
export const SCHEDULE_FORM_ID = "SCHEDULE_FORM_ID";
|
||||
export const toCalendsoAvailabilityFormat = (schedule: Schedule) => {
|
||||
|
|
|
@ -1,12 +1,13 @@
|
|||
import { TrashIcon } from "@heroicons/react/outline";
|
||||
import { Availability } from "@prisma/client";
|
||||
import dayjs from "dayjs";
|
||||
import timezone from "dayjs/plugin/timezone";
|
||||
import utc from "dayjs/plugin/utc";
|
||||
import React, { useEffect, useState } from "react";
|
||||
import TimezoneSelect from "react-timezone-select";
|
||||
import { TrashIcon } from "@heroicons/react/outline";
|
||||
|
||||
import { WeekdaySelect } from "./WeekdaySelect";
|
||||
import SetTimesModal from "./modal/SetTimesModal";
|
||||
import dayjs from "dayjs";
|
||||
import utc from "dayjs/plugin/utc";
|
||||
import timezone from "dayjs/plugin/timezone";
|
||||
import { Availability } from "@prisma/client";
|
||||
|
||||
dayjs.extend(utc);
|
||||
dayjs.extend(timezone);
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import { useState } from "react";
|
||||
import * as PrimitiveSwitch from "@radix-ui/react-switch";
|
||||
import * as Label from "@radix-ui/react-label";
|
||||
import * as PrimitiveSwitch from "@radix-ui/react-switch";
|
||||
import { useState } from "react";
|
||||
|
||||
function classNames(...classes) {
|
||||
return classes.filter(Boolean).join(" ");
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
import React from "react";
|
||||
import classnames from "classnames";
|
||||
import React from "react";
|
||||
|
||||
import { TextProps } from "../Text";
|
||||
|
||||
const Body: React.FunctionComponent<TextProps> = (props: TextProps) => {
|
||||
|
|
|
@ -1,2 +1,3 @@
|
|||
import Body from "./Body";
|
||||
|
||||
export default Body;
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
import React from "react";
|
||||
import classnames from "classnames";
|
||||
import React from "react";
|
||||
|
||||
import { TextProps } from "../Text";
|
||||
|
||||
const Caption: React.FunctionComponent<TextProps> = (props: TextProps) => {
|
||||
|
|
|
@ -1,2 +1,3 @@
|
|||
import Caption from "./Caption";
|
||||
|
||||
export default Caption;
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
import React from "react";
|
||||
import classnames from "classnames";
|
||||
import React from "react";
|
||||
|
||||
import { TextProps } from "../Text";
|
||||
|
||||
const Caption2: React.FunctionComponent<TextProps> = (props: TextProps) => {
|
||||
|
|
|
@ -1,2 +1,3 @@
|
|||
import Caption2 from "./Caption2";
|
||||
|
||||
export default Caption2;
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
import React from "react";
|
||||
import classnames from "classnames";
|
||||
import React from "react";
|
||||
|
||||
import { TextProps } from "../Text";
|
||||
|
||||
const Footnote: React.FunctionComponent<TextProps> = (props: TextProps) => {
|
||||
|
|
|
@ -1,2 +1,3 @@
|
|||
import Footnote from "./Footnote";
|
||||
|
||||
export default Footnote;
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
import React from "react";
|
||||
import classnames from "classnames";
|
||||
import React from "react";
|
||||
|
||||
import { TextProps } from "../Text";
|
||||
|
||||
const Headline: React.FunctionComponent<TextProps> = (props: TextProps) => {
|
||||
|
|
|
@ -1,2 +1,3 @@
|
|||
import Headline from "./Headline";
|
||||
|
||||
export default Headline;
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
import React from "react";
|
||||
import classnames from "classnames";
|
||||
import React from "react";
|
||||
|
||||
import { TextProps } from "../Text";
|
||||
|
||||
const Largetitle: React.FunctionComponent<TextProps> = (props: TextProps) => {
|
||||
|
|
|
@ -1,2 +1,3 @@
|
|||
import Largetitle from "./Largetitle";
|
||||
|
||||
export default Largetitle;
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
import React from "react";
|
||||
import classnames from "classnames";
|
||||
import React from "react";
|
||||
|
||||
import { TextProps } from "../Text";
|
||||
|
||||
const Overline: React.FunctionComponent<TextProps> = (props: TextProps) => {
|
||||
|
|
|
@ -1,2 +1,3 @@
|
|||
import Overline from "./Overline";
|
||||
|
||||
export default Overline;
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
import React from "react";
|
||||
import classnames from "classnames";
|
||||
import React from "react";
|
||||
|
||||
import { TextProps } from "../Text";
|
||||
|
||||
const Subheadline: React.FunctionComponent<TextProps> = (props: TextProps) => {
|
||||
|
|
|
@ -1,2 +1,3 @@
|
|||
import Subheadline from "./Subheadline";
|
||||
|
||||
export default Subheadline;
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
import React from "react";
|
||||
import classnames from "classnames";
|
||||
import React from "react";
|
||||
|
||||
import { TextProps } from "../Text";
|
||||
|
||||
const Subtitle: React.FunctionComponent<TextProps> = (props: TextProps) => {
|
||||
|
|
|
@ -1,2 +1,3 @@
|
|||
import Subtitle from "./Subtitle";
|
||||
|
||||
export default Subtitle;
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
import React from "react";
|
||||
|
||||
import Body from "./Body";
|
||||
import Caption from "./Caption";
|
||||
import Caption2 from "./Caption2";
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
import React from "react";
|
||||
import classnames from "classnames";
|
||||
import React from "react";
|
||||
|
||||
import { TextProps } from "../Text";
|
||||
|
||||
const Title: React.FunctionComponent<TextProps> = (props: TextProps) => {
|
||||
|
|
|
@ -1,2 +1,3 @@
|
|||
import Title from "./Title";
|
||||
|
||||
export default Title;
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
import React from "react";
|
||||
import classnames from "classnames";
|
||||
import React from "react";
|
||||
|
||||
import { TextProps } from "../Text";
|
||||
|
||||
const Title2: React.FunctionComponent<TextProps> = (props: TextProps) => {
|
||||
|
|
|
@ -1,2 +1,3 @@
|
|||
import Title2 from "./Title2";
|
||||
|
||||
export default Title2;
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
import React from "react";
|
||||
import classnames from "classnames";
|
||||
import React from "react";
|
||||
|
||||
import { TextProps } from "../Text";
|
||||
|
||||
const Title3: React.FunctionComponent<TextProps> = (props: TextProps) => {
|
||||
|
|
|
@ -1,2 +1,3 @@
|
|||
import Title3 from "./Title3";
|
||||
|
||||
export default Title3;
|
||||
|
|
|
@ -1,39 +1,40 @@
|
|||
import Body from "./Body";
|
||||
import Caption from "./Caption";
|
||||
import Caption2 from "./Caption2";
|
||||
import Footnote from "./Footnote";
|
||||
import Headline from "./Headline";
|
||||
import Largetitle from "./Largetitle";
|
||||
import Overline from "./Overline";
|
||||
import Subheadline from "./Subheadline";
|
||||
import Subtitle from "./Subtitle";
|
||||
import Text from "./Text";
|
||||
import Title from "./Title";
|
||||
import Title2 from "./Title2";
|
||||
import Title3 from "./Title3";
|
||||
|
||||
export { Text };
|
||||
export default Text;
|
||||
|
||||
import Title from "./Title";
|
||||
export { Title };
|
||||
|
||||
import Title2 from "./Title2";
|
||||
export { Title2 };
|
||||
|
||||
import Title3 from "./Title3";
|
||||
export { Title3 };
|
||||
|
||||
import Largetitle from "./Largetitle";
|
||||
export { Largetitle };
|
||||
|
||||
import Subtitle from "./Subtitle";
|
||||
export { Subtitle };
|
||||
|
||||
import Headline from "./Headline";
|
||||
export { Headline };
|
||||
|
||||
import Subheadline from "./Subheadline";
|
||||
export { Subheadline };
|
||||
|
||||
import Caption from "./Caption";
|
||||
export { Caption };
|
||||
|
||||
import Caption2 from "./Caption2";
|
||||
export { Caption2 };
|
||||
|
||||
import Footnote from "./Footnote";
|
||||
export { Footnote };
|
||||
|
||||
import Overline from "./Overline";
|
||||
export { Overline };
|
||||
|
||||
import Body from "./Body";
|
||||
export { Body };
|
||||
|
|
|
@ -1,9 +1,10 @@
|
|||
import Select from "@components/ui/form/Select";
|
||||
import { XIcon, CheckIcon } from "@heroicons/react/outline";
|
||||
import React, { ForwardedRef, useEffect, useState } from "react";
|
||||
import Avatar from "@components/ui/Avatar";
|
||||
import { OptionsType } from "react-select/lib/types";
|
||||
|
||||
import Avatar from "@components/ui/Avatar";
|
||||
import Select from "@components/ui/form/Select";
|
||||
|
||||
export type CheckedSelectProps = {
|
||||
defaultValue?: [];
|
||||
placeholder?: string;
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
import "react-phone-number-input/style.css";
|
||||
import { default as BasePhoneInput } from "react-phone-number-input";
|
||||
import React from "react";
|
||||
import { default as BasePhoneInput } from "react-phone-number-input";
|
||||
import "react-phone-number-input/style.css";
|
||||
|
||||
import classNames from "@lib/classNames";
|
||||
|
||||
export const PhoneInput = (props) => (
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
import React, { PropsWithChildren } from "react";
|
||||
import Select, { components, NamedProps } from "react-select";
|
||||
|
||||
import classNames from "@lib/classNames";
|
||||
|
||||
export const SelectComp = (props: PropsWithChildren<NamedProps>) => (
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
import React, { PropsWithChildren, useState } from "react";
|
||||
|
||||
import classNames from "@lib/classNames";
|
||||
|
||||
type RadioAreaProps = React.InputHTMLAttributes<HTMLInputElement> & {
|
||||
|
|
|
@ -1,9 +1,11 @@
|
|||
import { Collapsible, CollapsibleContent, CollapsibleTrigger } from "@radix-ui/react-collapsible";
|
||||
import { ChevronDownIcon } from "@heroicons/react/solid";
|
||||
import { Collapsible, CollapsibleContent, CollapsibleTrigger } from "@radix-ui/react-collapsible";
|
||||
import React from "react";
|
||||
import { RadioArea, RadioAreaGroup } from "@components/ui/form/radio-area/RadioAreaGroup";
|
||||
|
||||
import classNames from "@lib/classNames";
|
||||
|
||||
import { RadioArea, RadioAreaGroup } from "@components/ui/form/radio-area/RadioAreaGroup";
|
||||
|
||||
type OptionProps = React.OptionHTMLAttributes<HTMLOptionElement> & {
|
||||
description?: string;
|
||||
};
|
||||
|
|
|
@ -1,4 +1,2 @@
|
|||
/* eslint-disable @typescript-eslint/no-unused-vars */
|
||||
/* eslint-disable @typescript-eslint/no-namespace */
|
||||
|
||||
/* eslint-disable @typescript-eslint/no-unused-vars, @typescript-eslint/no-namespace */
|
||||
import "./commands";
|
||||
|
|
|
@ -1,11 +1,14 @@
|
|||
import React, { useState } from "react";
|
||||
import { stringify } from "querystring";
|
||||
import { CardElement, useStripe, useElements } from "@stripe/react-stripe-js";
|
||||
import Button from "@components/ui/Button";
|
||||
import { useRouter } from "next/router";
|
||||
import useDarkMode from "@lib/core/browser/useDarkMode";
|
||||
import { stringify } from "querystring";
|
||||
import React, { useState } from "react";
|
||||
|
||||
import { PaymentData } from "@ee/lib/stripe/server";
|
||||
|
||||
import useDarkMode from "@lib/core/browser/useDarkMode";
|
||||
|
||||
import Button from "@components/ui/Button";
|
||||
|
||||
const CARD_OPTIONS = {
|
||||
iconStyle: "solid" as const,
|
||||
classes: {
|
||||
|
|
|
@ -1,8 +1,4 @@
|
|||
import PaymentComponent from "@ee/components/stripe/Payment";
|
||||
import getStripe from "@ee/lib/stripe/client";
|
||||
import { PaymentPageProps } from "@ee/pages/payment/[uid]";
|
||||
import { CreditCardIcon } from "@heroicons/react/solid";
|
||||
import useTheme from "@lib/hooks/useTheme";
|
||||
import { Elements } from "@stripe/react-stripe-js";
|
||||
import dayjs from "dayjs";
|
||||
import timezone from "dayjs/plugin/timezone";
|
||||
|
@ -12,6 +8,12 @@ import Head from "next/head";
|
|||
import React, { FC, useEffect, useState } from "react";
|
||||
import { FormattedNumber, IntlProvider } from "react-intl";
|
||||
|
||||
import PaymentComponent from "@ee/components/stripe/Payment";
|
||||
import getStripe from "@ee/lib/stripe/client";
|
||||
import { PaymentPageProps } from "@ee/pages/payment/[uid]";
|
||||
|
||||
import useTheme from "@lib/hooks/useTheme";
|
||||
|
||||
dayjs.extend(utc);
|
||||
dayjs.extend(toArray);
|
||||
dayjs.extend(timezone);
|
||||
|
|
|
@ -1,11 +1,13 @@
|
|||
import { CalendarEvent, Person } from "@lib/calendarClient";
|
||||
import EventOrganizerRefundFailedMail from "@lib/emails/EventOrganizerRefundFailedMail";
|
||||
import EventPaymentMail from "@lib/emails/EventPaymentMail";
|
||||
import prisma from "@lib/prisma";
|
||||
import { PaymentType } from "@prisma/client";
|
||||
import Stripe from "stripe";
|
||||
import { JsonValue } from "type-fest";
|
||||
import { v4 as uuidv4 } from "uuid";
|
||||
|
||||
import { CalendarEvent, Person } from "@lib/calendarClient";
|
||||
import EventOrganizerRefundFailedMail from "@lib/emails/EventOrganizerRefundFailedMail";
|
||||
import EventPaymentMail from "@lib/emails/EventPaymentMail";
|
||||
import prisma from "@lib/prisma";
|
||||
|
||||
import { createPaymentLink } from "./client";
|
||||
|
||||
export type PaymentData = Stripe.Response<Stripe.PaymentIntent> & {
|
||||
|
|
|
@ -1,8 +1,9 @@
|
|||
import { getSession } from "@lib/auth";
|
||||
import prisma from "@lib/prisma";
|
||||
import type { NextApiRequest, NextApiResponse } from "next";
|
||||
import { stringify } from "querystring";
|
||||
|
||||
import { getSession } from "@lib/auth";
|
||||
import prisma from "@lib/prisma";
|
||||
|
||||
const client_id = process.env.STRIPE_CLIENT_ID;
|
||||
|
||||
export default async function handler(req: NextApiRequest, res: NextApiResponse) {
|
||||
|
|
|
@ -1,8 +1,10 @@
|
|||
import { Prisma } from "@prisma/client";
|
||||
import type { NextApiRequest, NextApiResponse } from "next";
|
||||
|
||||
import stripe, { StripeData } from "@ee/lib/stripe/server";
|
||||
|
||||
import { getSession } from "@lib/auth";
|
||||
import prisma from "@lib/prisma";
|
||||
import stripe, { StripeData } from "@ee/lib/stripe/server";
|
||||
import type { NextApiRequest, NextApiResponse } from "next";
|
||||
|
||||
export default async function handler(req: NextApiRequest, res: NextApiResponse) {
|
||||
const { code } = req.query;
|
||||
|
|
|
@ -1,11 +1,13 @@
|
|||
import { buffer } from "micro";
|
||||
import type { NextApiRequest, NextApiResponse } from "next";
|
||||
import { getErrorFromUnknown } from "pages/_error";
|
||||
import Stripe from "stripe";
|
||||
|
||||
import stripe from "@ee/lib/stripe/server";
|
||||
|
||||
import { CalendarEvent } from "@lib/calendarClient";
|
||||
import EventManager from "@lib/events/EventManager";
|
||||
import prisma from "@lib/prisma";
|
||||
import stripe from "@ee/lib/stripe/server";
|
||||
import { buffer } from "micro";
|
||||
import type { NextApiRequest, NextApiResponse } from "next";
|
||||
import Stripe from "stripe";
|
||||
import { getErrorFromUnknown } from "pages/_error";
|
||||
|
||||
const webhookSecret = process.env.STRIPE_WEBHOOK_SECRET;
|
||||
|
||||
|
|
|
@ -1,8 +1,10 @@
|
|||
import { GetServerSidePropsContext } from "next";
|
||||
|
||||
import { PaymentData } from "@ee/lib/stripe/server";
|
||||
|
||||
import { asStringOrThrow } from "@lib/asStringOrNull";
|
||||
import prisma from "@lib/prisma";
|
||||
import { inferSSRProps } from "@lib/types/inferSSRProps";
|
||||
import { GetServerSidePropsContext } from "next";
|
||||
|
||||
export type PaymentPageProps = inferSSRProps<typeof getServerSideProps>;
|
||||
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
import { CalendarEvent } from "./calendarClient";
|
||||
import { v5 as uuidv5 } from "uuid";
|
||||
import short from "short-uuid";
|
||||
import { v5 as uuidv5 } from "uuid";
|
||||
|
||||
import { CalendarEvent } from "./calendarClient";
|
||||
import { stripHtml } from "./emails/helpers";
|
||||
|
||||
const translator = short();
|
||||
|
|
|
@ -1,9 +1,10 @@
|
|||
import React from "react";
|
||||
import { createTelemetryClient, TelemetryProvider } from "@lib/telemetry";
|
||||
import { Provider } from "next-auth/client";
|
||||
import React from "react";
|
||||
import { QueryClient, QueryClientProvider } from "react-query";
|
||||
import { Hydrate } from "react-query/hydration";
|
||||
|
||||
import { createTelemetryClient, TelemetryProvider } from "@lib/telemetry";
|
||||
|
||||
export const queryClient = new QueryClient();
|
||||
|
||||
const AppProviders: React.FC = (props, pageProps) => {
|
||||
|
|
|
@ -1,12 +1,14 @@
|
|||
import EventOrganizerMail from "./emails/EventOrganizerMail";
|
||||
import EventOrganizerRescheduledMail from "./emails/EventOrganizerRescheduledMail";
|
||||
import prisma from "./prisma";
|
||||
import { Prisma, Credential } from "@prisma/client";
|
||||
import CalEventParser from "./CalEventParser";
|
||||
|
||||
import { EventResult } from "@lib/events/EventManager";
|
||||
import logger from "@lib/logger";
|
||||
import { CalDavCalendar } from "./integrations/CalDav/CalDavCalendarAdapter";
|
||||
|
||||
import CalEventParser from "./CalEventParser";
|
||||
import EventOrganizerMail from "./emails/EventOrganizerMail";
|
||||
import EventOrganizerRescheduledMail from "./emails/EventOrganizerRescheduledMail";
|
||||
import { AppleCalendar } from "./integrations/Apple/AppleCalendarAdapter";
|
||||
import { CalDavCalendar } from "./integrations/CalDav/CalDavCalendarAdapter";
|
||||
import prisma from "./prisma";
|
||||
|
||||
const log = logger.getChildLogger({ prefix: ["[lib] calendarClient"] });
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
// handles logic related to user clock display using 24h display / timeZone options.
|
||||
import dayjs from "dayjs";
|
||||
import utc from "dayjs/plugin/utc";
|
||||
import timezone from "dayjs/plugin/timezone";
|
||||
import utc from "dayjs/plugin/utc";
|
||||
|
||||
dayjs.extend(utc);
|
||||
dayjs.extend(timezone);
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
import { DefaultSeoProps } from "next-seo";
|
||||
|
||||
import { HeadSeoProps } from "@components/seo/head-seo";
|
||||
|
||||
const seoImages = {
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
import dayjs, { Dayjs } from "dayjs";
|
||||
import EventMail from "./EventMail";
|
||||
|
||||
import utc from "dayjs/plugin/utc";
|
||||
import timezone from "dayjs/plugin/timezone";
|
||||
import localizedFormat from "dayjs/plugin/localizedFormat";
|
||||
import timezone from "dayjs/plugin/timezone";
|
||||
import utc from "dayjs/plugin/utc";
|
||||
|
||||
import EventMail from "./EventMail";
|
||||
|
||||
dayjs.extend(utc);
|
||||
dayjs.extend(timezone);
|
||||
|
@ -160,6 +160,6 @@ export default class EventAttendeeMail extends EventMail {
|
|||
* @private
|
||||
*/
|
||||
protected getInviteeStart(): Dayjs {
|
||||
return <Dayjs>dayjs(this.calEvent.startTime).tz(this.calEvent.attendees[0].timeZone);
|
||||
return dayjs(this.calEvent.startTime).tz(this.calEvent.attendees[0].timeZone);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,8 +1,9 @@
|
|||
import nodemailer from "nodemailer";
|
||||
|
||||
import CalEventParser from "../CalEventParser";
|
||||
import { stripHtml } from "./helpers";
|
||||
import { CalendarEvent, ConferenceData } from "../calendarClient";
|
||||
import { serverConfig } from "../serverConfig";
|
||||
import nodemailer from "nodemailer";
|
||||
import { stripHtml } from "./helpers";
|
||||
|
||||
export interface EntryPoint {
|
||||
entryPointType?: string;
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
import { createEvent } from "ics";
|
||||
import dayjs, { Dayjs } from "dayjs";
|
||||
import EventMail from "./EventMail";
|
||||
|
||||
import utc from "dayjs/plugin/utc";
|
||||
import localizedFormat from "dayjs/plugin/localizedFormat";
|
||||
import timezone from "dayjs/plugin/timezone";
|
||||
import toArray from "dayjs/plugin/toArray";
|
||||
import localizedFormat from "dayjs/plugin/localizedFormat";
|
||||
import utc from "dayjs/plugin/utc";
|
||||
import { createEvent } from "ics";
|
||||
|
||||
import EventMail from "./EventMail";
|
||||
import { stripHtml } from "./helpers";
|
||||
|
||||
dayjs.extend(utc);
|
||||
|
@ -217,6 +217,6 @@ export default class EventOrganizerMail extends EventMail {
|
|||
* @private
|
||||
*/
|
||||
protected getOrganizerStart(): Dayjs {
|
||||
return <Dayjs>dayjs(this.calEvent.startTime).tz(this.calEvent.organizer.timeZone);
|
||||
return dayjs(this.calEvent.startTime).tz(this.calEvent.organizer.timeZone);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
import dayjs, { Dayjs } from "dayjs";
|
||||
|
||||
import utc from "dayjs/plugin/utc";
|
||||
import localizedFormat from "dayjs/plugin/localizedFormat";
|
||||
import timezone from "dayjs/plugin/timezone";
|
||||
import toArray from "dayjs/plugin/toArray";
|
||||
import localizedFormat from "dayjs/plugin/localizedFormat";
|
||||
import EventOrganizerMail from "@lib/emails/EventOrganizerMail";
|
||||
import utc from "dayjs/plugin/utc";
|
||||
|
||||
import { CalendarEvent } from "@lib/calendarClient";
|
||||
import EventOrganizerMail from "@lib/emails/EventOrganizerMail";
|
||||
|
||||
dayjs.extend(utc);
|
||||
dayjs.extend(timezone);
|
||||
|
@ -27,7 +27,7 @@ export default class EventOrganizerRefundFailedMail extends EventOrganizerMail {
|
|||
}
|
||||
|
||||
protected getBodyText(): string {
|
||||
const organizerStart: Dayjs = <Dayjs>dayjs(this.calEvent.startTime).tz(this.calEvent.organizer.timeZone);
|
||||
const organizerStart: Dayjs = dayjs(this.calEvent.startTime).tz(this.calEvent.organizer.timeZone);
|
||||
return `The refund for the event ${this.calEvent.type} with ${
|
||||
this.calEvent.attendees[0].name
|
||||
} on ${organizerStart.format("LT dddd, LL")} failed. Please check with your payment provider and ${
|
||||
|
@ -57,7 +57,7 @@ export default class EventOrganizerRefundFailedMail extends EventOrganizerMail {
|
|||
}
|
||||
|
||||
protected getSubject(): string {
|
||||
const organizerStart: Dayjs = <Dayjs>dayjs(this.calEvent.startTime).tz(this.calEvent.organizer.timeZone);
|
||||
const organizerStart: Dayjs = dayjs(this.calEvent.startTime).tz(this.calEvent.organizer.timeZone);
|
||||
return `Refund failed: ${this.calEvent.attendees[0].name} - ${organizerStart.format("LT dddd, LL")} - ${
|
||||
this.calEvent.type
|
||||
}`;
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
import dayjs, { Dayjs } from "dayjs";
|
||||
|
||||
import utc from "dayjs/plugin/utc";
|
||||
import localizedFormat from "dayjs/plugin/localizedFormat";
|
||||
import timezone from "dayjs/plugin/timezone";
|
||||
import toArray from "dayjs/plugin/toArray";
|
||||
import localizedFormat from "dayjs/plugin/localizedFormat";
|
||||
import utc from "dayjs/plugin/utc";
|
||||
|
||||
import EventOrganizerMail from "@lib/emails/EventOrganizerMail";
|
||||
|
||||
dayjs.extend(utc);
|
||||
|
@ -42,7 +42,7 @@ export default class EventOrganizerRequestMail extends EventOrganizerMail {
|
|||
}
|
||||
|
||||
protected getSubject(): string {
|
||||
const organizerStart: Dayjs = <Dayjs>dayjs(this.calEvent.startTime).tz(this.calEvent.organizer.timeZone);
|
||||
const organizerStart: Dayjs = dayjs(this.calEvent.startTime).tz(this.calEvent.organizer.timeZone);
|
||||
return `New event request: ${this.calEvent.attendees[0].name} - ${organizerStart.format(
|
||||
"LT dddd, LL"
|
||||
)} - ${this.calEvent.type}`;
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
import dayjs, { Dayjs } from "dayjs";
|
||||
|
||||
import utc from "dayjs/plugin/utc";
|
||||
import localizedFormat from "dayjs/plugin/localizedFormat";
|
||||
import timezone from "dayjs/plugin/timezone";
|
||||
import toArray from "dayjs/plugin/toArray";
|
||||
import localizedFormat from "dayjs/plugin/localizedFormat";
|
||||
import utc from "dayjs/plugin/utc";
|
||||
|
||||
import EventOrganizerRequestMail from "@lib/emails/EventOrganizerRequestMail";
|
||||
|
||||
dayjs.extend(utc);
|
||||
|
@ -17,7 +17,7 @@ export default class EventOrganizerRequestReminderMail extends EventOrganizerReq
|
|||
}
|
||||
|
||||
protected getSubject(): string {
|
||||
const organizerStart: Dayjs = <Dayjs>dayjs(this.calEvent.startTime).tz(this.calEvent.organizer.timeZone);
|
||||
const organizerStart: Dayjs = dayjs(this.calEvent.startTime).tz(this.calEvent.organizer.timeZone);
|
||||
return `Event request is still waiting: ${this.calEvent.attendees[0].name} - ${organizerStart.format(
|
||||
"LT dddd, LL"
|
||||
)} - ${this.calEvent.type}`;
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
import dayjs, { Dayjs } from "dayjs";
|
||||
|
||||
import EventOrganizerMail from "./EventOrganizerMail";
|
||||
|
||||
export default class EventOrganizerRescheduledMail extends EventOrganizerMail {
|
||||
|
@ -48,7 +49,7 @@ export default class EventOrganizerRescheduledMail extends EventOrganizerMail {
|
|||
* @protected
|
||||
*/
|
||||
protected getNodeMailerPayload(): Record<string, unknown> {
|
||||
const organizerStart: Dayjs = <Dayjs>dayjs(this.calEvent.startTime).tz(this.calEvent.organizer.timeZone);
|
||||
const organizerStart: Dayjs = dayjs(this.calEvent.startTime).tz(this.calEvent.organizer.timeZone);
|
||||
|
||||
return {
|
||||
icalEvent: {
|
||||
|
|
|
@ -1,11 +1,12 @@
|
|||
import dayjs, { Dayjs } from "dayjs";
|
||||
import EventMail, { AdditionInformation } from "./EventMail";
|
||||
|
||||
import utc from "dayjs/plugin/utc";
|
||||
import timezone from "dayjs/plugin/timezone";
|
||||
import localizedFormat from "dayjs/plugin/localizedFormat";
|
||||
import timezone from "dayjs/plugin/timezone";
|
||||
import utc from "dayjs/plugin/utc";
|
||||
|
||||
import { CalendarEvent } from "@lib/calendarClient";
|
||||
|
||||
import EventMail, { AdditionInformation } from "./EventMail";
|
||||
|
||||
dayjs.extend(utc);
|
||||
dayjs.extend(timezone);
|
||||
dayjs.extend(localizedFormat);
|
||||
|
@ -160,6 +161,6 @@ export default class EventPaymentMail extends EventMail {
|
|||
* @private
|
||||
*/
|
||||
protected getInviteeStart(): Dayjs {
|
||||
return <Dayjs>dayjs(this.calEvent.startTime).tz(this.calEvent.attendees[0].timeZone);
|
||||
return dayjs(this.calEvent.startTime).tz(this.calEvent.attendees[0].timeZone);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
import dayjs, { Dayjs } from "dayjs";
|
||||
import EventMail from "./EventMail";
|
||||
|
||||
import utc from "dayjs/plugin/utc";
|
||||
import timezone from "dayjs/plugin/timezone";
|
||||
import localizedFormat from "dayjs/plugin/localizedFormat";
|
||||
import timezone from "dayjs/plugin/timezone";
|
||||
import utc from "dayjs/plugin/utc";
|
||||
|
||||
import EventMail from "./EventMail";
|
||||
|
||||
dayjs.extend(utc);
|
||||
dayjs.extend(timezone);
|
||||
|
@ -86,6 +86,6 @@ export default class EventRejectionMail extends EventMail {
|
|||
* @private
|
||||
*/
|
||||
protected getInviteeStart(): Dayjs {
|
||||
return <Dayjs>dayjs(this.calEvent.startTime).tz(this.calEvent.attendees[0].timeZone);
|
||||
return dayjs(this.calEvent.startTime).tz(this.calEvent.attendees[0].timeZone);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,8 +1,9 @@
|
|||
import { AdditionInformation } from "@lib/emails/EventMail";
|
||||
|
||||
import { CalendarEvent } from "../calendarClient";
|
||||
import { VideoCallData } from "../videoClient";
|
||||
import EventAttendeeMail from "./EventAttendeeMail";
|
||||
import { getFormattedMeetingId, getIntegrationName } from "./helpers";
|
||||
import { VideoCallData } from "../videoClient";
|
||||
import { AdditionInformation } from "@lib/emails/EventMail";
|
||||
|
||||
export default class VideoEventAttendeeMail extends EventAttendeeMail {
|
||||
videoCallData: VideoCallData;
|
||||
|
|
|
@ -1,9 +1,10 @@
|
|||
import { CalendarEvent } from "../calendarClient";
|
||||
import EventOrganizerMail from "./EventOrganizerMail";
|
||||
import { VideoCallData } from "../videoClient";
|
||||
import { getFormattedMeetingId, getIntegrationName } from "./helpers";
|
||||
import { AdditionInformation } from "@lib/emails/EventMail";
|
||||
|
||||
import { CalendarEvent } from "../calendarClient";
|
||||
import { VideoCallData } from "../videoClient";
|
||||
import EventOrganizerMail from "./EventOrganizerMail";
|
||||
import { getFormattedMeetingId, getIntegrationName } from "./helpers";
|
||||
|
||||
export default class VideoEventOrganizerMail extends EventOrganizerMail {
|
||||
videoCallData: VideoCallData;
|
||||
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
import { serverConfig } from "../serverConfig";
|
||||
import nodemailer from "nodemailer";
|
||||
|
||||
import { serverConfig } from "../serverConfig";
|
||||
|
||||
export default function createInvitationEmail(data: any, options: any = {}) {
|
||||
return sendEmail(data, {
|
||||
provider: {
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
import { serverConfig } from "../serverConfig";
|
||||
import nodemailer, { SentMessageInfo } from "nodemailer";
|
||||
|
||||
import { serverConfig } from "../serverConfig";
|
||||
|
||||
const sendEmail = ({ to, subject, text, html = null }): Promise<string | SentMessageInfo> =>
|
||||
new Promise((resolve, reject) => {
|
||||
const { transport, from } = serverConfig;
|
||||
|
|
|
@ -1,13 +1,14 @@
|
|||
import { CalendarEvent, createEvent, updateEvent } from "@lib/calendarClient";
|
||||
import { Credential } from "@prisma/client";
|
||||
import async from "async";
|
||||
import { createMeeting, updateMeeting } from "@lib/videoClient";
|
||||
import prisma from "@lib/prisma";
|
||||
import { LocationType } from "@lib/location";
|
||||
import { v5 as uuidv5 } from "uuid";
|
||||
import merge from "lodash.merge";
|
||||
import { v5 as uuidv5 } from "uuid";
|
||||
|
||||
import { CalendarEvent, createEvent, updateEvent } from "@lib/calendarClient";
|
||||
import EventAttendeeMail from "@lib/emails/EventAttendeeMail";
|
||||
import EventAttendeeRescheduledMail from "@lib/emails/EventAttendeeRescheduledMail";
|
||||
import { LocationType } from "@lib/location";
|
||||
import prisma from "@lib/prisma";
|
||||
import { createMeeting, updateMeeting } from "@lib/videoClient";
|
||||
|
||||
export interface EventResult {
|
||||
type: string;
|
||||
|
|
|
@ -1,10 +1,13 @@
|
|||
import { useState, useEffect } from "react";
|
||||
import getSlots from "@lib/slots";
|
||||
import { User, SchedulingType } from "@prisma/client";
|
||||
import dayjs, { Dayjs } from "dayjs";
|
||||
import isBetween from "dayjs/plugin/isBetween";
|
||||
import utc from "dayjs/plugin/utc";
|
||||
import { useState, useEffect } from "react";
|
||||
|
||||
import getSlots from "@lib/slots";
|
||||
|
||||
import { FreeBusyTime } from "@components/ui/Schedule/Schedule";
|
||||
|
||||
dayjs.extend(isBetween);
|
||||
dayjs.extend(utc);
|
||||
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
import { IntegrationCalendar, CalendarApiAdapter, CalendarEvent } from "../../calendarClient";
|
||||
import { symmetricDecrypt } from "@lib/crypto";
|
||||
import { Credential } from "@prisma/client";
|
||||
import dayjs from "dayjs";
|
||||
import ICAL from "ical.js";
|
||||
import { createEvent, DurationObject, Attendee, Person } from "ics";
|
||||
import {
|
||||
createAccount,
|
||||
fetchCalendars,
|
||||
|
@ -9,14 +11,14 @@ import {
|
|||
updateCalendarObject,
|
||||
deleteCalendarObject,
|
||||
} from "tsdav";
|
||||
import { Credential } from "@prisma/client";
|
||||
import ICAL from "ical.js";
|
||||
import { createEvent, DurationObject, Attendee, Person } from "ics";
|
||||
import dayjs from "dayjs";
|
||||
import { v4 as uuidv4 } from "uuid";
|
||||
import { stripHtml } from "../../emails/helpers";
|
||||
|
||||
import { symmetricDecrypt } from "@lib/crypto";
|
||||
import logger from "@lib/logger";
|
||||
|
||||
import { IntegrationCalendar, CalendarApiAdapter, CalendarEvent } from "../../calendarClient";
|
||||
import { stripHtml } from "../../emails/helpers";
|
||||
|
||||
const log = logger.getChildLogger({ prefix: ["[[lib] apple calendar"] });
|
||||
|
||||
type EventBusyDate = Record<"start" | "end", Date>;
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
import { CalendarApiAdapter, CalendarEvent, IntegrationCalendar } from "../../calendarClient";
|
||||
import { symmetricDecrypt } from "@lib/crypto";
|
||||
import { Credential } from "@prisma/client";
|
||||
import dayjs from "dayjs";
|
||||
import ICAL from "ical.js";
|
||||
import { Attendee, createEvent, DurationObject, Person } from "ics";
|
||||
import {
|
||||
createAccount,
|
||||
createCalendarObject,
|
||||
|
@ -9,14 +11,14 @@ import {
|
|||
getBasicAuthHeaders,
|
||||
updateCalendarObject,
|
||||
} from "tsdav";
|
||||
import { Credential } from "@prisma/client";
|
||||
import ICAL from "ical.js";
|
||||
import { Attendee, createEvent, DurationObject, Person } from "ics";
|
||||
import dayjs from "dayjs";
|
||||
import { v4 as uuidv4 } from "uuid";
|
||||
import { stripHtml } from "../../emails/helpers";
|
||||
|
||||
import { symmetricDecrypt } from "@lib/crypto";
|
||||
import logger from "@lib/logger";
|
||||
|
||||
import { CalendarApiAdapter, CalendarEvent, IntegrationCalendar } from "../../calendarClient";
|
||||
import { stripHtml } from "../../emails/helpers";
|
||||
|
||||
const log = logger.getChildLogger({ prefix: ["[lib] caldav"] });
|
||||
|
||||
type EventBusyDate = Record<"start" | "end", Date>;
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue