Skip to content

Commit ae87fdc

Browse files
sean-brydonkeithwillcodeanikdhabaldevin-ai-integration[bot]
authored
perf: rename eventTypes.heavy to eventTypesHeavy (#24630)
* Rename eventTypes.heavy to eventTypesHeavy * Update eventTypes lib types * Remove trpc and trpc client heavy resolve endpoint * Update shared file * Fix comments * Rename path * Fix wait for URL path * Fix API endpoint in event-types.e2e.ts test * fix: Import WorkflowType from enums instead of client The WorkflowType enum should be imported from @calcom/prisma/enums rather than @calcom/prisma/client. This was causing integration tests to fail with 'Cannot read properties of undefined (reading EVENT_TYPE)' because the enum wasn't being properly exported from the client. This fixes the remaining integration test failures after the Prisma 6.16 upgrade. Co-Authored-By: [email protected] <[email protected]> --------- Co-authored-by: Keith Williams <[email protected]> Co-authored-by: Anik Dhabal Babu <[email protected]> Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Co-authored-by: [email protected] <[email protected]>
1 parent 35e29c4 commit ae87fdc

File tree

23 files changed

+34
-47
lines changed

23 files changed

+34
-47
lines changed

apps/web/app/_trpc/trpc-client.ts

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ const resolveEndpoint = (links: any) => {
1515
// to the correct API endpoints.
1616
// - viewer.me - 2 segment paths like this are for logged in requests
1717
// - viewer.public.i18n - 3 segments paths can be public or authed
18-
// - viewer.eventTypes.heavy.create - 4 segments paths for heavy sub-router
1918
// eslint-disable-next-line @typescript-eslint/no-explicit-any
2019
return (ctx: any) => {
2120
const parts = ctx.op.path.split(".");
@@ -24,11 +23,7 @@ const resolveEndpoint = (links: any) => {
2423
if (parts.length == 2) {
2524
endpoint = parts[0] as keyof typeof links;
2625
path = parts[1];
27-
} else if (parts.length >= 3 && parts[2] === "heavy") {
28-
endpoint = parts[1] + "/heavy" as keyof typeof links;
29-
path = parts[3];
30-
}
31-
else {
26+
} else {
3227
endpoint = parts[1] as keyof typeof links;
3328
path = parts.splice(2, parts.length - 2).join(".");
3429
}

apps/web/components/getting-started/steps-views/UserProfile.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ const UserProfile = ({ user }: UserProfileProps) => {
3838
const [imageSrc, setImageSrc] = useState<string>(user?.avatar || "");
3939
const utils = trpc.useUtils();
4040
const router = useRouter();
41-
const createEventType = trpc.viewer.eventTypes.heavy.create.useMutation();
41+
const createEventType = trpc.viewer.eventTypesHeavy.create.useMutation();
4242
const telemetry = useTelemetry();
4343
const [firstRender, setFirstRender] = useState(true);
4444

apps/web/modules/apps/installation/[[...step]]/step-view.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ const OnboardingPage = ({
177177
// eslint-disable-next-line react-hooks/exhaustive-deps
178178
}, [eventTypeGroups]);
179179

180-
const updateMutation = trpc.viewer.eventTypes.heavy.update.useMutation({
180+
const updateMutation = trpc.viewer.eventTypesHeavy.update.useMutation({
181181
onSuccess: async (data) => {
182182
showToast(t("event_type_updated_successfully", { eventTypeTitle: data.eventType?.title }), "success");
183183
},

apps/web/modules/event-types/views/event-types-listing-view.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,7 @@ export const InfiniteEventTypeList = ({
271271
},
272272
});
273273

274-
const setHiddenMutation = trpc.viewer.eventTypes.heavy.update.useMutation({
274+
const setHiddenMutation = trpc.viewer.eventTypesHeavy.update.useMutation({
275275
onMutate: async (data) => {
276276
await utils.viewer.eventTypes.getEventTypesFromGroup.cancel();
277277
const previousValue = utils.viewer.eventTypes.getEventTypesFromGroup.getInfiniteData({
File renamed without changes.

apps/web/playwright/dynamic-booking-pages.e2e.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ test("multiple duration selection updates event length correctly", async ({ page
113113
await page.getByTestId("vertical-tab-event_advanced_tab_title").click();
114114
await page.fill('[name="eventName"]', "{Event duration} event btwn {Organiser} {Scheduler}");
115115
await page.locator('[data-testid="update-eventtype"]').click();
116-
await page.waitForResponse("/api/trpc/eventTypes/heavy/update?batch=1");
116+
await page.waitForResponse("/api/trpc/eventTypesHeavy/update?batch=1");
117117
});
118118

119119
await page.goto(`/${user.username}/multiple-duration`);

apps/web/playwright/event-types.e2e.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ test.describe("Event Types tests", () => {
131131
expect(formTitle).toBe(firstTitle);
132132
expect(formSlug).toContain(firstSlug);
133133

134-
const submitPromise = page.waitForResponse("/api/trpc/eventTypes/heavy/duplicate?batch=1");
134+
const submitPromise = page.waitForResponse("/api/trpc/eventTypesHeavy/duplicate?batch=1");
135135
await page.getByTestId("continue").click();
136136
const response = await submitPromise;
137137
expect(response.status()).toBe(200);
@@ -144,7 +144,7 @@ test.describe("Event Types tests", () => {
144144
await page.waitForURL((url) => {
145145
return !!url.pathname.match(/\/event-types\/.+/);
146146
});
147-
await submitAndWaitForResponse(page, "/api/trpc/eventTypes/heavy/update?batch=1", {
147+
await submitAndWaitForResponse(page, "/api/trpc/eventTypesHeavy/update?batch=1", {
148148
action: () => page.locator("[data-testid=update-eventtype]").click(),
149149
});
150150
});
@@ -167,7 +167,7 @@ test.describe("Event Types tests", () => {
167167
await page.locator("[data-testid=add-location]").click();
168168
await fillLocation(page, locationData[2], 2);
169169

170-
await submitAndWaitForResponse(page, "/api/trpc/eventTypes/heavy/update?batch=1", {
170+
await submitAndWaitForResponse(page, "/api/trpc/eventTypesHeavy/update?batch=1", {
171171
action: () => page.locator("[data-testid=update-eventtype]").click(),
172172
});
173173

@@ -314,7 +314,7 @@ test.describe("Event Types tests", () => {
314314
const locationAddress = "New Delhi";
315315

316316
await fillLocation(page, locationAddress, 0, false);
317-
await submitAndWaitForResponse(page, "/api/trpc/eventTypes/heavy/update?batch=1", {
317+
await submitAndWaitForResponse(page, "/api/trpc/eventTypesHeavy/update?batch=1", {
318318
action: () => page.locator("[data-testid=update-eventtype]").click(),
319319
});
320320

@@ -429,7 +429,7 @@ test.describe("Event Types tests", () => {
429429
await page.locator('[aria-label="Timezone Select"]').fill("New York");
430430
await page.keyboard.press("Enter");
431431

432-
await submitAndWaitForResponse(page, "/api/trpc/eventTypes/heavy/update?batch=1", {
432+
await submitAndWaitForResponse(page, "/api/trpc/eventTypesHeavy/update?batch=1", {
433433
action: () => page.locator("[data-testid=update-eventtype]").click(),
434434
});
435435
await page.goto("/event-types");

apps/web/playwright/fixtures/regularBookings.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ export function createBookingPageFixture(page: Page) {
5050
await page.goto("/event-types");
5151
},
5252
updateEventType: async () => {
53-
await submitAndWaitForResponse(page, "/api/trpc/eventTypes/heavy/update?batch=1", {
53+
await submitAndWaitForResponse(page, "/api/trpc/eventTypesHeavy/update?batch=1", {
5454
action: () => page.locator("[data-testid=update-eventtype]").click(),
5555
});
5656
},

apps/web/playwright/hash-my-url.e2e.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ test.describe("private links creation and usage", () => {
4242
const $url = await page.locator('[data-testid="private-link-url"]').inputValue();
4343

4444
// click update
45-
await submitAndWaitForResponse(page, "/api/trpc/eventTypes/heavy/update?batch=1", {
45+
await submitAndWaitForResponse(page, "/api/trpc/eventTypesHeavy/update?batch=1", {
4646
action: () => page.locator("[data-testid=update-eventtype]").click(),
4747
});
4848
// book using generated url hash
@@ -74,7 +74,7 @@ test.describe("private links creation and usage", () => {
7474
await page.locator("[data-testid=event-slug]").first().fill("somethingrandom");
7575
await expect(page.locator('[data-testid="event-slug"]').first()).toHaveValue("somethingrandom");
7676

77-
await submitAndWaitForResponse(page, "/api/trpc/eventTypes/heavy/update?batch=1", {
77+
await submitAndWaitForResponse(page, "/api/trpc/eventTypesHeavy/update?batch=1", {
7878
action: () => page.locator("[data-testid=update-eventtype]").click(),
7979
});
8080
await page.locator("[data-testid=vertical-tab-event_advanced_tab_title]").click();
@@ -113,7 +113,7 @@ test.describe("private links creation and usage", () => {
113113
await page.locator('[data-testid="private-link-expiration-settings-save"]').click();
114114
await page.waitForLoadState("networkidle");
115115
// click update
116-
await submitAndWaitForResponse(page, "/api/trpc/eventTypes/heavy/update?batch=1", {
116+
await submitAndWaitForResponse(page, "/api/trpc/eventTypesHeavy/update?batch=1", {
117117
action: () => page.locator("[data-testid=update-eventtype]").click(),
118118
});
119119
// book using generated url hash
@@ -164,7 +164,7 @@ test.describe("private links creation and usage", () => {
164164
await page.locator('[data-testid="private-link-expiration-settings-save"]').click();
165165
await page.waitForLoadState("networkidle");
166166
// click update
167-
await submitAndWaitForResponse(page, "/api/trpc/eventTypes/heavy/update?batch=1", {
167+
await submitAndWaitForResponse(page, "/api/trpc/eventTypesHeavy/update?batch=1", {
168168
action: () => page.locator("[data-testid=update-eventtype]").click(),
169169
});
170170
// book using generated url hash

apps/web/playwright/lib/testUtils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -476,7 +476,7 @@ export async function gotoBookingPage(page: Page) {
476476
}
477477

478478
export async function saveEventType(page: Page) {
479-
await submitAndWaitForResponse(page, "/api/trpc/eventTypes/heavy/update?batch=1", {
479+
await submitAndWaitForResponse(page, "/api/trpc/eventTypesHeavy/update?batch=1", {
480480
action: () => page.locator("[data-testid=update-eventtype]").click(),
481481
});
482482
}

0 commit comments

Comments
 (0)