From 800d40a606e9f08ac2262fab85422394fee863e4 Mon Sep 17 00:00:00 2001 From: Pontus Dreij Date: Mon, 18 Nov 2024 15:22:13 +0100 Subject: [PATCH 1/5] feat(SW-589): Added correct breakfastMessage, also fixed some small issues --- .../HotelReservation/HotelCard/index.tsx | 2 +- .../RoomSelection/RoomCard/index.tsx | 23 ++++++++++++++++--- .../RoomCard/roomCard.module.css | 13 +---------- i18n/dictionaries/da.json | 2 ++ i18n/dictionaries/de.json | 2 ++ i18n/dictionaries/en.json | 2 ++ i18n/dictionaries/fi.json | 2 ++ i18n/dictionaries/no.json | 2 ++ i18n/dictionaries/sv.json | 2 ++ 9 files changed, 34 insertions(+), 16 deletions(-) diff --git a/components/HotelReservation/HotelCard/index.tsx b/components/HotelReservation/HotelCard/index.tsx index 4c478d275..2873bfaeb 100644 --- a/components/HotelReservation/HotelCard/index.tsx +++ b/components/HotelReservation/HotelCard/index.tsx @@ -136,7 +136,7 @@ export default function HotelCard({ {hotelData.specialAlerts.length > 0 && (
{hotelData.specialAlerts.map((alert) => ( - + ))}
)} diff --git a/components/HotelReservation/SelectRate/RoomSelection/RoomCard/index.tsx b/components/HotelReservation/SelectRate/RoomSelection/RoomCard/index.tsx index fb713fddb..e2829a1d8 100644 --- a/components/HotelReservation/SelectRate/RoomSelection/RoomCard/index.tsx +++ b/components/HotelReservation/SelectRate/RoomSelection/RoomCard/index.tsx @@ -59,6 +59,25 @@ export default function RoomCard({ ?.generalTerms } + function getBreakfastInformation(rate: RateDefinition | undefined) { + return rateDefinitions.find((def) => def.rateCode === rate?.rateCode) + ?.breakfastIncluded + } + + const breakfastMessage = (rate: RateDefinition | undefined) => { + const breakfastInfo = getBreakfastInformation(rate) + switch (breakfastInfo) { + case true: + return intl.formatMessage({ id: "Breakfast is included." }) + case false: + return intl.formatMessage({ id: "Breakfast selection in next step." }) + default: + return intl.formatMessage({ + id: "Breakfast deal can be purchased at the hotel.", + }) + } + } + const petRoomPackage = (selectedPackages.includes(RoomPackageCodeEnum.PET_ROOM) && packages?.find((pkg) => pkg.code === RoomPackageCodeEnum.PET_ROOM)) || @@ -168,9 +187,7 @@ export default function RoomCard({
- {intl.formatMessage({ - id: "Breakfast selection in next step.", - })} + {breakfastMessage(rates.flexRate)} {roomConfiguration.status === "NotAvailable" ? (
diff --git a/components/HotelReservation/SelectRate/RoomSelection/RoomCard/roomCard.module.css b/components/HotelReservation/SelectRate/RoomSelection/RoomCard/roomCard.module.css index 8ec1978e6..8e32bdb1d 100644 --- a/components/HotelReservation/SelectRate/RoomSelection/RoomCard/roomCard.module.css +++ b/components/HotelReservation/SelectRate/RoomSelection/RoomCard/roomCard.module.css @@ -12,18 +12,7 @@ .card.noAvailability { justify-content: flex-start; -} - -.card.noAvailability:before { - background-color: rgba(0, 0, 0, 40%); - content: ""; - display: block; - position: absolute; - top: 0; - bottom: 0; - left: 0; - right: 0; - z-index: 2; + opacity: 0.6; } .specification { diff --git a/i18n/dictionaries/da.json b/i18n/dictionaries/da.json index c453589ea..441bb12f5 100644 --- a/i18n/dictionaries/da.json +++ b/i18n/dictionaries/da.json @@ -47,8 +47,10 @@ "Booking number": "Bookingnummer", "Breakfast": "Morgenmad", "Breakfast buffet": "Morgenbuffet", + "Breakfast deal can be purchased at the hotel.": "Morgenmad kan købes på hotellet.", "Breakfast excluded": "Morgenmad ikke inkluderet", "Breakfast included": "Morgenmad inkluderet", + "Breakfast is included.": "Morgenmad er inkluderet.", "Breakfast restaurant": "Breakfast restaurant", "Breakfast selection in next step.": "Valg af morgenmad i næste trin.", "Bus terminal": "Busstation", diff --git a/i18n/dictionaries/de.json b/i18n/dictionaries/de.json index 04d750494..118f5a1af 100644 --- a/i18n/dictionaries/de.json +++ b/i18n/dictionaries/de.json @@ -47,8 +47,10 @@ "Booking number": "Buchungsnummer", "Breakfast": "Frühstück", "Breakfast buffet": "Frühstücksbuffet", + "Breakfast deal can be purchased at the hotel.": "Frühstücksangebot kann im Hotel gekauft werden.", "Breakfast excluded": "Frühstück nicht inbegriffen", "Breakfast included": "Frühstück inbegriffen", + "Breakfast is included.": "Frühstück ist inbegriffen.", "Breakfast restaurant": "Breakfast restaurant", "Breakfast selection in next step.": "Frühstücksauswahl in nächsten Schritt.", "Bus terminal": "Busbahnhof", diff --git a/i18n/dictionaries/en.json b/i18n/dictionaries/en.json index 09cf02ec9..de63bafc6 100644 --- a/i18n/dictionaries/en.json +++ b/i18n/dictionaries/en.json @@ -51,8 +51,10 @@ "Booking number": "Booking number", "Breakfast": "Breakfast", "Breakfast buffet": "Breakfast buffet", + "Breakfast deal can be purchased at the hotel.": "Breakfast deal can be purchased at the hotel.", "Breakfast excluded": "Breakfast excluded", "Breakfast included": "Breakfast included", + "Breakfast is included.": "Breakfast is included.", "Breakfast restaurant": "Breakfast restaurant", "Breakfast selection in next step.": "Breakfast selection in next step.", "Bus terminal": "Bus terminal", diff --git a/i18n/dictionaries/fi.json b/i18n/dictionaries/fi.json index 64903ea74..39a3af66d 100644 --- a/i18n/dictionaries/fi.json +++ b/i18n/dictionaries/fi.json @@ -47,8 +47,10 @@ "Booking number": "Varausnumero", "Breakfast": "Aamiainen", "Breakfast buffet": "Aamiaisbuffet", + "Breakfast deal can be purchased at the hotel.": "Aamiaisdeali voidaan ostaa hotellissa.", "Breakfast excluded": "Aamiainen ei sisälly", "Breakfast included": "Aamiainen sisältyy", + "Breakfast is included.": "Aamiainen sisältyy.", "Breakfast restaurant": "Breakfast restaurant", "Breakfast selection in next step.": "Aamiaisvalinta seuraavassa vaiheessa.", "Bus terminal": "Bussiasema", diff --git a/i18n/dictionaries/no.json b/i18n/dictionaries/no.json index ef15b0823..c33cd1cee 100644 --- a/i18n/dictionaries/no.json +++ b/i18n/dictionaries/no.json @@ -47,8 +47,10 @@ "Booking number": "Bestillingsnummer", "Breakfast": "Frokost", "Breakfast buffet": "Breakfast buffet", + "Breakfast deal can be purchased at the hotel.": "Frokostdeal kan kjøpes på hotellet.", "Breakfast excluded": "Frokost ekskludert", "Breakfast included": "Frokost inkludert", + "Breakfast is included.": "Frokost er inkludert.", "Breakfast restaurant": "Breakfast restaurant", "Breakfast selection in next step.": "Frokostvalg i neste steg.", "Bus terminal": "Bussterminal", diff --git a/i18n/dictionaries/sv.json b/i18n/dictionaries/sv.json index 8be596fc1..e0f357729 100644 --- a/i18n/dictionaries/sv.json +++ b/i18n/dictionaries/sv.json @@ -47,8 +47,10 @@ "Booking number": "Bokningsnummer", "Breakfast": "Frukost", "Breakfast buffet": "Frukostbuffé", + "Breakfast deal can be purchased at the hotel.": "Frukostdeal kan köpas på hotellet.", "Breakfast excluded": "Frukost ingår ej", "Breakfast included": "Frukost ingår", + "Breakfast is included.": "Frukost ingår.", "Breakfast restaurant": "Breakfast restaurant", "Breakfast selection in next step.": "Frukostval i nästa steg.", "Bus terminal": "Bussterminal", From e7c7485ff869d43654bd1d615b06490d62faaeba Mon Sep 17 00:00:00 2001 From: Pontus Dreij Date: Mon, 18 Nov 2024 16:41:02 +0100 Subject: [PATCH 2/5] feat(SW-589) Updated after comments --- .../SelectRate/RoomSelection/RoomCard/index.tsx | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/components/HotelReservation/SelectRate/RoomSelection/RoomCard/index.tsx b/components/HotelReservation/SelectRate/RoomSelection/RoomCard/index.tsx index e2829a1d8..8cf0b5c21 100644 --- a/components/HotelReservation/SelectRate/RoomSelection/RoomCard/index.tsx +++ b/components/HotelReservation/SelectRate/RoomSelection/RoomCard/index.tsx @@ -59,13 +59,11 @@ export default function RoomCard({ ?.generalTerms } - function getBreakfastInformation(rate: RateDefinition | undefined) { - return rateDefinitions.find((def) => def.rateCode === rate?.rateCode) - ?.breakfastIncluded - } + const getBreakfastMessage = (rate: RateDefinition | undefined) => { + const breakfastInfo = rateDefinitions.find( + (def) => def.rateCode === rate?.rateCode + )?.breakfastIncluded - const breakfastMessage = (rate: RateDefinition | undefined) => { - const breakfastInfo = getBreakfastInformation(rate) switch (breakfastInfo) { case true: return intl.formatMessage({ id: "Breakfast is included." }) @@ -187,7 +185,7 @@ export default function RoomCard({
- {breakfastMessage(rates.flexRate)} + {getBreakfastMessage(rates.flexRate)} {roomConfiguration.status === "NotAvailable" ? (
From d86e11ac8589537b331a3f9e503551dd895fbdba Mon Sep 17 00:00:00 2001 From: Pontus Dreij Date: Mon, 18 Nov 2024 16:43:02 +0100 Subject: [PATCH 3/5] feat(SW-589) reverted change on hotel card for alert (this will be removed) --- components/HotelReservation/HotelCard/index.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/HotelReservation/HotelCard/index.tsx b/components/HotelReservation/HotelCard/index.tsx index 2873bfaeb..4c478d275 100644 --- a/components/HotelReservation/HotelCard/index.tsx +++ b/components/HotelReservation/HotelCard/index.tsx @@ -136,7 +136,7 @@ export default function HotelCard({ {hotelData.specialAlerts.length > 0 && (
{hotelData.specialAlerts.map((alert) => ( - + ))}
)} From d56d2f84728d1ef742b978094354f48fb520e3f5 Mon Sep 17 00:00:00 2001 From: Pontus Dreij Date: Mon, 18 Nov 2024 16:54:18 +0100 Subject: [PATCH 4/5] feat(SW-589) updated getRateDefinitionForRate --- .../SelectRate/RoomSelection/RoomCard/index.tsx | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/components/HotelReservation/SelectRate/RoomSelection/RoomCard/index.tsx b/components/HotelReservation/SelectRate/RoomSelection/RoomCard/index.tsx index 8cf0b5c21..a81e4169e 100644 --- a/components/HotelReservation/SelectRate/RoomSelection/RoomCard/index.tsx +++ b/components/HotelReservation/SelectRate/RoomSelection/RoomCard/index.tsx @@ -54,15 +54,12 @@ export default function RoomCard({ : undefined } - function getPriceInformationForRate(rate: RateDefinition | undefined) { + function getRateDefinitionForRate(rate: RateDefinition | undefined) { return rateDefinitions.find((def) => def.rateCode === rate?.rateCode) - ?.generalTerms } const getBreakfastMessage = (rate: RateDefinition | undefined) => { - const breakfastInfo = rateDefinitions.find( - (def) => def.rateCode === rate?.rateCode - )?.breakfastIncluded + const breakfastInfo = getRateDefinitionForRate(rate)?.breakfastIncluded switch (breakfastInfo) { case true: @@ -207,7 +204,7 @@ export default function RoomCard({ value={key.toLowerCase()} paymentTerm={key === "flexRate" ? payLater : payNow} product={findProductForRate(rate)} - priceInformation={getPriceInformationForRate(rate)} + priceInformation={getRateDefinitionForRate(rate)?.generalTerms} handleSelectRate={handleSelectRate} roomType={roomConfiguration.roomType} roomTypeCode={roomConfiguration.roomTypeCode} From 62442646f07f7c672f432d5dea3194d29a0f74d6 Mon Sep 17 00:00:00 2001 From: Pontus Dreij Date: Mon, 18 Nov 2024 16:55:17 +0100 Subject: [PATCH 5/5] feat(SW-589): updated breakfastIncluded --- .../SelectRate/RoomSelection/RoomCard/index.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/components/HotelReservation/SelectRate/RoomSelection/RoomCard/index.tsx b/components/HotelReservation/SelectRate/RoomSelection/RoomCard/index.tsx index a81e4169e..d69391122 100644 --- a/components/HotelReservation/SelectRate/RoomSelection/RoomCard/index.tsx +++ b/components/HotelReservation/SelectRate/RoomSelection/RoomCard/index.tsx @@ -59,9 +59,9 @@ export default function RoomCard({ } const getBreakfastMessage = (rate: RateDefinition | undefined) => { - const breakfastInfo = getRateDefinitionForRate(rate)?.breakfastIncluded + const breakfastIncluded = getRateDefinitionForRate(rate)?.breakfastIncluded - switch (breakfastInfo) { + switch (breakfastIncluded) { case true: return intl.formatMessage({ id: "Breakfast is included." }) case false: