From 26d44a2c2977c8d5663989c4e57b47c632a51bab Mon Sep 17 00:00:00 2001 From: Linus Flood Date: Tue, 3 Dec 2024 08:19:47 +0100 Subject: [PATCH] Fixed bugs --- .../(live)/(public)/hotelreservation/(standard)/page.tsx | 1 + .../(standard)/select-hotel/@modal/(.)map/page.tsx | 1 + .../hotelreservation/(standard)/select-hotel/page.tsx | 4 +++- .../(public)/hotelreservation/(standard)/select-rate/page.tsx | 1 + .../hotelreservation/(standard)/step/enterDetailsTracking.tsx | 1 + .../(live)/(public)/hotelreservation/(standard)/step/page.tsx | 3 ++- server/routers/contentstack/accountPage/query.ts | 1 + server/routers/contentstack/collectionPage/query.ts | 1 + server/routers/contentstack/contentPage/query.ts | 1 + server/routers/contentstack/loyaltyPage/query.ts | 1 + types/components/tracking.ts | 2 +- 11 files changed, 14 insertions(+), 3 deletions(-) diff --git a/app/[lang]/(live)/(public)/hotelreservation/(standard)/page.tsx b/app/[lang]/(live)/(public)/hotelreservation/(standard)/page.tsx index 8e2fca10f..7b21164f7 100644 --- a/app/[lang]/(live)/(public)/hotelreservation/(standard)/page.tsx +++ b/app/[lang]/(live)/(public)/hotelreservation/(standard)/page.tsx @@ -26,6 +26,7 @@ export default function HotelReservationPage({ params }: PageArgs) { pageName: "hotelreservation", siteSections: "hotelreservation", pageType: "hotelreservationstartpage", + siteVersion: "new-web", } return ( diff --git a/app/[lang]/(live)/(public)/hotelreservation/(standard)/select-hotel/@modal/(.)map/page.tsx b/app/[lang]/(live)/(public)/hotelreservation/(standard)/select-hotel/@modal/(.)map/page.tsx index 980522754..63cdc2f3a 100644 --- a/app/[lang]/(live)/(public)/hotelreservation/(standard)/select-hotel/@modal/(.)map/page.tsx +++ b/app/[lang]/(live)/(public)/hotelreservation/(standard)/select-hotel/@modal/(.)map/page.tsx @@ -74,6 +74,7 @@ export default async function SelectHotelMapPage({ pageName: "hotelreservation|select-hotel|mapview", siteSections: "hotelreservation|select-hotel|mapview", pageType: "bookinghotelsmapviewpage", + siteVersion: "new-web", } const hotelsTrackingData: TrackingSDKHotelInfo = { diff --git a/app/[lang]/(live)/(public)/hotelreservation/(standard)/select-hotel/page.tsx b/app/[lang]/(live)/(public)/hotelreservation/(standard)/select-hotel/page.tsx index 2f8f21e37..a2fd1b287 100644 --- a/app/[lang]/(live)/(public)/hotelreservation/(standard)/select-hotel/page.tsx +++ b/app/[lang]/(live)/(public)/hotelreservation/(standard)/select-hotel/page.tsx @@ -36,6 +36,7 @@ import { setLang } from "@/i18n/serverContext" import styles from "./page.module.css" +import { ChildBedMapEnum } from "@/types/components/bookingWidget/enums" import type { HotelData } from "@/types/components/hotelReservation/selectHotel/hotelCardListingProps" import type { SelectHotelSearchParams } from "@/types/components/hotelReservation/selectHotel/selectHotelSearchParams" import { @@ -129,6 +130,7 @@ export default async function SelectHotelPage({ pageName: "hotelreservation|select-hotel", siteSections: "hotelreservation|select-hotel", pageType: "bookinghotelspage", + siteVersion: "new-web", } const hotelsTrackingData: TrackingSDKHotelInfo = { @@ -139,7 +141,7 @@ export default async function SelectHotelPage({ noOfAdults: adults, noOfChildren: child?.length, ageOfChildren: child?.map((c) => c.age).join(","), - childBedPreference: child?.map((c) => c.bed).join("|"), + childBedPreference: child?.map((c) => ChildBedMapEnum[c.bed]).join("|"), noOfRooms: 1, // // TODO: Handle multiple rooms duration: differenceInCalendarDays(departureDate, arrivalDate), leadTime: differenceInCalendarDays(arrivalDate, new Date()), diff --git a/app/[lang]/(live)/(public)/hotelreservation/(standard)/select-rate/page.tsx b/app/[lang]/(live)/(public)/hotelreservation/(standard)/select-rate/page.tsx index d1a03f9c3..74f85bda2 100644 --- a/app/[lang]/(live)/(public)/hotelreservation/(standard)/select-rate/page.tsx +++ b/app/[lang]/(live)/(public)/hotelreservation/(standard)/select-rate/page.tsx @@ -76,6 +76,7 @@ export default async function SelectRatePage({ pageName: "hotelreservation|select-rate", siteSections: "hotelreservation|select-rate", pageType: "bookingroomsandratespage", + siteVersion: "new-web", } const hotelsTrackingData: TrackingSDKHotelInfo = { diff --git a/app/[lang]/(live)/(public)/hotelreservation/(standard)/step/enterDetailsTracking.tsx b/app/[lang]/(live)/(public)/hotelreservation/(standard)/step/enterDetailsTracking.tsx index 42c6e0450..fbd213a73 100644 --- a/app/[lang]/(live)/(public)/hotelreservation/(standard)/step/enterDetailsTracking.tsx +++ b/app/[lang]/(live)/(public)/hotelreservation/(standard)/step/enterDetailsTracking.tsx @@ -86,6 +86,7 @@ export default function EnterDetailsTracking(props: Props) { pageName: `hotelreservation|${currentStep}`, siteSections: `hotelreservation|${currentStep}`, pageType: currentStep, + siteVersion: "new-web", } const trackingData = { diff --git a/app/[lang]/(live)/(public)/hotelreservation/(standard)/step/page.tsx b/app/[lang]/(live)/(public)/hotelreservation/(standard)/step/page.tsx index d8a86d6ed..2e9739dca 100644 --- a/app/[lang]/(live)/(public)/hotelreservation/(standard)/step/page.tsx +++ b/app/[lang]/(live)/(public)/hotelreservation/(standard)/step/page.tsx @@ -162,7 +162,8 @@ export default async function StepPage({ channel: TrackingChannelEnum["hotelreservation"], pageName: `hotelreservation|${searchParams.step}`, siteSections: `hotelreservation|${searchParams.step}`, - pageType: searchParams.step, // TODO: Change to correct + pageType: searchParams.step, + siteVersion: "new-web", } const initialHotelsTrackingData: TrackingSDKHotelInfo = { diff --git a/server/routers/contentstack/accountPage/query.ts b/server/routers/contentstack/accountPage/query.ts index 0c951552b..73b52c278 100644 --- a/server/routers/contentstack/accountPage/query.ts +++ b/server/routers/contentstack/accountPage/query.ts @@ -191,6 +191,7 @@ export const accountPageQueryRouter = router({ pageType: `member${parsedtitle}page`, pageName: validatedAccountPage.data.trackingProps.url, siteSections: validatedAccountPage.data.trackingProps.url, + siteVersion: "new-web", } return { diff --git a/server/routers/contentstack/collectionPage/query.ts b/server/routers/contentstack/collectionPage/query.ts index ae16f7a20..dcbe9da50 100644 --- a/server/routers/contentstack/collectionPage/query.ts +++ b/server/routers/contentstack/collectionPage/query.ts @@ -70,6 +70,7 @@ export const collectionPageQueryRouter = router({ pageType: "collectionpage", pageName: collectionPage.data.trackingProps.url, siteSections: collectionPage.data.trackingProps.url, + siteVersion: "new-web", } return { diff --git a/server/routers/contentstack/contentPage/query.ts b/server/routers/contentstack/contentPage/query.ts index 7435c764d..b277f1b8b 100644 --- a/server/routers/contentstack/contentPage/query.ts +++ b/server/routers/contentstack/contentPage/query.ts @@ -93,6 +93,7 @@ export const contentPageQueryRouter = router({ pageType: "staticcontentpage", pageName: contentPage.data.trackingProps.url, siteSections: contentPage.data.trackingProps.url, + siteVersion: "new-web", } return { diff --git a/server/routers/contentstack/loyaltyPage/query.ts b/server/routers/contentstack/loyaltyPage/query.ts index a31661cda..6b2c1b2bf 100644 --- a/server/routers/contentstack/loyaltyPage/query.ts +++ b/server/routers/contentstack/loyaltyPage/query.ts @@ -183,6 +183,7 @@ export const loyaltyPageQueryRouter = router({ pageType: "loyaltycontentpage", pageName: validatedLoyaltyPage.data.trackingProps.url, siteSections: validatedLoyaltyPage.data.trackingProps.url, + siteVersion: "new-web", } getLoyaltyPageSuccessCounter.add(1, metricsVariables) console.info( diff --git a/types/components/tracking.ts b/types/components/tracking.ts index 5273b92d3..bf048198e 100644 --- a/types/components/tracking.ts +++ b/types/components/tracking.ts @@ -18,7 +18,7 @@ export type TrackingSDKPageData = { domainLanguage: Lang pageType: string channel: TrackingChannel - siteVersion?: "new-web" + siteVersion: "new-web" pageName: string domain?: string siteSections: string