@roomstay/frontend 2.1.17 → 2.1.19
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/760.bundle.js +1 -1
- package/dist/main.bundle.js +1 -1
- package/dist/src/api/AvailabilityAPI.d.ts +9 -0
- package/dist/src/api/AvailabilityAPI.js +12 -0
- package/dist/src/api/AvailabilityAPI.js.map +1 -1
- package/dist/src/components/generic/BookingWizard/BookingWizard.js +5 -1
- package/dist/src/components/generic/BookingWizard/BookingWizard.js.map +1 -1
- package/dist/src/components/generic/BookingWizard/BookingWizardContent.js +55 -15
- package/dist/src/components/generic/BookingWizard/BookingWizardContent.js.map +1 -1
- package/dist/src/components/generic/BookingWizard/BookingWizardContext.d.ts +2 -1
- package/dist/src/components/generic/BookingWizard/BookingWizardContext.js.map +1 -1
- package/dist/src/components/generic/BookingWizard/BookingWizardDateSelector/BookingWizardDateSelector.js +13 -9
- package/dist/src/components/generic/BookingWizard/BookingWizardDateSelector/BookingWizardDateSelector.js.map +1 -1
- package/dist/src/components/generic/BookingWizard/BookingWizardGuestSelector/BookingWizardGuestSelector.js +6 -3
- package/dist/src/components/generic/BookingWizard/BookingWizardGuestSelector/BookingWizardGuestSelector.js.map +1 -1
- package/dist/src/components/generic/BookingWizard/BookingWizardHotelSelector/BookingWizardHotelSelector.js +16 -14
- package/dist/src/components/generic/BookingWizard/BookingWizardHotelSelector/BookingWizardHotelSelector.js.map +1 -1
- package/dist/src/components/generic/BookingWizard/BookingWizardPromoCode/BookingWizardPromoCode.d.ts +8 -0
- package/dist/src/components/generic/BookingWizard/BookingWizardPromoCode/BookingWizardPromoCode.js +64 -0
- package/dist/src/components/generic/BookingWizard/BookingWizardPromoCode/BookingWizardPromoCode.js.map +1 -0
- package/dist/src/components/generic/DateRangePicker/FloatingDateRangePicker.js +1 -1
- package/dist/src/components/generic/DateRangePicker/FloatingDateRangePicker.js.map +1 -1
- package/dist/src/components/generic/PromoCodeInput.d.ts +1 -0
- package/dist/src/components/generic/PromoCodeInput.js +1 -1
- package/dist/src/components/generic/PromoCodeInput.js.map +1 -1
- package/dist/src/components/generic/Select/Select.d.ts +2 -1
- package/dist/src/components/generic/Select/Select.js +3 -3
- package/dist/src/components/generic/Select/Select.js.map +1 -1
- package/dist/src/components/generic/TextBox.d.ts +1 -0
- package/dist/src/components/generic/TextBox.js +1 -1
- package/dist/src/components/generic/TextBox.js.map +1 -1
- package/dist/src/components/navigation/Header.js +2 -3
- package/dist/src/components/navigation/Header.js.map +1 -1
- package/dist/src/components/steps/confirmation/StepConfirmationAcknowledgement.d.ts +6 -3
- package/dist/src/components/steps/confirmation/StepConfirmationAcknowledgement.js +9 -19
- package/dist/src/components/steps/confirmation/StepConfirmationAcknowledgement.js.map +1 -1
- package/dist/src/components/steps/confirmation/StepConfirmationForm.js +28 -15
- package/dist/src/components/steps/confirmation/StepConfirmationForm.js.map +1 -1
- package/dist/src/contexts/ConfirmationStepContext/ConfirmationStepContextTypes.d.ts +1 -1
- package/dist/src/contexts/ConfirmationStepContext/ConfirmationStepContextTypes.js.map +1 -1
- package/dist/src/contexts/ConfirmationStepContext/ConfirmationStepContextWrapper.js +8 -9
- package/dist/src/contexts/ConfirmationStepContext/ConfirmationStepContextWrapper.js.map +1 -1
- package/dist/src/contexts/index.d.ts +22 -22
- package/dist/src/contexts/index.js +22 -22
- package/dist/src/contexts/index.js.map +1 -1
- package/dist/src/models/Confirmation.d.ts +0 -2
- package/dist/src/models/Confirmation.js.map +1 -1
- package/dist/src/pages/steps/StepConfirmation/StepConfirmationComponent.js +2 -1
- package/dist/src/pages/steps/StepConfirmation/StepConfirmationComponent.js.map +1 -1
- package/dist/src/stories/BookingWizard.stories.d.ts +1 -0
- package/dist/src/stories/BookingWizard.stories.js +12 -19
- package/dist/src/stories/BookingWizard.stories.js.map +1 -1
- package/dist/src/stories/Select.stories.d.ts +1 -0
- package/dist/test.bundle.js +1 -1
- package/dist/tests/offline/entry/RSCompany.js +2 -2
- package/dist/tests/offline/entry/RSCompany.js.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConfirmationStepContextWrapper.js","sourceRoot":"/","sources":["src/contexts/ConfirmationStepContext/ConfirmationStepContextWrapper.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,kDAA0B;AAC1B,iCAAoE;AAGpE,sEAAuC;AAEvC,iDAAiE;AACjE,2CAAkD;AAElD,wDAA0C;AAC1C,yCAAyC;AAEzC,qDAAwD;AACxD,kEAAmF;AACnF,iEAAiE;AACjE,uEAAoE;AAEpE,MAAM,+BAA+B,GAAG,iDAAuB,CAAC,QAAQ,CAAC;AAClE,MAAM,8BAA8B,GAA+B,CAAC,EAAE,QAAQ,EAAE,EAAE,EAAE;IACvF,MAAM,EAAE,kBAAkB,EAAE,eAAe,EAAE,kBAAkB,EAAE,sBAAsB,EAAE,GAAG,IAAA,wCAAoB,GAAE,CAAC;IAEnH,MAAM,CAAC,SAAS,EAAE,YAAY,CAAC,GAAG,IAAA,gBAAQ,EAAU,KAAK,CAAC,CAAC;IAC3D,MAAM,CAAC,SAAS,EAAE,YAAY,CAAC,GAAG,IAAA,gBAAQ,EAAS,EAAE,CAAC,CAAC;IACvD,MAAM,OAAO,GAAG,IAAA,yBAAO,EAAyB;QAC5C,IAAI,EAAE,UAAU;KACnB,CAAC,CAAC;IACH,MAAM,aAAa,GAAG,IAAA,kBAAU,EAAC,wBAAa,CAAC,CAAC;IAChD,MAAM,UAAU,GAAG,aAAa,CAAC,eAAe,EAAE,CAAC;IACnD,MAAM,eAAe,GAAG,aAAa,CAAC,eAAe,CAAC;IACtD,MAAM,EAAE,KAAK,EAAE,GAAG,IAAA,uBAAe,GAAE,CAAC;IAEpC,MAAM,cAAc,GAAG,CAAC,UAAkC,EAAiB,EAAE;QACzE,OAAO,UAAU,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,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CAAC,eAAe,CAAC,eAAe,EAAE,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,OAAiB,CAAC,CAAC;aAC3H;iBAAM;gBACH,MAAM,CAAC,gBAAgB,CAAC,wDAAwD,GAAG,IAAI,CAAC,SAAS,CAAC,aAAa,CAAC,eAAe,CAAC,CAAC,CAAC;aACrI;SACJ;QAAC,OAAO,EAAE,EAAE;YACT,OAAO,CAAC,GAAG,CAAC,iCAAiC,CAAC,CAAC;YAC/C,MAAM,CAAC,gBAAgB,CAAC,EAAE,CAAC,CAAC;SAC/B;gBAAS;YACN,aAAa,CAAC,QAAQ,EAAE,CAAC;YACzB,YAAY,CAAC,KAAK,CAAC,CAAC;SACvB;IACL,CAAC,CAAA,CAAC;IAEF,MAAM,cAAc,GAAG,GAAG,EAAE,CAAC,YAAY,CAAC,EAAE,CAAC,CAAC;IAE9C,MAAM,IAAI,GAAG,CACT,iBAAyC,EACzC,WAAmC,EACnC,qBAA+C,EAC/C,SAAgC,EAClC,EAAE;QACA,MAAM,OAAO,CAAC,YAAY,CAAC,QAAQ,CAAC,iBAAiB,EAAE,WAAW,EAAE,qBAAqB,EAAE,SAAS,CAAC,CAAC,EAAE,CAAC;IAC7G,CAAC,CAAA,CAAC;IAEF,OAAO,CACH,8BAAC,8BAAY,oBAAK,OAAO;QACrB,8BAAC,+BAA+B,IAC5B,KAAK,EAAE;gBACH,IAAI;gBACJ,iBAAiB;gBACjB,mBAAmB;gBAEnB,SAAS;gBACT,SAAS;gBACT,cAAc;gBACd,iBAAiB;aACpB,IAEA,QAAQ,CACqB,CACvB,CAClB,CAAC;AACN,CAAC,CAAC;AApLW,QAAA,8BAA8B,kCAoLzC","sourcesContent":["import React from 'react';\nimport { FC, PropsWithChildren, useContext, useState } from 'react';\nimport ReservationsDTO from '../../models/Api/ReservationsDTO';\nimport reservationsDTO, { ReservationDTO } from '../../models/Api/ReservationsDTO';\nimport API from '../../api/BookingAPI';\nimport UserProfile from '../../models/UserProfile';\nimport { BasketContext, ErrorHandler } from '@frontend/contexts';\nimport { useCurrentHotel } from '@frontend/hooks';\nimport BasketRowDifferences from '../../models/BasketRowDifferences';\nimport * as Sentry from '@sentry/browser';\nimport { Severity } from '@sentry/types';\nimport { ConfirmationFormValues, FBookGetPaymentDetails, FBookSuccessCallback, FBookValidateFunction, FBookValidationCallback, IBookValidationResult } from '@/models/Confirmation';\nimport { FormProvider, useForm } from 'react-hook-form';\nimport DataLayer, { InteractionStep, InteractionType } from '../../util/DataLayer';\nimport { useConfirmationQuery } from '@/hooks/ConfirmationQuery';\nimport { ConfirmationStepContext } from './ConfirmationStepContext';\n\nconst ConfirmationStepContextProvider = ConfirmationStepContext.Provider;\nexport const ConfirmationStepContextWrapper: FC<PropsWithChildren<any>> = ({ children }) => {\n const { queryPaymentMethod, queryRoomstayId: queryReservationId, queryPlanpayCheckoutId } = useConfirmationQuery();\n\n const [isLoading, setIsLoading] = useState<boolean>(false);\n const [apiErrors, setApiErrors] = useState<string>('');\n const methods = useForm<ConfirmationFormValues>({\n mode: 'onChange',\n });\n const basketContext = useContext(BasketContext);\n const basketRows = basketContext.getAllValidRows();\n const basketAddonRows = basketContext.basketAddonRows;\n const { hotel } = useCurrentHotel();\n\n const toUserProfiles = (formValues: ConfirmationFormValues): UserProfile[] => {\n return formValues.userProfiles.map((values) => ({\n FirstName: values.Forename,\n LastName: values.Surname,\n Phone: values.Phone.replace(' ', ''),\n Email: values.Email,\n Address: {\n Line1: values.Address,\n City: values.City,\n PostalCode: values.PostCode,\n Country: values.Country,\n },\n MarketingOptIn: false,\n }));\n };\n\n const validateReservation = async (data: reservationsDTO): Promise<IBookValidationResult | undefined> => {\n const apiDifferences: BasketRowDifferences[] = [];\n if (data.reservations) {\n data.reservations.forEach((reservation: ReservationDTO, index) => {\n const diff = basketContext.currentBasketRows[index].checkDiffFromReservation(reservation);\n\n if (diff) {\n apiDifferences.push(diff);\n }\n });\n } else {\n Sentry.addBreadcrumb({\n level: Severity.Error,\n message: 'No reservation data: ' + JSON.stringify(data),\n });\n throw new Error('The reservation could not be completed due to an unexpected issue, please try again');\n }\n\n // If there are differences, we want to display them to make sure the booking still needs to proceed\n if (apiDifferences.length || (data.warnings && data.warnings.length)) {\n return {\n differences: apiDifferences,\n warnings: data.warnings as string[],\n };\n }\n };\n\n const onSubmit =\n (getPaymentDetails: FBookGetPaymentDetails, preValidate?: FBookValidateFunction, onPostValidationError?: FBookValidationCallback, onSuccess?: FBookSuccessCallback) =>\n async (formValues: ConfirmationFormValues): Promise<void> => {\n DataLayer.instance.sendInteraction('Complete Booking', InteractionType.BUTTON, InteractionStep.GUEST_DETAILS);\n setIsLoading(true);\n let data: ReservationsDTO | undefined;\n const validateResult = !preValidate || (await preValidate());\n if (!validateResult) {\n setIsLoading(false);\n return;\n }\n\n const payment = await getPaymentDetails();\n\n try {\n data = await API.Reservation.bookNow(basketRows, toUserProfiles(formValues), payment, basketAddonRows, formValues.comment || '', hotel?.hotelID as string);\n basketContext.booked(data);\n const validationResult = await validateReservation(data);\n if (validationResult) {\n setIsLoading(false);\n onPostValidationError?.(validationResult);\n } else onSuccess?.(data);\n } catch (error: any) {\n console.log(error);\n setApiErrors(error?.Message ?? 'Unexpected error returned from the booking database.');\n // We don't want to stop the isLoading on a succesful flow to avoid clicking checkout twice\n setIsLoading(false);\n }\n };\n\n const isBackFromPlanpay = !!queryPlanpayCheckoutId && !!queryReservationId && !!queryPaymentMethod;\n\n const parseReservationIdsFromData = (data: ReservationsDTO) => {\n return data?.reservations?.map((reservation) => reservation.reservationNumber);\n };\n\n const commitReservation = async (resData: ReservationsDTO) => {\n try {\n setIsLoading(true);\n if (resData) {\n const reservationIds = parseReservationIdsFromData(resData);\n if (reservationIds.length) {\n try {\n API.Reservation.commit(reservationIds, resData.itineraryNumber, hotel?.hotelID as string, queryPlanpayCheckoutId || undefined)\n .then((response: ReservationsDTO) => {\n try {\n DataLayer.instance.sendReservationConfirmed(basketContext.getAllValidRows(), basketContext.basketAddonRows, response);\n } catch (ex) {\n Sentry.captureException('Failed to read reservations from GTM code: ' + JSON.stringify(ex));\n }\n basketContext.checkedOut(response);\n })\n .catch((ex: any) => {\n console.log(ex);\n setApiErrors('Unexpected error');\n })\n .finally(() => {\n setIsLoading(false);\n });\n } catch (error: any) {\n setApiErrors(error?.Message ?? 'Unexpected error returned from the booking database.');\n }\n } else {\n setApiErrors('Committing reservation failed due to an unexpected error');\n ErrorHandler.add({ message: 'Committing reservation failed due to an unexpected error' });\n Sentry.captureException('No reservation IDs found when attempting to commit: ' + JSON.stringify(resData));\n }\n }\n } catch (ex) {\n setApiErrors('Failed to commit reservation');\n console.log('Failed to commit reservation ');\n console.error(ex);\n Sentry.captureException(ex);\n }\n };\n\n const rollbackReservation = async () => {\n if (!basketContext.reservationData) return;\n try {\n const reservationIds = parseReservationIdsFromData(basketContext.reservationData);\n if (reservationIds.length) {\n setIsLoading(true);\n await API.Reservation.rollback(reservationIds, basketContext.reservationData.itineraryNumber, hotel?.hotelID as string);\n } else {\n Sentry.captureException('No reservation IDs found when attempting to rollback: ' + JSON.stringify(basketContext.reservationData));\n }\n } catch (ex) {\n console.log('Failed to rollback reservations');\n Sentry.captureException(ex);\n } finally {\n basketContext.rollback();\n setIsLoading(false);\n }\n };\n\n const clearApiErrors = () => setApiErrors('');\n\n const book = async (\n getPaymentDetails: FBookGetPaymentDetails,\n preValidate?: FBookValidateFunction,\n onPostValidationError?: FBookValidationCallback,\n onSuccess?: FBookSuccessCallback\n ) => {\n await methods.handleSubmit(onSubmit(getPaymentDetails, preValidate, onPostValidationError, onSuccess))();\n };\n\n return (\n <FormProvider {...methods}>\n <ConfirmationStepContextProvider\n value={{\n book,\n commitReservation,\n rollbackReservation,\n\n isLoading,\n apiErrors,\n clearApiErrors,\n isBackFromPlanpay,\n }}\n >\n {children}\n </ConfirmationStepContextProvider>\n </FormProvider>\n );\n};\n"]}
|
|
1
|
+
{"version":3,"file":"ConfirmationStepContextWrapper.js","sourceRoot":"/","sources":["src/contexts/Conf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AC,SAAS,CAAC,aAAa,CAAC,eAAe,CAAC,CAAC,CAAC;aACrI;SACJ;QAAC,OAAO,EAAE,EAAE;YACT,OAAO,CAAC,GAAG,CAAC,iCAAiC,CAAC,CAAC;YAC/C,MAAM,CAAC,gBAAgB,CAAC,EAAE,CAAC,CAAC;SAC/B;gBAAS;YACN,aAAa,CAAC,QAAQ,EAAE,CAAC;YACzB,YAAY,CAAC,KAAK,CAAC,CAAC;SACvB;IACL,CAAC,CAAA,CAAC;IAEF,MAAM,cAAc,GAAG,GAAG,EAAE,CAAC,YAAY,CAAC,EAAE,CAAC,CAAC;IAE9C,MAAM,IAAI,GAAG,CACT,iBAAyC,EACzC,QAAiB,EACjB,WAAmC,EACnC,qBAA+C,EAC/C,SAAgC,EAClC,EAAE;QACA,MAAM,OAAO,CAAC,YAAY,CAAC,QAAQ,CAAC,iBAAiB,EAAE,QAAQ,EAAE,WAAW,EAAE,qBAAqB,EAAE,SAAS,CAAC,CAAC,EAAE,CAAC;IACvH,CAAC,CAAA,CAAC;IAEF,OAAO,CACH,8BAAC,8BAAY,oBAAK,OAAO;QACrB,8BAAC,+BAA+B,IAC5B,KAAK,EAAE;gBACH,IAAI;gBACJ,iBAAiB;gBACjB,mBAAmB;gBAEnB,SAAS;gBACT,SAAS;gBACT,cAAc;gBACd,iBAAiB;aACpB,IAEA,QAAQ,CACqB,CACvB,CAClB,CAAC;AACN,CAAC,CAAC;AA3LW,QAAA,8BAA8B,kCA2LzC","sourcesContent":["import React, { FC, PropsWithChildren, useContext, useState } from 'react';\nimport ReservationsDTO from '../../models/Api/ReservationsDTO';\nimport reservationsDTO, { ReservationDTO } from '../../models/Api/ReservationsDTO';\nimport API from '../../api/BookingAPI';\nimport UserProfile from '../../models/UserProfile';\nimport { BasketContext, ErrorHandler } from '@frontend/contexts';\nimport { useCurrentHotel } from '@frontend/hooks';\nimport BasketRowDifferences from '../../models/BasketRowDifferences';\nimport * as Sentry from '@sentry/browser';\nimport { Severity } from '@sentry/types';\nimport { ConfirmationFormValues, FBookGetPaymentDetails, FBookSuccessCallback, FBookValidateFunction, FBookValidationCallback, IBookValidationResult } from '@/models/Confirmation';\nimport { FormProvider, useForm } from 'react-hook-form';\nimport DataLayer, { InteractionStep, InteractionType } from '../../util/DataLayer';\nimport { useConfirmationQuery } from '@/hooks/ConfirmationQuery';\nimport { ConfirmationStepContext } from './ConfirmationStepContext';\n\nconst ConfirmationStepContextProvider = ConfirmationStepContext.Provider;\nexport const ConfirmationStepContextWrapper: FC<PropsWithChildren<any>> = ({ children }) => {\n const { queryPaymentMethod, queryRoomstayId: queryReservationId, queryPlanpayCheckoutId } = useConfirmationQuery();\n\n const [isLoading, setIsLoading] = useState<boolean>(false);\n const [apiErrors, setApiErrors] = useState<string>('');\n const methods = useForm<ConfirmationFormValues>({\n mode: 'onChange',\n });\n const basketContext = useContext(BasketContext);\n const basketRows = basketContext.getAllValidRows();\n const basketAddonRows = basketContext.basketAddonRows;\n const { hotel } = useCurrentHotel();\n\n const toUserProfiles = (formValues: ConfirmationFormValues): UserProfile[] => {\n return formValues.userProfiles.map((values) => ({\n FirstName: values.Forename,\n LastName: values.Surname,\n Phone: values.Phone.replace(' ', ''),\n Email: values.Email,\n Address: {\n Line1: values.Address,\n City: values.City,\n PostalCode: values.PostCode,\n Country: values.Country,\n },\n MarketingOptIn: false,\n }));\n };\n\n const validateReservation = async (data: reservationsDTO): Promise<IBookValidationResult | undefined> => {\n const apiDifferences: BasketRowDifferences[] = [];\n if (data.reservations) {\n data.reservations.forEach((reservation: ReservationDTO, index) => {\n const diff = basketContext.currentBasketRows[index].checkDiffFromReservation(reservation);\n\n if (diff) {\n apiDifferences.push(diff);\n }\n });\n } else {\n Sentry.addBreadcrumb({\n level: Severity.Error,\n message: 'No reservation data: ' + JSON.stringify(data),\n });\n throw new Error('The reservation could not be completed due to an unexpected issue, please try again');\n }\n\n // If there are differences, we want to display them to make sure the booking still needs to proceed\n if (apiDifferences.length || (data.warnings && data.warnings.length)) {\n return {\n differences: apiDifferences,\n warnings: data.warnings as string[],\n };\n }\n };\n\n const onSubmit =\n (\n getPaymentDetails: FBookGetPaymentDetails,\n comments?: string,\n preValidate?: FBookValidateFunction,\n onPostValidationError?: FBookValidationCallback,\n onSuccess?: FBookSuccessCallback\n ) =>\n async (formValues: ConfirmationFormValues): Promise<void> => {\n DataLayer.instance.sendInteraction('Complete Booking', InteractionType.BUTTON, InteractionStep.GUEST_DETAILS);\n setIsLoading(true);\n let data: ReservationsDTO | undefined;\n const validateResult = !preValidate || (await preValidate());\n if (!validateResult) {\n setIsLoading(false);\n return;\n }\n\n const payment = await getPaymentDetails();\n\n try {\n data = await API.Reservation.bookNow(basketRows, toUserProfiles(formValues), payment, basketAddonRows, comments || '', hotel?.hotelID as string);\n basketContext.booked(data);\n const validationResult = await validateReservation(data);\n if (validationResult) {\n setIsLoading(false);\n onPostValidationError?.(validationResult);\n } else onSuccess?.(data);\n } catch (error: any) {\n console.log(error);\n setApiErrors(error?.Message ?? 'Unexpected error returned from the booking database.');\n // We don't want to stop the isLoading on a succesful flow to avoid clicking checkout twice\n setIsLoading(false);\n }\n };\n\n const isBackFromPlanpay = !!queryPlanpayCheckoutId && !!queryReservationId && !!queryPaymentMethod;\n\n const parseReservationIdsFromData = (data: ReservationsDTO) => {\n return data?.reservations?.map((reservation) => reservation.reservationNumber);\n };\n\n const commitReservation = async (resData: ReservationsDTO) => {\n try {\n setIsLoading(true);\n if (resData) {\n const reservationIds = parseReservationIdsFromData(resData);\n if (reservationIds.length) {\n try {\n API.Reservation.commit(reservationIds, resData.itineraryNumber, hotel?.hotelID as string, queryPlanpayCheckoutId || undefined)\n .then((response: ReservationsDTO) => {\n try {\n DataLayer.instance.sendReservationConfirmed(basketContext.getAllValidRows(), basketContext.basketAddonRows, response);\n } catch (ex) {\n Sentry.captureException('Failed to read reservations from GTM code: ' + JSON.stringify(ex));\n }\n basketContext.checkedOut(response);\n })\n .catch((ex: any) => {\n console.log(ex);\n setApiErrors('Unexpected error');\n })\n .finally(() => {\n setIsLoading(false);\n });\n } catch (error: any) {\n setApiErrors(error?.Message ?? 'Unexpected error returned from the booking database.');\n }\n } else {\n setApiErrors('Committing reservation failed due to an unexpected error');\n ErrorHandler.add({ message: 'Committing reservation failed due to an unexpected error' });\n Sentry.captureException('No reservation IDs found when attempting to commit: ' + JSON.stringify(resData));\n }\n }\n } catch (ex) {\n setApiErrors('Failed to commit reservation');\n console.log('Failed to commit reservation ');\n console.error(ex);\n Sentry.captureException(ex);\n }\n };\n\n const rollbackReservation = async () => {\n if (!basketContext.reservationData) return;\n try {\n const reservationIds = parseReservationIdsFromData(basketContext.reservationData);\n if (reservationIds.length) {\n setIsLoading(true);\n await API.Reservation.rollback(reservationIds, basketContext.reservationData.itineraryNumber, hotel?.hotelID as string);\n } else {\n Sentry.captureException('No reservation IDs found when attempting to rollback: ' + JSON.stringify(basketContext.reservationData));\n }\n } catch (ex) {\n console.log('Failed to rollback reservations');\n Sentry.captureException(ex);\n } finally {\n basketContext.rollback();\n setIsLoading(false);\n }\n };\n\n const clearApiErrors = () => setApiErrors('');\n\n const book = async (\n getPaymentDetails: FBookGetPaymentDetails,\n comments?: string,\n preValidate?: FBookValidateFunction,\n onPostValidationError?: FBookValidationCallback,\n onSuccess?: FBookSuccessCallback\n ) => {\n await methods.handleSubmit(onSubmit(getPaymentDetails, comments, preValidate, onPostValidationError, onSuccess))();\n };\n\n return (\n <FormProvider {...methods}>\n <ConfirmationStepContextProvider\n value={{\n book,\n commitReservation,\n rollbackReservation,\n\n isLoading,\n apiErrors,\n clearApiErrors,\n isBackFromPlanpay,\n }}\n >\n {children}\n </ConfirmationStepContextProvider>\n </FormProvider>\n );\n};\n"]}
|
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
export * from '
|
|
2
|
-
export * from '
|
|
3
|
-
export * from '
|
|
4
|
-
export * from '
|
|
5
|
-
export * from '
|
|
6
|
-
export * from '
|
|
7
|
-
export * from '
|
|
8
|
-
export * from '
|
|
9
|
-
export * from '
|
|
10
|
-
export * from '
|
|
11
|
-
export * from '
|
|
12
|
-
export * from '
|
|
13
|
-
export * from '
|
|
14
|
-
export * from '
|
|
15
|
-
export * from '
|
|
16
|
-
export * from '
|
|
17
|
-
export * from '
|
|
18
|
-
export * from '
|
|
19
|
-
export * from '
|
|
20
|
-
export * from '
|
|
21
|
-
export * from '
|
|
22
|
-
export * from '
|
|
1
|
+
export * from './BasketContext/BasketContext';
|
|
2
|
+
export * from './BasketContext/BasketContextWrapper';
|
|
3
|
+
export * from './BasketContext/BasketContextType';
|
|
4
|
+
export * from './BookingEngineContext/BookingEngineContextType.types';
|
|
5
|
+
export * from './BookingEngineContext/BookingEngineContextWrapper';
|
|
6
|
+
export * from './BookingEngineContext/BookingEngineContext';
|
|
7
|
+
export * from './CompanyContext/CompanyContextType.type';
|
|
8
|
+
export * from './CompanyContext/CompanyContextWrapper';
|
|
9
|
+
export * from './CompanyContext/CompanyContext';
|
|
10
|
+
export * from './Members/AuthenticationContext/AuthenticationContext';
|
|
11
|
+
export * from './Members/AuthenticationContext/AuthenticationContextProvider';
|
|
12
|
+
export * from './Members/RoomstayMemberContext/RoomstayMemberContext';
|
|
13
|
+
export * from './Members/RoomstayMemberContext/RoomstayMemberContextProvider';
|
|
14
|
+
export * from './ConfirmationFormContext';
|
|
15
|
+
export * from './DatePickerContext';
|
|
16
|
+
export * from './ErrorContext';
|
|
17
|
+
export * from './FullPageEngineContext/FullPageEngineContext';
|
|
18
|
+
export * from './FullPageEngineContext/FullPageEngineContextTypes';
|
|
19
|
+
export * from './FullPageEngineContext/FullPageEngineContextWrapper';
|
|
20
|
+
export * from './HotelOverridesContext';
|
|
21
|
+
export * from './ModalContext';
|
|
22
|
+
export * from './NotificationContext';
|
|
@@ -14,26 +14,26 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("
|
|
18
|
-
__exportStar(require("
|
|
19
|
-
__exportStar(require("
|
|
20
|
-
__exportStar(require("
|
|
21
|
-
__exportStar(require("
|
|
22
|
-
__exportStar(require("
|
|
23
|
-
__exportStar(require("
|
|
24
|
-
__exportStar(require("
|
|
25
|
-
__exportStar(require("
|
|
26
|
-
__exportStar(require("
|
|
27
|
-
__exportStar(require("
|
|
28
|
-
__exportStar(require("
|
|
29
|
-
__exportStar(require("
|
|
30
|
-
__exportStar(require("
|
|
31
|
-
__exportStar(require("
|
|
32
|
-
__exportStar(require("
|
|
33
|
-
__exportStar(require("
|
|
34
|
-
__exportStar(require("
|
|
35
|
-
__exportStar(require("
|
|
36
|
-
__exportStar(require("
|
|
37
|
-
__exportStar(require("
|
|
38
|
-
__exportStar(require("
|
|
17
|
+
__exportStar(require("./BasketContext/BasketContext"), exports);
|
|
18
|
+
__exportStar(require("./BasketContext/BasketContextWrapper"), exports);
|
|
19
|
+
__exportStar(require("./BasketContext/BasketContextType"), exports);
|
|
20
|
+
__exportStar(require("./BookingEngineContext/BookingEngineContextType.types"), exports);
|
|
21
|
+
__exportStar(require("./BookingEngineContext/BookingEngineContextWrapper"), exports);
|
|
22
|
+
__exportStar(require("./BookingEngineContext/BookingEngineContext"), exports);
|
|
23
|
+
__exportStar(require("./CompanyContext/CompanyContextType.type"), exports);
|
|
24
|
+
__exportStar(require("./CompanyContext/CompanyContextWrapper"), exports);
|
|
25
|
+
__exportStar(require("./CompanyContext/CompanyContext"), exports);
|
|
26
|
+
__exportStar(require("./Members/AuthenticationContext/AuthenticationContext"), exports);
|
|
27
|
+
__exportStar(require("./Members/AuthenticationContext/AuthenticationContextProvider"), exports);
|
|
28
|
+
__exportStar(require("./Members/RoomstayMemberContext/RoomstayMemberContext"), exports);
|
|
29
|
+
__exportStar(require("./Members/RoomstayMemberContext/RoomstayMemberContextProvider"), exports);
|
|
30
|
+
__exportStar(require("./ConfirmationFormContext"), exports);
|
|
31
|
+
__exportStar(require("./DatePickerContext"), exports);
|
|
32
|
+
__exportStar(require("./ErrorContext"), exports);
|
|
33
|
+
__exportStar(require("./FullPageEngineContext/FullPageEngineContext"), exports);
|
|
34
|
+
__exportStar(require("./FullPageEngineContext/FullPageEngineContextTypes"), exports);
|
|
35
|
+
__exportStar(require("./FullPageEngineContext/FullPageEngineContextWrapper"), exports);
|
|
36
|
+
__exportStar(require("./HotelOverridesContext"), exports);
|
|
37
|
+
__exportStar(require("./ModalContext"), exports);
|
|
38
|
+
__exportStar(require("./NotificationContext"), exports);
|
|
39
39
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"/","sources":["src/contexts/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"/","sources":["src/contexts/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,yEAAuD;AACvD,gFAA8D;AAC9D,6EAA2D;AAE3D,iGAA+E;AAC/E,8FAA4E;AAC5E,uFAAqE;AAErE,oFAAkE;AAClE,kFAAgE;AAChE,2EAAyD;AAEzD,iGAA+E;AAC/E,yGAAuF;AACvF,iGAA+E;AAC/E,yGAAuF;AAEvF,qEAAmD;AACnD,+DAA6C;AAC7C,0DAAwC;AAExC,yFAAuE;AACvE,8FAA4E;AAC5E,gGAA8E;AAE9E,mEAAiD;AACjD,0DAAwC;AACxC,iEAA+C","sourcesContent":["export * from '@/contexts/BasketContext/BasketContext';\nexport * from '@/contexts/BasketContext/BasketContextWrapper';\nexport * from '@/contexts/BasketContext/BasketContextType';\n\nexport * from '@/contexts/BookingEngineContext/BookingEngineContextType.types';\nexport * from '@/contexts/BookingEngineContext/BookingEngineContextWrapper';\nexport * from '@/contexts/BookingEngineContext/BookingEngineContext';\n\nexport * from '@/contexts/CompanyContext/CompanyContextType.type';\nexport * from '@/contexts/CompanyContext/CompanyContextWrapper';\nexport * from '@/contexts/CompanyContext/CompanyContext';\n\nexport * from '@/contexts/Members/AuthenticationContext/AuthenticationContext';\nexport * from '@/contexts/Members/AuthenticationContext/AuthenticationContextProvider';\nexport * from '@/contexts/Members/RoomstayMemberContext/RoomstayMemberContext';\nexport * from '@/contexts/Members/RoomstayMemberContext/RoomstayMemberContextProvider';\n\nexport * from '@/contexts/ConfirmationFormContext';\nexport * from '@/contexts/DatePickerContext';\nexport * from '@/contexts/ErrorContext';\n\nexport * from '@/contexts/FullPageEngineContext/FullPageEngineContext';\nexport * from '@/contexts/FullPageEngineContext/FullPageEngineContextTypes';\nexport * from '@/contexts/FullPageEngineContext/FullPageEngineContextWrapper';\n\nexport * from '@/contexts/HotelOverridesContext';\nexport * from '@/contexts/ModalContext';\nexport * from '@/contexts/NotificationContext';\n"]}
|
|
@@ -15,8 +15,6 @@ export type TUserProfileFormValues = {
|
|
|
15
15
|
[userProfileKey in EUserProfileFormKey]: string;
|
|
16
16
|
};
|
|
17
17
|
export interface ConfirmationFormValues {
|
|
18
|
-
isPolicyConfirmed?: boolean;
|
|
19
|
-
comment?: string;
|
|
20
18
|
IATANumber?: string;
|
|
21
19
|
userProfiles: TUserProfileFormValues[];
|
|
22
20
|
copyCheckBox?: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Confirmation.js","sourceRoot":"/","sources":["src/models/Confirmation.ts"],"names":[],"mappings":";;;AAIA,IAAY,mBASX;AATD,WAAY,mBAAmB;IAC3B,4CAAqB,CAAA;IACrB,0CAAmB,CAAA;IACnB,sCAAe,CAAA;IACf,sCAAe,CAAA;IACf,0CAAmB,CAAA;IACnB,oCAAa,CAAA;IACb,4CAAqB,CAAA;IACrB,0CAAmB,CAAA;AACvB,CAAC,EATW,mBAAmB,GAAnB,2BAAmB,KAAnB,2BAAmB,QAS9B","sourcesContent":["import BasketRowDifferences from './BasketRowDifferences';\nimport ReservationsDTO from './Api/ReservationsDTO';\nimport { EBookingPaymentMethod, IBookingPayment } from '@roomstay/core';\n\nexport enum EUserProfileFormKey {\n Forename = 'Forename',\n Surname = 'Surname',\n Email = 'Email',\n Phone = 'Phone',\n Address = 'Address',\n City = 'City',\n PostCode = 'PostCode',\n Country = 'Country',\n}\n\nexport type TUserProfileFormValues = {\n [userProfileKey in EUserProfileFormKey]: string;\n};\n\nexport interface ConfirmationFormValues {\n
|
|
1
|
+
{"version":3,"file":"Confirmation.js","sourceRoot":"/","sources":["src/models/Confirmation.ts"],"names":[],"mappings":";;;AAIA,IAAY,mBASX;AATD,WAAY,mBAAmB;IAC3B,4CAAqB,CAAA;IACrB,0CAAmB,CAAA;IACnB,sCAAe,CAAA;IACf,sCAAe,CAAA;IACf,0CAAmB,CAAA;IACnB,oCAAa,CAAA;IACb,4CAAqB,CAAA;IACrB,0CAAmB,CAAA;AACvB,CAAC,EATW,mBAAmB,GAAnB,2BAAmB,KAAnB,2BAAmB,QAS9B","sourcesContent":["import BasketRowDifferences from './BasketRowDifferences';\nimport ReservationsDTO from './Api/ReservationsDTO';\nimport { EBookingPaymentMethod, IBookingPayment } from '@roomstay/core';\n\nexport enum EUserProfileFormKey {\n Forename = 'Forename',\n Surname = 'Surname',\n Email = 'Email',\n Phone = 'Phone',\n Address = 'Address',\n City = 'City',\n PostCode = 'PostCode',\n Country = 'Country',\n}\n\nexport type TUserProfileFormValues = {\n [userProfileKey in EUserProfileFormKey]: string;\n};\n\nexport interface ConfirmationFormValues {\n IATANumber?: string;\n userProfiles: TUserProfileFormValues[];\n copyCheckBox?: boolean;\n paymentMethod: EBookingPaymentMethod;\n}\n\nexport interface IBookValidationResult {\n differences: BasketRowDifferences[];\n warnings: string[];\n}\n\nexport type FBookValidationCallback = (validationResult?: IBookValidationResult) => void;\nexport type FBookSuccessCallback = (data: ReservationsDTO) => void;\nexport type FBookValidateFunction = () => Promise<boolean>;\nexport type FBookGetPaymentDetails = () => Promise<IBookingPayment>;\n"]}
|
|
@@ -76,7 +76,8 @@ function StepConfirmationComponent() {
|
|
|
76
76
|
react_1.default.createElement(StepLayout_1.StepLayoutLeftContent, null,
|
|
77
77
|
react_1.default.createElement("div", { className: "block-container" },
|
|
78
78
|
!InlineAddonStepFeature_1.default.isActive() && react_1.default.createElement(AdditionalOffers_1.default, null),
|
|
79
|
-
react_1.default.createElement(
|
|
79
|
+
react_1.default.createElement(contexts_1.ConfirmationFormContextWrapper, null,
|
|
80
|
+
react_1.default.createElement(StepConfirmationFormProvider_1.default, null)))),
|
|
80
81
|
context.screenSize > ScreenSize_1.default.Medium && (react_1.default.createElement(StepLayout_1.StepLayoutRightContent, null,
|
|
81
82
|
react_1.default.createElement(StepConfirmationLimitedOffer_1.default, { endDate: (0, dayjs_1.default)().add(10, 'minute') }),
|
|
82
83
|
react_1.default.createElement(BESummary_1.BESummary, { showImages: true }))))));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StepConfirmationComponent.js","sourceRoot":"/","sources":["src/pages/steps/StepConfirmation/StepConfirmationComponent.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+CAAqD;AACrD,6EAAqD;AACrD,qEAA6C;AAC7C,8DAA2D;AAC3D,uDAAwC;AACxC,+EAAuD;AACvD,iFAAyD;AACzD,0DAAuD;AACvD,2FAAmE;AAEnE,mEAA2C;AAE3C,wGAAgF;AAChF,iDAA+C;AAC/C,yHAAiG;AACjG,gIAAwG;AACxG,kDAA0B;AAC1B,0GAAkF;AAClF,wGAAgF;AAChF,iDAA6C;AAC7C,6CAAyD;AACzD,
|
|
1
|
+
{"version":3,"file":"StepConfirmationComponent.js","sourceRoot":"/","sources":["src/pages/steps/StepConfirmation/StepConfirmationComponent.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+CAAqD;AACrD,6EAAqD;AACrD,qEAA6C;AAC7C,8DAA2D;AAC3D,uDAAwC;AACxC,+EAAuD;AACvD,iFAAyD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C,eAAe;oBAC1B,8BAAC,+BAAqB,OAAG,CACvB,CACc;YACvB,OAAO,CAAC,UAAU,GAAG,oBAAU,CAAC,MAAM,IAAI,CACvC,8BAAC,mCAAsB;gBACnB,8BAAC,8BAAoB,OAAG,CACH,CAC5B,CACiB;QACtB,8BAAC,mBAAS,OAAG;QACb,8BAAC,gCAAmB;YAChB,8BAAC,kCAAqB;gBAClB,uCAAK,SAAS,EAAC,iBAAiB;oBAC3B,CAAC,gCAAsB,CAAC,QAAQ,EAAE,IAAI,8BAAC,0BAAgB,OAAG;oBAC3D,8BAAC,yCAA8B;wBAC3B,8BAAC,sCAA4B,OAAG,CACH,CAC/B,CACc;YAEvB,OAAO,CAAC,UAAU,GAAG,oBAAU,CAAC,MAAM,IAAI,CACvC,8BAAC,mCAAsB;gBACnB,8BAAC,sCAA4B,IAAC,OAAO,EAAE,IAAA,eAAK,GAAE,CAAC,GAAG,CAAC,EAAE,EAAE,QAAQ,CAAC,GAAI;gBACpE,8BAAC,qBAAS,IAAC,UAAU,SAAG,CACH,CAC5B,CACiB,CACpB,CACT,CAAC;AACN,CAAC;AAED,kBAAe,yBAAyB,CAAC","sourcesContent":["import React, { useContext, useEffect } from 'react';\nimport Headline from '@/components/generic/Headline';\nimport StepManager from '@/util/StepManager';\nimport { BESummary } from '@/components/summary/BESummary';\nimport { Link } from 'react-router-dom';\nimport LineBreak from '@/components/generic/LineBreak';\nimport BackButton from '@/components/generic/BackButton';\nimport { Translation } from 'translations/Translation';\nimport BEMobileSummary from '@/components/summary/BEMobileSummary';\n\nimport ScreenSize from '@/util/ScreenSize';\n\nimport StepRoomHotelDetails from '@/components/steps/room/StepRoomHotelDetails';\nimport { useTranslation } from 'react-i18next';\nimport AdditionalOffers from '@/components/steps/confirmation/additionalOffers/AdditionalOffers';\nimport StepConfirmationLimitedOffer from '@/components/steps/confirmation/StepConfirmationLimitedOffer';\nimport dayjs from 'dayjs';\nimport StepRoomBestRateAlert from '@/components/steps/room/StepRoomBestRateAlert';\nimport InlineAddonStepFeature from '@/providers/feature/InlineAddonStepFeature';\nimport { useEvent } from '@/hooks/EventHook';\nimport { StepCheckoutViewEvent } from '@frontend/events';\nimport { BasketContext, BookingEngineContext, ConfirmationFormContextWrapper, FullPageEngineContext } from '@frontend/contexts';\nimport StepConfirmationFormProvider from '../../../components/steps/confirmation/StepConfirmationFormProvider';\nimport { StepLayoutContainer, StepLayoutLeftContent, StepLayoutRightContent } from '@/components/generic/Layout/StepLayout';\n\nfunction StepConfirmationComponent() {\n const context = useContext(BookingEngineContext);\n const { currentStep } = useContext(FullPageEngineContext);\n const { currentBasketRows } = useContext(BasketContext);\n\n const { t } = useTranslation();\n\n const { raise } = useEvent();\n\n useEffect(() => {\n const event = new StepCheckoutViewEvent(currentBasketRows);\n raise(event);\n }, []);\n\n return (\n <div className=\"container\">\n <BEMobileSummary />\n <StepLayoutContainer>\n <StepLayoutLeftContent>\n {context.screenSize > ScreenSize.Medium && (\n <>\n <Link to={StepManager.getPreviousStepUrl(currentStep)}>\n <BackButton />\n </Link>\n <div className=\"u-marg-top--light u-marg-bottom--heavy\">\n <Headline bold>{t(Translation.Navigation.Steps.Confirmation)}</Headline>\n </div>\n </>\n )}\n\n <div className=\"u-marg-top@m-\">\n <StepRoomBestRateAlert />\n </div>\n </StepLayoutLeftContent>\n {context.screenSize > ScreenSize.Medium && (\n <StepLayoutRightContent>\n <StepRoomHotelDetails />\n </StepLayoutRightContent>\n )}\n </StepLayoutContainer>\n <LineBreak />\n <StepLayoutContainer>\n <StepLayoutLeftContent>\n <div className=\"block-container\">\n {!InlineAddonStepFeature.isActive() && <AdditionalOffers />}\n <ConfirmationFormContextWrapper>\n <StepConfirmationFormProvider />\n </ConfirmationFormContextWrapper>\n </div>\n </StepLayoutLeftContent>\n\n {context.screenSize > ScreenSize.Medium && (\n <StepLayoutRightContent>\n <StepConfirmationLimitedOffer endDate={dayjs().add(10, 'minute')} />\n <BESummary showImages />\n </StepLayoutRightContent>\n )}\n </StepLayoutContainer>\n </div>\n );\n}\n\nexport default StepConfirmationComponent;\n"]}
|
|
@@ -7,3 +7,4 @@ 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
9
|
export declare const FixedCompany: ({ properties, ...props }: BookingWizardProps) => JSX.Element;
|
|
10
|
+
export declare const ThemeMini: ComponentStory<React.FC<BookingWizardProps>>;
|
|
@@ -14,7 +14,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
14
14
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
exports.FixedCompany = exports.Button = exports.Vertical = exports.Horizontal = void 0;
|
|
17
|
+
exports.ThemeMini = exports.FixedCompany = exports.Button = exports.Vertical = exports.Horizontal = void 0;
|
|
18
18
|
const BookingWizard_1 = __importDefault(require("../components/generic/BookingWizard/BookingWizard"));
|
|
19
19
|
const react_1 = __importDefault(require("react"));
|
|
20
20
|
const RSCompany_1 = require("../../tests/offline/entry/RSCompany");
|
|
@@ -38,24 +38,6 @@ exports.Horizontal.args = {
|
|
|
38
38
|
layout: 'horizontal',
|
|
39
39
|
properties: globalProperties,
|
|
40
40
|
};
|
|
41
|
-
// Horizontal.play = async ({ canvasElement }) => {
|
|
42
|
-
// const canvas = within(canvasElement);
|
|
43
|
-
// const hotelInput = await canvas.getByPlaceholderText('Choose hotel');
|
|
44
|
-
// const hotelSelectButton = hotelInput.parentElement.querySelector('i');
|
|
45
|
-
// await userEvent.click(hotelSelectButton);
|
|
46
|
-
// const option1 = await canvas.findByText('Hotel Lorem Ipsum 1');
|
|
47
|
-
// await userEvent.click(option1.parentElement);
|
|
48
|
-
// const guestInput = await canvas.getByPlaceholderText('Guests');
|
|
49
|
-
// await userEvent.click(guestInput);
|
|
50
|
-
// const addButtons = await canvas.findAllByRole('button', { name: /^\+$/i, hidden: true });
|
|
51
|
-
// await userEvent.click(addButtons[0]);
|
|
52
|
-
// await userEvent.click(addButtons[0]);
|
|
53
|
-
// await userEvent.click(addButtons[1]);
|
|
54
|
-
// const applyButton = await canvas.findByRole('button', { name: /Apply/i });
|
|
55
|
-
// await userEvent.click(applyButton);
|
|
56
|
-
// const bookButton = await canvas.findByRole('button', { name: /Book Now/i });
|
|
57
|
-
// await userEvent.click(bookButton);
|
|
58
|
-
// };
|
|
59
41
|
exports.Vertical = Template.bind({});
|
|
60
42
|
exports.Vertical.args = {
|
|
61
43
|
layout: 'vertical',
|
|
@@ -71,4 +53,15 @@ const FixedCompany = (_a) => {
|
|
|
71
53
|
return react_1.default.createElement(BookingWizard_1.default, Object.assign({ properties: globalProperties }, props));
|
|
72
54
|
};
|
|
73
55
|
exports.FixedCompany = FixedCompany;
|
|
56
|
+
exports.ThemeMini = Template.bind({});
|
|
57
|
+
exports.ThemeMini.args = {
|
|
58
|
+
layout: 'horizontal-condensed',
|
|
59
|
+
// theme: EBookingWizardTheme.Specific,
|
|
60
|
+
properties: globalProperties,
|
|
61
|
+
};
|
|
62
|
+
exports.ThemeMini.parameters = {
|
|
63
|
+
backgrounds: {
|
|
64
|
+
default: 'dark',
|
|
65
|
+
},
|
|
66
|
+
};
|
|
74
67
|
//# sourceMappingURL=BookingWizard.stories.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BookingWizard.stories.js","sourceRoot":"/","sources":["src/stories/BookingWizard.stories.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AACA,
|
|
1
|
+
{"version":3,"file":"BookingWizard.stories.js","sourceRoot":"/","sources":["src/stories/BookingWizard.stories.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AACA,qGAA0H;AAC1H,kDAA0B;AAC1B,mEAAgE;AAGhE,kBAAe;IACX,KAAK,EAAE,uBAAuB;IAC9B,SAAS,EAAE,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,GAAG,CAAC,EAA4C,EAAE,EAAE;QAAhD,EAAE,UAAU,OAAgC,EAA3B,KAAK,cAAtB,cAAwB,CAAF;IAC/C,OAAO,8BAAC,uBAAa,kBAAC,UAAU,EAAE,gBAAgB,IAAM,KAAK,EAAI,CAAC;AACtE,CAAC,CAAC;AAFW,QAAA,YAAY,gBAEvB;AAEW,QAAA,SAAS,GAAG,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AAC3C,iBAAS,CAAC,IAAI,GAAG;IACb,MAAM,EAAE,sBAAsB;IAC9B,uCAAuC;IACvC,UAAU,EAAE,gBAAgB;CAC/B,CAAC;AACF,iBAAS,CAAC,UAAU,GAAG;IACnB,WAAW,EAAE;QACT,OAAO,EAAE,MAAM;KAClB;CACJ,CAAC","sourcesContent":["import { ComponentMeta, ComponentStory } from '@storybook/react';\nimport BookingWizard, { BookingWizardProps, EBookingWizardTheme } from '@/components/generic/BookingWizard/BookingWizard';\nimport React from 'react';\nimport { rsCompany } from '../../tests/offline/entry/RSCompany';\nimport { TBookingWizardProperties } from '@/models/BookingWizard/BookingWizardTypes';\n\nexport default {\n title: 'generic/BookingWizard',\n component: BookingWizard,\n argTypes: {},\n} as ComponentMeta<typeof BookingWizard>;\n\nconst globalProperties = rsCompany.hotels.reduce<TBookingWizardProperties>((map, hotel) => {\n map[hotel.address?.city as string] = map[hotel.address?.city as string] || [];\n\n map[hotel.address?.city as string]?.push({ id: hotel.hotelID as string, name: hotel.name });\n\n return map;\n}, {});\n\nconst Template: ComponentStory<typeof BookingWizard> = ({ properties, ...args }) => <BookingWizard properties={properties} {...args} />;\n\nexport const Horizontal = Template.bind({});\nHorizontal.args = {\n layout: 'horizontal',\n properties: globalProperties,\n};\n\nexport const Vertical = Template.bind({});\nVertical.args = {\n layout: 'vertical',\n properties: globalProperties,\n};\n\nexport const Button = Template.bind({});\nButton.args = {\n layout: 'button',\n properties: globalProperties,\n};\n\nexport const FixedCompany = ({ properties, ...props }: BookingWizardProps) => {\n return <BookingWizard properties={globalProperties} {...props} />;\n};\n\nexport const ThemeMini = Template.bind({});\nThemeMini.args = {\n layout: 'horizontal-condensed',\n // theme: EBookingWizardTheme.Specific,\n properties: globalProperties,\n};\nThemeMini.parameters = {\n backgrounds: {\n default: 'dark',\n },\n};\n"]}
|
|
@@ -16,6 +16,7 @@ declare const _default: ComponentMeta<(<TOption extends import("../components/ge
|
|
|
16
16
|
renderLabel?: ((option?: TOption | null | undefined) => React.ReactElement<any, string | React.JSXElementConstructor<any>> | null) | undefined;
|
|
17
17
|
nativeOnMobile?: boolean | undefined;
|
|
18
18
|
overlay?: Partial<Omit<import("../components/generic/Overlay/Overlay").OverlayProps, "children" | "open" | "onClose" | "container" | "followElement" | "overlayRef">> | undefined;
|
|
19
|
+
hideExpandIcon?: boolean | undefined;
|
|
19
20
|
} & {
|
|
20
21
|
ref?: React.Ref<HTMLDivElement> | undefined;
|
|
21
22
|
}) => JSX.Element)>;
|