@roomstay/frontend 2.6.75 → 2.6.77-0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/153.bundle.js +1 -0
- package/dist/176.bundle.js +1 -0
- package/dist/273.bundle.js +1 -0
- package/dist/292.bundle.js +1 -0
- package/dist/316.bundle.js +1 -0
- package/dist/349.bundle.js +2 -0
- package/dist/{535.bundle.js.LICENSE.txt → 349.bundle.js.LICENSE.txt} +1 -1
- package/dist/352.bundle.js +1 -0
- package/dist/41.bundle.js +1 -0
- package/dist/{151.bundle.js → 451.bundle.js} +1 -1
- package/dist/479.bundle.js +1 -0
- package/dist/534.bundle.js +1 -0
- package/dist/557.bundle.js +1 -0
- package/dist/620.bundle.js +1 -0
- package/dist/696.bundle.js +1 -0
- package/dist/734.bundle.js +1 -0
- package/dist/83.bundle.js +1 -0
- package/dist/910.bundle.js +1 -0
- package/dist/922.bundle.js +1 -0
- package/dist/99.bundle.js +1 -0
- package/dist/main.bundle.js +1 -1
- package/dist/src/animations/AutoAutoHeight.d.ts +1 -1
- package/dist/src/api/HotelAPI.d.ts +2 -0
- package/dist/src/api/HotelAPI.js +7 -0
- package/dist/src/api/HotelAPI.js.map +1 -1
- package/dist/src/api/ReservationAPI.js +12 -9
- package/dist/src/api/ReservationAPI.js.map +1 -1
- package/dist/src/components/User/Forms/ForgotPasswordForm.d.ts +2 -1
- package/dist/src/components/User/Forms/SignUpForm.d.ts +2 -1
- package/dist/src/components/User/Forms/VerifyEmailForm.d.ts +2 -1
- package/dist/src/components/generic/AgedBetweenLabel/AgedBetweenLabel.d.ts +2 -1
- package/dist/src/components/generic/Alert.d.ts +2 -2
- package/dist/src/components/generic/BEButton.d.ts +1 -1
- package/dist/src/components/generic/BackButton.d.ts +2 -1
- package/dist/src/components/generic/BookingWizard/BookingWizard.d.ts +1 -0
- package/dist/src/components/generic/BookingWizard/BookingWizard.js +7 -1
- package/dist/src/components/generic/BookingWizard/BookingWizard.js.map +1 -1
- package/dist/src/components/generic/BookingWizard/BookingWizardBottomSheet/BookingWizardBottomSheet.d.ts +2 -2
- package/dist/src/components/generic/BookingWizard/BookingWizardBottomSheet/BookingWizardBottomSheet.js +0 -1
- package/dist/src/components/generic/BookingWizard/BookingWizardBottomSheet/BookingWizardBottomSheet.js.map +1 -1
- package/dist/src/components/generic/BookingWizard/BookingWizardContent.d.ts +14 -5
- package/dist/src/components/generic/BookingWizard/BookingWizardContent.js +24 -10
- package/dist/src/components/generic/BookingWizard/BookingWizardContent.js.map +1 -1
- package/dist/src/components/generic/BookingWizard/BookingWizardDateSelector/BookingWizardDateSelector.js +1 -1
- package/dist/src/components/generic/BookingWizard/BookingWizardDateSelector/BookingWizardDateSelector.js.map +1 -1
- package/dist/src/components/generic/BookingWizard/BookingWizardHotelSelector/BookingWizardHotelSelector.d.ts +10 -2
- package/dist/src/components/generic/BookingWizard/BookingWizardHotelSelector/BookingWizardHotelSelector.js +187 -22
- package/dist/src/components/generic/BookingWizard/BookingWizardHotelSelector/BookingWizardHotelSelector.js.map +1 -1
- package/dist/src/components/generic/Card/IconNavCard/IconNavCard.d.ts +2 -2
- package/dist/src/components/generic/Countdown.d.ts +2 -1
- package/dist/src/components/generic/Currency.d.ts +2 -1
- package/dist/src/components/generic/DateRangePicker/DateRangePicker.d.ts +2 -1
- package/dist/src/components/generic/DateRangePicker/DateRangePickerDay.d.ts +2 -1
- package/dist/src/components/generic/DateRangePicker/DateRangePickerDays.d.ts +2 -1
- package/dist/src/components/generic/DateRangePicker/DateRangePickerMonth.d.ts +2 -1
- package/dist/src/components/generic/Distance.d.ts +2 -1
- package/dist/src/components/generic/Headline.d.ts +1 -1
- package/dist/src/components/generic/HtmlContentViewer.d.ts +2 -1
- package/dist/src/components/generic/InputGroup/InputGroup.d.ts +2 -2
- package/dist/src/components/generic/LineBreak.d.ts +2 -1
- package/dist/src/components/generic/Notification.d.ts +1 -1
- package/dist/src/components/generic/NumberIncrement.d.ts +2 -1
- package/dist/src/components/generic/Overlay/Overlay.d.ts +2 -2
- package/dist/src/components/generic/PageTitle/index.d.ts +2 -1
- package/dist/src/components/generic/PaymentCard/PaymentCard.d.ts +2 -1
- package/dist/src/components/generic/Pill.d.ts +1 -1
- package/dist/src/components/generic/Placeholder.d.ts +2 -1
- package/dist/src/components/generic/PromoCodeInput.d.ts +2 -1
- package/dist/src/components/generic/RecentSearchesCard.d.ts +2 -1
- package/dist/src/components/generic/RoomstayMark.d.ts +2 -1
- package/dist/src/components/generic/Select/Select.d.ts +2 -1
- package/dist/src/components/generic/Select/Select.js +2 -2
- package/dist/src/components/generic/Select/Select.js.map +1 -1
- package/dist/src/components/generic/Slider/Slider.d.ts +1 -1
- package/dist/src/components/generic/Tabs/TabRouteContainer.d.ts +2 -2
- package/dist/src/components/generic/Tooltip/Tooltip.d.ts +2 -2
- package/dist/src/components/generic/badging/SSLSecureBadge.d.ts +2 -1
- package/dist/src/components/generic/buttons/NextStepButton.d.ts +2 -1
- package/dist/src/components/generic/date/DatePicker.d.ts +2 -1
- package/dist/src/components/generic/date/DatePickerDay.d.ts +2 -1
- package/dist/src/components/generic/date/DatePickerDays.d.ts +2 -1
- package/dist/src/components/generic/date/DatePickerMonth.d.ts +2 -1
- package/dist/src/components/generic/date/DatePickerWeek.d.ts +2 -1
- package/dist/src/components/generic/date/FloatingDatePicker.d.ts +1 -1
- package/dist/src/components/generic/date/WeekViewSkeleton.d.ts +2 -1
- package/dist/src/components/generic/loader/ImageLoader.d.ts +1 -1
- package/dist/src/components/generic/loader/LargeLoader.d.ts +2 -1
- package/dist/src/components/generic/loader/OverlayLoader.d.ts +2 -1
- package/dist/src/components/generic/loader/SmallSpinner.d.ts +2 -1
- package/dist/src/components/generic/map/HotelLocationMap.d.ts +2 -1
- package/dist/src/components/generic/modal/ConfirmationModal.d.ts +2 -1
- package/dist/src/components/generic/modal/ErrorModal.d.ts +1 -1
- package/dist/src/components/generic/modal/SigninModal/UnauthenticatedUserModal.d.ts +2 -1
- package/dist/src/components/generic/modal/SimpleModal.d.ts +1 -1
- package/dist/src/components/generic/modal/TabbedModal.d.ts +1 -1
- package/dist/src/components/generic/radio/RadioFields.d.ts +2 -1
- package/dist/src/components/graphics/TravelerNotfound.d.ts +2 -1
- package/dist/src/components/iconComponents/BookNowPayLaterIcon.d.ts +2 -1
- package/dist/src/components/members/InlineSignUpSection.d.ts +2 -1
- package/dist/src/components/members/SignInModal/ExternalMemberModal.d.ts +2 -1
- package/dist/src/components/members/SignInModal/InternalMemberSignInModal.d.ts +2 -1
- package/dist/src/components/members/SignInModal/MemberPortalSignInModal.d.ts +2 -1
- package/dist/src/components/members/SignInModal/MemberSignInModal.d.ts +2 -1
- package/dist/src/components/navigation/Header.d.ts +2 -1
- package/dist/src/components/navigation/StepSelector.d.ts +2 -1
- package/dist/src/components/navigation/StepSelectorModal.d.ts +2 -1
- package/dist/src/components/pages/Account/Card/MemberCardItem.d.ts +2 -1
- package/dist/src/components/pages/PageColorComponent.d.ts +2 -1
- package/dist/src/components/reservation/ReservationItem.d.ts +2 -1
- package/dist/src/components/steps/DaysSelectedInformer.d.ts +2 -1
- package/dist/src/components/steps/MinimumNightStayPill.d.ts +2 -1
- package/dist/src/components/steps/addons/AddonCard.d.ts +2 -1
- package/dist/src/components/steps/addons/AddonList.d.ts +2 -1
- package/dist/src/components/steps/addons/AddonsNotFoundBlock.d.ts +2 -1
- package/dist/src/components/steps/common/CommonAddonSummary/CommonAddonSummary.d.ts +2 -1
- package/dist/src/components/steps/common/ItemisedFeesListing/ItemisedFeesListing.d.ts +2 -1
- package/dist/src/components/steps/common/ItemisedFeesSummary/ItemisedFeesSummary.d.ts +2 -1
- package/dist/src/components/steps/confirmation/AccountDetails.d.ts +2 -1
- package/dist/src/components/steps/confirmation/PaymentDetails/ExistingCardPicker.d.ts +2 -1
- package/dist/src/components/steps/confirmation/PaymentInformation.d.ts +2 -1
- package/dist/src/components/steps/confirmation/PlanpayLabel.d.ts +2 -1
- package/dist/src/components/steps/confirmation/StepConfirmationAcknowledgement.d.ts +2 -1
- package/dist/src/components/steps/confirmation/StepConfirmationAcknowledgement.js +11 -10
- package/dist/src/components/steps/confirmation/StepConfirmationAcknowledgement.js.map +1 -1
- package/dist/src/components/steps/confirmation/StepConfirmationCheckoutDifferencesModal.d.ts +2 -1
- package/dist/src/components/steps/confirmation/StepConfirmationCommentsComponent.d.ts +2 -1
- package/dist/src/components/steps/confirmation/StepConfirmationForm.d.ts +2 -1
- package/dist/src/components/steps/confirmation/StepConfirmationForm.js +11 -4
- package/dist/src/components/steps/confirmation/StepConfirmationForm.js.map +1 -1
- package/dist/src/components/steps/confirmation/StepConfirmationFormProvider.d.ts +2 -1
- package/dist/src/components/steps/confirmation/StepConfirmationImportantInformation.d.ts +7 -0
- package/dist/src/components/steps/confirmation/StepConfirmationImportantInformation.js +54 -0
- package/dist/src/components/steps/confirmation/StepConfirmationImportantInformation.js.map +1 -0
- package/dist/src/components/steps/confirmation/StepConfirmationLimitedOffer.d.ts +2 -1
- package/dist/src/components/steps/confirmation/StepConfirmationPoliciesSection.d.ts +2 -1
- package/dist/src/components/steps/confirmation/StepConfirmationPolicyBlock.d.ts +2 -1
- package/dist/src/components/steps/confirmation/additionalOffers/AdditionalOffers.d.ts +2 -1
- package/dist/src/components/steps/confirmation/additionalOffers/AdditionalOffersColumn.d.ts +2 -1
- package/dist/src/components/steps/confirmation/additionalOffers/AdditionalOffersModal.d.ts +2 -1
- package/dist/src/components/steps/date/OccupancyWarningBlock.d.ts +2 -1
- package/dist/src/components/steps/date/PeoplePicker.d.ts +2 -1
- package/dist/src/components/steps/date/PeoplePickerRow.d.ts +2 -1
- package/dist/src/components/steps/date/StepDatePricePerRoom.d.ts +2 -1
- package/dist/src/components/steps/date/StepOneDateRange.d.ts +2 -1
- package/dist/src/components/steps/date/StepOneDateRangePicker.d.ts +2 -1
- package/dist/src/components/steps/date/StepOneDateRangePickerLegend.d.ts +2 -1
- package/dist/src/components/steps/date/StepOneNextStepButton.d.ts +2 -1
- package/dist/src/components/steps/date/StepOneStatusPeople.d.ts +2 -1
- package/dist/src/components/steps/hotel/HotelCard.d.ts +2 -1
- package/dist/src/components/steps/hotel/HotelCardList.d.ts +2 -1
- package/dist/src/components/steps/hotel/HotelCardModal.d.ts +2 -1
- package/dist/src/components/steps/hotel/HotelInfoPerksRow.d.ts +2 -1
- package/dist/src/components/steps/hotel/HotelSearchParameters.d.ts +2 -1
- package/dist/src/components/steps/hotel/NoHotelsAvailable.d.ts +2 -1
- package/dist/src/components/steps/room/AvailableUpgradesModal.js +0 -5
- package/dist/src/components/steps/room/AvailableUpgradesModal.js.map +1 -1
- package/dist/src/components/steps/room/ImageGallerySlider.d.ts +2 -1
- package/dist/src/components/steps/room/InactivityWindow.d.ts +2 -1
- package/dist/src/components/steps/room/LargeRoomCard.d.ts +2 -1
- package/dist/src/components/steps/room/NoRoomsFoundBlock.d.ts +2 -1
- package/dist/src/components/steps/room/RatesNotFoundBlock.d.ts +2 -1
- package/dist/src/components/steps/room/RoomList.d.ts +2 -1
- package/dist/src/components/steps/room/RoomList.js +1 -1
- package/dist/src/components/steps/room/RoomList.js.map +1 -1
- package/dist/src/components/steps/room/RoomModal.d.ts +2 -1
- package/dist/src/components/steps/room/RoomModalPerkRow.d.ts +2 -1
- package/dist/src/components/steps/room/StepRoomAlertBlocks.d.ts +2 -1
- package/dist/src/components/steps/room/StepRoomBestRateAlert.d.ts +2 -1
- package/dist/src/components/steps/room/StepRoomErrorForm.d.ts +2 -1
- package/dist/src/components/steps/room/StepRoomHotelDetails.d.ts +2 -1
- package/dist/src/components/steps/room/StepRoomSortBy.d.ts +2 -1
- package/dist/src/components/steps/room/StepRoomSummaryAndButton.d.ts +2 -1
- package/dist/src/components/steps/room/TabGroupedRooms/TabGroupedRoomList.d.ts +2 -1
- package/dist/src/components/steps/room/TabGroupedRooms/TabGroupedRoomList.js +3 -2
- package/dist/src/components/steps/room/TabGroupedRooms/TabGroupedRoomList.js.map +1 -1
- package/dist/src/components/steps/room/TabGroupedRooms/TabGroupedRooms.d.ts +2 -1
- package/dist/src/components/steps/room/TripteaseLodgingSearchSchema.d.ts +2 -1
- package/dist/src/components/steps/room/UserSearchSummary/PromoCodeVerificationAlert.d.ts +2 -1
- package/dist/src/components/steps/room/UserSearchSummary/UserSearchSummary.d.ts +2 -1
- package/dist/src/components/steps/room/UserSearchSummary/UserSearchSummaryForm.d.ts +25 -0
- package/dist/src/components/steps/room/UserSearchSummary/UserSearchSummaryForm.js +38 -0
- package/dist/src/components/steps/room/UserSearchSummary/UserSearchSummaryForm.js.map +1 -0
- package/dist/src/components/steps/room/UserSearchSummary/UserSearchSummaryPromocodeInput.d.ts +2 -1
- package/dist/src/components/steps/room/UserSearchSummary/UserSearchSummaryRow.d.ts +2 -1
- package/dist/src/components/steps/room/UserSearchSummary/UserSearchSummaryRow.js +17 -23
- package/dist/src/components/steps/room/UserSearchSummary/UserSearchSummaryRow.js.map +1 -1
- package/dist/src/components/steps/room/roomBuilderProgress/NumberOfAdultsPicker.d.ts +2 -1
- package/dist/src/components/steps/room/roomBuilderProgress/NumberOfChildrenPicker.d.ts +2 -1
- package/dist/src/components/steps/room/roomBuilderProgress/NumberOfInfantsPicker.d.ts +2 -1
- package/dist/src/components/steps/room/roomBuilderProgress/RoomBuilderProgress.d.ts +2 -1
- package/dist/src/components/steps/room/roomBuilderProgress/RoomBuilderProgressRow.d.ts +2 -1
- package/dist/src/components/steps/room/roomBuilderProgress/RoomBuilderProgressRow.js +59 -28
- package/dist/src/components/steps/room/roomBuilderProgress/RoomBuilderProgressRow.js.map +1 -1
- package/dist/src/components/steps/room/roomDetails/RoomDetails.d.ts +2 -1
- package/dist/src/components/steps/room/roomDetails/RoomDetailsBedsBlock.d.ts +2 -1
- package/dist/src/components/steps/room/roomDetails/RoomDetailsPerkBlock.d.ts +2 -1
- package/dist/src/components/steps/room/roomDetails/RoomDetailsPriceBlock.d.ts +2 -1
- package/dist/src/components/steps/room/roomDetails/roomRates/BookNowButton.d.ts +2 -1
- package/dist/src/components/steps/room/roomDetails/roomRates/MembersOnlyRow.d.ts +2 -1
- package/dist/src/components/steps/room/roomDetails/roomRates/PriceBreakdownBlock.d.ts +3 -2
- package/dist/src/components/steps/room/roomDetails/roomRates/PriceBreakdownBlock.js +2 -2
- package/dist/src/components/steps/room/roomDetails/roomRates/PriceBreakdownBlock.js.map +1 -1
- package/dist/src/components/steps/room/roomDetails/roomRates/ReadMoreRoomRateRow.d.ts +2 -1
- package/dist/src/components/steps/room/roomDetails/roomRates/RoomRateDescriptionTab.d.ts +3 -2
- package/dist/src/components/steps/room/roomDetails/roomRates/RoomRateDetailsAndPriceBreakdownModal.d.ts +2 -1
- package/dist/src/components/steps/room/roomDetails/roomRates/RoomRateListPromotion/RoomRateListPromotion.d.ts +2 -1
- package/dist/src/components/steps/room/roomDetails/roomRates/RoomRatePills.d.ts +2 -1
- package/dist/src/components/steps/room/roomDetails/roomRates/RoomRateRow.d.ts +2 -1
- package/dist/src/components/steps/room/roomDetails/roomRates/RoomRates.d.ts +2 -1
- package/dist/src/components/steps/room/roomDetails/unavailableRoom/UnavailableRoom.d.ts +2 -1
- package/dist/src/components/steps/room/roomFilter/AppliedFiltersBlock.d.ts +2 -1
- package/dist/src/components/steps/room/roomFilter/RoomFilterOverlay.d.ts +2 -1
- package/dist/src/components/steps/room/roomFilter/RoomFilterPriceSlider.d.ts +2 -1
- package/dist/src/components/steps/room/roomFilter/RoomFilterRateType.d.ts +2 -1
- package/dist/src/components/steps/room/roomFilter/RoomFilterRoomType.d.ts +2 -1
- package/dist/src/components/summary/BEMobileSummary.d.ts +2 -1
- package/dist/src/components/summary/BEMobileSummaryModal.d.ts +2 -1
- package/dist/src/components/summary/BESummary.d.ts +2 -1
- package/dist/src/components/summary/BESummaryAddonRow.d.ts +2 -1
- package/dist/src/components/summary/BESummaryPerkBlock.d.ts +2 -1
- package/dist/src/components/summary/BESummaryPrivacyPolicy.d.ts +2 -1
- package/dist/src/components/summary/BESummaryRoomRow.d.ts +2 -1
- package/dist/src/components/summary/BESummaryRoomRow.js +1 -1
- package/dist/src/components/summary/BESummaryRoomRow.js.map +1 -1
- package/dist/src/components/summary/TransportDistanceFromHotelBlock.d.ts +2 -1
- package/dist/src/contexts/BasketContext/BasketContextWrapper.d.ts +1 -1
- package/dist/src/contexts/BasketContext/BasketContextWrapper.js +63 -11
- package/dist/src/contexts/BasketContext/BasketContextWrapper.js.map +1 -1
- package/dist/src/contexts/BookingEngineContext/BookingEngineContextWrapper.d.ts +1 -1
- package/dist/src/contexts/CompanyContext/CompanyContextWrapper.d.ts +2 -2
- package/dist/src/contexts/CompanyContext/CompanyContextWrapper.js +1 -0
- package/dist/src/contexts/CompanyContext/CompanyContextWrapper.js.map +1 -1
- package/dist/src/contexts/ConfirmationFormContext.d.ts +1 -1
- package/dist/src/contexts/ConfirmationStepContext/ConfirmationStepContextWrapper.js +3 -2
- package/dist/src/contexts/ConfirmationStepContext/ConfirmationStepContextWrapper.js.map +1 -1
- package/dist/src/contexts/ConfirmationStepContext/ConfirmationStepErrorModal.d.ts +2 -1
- package/dist/src/contexts/ErrorContext.d.ts +1 -1
- package/dist/src/contexts/FullPageEngineContext/EngineBodyLayout.d.ts +2 -1
- package/dist/src/contexts/FullPageEngineContext/EnginePageLayout.d.ts +2 -1
- package/dist/src/contexts/FullPageEngineContext/FullPageEngineContextWrapper.d.ts +2 -1
- package/dist/src/contexts/FullPageEngineContext/FullPageEngineContextWrapper.js +10 -2
- package/dist/src/contexts/FullPageEngineContext/FullPageEngineContextWrapper.js.map +1 -1
- package/dist/src/contexts/HotelOverridesContext.d.ts +1 -1
- package/dist/src/contexts/ModalContext.d.ts +1 -1
- package/dist/src/contexts/NotificationContext.d.ts +1 -1
- package/dist/src/engines/BookingWizardEngine/BookingWizardEngine.d.ts +7 -0
- package/dist/src/engines/BookingWizardEngine/BookingWizardEngine.js.map +1 -1
- package/dist/src/engines/BookingWizardEngine/BookingWizardEngineElement.d.ts +2 -1
- package/dist/src/engines/BookingWizardEngine/BookingWizardEngineElement.js +1 -0
- package/dist/src/engines/BookingWizardEngine/BookingWizardEngineElement.js.map +1 -1
- package/dist/src/engines/FullPageBookingEngine/FullPageBookingEngineElement.d.ts +2 -1
- package/dist/src/engines/InlineRoomMiniEngine/InlineRoomMiniEngineElement.d.ts +2 -2
- package/dist/src/engines/InlineRoomMiniEngine/InlineRoomMiniEngineElement.js +3 -0
- package/dist/src/engines/InlineRoomMiniEngine/InlineRoomMiniEngineElement.js.map +1 -1
- package/dist/src/engines/MemberPortalWidget/MemberPortalWidgetElement.d.ts +2 -1
- package/dist/src/engines/RecentSearchesEngine/RecentSearchesEngineElement.d.ts +2 -1
- package/dist/src/hooks/RoomRateAvailabilityListFromApi.js +2 -1
- package/dist/src/hooks/RoomRateAvailabilityListFromApi.js.map +1 -1
- package/dist/src/hooks/useNextStepAction.d.ts +2 -1
- package/dist/src/icons/Check.d.ts +2 -1
- package/dist/src/index.d.ts +1 -0
- package/dist/src/index.js +4 -2
- package/dist/src/index.js.map +1 -1
- package/dist/src/models/Api/HotelDTO.d.ts +1 -0
- package/dist/src/models/Api/HotelDTO.js.map +1 -1
- package/dist/src/models/BasketRow.d.ts +2 -1
- package/dist/src/models/BasketRow.js +32 -2
- package/dist/src/models/BasketRow.js.map +1 -1
- package/dist/src/models/BookingWizard/BookingWizardProperty.d.ts +13 -0
- package/dist/src/models/BookingWizard/BookingWizardProperty.js.map +1 -1
- package/dist/src/models/Client/Hotel/Hotel.d.ts +1 -0
- package/dist/src/models/Client/Hotel/Hotel.js.map +1 -1
- package/dist/src/models/RoomstaySession.d.ts +1 -0
- package/dist/src/models/RoomstaySession.js.map +1 -1
- package/dist/src/pages/account/AccountHome/AccountHomePage.d.ts +2 -1
- package/dist/src/pages/account/AccountOutlet.d.ts +1 -1
- package/dist/src/pages/account/AccountRouter.d.ts +2 -1
- package/dist/src/pages/account/ChangePassword/AccountChangePasswordPage.d.ts +2 -1
- package/dist/src/pages/account/Details/AccountDetailsCardsPage.d.ts +2 -1
- package/dist/src/pages/account/Details/AccountDetailsProfilePage.d.ts +2 -1
- package/dist/src/pages/account/Help/AccountHelpPage.d.ts +2 -1
- package/dist/src/pages/account/Reservations/AccountReservationSinglePage.d.ts +2 -1
- package/dist/src/pages/account/Reservations/AccountReservationsPage.d.ts +2 -1
- package/dist/src/pages/findReservation/FindReservation.d.ts +2 -1
- package/dist/src/pages/findReservation/FindReservationResults.d.ts +2 -1
- package/dist/src/pages/findReservation/ReservationRow.d.ts +2 -1
- package/dist/src/pages/findReservation/ReservationRowModal.d.ts +2 -1
- package/dist/src/pages/hotel/HotelInfo.d.ts +2 -1
- package/dist/src/pages/hotel/HotelInfoPlaceholder.d.ts +2 -1
- package/dist/src/pages/steps/StepAddon/StepAddon.d.ts +2 -1
- package/dist/src/pages/steps/StepAddon/StepAddonComponent.d.ts +2 -1
- package/dist/src/pages/steps/StepAddon/StepAddonComponent.js +1 -1
- package/dist/src/pages/steps/StepAddon/StepAddonComponent.js.map +1 -1
- package/dist/src/pages/steps/StepAddon/StepAddonLoader.d.ts +2 -1
- package/dist/src/pages/steps/StepConfirmation/StepConfirmationComponent.d.ts +2 -1
- package/dist/src/pages/steps/StepConfirmation/StepConfirmationComponent.js +1 -1
- package/dist/src/pages/steps/StepConfirmation/StepConfirmationComponent.js.map +1 -1
- package/dist/src/pages/steps/StepConfirmation/StepConfirmationLoader.d.ts +2 -1
- package/dist/src/pages/steps/StepDate/StepDate.d.ts +2 -1
- package/dist/src/pages/steps/StepDate/StepDateComponent.d.ts +2 -1
- package/dist/src/pages/steps/StepDate/StepDateComponent.js +1 -1
- package/dist/src/pages/steps/StepDate/StepDateComponent.js.map +1 -1
- package/dist/src/pages/steps/StepGroupedRoom/StepGroupedRoomComponent.d.ts +2 -1
- package/dist/src/pages/steps/StepGroupedRoom/StepGroupedRoomComponent.js +1 -1
- package/dist/src/pages/steps/StepGroupedRoom/StepGroupedRoomComponent.js.map +1 -1
- package/dist/src/pages/steps/StepGroupedRoom/StepGroupedRoomLoader.d.ts +2 -1
- package/dist/src/pages/steps/StepGuide.d.ts +1 -1
- package/dist/src/pages/steps/StepHotel/StepHotel.d.ts +2 -1
- package/dist/src/pages/steps/StepHotel/StepHotelComponent.d.ts +2 -1
- package/dist/src/pages/steps/StepHotel/StepHotelComponent.js +1 -1
- package/dist/src/pages/steps/StepHotel/StepHotelComponent.js.map +1 -1
- package/dist/src/pages/steps/StepHotel/StepHotelLoader.d.ts +2 -1
- package/dist/src/pages/steps/StepRoom/StepRoomComponent.d.ts +2 -1
- package/dist/src/pages/steps/StepRoom/StepRoomComponent.js +1 -1
- package/dist/src/pages/steps/StepRoom/StepRoomComponent.js.map +1 -1
- package/dist/src/pages/steps/StepRoom/StepRoomLoader.d.ts +2 -1
- package/dist/src/pages/steps/StepThanks/StepThanksComponent.d.ts +2 -1
- package/dist/src/pages/steps/StepThanks/StepThanksComponent.js +1 -1
- package/dist/src/pages/steps/StepThanks/StepThanksComponent.js.map +1 -1
- package/dist/src/providers/DIProvider.d.ts +2 -1
- package/dist/src/providers/FeatureProvider.js +2 -0
- package/dist/src/providers/FeatureProvider.js.map +1 -1
- package/dist/src/providers/feature/ConfirmationImportantInformationFeature.d.ts +10 -0
- package/dist/src/providers/feature/ConfirmationImportantInformationFeature.js +13 -0
- package/dist/src/providers/feature/ConfirmationImportantInformationFeature.js.map +1 -0
- package/dist/src/providers/feature/Feature.d.ts +2 -0
- package/dist/src/providers/feature/Feature.js +4 -0
- package/dist/src/providers/feature/Feature.js.map +1 -1
- package/dist/src/providers/storage/SessionProvider.js +2 -0
- package/dist/src/providers/storage/SessionProvider.js.map +1 -1
- package/dist/src/routes/NaturallyProgressedStepRoute.d.ts +2 -1
- package/dist/src/stories/BookingWizard.stories.d.ts +1 -1
- package/dist/src/stories/ConfirmationModal.stories.d.ts +2 -1
- package/dist/src/stories/DateRangePicker.stories.d.ts +5 -4
- package/dist/src/stories/ErrorModal.stories.d.ts +2 -1
- package/dist/src/stories/EventCarousel.stories.d.ts +2 -2
- package/dist/src/stories/FloatingDateRangePicker.stories.d.ts +2 -2
- package/dist/src/stories/IconNavCard.stories.d.ts +2 -2
- package/dist/src/stories/NumberIncrement.stories.d.ts +2 -1
- package/dist/src/stories/PaymentCard.stories.d.ts +3 -2
- package/dist/src/stories/RadioButtonGroup.stories.d.ts +3 -3
- package/dist/src/stories/Select.stories.d.ts +3 -3
- package/dist/src/stories/SimpleModal.stories.d.ts +2 -1
- package/dist/src/stories/Slider.stories.d.ts +3 -2
- package/dist/src/stories/TabbedModal.stories.d.ts +2 -1
- package/dist/src/stories/Tabs.stories.d.ts +1 -1
- package/dist/src/translations/Translation.d.ts +6 -0
- package/dist/src/translations/Translation.js +6 -0
- package/dist/src/translations/Translation.js.map +1 -1
- package/dist/src/translations/languages/en-gb.js +6 -0
- package/dist/src/translations/languages/en-gb.js.map +1 -1
- package/dist/src/util/TotalCalculator.js.map +1 -1
- package/dist/test.bundle.js +1 -1
- package/dist/tests/offline/entry/config/hotelSpecDefault.d.ts +2 -1
- package/dist/vendors.bundle.js +1 -1
- package/dist/vendors.bundle.js.LICENSE.txt +6 -6
- package/package.json +2 -2
- package/dist/279.bundle.js +0 -1
- package/dist/288.bundle.js +0 -1
- package/dist/370.bundle.js +0 -1
- package/dist/430.bundle.js +0 -1
- package/dist/439.bundle.js +0 -1
- package/dist/446.bundle.js +0 -1
- package/dist/449.bundle.js +0 -1
- package/dist/535.bundle.js +0 -2
- package/dist/537.bundle.js +0 -1
- package/dist/619.bundle.js +0 -1
- package/dist/625.bundle.js +0 -1
- package/dist/659.bundle.js +0 -1
- package/dist/686.bundle.js +0 -1
- package/dist/873.bundle.js +0 -1
- package/dist/903.bundle.js +0 -1
- package/dist/972.bundle.js +0 -1
- package/dist/978.bundle.js +0 -1
- package/dist/984.bundle.js +0 -1
|
@@ -48,7 +48,7 @@ const StepGroupedRoomComponent = () => {
|
|
|
48
48
|
const location = (0, react_router_dom_1.useLocation)();
|
|
49
49
|
const { t } = (0, react_i18next_1.useTranslation)();
|
|
50
50
|
const { currentStep } = (0, react_1.useContext)(contexts_1.FullPageEngineContext);
|
|
51
|
-
return (react_1.default.createElement("div", { className: "container" },
|
|
51
|
+
return (react_1.default.createElement("div", { className: "container rs-step-grouped-room" },
|
|
52
52
|
react_1.default.createElement(BEMobileSummary_1.default, null),
|
|
53
53
|
react_1.default.createElement(StepLayout_1.StepLayoutContainer, null,
|
|
54
54
|
react_1.default.createElement(StepLayout_1.StepLayoutLeftContent, null,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StepGroupedRoomComponent.js","sourceRoot":"/","sources":["src/pages/steps/StepGroupedRoom/StepGroupedRoomComponent.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,iDAAiF;AACjF,+CAA0C;AAC1C,iDAA+C;AAC/C,uDAAqD;AAErD,iFAAyD;AACzD,6EAAqD;AACrD,uEAA4H;AAC5H,+EAAuD;AACvD,wGAAgF;AAChF,gHAAwF;AACxF,6FAA0F;AAC1F,mGAAgG;AAChG,2FAAmE;AACnE,4EAAyE;AACzE,4DAAyD;AACzD,mEAA2C;AAC3C,qEAA6C;AAE7C,MAAM,wBAAwB,GAAG,GAAG,EAAE;IAClC,MAAM,OAAO,GAAG,IAAA,kBAAU,EAAC,+BAAoB,CAAC,CAAC;IACjD,MAAM,QAAQ,GAAG,IAAA,8BAAW,GAAE,CAAC;IAE/B,MAAM,EAAE,CAAC,EAAE,GAAG,IAAA,8BAAc,GAAE,CAAC;IAE/B,MAAM,EAAE,WAAW,EAAE,GAAG,IAAA,kBAAU,EAAC,gCAAqB,CAAC,CAAC;IAE1D,OAAO,CACH,uCAAK,SAAS,EAAC,
|
|
1
|
+
{"version":3,"file":"StepGroupedRoomComponent.js","sourceRoot":"/","sources":["src/pages/steps/StepGroupedRoom/StepGroupedRoomComponent.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,iDAAiF;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U,GAAG,oBAAU,CAAC,MAAM,IAAI,CACvC,8BAAC,mCAAsB;gBACnB,uCAAK,SAAS,EAAC,YAAY;oBACvB,8BAAC,8BAAoB,OAAG,CACtB;gBACN,uCAAK,SAAS,EAAC,mBAAmB;oBAC9B,8BAAC,kCAAwB,OAAG,CAC1B,CACe,CAC5B,CACiB,CACpB,CACT,CAAC;AACN,CAAC,CAAC;AAEF,kBAAe,wBAAwB,CAAC","sourcesContent":["import { BookingEngineContext, FullPageEngineContext } from '@frontend/contexts';\nimport React, { useContext } from 'react';\nimport { useTranslation } from 'react-i18next';\nimport { Link, useLocation } from 'react-router-dom';\n\nimport BackButton from '@/components/generic/BackButton';\nimport Headline from '@/components/generic/Headline';\nimport { StepLayoutContainer, StepLayoutLeftContent, StepLayoutRightContent } from '@/components/generic/Layout/StepLayout';\nimport LineBreak from '@/components/generic/LineBreak';\nimport StepRoomHotelDetails from '@/components/steps/room/StepRoomHotelDetails';\nimport StepRoomSummaryAndButton from '@/components/steps/room/StepRoomSummaryAndButton';\nimport { TabGroupedRooms } from '@/components/steps/room/TabGroupedRooms/TabGroupedRooms';\nimport { UserSearchSummary } from '@/components/steps/room/UserSearchSummary/UserSearchSummary';\nimport BEMobileSummary from '@/components/summary/BEMobileSummary';\nimport { StepRoomFilters } from '@/pages/steps/StepRoom/StepRoomFilters';\nimport { Translation } from '@/translations/Translation';\nimport ScreenSize from '@/util/ScreenSize';\nimport StepManager from '@/util/StepManager';\n\nconst StepGroupedRoomComponent = () => {\n const context = useContext(BookingEngineContext);\n const location = useLocation();\n\n const { t } = useTranslation();\n\n const { currentStep } = useContext(FullPageEngineContext);\n\n return (\n <div className=\"container rs-step-grouped-room\">\n <BEMobileSummary />\n <StepLayoutContainer>\n <StepLayoutLeftContent>\n {context.screenSize > ScreenSize.Medium && (\n <>\n <Link\n to={{\n pathname: StepManager.getPreviousStepUrl(currentStep),\n search: location.search,\n }}\n >\n <BackButton />\n </Link>\n <div className=\"u-marg-top--light u-marg-bottom--heavy\">\n <Headline bold>{t(Translation.Step.Room.ChooseRoom)}</Headline>\n </div>\n </>\n )}\n\n <StepRoomFilters />\n <LineBreak smallMargins />\n\n <UserSearchSummary />\n\n <div className=\"u-marg-top\">\n <TabGroupedRooms />\n </div>\n </StepLayoutLeftContent>\n {context.screenSize > ScreenSize.Medium && (\n <StepLayoutRightContent>\n <div className=\"u-marg-top\">\n <StepRoomHotelDetails />\n </div>\n <div className=\"u-marg-top--heavy\">\n <StepRoomSummaryAndButton />\n </div>\n </StepLayoutRightContent>\n )}\n </StepLayoutContainer>\n </div>\n );\n};\n\nexport default StepGroupedRoomComponent;\n"]}
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export default function StepGroupedRoomLoader(): React.JSX.Element;
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
1
2
|
import { IHotelColorScheme } from '@roomstay/core';
|
|
2
3
|
import { Company } from '../../../models/Client/Hotel/Company';
|
|
3
4
|
import Step from '../Step';
|
|
4
5
|
import StepHotelValidator from './StepHotelValidator';
|
|
5
6
|
declare class StepHotel extends Step {
|
|
6
7
|
constructor();
|
|
7
|
-
getComponent(): () => JSX.Element;
|
|
8
|
+
getComponent(): () => import("react").JSX.Element;
|
|
8
9
|
getValidator(): StepHotelValidator;
|
|
9
10
|
getStepTranslation(): string;
|
|
10
11
|
getColorProfile(company: Company): IHotelColorScheme;
|
|
@@ -135,7 +135,7 @@ const StepHotelComponent = () => {
|
|
|
135
135
|
basketContext.updateBasketRow(basketRow);
|
|
136
136
|
}
|
|
137
137
|
}, []);
|
|
138
|
-
return (react_1.default.createElement("div", { className: "container" },
|
|
138
|
+
return (react_1.default.createElement("div", { className: "container rs-step-hotel" },
|
|
139
139
|
react_1.default.createElement("div", { className: 'row' + (context.screenSize > ScreenSize_1.default.ExtraLarge ? ' no-gutters' : '') },
|
|
140
140
|
react_1.default.createElement("div", { className: "col-md-8" },
|
|
141
141
|
react_1.default.createElement("div", { className: "row align-items-end" },
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StepHotelComponent.js","sourceRoot":"/","sources":["src/pages/steps/StepHotel/StepHotelComponent.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,iDAAgH;AAChH,6CAAsD;AACtD,4DAAoC;AACpC,kDAA0B;AAC1B,+CAA+D;AAC/D,iDAA+C;AAC/C,0DAAuD;AAEvD,6EAAqD;AACrD,+EAAuD;AACvD,+DAAkF;AAClF,kEAA2D;AAC3D,2FAAmE;AACnE,2GAAmF;AACnF,iDAA6C;AAE7C,wCAAqC;AACrC,mEAA2C;AAE3C,IAAK,aAIJ;AAJD,WAAK,aAAa;IACd,kCAAiB,CAAA;IACjB,kCAAiB,CAAA;IACjB,mCAAkB,CAAA;AACtB,CAAC,EAJI,aAAa,KAAb,aAAa,QAIjB;AAOD,MAAM,kBAAkB,GAAG,GAAG,EAAE;;IAC5B,MAAM,EAAE,CAAC,EAAE,GAAG,IAAA,8BAAc,GAAE,CAAC;IAC/B,MAAM,YAAY,GAAG;QACjB,EAAE,KAAK,EAAE,aAAa,CAAC,WAAW,EAAE,IAAI,EAAE,CAAC,CAAC,yBAAW,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC,EAAE;QACrF,EAAE,KAAK,EAAE,aAAa,CAAC,WAAW,EAAE,IAAI,EAAE,CAAC,CAAC,yBAAW,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC,EAAE;QACrF,EAAE,KAAK,EAAE,aAAa,CAAC,YAAY,EAAE,IAAI,EAAE,CAAC,CAAC,yBAAW,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,YAAY,CAAC,EAAE;KAC1F,CAAC;IAEF,MAAM,GAAG,GAAG,IAAA,kBAAU,EAAC,yBAAc,CAAC,CAAC;IACvC,MAAM,OAAO,GAAG,IAAA,kBAA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S,EAAC,0DAA0D;gCACrE,8BAAC,eAAM,IACH,cAAc,QACd,OAAO,EAAE,WAAW,EACpB,KAAK,EAAE,IAAI,EACX,QAAQ,EAAE,aAAa,EACvB,OAAO,EAAC,OAAO,EACf,SAAS,EAAC,MAAM,GAClB,CACA,CACJ,CACJ;oBACN,uCACI,SAAS,EAAE,IAAA,oBAAU,EAAC,oDAAoD,EAAE;4BACxE,mBAAmB,EAAE,OAAO,CAAC,UAAU,IAAI,oBAAU,CAAC,MAAM;yBAC/D,CAAC;wBAEF,8BAAC,kBAAQ,IAAC,OAAO,QAAC,IAAI,EAAC,MAAM,EAAC,OAAO,EAAE,YAAY,EAAE,QAAQ,EAAE,IAAI,MAAK,MAAA,WAAW,CAAC,CAAC,CAAC,0CAAE,KAAK,CAAA,IAAI,MAAM,KAAK,YAAY,CAAC,CAAC,CAAC,CAAC,KAAK,IAC5H,CAAC,CAAC,yBAAW,CAAC,IAAI,CAAC,QAAQ,CAAC,CACtB,CACT,CACJ,CACJ,CACJ;QACN,8BAAC,mBAAS,OAAG;QACb,8BAAC,+BAAqB,OAAG;QACzB,8BAAC,uBAAa,IAAC,SAAS,EAAE,YAAuB,GAAI,CACnD,CACT,CAAC;AACN,CAAC,CAAC;AAEF,kBAAe,kBAAkB,CAAC","sourcesContent":["import { BasketContext, BookingEngineContext, CompanyContext, FullPageEngineContext } from '@frontend/contexts';\nimport { StepHotelViewEvent } from '@frontend/events';\nimport classNames from 'classnames';\nimport dayjs from 'dayjs';\nimport React, { useContext, useEffect, useState } from 'react';\nimport { useTranslation } from 'react-i18next';\nimport { Translation } from 'translations/Translation';\n\nimport BEButton from '@/components/generic/BEButton';\nimport LineBreak from '@/components/generic/LineBreak';\nimport { IDefaultSelectOption, Select } from '@/components/generic/Select/Select';\nimport Text, { TextType } from '@/components/generic/Text';\nimport HotelCardList from '@/components/steps/hotel/HotelCardList';\nimport HotelSearchParameters from '@/components/steps/hotel/HotelSearchParameters';\nimport { useEvent } from '@/hooks/EventHook';\nimport type { Hotel } from '@/models/Client/Hotel/Hotel';\nimport { Color } from '@/util/Color';\nimport ScreenSize from '@/util/ScreenSize';\n\nenum SortByOptions {\n Recommended = 'R',\n LowestPrice = 'L',\n HighestPrice = 'H',\n}\n\ninterface ISortByOption {\n value: SortByOptions;\n text: string;\n}\n\nconst StepHotelComponent = () => {\n const { t } = useTranslation();\n const sortByValues = [\n { value: SortByOptions.Recommended, text: t(Translation.Step.Room.Sort.Recommended) },\n { value: SortByOptions.LowestPrice, text: t(Translation.Step.Room.Sort.LowestPrice) },\n { value: SortByOptions.HighestPrice, text: t(Translation.Step.Room.Sort.HighestPrice) },\n ];\n\n const ccx = useContext(CompanyContext);\n const context = useContext(BookingEngineContext);\n const basketContext = useContext(BasketContext);\n const fullPageContext = useContext(FullPageEngineContext);\n\n const [sortBy, setSortBy] = useState<SortByOptions>(sortByValues[0].value);\n const [city, setCity] = useState(fullPageContext.urlParameters.defaultCity ?? 'All');\n\n const [cityOptions, setCityOptions] = useState<IDefaultSelectOption[]>([]);\n\n const [sortedHotels, setSortedHotels] = useState<Hotel[]>();\n\n const basketRow = basketContext.selectedBasketRow ?? basketContext.currentBasketRows[0];\n\n const { raise } = useEvent();\n\n useEffect(() => {\n const event = new StepHotelViewEvent();\n raise(event);\n }, []);\n\n useEffect(() => {\n const hotelsToShow = ccx.hotels.filter((hotel: Hotel) => {\n if (hotel.address?.city === city) {\n return hotel;\n } else if (city === 'All') {\n return hotel;\n }\n });\n\n if (sortBy === SortByOptions.Recommended) {\n setSortedHotels(hotelsToShow);\n } else {\n setSortedHotels(\n [...hotelsToShow].sort((a: Hotel, b: Hotel) => {\n switch (sortBy) {\n case SortByOptions.LowestPrice:\n return (a.lowestPrice?.value as number) - (b.lowestPrice?.value as number);\n case SortByOptions.HighestPrice:\n return (b.lowestPrice?.value as number) - (a.lowestPrice?.value as number);\n }\n })\n );\n }\n }, [ccx.hotels, sortBy, city]);\n\n useEffect(() => {\n const cities: { [cityName: string]: any } = {};\n\n ccx.hotels.forEach((hotel: Hotel) => {\n // We must wait till address is loaded\n if (hotel.address) {\n cities[hotel.address.city as string] = { value: hotel.address.city, text: hotel.address.city };\n }\n });\n\n setCityOptions([{ value: 'All', text: 'All' }, ...Object.values(cities)]);\n }, [ccx.hotels]);\n\n useEffect(() => {\n ccx.hotels.forEach((hotel) => {\n ccx.updateLowestPricePerNight(hotel, basketRow);\n });\n }, [basketRow?.getStartDate(), basketRow?.getEndDate(), basketRow?.getAdults(), basketRow?.getChildren(), basketRow?.getInfants(), basketRow?.getPromoCode()]);\n\n const changeCountry = (selected: string) => {\n setCity(selected);\n };\n\n const changeFilter = (selected: SortByOptions) => {\n setSortBy(selected);\n };\n\n const clearFilters = () => {\n setCity(cityOptions[0]?.value);\n setSortBy(sortByValues[0].value);\n };\n\n useEffect(() => {\n const startDate = basketRow.getStartDate();\n const endDate = basketRow.getEndDate();\n\n if (!startDate || !endDate) {\n if (startDate) {\n basketRow.setEndDate(startDate.add(1, 'day'));\n } else {\n basketRow.setStartDate(dayjs().add(1, 'day'));\n basketRow.setEndDate(dayjs().add(2, 'day'));\n }\n\n basketContext.updateBasketRow(basketRow);\n }\n }, []);\n\n return (\n <div className=\"container\">\n <div className={'row' + (context.screenSize > ScreenSize.ExtraLarge ? ' no-gutters' : '')}>\n <div className=\"col-md-8\">\n <div className=\"row align-items-end\">\n <div className=\"col-6 col-md-4 col-lg-3\">\n <Text type={TextType.Label} color={Color.DarkGrey}>\n <strong>{t(Translation.Step.Room.SortBy)}</strong>\n </Text>\n <div>\n <Select<ISortByOption, 'value'> nativeOnMobile options={sortByValues} value={sortBy} onChange={changeFilter} keyName=\"value\" labelName=\"text\" />\n </div>\n </div>\n <div className=\"col-6 col-md-2 col-lg-2\">\n <div>\n <Text type={TextType.Label} color={Color.DarkGrey}>\n <strong>{t(Translation.Step.Hotel.Cities)}</strong>\n </Text>\n <div className=\"filter-button d-flex align-items-center u-cursor-pointer\">\n <Select<IDefaultSelectOption, 'value'>\n nativeOnMobile\n options={cityOptions}\n value={city}\n onChange={changeCountry}\n keyName=\"value\"\n labelName=\"text\"\n />\n </div>\n </div>\n </div>\n <div\n className={classNames('col-sm-12 col-md-2 col-lg-1 u-flex u-flex-flex-end', {\n 'u-marg-top--light': context.screenSize <= ScreenSize.Medium,\n })}\n >\n <BEButton rounded size=\"tiny\" onClick={clearFilters} disabled={city === cityOptions[0]?.value && sortBy === sortByValues[0].value}>\n {t(Translation.Misc.ClearAll)}\n </BEButton>\n </div>\n </div>\n </div>\n </div>\n <LineBreak />\n <HotelSearchParameters />\n <HotelCardList hotelList={sortedHotels as Hotel[]} />\n </div>\n );\n};\n\nexport default StepHotelComponent;\n"]}
|
|
1
|
+
{"version":3,"file":"StepHotelComponent.js","sourceRoot":"/","sources":["src/pages/steps/StepHotel/StepHotelComponent.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,iDAAgH;AAChH,6CAAsD;AACtD,4DAAoC;AACpC,kDAA0B;AAC1B,+CAA+D;AAC/D,iDAA+C;AAC/C,0DAAuD;AAEvD,6EAAqD;AACrD,+EAAuD;AACvD,+DAAkF;AAClF,kEAA2D;AAC3D,2FAAmE;AACnE,2GAAmF;AACnF,iDAA6C;AAE7C,wCAAqC;AACrC,mEAA2C;AAE3C,IAAK,aAIJ;AAJD,WAAK,aAAa;IACd,kCAAiB,CAAA;IACjB,kCAAiB,CAAA;IACjB,mCAAkB,CAAA;AACtB,CAAC,EAJI,aAAa,KAAb,aAAa,QAIjB;AAOD,MAAM,kBAAkB,GAAG,GAAG,EAAE;;IAC5B,MAAM,EAAE,CAAC,EAAE,GAAG,IAAA,8BAAc,GAAE,CAAC;IAC/B,MAAM,YAAY,GAAG;QACjB,EAAE,KAAK,EAAE,aAAa,CAAC,WAAW,EAAE,IAAI,EAAE,CAAC,CAAC,yBAAW,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC,EAAE;QACrF,EAAE,KAAK,EAA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import { StepHotelViewEvent } from '@frontend/events';\nimport classNames from 'classnames';\nimport dayjs from 'dayjs';\nimport React, { useContext, useEffect, useState } from 'react';\nimport { useTranslation } from 'react-i18next';\nimport { Translation } from 'translations/Translation';\n\nimport BEButton from '@/components/generic/BEButton';\nimport LineBreak from '@/components/generic/LineBreak';\nimport { IDefaultSelectOption, Select } from '@/components/generic/Select/Select';\nimport Text, { TextType } from '@/components/generic/Text';\nimport HotelCardList from '@/components/steps/hotel/HotelCardList';\nimport HotelSearchParameters from '@/components/steps/hotel/HotelSearchParameters';\nimport { useEvent } from '@/hooks/EventHook';\nimport type { Hotel } from '@/models/Client/Hotel/Hotel';\nimport { Color } from '@/util/Color';\nimport ScreenSize from '@/util/ScreenSize';\n\nenum SortByOptions {\n Recommended = 'R',\n LowestPrice = 'L',\n HighestPrice = 'H',\n}\n\ninterface ISortByOption {\n value: SortByOptions;\n text: string;\n}\n\nconst StepHotelComponent = () => {\n const { t } = useTranslation();\n const sortByValues = [\n { value: SortByOptions.Recommended, text: t(Translation.Step.Room.Sort.Recommended) },\n { value: SortByOptions.LowestPrice, text: t(Translation.Step.Room.Sort.LowestPrice) },\n { value: SortByOptions.HighestPrice, text: t(Translation.Step.Room.Sort.HighestPrice) },\n ];\n\n const ccx = useContext(CompanyContext);\n const context = useContext(BookingEngineContext);\n const basketContext = useContext(BasketContext);\n const fullPageContext = useContext(FullPageEngineContext);\n\n const [sortBy, setSortBy] = useState<SortByOptions>(sortByValues[0].value);\n const [city, setCity] = useState(fullPageContext.urlParameters.defaultCity ?? 'All');\n\n const [cityOptions, setCityOptions] = useState<IDefaultSelectOption[]>([]);\n\n const [sortedHotels, setSortedHotels] = useState<Hotel[]>();\n\n const basketRow = basketContext.selectedBasketRow ?? basketContext.currentBasketRows[0];\n\n const { raise } = useEvent();\n\n useEffect(() => {\n const event = new StepHotelViewEvent();\n raise(event);\n }, []);\n\n useEffect(() => {\n const hotelsToShow = ccx.hotels.filter((hotel: Hotel) => {\n if (hotel.address?.city === city) {\n return hotel;\n } else if (city === 'All') {\n return hotel;\n }\n });\n\n if (sortBy === SortByOptions.Recommended) {\n setSortedHotels(hotelsToShow);\n } else {\n setSortedHotels(\n [...hotelsToShow].sort((a: Hotel, b: Hotel) => {\n switch (sortBy) {\n case SortByOptions.LowestPrice:\n return (a.lowestPrice?.value as number) - (b.lowestPrice?.value as number);\n case SortByOptions.HighestPrice:\n return (b.lowestPrice?.value as number) - (a.lowestPrice?.value as number);\n }\n })\n );\n }\n }, [ccx.hotels, sortBy, city]);\n\n useEffect(() => {\n const cities: { [cityName: string]: any } = {};\n\n ccx.hotels.forEach((hotel: Hotel) => {\n // We must wait till address is loaded\n if (hotel.address) {\n cities[hotel.address.city as string] = { value: hotel.address.city, text: hotel.address.city };\n }\n });\n\n setCityOptions([{ value: 'All', text: 'All' }, ...Object.values(cities)]);\n }, [ccx.hotels]);\n\n useEffect(() => {\n ccx.hotels.forEach((hotel) => {\n ccx.updateLowestPricePerNight(hotel, basketRow);\n });\n }, [basketRow?.getStartDate(), basketRow?.getEndDate(), basketRow?.getAdults(), basketRow?.getChildren(), basketRow?.getInfants(), basketRow?.getPromoCode()]);\n\n const changeCountry = (selected: string) => {\n setCity(selected);\n };\n\n const changeFilter = (selected: SortByOptions) => {\n setSortBy(selected);\n };\n\n const clearFilters = () => {\n setCity(cityOptions[0]?.value);\n setSortBy(sortByValues[0].value);\n };\n\n useEffect(() => {\n const startDate = basketRow.getStartDate();\n const endDate = basketRow.getEndDate();\n\n if (!startDate || !endDate) {\n if (startDate) {\n basketRow.setEndDate(startDate.add(1, 'day'));\n } else {\n basketRow.setStartDate(dayjs().add(1, 'day'));\n basketRow.setEndDate(dayjs().add(2, 'day'));\n }\n\n basketContext.updateBasketRow(basketRow);\n }\n }, []);\n\n return (\n <div className=\"container rs-step-hotel\">\n <div className={'row' + (context.screenSize > ScreenSize.ExtraLarge ? ' no-gutters' : '')}>\n <div className=\"col-md-8\">\n <div className=\"row align-items-end\">\n <div className=\"col-6 col-md-4 col-lg-3\">\n <Text type={TextType.Label} color={Color.DarkGrey}>\n <strong>{t(Translation.Step.Room.SortBy)}</strong>\n </Text>\n <div>\n <Select<ISortByOption, 'value'> nativeOnMobile options={sortByValues} value={sortBy} onChange={changeFilter} keyName=\"value\" labelName=\"text\" />\n </div>\n </div>\n <div className=\"col-6 col-md-2 col-lg-2\">\n <div>\n <Text type={TextType.Label} color={Color.DarkGrey}>\n <strong>{t(Translation.Step.Hotel.Cities)}</strong>\n </Text>\n <div className=\"filter-button d-flex align-items-center u-cursor-pointer\">\n <Select<IDefaultSelectOption, 'value'>\n nativeOnMobile\n options={cityOptions}\n value={city}\n onChange={changeCountry}\n keyName=\"value\"\n labelName=\"text\"\n />\n </div>\n </div>\n </div>\n <div\n className={classNames('col-sm-12 col-md-2 col-lg-1 u-flex u-flex-flex-end', {\n 'u-marg-top--light': context.screenSize <= ScreenSize.Medium,\n })}\n >\n <BEButton rounded size=\"tiny\" onClick={clearFilters} disabled={city === cityOptions[0]?.value && sortBy === sortByValues[0].value}>\n {t(Translation.Misc.ClearAll)}\n </BEButton>\n </div>\n </div>\n </div>\n </div>\n <LineBreak />\n <HotelSearchParameters />\n <HotelCardList hotelList={sortedHotels as Hotel[]} />\n </div>\n );\n};\n\nexport default StepHotelComponent;\n"]}
|
|
@@ -47,7 +47,7 @@ const StepRoomComponent = () => {
|
|
|
47
47
|
const location = (0, react_router_dom_1.useLocation)();
|
|
48
48
|
const { t } = (0, react_i18next_1.useTranslation)();
|
|
49
49
|
const { currentStep } = (0, react_1.useContext)(contexts_1.FullPageEngineContext);
|
|
50
|
-
return (react_1.default.createElement("div", { className: "container" },
|
|
50
|
+
return (react_1.default.createElement("div", { className: "container rs-step-room" },
|
|
51
51
|
react_1.default.createElement(BEMobileSummary_1.default, null),
|
|
52
52
|
react_1.default.createElement(StepLayout_1.StepLayoutContainer, null,
|
|
53
53
|
react_1.default.createElement(StepLayout_1.StepLayoutLeftContent, null,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StepRoomComponent.js","sourceRoot":"/","sources":["src/pages/steps/StepRoom/StepRoomComponent.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,iDAAiF;AACjF,+CAA0C;AAC1C,iDAA+C;AAC/C,uDAAqD;AACrD,0DAAuD;AAEvD,iFAAyD;AACzD,6EAAqD;AACrD,uEAA4H;AAC5H,+EAAuD;AACvD,gFAAwD;AACxD,wGAAgF;AAChF,gHAAwF;AACxF,2FAAmE;AACnE,4EAAyE;AACzE,mEAA2C;AAC3C,qEAA6C;AAE7C,MAAM,iBAAiB,GAAG,GAAG,EAAE;IAC3B,MAAM,OAAO,GAAG,IAAA,kBAAU,EAAC,+BAAoB,CAAC,CAAC;IACjD,MAAM,QAAQ,GAAG,IAAA,8BAAW,GAAE,CAAC;IAE/B,MAAM,EAAE,CAAC,EAAE,GAAG,IAAA,8BAAc,GAAE,CAAC;IAE/B,MAAM,EAAE,WAAW,EAAE,GAAG,IAAA,kBAAU,EAAC,gCAAqB,CAAC,CAAC;IAE1D,OAAO,CACH,uCAAK,SAAS,EAAC,
|
|
1
|
+
{"version":3,"file":"StepRoomComponent.js","sourceRoot":"/","sources":["src/pages/steps/StepRoom/StepRoomComponent.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,iDAAiF;AACjF,+CAA0C;AAC1C,iDAA+C;AAC/C,uDAAqD;AACrD,0DAAuD;AAEvD,iFAAyD;AACzD,6EAAqD;AACrD,uEAA4H;AAC5H,+EAAuD;AACvD,gFAAwD;AACxD,wGAAgF;AAChF,gHAAwF;AACxF,2FAAmE;AACnE,4EAAyE;AACzE,mEAA2C;AAC3C,qEAA6C;AAE7C,MAAM,iBAAiB,GAAG,GAAG,EAAE;IAC3B,MAAM,OAAO,GAAG,IAAA,kBAAU,EAAC,+BAAoB,CAAC,CAAC;IACjD,MAAM,QAAQ,GAAG,IAAA,8BAAW,GAAE,CAAC;IAE/B,MAAM,EAAE,CAAC,EAAE,GAAG,IAAA,8BAAc,GAAE,CAAC;IAE/B,MAAM,EAAE,WAAW,EAAE,GAAG,IAAA,kBAAU,EAAC,gCAAqB,CAAC,CAAC;IAE1D,OAAO,CACH,uCAAK,SAAS,EAAC,wBAAwB;QACnC,8BAAC,yBAAe,OAAG;QACnB,8BAAC,gCAAmB;YAChB,8BAAC,kCAAqB;gBACjB,OAAO,CAAC,UAAU,GAAG,oBAAU,CAAC,MAAM,IAAI,CACvC;oBACI,8BAAC,uBAAI,IACD,EAAE,EAAE;4BACA,QAAQ,EAAE,qBAAW,CAAC,kBAAkB,CAAC,WAAW,CAAC;4BACrD,MAAM,EAAE,QAAQ,CAAC,MAAM;yBAC1B;wBAED,8BAAC,oBAAU,OAAG,CACX;oBACP,uCAAK,SAAS,EAAC,wCAAwC;wBACnD,8BAAC,kBAAQ,IAAC,IAAI,UAAE,CAAC,CAAC,yBAAW,CAAC,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,CAAY,CAC7D,CACP,CACN;gBACD,8BAAC,iCAAe,OAAG,CACC;YACvB,OAAO,CAAC,UAAU,GAAG,oBAAU,CAAC,MAAM,IAAI,CACvC,8BAAC,mCAAsB;gBACnB,8BAAC,8BAAoB,OAAG,CACH,CAC5B,CACiB;QACrB,OAAO,CAAC,UAAU,GAAG,oBAAU,CAAC,MAAM,IAAI,8BAAC,mBAAS,OAAG;QACxD,8BAAC,gCAAmB;YAChB,8BAAC,kCAAqB;gBAClB,8BAAC,kBAAQ,OAAG,CACQ;YACxB,8BAAC,mCAAsB;gBACnB,8BAAC,kCAAwB,OAAG,CACP,CACP,CACpB,CACT,CAAC;AACN,CAAC,CAAC;AAEF,kBAAe,iBAAiB,CAAC","sourcesContent":["import { BookingEngineContext, FullPageEngineContext } from '@frontend/contexts';\nimport React, { useContext } from 'react';\nimport { useTranslation } from 'react-i18next';\nimport { Link, useLocation } from 'react-router-dom';\nimport { Translation } from 'translations/Translation';\n\nimport BackButton from '@/components/generic/BackButton';\nimport Headline from '@/components/generic/Headline';\nimport { StepLayoutContainer, StepLayoutLeftContent, StepLayoutRightContent } from '@/components/generic/Layout/StepLayout';\nimport LineBreak from '@/components/generic/LineBreak';\nimport RoomList from '@/components/steps/room/RoomList';\nimport StepRoomHotelDetails from '@/components/steps/room/StepRoomHotelDetails';\nimport StepRoomSummaryAndButton from '@/components/steps/room/StepRoomSummaryAndButton';\nimport BEMobileSummary from '@/components/summary/BEMobileSummary';\nimport { StepRoomFilters } from '@/pages/steps/StepRoom/StepRoomFilters';\nimport ScreenSize from '@/util/ScreenSize';\nimport StepManager from '@/util/StepManager';\n\nconst StepRoomComponent = () => {\n const context = useContext(BookingEngineContext);\n const location = useLocation();\n\n const { t } = useTranslation();\n\n const { currentStep } = useContext(FullPageEngineContext);\n\n return (\n <div className=\"container rs-step-room\">\n <BEMobileSummary />\n <StepLayoutContainer>\n <StepLayoutLeftContent>\n {context.screenSize > ScreenSize.Medium && (\n <>\n <Link\n to={{\n pathname: StepManager.getPreviousStepUrl(currentStep),\n search: location.search,\n }}\n >\n <BackButton />\n </Link>\n <div className=\"u-marg-top--light u-marg-bottom--heavy\">\n <Headline bold>{t(Translation.Step.Room.ChooseRoom)}</Headline>\n </div>\n </>\n )}\n <StepRoomFilters />\n </StepLayoutLeftContent>\n {context.screenSize > ScreenSize.Medium && (\n <StepLayoutRightContent>\n <StepRoomHotelDetails />\n </StepLayoutRightContent>\n )}\n </StepLayoutContainer>\n {context.screenSize > ScreenSize.Medium && <LineBreak />}\n <StepLayoutContainer>\n <StepLayoutLeftContent>\n <RoomList />\n </StepLayoutLeftContent>\n <StepLayoutRightContent>\n <StepRoomSummaryAndButton />\n </StepLayoutRightContent>\n </StepLayoutContainer>\n </div>\n );\n};\n\nexport default StepRoomComponent;\n"]}
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export default function StepRoomLoader(): React.JSX.Element;
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export default function StepThanksComponent(): React.JSX.Element;
|
|
@@ -89,7 +89,7 @@ function StepThanksComponent() {
|
|
|
89
89
|
basketContext.finish();
|
|
90
90
|
};
|
|
91
91
|
}, []);
|
|
92
|
-
return (react_1.default.createElement("div", { className: "container u-marg-top--heavy" },
|
|
92
|
+
return (react_1.default.createElement("div", { className: "container u-marg-top--heavy rs-step-thanks" },
|
|
93
93
|
react_1.default.createElement("div", { className: "row justify-content-center" },
|
|
94
94
|
react_1.default.createElement("div", { className: "col-lg-8 col-md-12 u-flex align-items-center u-flex-direction-column" },
|
|
95
95
|
react_1.default.createElement("div", { className: "u-marg-bottom" },
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StepThanksComponent.js","sourceRoot":"/","sources":["src/pages/steps/StepThanks/StepThanksComponent.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,iDAAmE;AACnE,2CAA4D;AAC5D,kDAA0B;AAC1B,+CAA4E;AAC5E,iDAA+C;AAC/C,uDAAwC;AACxC,0DAAuD;AAEvD,6EAAqD;AACrD,6EAAqD;AACrD,6EAAqD;AACrD,uEAAgE;AAChE,+EAAuD;AACvD,kEAA2D;AAC3D,kFAA+E;AAC/E,wGAAqG;AACrG,2GAAwG;AACxG,qCAA+C;AAI/C,4FAAoE;AACpE,wCAAqC;AACrC,wDAAiD;AACjD,4DAAsE;AAEtE,SAAwB,mBAAmB;;IACvC,MAAM,aAAa,GAAG,IAAA,kBAAU,EAAC,wBAAa,CAAC,CAAC;IAEhD,MAAM,EAAE,KAAK,EAAE,GAAG,IAAA,uBAAe,GAAE,CAAC;IACpC,MAAM,GAAG,GAAG,IAAA,kBAAU,EAAC,yBAAc,CAAC,CAAC;IACvC,MAAM,EAAE,KAAK,EAAE,GAAG,IAAA,gBAAQ,GAAE,CAAC;IAE7B,MAAM,CAAC,YAAY,EAAE,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AAtKD,sCAsKC","sourcesContent":["import { BasketContext, CompanyContext } from '@frontend/contexts';\nimport { useCurrentHotel, useEvent } from '@frontend/hooks';\nimport dayjs from 'dayjs';\nimport React, { useCallback, useContext, useEffect, useState } from 'react';\nimport { useTranslation } from 'react-i18next';\nimport { Link } from 'react-router-dom';\nimport { Translation } from 'translations/Translation';\n\nimport BEButton from '@/components/generic/BEButton';\nimport Currency from '@/components/generic/Currency';\nimport Headline from '@/components/generic/Headline';\nimport Icon, { IconType } from '@/components/generic/Icon/Icon';\nimport LineBreak from '@/components/generic/LineBreak';\nimport Text, { TextType } from '@/components/generic/Text';\nimport { InlineSignUpSection } from '@/components/members/InlineSignUpSection';\nimport { CommonAddonSummary } from '@/components/steps/common/CommonAddonSummary/CommonAddonSummary';\nimport { ItemisedFeesSummary } from '@/components/steps/common/ItemisedFeesSummary/ItemisedFeesSummary';\nimport { StepThanksViewEvent } from '@/events';\nimport { IEventReservation } from '@/models/Api/IEventReservation';\nimport { ReservationAddonDTO, ReservationDTO } from '@/models/Api/ReservationsDTO';\nimport { SimpleItemisedFee } from '@/models/Fee';\nimport ReservationRow from '@/pages/findReservation/ReservationRow';\nimport { Color } from '@/util/Color';\nimport { TextAlign } from '@/util/TextAlignment';\nimport { calculateTotalForReservation } from '@/util/TotalCalculator';\n\nexport default function StepThanksComponent() {\n const basketContext = useContext(BasketContext);\n\n const { hotel } = useCurrentHotel();\n const ccx = useContext(CompanyContext);\n const { raise } = useEvent();\n\n const [itemisedFees, setItemisedFees] = useState<SimpleItemisedFee[]>([]);\n\n const checkoutData = basketContext.reservationData;\n\n const isFromRoomstay = checkoutData?.itineraryNumber?.startsWith('RS');\n\n const { t } = useTranslation();\n\n const total = useCallback(() => {\n if (checkoutData?.reservations) {\n const reservations: IEventReservation[] = checkoutData?.reservations?.map((obj: ReservationDTO) => {\n const nightKeys = Object.keys(obj.nights);\n const dateFormat = 'YYYY-MM-DDTHH:mm:ss';\n\n return {\n reservationId: obj.reservationNumber,\n checkInTime: dayjs(nightKeys[0]).format(dateFormat),\n checkOutTime: dayjs(nightKeys[nightKeys.length - 1])\n .add(1, 'day')\n .format(dateFormat),\n totalPrice: obj.total.afterTax,\n priceCurrency: ccx.currentCurrency,\n };\n });\n const event = new StepThanksViewEvent(reservations, basketContext.currentBasketRows, hotel);\n raise(event);\n\n return calculateTotalForReservation(checkoutData, !isFromRoomstay);\n }\n\n return 0;\n }, [checkoutData]);\n\n useEffect(() => {\n setItemisedFees(checkoutData.feesSummary || []);\n }, [checkoutData]);\n\n const addons: ReservationAddonDTO[] = [];\n const comments: string[] = [];\n\n useEffect(() => {\n return () => {\n basketContext.finish();\n };\n }, []);\n\n return (\n <div className=\"container u-marg-top--heavy\">\n <div className=\"row justify-content-center\">\n <div className=\"col-lg-8 col-md-12 u-flex align-items-center u-flex-direction-column\">\n <div className=\"u-marg-bottom\">\n <Icon icon={IconType.Check} size=\"48px\" color={Color.White} backgroundColor={Color.Accent} borderRadius=\"round\" noPadding />\n </div>\n <div className=\"u-marg-bottom\" style={{ maxWidth: '530px' }}>\n <Headline size=\"large\" align={TextAlign.Center}>\n {t(Translation.Step.Thanks.ThankYouHeadline, { hotel: hotel?.name })}\n </Headline>\n </div>\n <div className=\"u-marg-bottom--heavy\">\n <Text color={Color.DarkGrey}>\n {t(Translation.Step.Thanks.InvoiceNumber)} {checkoutData.itineraryNumber}\n </Text>\n </div>\n\n <div className=\"u-marg-bottom--massive\">\n <Link to=\"/\">\n <BEButton>{t(Translation.Step.Thanks.GoBackHome)}</BEButton>\n </Link>\n </div>\n\n {checkoutData?.reservations?.[0]?.guest && <InlineSignUpSection reservation={checkoutData.reservations[0]} hotelId={hotel?.hotelID || ''} />}\n\n <>\n <div className=\"u-marg-top w-100\">\n {checkoutData?.reservations?.map((obj: ReservationDTO) => {\n if (obj.addons) {\n const nights = Object.keys(obj.nights);\n obj.addons.forEach((addon) => {\n if (isFromRoomstay) {\n addons.push({ ...addon, nights: nights.length });\n } else {\n addons.push(addon);\n }\n });\n }\n\n if (obj.comments) {\n obj.comments.map((comment: string) => {\n comments.push(comment);\n });\n }\n\n return <ReservationRow reservation={obj} key={obj.reservationNumber} />;\n })}\n </div>\n <LineBreak />\n\n <div className=\"w-100\">\n <CommonAddonSummary addons={addons} />\n {comments.length >= 1 && (\n <div className=\"u-marg-bottom--heavy\">\n <div className=\"u-marg-bottom\">\n <Text type={TextType.Label} color={Color.Grey}>\n {t(Translation.Step.Confirmation.Comments)}\n </Text>\n </div>\n {comments.map((comment, index) => (\n <Text\n style={{\n whiteSpace: 'pre',\n }}\n key={index}\n type={TextType.Small}\n >\n {comment}\n </Text>\n ))}\n </div>\n )}\n\n <ItemisedFeesSummary fees={itemisedFees} />\n\n <Text type={TextType.Small} align={TextAlign.Right}>\n {t(Translation.Misc.Total)}\n </Text>\n <Headline bold size=\"large\" align={TextAlign.Right}>\n <Currency>{total}</Currency>\n </Headline>\n <Text type={TextType.Small} align={TextAlign.Right} color={Color.DarkGrey}>\n <span dangerouslySetInnerHTML={{ __html: t(Translation.Step.Thanks.IncludingTaxes) }}></span>\n </Text>\n </div>\n </>\n </div>\n </div>\n {checkoutData?.reservations?.map((obj: ReservationDTO, index) => {\n const nightKeys = Object.keys(obj.nights);\n\n const firstNight = dayjs(nightKeys[0]);\n const lastNight = dayjs(nightKeys[nightKeys.length - 1]).add(1, 'day');\n\n return (\n <script key={index} type=\"application/ld+json\">\n {JSON.stringify({\n '@context': 'http://schema.org',\n '@type': 'LodgingReservation',\n reservationId: obj.reservationNumber,\n reservationStatus: 'http://schema.org/ReservationConfirmed',\n checkinTime: firstNight.format('YYYY-MM-DDTHH:mm:ss'),\n checkoutTime: lastNight.format('YYYY-MM-DDTHH:mm:ss'),\n totalPrice: obj.total.afterTax,\n basePrice: obj.total.beforeTax,\n priceCurrency: ccx.currentCurrency,\n })}\n </script>\n );\n })}\n </div>\n );\n}\n"]}
|
|
1
|
+
{"version":3,"file":"StepThanksComponent.js","sourceRoot":"/","sources":["src/pages/ste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,SAAS,GAAG,IAAA,eAAK,EAAC,SAAS,CAAC,SAAS,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC;YAEvE,OAAO,CACH,0CAAQ,GAAG,EAAE,KAAK,EAAE,IAAI,EAAC,qBAAqB,IACzC,IAAI,CAAC,SAAS,CAAC;gBACZ,UAAU,EAAE,mBAAmB;gBAC/B,OAAO,EAAE,oBAAoB;gBAC7B,aAAa,EAAE,GAAG,CAAC,iBAAiB;gBACpC,iBAAiB,EAAE,wCAAwC;gBAC3D,WAAW,EAAE,UAAU,CAAC,MAAM,CAAC,qBAAqB,CAAC;gBACrD,YAAY,EAAE,SAAS,CAAC,MAAM,CAAC,qBAAqB,CAAC;gBACrD,UAAU,EAAE,GAAG,CAAC,KAAK,CAAC,QAAQ;gBAC9B,SAAS,EAAE,GAAG,CAAC,KAAK,CAAC,SAAS;gBAC9B,aAAa,EAAE,GAAG,CAAC,eAAe;aACrC,CAAC,CACG,CACZ,CAAC;QACN,CAAC,CAAC,CACA,CACT,CAAC;AACN,CAAC;AAtKD,sCAsKC","sourcesContent":["import { BasketContext, CompanyContext } from '@frontend/contexts';\nimport { useCurrentHotel, useEvent } from '@frontend/hooks';\nimport dayjs from 'dayjs';\nimport React, { useCallback, useContext, useEffect, useState } from 'react';\nimport { useTranslation } from 'react-i18next';\nimport { Link } from 'react-router-dom';\nimport { Translation } from 'translations/Translation';\n\nimport BEButton from '@/components/generic/BEButton';\nimport Currency from '@/components/generic/Currency';\nimport Headline from '@/components/generic/Headline';\nimport Icon, { IconType } from '@/components/generic/Icon/Icon';\nimport LineBreak from '@/components/generic/LineBreak';\nimport Text, { TextType } from '@/components/generic/Text';\nimport { InlineSignUpSection } from '@/components/members/InlineSignUpSection';\nimport { CommonAddonSummary } from '@/components/steps/common/CommonAddonSummary/CommonAddonSummary';\nimport { ItemisedFeesSummary } from '@/components/steps/common/ItemisedFeesSummary/ItemisedFeesSummary';\nimport { StepThanksViewEvent } from '@/events';\nimport { IEventReservation } from '@/models/Api/IEventReservation';\nimport { ReservationAddonDTO, ReservationDTO } from '@/models/Api/ReservationsDTO';\nimport { SimpleItemisedFee } from '@/models/Fee';\nimport ReservationRow from '@/pages/findReservation/ReservationRow';\nimport { Color } from '@/util/Color';\nimport { TextAlign } from '@/util/TextAlignment';\nimport { calculateTotalForReservation } from '@/util/TotalCalculator';\n\nexport default function StepThanksComponent() {\n const basketContext = useContext(BasketContext);\n\n const { hotel } = useCurrentHotel();\n const ccx = useContext(CompanyContext);\n const { raise } = useEvent();\n\n const [itemisedFees, setItemisedFees] = useState<SimpleItemisedFee[]>([]);\n\n const checkoutData = basketContext.reservationData;\n\n const isFromRoomstay = checkoutData?.itineraryNumber?.startsWith('RS');\n\n const { t } = useTranslation();\n\n const total = useCallback(() => {\n if (checkoutData?.reservations) {\n const reservations: IEventReservation[] = checkoutData?.reservations?.map((obj: ReservationDTO) => {\n const nightKeys = Object.keys(obj.nights);\n const dateFormat = 'YYYY-MM-DDTHH:mm:ss';\n\n return {\n reservationId: obj.reservationNumber,\n checkInTime: dayjs(nightKeys[0]).format(dateFormat),\n checkOutTime: dayjs(nightKeys[nightKeys.length - 1])\n .add(1, 'day')\n .format(dateFormat),\n totalPrice: obj.total.afterTax,\n priceCurrency: ccx.currentCurrency,\n };\n });\n const event = new StepThanksViewEvent(reservations, basketContext.currentBasketRows, hotel);\n raise(event);\n\n return calculateTotalForReservation(checkoutData, !isFromRoomstay);\n }\n\n return 0;\n }, [checkoutData]);\n\n useEffect(() => {\n setItemisedFees(checkoutData.feesSummary || []);\n }, [checkoutData]);\n\n const addons: ReservationAddonDTO[] = [];\n const comments: string[] = [];\n\n useEffect(() => {\n return () => {\n basketContext.finish();\n };\n }, []);\n\n return (\n <div className=\"container u-marg-top--heavy rs-step-thanks\">\n <div className=\"row justify-content-center\">\n <div className=\"col-lg-8 col-md-12 u-flex align-items-center u-flex-direction-column\">\n <div className=\"u-marg-bottom\">\n <Icon icon={IconType.Check} size=\"48px\" color={Color.White} backgroundColor={Color.Accent} borderRadius=\"round\" noPadding />\n </div>\n <div className=\"u-marg-bottom\" style={{ maxWidth: '530px' }}>\n <Headline size=\"large\" align={TextAlign.Center}>\n {t(Translation.Step.Thanks.ThankYouHeadline, { hotel: hotel?.name })}\n </Headline>\n </div>\n <div className=\"u-marg-bottom--heavy\">\n <Text color={Color.DarkGrey}>\n {t(Translation.Step.Thanks.InvoiceNumber)} {checkoutData.itineraryNumber}\n </Text>\n </div>\n\n <div className=\"u-marg-bottom--massive\">\n <Link to=\"/\">\n <BEButton>{t(Translation.Step.Thanks.GoBackHome)}</BEButton>\n </Link>\n </div>\n\n {checkoutData?.reservations?.[0]?.guest && <InlineSignUpSection reservation={checkoutData.reservations[0]} hotelId={hotel?.hotelID || ''} />}\n\n <>\n <div className=\"u-marg-top w-100\">\n {checkoutData?.reservations?.map((obj: ReservationDTO) => {\n if (obj.addons) {\n const nights = Object.keys(obj.nights);\n obj.addons.forEach((addon) => {\n if (isFromRoomstay) {\n addons.push({ ...addon, nights: nights.length });\n } else {\n addons.push(addon);\n }\n });\n }\n\n if (obj.comments) {\n obj.comments.map((comment: string) => {\n comments.push(comment);\n });\n }\n\n return <ReservationRow reservation={obj} key={obj.reservationNumber} />;\n })}\n </div>\n <LineBreak />\n\n <div className=\"w-100\">\n <CommonAddonSummary addons={addons} />\n {comments.length >= 1 && (\n <div className=\"u-marg-bottom--heavy\">\n <div className=\"u-marg-bottom\">\n <Text type={TextType.Label} color={Color.Grey}>\n {t(Translation.Step.Confirmation.Comments)}\n </Text>\n </div>\n {comments.map((comment, index) => (\n <Text\n style={{\n whiteSpace: 'pre',\n }}\n key={index}\n type={TextType.Small}\n >\n {comment}\n </Text>\n ))}\n </div>\n )}\n\n <ItemisedFeesSummary fees={itemisedFees} />\n\n <Text type={TextType.Small} align={TextAlign.Right}>\n {t(Translation.Misc.Total)}\n </Text>\n <Headline bold size=\"large\" align={TextAlign.Right}>\n <Currency>{total}</Currency>\n </Headline>\n <Text type={TextType.Small} align={TextAlign.Right} color={Color.DarkGrey}>\n <span dangerouslySetInnerHTML={{ __html: t(Translation.Step.Thanks.IncludingTaxes) }}></span>\n </Text>\n </div>\n </>\n </div>\n </div>\n {checkoutData?.reservations?.map((obj: ReservationDTO, index) => {\n const nightKeys = Object.keys(obj.nights);\n\n const firstNight = dayjs(nightKeys[0]);\n const lastNight = dayjs(nightKeys[nightKeys.length - 1]).add(1, 'day');\n\n return (\n <script key={index} type=\"application/ld+json\">\n {JSON.stringify({\n '@context': 'http://schema.org',\n '@type': 'LodgingReservation',\n reservationId: obj.reservationNumber,\n reservationStatus: 'http://schema.org/ReservationConfirmed',\n checkinTime: firstNight.format('YYYY-MM-DDTHH:mm:ss'),\n checkoutTime: lastNight.format('YYYY-MM-DDTHH:mm:ss'),\n totalPrice: obj.total.afterTax,\n basePrice: obj.total.beforeTax,\n priceCurrency: ccx.currentCurrency,\n })}\n </script>\n );\n })}\n </div>\n );\n}\n"]}
|
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export declare function withDI(name: string, OriginalObject: any, props: any): React.JSX.Element;
|
|
2
3
|
export declare function registerReplacement(name: string, component: any): void;
|
|
@@ -17,6 +17,7 @@ const NumberOfPeopleBookedPillFeature_1 = __importDefault(require("./feature/Num
|
|
|
17
17
|
const PlanPayPricePreviewFeature_1 = __importDefault(require("./feature/PlanPayPricePreviewFeature"));
|
|
18
18
|
const RoomUpsellFeature_1 = __importDefault(require("./feature/RoomUpsellFeature"));
|
|
19
19
|
const ShowIATANumberOnCheckoutFeature_1 = __importDefault(require("./feature/ShowIATANumberOnCheckoutFeature"));
|
|
20
|
+
const ConfirmationImportantInformationFeature_1 = __importDefault(require("./feature/ConfirmationImportantInformationFeature"));
|
|
20
21
|
const DerbysoftClickTrackingFeature_1 = __importDefault(require("./feature/DerbysoftClickTrackingFeature"));
|
|
21
22
|
const RoomRateReadMoreVersionFeature_1 = __importDefault(require("./feature/RoomRateReadMoreVersionFeature"));
|
|
22
23
|
class FeatureProvider {
|
|
@@ -52,6 +53,7 @@ FeatureProvider.features = [
|
|
|
52
53
|
RoomRateReadMoreVersionFeature_1.default,
|
|
53
54
|
DerbysoftClickTrackingFeature_1.default,
|
|
54
55
|
GuestTitleFieldFeature_1.default,
|
|
56
|
+
ConfirmationImportantInformationFeature_1.default,
|
|
55
57
|
HotelGroupFeature_1.default,
|
|
56
58
|
];
|
|
57
59
|
//# sourceMappingURL=FeatureProvider.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FeatureProvider.js","sourceRoot":"/","sources":["src/providers/FeatureProvider.ts"],"names":[],"mappings":";;;;;AAAA,8GAAsF;AACtF,sGAA8E;AAC9E,kHAA0F;AAC1F,oGAA4E;AAC5E,8HAAsG;AACtG,wGAAgF;AAChF,8FAAsE;AACtE,wGAAgF;AAChF,kGAA0E;AAC1E,oGAA4E;AAC5E,0HAAkG;AAClG,gHAAwF;AACxF,8FAAsE;AACtE,0HAAkG;AAElG,4GAAoF;AACpF,8GAAsF;AAEtF,MAAqB,eAAe;
|
|
1
|
+
{"version":3,"file":"FeatureProvider.js","sourceRoot":"/","sources":["src/providers/FeatureProvider.ts"],"names":[],"mappings":";;;;;AAAA,8GAAsF;AACtF,sGAA8E;AAC9E,kHAA0F;AAC1F,oGAA4E;AAC5E,8HAAsG;AACtG,wGAAgF;AAChF,8FAAsE;AACtE,wGAAgF;AAChF,kGAA0E;AAC1E,oGAA4E;AAC5E,0HAAkG;AAClG,gHAAwF;AACxF,8FAAsE;AACtE,0HAAkG;AAElG,gIAAwG;AACxG,4GAAoF;AACpF,8GAAsF;AAEtF,MAAqB,eAAe;IAqBzB,MAAM,CAAC,IAAI,CAAC,IAAuF,EAAE,OAAa;QACrH,KAAK,MAAM,OAAO,IAAI,IAAI,CAAC,QAAQ,EAAE;YACjC,IAAI,OAAO,CAAC,OAAO,EAAE,KAAK,IAAI,IAAI,IAAI,KAAK,OAAO,EAAE;gBAChD,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;aACzB;SACJ;IACL,CAAC;IAEM,MAAM,CAAC,MAAM,CAAC,IAAuF;QACxG,KAAK,MAAM,OAAO,IAAI,IAAI,CAAC,QAAQ,EAAE;YACjC,IAAI,OAAO,CAAC,OAAO,EAAE,KAAK,IAAI,IAAI,IAAI,KAAK,OAAO,EAAE;gBAChD,OAAO,CAAC,MAAM,EAAE,CAAC;aACpB;SACJ;IACL,CAAC;;AAnCL,kCAoCC;AAnCkB,wBAAQ,GAAG;IACtB,gCAAsB;IACtB,+BAAqB;IACrB,2BAAiB;IACjB,8BAAoB;IACpB,mCAAyB;IACzB,yCAA+B;IAC/B,qCAA2B;IAC3B,6BAAmB;IACnB,yCAA+B;IAC/B,2CAAiC;IACjC,8BAAoB;IACpB,oCAA0B;IAC1B,wCAA8B;IAC9B,uCAA6B;IAC7B,gCAAsB;IACtB,iDAAuC;IACvC,2BAAiB;CACpB,CAAC","sourcesContent":["import ConfirmationVerifyFeature from '@/providers/feature/ConfirmationVerifyFeature';\nimport DatePickerTypeFeature from '@/providers/feature/DatePickerTypeFeature';\nimport E164PhoneNumberFieldFeature from '@/providers/feature/E164PhoneNumberFieldFeature';\nimport FeaturedPromoFeature from '@/providers/feature/FeaturedPromoFeature';\nimport FullPageEngineSmallSpacingFeature from '@/providers/feature/FullPageEngineSmallSpacingFeature';\nimport GuestTitleFieldFeature from '@/providers/feature/GuestTitleFieldFeature';\nimport HotelGroupFeature from '@/providers/feature/HotelGroupFeature';\nimport InlineAddonStepFeature from '@/providers/feature/InlineAddonStepFeature';\nimport MemberPortalFeature from '@/providers/feature/MemberPortalFeature';\nimport ModifyBookingFeature from '@/providers/feature/ModifyBookingFeature';\nimport NumberOfPeopleBookedPillFeature from '@/providers/feature/NumberOfPeopleBookedPillFeature';\nimport PlanPayPricePreviewFeature from '@/providers/feature/PlanPayPricePreviewFeature';\nimport RoomUpsellFeature from '@/providers/feature/RoomUpsellFeature';\nimport ShowIATANumberOnCheckoutFeature from '@/providers/feature/ShowIATANumberOnCheckoutFeature';\n\nimport ConfirmationImportantInformationFeature from './feature/ConfirmationImportantInformationFeature';\nimport DerbysoftClickTrackingFeature from './feature/DerbysoftClickTrackingFeature';\nimport RoomRateReadMoreVersionFeature from './feature/RoomRateReadMoreVersionFeature';\n\nexport default class FeatureProvider {\n private static features = [\n InlineAddonStepFeature,\n DatePickerTypeFeature,\n RoomUpsellFeature,\n FeaturedPromoFeature,\n ConfirmationVerifyFeature,\n ShowIATANumberOnCheckoutFeature,\n E164PhoneNumberFieldFeature,\n MemberPortalFeature,\n NumberOfPeopleBookedPillFeature,\n FullPageEngineSmallSpacingFeature,\n ModifyBookingFeature,\n PlanPayPricePreviewFeature,\n RoomRateReadMoreVersionFeature,\n DerbysoftClickTrackingFeature,\n GuestTitleFieldFeature,\n ConfirmationImportantInformationFeature,\n HotelGroupFeature,\n ];\n\n public static load(name: string | (typeof FeatureProvider.features)[keyof typeof FeatureProvider.features], options?: any) {\n for (const feature of this.features) {\n if (feature.getName() === name || name === feature) {\n feature.load(options);\n }\n }\n }\n\n public static unLoad(name: string | (typeof FeatureProvider.features)[keyof typeof FeatureProvider.features]) {\n for (const feature of this.features) {\n if (feature.getName() === name || name === feature) {\n feature.unLoad();\n }\n }\n }\n}\n"]}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Feature } from './Feature';
|
|
2
|
+
type ConfirmationImportantInformationFeatureOption = {
|
|
3
|
+
withCheckbox: boolean;
|
|
4
|
+
};
|
|
5
|
+
declare class ConfirmationImportantInformationFeature extends Feature<ConfirmationImportantInformationFeatureOption> {
|
|
6
|
+
constructor();
|
|
7
|
+
protected onLoad(options: ConfirmationImportantInformationFeatureOption): void;
|
|
8
|
+
}
|
|
9
|
+
declare const _default: ConfirmationImportantInformationFeature;
|
|
10
|
+
export default _default;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const Feature_1 = require("./Feature");
|
|
4
|
+
class ConfirmationImportantInformationFeature extends Feature_1.Feature {
|
|
5
|
+
constructor() {
|
|
6
|
+
super('ConfirmationImportantInformationFeature');
|
|
7
|
+
}
|
|
8
|
+
onLoad(options) {
|
|
9
|
+
super.onLoad(options);
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
exports.default = new ConfirmationImportantInformationFeature();
|
|
13
|
+
//# sourceMappingURL=ConfirmationImportantInformationFeature.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ConfirmationImportantInformationFeature.js","sourceRoot":"/","sources":["src/providers/feature/ConfirmationImportantInformationFeature.ts"],"names":[],"mappings":";;AAAA,yDAAsD;AAKtD,MAAM,uCAAwC,SAAQ,iBAAsD;IACxG;QACI,KAAK,CAAC,yCAAyC,CAAC,CAAC;IACrD,CAAC;IAES,MAAM,CAAC,OAAsD;QACnE,KAAK,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;IAC1B,CAAC;CACJ;AAED,kBAAe,IAAI,uCAAuC,EAAE,CAAC","sourcesContent":["import { Feature } from '@/providers/feature/Feature';\n\ntype ConfirmationImportantInformationFeatureOption = {\n withCheckbox: boolean;\n};\nclass ConfirmationImportantInformationFeature extends Feature<ConfirmationImportantInformationFeatureOption> {\n public constructor() {\n super('ConfirmationImportantInformationFeature');\n }\n\n protected onLoad(options: ConfirmationImportantInformationFeatureOption) {\n super.onLoad(options);\n }\n}\n\nexport default new ConfirmationImportantInformationFeature();\n"]}
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
export declare abstract class Feature<TOptions = any> {
|
|
2
2
|
private name;
|
|
3
3
|
private active;
|
|
4
|
+
private options?;
|
|
4
5
|
constructor(name: string);
|
|
5
6
|
getName(): string;
|
|
7
|
+
getOptions(): TOptions | undefined;
|
|
6
8
|
isActive(): boolean;
|
|
7
9
|
load(options?: TOptions): void;
|
|
8
10
|
unLoad(): void;
|
|
@@ -9,6 +9,9 @@ class Feature {
|
|
|
9
9
|
getName() {
|
|
10
10
|
return this.name;
|
|
11
11
|
}
|
|
12
|
+
getOptions() {
|
|
13
|
+
return this.options;
|
|
14
|
+
}
|
|
12
15
|
isActive() {
|
|
13
16
|
return this.active;
|
|
14
17
|
}
|
|
@@ -22,6 +25,7 @@ class Feature {
|
|
|
22
25
|
}
|
|
23
26
|
onLoad(options) {
|
|
24
27
|
// Empty function to be overwritten
|
|
28
|
+
this.options = options;
|
|
25
29
|
}
|
|
26
30
|
onUnLoad() {
|
|
27
31
|
// Empty function to be overwritten
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Feature.js","sourceRoot":"/","sources":["src/providers/feature/Feature.ts"],"names":[],"mappings":";;;AAAA,MAAsB,OAAO;
|
|
1
|
+
{"version":3,"file":"Feature.js","sourceRoot":"/","sources":["src/providers/feature/Feature.ts"],"names":[],"mappings":";;;AAAA,MAAsB,OAAO;IAKzB,YAAmB,IAAY;QAC3B,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC;IACxB,CAAC;IAEM,OAAO;QACV,OAAO,IAAI,CAAC,IAAI,CAAC;IACrB,CAAC;IAEM,UAAU;QACb,OAAO,IAAI,CAAC,OAAO,CAAC;IACxB,CAAC;IAEM,QAAQ;QACX,OAAO,IAAI,CAAC,MAAM,CAAC;IACvB,CAAC;IAEM,IAAI,CAAC,OAAkB;QAC1B,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC;QACnB,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;IACzB,CAAC;IAEM,MAAM;QACT,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC;QAEpB,IAAI,CAAC,QAAQ,EAAE,CAAC;IACpB,CAAC;IAES,MAAM,CAAC,OAAkB;QAC/B,mCAAmC;QACnC,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;IAC3B,CAAC;IAES,QAAQ;QACd,mCAAmC;IACvC,CAAC;CACJ;AAzCD,0BAyCC","sourcesContent":["export abstract class Feature<TOptions = any> {\n private name: string;\n private active: boolean;\n private options?: TOptions;\n\n public constructor(name: string) {\n this.name = name;\n this.active = false;\n }\n\n public getName() {\n return this.name;\n }\n\n public getOptions() {\n return this.options;\n }\n\n public isActive() {\n return this.active;\n }\n\n public load(options?: TOptions) {\n this.active = true;\n this.onLoad(options);\n }\n\n public unLoad() {\n this.active = false;\n\n this.onUnLoad();\n }\n\n protected onLoad(options?: TOptions): void {\n // Empty function to be overwritten\n this.options = options;\n }\n\n protected onUnLoad() {\n // Empty function to be overwritten\n }\n}\n"]}
|
|
@@ -209,6 +209,7 @@ class SessionProvider {
|
|
|
209
209
|
children: unSerializeBasketRow.getChildren(),
|
|
210
210
|
infants: unSerializeBasketRow.getInfants(),
|
|
211
211
|
promoCode: unSerializeBasketRow.getPromoCode(),
|
|
212
|
+
roomCode: unSerializeBasketRow.getRoomCode(),
|
|
212
213
|
promoCodeStatus: unSerializeBasketRow.getPromoCodeStatus(),
|
|
213
214
|
rate: serializedRate,
|
|
214
215
|
room: serializedRoom,
|
|
@@ -261,6 +262,7 @@ class SessionProvider {
|
|
|
261
262
|
basketRow.setAdults(serializedBasketRow.adults);
|
|
262
263
|
basketRow.setChildren(serializedBasketRow.children);
|
|
263
264
|
basketRow.setInfants(serializedBasketRow.infants);
|
|
265
|
+
basketRow.setRoomCode(serializedBasketRow.roomCode);
|
|
264
266
|
basketRows.push(basketRow);
|
|
265
267
|
});
|
|
266
268
|
return {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SessionProvider.js","sourceRoot":"/","sources":["src/providers/storage/SessionProvider.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AACA,kDAA0B;AAE1B,mEAA2C;AAC3C,6CAAiD;AACjD,qDAA6D;AAC7D,8DAAkJ;AAClJ,yEAAsE;AAC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,UAAU;YACV,MAAM,EAAE,OAAO,CAAC,MAAM;YACtB,IAAI,EAAE,OAAO,CAAC,IAAI,CAAC,CAAC,CAAE,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAgB,CAAC,CAAC,CAAC,SAAS;YACzE,QAAQ,EAAE,OAAO,CAAC,QAAQ;YAC1B,WAAW,EAAE,OAAO,CAAC,WAAW;YAChC,kBAAkB,EAAE,OAAO,CAAC,kBAAkB;SACjD,CAAC;IACN,CAAC;IAEO,aAAa,CAAC,SAAkB;QACpC,OAAO,WAAW,SAAS,aAAT,SAAS,cAAT,SAAS,GAAI,IAAI,CAAC,gBAAgB,EAAE,CAAC;IAC3D,CAAC;CACJ;AApQD,kCAoQC","sourcesContent":["import { SignInUser } from '@frontend/contexts';\nimport dayjs from 'dayjs';\n\nimport BasketRow from '@/models/BasketRow';\nimport { IRoom, Room } from '@/models/Room/Room';\nimport { IRoomRate, RoomRate } from '@/models/Room/RoomRate';\nimport { RoomstaySession, SERIALIZED_DATE_FORMAT, SerializedRoomstaySession, SerializedRoomstaySessionBasketRow } from '@/models/RoomstaySession';\nimport { StorageProvider } from '@/providers/storage/StorageProvider';\nimport { debounce, delay } from '@/util/Debounce';\n\n/**\n * Session provider is in charge of handling the loading, saving and passing of the current Engine Session.\n *\n * Desired flow:\n * * App Opened\n * * Session Provider loaded\n * * New User Session Created\n * * User moves through the app, updating the session with vital details (current step, basket context )\n * * User refreshes browser - session is re-loaded and user resumes where they left off\n * * User proceeds to checkout.\n * * Session is saved.\n *\n * Mini Booking Widget:\n * * User loads mini booking widget, selects dates, people\n * * Rates are loaded, and user selects a rate, redirecting to Full Booking Engine\n * * Session Provider creates a SessionID to pass to redirected path\n * * Session Provider loads the passed SessionID and loads the correct session\n * * Resume to Desired Flow\n *\n * Re-targeting:\n * ---Since re-targeting will happen on client site, under client domain, localStorage will be preserved, ergo we can load the previous incomplete sessions back to the user\n * * User lands on client Homepage\n * * Session Provider loads previous incomplete sessions\n * * A slider with details of previous baskets is shown back to the user\n * * User clicks on a previous session and is brought to the Booking Engine\n * * Resume to Desired Flow\n */\n\nexport default class SessionProvider {\n private currentSessionID!: number;\n private hotelID!: string;\n private cachedSession: Partial<RoomstaySession> = {};\n\n private syncSession = async () => {\n try {\n const currentSession = await this.getSession();\n const cachedSession = this.cachedSession;\n this.cachedSession = {};\n await this.saveSession({\n ...currentSession,\n ...cachedSession,\n });\n } catch (error) {\n console.error('Failed to sync session:', error);\n }\n };\n\n private debouncedUpdateSession = debounce(async () => {\n await this.syncSession();\n }, 300);\n\n private async updateSessionWithAsync() {\n await delay(300); // 300 milliseconds delay -- Why is a delay necessary?\n await this.syncSession();\n }\n\n public async setHotelID(hotelID: string) {\n this.hotelID = hotelID;\n this.updateSession({ hotelID });\n }\n\n public async initialize(sessionID?: number, source?: string) {\n await this.setSessionID(sessionID, source);\n }\n\n public async setSessionID(sessionID?: number, source?: string) {\n const foundSession = await this.findOrCreateSessionID(sessionID as number, source as string);\n\n if (foundSession) {\n this.currentSessionID = foundSession;\n\n // Never read?\n const storage = new StorageProvider(sessionStorage);\n await storage.write('currentSession', this.currentSessionID);\n }\n }\n\n /**\n * @returns the current session ID\n */\n public getCurrentSessionID(): number {\n return this.currentSessionID;\n }\n\n public getSession(): RoomstaySession {\n const storage = new StorageProvider();\n\n const sessionFromStorage = storage.read<SerializedRoomstaySession>(this.getSessionKey());\n\n if (sessionFromStorage) {\n return this.unSerializeSession(sessionFromStorage);\n } else {\n return this.generateNewSession('');\n }\n }\n\n public async saveSession(changedSession: RoomstaySession) {\n if (!changedSession) {\n return console.log('Attempted to save empty session');\n }\n\n const storage = new StorageProvider();\n\n const serializedSession = this.serializeSession(changedSession);\n\n await storage.write(this.getSessionKey(serializedSession.id), serializedSession);\n }\n\n public async updateSession(partialSession: Partial<RoomstaySession>) {\n Object.assign(this.cachedSession, partialSession);\n this.debouncedUpdateSession();\n }\n\n public async updateSessionAsync(partialSession: Partial<RoomstaySession>) {\n Object.assign(this.cachedSession, partialSession);\n await this.updateSessionWithAsync();\n }\n\n public async deleteSession() {\n const storage = new StorageProvider();\n storage.delete(this.getSessionKey());\n }\n\n public async getAllSessions() {\n const storage = new StorageProvider();\n const sessionKeys = storage.getAllKeys((name) => name.startsWith('roomstay-session'));\n\n return (await storage.readAll<SerializedRoomstaySession>(sessionKeys)).map((session) => this.unSerializeSession(session));\n }\n\n /**\n * Function to find the right session from session storage, or local storage\n *\n * If one isn't found it is then created.\n */\n private async findOrCreateSessionID(sessionID: number, source: string) {\n let session: RoomstaySession;\n\n if (sessionID) {\n session = (await this.findSession(sessionID)) as RoomstaySession;\n\n if (session) {\n return session.id;\n }\n }\n\n session = await this.generateNewSession(source);\n\n return session.id;\n }\n\n private async findSession(sessionID: number): Promise<RoomstaySession | undefined> {\n const storage = new StorageProvider();\n const session = await storage.read<SerializedRoomstaySession>(this.getSessionKey(sessionID));\n\n if (session) {\n return this.unSerializeSession(session);\n }\n }\n\n private generateNewSession(source: string): RoomstaySession {\n const sessionId = new Date().getTime();\n\n const session: RoomstaySession = {\n id: sessionId,\n startDate: null,\n endDate: null,\n step: '',\n hotelID: this.hotelID ?? null,\n basketRows: [],\n source,\n };\n\n this.saveSession(session);\n\n return session;\n }\n\n private serializeSession(session: RoomstaySession): SerializedRoomstaySession {\n const basketRows: SerializedRoomstaySessionBasketRow[] = [];\n\n // TODO possibly refactor BasketRow to serialize itself, or instead make a serializer that can do all this.\n session.basketRows.forEach((unSerializeBasketRow: BasketRow) => {\n const rate = unSerializeBasketRow.getRate();\n const room = unSerializeBasketRow.getRoom();\n\n let serializedRate = null;\n let serializedRoom = null;\n\n if (rate) {\n serializedRate = rate.serialize();\n }\n\n if (room) {\n serializedRoom = room.serialize();\n }\n\n basketRows.push({\n uniqId: unSerializeBasketRow.getID(),\n startDate: unSerializeBasketRow.getStartDate()?.format(SERIALIZED_DATE_FORMAT),\n endDate: unSerializeBasketRow.getEndDate()?.format(SERIALIZED_DATE_FORMAT),\n adults: unSerializeBasketRow.getAdults(),\n children: unSerializeBasketRow.getChildren(),\n infants: unSerializeBasketRow.getInfants(),\n promoCode: unSerializeBasketRow.getPromoCode(),\n promoCodeStatus: unSerializeBasketRow.getPromoCodeStatus(),\n rate: serializedRate as IRoomRate,\n room: serializedRoom as IRoom,\n });\n });\n\n return {\n id: session.id,\n startDate: session.startDate?.format(SERIALIZED_DATE_FORMAT) as string,\n endDate: session.endDate?.format(SERIALIZED_DATE_FORMAT) as string,\n step: session.step,\n hotelID: session.hotelID,\n basketRows,\n source: session.source,\n user: JSON.stringify(session.user),\n memberId: session.memberId,\n reservation: session.reservation,\n reservationRequest: session.reservationRequest,\n };\n }\n\n private unSerializeSession(session: SerializedRoomstaySession): RoomstaySession {\n const basketRows: BasketRow[] = [];\n let startDate: dayjs.Dayjs | null = null;\n let endDate: dayjs.Dayjs | null = null;\n\n if (session.startDate) {\n startDate = dayjs(session.startDate, SERIALIZED_DATE_FORMAT);\n }\n\n if (session.endDate) {\n endDate = dayjs(session.endDate, SERIALIZED_DATE_FORMAT);\n }\n\n session.basketRows?.forEach((serializedBasketRow) => {\n let rate;\n let room;\n\n if (serializedBasketRow.room) {\n room = new Room();\n room.unSerialize(serializedBasketRow.room);\n }\n\n if (serializedBasketRow.rate && room) {\n rate = new RoomRate();\n rate.unSerialize(serializedBasketRow.rate);\n rate.setRoom(room);\n }\n\n const basketRow = new BasketRow(rate, serializedBasketRow.uniqId);\n\n if (serializedBasketRow.startDate) {\n basketRow.setStartDate(dayjs(serializedBasketRow.startDate, SERIALIZED_DATE_FORMAT));\n }\n if (serializedBasketRow.endDate) {\n basketRow.setEndDate(dayjs(serializedBasketRow.endDate, SERIALIZED_DATE_FORMAT));\n }\n\n basketRow.setAdults(serializedBasketRow.adults);\n basketRow.setChildren(serializedBasketRow.children);\n basketRow.setInfants(serializedBasketRow.infants);\n\n basketRows.push(basketRow);\n });\n\n return {\n id: session.id,\n startDate,\n endDate,\n step: session.step,\n hotelID: session.hotelID,\n basketRows,\n source: session.source,\n user: session.user ? (JSON.parse(session.user) as SignInUser) : undefined,\n memberId: session.memberId,\n reservation: session.reservation,\n reservationRequest: session.reservationRequest,\n };\n }\n\n private getSessionKey(sessionId?: number): string {\n return `session-${sessionId ?? this.currentSessionID}`;\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"SessionProvider.js","sourceRoot":"/","sources":["src/providers/storage/SessionProvider.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AACA,kDAA0B;AAE1B,mEAA2C;AAC3C,6CAAiD;AACjD,qDAA6D;AAC7D,8DAAkJ;AAClJ,yEAAsE;AACtE,8CAAkD;AAElD;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAEH,MAAqB,eAAe;IAApC;QAGY,kBAAa,GAA6B,EAAE,CAAC;QAE7C,gBAAW,GAAG,GAAS,EAAE;YAC7B,IAAI;gBACA,MAAM,cAAc,GAAG,MAAM,IAAI,CAAC,UAAU,EAAE,CAAC;gBAC/C,MAAM,aAAa,GAAG,IAAI,CAAC,aAAa,CAAC;gBACzC,IAAI,CAAC,aAAa,GAAG,EAAE,CAAC;gBACxB,MAAM,IAAI,CAAC,WAAW,iCACf,cAAc,GACd,aAAa,EAClB,CAAC;aACN;YAAC,OAAO,KAAK,EAAE;gBACZ,OAAO,CAAC,KAAK,CAAC,yBAAyB,EAAE,KAAK,CAAC,CAAC;aACnD;QACL,CAAC,CAAA,CAAC;QAEM,2BAAsB,GAAG,IAAA,mBAAQ,EAAC,GAAS,EAAE;YACjD,MAAM,IAAI,CAAC,WAAW,EAAE,CAAC;QAC7B,CAAC,CAAA,EAAE,GAAG,CAAC,CAAC;IAiPZ,CAAC;IA/OiB,sBAAsB;;YAChC,MAAM,IAAA,gBAAK,EAAC,GAAG,CAAC,CAAC,CAAC,sDAAsD;YACxE,MAAM,IAAI,CAAC,WAAW,EAAE,CAAC;QAC7B,CAAC;KAAA;IAEY,UAAU,CAAC,OAAe;;YACnC,IAAI,CAAC,OAAO,GAAG,OAAO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CAAC,CAAC;aACpF;YAED,SAAS,CAAC,SAAS,CAAC,mBAAmB,CAAC,MAAM,CAAC,CAAC;YAChD,SAAS,CAAC,WAAW,CAAC,mBAAmB,CAAC,QAAQ,CAAC,CAAC;YACpD,SAAS,CAAC,UAAU,CAAC,mBAAmB,CAAC,OAAO,CAAC,CAAC;YAClD,SAAS,CAAC,WAAW,CAAC,mBAAmB,CAAC,QAAQ,CAAC,CAAC;YAEpD,UAAU,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;QAC/B,CAAC,CAAC,CAAC;QAEH,OAAO;YACH,EAAE,EAAE,OAAO,CAAC,EAAE;YACd,SAAS;YACT,OAAO;YACP,IAAI,EAAE,OAAO,CAAC,IAAI;YAClB,OAAO,EAAE,OAAO,CAAC,OAAO;YACxB,UAAU;YACV,MAAM,EAAE,OAAO,CAAC,MAAM;YACtB,IAAI,EAAE,OAAO,CAAC,IAAI,CAAC,CAAC,CAAE,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAgB,CAAC,CAAC,CAAC,SAAS;YACzE,QAAQ,EAAE,OAAO,CAAC,QAAQ;YAC1B,WAAW,EAAE,OAAO,CAAC,WAAW;YAChC,kBAAkB,EAAE,OAAO,CAAC,kBAAkB;SACjD,CAAC;IACN,CAAC;IAEO,aAAa,CAAC,SAAkB;QACpC,OAAO,WAAW,SAAS,aAAT,SAAS,cAAT,SAAS,GAAI,IAAI,CAAC,gBAAgB,EAAE,CAAC;IAC3D,CAAC;CACJ;AAtQD,kCAsQC","sourcesContent":["import { SignInUser } from '@frontend/contexts';\nimport dayjs from 'dayjs';\n\nimport BasketRow from '@/models/BasketRow';\nimport { IRoom, Room } from '@/models/Room/Room';\nimport { IRoomRate, RoomRate } from '@/models/Room/RoomRate';\nimport { RoomstaySession, SERIALIZED_DATE_FORMAT, SerializedRoomstaySession, SerializedRoomstaySessionBasketRow } from '@/models/RoomstaySession';\nimport { StorageProvider } from '@/providers/storage/StorageProvider';\nimport { debounce, delay } from '@/util/Debounce';\n\n/**\n * Session provider is in charge of handling the loading, saving and passing of the current Engine Session.\n *\n * Desired flow:\n * * App Opened\n * * Session Provider loaded\n * * New User Session Created\n * * User moves through the app, updating the session with vital details (current step, basket context )\n * * User refreshes browser - session is re-loaded and user resumes where they left off\n * * User proceeds to checkout.\n * * Session is saved.\n *\n * Mini Booking Widget:\n * * User loads mini booking widget, selects dates, people\n * * Rates are loaded, and user selects a rate, redirecting to Full Booking Engine\n * * Session Provider creates a SessionID to pass to redirected path\n * * Session Provider loads the passed SessionID and loads the correct session\n * * Resume to Desired Flow\n *\n * Re-targeting:\n * ---Since re-targeting will happen on client site, under client domain, localStorage will be preserved, ergo we can load the previous incomplete sessions back to the user\n * * User lands on client Homepage\n * * Session Provider loads previous incomplete sessions\n * * A slider with details of previous baskets is shown back to the user\n * * User clicks on a previous session and is brought to the Booking Engine\n * * Resume to Desired Flow\n */\n\nexport default class SessionProvider {\n private currentSessionID!: number;\n private hotelID!: string;\n private cachedSession: Partial<RoomstaySession> = {};\n\n private syncSession = async () => {\n try {\n const currentSession = await this.getSession();\n const cachedSession = this.cachedSession;\n this.cachedSession = {};\n await this.saveSession({\n ...currentSession,\n ...cachedSession,\n });\n } catch (error) {\n console.error('Failed to sync session:', error);\n }\n };\n\n private debouncedUpdateSession = debounce(async () => {\n await this.syncSession();\n }, 300);\n\n private async updateSessionWithAsync() {\n await delay(300); // 300 milliseconds delay -- Why is a delay necessary?\n await this.syncSession();\n }\n\n public async setHotelID(hotelID: string) {\n this.hotelID = hotelID;\n this.updateSession({ hotelID });\n }\n\n public async initialize(sessionID?: number, source?: string) {\n await this.setSessionID(sessionID, source);\n }\n\n public async setSessionID(sessionID?: number, source?: string) {\n const foundSession = await this.findOrCreateSessionID(sessionID as number, source as string);\n\n if (foundSession) {\n this.currentSessionID = foundSession;\n\n // Never read?\n const storage = new StorageProvider(sessionStorage);\n await storage.write('currentSession', this.currentSessionID);\n }\n }\n\n /**\n * @returns the current session ID\n */\n public getCurrentSessionID(): number {\n return this.currentSessionID;\n }\n\n public getSession(): RoomstaySession {\n const storage = new StorageProvider();\n\n const sessionFromStorage = storage.read<SerializedRoomstaySession>(this.getSessionKey());\n\n if (sessionFromStorage) {\n return this.unSerializeSession(sessionFromStorage);\n } else {\n return this.generateNewSession('');\n }\n }\n\n public async saveSession(changedSession: RoomstaySession) {\n if (!changedSession) {\n return console.log('Attempted to save empty session');\n }\n\n const storage = new StorageProvider();\n\n const serializedSession = this.serializeSession(changedSession);\n\n await storage.write(this.getSessionKey(serializedSession.id), serializedSession);\n }\n\n public async updateSession(partialSession: Partial<RoomstaySession>) {\n Object.assign(this.cachedSession, partialSession);\n this.debouncedUpdateSession();\n }\n\n public async updateSessionAsync(partialSession: Partial<RoomstaySession>) {\n Object.assign(this.cachedSession, partialSession);\n await this.updateSessionWithAsync();\n }\n\n public async deleteSession() {\n const storage = new StorageProvider();\n storage.delete(this.getSessionKey());\n }\n\n public async getAllSessions() {\n const storage = new StorageProvider();\n const sessionKeys = storage.getAllKeys((name) => name.startsWith('roomstay-session'));\n\n return (await storage.readAll<SerializedRoomstaySession>(sessionKeys)).map((session) => this.unSerializeSession(session));\n }\n\n /**\n * Function to find the right session from session storage, or local storage\n *\n * If one isn't found it is then created.\n */\n private async findOrCreateSessionID(sessionID: number, source: string) {\n let session: RoomstaySession;\n\n if (sessionID) {\n session = (await this.findSession(sessionID)) as RoomstaySession;\n\n if (session) {\n return session.id;\n }\n }\n\n session = await this.generateNewSession(source);\n\n return session.id;\n }\n\n private async findSession(sessionID: number): Promise<RoomstaySession | undefined> {\n const storage = new StorageProvider();\n const session = await storage.read<SerializedRoomstaySession>(this.getSessionKey(sessionID));\n\n if (session) {\n return this.unSerializeSession(session);\n }\n }\n\n private generateNewSession(source: string): RoomstaySession {\n const sessionId = new Date().getTime();\n\n const session: RoomstaySession = {\n id: sessionId,\n startDate: null,\n endDate: null,\n step: '',\n hotelID: this.hotelID ?? null,\n basketRows: [],\n source,\n };\n\n this.saveSession(session);\n\n return session;\n }\n\n private serializeSession(session: RoomstaySession): SerializedRoomstaySession {\n const basketRows: SerializedRoomstaySessionBasketRow[] = [];\n\n // TODO possibly refactor BasketRow to serialize itself, or instead make a serializer that can do all this.\n session.basketRows.forEach((unSerializeBasketRow: BasketRow) => {\n const rate = unSerializeBasketRow.getRate();\n const room = unSerializeBasketRow.getRoom();\n\n let serializedRate = null;\n let serializedRoom = null;\n\n if (rate) {\n serializedRate = rate.serialize();\n }\n\n if (room) {\n serializedRoom = room.serialize();\n }\n\n basketRows.push({\n uniqId: unSerializeBasketRow.getID(),\n startDate: unSerializeBasketRow.getStartDate()?.format(SERIALIZED_DATE_FORMAT),\n endDate: unSerializeBasketRow.getEndDate()?.format(SERIALIZED_DATE_FORMAT),\n adults: unSerializeBasketRow.getAdults(),\n children: unSerializeBasketRow.getChildren(),\n infants: unSerializeBasketRow.getInfants(),\n promoCode: unSerializeBasketRow.getPromoCode(),\n roomCode: unSerializeBasketRow.getRoomCode(),\n promoCodeStatus: unSerializeBasketRow.getPromoCodeStatus(),\n rate: serializedRate as IRoomRate,\n room: serializedRoom as IRoom,\n });\n });\n\n return {\n id: session.id,\n startDate: session.startDate?.format(SERIALIZED_DATE_FORMAT) as string,\n endDate: session.endDate?.format(SERIALIZED_DATE_FORMAT) as string,\n step: session.step,\n hotelID: session.hotelID,\n basketRows,\n source: session.source,\n user: JSON.stringify(session.user),\n memberId: session.memberId,\n reservation: session.reservation,\n reservationRequest: session.reservationRequest,\n };\n }\n\n private unSerializeSession(session: SerializedRoomstaySession): RoomstaySession {\n const basketRows: BasketRow[] = [];\n let startDate: dayjs.Dayjs | null = null;\n let endDate: dayjs.Dayjs | null = null;\n\n if (session.startDate) {\n startDate = dayjs(session.startDate, SERIALIZED_DATE_FORMAT);\n }\n\n if (session.endDate) {\n endDate = dayjs(session.endDate, SERIALIZED_DATE_FORMAT);\n }\n\n session.basketRows?.forEach((serializedBasketRow) => {\n let rate;\n let room;\n\n if (serializedBasketRow.room) {\n room = new Room();\n room.unSerialize(serializedBasketRow.room);\n }\n\n if (serializedBasketRow.rate && room) {\n rate = new RoomRate();\n rate.unSerialize(serializedBasketRow.rate);\n rate.setRoom(room);\n }\n\n const basketRow = new BasketRow(rate, serializedBasketRow.uniqId);\n\n if (serializedBasketRow.startDate) {\n basketRow.setStartDate(dayjs(serializedBasketRow.startDate, SERIALIZED_DATE_FORMAT));\n }\n if (serializedBasketRow.endDate) {\n basketRow.setEndDate(dayjs(serializedBasketRow.endDate, SERIALIZED_DATE_FORMAT));\n }\n\n basketRow.setAdults(serializedBasketRow.adults);\n basketRow.setChildren(serializedBasketRow.children);\n basketRow.setInfants(serializedBasketRow.infants);\n basketRow.setRoomCode(serializedBasketRow.roomCode);\n\n basketRows.push(basketRow);\n });\n\n return {\n id: session.id,\n startDate,\n endDate,\n step: session.step,\n hotelID: session.hotelID,\n basketRows,\n source: session.source,\n user: session.user ? (JSON.parse(session.user) as SignInUser) : undefined,\n memberId: session.memberId,\n reservation: session.reservation,\n reservationRequest: session.reservationRequest,\n };\n }\n\n private getSessionKey(sessionId?: number): string {\n return `session-${sessionId ?? this.currentSessionID}`;\n }\n}\n"]}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
import React from 'react';
|
|
1
2
|
import Step from '../pages/steps/Step';
|
|
2
3
|
export interface StepRouteProps {
|
|
3
4
|
step: Step;
|
|
4
5
|
}
|
|
5
|
-
declare const StepRoute: (props: StepRouteProps) => JSX.Element;
|
|
6
|
+
declare const StepRoute: (props: StepRouteProps) => React.JSX.Element;
|
|
6
7
|
export default StepRoute;
|
|
@@ -6,5 +6,5 @@ export default _default;
|
|
|
6
6
|
export declare const Horizontal: ComponentStory<React.FC<BookingWizardProps>>;
|
|
7
7
|
export declare const Vertical: ComponentStory<React.FC<BookingWizardProps>>;
|
|
8
8
|
export declare const Button: ComponentStory<React.FC<BookingWizardProps>>;
|
|
9
|
-
export declare const FixedCompany: ({ properties, ...props }: BookingWizardProps) => JSX.Element;
|
|
9
|
+
export declare const FixedCompany: ({ properties, ...props }: BookingWizardProps) => React.JSX.Element;
|
|
10
10
|
export declare const ThemeMini: ComponentStory<React.FC<BookingWizardProps>>;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { ComponentMeta } from '@storybook/react';
|
|
2
|
+
import React from 'react';
|
|
2
3
|
import ConfirmationModal, { ConfirmationModalProps } from '../components/generic/modal/ConfirmationModal';
|
|
3
4
|
declare const _default: ComponentMeta<typeof ConfirmationModal>;
|
|
4
5
|
export default _default;
|
|
5
|
-
export declare const Default: (args: ConfirmationModalProps) => JSX.Element;
|
|
6
|
+
export declare const Default: (args: ConfirmationModalProps) => React.JSX.Element;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { ComponentMeta } from '@storybook/react';
|
|
2
|
+
import React from 'react';
|
|
2
3
|
import DateRangePicker, { DatePickerProps } from '../components/generic/DateRangePicker/DateRangePicker';
|
|
3
4
|
declare const _default: ComponentMeta<typeof DateRangePicker>;
|
|
4
5
|
export default _default;
|
|
5
|
-
export declare const Primary: (args: DatePickerProps) => JSX.Element;
|
|
6
|
-
export declare const StartDatePopulated: (args: DatePickerProps) => JSX.Element;
|
|
7
|
-
export declare const MultipleMonths: (args: DatePickerProps) => JSX.Element;
|
|
8
|
-
export declare const ThemeSpecific: (args: DatePickerProps) => JSX.Element;
|
|
6
|
+
export declare const Primary: (args: DatePickerProps) => React.JSX.Element;
|
|
7
|
+
export declare const StartDatePopulated: (args: DatePickerProps) => React.JSX.Element;
|
|
8
|
+
export declare const MultipleMonths: (args: DatePickerProps) => React.JSX.Element;
|
|
9
|
+
export declare const ThemeSpecific: (args: DatePickerProps) => React.JSX.Element;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { ComponentMeta } from '@storybook/react';
|
|
2
|
+
import React from 'react';
|
|
2
3
|
import ErrorModal from '../components/generic/modal/ErrorModal';
|
|
3
4
|
declare const _default: ComponentMeta<typeof ErrorModal>;
|
|
4
5
|
export default _default;
|
|
5
|
-
export declare const Default: () => JSX.Element;
|
|
6
|
+
export declare const Default: () => React.JSX.Element;
|