Merged in fix/SW-2980-alert (pull request #2312)

Fix/SW-2980: Only filter out child alert on hotel page

Approved-by: Erik Tiekstra
This commit is contained in:
Matilda Landström
2025-06-10 07:35:12 +00:00
parent 5e760fee71
commit be643e68a7
3 changed files with 9 additions and 1 deletions

View File

@@ -45,6 +45,7 @@ import {
import styles from "./hotelPage.module.css"
import type { HotelPageProps } from "@/types/components/hotelPage/hotelPage"
import { AlertName } from "@/types/enums/alert"
import { HotelHashValues } from "@/types/enums/hotelPage"
export default async function HotelPage({ hotelId }: HotelPageProps) {
@@ -176,7 +177,9 @@ export default async function HotelPage({ hotelId }: HotelPageProps) {
{specialAlerts.length ? (
<div className={styles.alertsContainer}>
{specialAlerts
.filter((alert) => !alert.displayInBookingFlow)
.filter(
(alert) => alert.name !== AlertName.HotelChildrenInBooking
)
.map((alert) => (
<Alert
key={alert.id}

View File

@@ -32,6 +32,7 @@ export const specialAlertsSchema = z
return filteredAlerts.map((alert, idx) => ({
heading: alert.title || null,
id: `alert-${alert.type}-${idx}`,
name: alert.type,
text: alert.description || null,
type: AlertTypeEnum.Info,
displayInBookingFlow: alert.displayInBookingFlow,

View File

@@ -3,3 +3,7 @@ export enum AlertTypeEnum {
Warning = "warning",
Alarm = "alarm",
}
export const AlertName = {
HotelChildrenInBooking: "HotelChildrenInBooking",
} as const