From 8f9e26880234ed801f978544a13fa1d52e5ae327 Mon Sep 17 00:00:00 2001 From: Pontus Dreij Date: Thu, 20 Mar 2025 09:55:24 +0000 Subject: [PATCH] Merged in feat(SW-1944)-update-url-to-mystay (pull request #1566) feat(SW-1944) Update to correct URL to my stay (for my pages/my stays and confirmation page) * feat(SW-1944) Update to correct URL to my stay (for my pages/my stays and confirmation page) * feat(SW-1944) updated to RefId * feat(SW-1944) updated myStay path * feat(SW-1944) updated refId check Approved-by: Christian Andolf --- .../gla-payment-callback/page.tsx | 4 +- .../Confirmation/index.tsx | 3 +- .../Header/Actions/ManageBooking.tsx | 18 ++----- .../BookingConfirmation/Header/index.tsx | 12 +++-- .../BookingConfirmation/index.tsx | 7 ++- .../HotelReservation/FindMyBooking/index.tsx | 4 +- apps/scandic-web/constants/routes/myStay.js | 14 +++++ apps/scandic-web/next.config.js | 26 ++++++++++ .../routers/contentstack/metadata/output.ts | 9 ++++ apps/scandic-web/server/routers/user/utils.ts | 51 ++++++------------- .../actions/manageBooking.ts | 8 ++- .../bookingConfirmation.ts | 1 + .../bookingConfirmation/header.ts | 1 + 13 files changed, 93 insertions(+), 65 deletions(-) create mode 100644 apps/scandic-web/constants/routes/myStay.js diff --git a/apps/scandic-web/app/[lang]/(live)/(public)/hotelreservation/(payment-callback)/gla-payment-callback/page.tsx b/apps/scandic-web/app/[lang]/(live)/(public)/hotelreservation/(payment-callback)/gla-payment-callback/page.tsx index b029551ce..3268e2500 100644 --- a/apps/scandic-web/app/[lang]/(live)/(public)/hotelreservation/(payment-callback)/gla-payment-callback/page.tsx +++ b/apps/scandic-web/app/[lang]/(live)/(public)/hotelreservation/(payment-callback)/gla-payment-callback/page.tsx @@ -4,7 +4,7 @@ import { BookingErrorCodeEnum, PaymentCallbackStatusEnum, } from "@/constants/booking" -import { hotelreservation } from "@/constants/routes/hotelReservation" +import { myStay } from "@/constants/routes/myStay" import { serverClient } from "@/lib/trpc/server" import LoadingSpinner from "@/components/LoadingSpinner" @@ -27,7 +27,7 @@ export default async function GuaranteePaymentCallbackPage({ const status = searchParams.status const confirmationNumber = searchParams.confirmationNumber const refId = searchParams.refId - const myStayUrl = `${hotelreservation(lang)}/my-stay?RefId=${refId}` + const myStayUrl = `${myStay[lang]}?RefId=${refId}` if ( status === PaymentCallbackStatusEnum.Success && diff --git a/apps/scandic-web/components/HotelReservation/BookingConfirmation/Confirmation/index.tsx b/apps/scandic-web/components/HotelReservation/BookingConfirmation/Confirmation/index.tsx index 10c9258db..88b99038c 100644 --- a/apps/scandic-web/components/HotelReservation/BookingConfirmation/Confirmation/index.tsx +++ b/apps/scandic-web/components/HotelReservation/BookingConfirmation/Confirmation/index.tsx @@ -11,12 +11,13 @@ export default function Confirmation({ booking, hotel, children, + refId, }: React.PropsWithChildren) { const mainRef = useRef(null) return (
-
+
{children}
) diff --git a/apps/scandic-web/components/HotelReservation/BookingConfirmation/Header/Actions/ManageBooking.tsx b/apps/scandic-web/components/HotelReservation/BookingConfirmation/Header/Actions/ManageBooking.tsx index 45f7d3655..6924db6ca 100644 --- a/apps/scandic-web/components/HotelReservation/BookingConfirmation/Header/Actions/ManageBooking.tsx +++ b/apps/scandic-web/components/HotelReservation/BookingConfirmation/Header/Actions/ManageBooking.tsx @@ -1,23 +1,15 @@ "use client" import { useIntl } from "react-intl" -import { myBooking } from "@/constants/myBooking" -import { env } from "@/env/client" - import { EditIcon } from "@/components/Icons" import Button from "@/components/TempDesignSystem/Button" import Link from "@/components/TempDesignSystem/Link" -import useLang from "@/hooks/useLang" import type { ManageBookingProps } from "@/types/components/hotelReservation/bookingConfirmation/actions/manageBooking" -export default function ManageBooking({ - confirmationNumber, - lastName, -}: ManageBookingProps) { +export default function ManageBooking({ bookingUrl }: ManageBookingProps) { const intl = useIntl() - const lang = useLang() - const myBookingUrl = myBooking[env.NEXT_PUBLIC_NODE_ENV][lang] + return (