Merged in fix/my-stay-ancillaries (pull request #1663)

fix: small design fix, fix bug that redirects to planet, add translations

* fix: small design fix, fix bug that redirects to planet, add translations

* fix: if user does not have enough points, default quantitywithcard to 1

* fix: fix pr comment


Approved-by: Linus Flood
Approved-by: Matilda Landström
This commit is contained in:
Bianca Widstam
2025-04-01 09:05:42 +00:00
parent 221f842552
commit e6c9e25222
10 changed files with 22 additions and 11 deletions

View File

@@ -140,6 +140,7 @@ export default function PaymentClient({
if (result.reservationStatus == BookingStatusEnum.BookingCompleted) {
const confirmationUrl = `${bookingConfirmation(lang)}?${BOOKING_CONFIRMATION_NUMBER}=${result.id}`
router.push(confirmationUrl)
return
}
setBookingNumber(result.id)

View File

@@ -74,7 +74,7 @@
padding-bottom: var(--Space-x025);
}
.divider {
.pointsDivider {
display: flex;
gap: var(--Space-x2);
height: 24px;

View File

@@ -80,10 +80,13 @@ export default function AddAncillaryFlowModal({
const defaultDeliveryTime = deliveryTimeOptions[0].value
const hasInsufficientPoints =
(user?.membership?.currentPoints ?? 0) < (selectedAncillary?.points ?? 0)
const formMethods = useForm<AncillaryFormData>({
defaultValues: {
quantityWithPoints: null,
quantityWithCard: user ? null : 1,
quantityWithCard: !user || hasInsufficientPoints ? 1 : null,
deliveryTime: defaultDeliveryTime,
optionalText: "",
termsAndConditions: false,
@@ -320,7 +323,7 @@ export default function AddAncillaryFlowModal({
</p>
</Typography>
{selectedAncillary.points && (
<div className={styles.divider}>
<div className={styles.pointsDivider}>
<Divider variant="vertical" color="subtle" />
<Typography variant="Body/Paragraph/mdBold">
<p>

View File

@@ -64,12 +64,19 @@ export function useGuaranteeBooking({
})
useEffect(() => {
if (bookingStatus?.data?.paymentUrl) {
if (bookingStatus?.data?.paymentUrl && isPollingForBookingStatus) {
router.push(bookingStatus.data.paymentUrl)
setIsPollingForBookingStatus(false)
} else if (bookingStatus.isTimeout) {
handlePaymentError()
}
}, [bookingStatus, router, handlePaymentError])
}, [
bookingStatus,
router,
handlePaymentError,
setIsPollingForBookingStatus,
isPollingForBookingStatus,
])
const isLoading =
guaranteeBooking.isPending ||

View File

@@ -911,7 +911,7 @@
"Your booking(s) is confirmed but we could not verify your membership. If you have booked with a member discount, you'll either need to present your existing membership number upon check-in, become a member or pay the price difference at the hotel. Signing up is preferably done online before the stay.": "Din booking er bekræftet, men vi kunne ikke verificere dit medlemskab. Hvis du har booket med et medlemstilbud, skal du enten vise dit eksisterende medlemskab ved check-in, blive medlem eller betale prisdifferencen ved check-in. Tilmelding er foretrukket online før opholdet.",
"Your card was successfully removed!": "Dit kort blev fjernet!",
"Your card was successfully saved!": "Dit kort blev gemt!",
"Your card will only be used for authorization": "Dit kort vil kun blive brugt til autorisation",
"Your card will only be used for authorisation": "Dit kort vil kun blive brugt til autorisation",
"Your current level": "Dit nuværende niveau",
"Your details": "Dine oplysninger",
"Your exchanged points will retain their original expiry date with a maximum validity of 12 months.": "Your exchanged points will retain their original expiry date with a maximum validity of 12 months.",

View File

@@ -909,7 +909,7 @@
"Your booking(s) is confirmed but we could not verify your membership. If you have booked with a member discount, you'll either need to present your existing membership number upon check-in, become a member or pay the price difference at the hotel. Signing up is preferably done online before the stay.": "Ihre Buchung ist bestätigt, aber wir konnten Ihr Mitglied nicht verifizieren. Wenn Sie mit einem Mitgliederrabatt gebucht haben, müssen Sie entweder Ihr vorhandenes Mitgliedschaftsnummer bei der Anreise präsentieren, ein Mitglied werden oder die Preisdifferenz bei der Anreise bezahlen. Die Anmeldung ist vorzugsweise online vor der Aufenthaltsdauer erfolgreich.",
"Your card was successfully removed!": "Ihre Karte wurde erfolgreich entfernt!",
"Your card was successfully saved!": "Ihre Karte wurde erfolgreich gespeichert!",
"Your card will only be used for authorization": "Ihre Karte wird nur zur Autorisierung verwendet",
"Your card will only be used for authorisation": "Ihre Karte wird nur zur Autorisierung verwendet",
"Your current level": "Ihr aktuelles Level",
"Your details": "Ihre Angaben",
"Your exchanged points will retain their original expiry date with a maximum validity of 12 months.": "Your exchanged points will retain their original expiry date with a maximum validity of 12 months.",

View File

@@ -907,7 +907,7 @@
"Your booking(s) is confirmed but we could not verify your membership. If you have booked with a member discount, you'll either need to present your existing membership number upon check-in, become a member or pay the price difference at the hotel. Signing up is preferably done online before the stay.": "Your booking(s) is confirmed but we could not verify your membership. If you have booked with a member discount, you'll either need to present your existing membership number upon check-in, become a member or pay the price difference at the hotel. Signing up is preferably done online before the stay.",
"Your card was successfully removed!": "Your card was successfully removed!",
"Your card was successfully saved!": "Your card was successfully saved!",
"Your card will only be used for authorization": "Your card will only be used for authorization",
"Your card will only be used for authorisation": "Your card will only be used for authorisation",
"Your current level": "Your current level",
"Your details": "Your details",
"Your exchanged points will retain their original expiry date with a maximum validity of 12 months.": "Your exchanged points will retain their original expiry date with a maximum validity of 12 months.",

View File

@@ -909,7 +909,7 @@
"Your booking(s) is confirmed but we could not verify your membership. If you have booked with a member discount, you'll either need to present your existing membership number upon check-in, become a member or pay the price difference at the hotel. Signing up is preferably done online before the stay.": "Varauksesi on vahvistettu, mutta jäsenyytesi ei voitu vahvistaa. Jos olet bookeutunut jäsenyysalennoilla, sinun on joko esitettävä olemassa olevan jäsenyysnumero tarkistukseen, tulla jäseneksi tai maksamaan hinnan eron hotellissa. Jäsenyyden tilittäminen on suositeltavampaa tehdä verkkoon ennen majoittumista.",
"Your card was successfully removed!": "Korttisi poistettiin onnistuneesti!",
"Your card was successfully saved!": "Korttisi tallennettu onnistuneesti!",
"Your card will only be used for authorization": "Korttiasi käytetään vain valtuutukseen",
"Your card will only be used for authorisation": "Korttiasi käytetään vain valtuutukseen",
"Your current level": "Nykyinen tasosi",
"Your details": "Tietosi",
"Your exchanged points will retain their original expiry date with a maximum validity of 12 months.": "Your exchanged points will retain their original expiry date with a maximum validity of 12 months.",

View File

@@ -905,7 +905,7 @@
"Your booking(s) is confirmed but we could not verify your membership. If you have booked with a member discount, you'll either need to present your existing membership number upon check-in, become a member or pay the price difference at the hotel. Signing up is preferably done online before the stay.": "Din bestilling er bekreftet, men vi kunne ikke verifisere medlemskapet ditt. Hvis du har booke ut med et medlemsrabatt, må du enten presentere eksisterende medlemsnummer ved check-in, bli medlem eller betale prisdifferansen ved hotellet. Registrering er foretrukket gjort online før oppholdet.",
"Your card was successfully removed!": "Kortet ditt ble fjernet!",
"Your card was successfully saved!": "Kortet ditt ble lagret!",
"Your card will only be used for authorization": "Kortet ditt vil kun bli brukt til autorisasjon",
"Your card will only be used for authorisation": "Kortet ditt vil kun bli brukt til autorisasjon",
"Your current level": "Ditt nåværende nivå",
"Your details": "Dine detaljer",
"Your exchanged points will retain their original expiry date with a maximum validity of 12 months.": "Your exchanged points will retain their original expiry date with a maximum validity of 12 months.",

View File

@@ -907,7 +907,7 @@
"Your booking(s) is confirmed but we could not verify your membership. If you have booked with a member discount, you'll either need to present your existing membership number upon check-in, become a member or pay the price difference at the hotel. Signing up is preferably done online before the stay.": "Din bokning är bekräftad, men vi kunde inte verifiera ditt medlemskap. Om du har bokat med ett medlemsrabatt måste du antingen presentera ditt befintliga medlemsnummer vid check-in, bli medlem eller betala prisdifferensen vid hotell. Registrering är föredragen gjord online före vistelsen.",
"Your card was successfully removed!": "Ditt kort har tagits bort!",
"Your card was successfully saved!": "Ditt kort har sparats!",
"Your card will only be used for authorization": "Ditt kort kommer endast att användas för auktorisering",
"Your card will only be used for authorisation": "Ditt kort kommer endast att användas för auktorisering",
"Your current level": "Din nuvarande nivå",
"Your details": "Dina uppgifter",
"Your exchanged points will retain their original expiry date with a maximum validity of 12 months.": "Your exchanged points will retain their original expiry date with a maximum validity of 12 months.",