From d83411162d46ee27e57c9e6dcdaad5b1b8b1cfb2 Mon Sep 17 00:00:00 2001 From: Peer Richelsen Date: Fri, 6 Jan 2023 13:13:56 +0100 Subject: [PATCH] Upgrade to next 13.1 (#6265) Co-authored-by: zomars --- apps/api | 2 +- apps/console | 2 +- apps/docs/package.json | 2 +- apps/storybook/package.json | 2 +- apps/swagger/package.json | 2 +- apps/web/components/NavTabs.tsx | 2 +- apps/web/components/apps/App.tsx | 6 +- .../web/components/booking/AvailableTimes.tsx | 46 +- .../components/eventtype/EventAdvancedTab.tsx | 19 +- apps/web/components/ui/AvatarGroup.tsx | 8 +- apps/web/components/ui/LinkText.tsx | 22 - apps/web/components/ui/PoweredByCal.tsx | 35 +- apps/web/next.config.js | 6 + apps/web/package.json | 9 +- apps/web/pages/404.tsx | 94 ++- apps/web/pages/[user].tsx | 70 +-- apps/web/pages/apps/[slug]/index.tsx | 15 +- apps/web/pages/apps/categories/[category].tsx | 8 +- apps/web/pages/apps/categories/index.tsx | 34 +- apps/web/pages/auth/error.tsx | 2 +- apps/web/pages/auth/forgot-password/[id].tsx | 2 +- apps/web/pages/auth/forgot-password/index.tsx | 4 +- apps/web/pages/auth/login.tsx | 9 +- apps/web/pages/booking/[uid].tsx | 108 ++-- apps/web/pages/event-types/index.tsx | 120 ++-- apps/web/pages/team/[slug].tsx | 43 +- apps/website | 2 +- packages/app-store/_components/AppCard.tsx | 6 +- .../routing-forms/components/SingleForm.tsx | 19 +- .../pages/route-builder/[...appPages].tsx | 8 +- .../pages/how-to-use/[...appPages].tsx | 55 +- .../app-store/zapier/pages/setup/index.tsx | 4 +- packages/config/package.json | 2 +- .../bookings/UnconfirmedBookingBadge.tsx | 25 +- .../ee/teams/components/TeamListItem.tsx | 9 +- .../ee/teams/pages/team-profile-view.tsx | 6 +- .../components/EventWorkflowsTab.tsx | 12 +- .../workflows/components/WorkflowListPage.tsx | 94 ++- .../schedules/components/ScheduleListItem.tsx | 61 +- .../settings/layouts/SettingsLayout.tsx | 33 +- .../users/components/AdminPasswordBanner.tsx | 4 +- packages/ui/components/apps/Categories.tsx | 34 +- .../ui/components/breadcrumb/Breadcrumb.tsx | 6 +- packages/ui/components/button/Button.tsx | 2 +- packages/ui/components/credits/Credits.tsx | 12 +- packages/ui/components/list/List.tsx | 28 +- packages/ui/package.json | 2 +- packages/ui/v2/core/Card.tsx | 15 +- packages/ui/v2/core/Dropdown.tsx | 4 +- packages/ui/v2/core/Shell.tsx | 115 ++-- packages/ui/v2/core/Stepper.tsx | 6 +- packages/ui/v2/core/form/FormCard.tsx | 8 +- .../navigation/tabs/HorizontalTabItem.tsx | 45 +- .../core/navigation/tabs/VerticalTabItem.tsx | 75 +-- yarn.lock | 582 ++++++++++++------ 55 files changed, 1025 insertions(+), 921 deletions(-) delete mode 100644 apps/web/components/ui/LinkText.tsx diff --git a/apps/api b/apps/api index 9c23a8e5ab..2808b798df 160000 --- a/apps/api +++ b/apps/api @@ -1 +1 @@ -Subproject commit 9c23a8e5ab8ceb1af82beaa850609ed7fdc6a86e +Subproject commit 2808b798dfa64436eebd83b3705c7cafe4596446 diff --git a/apps/console b/apps/console index 2d577dd9ed..50ec8b8630 160000 --- a/apps/console +++ b/apps/console @@ -1 +1 @@ -Subproject commit 2d577dd9edd4216cd1920b0d348f94a335f28bb5 +Subproject commit 50ec8b86305dbd0abe7cfbfbf3459a334a9513a6 diff --git a/apps/docs/package.json b/apps/docs/package.json index e545255a40..89083b5cdf 100644 --- a/apps/docs/package.json +++ b/apps/docs/package.json @@ -17,7 +17,7 @@ "license": "MIT", "dependencies": { "iframe-resizer-react": "^1.1.0", - "next": "^12.3.1", + "next": "^13.1.1", "nextra": "^1.1.0", "nextra-theme-docs": "^1.2.2", "react": "^18.2.0", diff --git a/apps/storybook/package.json b/apps/storybook/package.json index 76a3110cb4..1b50f91c9a 100644 --- a/apps/storybook/package.json +++ b/apps/storybook/package.json @@ -20,7 +20,7 @@ "@radix-ui/react-slider": "^1.0.0", "@radix-ui/react-switch": "^1.0.0", "@radix-ui/react-tooltip": "^1.0.0", - "next": "^12.3.1", + "next": "^13.1.1", "react": "^18.2.0", "react-dom": "^18.2.0" }, diff --git a/apps/swagger/package.json b/apps/swagger/package.json index b1aebeb15d..6fa2dc8067 100644 --- a/apps/swagger/package.json +++ b/apps/swagger/package.json @@ -14,7 +14,7 @@ "dependencies": { "highlight.js": "^11.6.0", "isarray": "2.0.5", - "next": "^12.3.1", + "next": "^13.1.1", "openapi-snippet": "^0.13.0", "react": "^18.2.0", "react-dom": "^18.2.0", diff --git a/apps/web/components/NavTabs.tsx b/apps/web/components/NavTabs.tsx index 47eb0ac4f7..df04e07773 100644 --- a/apps/web/components/NavTabs.tsx +++ b/apps/web/components/NavTabs.tsx @@ -62,7 +62,7 @@ const NavTabs: FC = ({ tabs, linkProps, ...props }) => { const className = tab.className || ""; return ( - + {name}

- - {categories[0]} + + {categories[0]} {" "} • {t("published_by", { author })}

diff --git a/apps/web/components/booking/AvailableTimes.tsx b/apps/web/components/booking/AvailableTimes.tsx index b65b2d1fbd..daba4dd91e 100644 --- a/apps/web/components/booking/AvailableTimes.tsx +++ b/apps/web/components/booking/AvailableTimes.tsx @@ -114,29 +114,29 @@ const AvailableTimes: FC = ({ {!!seatsPerTimeSlot &&

{t("booking_full")}

} ) : ( - - - {dayjs(slot.time).tz(timeZone()).format(timeFormat)} - {!!seatsPerTimeSlot && ( -

= 0.8 - ? "text-rose-600" - : slot.attendees && slot.attendees / seatsPerTimeSlot >= 0.33 - ? "text-yellow-500" - : "text-emerald-400" - } text-sm`}> - {slot.attendees ? seatsPerTimeSlot - slot.attendees : seatsPerTimeSlot} /{" "} - {seatsPerTimeSlot} {t("seats_available")} -

- )} -
+ + {dayjs(slot.time).tz(timeZone()).format(timeFormat)} + {!!seatsPerTimeSlot && ( +

= 0.8 + ? "text-rose-600" + : slot.attendees && slot.attendees / seatsPerTimeSlot >= 0.33 + ? "text-yellow-500" + : "text-emerald-400" + } text-sm`}> + {slot.attendees ? seatsPerTimeSlot - slot.attendees : seatsPerTimeSlot} /{" "} + {seatsPerTimeSlot} {t("seats_available")} +

+ )} )} diff --git a/apps/web/components/eventtype/EventAdvancedTab.tsx b/apps/web/components/eventtype/EventAdvancedTab.tsx index df4f1c8173..b1c72d6153 100644 --- a/apps/web/components/eventtype/EventAdvancedTab.tsx +++ b/apps/web/components/eventtype/EventAdvancedTab.tsx @@ -93,10 +93,11 @@ export const EventAdvancedTab = ({ eventType, team }: Pick
- - - {t("add_another_calendar")} - + + {t("add_another_calendar")}
@@ -266,12 +267,10 @@ export const EventAdvancedTab = ({ eventType, team }: Pick {/*TODO: Extract it out into a component when used more than once*/} {!IS_SELF_HOSTED && ( - - - - Platform Only - - + + + Platform Only + )}
diff --git a/apps/web/components/ui/AvatarGroup.tsx b/apps/web/components/ui/AvatarGroup.tsx index f42b65d25c..acaaf90557 100644 --- a/apps/web/components/ui/AvatarGroup.tsx +++ b/apps/web/components/ui/AvatarGroup.tsx @@ -35,13 +35,7 @@ export const AvatarGroup = function AvatarGroup(props: AvatarGroupProps) { return (
  • - {item.href ? ( - - {avatar} - - ) : ( - avatar - )} + {item.href ? {avatar} : avatar}
  • ); } diff --git a/apps/web/components/ui/LinkText.tsx b/apps/web/components/ui/LinkText.tsx deleted file mode 100644 index 5deca4ca77..0000000000 --- a/apps/web/components/ui/LinkText.tsx +++ /dev/null @@ -1,22 +0,0 @@ -import Link from "next/link"; - -interface ILinkTextProps { - href: string; - children: React.ReactNode; - classNameChildren?: string; - target?: string; -} -/** - * This component had to be made in order to make i18n work with next/link - * @see https://github.com/i18next/react-i18next/issues/1090#issuecomment-615426145 - **/ -export const LinkText = (props: ILinkTextProps) => { - const { target, href, children, classNameChildren, ...moreProps } = props; - return ( - - - {children} - - - ); -}; diff --git a/apps/web/components/ui/PoweredByCal.tsx b/apps/web/components/ui/PoweredByCal.tsx index 702c41f13d..7bc8d526de 100644 --- a/apps/web/components/ui/PoweredByCal.tsx +++ b/apps/web/components/ui/PoweredByCal.tsx @@ -9,26 +9,21 @@ const PoweredByCal = () => { const isEmbed = useIsEmbed(); return ( ); diff --git a/apps/web/next.config.js b/apps/web/next.config.js index 5bf9ad5eb4..4c046f461d 100644 --- a/apps/web/next.config.js +++ b/apps/web/next.config.js @@ -89,6 +89,12 @@ const nextConfig = { eslint: { ignoreDuringBuilds: !!process.env.CI, }, + // TODO: We need to have all components in `@calcom/ui/components` in order to use this + // modularizeImports: { + // "@calcom/ui": { + // transform: "@calcom/ui/components/{{member}}", + // }, + // }, images: { unoptimized: true, }, diff --git a/apps/web/package.json b/apps/web/package.json index b5bd168100..a121df1f0c 100644 --- a/apps/web/package.json +++ b/apps/web/package.json @@ -67,6 +67,7 @@ "bcryptjs": "^2.4.3", "classnames": "^2.3.1", "dotenv-cli": "^6.0.0", + "eslint-config-next": "^13.1.1", "googleapis": "^84.0.0", "gray-matter": "^4.0.3", "handlebars": "^4.7.7", @@ -80,15 +81,15 @@ "memory-cache": "^0.2.0", "micro": "^9.4.1", "mime-types": "^2.1.35", - "next": "^12.3.1", + "next": "^13.1.1", "next-auth": "^4.10.3", - "next-axiom": "^0.10.0", + "next-axiom": "^0.16.0", "next-collect": "^0.2.1", "next-i18next": "^11.3.0", - "next-mdx-remote": "^4.1.0", + "next-mdx-remote": "^4.2.1", "next-seo": "^4.26.0", "next-themes": "^0.2.0", - "next-transpile-modules": "^9.0.0", + "next-transpile-modules": "^10.0.0", "nock": "^13.2.8", "nodemailer": "^6.7.8", "otplib": "^12.0.1", diff --git a/apps/web/pages/404.tsx b/apps/web/pages/404.tsx index 6b8b62233a..935f640a95 100644 --- a/apps/web/pages/404.tsx +++ b/apps/web/pages/404.tsx @@ -98,26 +98,26 @@ export default function Custom404() {
    - - - {t("contact_sales")} - - + + {t("contact_sales")} +
    @@ -243,26 +243,26 @@ export default function Custom404() {
    - - - {t("or_go_back_home")} - - + + {t("or_go_back_home")} +
    diff --git a/apps/web/pages/[user].tsx b/apps/web/pages/[user].tsx index db858d43f2..d43dbe54aa 100644 --- a/apps/web/pages/[user].tsx +++ b/apps/web/pages/[user].tsx @@ -1,6 +1,5 @@ import classNames from "classnames"; import { GetServerSidePropsContext } from "next"; -import dynamic from "next/dynamic"; import Link from "next/link"; import { useRouter } from "next/router"; import { useEffect } from "react"; @@ -60,25 +59,26 @@ export default function User(props: inferSSRProps & E key={index} className="dark:bg-darkgray-100 group relative border-b border-neutral-200 bg-white first:rounded-t-md last:rounded-b-md last:border-b-0 hover:bg-gray-50 dark:border-neutral-700 dark:hover:border-neutral-600"> - - -
    -

    {type.title}

    - -
    -
    - ({ - alt: user.name || "", - image: user.avatar || "", - }))} - /> -
    -
    + +
    +

    {type.title}

    + +
    +
    + ({ + alt: user.name || "", + image: user.avatar || "", + }))} + /> +
    ))} @@ -175,22 +175,20 @@ export default function User(props: inferSSRProps & E href={{ pathname: `/${user.username}/${type.slug}`, query, - }}> - { - sdkActionManager?.fire("eventTypeSelected", { - eventType: type, - }); - }} - className="block w-full p-5" - data-testid="event-type-link"> -
    -

    - {type.title} -

    -
    - -
    + }} + onClick={async () => { + sdkActionManager?.fire("eventTypeSelected", { + eventType: type, + }); + }} + className="block w-full p-5" + data-testid="event-type-link"> +
    +

    + {type.title} +

    +
    + )) diff --git a/apps/web/pages/apps/[slug]/index.tsx b/apps/web/pages/apps/[slug]/index.tsx index 5d96a7e93b..778ddf27a1 100644 --- a/apps/web/pages/apps/[slug]/index.tsx +++ b/apps/web/pages/apps/[slug]/index.tsx @@ -3,7 +3,7 @@ import matter from "gray-matter"; import { GetStaticPaths, GetStaticPropsContext } from "next"; import { MDXRemote } from "next-mdx-remote"; import { serialize } from "next-mdx-remote/serialize"; -import Image from "next/image"; +import Image, { ImageProps } from "next/legacy/image"; import Link from "next/link"; import path from "path"; @@ -16,13 +16,18 @@ import App from "@components/apps/App"; const components = { a: ({ href = "", ...otherProps }: JSX.IntrinsicElements["a"]) => ( - + ), - img: ({ src = "", alt = "", placeholder, ...rest }: JSX.IntrinsicElements["img"]) => ( - {alt} - ), + img: ({ + src = "", + alt = "", + placeholder, + ...rest + }: Partial< + Omit + > & { src?: string; alt?: string; placeholder?: string }) => {alt}, // @TODO: In v2 the slider isn't shown anymore. However, to ensure the v1 pages keep // working, this component is still rendered in the MDX content. To skip them in the v2 // content we have to render null here. In v2 the gallery is shown by directly diff --git a/apps/web/pages/apps/categories/[category].tsx b/apps/web/pages/apps/categories/[category].tsx index bc7faeccbe..0b5eb99aeb 100644 --- a/apps/web/pages/apps/categories/[category].tsx +++ b/apps/web/pages/apps/categories/[category].tsx @@ -20,10 +20,10 @@ export default function Apps({ apps }: InferGetStaticPropsType - - - {isLocaleReady ? t("app_store") : }{" "} - + + {isLocaleReady ? t("app_store") : }{" "} {category && ( diff --git a/apps/web/pages/apps/categories/index.tsx b/apps/web/pages/apps/categories/index.tsx index 94d17d8ac2..4667fc4d4f 100644 --- a/apps/web/pages/apps/categories/index.tsx +++ b/apps/web/pages/apps/categories/index.tsx @@ -11,28 +11,28 @@ export default function Apps({ categories }: InferGetStaticPropsType
    - - - - {isLocaleReady ? t("app_store") : }{" "} - + + + {isLocaleReady ? t("app_store") : }{" "}
    {categories.map((category) => ( - - -
    -

    {category.name}

    -

    - {t("number_apps", { count: category.count })}{" "} - -

    -
    -
    + +
    +

    {category.name}

    +

    + {t("number_apps", { count: category.count })}{" "} + +

    +
    ))}
    diff --git a/apps/web/pages/auth/error.tsx b/apps/web/pages/auth/error.tsx index 2ebb336dc6..2463015e5e 100644 --- a/apps/web/pages/auth/error.tsx +++ b/apps/web/pages/auth/error.tsx @@ -40,7 +40,7 @@ export default function Error() {
    - +
    diff --git a/apps/web/pages/auth/forgot-password/[id].tsx b/apps/web/pages/auth/forgot-password/[id].tsx index 5b42351893..ba4fec7760 100644 --- a/apps/web/pages/auth/forgot-password/[id].tsx +++ b/apps/web/pages/auth/forgot-password/[id].tsx @@ -81,7 +81,7 @@ export default function Page({ resetPasswordRequest, csrfToken }: Props) {

    {t("request_is_expired")}

    {t("request_is_expired_instructions")}

    - + - + + @@ -424,7 +421,7 @@ export const EventTypeList = ({ group, groupIndex, readOnly, types }: EventTypeL navigator.clipboard.writeText(calLink); showToast(t("link_copied"), "success"); }}> - {t("copy_link") as string} + {t("copy_link")} {isNativeShare ? ( @@ -445,7 +442,7 @@ export const EventTypeList = ({ group, groupIndex, readOnly, types }: EventTypeL .then(() => showToast(t("link_shared"), "success")) .catch(() => showToast(t("failed"), "error")); }}> - {t("share") as string} + {t("share")} ) : null} @@ -456,7 +453,7 @@ export const EventTypeList = ({ group, groupIndex, readOnly, types }: EventTypeL color="minimal" className="w-full rounded-none" StartIcon={Icon.FiEdit}> - {t("edit") as string} + {t("edit")} @@ -467,7 +464,7 @@ export const EventTypeList = ({ group, groupIndex, readOnly, types }: EventTypeL data-testid={"event-type-duplicate-" + type.id} StartIcon={Icon.FiCopy} onClick={() => openDuplicateModal(type)}> - {t("duplicate") as string} + {t("duplicate")} @@ -480,7 +477,7 @@ export const EventTypeList = ({ group, groupIndex, readOnly, types }: EventTypeL color="destructive" StartIcon={Icon.FiTrash} className="w-full rounded-none"> - {t("delete") as string} + {t("delete")} @@ -502,7 +499,7 @@ export const EventTypeList = ({ group, groupIndex, readOnly, types }: EventTypeL e.preventDefault(); deleteEventTypeHandler(deleteDialogTypeId); }}> - {t("delete_event_type_description") as string} + {t("delete_event_type_description")} @@ -517,36 +514,32 @@ const EventTypeListHeading = ({ return (
    - - - +
    - - {profile?.name || ""} + + {profile?.name || ""} {membershipCount && teamId && ( - - - - {membershipCount} - - + + + {membershipCount} + )} {profile?.slug && ( - - {`${CAL_URL?.replace("https://", "")}/${ - profile.slug - }`} + + {`${CAL_URL?.replace("https://", "")}/${profile.slug}`} )}
    @@ -581,10 +574,7 @@ const EventTypesPage = () => { return (
    - }> + }> } success={({ data }) => ( diff --git a/apps/web/pages/team/[slug].tsx b/apps/web/pages/team/[slug].tsx index 82a2a9ca06..b0c9d253d6 100644 --- a/apps/web/pages/team/[slug].tsx +++ b/apps/web/pages/team/[slug].tsx @@ -45,28 +45,29 @@ function TeamPage({ team }: TeamPageProps) { "dark:bg-darkgray-100 group relative border-b border-neutral-200 bg-white first:rounded-t-md last:rounded-b-md last:border-b-0 hover:bg-gray-50 dark:border-neutral-700 dark:hover:border-neutral-600", !isEmbed && "bg-white" )}> - - -
    -
    -

    {type.title}

    -
    - + +
    +
    + ({ + alt: user.name || "", + title: user.name || "", + image: CAL_URL + "/" + user.username + "/avatar.png" || "", + }))} + /> +
    ))} diff --git a/apps/website b/apps/website index ebcc470ae1..3c4abd2b92 160000 --- a/apps/website +++ b/apps/website @@ -1 +1 @@ -Subproject commit ebcc470ae19e41e6bee6d1f31af42379f24eefcb +Subproject commit 3c4abd2b9248b7199515e5c6d82447e810d557f4 diff --git a/packages/app-store/_components/AppCard.tsx b/packages/app-store/_components/AppCard.tsx index 5ca6c5998d..1350a2cf2a 100644 --- a/packages/app-store/_components/AppCard.tsx +++ b/packages/app-store/_components/AppCard.tsx @@ -32,10 +32,8 @@ export default function AppCard({
    {/* Don't know why but w-[42px] isn't working, started happening when I started using next/dynamic */} - - - {app?.name} - + + {app?.name}
    {app?.name} diff --git a/packages/app-store/ee/routing-forms/components/SingleForm.tsx b/packages/app-store/ee/routing-forms/components/SingleForm.tsx index 3f07ab484e..697a6c5ac5 100644 --- a/packages/app-store/ee/routing-forms/components/SingleForm.tsx +++ b/packages/app-store/ee/routing-forms/components/SingleForm.tsx @@ -14,8 +14,8 @@ import { } from "@calcom/types/AppGetServerSideProps"; import { Alert, - Button, Badge, + Button, ButtonGroup, Dialog, DialogClose, @@ -318,9 +318,7 @@ function SingleForm({ form, appUrl, Page }: SingleFormComponentProps) { return (
    - - {router.name} - + {router.name}
    ); @@ -342,9 +340,7 @@ function SingleForm({ form, appUrl, Page }: SingleFormComponentProps) { return (
    - - {router.name} - + {router.name}
    ); @@ -399,9 +395,12 @@ function SingleForm({ form, appUrl, Page }: SingleFormComponentProps) {
    {t("route_to")}:
    {RoutingPages.map((page) => { - if (page.value === decidedAction.type) { - return
    {page.label}
    ; - } + if (page.value !== decidedAction.type) return null; + return ( +
    + {page.label} +
    + ); })} :{" "} {decidedAction.type === "customPageMessage" ? ( diff --git a/packages/app-store/ee/routing-forms/pages/route-builder/[...appPages].tsx b/packages/app-store/ee/routing-forms/pages/route-builder/[...appPages].tsx index 625f887f66..88abacdf58 100644 --- a/packages/app-store/ee/routing-forms/pages/route-builder/[...appPages].tsx +++ b/packages/app-store/ee/routing-forms/pages/route-builder/[...appPages].tsx @@ -213,11 +213,9 @@ const Route = ({ className="mb-6">
    - - - {route.name} - - + + {route.name} +

    Fields available in {route.name} will be added to this form. diff --git a/packages/app-store/typeform/pages/how-to-use/[...appPages].tsx b/packages/app-store/typeform/pages/how-to-use/[...appPages].tsx index 3fdd0cd0ed..01b23ee7e7 100644 --- a/packages/app-store/typeform/pages/how-to-use/[...appPages].tsx +++ b/packages/app-store/typeform/pages/how-to-use/[...appPages].tsx @@ -18,7 +18,7 @@ export default function HowToUse() {

  • Make sure that you have{" "} - Routing Forms + Routing Forms {" "} app installed
  • @@ -26,39 +26,42 @@ export default function HowToUse() { Create a Routing Form with fields on the basis of which you want your typeform routing to work
  • - - - + +
  • Create a Typeform that you want to route through Cal.com form's routing
  • Add the copied URL as{" "} - - - + +
  • Use{" "} - - - + +
  • @@ -68,7 +71,7 @@ export default function HowToUse() { - +
    diff --git a/packages/app-store/zapier/pages/setup/index.tsx b/packages/app-store/zapier/pages/setup/index.tsx index 5677e70758..f1945c815b 100644 --- a/packages/app-store/zapier/pages/setup/index.tsx +++ b/packages/app-store/zapier/pages/setup/index.tsx @@ -103,7 +103,7 @@ export default function ZapierSetup(props: IZapierSetupProps) {
  • You're set!
  • - +
    @@ -113,7 +113,7 @@ export default function ZapierSetup(props: IZapierSetupProps) {
    {t("install_zapier_app")}
    - +
    diff --git a/packages/config/package.json b/packages/config/package.json index f58aa06ddf..9d0b277000 100644 --- a/packages/config/package.json +++ b/packages/config/package.json @@ -10,7 +10,7 @@ ], "dependencies": { "@calcom/eslint-plugin-eslint": "*", - "eslint-config-next": "^12.2.5", + "eslint-config-next": "^13.1.1", "eslint-config-prettier": "^8.5.0", "eslint-config-turbo": "^0.0.3", "eslint-plugin-playwright": "^0.9.0", diff --git a/packages/features/bookings/UnconfirmedBookingBadge.tsx b/packages/features/bookings/UnconfirmedBookingBadge.tsx index e776b5d6b9..f57fe48aad 100644 --- a/packages/features/bookings/UnconfirmedBookingBadge.tsx +++ b/packages/features/bookings/UnconfirmedBookingBadge.tsx @@ -8,18 +8,15 @@ export default function UnconfirmedBookingBadge() { const { t } = useLocale(); const { data: unconfirmedBookingCount } = trpc.viewer.bookingUnconfirmedCount.useQuery(); if (!unconfirmedBookingCount) return null; - else - return ( - - <> - - {unconfirmedBookingCount} - - - - ); + return ( + + + {unconfirmedBookingCount} + + + ); } diff --git a/packages/features/ee/teams/components/TeamListItem.tsx b/packages/features/ee/teams/components/TeamListItem.tsx index 5c7fed5dfb..b58a4dbb06 100644 --- a/packages/features/ee/teams/components/TeamListItem.tsx +++ b/packages/features/ee/teams/components/TeamListItem.tsx @@ -88,10 +88,11 @@ export default function TeamListItem(props: Props) { !isInvitee && "group hover:bg-neutral-50" )}> {!isInvitee ? ( - - - {teamInfo} - + + {teamInfo} ) : ( teamInfo diff --git a/packages/features/ee/teams/pages/team-profile-view.tsx b/packages/features/ee/teams/pages/team-profile-view.tsx index cef0bdb33c..52c448c5d1 100644 --- a/packages/features/ee/teams/pages/team-profile-view.tsx +++ b/packages/features/ee/teams/pages/team-profile-view.tsx @@ -263,10 +263,8 @@ const ProfileView = () => { )}
    - - - {t("preview")} - + + {t("preview")} {
    - - - - + +
    diff --git a/packages/features/ee/workflows/components/WorkflowListPage.tsx b/packages/features/ee/workflows/components/WorkflowListPage.tsx index bb36ad5b21..80e726ec85 100644 --- a/packages/features/ee/workflows/components/WorkflowListPage.tsx +++ b/packages/features/ee/workflows/components/WorkflowListPage.tsx @@ -84,58 +84,56 @@ export default function WorkflowListPage({ workflows }: Props) { {workflows.map((workflow) => (
  • - - -
    -
    - {workflow.name - ? workflow.name - : "Untitled (" + - `${t(`${workflow.steps[0].action.toLowerCase()}_action`)}` - .charAt(0) - .toUpperCase() + - `${t(`${workflow.steps[0].action.toLowerCase()}_action`)}`.slice(1) + - ")"} -
    -
      -
    • -
      - {getActionIcon(workflow.steps)} + +
      +
      + {workflow.name + ? workflow.name + : "Untitled (" + + `${t(`${workflow.steps[0].action.toLowerCase()}_action`)}` + .charAt(0) + .toUpperCase() + + `${t(`${workflow.steps[0].action.toLowerCase()}_action`)}`.slice(1) + + ")"} +
      +
        +
      • +
        + {getActionIcon(workflow.steps)} - {t("triggers")} - {workflow.timeUnit && workflow.time && ( - - {t(`${workflow.timeUnit.toLowerCase()}`, { count: workflow.time })} - - )} - {t(`${workflow.trigger.toLowerCase()}_trigger`)} -
        -
      • -
      • - {workflow.activeOn && workflow.activeOn.length > 0 ? ( - ( -

        {activeOn.eventType.title}

        - ))}> -
        -
        -
        - ) : ( + {t("triggers")} + {workflow.timeUnit && workflow.time && ( + + {t(`${workflow.timeUnit.toLowerCase()}`, { count: workflow.time })} + + )} + {t(`${workflow.trigger.toLowerCase()}_trigger`)} +
      +
    • +
    • + {workflow.activeOn && workflow.activeOn.length > 0 ? ( + ( +

      {activeOn.eventType.title}

      + ))}>
      - )} -
    • -
    -
    -
    + + ) : ( +
    +
    + )} +
  • + +
    diff --git a/packages/features/schedules/components/ScheduleListItem.tsx b/packages/features/schedules/components/ScheduleListItem.tsx index b294d57c1e..6874ec6981 100644 --- a/packages/features/schedules/components/ScheduleListItem.tsx +++ b/packages/features/schedules/components/ScheduleListItem.tsx @@ -40,36 +40,37 @@ export function ScheduleListItem({
  • - - -
    - {schedule.name} - {schedule.isDefault && ( - - {t("default")} - - )} -
    -

    - {schedule.availability - .filter((availability) => !!availability.days.length) - .map((availability) => ( - - {availabilityAsString(availability, { - locale: i18n.language, - hour12: displayOptions?.hour12, - })} -
    -
    - ))} - {schedule.timeZone && schedule.timeZone !== displayOptions?.timeZone && ( -

    - -  {schedule.timeZone} -

    - )} -

    -
    + +
    + {schedule.name} + {schedule.isDefault && ( + + {t("default")} + + )} +
    +

    + {schedule.availability + .filter((availability) => !!availability.days.length) + .map((availability) => ( + + {availabilityAsString(availability, { + locale: i18n.language, + hour12: displayOptions?.hour12, + })} +
    +
    + ))} + {schedule.timeZone && schedule.timeZone !== displayOptions?.timeZone && ( +

    + +  {schedule.timeZone} +

    + )} +

    diff --git a/packages/features/settings/layouts/SettingsLayout.tsx b/packages/features/settings/layouts/SettingsLayout.tsx index 49a3566cf8..cb06db1a4e 100644 --- a/packages/features/settings/layouts/SettingsLayout.tsx +++ b/packages/features/settings/layouts/SettingsLayout.tsx @@ -117,16 +117,15 @@ const useTabs = () => { const BackButtonInSidebar = ({ name }: { name: string }) => { return ( - - - - - {name} - - + + + + {name} + ); }; @@ -212,14 +211,12 @@ const SettingsSidebarContainer = ({
    - -
    - {tab && tab.icon && ( - - )} -

    {t(tab.name)}

    -
    -
    +
    + {tab && tab.icon && ( + + )} +

    {t(tab.name)}

    +
    {teams && teamMenuState && diff --git a/packages/features/users/components/AdminPasswordBanner.tsx b/packages/features/users/components/AdminPasswordBanner.tsx index 1bf42680d0..3ac73bd15d 100644 --- a/packages/features/users/components/AdminPasswordBanner.tsx +++ b/packages/features/users/components/AdminPasswordBanner.tsx @@ -16,8 +16,8 @@ function AdminPasswordBanner() { text={t("invalid_admin_password", { user: data.user.username })} variant="warning" actions={ - - {t("change_password_admin")} + + {t("change_password_admin")} } /> diff --git a/packages/ui/components/apps/Categories.tsx b/packages/ui/components/apps/Categories.tsx index 5b7d05da8e..1bd6497e8b 100644 --- a/packages/ui/components/apps/Categories.tsx +++ b/packages/ui/components/apps/Categories.tsx @@ -30,23 +30,23 @@ export function AppStoreCategories({ }, }} renderItem={(category) => ( - - -
    - {isLocaleReady ? ( -

    {category.name}

    - ) : ( - - )} -

    - {isLocaleReady ? t("number_apps", { count: category.count }) : }{" "} - -

    -
    -
    + +
    + {isLocaleReady ? ( +

    {category.name}

    + ) : ( + + )} +

    + {isLocaleReady ? t("number_apps", { count: category.count }) : }{" "} + +

    +
    )} /> diff --git a/packages/ui/components/breadcrumb/Breadcrumb.tsx b/packages/ui/components/breadcrumb/Breadcrumb.tsx index e6ec66654f..2b28a993b0 100644 --- a/packages/ui/components/breadcrumb/Breadcrumb.tsx +++ b/packages/ui/components/breadcrumb/Breadcrumb.tsx @@ -38,16 +38,14 @@ type BreadcrumbItemProps = { export const BreadcrumbItem = ({ children, href, listProps }: BreadcrumbItemProps) => { return (
  • - - {children} - + {children}
  • ); }; export const BreadcrumbContainer = () => { const router = useRouter(); - const [breadcrumbs, setBreadcrumbs] = useState<{ href: string; label: string }[]>(); + const [, setBreadcrumbs] = useState<{ href: string; label: string }[]>(); useEffect(() => { const rawPath = router.asPath.split("?")[0]; // this will ignore any query params for now? diff --git a/packages/ui/components/button/Button.tsx b/packages/ui/components/button/Button.tsx index e388a1421a..3a2b374a90 100644 --- a/packages/ui/components/button/Button.tsx +++ b/packages/ui/components/button/Button.tsx @@ -229,7 +229,7 @@ export const Button = forwardRef + {element} ) : ( diff --git a/packages/ui/components/credits/Credits.tsx b/packages/ui/components/credits/Credits.tsx index cf0549f495..e47603f379 100644 --- a/packages/ui/components/credits/Credits.tsx +++ b/packages/ui/components/credits/Credits.tsx @@ -18,16 +18,12 @@ export default function Credits() { return ( © {new Date().getFullYear()}{" "} - - - {COMPANY_NAME} - + + {COMPANY_NAME} {" "} {hasMounted && ( - - - {CalComVersion} - + + {CalComVersion} )} diff --git a/packages/ui/components/list/List.tsx b/packages/ui/components/list/List.tsx index 5b3697dfe2..207168d6f5 100644 --- a/packages/ui/components/list/List.tsx +++ b/packages/ui/components/list/List.tsx @@ -51,7 +51,7 @@ export function ListItem(props: ListItemProps) { ); return href ? ( - + {element} ) : ( @@ -79,19 +79,19 @@ export function ListLinkItem(props: ListLinkItemProps) { "group flex w-full items-center justify-between p-5 hover:bg-neutral-50", disabled ? "hover:bg-white" : "" )}> - - -

    {heading}

    -

    - {subHeading.substring(0, 100)} - {subHeading.length > 100 && "..."} -

    -
    {children}
    -
    + +

    {heading}

    +

    + {subHeading.substring(0, 100)} + {subHeading.length > 100 && "..."} +

    +
    {children}
    {actions} diff --git a/packages/ui/package.json b/packages/ui/package.json index f78f64801c..fcb3cea499 100644 --- a/packages/ui/package.json +++ b/packages/ui/package.json @@ -24,7 +24,7 @@ "@wojtekmaj/react-daterange-picker": "^3.3.1", "class-variance-authority": "^0.3.0", "downshift": "^6.1.9", - "next": "^12.3.1", + "next": "^13.1.1", "react": "^18.2.0", "react-colorful": "^5.6.0", "react-feather": "^2.0.10", diff --git a/packages/ui/v2/core/Card.tsx b/packages/ui/v2/core/Card.tsx index e0398a667d..6b42226115 100644 --- a/packages/ui/v2/core/Card.tsx +++ b/packages/ui/v2/core/Card.tsx @@ -129,14 +129,13 @@ export function Card({ {variant === "SidebarCard" && (
    {learnMore && ( - - - {learnMore.text} - + + {learnMore.text} )} diff --git a/packages/ui/v2/core/Stepper.tsx b/packages/ui/v2/core/Stepper.tsx index 387b6ed7ad..8f3877ba83 100644 --- a/packages/ui/v2/core/Stepper.tsx +++ b/packages/ui/v2/core/Stepper.tsx @@ -24,7 +24,11 @@ function Stepper(props: {
      {steps.map((mapStep, index) => (
    1. - + {index + 1 < props.step ? ( {mapStep.title} diff --git a/packages/ui/v2/core/form/FormCard.tsx b/packages/ui/v2/core/form/FormCard.tsx index 9f0284be84..32c1695c7c 100644 --- a/packages/ui/v2/core/form/FormCard.tsx +++ b/packages/ui/v2/core/form/FormCard.tsx @@ -56,13 +56,7 @@ export default function FormCard({ {label} {badge && ( - {badge.href ? ( - - {badge.text} - - ) : ( - badge.text - )} + {badge.href ? {badge.text} : badge.text} )}
    diff --git a/packages/ui/v2/core/navigation/tabs/HorizontalTabItem.tsx b/packages/ui/v2/core/navigation/tabs/HorizontalTabItem.tsx index e0f3fa2594..0b88f9bf6b 100644 --- a/packages/ui/v2/core/navigation/tabs/HorizontalTabItem.tsx +++ b/packages/ui/v2/core/navigation/tabs/HorizontalTabItem.tsx @@ -23,28 +23,29 @@ const HorizontalTabItem = function ({ name, href, linkProps, ...props }: Horizon const isCurrent = asPath.startsWith(href); return ( - - - {props.icon && ( - // eslint-disable-next-line @typescript-eslint/ban-ts-comment - //@ts-ignore - + + {props.icon && ( + // eslint-disable-next-line @typescript-eslint/ban-ts-comment + //@ts-ignore +