From 76c20df8e8abf0b31dc2c0d41985059267197784 Mon Sep 17 00:00:00 2001 From: Erik Tiekstra Date: Wed, 5 Mar 2025 10:15:52 +0000 Subject: [PATCH] Merged in fix/SW-1819-batching-city-urls (pull request #1477) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit fix(SW-1819): Batching fetch for city page urls * fix(SW-1819): Batching fetch for city page urls Approved-by: Fredrik Thorsson Approved-by: Matilda Landström --- .../CityListing/CityListingItem/index.tsx | 6 +- .../CountryMap/CityListItem/index.tsx | 10 +- .../DestinationPage/TopImages/index.tsx | 2 +- .../DestinationCityPageCount.graphql | 7 ++ .../DestinationCityPageUrl.graphql | 4 +- .../destinationCityPage/output.ts | 24 ++++- .../destinationCityPage/telemetry.ts | 10 ++ .../contentstack/destinationCityPage/utils.ts | 93 ++++++++++++++++--- .../routers/contentstack/hotelPage/utils.ts | 16 ++-- .../contentstack/destinationCityPage.ts | 3 + 10 files changed, 143 insertions(+), 32 deletions(-) create mode 100644 apps/scandic-web/lib/graphql/Query/DestinationCityPage/DestinationCityPageCount.graphql diff --git a/apps/scandic-web/components/ContentType/DestinationPage/CityListing/CityListingItem/index.tsx b/apps/scandic-web/components/ContentType/DestinationPage/CityListing/CityListingItem/index.tsx index aa6b3634b..1e6ef95ae 100644 --- a/apps/scandic-web/components/ContentType/DestinationPage/CityListing/CityListingItem/index.tsx +++ b/apps/scandic-web/components/ContentType/DestinationPage/CityListing/CityListingItem/index.tsx @@ -22,7 +22,7 @@ interface CityListingItemProps { export default function CityListingItem({ city }: CityListingItemProps) { const intl = useIntl() - const galleryImages = mapImageVaultImagesToGalleryImages(city.images) + const galleryImages = mapImageVaultImagesToGalleryImages(city.images || []) return (
@@ -40,7 +40,9 @@ export default function CityListingItem({ city }: CityListingItemProps) {

{city.heading}

- + {city.experiences?.length && ( + + )} {city.preamble} diff --git a/apps/scandic-web/components/ContentType/DestinationPage/DestinationCountryPage/CountryMap/CityListItem/index.tsx b/apps/scandic-web/components/ContentType/DestinationPage/DestinationCountryPage/CountryMap/CityListItem/index.tsx index 3c9abc163..3a727dfb6 100644 --- a/apps/scandic-web/components/ContentType/DestinationPage/DestinationCountryPage/CountryMap/CityListItem/index.tsx +++ b/apps/scandic-web/components/ContentType/DestinationPage/DestinationCountryPage/CountryMap/CityListItem/index.tsx @@ -20,7 +20,7 @@ interface CityListItemProps { export default function CityListItem({ city }: CityListItemProps) { const intl = useIntl() - const galleryImages = mapImageVaultImagesToGalleryImages(city.images) + const galleryImages = mapImageVaultImagesToGalleryImages(city.images || []) return (
@@ -38,9 +38,11 @@ export default function CityListItem({ city }: CityListItemProps) {

{city.heading}

-
- -
+ {city.experiences?.length && ( +
+ +
+ )}