Merged in feat(SW-1973)-mystay-multiroom-cancellation-scenarios (pull request #1613)

My stay access denied

* feat(SW-1973) updated no access view

* feat(SW-1973) small fixes

* feat(SW-1973) Update copy


Approved-by: Niclas Edenvin
This commit is contained in:
Pontus Dreij
2025-03-24 14:52:00 +00:00
parent 34bc877092
commit 710e412414
12 changed files with 90 additions and 57 deletions

View File

@@ -38,7 +38,7 @@ interface MultiRoomProps {
| null
bookingPromise?: Promise<BookingConfirmation | null>
index?: number
user?: User | null
user: User | null
}
export default function MultiRoom({
@@ -203,31 +203,24 @@ export default function MultiRoom({
<div
className={`${styles.multiRoomCard} ${isCancelled ? styles.cancelled : ""}`}
>
{packages &&
packages.some((item) =>
Object.values(RoomPackageCodeEnum).includes(
item.code as RoomPackageCodeEnum
)
) && (
<div className={styles.packages}>
{packages
.filter((item) =>
Object.values(RoomPackageCodeEnum).includes(
item.code as RoomPackageCodeEnum
)
{packages?.some((item) =>
Object.values(RoomPackageCodeEnum).includes(item.code)
) && (
<div className={styles.packages}>
{packages
.filter((item) =>
Object.values(RoomPackageCodeEnum).includes(item.code)
)
.map((item) => {
const Icon = getIconForFeatureCode(item.code)
return (
<span className={styles.package} key={item.code}>
<Icon width={16} height={16} color="burgundy" />
</span>
)
.map((item) => {
const Icon = getIconForFeatureCode(
item.code as RoomPackageCodeEnum
)
return (
<span className={styles.package} key={item.code}>
<Icon width={16} height={16} color="burgundy" />
</span>
)
})}
</div>
)}
})}
</div>
)}
<div className={styles.imageContainer}>
<Image
src={roomInfo?.images[0]?.imageSizes.small ?? ""}

View File

@@ -12,7 +12,6 @@ import {
import { decrypt } from "@/server/routers/utils/encryption"
import { ScandicLogoIcon } from "@/components/Icons"
import Body from "@/components/TempDesignSystem/Text/Body"
import { getIntl } from "@/i18n"
import AdditionalInfoForm from "../../FindMyBooking/AdditionalInfoForm"
@@ -136,11 +135,20 @@ export async function Receipt({ refId }: { refId: string }) {
return (
<main className={styles.main}>
<div className={styles.logIn}>
<Body textAlign="center">
{intl.formatMessage({
id: "In order to view your booking, please log in.",
})}
</Body>
<Typography variant="Title/md">
<h1>
{intl.formatMessage({
id: "You need to be logged in to view your booking",
})}
</h1>
</Typography>
<Typography variant="Body/Lead text">
<p>
{intl.formatMessage({
id: "And you need to be logged in with the same member account that made the booking.",
})}
</p>
</Typography>
</div>
</main>
)

View File

@@ -36,5 +36,10 @@
}
.logIn {
padding: var(--Spacing-x5) var(--Spacing-x2);
padding: var(--Spacing-x9) var(--Spacing-x2);
display: flex;
flex-direction: column;
gap: var(--Spacing-x2);
align-items: center;
color: var(--Scandic-Grey-100);
}

View File

@@ -153,25 +153,24 @@ export function SingleRoom({ bedType, image, hotel, user }: RoomProps) {
<div
className={`${styles.content} ${isCancelled ? styles.cancelled : ""}`}
>
{packages &&
packages.some((item) =>
Object.values(RoomPackageCodeEnum).includes(item.code)
) && (
<div className={styles.packages}>
{packages
.filter((item) =>
Object.values(RoomPackageCodeEnum).includes(item.code)
{packages?.some((item) =>
Object.values(RoomPackageCodeEnum).includes(item.code)
) && (
<div className={styles.packages}>
{packages
.filter((item) =>
Object.values(RoomPackageCodeEnum).includes(item.code)
)
.map((item) => {
const Icon = getIconForFeatureCode(item.code)
return (
<span className={styles.package} key={item.code}>
<Icon width={16} height={16} color="burgundy" />
</span>
)
.map((item) => {
const Icon = getIconForFeatureCode(item.code)
return (
<span className={styles.package} key={item.code}>
<Icon width={16} height={16} color="burgundy" />
</span>
)
})}
</div>
)}
})}
</div>
)}
<div className={styles.imageContainer}>
<Image
key={image.imageSizes.small}

View File

@@ -1,6 +1,8 @@
import { cookies } from "next/headers"
import { notFound } from "next/navigation"
import { Typography } from "@scandic-hotels/design-system/Typography"
import { homeHrefs } from "@/constants/homeHrefs"
import { env } from "@/env/server"
import { dt } from "@/lib/dt"
@@ -13,7 +15,6 @@ import {
import { decrypt } from "@/server/routers/utils/encryption"
import Image from "@/components/Image"
import Body from "@/components/TempDesignSystem/Text/Body"
import { getIntl } from "@/i18n"
import { getLang } from "@/i18n/serverContext"
@@ -49,6 +50,7 @@ export async function MyStay({ refId }: { refId: string }) {
const intl = await getIntl()
const access = accessBooking(booking.guest, lastName, user, bv)
if (access === ACCESS_GRANTED) {
const lang = getLang()
const ancillaryPackages = await getAncillaryPackages({
@@ -135,11 +137,20 @@ export async function MyStay({ refId }: { refId: string }) {
return (
<main className={styles.main}>
<div className={styles.logIn}>
<Body textAlign="center">
{intl.formatMessage({
id: "In order to view your booking, please log in.",
})}
</Body>
<Typography variant="Title/md">
<h1>
{intl.formatMessage({
id: "You need to be logged in to view your booking",
})}
</h1>
</Typography>
<Typography variant="Body/Lead text">
<p>
{intl.formatMessage({
id: "And you need to be logged in with the same member account that made the booking.",
})}
</p>
</Typography>
</div>
</main>
)

View File

@@ -91,7 +91,12 @@
}
.logIn {
padding: var(--Spacing-x5) var(--Spacing-x2);
padding: var(--Spacing-x9) var(--Spacing-x2);
display: flex;
flex-direction: column;
gap: var(--Spacing-x2);
align-items: center;
color: var(--Scandic-Grey-100);
}
@media (min-width: 768px) {

View File

@@ -58,6 +58,7 @@
"An error occurred when adding a credit card, please try again later.": "Der opstod en fejl under tilføjelse af et kreditkort. Prøv venligst igen senere.",
"An error occurred when trying to update profile.": "Der opstod en fejl under forsøg på at opdatere profilen.",
"An error occurred. Please try again.": "Der opstod en fejl. Prøv venligst igen.",
"And you need to be logged in with the same member account that made the booking.": "Og du skal være logget ind med det samme medlemskab, der gjorde bookingen.",
"Any changes you've made will be lost.": "Alle ændringer, du har foretaget, går tabt.",
"Apply": "Vælg",
"Approx {value}.": "Ca. {value}",
@@ -881,6 +882,7 @@
"You have no upcoming stays.": "Du har ingen kommende ophold.",
"You have now cancelled your payment.": "Du har nu annulleret din betaling.",
"You must accept the terms and conditions": "You must accept the terms and conditions",
"You need to be logged in to view your booking": "Du skal være logget ind for at se din booking",
"You'll find all your gifts in 'My benefits'": "Du finder alle dine gaver i 'Mine fordele'",
"Your Challenges Conquer & Earn!": "Dine udfordringer Overvind og tjen!",
"Your SAS level has upgraded you to {level}!": "Your SAS level has upgraded you to {level}!",

View File

@@ -58,6 +58,7 @@
"An error occurred when adding a credit card, please try again later.": "Beim Hinzufügen einer Kreditkarte ist ein Fehler aufgetreten. Bitte versuchen Sie es später erneut.",
"An error occurred when trying to update profile.": "Beim Versuch, das Profil zu aktualisieren, ist ein Fehler aufgetreten.",
"An error occurred. Please try again.": "Es ist ein Fehler aufgetreten. Bitte versuchen Sie es erneut.",
"And you need to be logged in with the same member account that made the booking.": "Und Sie müssen mit dem gleichen Mitgliedsaccount eingeloggt sein, der die Buchung gemacht hat.",
"Any changes you've made will be lost.": "Alle Änderungen, die Sie vorgenommen haben, gehen verloren.",
"Apply": "Anwenden",
"Approx {value}.": "Ca. {value}",
@@ -879,6 +880,7 @@
"You have no upcoming stays.": "Sie haben keine bevorstehenden Aufenthalte.",
"You have now cancelled your payment.": "Sie haben jetzt Ihre Zahlung abgebrochen.",
"You must accept the terms and conditions": "You must accept the terms and conditions",
"You need to be logged in to view your booking": "Sie müssen eingeloggt sein, um Ihre Buchung anzusehen",
"You'll find all your gifts in 'My benefits'": "Alle Ihre Geschenke finden Sie unter „Meine Vorteile“",
"Your Challenges Conquer & Earn!": "Meistern Sie Ihre Herausforderungen und verdienen Sie Geld!",
"Your SAS level has upgraded you to {level}!": "Your SAS level has upgraded you to {level}!",

View File

@@ -58,6 +58,7 @@
"An error occurred when adding a credit card, please try again later.": "An error occurred when adding a credit card, please try again later.",
"An error occurred when trying to update profile.": "An error occurred when trying to update profile.",
"An error occurred. Please try again.": "An error occurred. Please try again.",
"And you need to be logged in with the same member account that made the booking.": "And you need to be logged in with the same member account that made the booking.",
"Any changes you've made will be lost.": "Any changes you've made will be lost.",
"Apply": "Apply",
"Approx.": "Approx.",
@@ -877,6 +878,7 @@
"You have no upcoming stays.": "You have no upcoming stays.",
"You have now cancelled your payment.": "You have now cancelled your payment.",
"You must accept the terms and conditions": "You must accept the terms and conditions",
"You need to be logged in to view your booking": "You need to be logged in to view your booking",
"You'll find all your gifts in 'My benefits'": "You'll find all your gifts in 'My benefits'",
"Your Challenges Conquer & Earn!": "Your Challenges Conquer & Earn!",
"Your SAS level has upgraded you to {level}!": "Your SAS level has upgraded you to {level}!",

View File

@@ -58,6 +58,7 @@
"An error occurred when adding a credit card, please try again later.": "Luottokorttia lisättäessä tapahtui virhe. Yritä myöhemmin uudelleen.",
"An error occurred when trying to update profile.": "Profiilia päivitettäessä tapahtui virhe.",
"An error occurred. Please try again.": "Tapahtui virhe. Yritä uudelleen.",
"And you need to be logged in with the same member account that made the booking.": "Ja sinun täytyy olla kirjautunut sisään samalla jäsenyyden tilillä, jolla teit varauksen.",
"Any changes you've made will be lost.": "Kaikki tekemäsi muutokset menetetään.",
"Apply": "Tallenna",
"Approx.": "N.",
@@ -879,6 +880,7 @@
"You have no upcoming stays.": "Sinulla ei ole tulevia majoituksia.",
"You have now cancelled your payment.": "Sinut nyt peruutit maksun.",
"You must accept the terms and conditions": "You must accept the terms and conditions",
"You need to be logged in to view your booking": "Sinun täytyy olla kirjautunut sisään nähdäksesi varauksesi",
"You'll find all your gifts in 'My benefits'": "You'll find all your gifts in 'My benefits'",
"Your Challenges Conquer & Earn!": "Your Challenges Conquer & Earn!",
"Your SAS level has upgraded you to {level}!": "Your SAS level has upgraded you to {level}!",

View File

@@ -58,6 +58,7 @@
"An error occurred when adding a credit card, please try again later.": "Det oppstod en feil ved å legge til et kredittkort. Prøv igjen senere.",
"An error occurred when trying to update profile.": "Det oppstod en feil under forsøk på å oppdatere profilen.",
"An error occurred. Please try again.": "Det oppsto en feil. Vennligst prøv igjen.",
"And you need to be logged in with the same member account that made the booking.": "Og du må være logget inn med samme medlemskonto som gjorde bestillingen.",
"Any changes you've made will be lost.": "Eventuelle endringer du har gjort, går tapt.",
"Apply": "Velg",
"Approx.": "Ca.",
@@ -875,6 +876,7 @@
"You have no upcoming stays.": "Du har ingen kommende opphold.",
"You have now cancelled your payment.": "Du har nå annullerer din betaling.",
"You must accept the terms and conditions": "You must accept the terms and conditions",
"You need to be logged in to view your booking": "Du må være logget inn for å se din bestilling",
"You'll find all your gifts in 'My benefits'": "Du finner alle gavene dine i 'Mine fordeler'",
"Your Challenges Conquer & Earn!": "Dine utfordringer Erobre og tjen!",
"Your SAS level has upgraded you to {level}!": "Your SAS level has upgraded you to {level}!",

View File

@@ -58,6 +58,7 @@
"An error occurred when adding a credit card, please try again later.": "Ett fel uppstod när ett kreditkort lades till, försök igen senare.",
"An error occurred when trying to update profile.": "Ett fel uppstod när du försökte uppdatera profilen.",
"An error occurred. Please try again.": "Ett fel uppstod. Försök igen.",
"And you need to be logged in with the same member account that made the booking.": "Och du måste vara inloggad med samma medlemskonto som gjorde bokningen.",
"Any changes you've made will be lost.": "Alla ändringar du har gjort kommer att gå förlorade.",
"Apply": "Tillämpa",
"Approx.": "Ca.",
@@ -877,6 +878,7 @@
"You have no upcoming stays.": "Du har inga planerade resor.",
"You have now cancelled your payment.": "Du har nu avbrutit din betalning.",
"You must accept the terms and conditions": "You must accept the terms and conditions",
"You need to be logged in to view your booking": "Du måste vara inloggad för att se din bokning",
"You'll find all your gifts in 'My benefits'": "Du hittar alla dina gåvor i 'Mina förmåner'",
"Your Challenges Conquer & Earn!": "Dina utmaningar Erövra och tjäna!",
"Your SAS level has upgraded you to {level}!": "Your SAS level has upgraded you to {level}!",