Merged in fix/SW-3484-campaign-remove-breakfast-message-chip (pull request #2820)
fix(SW-3484): remove breakfast message in the booking code chip for campaign * fix(SW-3484): remove breakfast message in the booking code chip for campaign Approved-by: Matilda Landström
This commit is contained in:
@@ -83,9 +83,7 @@ export default function SummaryUI({
|
|||||||
const isAllCampaignRate = rooms.every(
|
const isAllCampaignRate = rooms.every(
|
||||||
(room) => room.room.roomRate.rateDefinition.isCampaignRate
|
(room) => room.room.roomRate.rateDefinition.isCampaignRate
|
||||||
)
|
)
|
||||||
const isAllBreakfastIncluded = rooms.every(
|
|
||||||
(room) => room.room.roomRate.rateDefinition.breakfastIncluded
|
|
||||||
)
|
|
||||||
const containsBookingCodeRate = rooms.find(
|
const containsBookingCodeRate = rooms.find(
|
||||||
(r) => r && isBookingCodeRate(r.room.roomRate)
|
(r) => r && isBookingCodeRate(r.room.roomRate)
|
||||||
)
|
)
|
||||||
@@ -227,7 +225,6 @@ export default function SummaryUI({
|
|||||||
<BookingCodeChip
|
<BookingCodeChip
|
||||||
isCampaign={isAllCampaignRate}
|
isCampaign={isAllCampaignRate}
|
||||||
bookingCode={booking.bookingCode}
|
bookingCode={booking.bookingCode}
|
||||||
isBreakfastIncluded={isAllBreakfastIncluded}
|
|
||||||
alignCenter
|
alignCenter
|
||||||
/>
|
/>
|
||||||
<Divider className={styles.bottomDivider} color="Border/Divider/Subtle" />
|
<Divider className={styles.bottomDivider} color="Border/Divider/Subtle" />
|
||||||
|
|||||||
@@ -12,7 +12,6 @@ interface BookingCodeRowProps {
|
|||||||
|
|
||||||
export default function BookingCodeRow({
|
export default function BookingCodeRow({
|
||||||
bookingCode,
|
bookingCode,
|
||||||
isBreakfastIncluded,
|
|
||||||
isCampaignRate,
|
isCampaignRate,
|
||||||
}: BookingCodeRowProps) {
|
}: BookingCodeRowProps) {
|
||||||
if (!bookingCode) {
|
if (!bookingCode) {
|
||||||
@@ -24,7 +23,6 @@ export default function BookingCodeRow({
|
|||||||
<td colSpan={2} align="left">
|
<td colSpan={2} align="left">
|
||||||
<BookingCodeChip
|
<BookingCodeChip
|
||||||
bookingCode={bookingCode}
|
bookingCode={bookingCode}
|
||||||
isBreakfastIncluded={isBreakfastIncluded}
|
|
||||||
isCampaign={isCampaignRate}
|
isCampaign={isCampaignRate}
|
||||||
/>
|
/>
|
||||||
</td>
|
</td>
|
||||||
|
|||||||
@@ -91,8 +91,6 @@ export default function PriceDetailsTable({
|
|||||||
const departue = dt(toDate).locale(lang).format(longDateFormat[lang])
|
const departue = dt(toDate).locale(lang).format(longDateFormat[lang])
|
||||||
const duration = ` ${arrival} - ${departue} (${nightsMsg})`
|
const duration = ` ${arrival} - ${departue} (${nightsMsg})`
|
||||||
|
|
||||||
const isAllBreakfastIncluded = rooms.every((room) => room.breakfastIncluded)
|
|
||||||
|
|
||||||
const allPricesIsDiscounted = rooms.every((room) => {
|
const allPricesIsDiscounted = rooms.every((room) => {
|
||||||
if (!("regular" in room.price)) {
|
if (!("regular" in room.price)) {
|
||||||
return false
|
return false
|
||||||
@@ -223,7 +221,6 @@ export default function PriceDetailsTable({
|
|||||||
|
|
||||||
<BookingCodeRow
|
<BookingCodeRow
|
||||||
isCampaignRate={isCampaignRate}
|
isCampaignRate={isCampaignRate}
|
||||||
isBreakfastIncluded={isAllBreakfastIncluded}
|
|
||||||
bookingCode={bookingCode}
|
bookingCode={bookingCode}
|
||||||
/>
|
/>
|
||||||
</Tbody>
|
</Tbody>
|
||||||
|
|||||||
@@ -45,32 +45,14 @@ export const WithCloseButton: Story = {
|
|||||||
),
|
),
|
||||||
}
|
}
|
||||||
|
|
||||||
export const CampaignBreakfastIncluded: Story = {
|
export const CampaignWithoutBookingCode: Story = {
|
||||||
args: {},
|
args: {},
|
||||||
render: () => (
|
render: () => <BookingCodeChip isCampaign />,
|
||||||
<BookingCodeChip isCampaign bookingCode="SUMMER25" isBreakfastIncluded />
|
|
||||||
),
|
|
||||||
}
|
|
||||||
|
|
||||||
export const CampaignBreakfastExcluded: Story = {
|
|
||||||
args: {},
|
|
||||||
render: () => (
|
|
||||||
<BookingCodeChip
|
|
||||||
isCampaign
|
|
||||||
bookingCode="SUMMER25"
|
|
||||||
isBreakfastIncluded={false}
|
|
||||||
/>
|
|
||||||
),
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export const CampaignFilledIcon: Story = {
|
export const CampaignFilledIcon: Story = {
|
||||||
args: {},
|
args: {},
|
||||||
render: () => (
|
render: () => (
|
||||||
<BookingCodeChip
|
<BookingCodeChip isCampaign bookingCode="SUMMER25" filledIcon />
|
||||||
isCampaign
|
|
||||||
bookingCode="SUMMER25"
|
|
||||||
isBreakfastIncluded
|
|
||||||
filledIcon
|
|
||||||
/>
|
|
||||||
),
|
),
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,7 +12,6 @@ import styles from './bookingCodeChip.module.css'
|
|||||||
type BaseBookingCodeChipProps = {
|
type BaseBookingCodeChipProps = {
|
||||||
alignCenter?: boolean
|
alignCenter?: boolean
|
||||||
bookingCode?: string | null
|
bookingCode?: string | null
|
||||||
isBreakfastIncluded?: boolean
|
|
||||||
isCampaign?: boolean
|
isCampaign?: boolean
|
||||||
isUnavailable?: boolean
|
isUnavailable?: boolean
|
||||||
withText?: boolean
|
withText?: boolean
|
||||||
@@ -33,7 +32,6 @@ type BookingCodeChipProps =
|
|||||||
export function BookingCodeChip({
|
export function BookingCodeChip({
|
||||||
alignCenter,
|
alignCenter,
|
||||||
bookingCode,
|
bookingCode,
|
||||||
isBreakfastIncluded,
|
|
||||||
isCampaign,
|
isCampaign,
|
||||||
isUnavailable,
|
isUnavailable,
|
||||||
withText = true,
|
withText = true,
|
||||||
@@ -61,19 +59,11 @@ export function BookingCodeChip({
|
|||||||
{intl.formatMessage({ defaultMessage: 'Campaign' })}
|
{intl.formatMessage({ defaultMessage: 'Campaign' })}
|
||||||
</strong>
|
</strong>
|
||||||
</Typography>
|
</Typography>
|
||||||
<Typography variant="Body/Supporting text (caption)/smRegular">
|
{bookingCode && (
|
||||||
<span>
|
<Typography variant="Body/Supporting text (caption)/smRegular">
|
||||||
{isBreakfastIncluded
|
<span>{bookingCode}</span>
|
||||||
? // eslint-disable-next-line formatjs/no-literal-string-in-jsx
|
</Typography>
|
||||||
`${bookingCode ?? ''} ${intl.formatMessage({
|
)}
|
||||||
defaultMessage: 'Breakfast included',
|
|
||||||
})}`
|
|
||||||
: // eslint-disable-next-line formatjs/no-literal-string-in-jsx
|
|
||||||
`${bookingCode ?? ''} ${intl.formatMessage({
|
|
||||||
defaultMessage: 'Breakfast excluded',
|
|
||||||
})}`}
|
|
||||||
</span>
|
|
||||||
</Typography>
|
|
||||||
</p>
|
</p>
|
||||||
</IconChip>
|
</IconChip>
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user