From 413c197ca066b3a8bb64a8e7b67c0a622f980a3a Mon Sep 17 00:00:00 2001 From: Erik Tiekstra Date: Mon, 10 Feb 2025 07:40:38 +0000 Subject: [PATCH] Merged in feat/SW-1495-hide-alerts-on-hotel-pages (pull request #1268) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit feat(SW-1495): removed alerts on hotel pages when displayInBookingFlow is true * feat(SW-1495): removed alerts on hotel pages when displayInBookingFlow is true Approved-by: Fredrik Thorsson Approved-by: Matilda Landström --- components/ContentType/HotelPage/index.tsx | 18 ++++++++++-------- .../hotels/schemas/hotel/specialAlerts.ts | 1 + 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/components/ContentType/HotelPage/index.tsx b/components/ContentType/HotelPage/index.tsx index ead1a176a..173e41e53 100644 --- a/components/ContentType/HotelPage/index.tsx +++ b/components/ContentType/HotelPage/index.tsx @@ -169,14 +169,16 @@ export default async function HotelPage({ hotelId }: HotelPageProps) { {specialAlerts.length ? (
- {specialAlerts.map((alert) => ( - - ))} + {specialAlerts + .filter((alert) => !alert.displayInBookingFlow) + .map((alert) => ( + + ))}
) : null} diff --git a/server/routers/hotels/schemas/hotel/specialAlerts.ts b/server/routers/hotels/schemas/hotel/specialAlerts.ts index 5d89fe936..4404204e6 100644 --- a/server/routers/hotels/schemas/hotel/specialAlerts.ts +++ b/server/routers/hotels/schemas/hotel/specialAlerts.ts @@ -32,6 +32,7 @@ export const specialAlertsSchema = z id: `alert-${alert.type}-${idx}`, text: alert.description || null, type: AlertTypeEnum.Info, + displayInBookingFlow: alert.displayInBookingFlow, })) }) .default([])