Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

perf: refactor and replacing viewer.teams.getMinimal with viewer.teams.get #20

Closed
wants to merge 6 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions apps/web/app/future/event-types/[type]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ import { _generateMetadata } from "app/_utils";
import { WithLayout } from "app/layoutHOC";
import { cookies, headers } from "next/headers";

import { EventType } from "@calcom/atoms/monorepo";

import { buildLegacyCtx } from "@lib/buildLegacyCtx";
import { getServerSideProps } from "@lib/event-types/[type]/getServerSideProps";
import type { PageProps as EventTypePageProps } from "@lib/event-types/[type]/getServerSideProps";

import EventTypePageWrapper from "~/event-types/views/event-types-single-view";

export const generateMetadata = async ({ params, searchParams }: PageProps) => {
const legacyCtx = buildLegacyCtx(headers(), cookies(), params, searchParams);
const { eventType } = await getData(legacyCtx);
Expand All @@ -21,5 +21,5 @@ export const generateMetadata = async ({ params, searchParams }: PageProps) => {
};

const getData = withAppDirSsr(getServerSideProps);
const Page = (props: EventTypePageProps) => <EventTypePageWrapper {...props} isAppDir={true} />;
const Page = ({ type, ...rest }: EventTypePageProps) => <EventType {...rest} id={type} isAppDir={true} />;
export default WithLayout({ getLayout: null, getData, Page })<"P">;
33 changes: 3 additions & 30 deletions apps/web/modules/event-types/views/event-types-single-view.tsx
Original file line number Diff line number Diff line change
@@ -1,38 +1,11 @@
"use client";

import { EventType } from "@calcom/features/eventtypes/components/EventType";
import { EventTypeAppDir } from "@calcom/features/eventtypes/components/EventTypeAppDir";
import type { EventTypeSetupProps } from "@calcom/features/eventtypes/lib/types";

/* eslint-disable @typescript-eslint/no-empty-function */
// eslint-disable-next-line @calcom/eslint/deprecated-imports-next-router
import { trpc } from "@calcom/trpc/react";
import { EventType } from "@calcom/atoms/monorepo";

import type { PageProps } from "@lib/event-types/[type]/getServerSideProps";

const EventTypePageWrapper = (props: PageProps & { isAppDir?: boolean }) => {
const { data } = trpc.viewer.eventTypes.get.useQuery({ id: props.type });

if (!data) return null;

const eventType = data.eventType;

const { data: workflows } = trpc.viewer.workflows.getAllActiveWorkflows.useQuery({
eventType: {
id: props.type,
teamId: eventType.teamId,
userId: eventType.userId,
parent: eventType.parent,
metadata: eventType.metadata,
},
});

const propsData = {
...(data as EventTypeSetupProps),
allActiveWorkflows: workflows,
};

return props.isAppDir ? <EventTypeAppDir {...propsData} /> : <EventType {...propsData} />;
const EventTypePageWrapper = ({ type, ...rest }: PageProps) => {
return <EventType {...rest} id={type} isAppDir={false} />;
};

export default EventTypePageWrapper;
2 changes: 1 addition & 1 deletion apps/web/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@calcom/web",
"version": "4.5.0",
"version": "4.5.1",
"private": true,
"scripts": {
"analyze": "ANALYZE=true next build",
Expand Down
6 changes: 3 additions & 3 deletions apps/web/public/static/locales/ar/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -2369,13 +2369,13 @@
"success_entry_created": "تم إنشاء إدخال جديد بنجاح",
"booking_redirect_email_subject": "إشعار إعادة توجيه الحجز",
"booking_redirect_email_title": "إشعار إعادة توجيه الحجز",
"booking_redirect_email_description": "لقد تلقيت إعادة توجيه للحجز من {{eventOwner}} بحيث سيتم إعادة توجيه روابط ملفهم الشخصي إلى ملفك الشخصي للفترة الزمنية: \"{{dates}}\"",
"booking_redirect_email_description": "لقد تلقيت إعادة توجيه حجز من {{eventOwner}}، لذا سيتم إعادة توجيه روابط ملفهم الشخصي إلى ملفك الشخصي خلال الفترة الزمنية {{dates}}.",
"booking_redirect_updated_email_subject": "إشعار تعديل إعادة توجيه الحجز",
"booking_redirect_updated_email_title": "إشعار تعديل إعادة توجيه الحجز",
"booking_redirect_updated_email_description": "تم تعديل إعادة توجيه الحجز الخاصة بك من {{eventOwner}} للفترة الزمنية \"{{oldDates}}\". الفترة الزمنية الجديدة لإعادة التوجيه هي: \"{{dates}}\"",
"booking_redirect_updated_email_description": "تم تحديث إعادة توجيه الحجز الخاصة بك من {{eventOwner}} للفترة الزمنية {{oldDates}}. الفترة الزمنية الجديدة لإعادة التوجيه هي {{dates}}.",
"booking_redirect_cancelled_email_subject": "إشعار إلغاء إعادة توجيه الحجز",
"booking_redirect_cancelled_email_title": "إشعار إلغاء إعادة توجيه الحجز",
"booking_redirect_cancelled_email_description": "تم إلغاء إعادة توجيه الحجز الخاصة بك من {{eventOwner}} للفترة الزمنية \"{{dates}}\".",
"booking_redirect_cancelled_email_description": "تم إلغاء إعادة توجيه الحجز الخاصة بك من {{eventOwner}} للفترة الزمنية {{dates}}.",
"success_accept_booking_redirect": "لقد قبلت طلب إعادة توجيه الحجز هذا.",
"success_reject_booking_redirect": "لقد رفضت طلب إعادة توجيه الحجز هذا.",
"copy_link_booking_redirect_request": "نسخ الرابط لمشاركة الطلب",
Expand Down
6 changes: 3 additions & 3 deletions apps/web/public/static/locales/az/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -2369,13 +2369,13 @@
"success_entry_created": "Yeni giriş uğurla yaradıldı",
"booking_redirect_email_subject": "Yönləndirmə bildirişi",
"booking_redirect_email_title": "Yönləndirmə Bildirişi",
"booking_redirect_email_description": "{{eventOwner}} tərəfindən yönləndirmə aldınız, beləliklə onların profil bağlantıları \"{{dates}}\" intervalı üçün sizə yönləndiriləcək",
"booking_redirect_email_description": "{{eventOwner}} tərəfindən sizə bir yönləndirmə göndərilib, beləliklə onların profil linkləri {{dates}} müddətində sizin profilinizə yönləndiriləcək.",
"booking_redirect_updated_email_subject": "Yönləndirmə redaktəsi bildirişi",
"booking_redirect_updated_email_title": "Yönləndirmə Redaktəsi Bildirişi",
"booking_redirect_updated_email_description": "{{eventOwner}} tərəfindən \"{{oldDates}}\" intervalı üçün yönləndirməniz yenilənib. Yeni yönləndirmə intervalı: \"{{dates}}\"",
"booking_redirect_updated_email_description": "{{eventOwner}} tərəfindən {{oldDates}} müddətində olan yönləndirməniz yenilənib. Yeni yönləndirmə müddəti {{dates}} olaraq dəyişdirilib.",
"booking_redirect_cancelled_email_subject": "Yönləndirmə ləğv bildirişi",
"booking_redirect_cancelled_email_title": "Yönləndirmə Ləğv Bildirişi",
"booking_redirect_cancelled_email_description": "{{eventOwner}} tərəfindən \"{{dates}}\" intervalı üçün yönləndirməniz ləğv edilib.",
"booking_redirect_cancelled_email_description": "{{eventOwner}} tərəfindən {{dates}} müddətində olan yönləndirməniz ləğv edilib.",
"success_accept_booking_redirect": "Yönləndirmə sorğusunu qəbul etdiniz.",
"success_reject_booking_redirect": "Yönləndirmə sorğusunu rədd etdiniz.",
"copy_link_booking_redirect_request": "Sorğunu paylaşmaq üçün linki kopyalayın",
Expand Down
6 changes: 3 additions & 3 deletions apps/web/public/static/locales/cs/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -2369,13 +2369,13 @@
"success_entry_created": "Nový záznam byl úspěšně vytvořen",
"booking_redirect_email_subject": "Oznámení o přesměrování rezervace",
"booking_redirect_email_title": "Oznámení o přesměrování rezervace",
"booking_redirect_email_description": "Obdrželi jste přesměrování rezervace od {{eventOwner}}, takže jejich profilové odkazy budou přesměrovány na váš pro časový interval: \"{{dates}}\"",
"booking_redirect_email_description": "Obdrželi jste přesměrování rezervace od {{eventOwner}}, takže jejich profilové odkazy budou po dobu intervalu {{dates}} přesměrovány na váš profil.",
"booking_redirect_updated_email_subject": "Oznámení o úpravě přesměrování rezervace",
"booking_redirect_updated_email_title": "Oznámení o úpravě přesměrování rezervace",
"booking_redirect_updated_email_description": "Vaše přesměrování rezervace od {{eventOwner}} pro interval \"{{oldDates}}\" bylo aktualizováno. Nový časový interval pro přesměrování je: \"{{dates}}\"",
"booking_redirect_updated_email_description": "Vaše přesměrování rezervace od {{eventOwner}} pro časový interval {{oldDates}} bylo aktualizováno. Nový časový interval pro přesměrování je {{dates}}.",
"booking_redirect_cancelled_email_subject": "Oznámení o zrušení přesměrování rezervace",
"booking_redirect_cancelled_email_title": "Oznámení o zrušení přesměrování rezervace",
"booking_redirect_cancelled_email_description": "Vaše přesměrování rezervace od {{eventOwner}} pro časový interval \"{{dates}}\" bylo zrušeno.",
"booking_redirect_cancelled_email_description": "Vaše přesměrování rezervace od {{eventOwner}} pro časový interval {{dates}} bylo zrušeno.",
"success_accept_booking_redirect": "Přijali jste tuto žádost o přesměrování rezervace.",
"success_reject_booking_redirect": "Odmítli jste tuto žádost o přesměrování rezervace.",
"copy_link_booking_redirect_request": "Zkopírovat odkaz pro sdílení žádosti",
Expand Down
6 changes: 3 additions & 3 deletions apps/web/public/static/locales/da/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -2369,13 +2369,13 @@
"success_entry_created": "Ny indtastning oprettet med succes",
"booking_redirect_email_subject": "Booking-omdirigeringsmeddelelse",
"booking_redirect_email_title": "Omdirigeringsmeddelelse for booking",
"booking_redirect_email_description": "Du har modtaget en omdirigering af booking fra {{eventOwner}}, så deres profil-links vil blive omdirigeret til dine i tidsintervallet: \"{{dates}}\"",
"booking_redirect_email_description": "Du har modtaget en omdirigering af booking fra {{eventOwner}}, så deres profil-links vil blive omdirigeret til dine i tidsintervallet {{dates}}.",
"booking_redirect_updated_email_subject": "Redigeringsmeddelelse for bookingomdirigering",
"booking_redirect_updated_email_title": "Redigeringsmeddelelse for bookingomdirigering",
"booking_redirect_updated_email_description": "Din bookingomdirigering fra {{eventOwner}} for intervallet \"{{oldDates}}\" er blevet opdateret. Nyt tidsinterval for omdirigeringen er: \"{{dates}}\"",
"booking_redirect_updated_email_description": "Din omdirigering af booking fra {{eventOwner}} for tidsintervallet {{oldDates}} er blevet opdateret. Nyt tidsinterval for omdirigeringen er {{dates}}.",
"booking_redirect_cancelled_email_subject": "Annulleringsmeddelelse for bookingomdirigering",
"booking_redirect_cancelled_email_title": "Annulleringsmeddelelse for bookingomdirigering",
"booking_redirect_cancelled_email_description": "Din bookingomdirigering fra {{eventOwner}} for tidsintervallet \"{{dates}}\" er blevet annulleret.",
"booking_redirect_cancelled_email_description": "Din omdirigering af booking fra {{eventOwner}} for tidsintervallet {{dates}} er blevet annulleret.",
"success_accept_booking_redirect": "Du har accepteret denne anmodning om bookingomdirigering.",
"success_reject_booking_redirect": "Du har afvist denne anmodning om bookingomdirigering.",
"copy_link_booking_redirect_request": "Kopiér link for at dele anmodning",
Expand Down
6 changes: 3 additions & 3 deletions apps/web/public/static/locales/de/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -2369,13 +2369,13 @@
"success_entry_created": "Neuer Eintrag wurde erfolgreich erstellt",
"booking_redirect_email_subject": "Buchungsumleitungsbenachrichtigung",
"booking_redirect_email_title": "Buchungsumleitungsbenachrichtigung",
"booking_redirect_email_description": "Sie haben eine Buchungsumleitung von {{eventOwner}} erhalten. Deren Profillinks werden für den Zeitraum: \"{{dates}}\" auf Ihr Profil umgeleitet.",
"booking_redirect_email_description": "Sie haben eine Buchungsumleitung von {{eventOwner}} erhalten. Deren Profillinks werden für den Zeitraum {{dates}} auf Ihre umgeleitet.",
"booking_redirect_updated_email_subject": "Benachrichtigung über Änderung der Buchungsumleitung",
"booking_redirect_updated_email_title": "Benachrichtigung über Änderung der Buchungsumleitung",
"booking_redirect_updated_email_description": "Ihre Buchungsumleitung von {{eventOwner}} für den Zeitraum \"{{oldDates}}\" wurde aktualisiert. Der neue Zeitraum für die Umleitung ist: \"{{dates}}\"",
"booking_redirect_updated_email_description": "Ihre Buchungsumleitung von {{eventOwner}} für den Zeitraum {{oldDates}} wurde aktualisiert. Der neue Zeitraum für die Umleitung ist {{dates}}.",
"booking_redirect_cancelled_email_subject": "Benachrichtigung über Stornierung der Buchungsumleitung",
"booking_redirect_cancelled_email_title": "Benachrichtigung über Stornierung der Buchungsumleitung",
"booking_redirect_cancelled_email_description": "Ihre Buchungsumleitung von {{eventOwner}} für den Zeitraum \"{{dates}}\" wurde storniert.",
"booking_redirect_cancelled_email_description": "Ihre Buchungsumleitung von {{eventOwner}} für den Zeitraum {{dates}} wurde storniert.",
"success_accept_booking_redirect": "Sie haben diese Buchungsumleitungsanfrage akzeptiert.",
"success_reject_booking_redirect": "Sie haben diese Buchungsumleitungsanfrage abgelehnt.",
"copy_link_booking_redirect_request": "Link zum Teilen der Anfrage kopieren",
Expand Down
6 changes: 3 additions & 3 deletions apps/web/public/static/locales/en/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -2369,13 +2369,13 @@
"success_entry_created": "Successfully created a new entry",
"booking_redirect_email_subject": "Booking redirect notification",
"booking_redirect_email_title": "Booking Redirect Notification",
"booking_redirect_email_description": "You have received a booking redirection from {{eventOwner}} so their profile links will be redirect to yours for the time interval: \"{{dates}}\"",
"booking_redirect_email_description": "You have received a booking redirection from {{eventOwner}} so their profile links will be redirect to yours for the time interval {{dates}}.",
"booking_redirect_updated_email_subject": "Booking redirect edit notification",
"booking_redirect_updated_email_title": "Booking Redirect Edit Notification",
"booking_redirect_updated_email_description": "Your booking redirection from {{eventOwner}} for interval \"{{oldDates}}\" have been udpated. New time interval for the redirection is: \"{{dates}}\"",
"booking_redirect_updated_email_description": "Your booking redirection from {{eventOwner}} for the time interval {{oldDates}} has been udpated. New time interval for the redirection is {{dates}}.",
"booking_redirect_cancelled_email_subject": "Booking redirect cancel notification",
"booking_redirect_cancelled_email_title": "Booking Redirect Cancel Notification",
"booking_redirect_cancelled_email_description": "Your booking redirection from {{eventOwner}}, for time interval \"{{dates}}\" have been cancelled.",
"booking_redirect_cancelled_email_description": "Your booking redirection from {{eventOwner}}, for time interval {{dates}} has been canceled.",
"success_accept_booking_redirect": "You have accepted this booking redirect request.",
"success_reject_booking_redirect": "You have rejected this booking redirect request.",
"copy_link_booking_redirect_request": "Copy link to share request",
Expand Down
6 changes: 3 additions & 3 deletions apps/web/public/static/locales/es-419/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -2369,13 +2369,13 @@
"success_entry_created": "Entrada creada exitosamente",
"booking_redirect_email_subject": "Notificación de redirección de reservas",
"booking_redirect_email_title": "Notificación de Redirección de Reservas",
"booking_redirect_email_description": "Has recibido una redirección de reserva de {{eventOwner}} para que los enlaces de su perfil se redirijan al tuyo durante el intervalo de tiempo: \"{{dates}}\"",
"booking_redirect_email_description": "Has recibido una redirección de reserva de {{eventOwner}}, por lo que los enlaces de su perfil se redirigirán al tuyo durante el intervalo de tiempo {{dates}}.",
"booking_redirect_updated_email_subject": "Notificación de edición de redirección de reserva",
"booking_redirect_updated_email_title": "Notificación de Edición de Redirección de Reserva",
"booking_redirect_updated_email_description": "La redirección de tu reserva de {{eventOwner}} para el intervalo \"{{oldDates}}\" ha sido actualizada. El nuevo intervalo de tiempo para la redirección es: \"{{dates}}\"",
"booking_redirect_updated_email_description": "Tu redirección de reserva de {{eventOwner}} para el intervalo de tiempo {{oldDates}} ha sido actualizada. El nuevo intervalo de tiempo para la redirección es {{dates}}.",
"booking_redirect_cancelled_email_subject": "Notificación de cancelación de redirección de reserva",
"booking_redirect_cancelled_email_title": "Notificación de Cancelación de Redirección de Reserva",
"booking_redirect_cancelled_email_description": "La redirección de tu reserva de {{eventOwner}}, para el intervalo de tiempo \"{{dates}}\" ha sido cancelada.",
"booking_redirect_cancelled_email_description": "Tu redirección de reserva de {{eventOwner}} para el intervalo de tiempo {{dates}} ha sido cancelada.",
"success_accept_booking_redirect": "Has aceptado esta solicitud de redirección de reservas.",
"success_reject_booking_redirect": "Has rechazado esta solicitud de redirección de reservas.",
"copy_link_booking_redirect_request": "Copiar enlace para compartir solicitud",
Expand Down
6 changes: 3 additions & 3 deletions apps/web/public/static/locales/es/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -2369,13 +2369,13 @@
"success_entry_created": "Entrada creada con éxito",
"booking_redirect_email_subject": "Notificación de redirección de reserva",
"booking_redirect_email_title": "Notificación de Redirección de Reserva",
"booking_redirect_email_description": "Has recibido una redirección de reserva de {{eventOwner}} para que sus enlaces de perfil se redirijan al tuyo durante el intervalo de tiempo: \"{{dates}}\"",
"booking_redirect_email_description": "Has recibido una redirección de reserva de {{eventOwner}}, por lo que los enlaces de su perfil se redirigirán al tuyo durante el intervalo de tiempo {{dates}}.",
"booking_redirect_updated_email_subject": "Notificación de edición de redirección de reserva",
"booking_redirect_updated_email_title": "Notificación de Edición de Redirección de Reserva",
"booking_redirect_updated_email_description": "La redirección de tu reserva de {{eventOwner}} para el intervalo \"{{oldDates}}\" ha sido actualizada. El nuevo intervalo de tiempo para la redirección es: \"{{dates}}\"",
"booking_redirect_updated_email_description": "Tu redirección de reserva de {{eventOwner}} para el intervalo de tiempo {{oldDates}} ha sido actualizada. El nuevo intervalo de tiempo para la redirección es {{dates}}.",
"booking_redirect_cancelled_email_subject": "Notificación de cancelación de redirección de reserva",
"booking_redirect_cancelled_email_title": "Notificación de Cancelación de Redirección de Reserva",
"booking_redirect_cancelled_email_description": "La redirección de tu reserva de {{eventOwner}}, para el intervalo de tiempo \"{{dates}}\" ha sido cancelada.",
"booking_redirect_cancelled_email_description": "Tu redirección de reserva de {{eventOwner}} para el intervalo de tiempo {{dates}} ha sido cancelada.",
"success_accept_booking_redirect": "Has aceptado esta solicitud de redirección de reserva.",
"success_reject_booking_redirect": "Has rechazado esta solicitud de redirección de reserva.",
"copy_link_booking_redirect_request": "Copiar enlace para compartir solicitud",
Expand Down
Loading
Loading