Rename /success to /manage and fix link in calendar event (#5719)

* fix need to make changes link in calendar event

* change /success link to /manage

* delete success.tsx file and use next.js rewrites

* fix e2e tests

* remove not needed waitForNavigation

* fix e2e tests

* rename manage?uid to booking/uid

* fix rewrite

* remove not needed export

* fix rescheduling e2e tests

* Minor fixes/cleannup

* Update BookingPage.tsx

* Moves cancel page to rewrite

Co-authored-by: CarinaWolli <[email protected]>
Co-authored-by: Peer Richelsen <[email protected]>
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
Co-authored-by: zomars <[email protected]>
This commit is contained in:
authored and GitHub committed 2022-11-29 20:27:29 +00:00
1 parent 0c746ec10f
commit dff49ec28a
15 files changed
+46 -62

No files matched your search

@@ -1,7 +1,7 @@
import { createEvent, DateArray, Person } from "ics";
import dayjs from "@calcom/dayjs";
import { getCancelLink } from "@calcom/lib/CalEventParser";
import { getManageLink } from "@calcom/lib/CalEventParser";
import type { CalendarEvent } from "@calcom/types/Calendar";
import { renderEmail } from "..";
@@ -89,7 +89,7 @@ ${this.t("request_reschedule_subtitle", {
})},
${this.getWhen()}
${this.t("need_to_reschedule_or_cancel")}
${getCancelLink(this.calEvent)}
${getManageLink(this.calEvent)}
`.replace(/(<([^>]+)>)/gi, "");
}
}
@@ -81,9 +81,7 @@ export default function PaymentComponent(props: Props) {
error: new Error(`Payment failed: ${payload.error.message}`),
});
} else {
const params: { [k: string]: any } = {
uid: props.bookingUid,
};
const params: { [k: string]: any } = {};
if (props.location) {
if (props.location.includes("integration")) {
@@ -94,7 +92,7 @@ export default function PaymentComponent(props: Props) {
}
const query = stringify(params);
const successUrl = `/success?${query}`;
const successUrl = `/booking/${props.bookingUid}?${query}`;
await router.push(successUrl);
}
+8 -9
View File
@@ -123,21 +123,20 @@ export const getProviderName = (calEvent: CalendarEvent): string => {
return "";
};
export const getManageLink = (calEvent: CalendarEvent) => {
return `
${calEvent.organizer.language.translate("need_to_reschedule_or_cancel")}
${getCancelLink(calEvent)}
`;
};
export const getUid = (calEvent: CalendarEvent): string => {
return calEvent.uid ?? translator.fromUUID(uuidv5(JSON.stringify(calEvent), uuidv5.URL));
};
export const getManageLink = (calEvent: CalendarEvent) => {
return `
${calEvent.organizer.language.translate("need_to_reschedule_or_cancel")}
${WEBAPP_URL + "/booking/" + getUid(calEvent) + "?changes=true"}
`;
};
export const getCancelLink = (calEvent: CalendarEvent): string => {
return (
WEBAPP_URL +
`/success?uid=${getUid(calEvent)}&cancel=true&allRemainingBookings=${!!calEvent.recurringEvent}`
WEBAPP_URL + `/booking/${getUid(calEvent)}?cancel=true&allRemainingBookings=${!!calEvent.recurringEvent}`
);
};