Merged in fix(BOOK-659)-multiroom-name-check (pull request #3384)
fix(BOOK-659): trim names for multiroom booking * fix(BOOK-659): trim names for multiroom booking Approved-by: Matilda Haneling
This commit is contained in:
@@ -45,6 +45,7 @@ export function Blocks({ blocks }: BlocksProps) {
|
||||
case BlocksEnums.block.FullWidthCampaign:
|
||||
return (
|
||||
<FullWidthCampaign
|
||||
key={`${block.typename}-${idx}`}
|
||||
content={block.full_width_campaign}
|
||||
headingLevel={headingLevel}
|
||||
/>
|
||||
|
||||
@@ -7,9 +7,9 @@ import { useIntl } from "react-intl"
|
||||
|
||||
import { usePhoneNumberParsing } from "@scandic-hotels/common/hooks/usePhoneNumberParsing"
|
||||
import { getDefaultCountryFromLang } from "@scandic-hotels/common/utils/phone"
|
||||
import Footnote from "@scandic-hotels/design-system/Footnote"
|
||||
import CountrySelect from "@scandic-hotels/design-system/Form/Country"
|
||||
import Phone from "@scandic-hotels/design-system/Form/Phone"
|
||||
import { Typography } from "@scandic-hotels/design-system/Typography"
|
||||
import { useFormTracking } from "@scandic-hotels/tracking/useFormTracking"
|
||||
|
||||
import { useBookingFlowConfig } from "../../../../bookingFlowConfig/bookingFlowConfigContext"
|
||||
@@ -198,17 +198,14 @@ export default function Details() {
|
||||
<JoinScandicCard updateDetailsStore={updateDetailsStore} />
|
||||
)}
|
||||
<div className={styles.container}>
|
||||
<Footnote
|
||||
color="uiTextHighContrast"
|
||||
textTransform="uppercase"
|
||||
type="label"
|
||||
className={styles.fullWidth}
|
||||
>
|
||||
{intl.formatMessage({
|
||||
id: "enterDetails.roomInfo.title",
|
||||
defaultMessage: "Guest information",
|
||||
})}
|
||||
</Footnote>
|
||||
<Typography variant="Title/Overline/sm" className={styles.fullWidth}>
|
||||
<p>
|
||||
{intl.formatMessage({
|
||||
id: "enterDetails.roomInfo.title",
|
||||
defaultMessage: "Guest information",
|
||||
})}
|
||||
</p>
|
||||
</Typography>
|
||||
<div
|
||||
ref={(el) => {
|
||||
refs.current.firstName = el
|
||||
|
||||
@@ -61,8 +61,10 @@ export function getMultiroomDetailsSchema(
|
||||
(data) =>
|
||||
!crossValidationData.some(
|
||||
(room) =>
|
||||
room.firstName?.toLowerCase() === data.firstName.toLowerCase() &&
|
||||
room.lastName?.toLowerCase() === data.lastName.toLowerCase()
|
||||
room.firstName?.toLowerCase().trim() ===
|
||||
data.firstName.toLowerCase().trim() &&
|
||||
room.lastName?.toLowerCase().trim() ===
|
||||
data.lastName.toLowerCase().trim()
|
||||
),
|
||||
{
|
||||
message: multiroomErrors.FIRST_AND_LAST_NAME_UNIQUE,
|
||||
@@ -73,8 +75,10 @@ export function getMultiroomDetailsSchema(
|
||||
(data) =>
|
||||
!crossValidationData.some(
|
||||
(room) =>
|
||||
room.firstName?.toLowerCase() === data.firstName.toLowerCase() &&
|
||||
room.lastName?.toLowerCase() === data.lastName.toLowerCase()
|
||||
room.firstName?.toLowerCase().trim() ===
|
||||
data.firstName.toLowerCase().trim() &&
|
||||
room.lastName?.toLowerCase().trim() ===
|
||||
data.lastName.toLowerCase().trim()
|
||||
),
|
||||
{
|
||||
message: multiroomErrors.FIRST_AND_LAST_NAME_UNIQUE,
|
||||
|
||||
@@ -7,9 +7,9 @@ import { useIntl } from "react-intl"
|
||||
|
||||
import { usePhoneNumberParsing } from "@scandic-hotels/common/hooks/usePhoneNumberParsing"
|
||||
import { getDefaultCountryFromLang } from "@scandic-hotels/common/utils/phone"
|
||||
import Footnote from "@scandic-hotels/design-system/Footnote"
|
||||
import CountrySelect from "@scandic-hotels/design-system/Form/Country"
|
||||
import Phone from "@scandic-hotels/design-system/Form/Phone"
|
||||
import { Typography } from "@scandic-hotels/design-system/Typography"
|
||||
import { useFormTracking } from "@scandic-hotels/tracking/useFormTracking"
|
||||
|
||||
import { useBookingFlowConfig } from "../../../../bookingFlowConfig/bookingFlowConfigContext"
|
||||
@@ -208,17 +208,14 @@ export default function Details({ user }: DetailsProps) {
|
||||
<JoinScandicCard updateDetailsStore={updateDetailsStore} />
|
||||
) : null}
|
||||
<div className={styles.container}>
|
||||
<Footnote
|
||||
color="uiTextHighContrast"
|
||||
textTransform="uppercase"
|
||||
type="label"
|
||||
className={styles.fullWidth}
|
||||
>
|
||||
{intl.formatMessage({
|
||||
id: "enterDetails.roomInfo.title",
|
||||
defaultMessage: "Guest information",
|
||||
})}
|
||||
</Footnote>
|
||||
<Typography variant="Title/Overline/sm" className={styles.fullWidth}>
|
||||
<p>
|
||||
{intl.formatMessage({
|
||||
id: "enterDetails.roomInfo.title",
|
||||
defaultMessage: "Guest information",
|
||||
})}
|
||||
</p>
|
||||
</Typography>
|
||||
<div
|
||||
ref={(el) => {
|
||||
refs.current.firstName = el
|
||||
|
||||
Reference in New Issue
Block a user