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:
@@ -45,6 +45,7 @@ import {
|
|||||||
import styles from "./hotelPage.module.css"
|
import styles from "./hotelPage.module.css"
|
||||||
|
|
||||||
import type { HotelPageProps } from "@/types/components/hotelPage/hotelPage"
|
import type { HotelPageProps } from "@/types/components/hotelPage/hotelPage"
|
||||||
|
import { AlertName } from "@/types/enums/alert"
|
||||||
import { HotelHashValues } from "@/types/enums/hotelPage"
|
import { HotelHashValues } from "@/types/enums/hotelPage"
|
||||||
|
|
||||||
export default async function HotelPage({ hotelId }: HotelPageProps) {
|
export default async function HotelPage({ hotelId }: HotelPageProps) {
|
||||||
@@ -176,7 +177,9 @@ export default async function HotelPage({ hotelId }: HotelPageProps) {
|
|||||||
{specialAlerts.length ? (
|
{specialAlerts.length ? (
|
||||||
<div className={styles.alertsContainer}>
|
<div className={styles.alertsContainer}>
|
||||||
{specialAlerts
|
{specialAlerts
|
||||||
.filter((alert) => !alert.displayInBookingFlow)
|
.filter(
|
||||||
|
(alert) => alert.name !== AlertName.HotelChildrenInBooking
|
||||||
|
)
|
||||||
.map((alert) => (
|
.map((alert) => (
|
||||||
<Alert
|
<Alert
|
||||||
key={alert.id}
|
key={alert.id}
|
||||||
|
|||||||
@@ -32,6 +32,7 @@ export const specialAlertsSchema = z
|
|||||||
return filteredAlerts.map((alert, idx) => ({
|
return filteredAlerts.map((alert, idx) => ({
|
||||||
heading: alert.title || null,
|
heading: alert.title || null,
|
||||||
id: `alert-${alert.type}-${idx}`,
|
id: `alert-${alert.type}-${idx}`,
|
||||||
|
name: alert.type,
|
||||||
text: alert.description || null,
|
text: alert.description || null,
|
||||||
type: AlertTypeEnum.Info,
|
type: AlertTypeEnum.Info,
|
||||||
displayInBookingFlow: alert.displayInBookingFlow,
|
displayInBookingFlow: alert.displayInBookingFlow,
|
||||||
|
|||||||
@@ -3,3 +3,7 @@ export enum AlertTypeEnum {
|
|||||||
Warning = "warning",
|
Warning = "warning",
|
||||||
Alarm = "alarm",
|
Alarm = "alarm",
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export const AlertName = {
|
||||||
|
HotelChildrenInBooking: "HotelChildrenInBooking",
|
||||||
|
} as const
|
||||||
|
|||||||
Reference in New Issue
Block a user