Merged in fix/sw-3495-booking-flow-links-to-web (pull request #2837)

fix: (SW-3495): Update booking-flow links in partner-sas

* Update links to scandic web in booking-flow

* Fix routeToScandicWeb util function


Approved-by: Hrishikesh Vaipurkar
This commit is contained in:
Anton Gunnarsson
2025-09-22 13:30:38 +00:00
parent 630e89c845
commit c21d0dbc74
9 changed files with 70 additions and 23 deletions

View File

@@ -11,6 +11,10 @@ import { SessionProvider } from "next-auth/react"
import { BookingFlowConfig } from "@scandic-hotels/booking-flow/BookingFlowConfig"
import { NuqsAdapter } from "@scandic-hotels/booking-flow/utils/nuqs"
import { Lang } from "@scandic-hotels/common/constants/language"
import { bookingTermsAndConditionsRoutes } from "@scandic-hotels/common/constants/routes/bookingTermsAndConditionsRoutes"
import { customerService } from "@scandic-hotels/common/constants/routes/customerService"
import { myStay } from "@scandic-hotels/common/constants/routes/myStay"
import { privacyPolicyRoutes } from "@scandic-hotels/common/constants/routes/privacyPolicyRoutes"
import { ToastHandler } from "@scandic-hotels/design-system/ToastHandler"
import AdobeSDKScript from "@/components/AdobeSDKScript"
@@ -28,11 +32,12 @@ import { BookingFlowProviders } from "../../components/BookingFlowProviders"
import { Footer } from "../../components/Footer/Footer"
import { Header } from "../../components/Header/Header"
import type { LangRoute } from "@scandic-hotels/common/constants/routes/langRoute"
import type { Metadata } from "next"
export const metadata: Metadata = {
title: "SAS by Scandic Hotels",
description: "This text should be updated.",
description: "TODO This text should be updated.",
}
type LangParams = {
@@ -45,8 +50,6 @@ type RootLayoutProps = {
bookingwidget: React.ReactNode
}
const bookingFlowConfig = { bookingCodeEnabled: false } as const
export default async function RootLayout(props: RootLayoutProps) {
const params = await props.params
const lang = params.lang
@@ -56,6 +59,18 @@ export default async function RootLayout(props: RootLayoutProps) {
const parsedLanguage = setLang(lang)
const messages = await getMessages(parsedLanguage)
const bookingFlowConfig: BookingFlowConfig = {
bookingCodeEnabled: false,
routes: {
myStay: routeToScandicWeb(myStay),
bookingTermsAndConditions: routeToScandicWeb(
bookingTermsAndConditionsRoutes
),
customerService: routeToScandicWeb(customerService),
privacyPolicy: routeToScandicWeb(privacyPolicyRoutes),
},
}
return (
<html lang="en">
<head>
@@ -112,3 +127,11 @@ export default async function RootLayout(props: RootLayoutProps) {
</html>
)
}
function routeToScandicWeb(route: LangRoute) {
const url = `https://www.scandichotels.com`
return Object.entries(route).reduce((acc, [key, value]) => {
acc[key as Lang] = `${url}/${value}`
return acc
}, {} as LangRoute)
}

View File

@@ -1 +1,16 @@
export const bookingFlowConfig = { bookingCodeEnabled: true } as const
import { bookingTermsAndConditionsRoutes } from "@scandic-hotels/common/constants/routes/bookingTermsAndConditionsRoutes"
import { customerService } from "@scandic-hotels/common/constants/routes/customerService"
import { myStay } from "@scandic-hotels/common/constants/routes/myStay"
import { privacyPolicyRoutes } from "@scandic-hotels/common/constants/routes/privacyPolicyRoutes"
import type { BookingFlowConfig } from "@scandic-hotels/booking-flow/BookingFlowConfig"
export const bookingFlowConfig: BookingFlowConfig = {
bookingCodeEnabled: true,
routes: {
myStay,
customerService,
bookingTermsAndConditions: bookingTermsAndConditionsRoutes,
privacyPolicy: privacyPolicyRoutes,
},
}