From 4c23700d52d7a77882de3e204b30e204f987d9d8 Mon Sep 17 00:00:00 2001 From: Simon Emanuelsson Date: Mon, 17 Feb 2025 15:10:48 +0100 Subject: [PATCH] feat: adjust select rate ui to latest design --- .../(standard)/select-hotel/utils.ts | 10 +- .../HotelListing/HotelListingItem/utils.ts | 2 +- .../HotelListing/HotelListingItem/index.tsx | 2 +- .../HotelPage/IntroSection/types.ts | 3 +- .../SidePeeks/AboutTheHotel/index.tsx | 2 +- components/ContentType/HotelPage/index.tsx | 8 +- .../BookingConfirmation/Header/index.tsx | 2 +- .../SelectedRoom/ToggleSidePeek.tsx | 3 +- .../HotelReservation/HotelCard/index.tsx | 2 +- .../MyStay/ManageStay/ActionPanel/index.tsx | 2 +- .../SelectRate/HotelInfoCard/index.tsx | 2 +- .../SelectedRoomPanel/index.tsx | 31 ++-- .../selectedRoomPanel.module.css | 61 ++++---- .../Rooms/MultiRoomWrapper/index.tsx | 50 ++++-- .../multiRoomWrapper.module.css | 26 +-- .../FlexibilityOption/PriceList/index.tsx | 26 +-- .../flexibilityOption.module.css | 11 ++ .../RoomCard/FlexibilityOption/index.tsx | 4 +- .../RoomSelectionPanel/RoomCard/RoomSize.tsx | 36 +++-- .../RoomSelectionPanel/RoomCard/index.tsx | 148 +++++++++--------- .../RoomCard/roomCard.module.css | 130 +++++++-------- .../Rooms/RoomSelectionPanel/index.tsx | 18 +-- .../roomSelectionPanel.module.css | 6 - components/ParkingInformation/index.tsx | 24 +-- .../TempDesignSystem/Button/button.module.css | 14 ++ components/TempDesignSystem/Button/index.tsx | 2 + .../TempDesignSystem/Button/variants.ts | 4 + .../TempDesignSystem/Chip/chip.module.css | 22 ++- components/TempDesignSystem/Chip/index.tsx | 8 +- components/TempDesignSystem/Chip/variants.ts | 6 + i18n/dictionaries/da.json | 4 +- i18n/dictionaries/de.json | 4 +- i18n/dictionaries/en.json | 5 +- i18n/dictionaries/fi.json | 4 +- i18n/dictionaries/no.json | 4 +- i18n/dictionaries/sv.json | 4 +- providers/RoomProvider.tsx | 2 + server/routers/contentstack/metadata/utils.ts | 2 +- server/routers/hotels/query.ts | 20 +-- .../routers/hotels/schemas/additionalData.ts | 78 --------- server/routers/hotels/schemas/hotel.ts | 47 +++--- .../routers/hotels/schemas/hotel/address.ts | 10 +- .../schemas/hotel/contactInformation.ts | 13 +- .../routers/hotels/schemas/hotel/content.ts | 54 +++---- .../hotels/schemas/hotel/detailedFacility.ts | 25 +-- server/routers/hotels/schemas/hotel/facts.ts | 61 ++------ .../routers/hotels/schemas/hotel/gallery.ts | 8 - .../hotels/schemas/hotel/healthFacilities.ts | 64 +++++--- .../schemas/hotel/include/additionalData.ts | 48 ++++++ .../include/additionalData/displayWebPage.ts | 8 + .../hotel/include/additionalData/facility.ts | 13 ++ .../hotel/include/additionalData/gallery.ts | 13 ++ .../additionalData/restaurantsOverviewPage.ts | 10 ++ .../additionalData/specialNeedGroups.ts | 14 ++ .../hotels/schemas/hotel/include/include.ts | 5 +- .../schemas/hotel/include/roomCategories.ts | 35 +++-- .../schemas/hotel/merchantInformation.ts | 4 +- .../routers/hotels/schemas/hotel/parking.ts | 42 ++--- server/routers/hotels/schemas/hotel/poi.ts | 19 ++- server/routers/hotels/schemas/hotel/rating.ts | 52 ++++-- .../hotels/schemas/hotel/rewardNight.ts | 6 +- .../hotels/schemas/hotel/socialMedia.ts | 6 +- .../hotels/schemas/hotel/specialAlerts.ts | 3 +- .../hotels/schemas/hotel/specialNeedGroups.ts | 11 -- server/routers/hotels/schemas/image.ts | 25 +-- server/routers/hotels/utils.ts | 1 - stores/select-rate/index.ts | 22 ++- .../selectHotel/hotelFilters.ts | 11 +- .../hotelReservation/selectHotel/map.ts | 7 +- .../hotelReservation/toggleSidePeekProps.ts | 1 + types/components/image.ts | 2 - types/contexts/room.ts | 1 + types/hotel.ts | 16 +- types/stores/rates.ts | 1 + utils/zod/arrayValidator.ts | 17 ++ utils/zod/stringValidator.ts | 6 + 76 files changed, 819 insertions(+), 654 deletions(-) delete mode 100644 server/routers/hotels/schemas/additionalData.ts delete mode 100644 server/routers/hotels/schemas/hotel/gallery.ts create mode 100644 server/routers/hotels/schemas/hotel/include/additionalData.ts create mode 100644 server/routers/hotels/schemas/hotel/include/additionalData/displayWebPage.ts create mode 100644 server/routers/hotels/schemas/hotel/include/additionalData/facility.ts create mode 100644 server/routers/hotels/schemas/hotel/include/additionalData/gallery.ts create mode 100644 server/routers/hotels/schemas/hotel/include/additionalData/restaurantsOverviewPage.ts create mode 100644 server/routers/hotels/schemas/hotel/include/additionalData/specialNeedGroups.ts delete mode 100644 server/routers/hotels/schemas/hotel/specialNeedGroups.ts create mode 100644 utils/zod/arrayValidator.ts diff --git a/app/[lang]/(live)/(public)/hotelreservation/(standard)/select-hotel/utils.ts b/app/[lang]/(live)/(public)/hotelreservation/(standard)/select-hotel/utils.ts index cd0be320c..d54df6248 100644 --- a/app/[lang]/(live)/(public)/hotelreservation/(standard)/select-hotel/utils.ts +++ b/app/[lang]/(live)/(public)/hotelreservation/(standard)/select-hotel/utils.ts @@ -11,10 +11,8 @@ import type { HotelData, NullableHotelData, } from "@/types/components/hotelReservation/selectHotel/hotelCardListingProps" -import type { - CategorizedFilters, - Filter, -} from "@/types/components/hotelReservation/selectHotel/hotelFilters" +import type { CategorizedFilters } from "@/types/components/hotelReservation/selectHotel/hotelFilters" +import type { DetailedFacility } from "@/types/hotel" import type { HotelsAvailabilityItem } from "@/types/trpc/routers/hotel/availability" const hotelSurroundingsFilterNames = [ @@ -111,9 +109,9 @@ export function getFiltersFromHotels(hotels: HotelData[]): CategorizedFilters { }) const uniqueFilterIds = [...new Set(filters.map((filter) => filter.id))] - const filterList: Filter[] = uniqueFilterIds + const filterList: DetailedFacility[] = uniqueFilterIds .map((filterId) => filters.find((filter) => filter.id === filterId)) - .filter((filter): filter is Filter => filter !== undefined) + .filter((filter): filter is DetailedFacility => filter !== undefined) .sort((a, b) => b.sortOrder - a.sortOrder) return filterList.reduce( diff --git a/components/Blocks/HotelListing/HotelListingItem/utils.ts b/components/Blocks/HotelListing/HotelListingItem/utils.ts index 750ed39fc..9b07381a2 100644 --- a/components/Blocks/HotelListing/HotelListingItem/utils.ts +++ b/components/Blocks/HotelListing/HotelListingItem/utils.ts @@ -8,7 +8,7 @@ export function getTypeSpecificInformation( const { images } = hotel.hotelContent const { descriptions, meetingDescription } = hotel.hotelContent.texts const hotelData = { - description: descriptions.short, + description: descriptions?.short, imageSrc: images.imageSizes.small, altText: images.metaData.altText, } diff --git a/components/ContentType/DestinationPage/HotelListing/HotelListingItem/index.tsx b/components/ContentType/DestinationPage/HotelListing/HotelListingItem/index.tsx index c7fcf609a..cb3a22173 100644 --- a/components/ContentType/DestinationPage/HotelListing/HotelListingItem/index.tsx +++ b/components/ContentType/DestinationPage/HotelListing/HotelListingItem/index.tsx @@ -64,7 +64,7 @@ export default function HotelListingItem({ - {hotel.hotelContent.texts.descriptions.short} + {hotel.hotelContent.texts.descriptions?.short}