@lookiero/checkout 8.14.0-beta.3 → 8.14.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/.eslintrc.js +1 -1
- package/cypress/integration/checkout.spec.ts +259 -0
- package/cypress/support/e2e.ts +3 -0
- package/cypress/support/index.d.ts +8 -0
- package/cypress/support/interceptBlockCheckoutBooking.ts +4 -0
- package/cypress/support/interceptGiveCheckoutFeedback.ts +4 -0
- package/cypress/support/interceptKeepCheckoutItem.ts +4 -0
- package/cypress/support/interceptListCheckoutQuestionsByCheckoutId.ts +9 -0
- package/cypress/support/interceptListReturnQuestionsByCheckoutItemId.ts +9 -0
- package/cypress/support/interceptPayment.ts +23 -0
- package/cypress/support/interceptReplaceCheckoutItem.ts +4 -0
- package/cypress/support/interceptReturnCheckoutItem.ts +4 -0
- package/cypress/support/interceptSubmitCheckout.ts +4 -0
- package/cypress/support/interceptViewBookedProductsVariantsForCheckoutItem.ts +9 -0
- package/cypress/support/interceptViewCheckoutById.ts +6 -0
- package/cypress/support/interceptViewFirstAvailableCheckoutByCustomerId.ts +9 -0
- package/cypress/support/interceptViewFiveItemsDiscountByCustomerId.ts +6 -0
- package/cypress/support/interceptViewIsSizeChangeEnabledByCheckoutId.ts +6 -0
- package/cypress/support/interceptViewPaymentFlowPayloadByCheckoutId.ts +9 -0
- package/cypress/support/interceptViewPricingByCheckoutId.ts +6 -0
- package/cypress/tsconfig.json +8 -0
- package/cypress.config.ts +50 -0
- package/dist/src/ExpoRoot.js +2 -2
- package/dist/src/infrastructure/projection/payment/react/useViewPaymentFlowPayloadByCheckoutId.js +1 -1
- package/dist/src/infrastructure/ui/Root.d.ts +1 -2
- package/dist/src/infrastructure/ui/Root.js +2 -4
- package/dist/src/infrastructure/ui/components/organisms/returnQuestions/ReturnQuestion.js +3 -1
- package/dist/src/infrastructure/ui/components/organisms/returnQuestions/behaviors/isChildReturnQuestion.js +2 -1
- package/dist/src/infrastructure/ui/components/organisms/returnQuestions/behaviors/useReturnQuestionItem.d.ts +3 -3
- package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/ReturnQuestionItem.d.ts +4 -3
- package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/hostDefaultReturnQuestionFeedbackItem/HostDefaultReturnQuestionFeedbackItem.d.ts +2 -1
- package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/hostDefaultReturnQuestionFeedbackItem/HostDefaultReturnQuestionFeedbackItem.js +1 -0
- package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/hostDefaultReturnQuestionItem/HostDefaultReturnQuestionItem.d.ts +2 -1
- package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/hostDefaultReturnQuestionItem/HostDefaultReturnQuestionItem.js +8 -6
- package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/hostRadioGroupReturnQuestionItem/HostRadioGroupReturnQuestionItem.d.ts +2 -1
- package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/hostRadioGroupReturnQuestionItem/HostRadioGroupReturnQuestionItem.js +2 -1
- package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/hostSelectReturnQuestionItem/HostSelectReturnQuestionItem.d.ts +2 -1
- package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/hostSelectReturnQuestionItem/HostSelectReturnQuestionItem.js +4 -4
- package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/hostSelectReturnQuestionItem/HostSelectReturnQuestionItem.style.d.ts +1 -1
- package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/hostSelectReturnQuestionItem/HostSelectReturnQuestionItem.style.js +1 -1
- package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/hostStackReturnQuestionItem/form/HostStackReturnQuestionItem.d.ts +2 -1
- package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/hostStackReturnQuestionItem/form/HostStackReturnQuestionItem.js +1 -0
- package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/hostStackReturnQuestionItem/modal/HostStackReturnQuestionItem.d.ts +2 -1
- package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/hostStackReturnQuestionItem/modal/HostStackReturnQuestionItem.js +5 -3
- package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/modalOptionReturnQuestionItems/ModalOptionReturnQuestionItems.js +6 -5
- package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/optionReturnQuestionItem/OptionReturnQuestionItem.d.ts +2 -1
- package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/optionReturnQuestionItem/OptionReturnQuestionItem.js +2 -1
- package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/radioReturnQuestionItem/RadioReturnQuestionItem.d.ts +2 -1
- package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/radioReturnQuestionItem/RadioReturnQuestionItem.js +2 -1
- package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/returnQuestionFeedbackItem/ReturnQuestionFeedbackItem.d.ts +2 -1
- package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/returnQuestionFeedbackItem/ReturnQuestionFeedbackItem.js +2 -1
- package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/textareaReturnQuestionItem/TextareaReturnQuestionItem.d.ts +2 -1
- package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/textareaReturnQuestionItem/TextareaReturnQuestionItem.js +2 -1
- package/dist/src/infrastructure/ui/components/organisms/returnQuestions/util/returnQuestionFeedback.js +18 -9
- package/dist/src/infrastructure/ui/test/render.js +1 -3
- package/dist/src/infrastructure/ui/views/App.js +7 -12
- package/dist/src/infrastructure/ui/views/item/components/getOutOfCheckoutModal/GetOutOfCheckoutModal.js +2 -3
- package/dist/src/infrastructure/ui/views/item/components/getOutOfCheckoutModal/GetOutOfCheckoutModal.style.d.ts +1 -1
- package/dist/src/infrastructure/ui/views/item/components/getOutOfCheckoutModal/GetOutOfCheckoutModal.style.js +1 -1
- package/dist/src/infrastructure/ui/views/item/components/returnQuestionsFeedback/ReturnQuestionsFeedback.js +1 -1
- package/dist/src/infrastructure/ui/views/item/components/selectModal/SelectModal.d.ts +9 -2
- package/dist/src/infrastructure/ui/views/item/components/selectModal/SelectModal.js +5 -6
- package/dist/src/infrastructure/ui/views/item/components/selectModal/SelectModal.style.d.ts +1 -1
- package/dist/src/infrastructure/ui/views/item/components/selectModal/SelectModal.style.js +1 -1
- package/dist/src/infrastructure/ui/views/item/components/sizeWithoutStockModal/SizeWithoutStockModal.js +2 -3
- package/dist/src/infrastructure/ui/views/return/components/returnQuestionsForm/ReturnQuestionsForm.js +4 -3
- package/dist/src/infrastructure/ui/views/summary/components/collapsiblePricing/CollapsiblePricing.js +2 -2
- package/dist/src/projection/returnQuestion/returnQuestion.constants.d.ts +9 -0
- package/dist/src/projection/returnQuestion/returnQuestion.constants.js +10 -0
- package/dist/src/projection/returnQuestion/returnQuestion.d.ts +23 -16
- package/dist/src/projection/returnQuestion/returnQuestion.js +1 -11
- package/dist/src/projection/returnQuestion/returnQuestion.metadata.d.ts +12 -0
- package/dist/src/projection/returnQuestion/returnQuestion.metadata.js +1 -0
- package/dist/src/projection/returnQuestion/returnQuestion.typeguard.d.ts +5 -0
- package/dist/src/projection/returnQuestion/returnQuestion.typeguard.js +10 -0
- package/dist/src/version.d.ts +1 -1
- package/dist/src/version.js +1 -1
- package/jest.setup.js +0 -20
- package/package.json +8 -7
- package/src/ExpoRoot.tsx +2 -2
- package/src/infrastructure/domain/uiSetting/react/useUpdateUiSetting.test.ts +1 -1
- package/src/infrastructure/projection/payment/react/useViewPaymentFlowPayloadByCheckoutId.ts +1 -1
- package/src/infrastructure/projection/returnQuestion/react/useListReturnQuestionsByCheckoutItemId.test.ts +4 -9
- package/src/infrastructure/projection/returnQuestion/returnQuestions.mock.ts +72 -117
- package/src/infrastructure/ui/Root.tsx +17 -21
- package/src/infrastructure/ui/components/organisms/returnQuestions/ReturnQuestion.test.tsx +10 -12
- package/src/infrastructure/ui/components/organisms/returnQuestions/ReturnQuestion.tsx +10 -8
- package/src/infrastructure/ui/components/organisms/returnQuestions/ReturnQuestions.test.tsx +10 -9
- package/src/infrastructure/ui/components/organisms/returnQuestions/behaviors/isChildReturnQuestion.ts +2 -1
- package/src/infrastructure/ui/components/organisms/returnQuestions/behaviors/useReturnQuestionItem.test.tsx +7 -9
- package/src/infrastructure/ui/components/organisms/returnQuestions/behaviors/useReturnQuestionItem.tsx +3 -3
- package/src/infrastructure/ui/components/organisms/returnQuestions/components/ReturnQuestionItem.ts +4 -3
- package/src/infrastructure/ui/components/organisms/returnQuestions/components/hostDefaultReturnQuestionFeedbackItem/HostDefaultReturnQuestionFeedbackItem.test.tsx +7 -13
- package/src/infrastructure/ui/components/organisms/returnQuestions/components/hostDefaultReturnQuestionFeedbackItem/HostDefaultReturnQuestionFeedbackItem.tsx +4 -2
- package/src/infrastructure/ui/components/organisms/returnQuestions/components/hostDefaultReturnQuestionItem/HostDefaultReturnQuestionItem.test.tsx +8 -14
- package/src/infrastructure/ui/components/organisms/returnQuestions/components/hostDefaultReturnQuestionItem/HostDefaultReturnQuestionItem.tsx +13 -7
- package/src/infrastructure/ui/components/organisms/returnQuestions/components/hostRadioGroupReturnQuestionItem/HostRadioGroupReturnQuestionItem.tsx +7 -5
- package/src/infrastructure/ui/components/organisms/returnQuestions/components/hostSelectReturnQuestionItem/HostSelectReturnQuestionItem.style.ts +1 -1
- package/src/infrastructure/ui/components/organisms/returnQuestions/components/hostSelectReturnQuestionItem/HostSelectReturnQuestionItem.test.tsx +10 -14
- package/src/infrastructure/ui/components/organisms/returnQuestions/components/hostSelectReturnQuestionItem/HostSelectReturnQuestionItem.tsx +9 -8
- package/src/infrastructure/ui/components/organisms/returnQuestions/components/hostStackReturnQuestionItem/form/HostStackReturnQuestionItem.tsx +5 -3
- package/src/infrastructure/ui/components/organisms/returnQuestions/components/hostStackReturnQuestionItem/modal/HostStackReturnQuestionItem.test.tsx +43 -36
- package/src/infrastructure/ui/components/organisms/returnQuestions/components/hostStackReturnQuestionItem/modal/HostStackReturnQuestionItem.tsx +10 -7
- package/src/infrastructure/ui/components/organisms/returnQuestions/components/modalOptionReturnQuestionItems/ModalOptionReturnQuestionItems.tsx +13 -12
- package/src/infrastructure/ui/components/organisms/returnQuestions/components/optionReturnQuestionItem/OptionReturnQuestionItem.test.tsx +8 -14
- package/src/infrastructure/ui/components/organisms/returnQuestions/components/optionReturnQuestionItem/OptionReturnQuestionItem.tsx +6 -4
- package/src/infrastructure/ui/components/organisms/returnQuestions/components/radioReturnQuestionItem/RadioReturnQuestionItem.tsx +6 -4
- package/src/infrastructure/ui/components/organisms/returnQuestions/components/returnQuestionFeedbackItem/ReturnQuestionFeedbackItem.test.tsx +23 -25
- package/src/infrastructure/ui/components/organisms/returnQuestions/components/returnQuestionFeedbackItem/ReturnQuestionFeedbackItem.tsx +5 -3
- package/src/infrastructure/ui/components/organisms/returnQuestions/components/textareaReturnQuestionItem/TextareaReturnQuestionItem.test.tsx +9 -29
- package/src/infrastructure/ui/components/organisms/returnQuestions/components/textareaReturnQuestionItem/TextareaReturnQuestionItem.tsx +7 -5
- package/src/infrastructure/ui/components/organisms/returnQuestions/util/__snapshots__/returnQuestionFeedback.test.ts.snap +5 -4
- package/src/infrastructure/ui/components/organisms/returnQuestions/util/returnQuestionFeedback.ts +32 -18
- package/src/infrastructure/ui/test/render.tsx +1 -4
- package/src/infrastructure/ui/views/App.tsx +16 -23
- package/src/infrastructure/ui/views/item/components/getOutOfCheckoutModal/GetOutOfCheckoutModal.style.ts +1 -1
- package/src/infrastructure/ui/views/item/components/getOutOfCheckoutModal/GetOutOfCheckoutModal.tsx +2 -3
- package/src/infrastructure/ui/views/item/components/getOutOfCheckoutModal/__snapshots__/GetOutOfCheckoutModal.test.tsx.snap +10 -6
- package/src/infrastructure/ui/views/item/components/itemActions/ItemActions.tsx +0 -1
- package/src/infrastructure/ui/views/item/components/returnQuestionsFeedback/ReturnQuestionsFeedback.tsx +2 -4
- package/src/infrastructure/ui/views/item/components/selectModal/SelectModal.style.ts +1 -1
- package/src/infrastructure/ui/views/item/components/selectModal/SelectModal.tsx +21 -10
- package/src/infrastructure/ui/views/item/components/selectModal/__snapshots__/SelecModal.test.tsx.snap +15 -5
- package/src/infrastructure/ui/views/item/components/sizeWithoutStockModal/SizeWithoutStockModal.tsx +2 -4
- package/src/infrastructure/ui/views/item/components/sizeWithoutStockModal/__snapshots__/SizeWithoutStockModal.test.tsx.snap +10 -6
- package/src/infrastructure/ui/views/item/views/itemWithoutCustomerDecission/ItemWithoutCustomerDecission.tsx +2 -2
- package/src/infrastructure/ui/views/return/components/returnQuestionsForm/ReturnQuestionsForm.tsx +10 -4
- package/src/infrastructure/ui/views/summary/components/collapsiblePricing/CollapsiblePricing.tsx +2 -2
- package/src/infrastructure/ui/views/summary/components/collapsiblePricing/__snapshots__/CollapsiblePricing.test.tsx.snap +2 -2
- package/src/projection/returnQuestion/listReturnQuestionsByCheckoutItemId.test.ts +4 -12
- package/src/projection/returnQuestion/returnQuestion.constants.ts +10 -0
- package/src/projection/returnQuestion/returnQuestion.metadata.ts +17 -0
- package/src/projection/returnQuestion/returnQuestion.ts +42 -20
- package/src/projection/returnQuestion/returnQuestion.typeguard.ts +24 -0
- package/dist/pact.config.d.ts +0 -13
- package/dist/pact.config.js +0 -9
- package/dist/public/public/assets/adaptive-icon.png +0 -0
- package/dist/public/public/assets/favicon.png +0 -0
- package/dist/public/public/assets/icon.png +0 -0
- package/dist/public/public/assets/splash.png +0 -0
- package/dist/public/public/images/not-found.png +0 -0
- package/dist/src/infrastructure/projection/bookedProductsVariants/bookedProductsVariants.mock.d.ts +0 -3
- package/dist/src/infrastructure/projection/bookedProductsVariants/bookedProductsVariants.mock.js +0 -27
- package/dist/src/infrastructure/projection/bookedProductsVariants/httpBookedProductsVariantsForCheckoutItemView.pact.d.ts +0 -1
- package/dist/src/infrastructure/projection/bookedProductsVariants/httpBookedProductsVariantsForCheckoutItemView.pact.js +0 -48
- package/dist/src/infrastructure/projection/checkout/checkout.mock.d.ts +0 -19
- package/dist/src/infrastructure/projection/checkout/checkout.mock.js +0 -21
- package/dist/src/infrastructure/projection/checkout/httpCheckoutByIdView.pact.d.ts +0 -1
- package/dist/src/infrastructure/projection/checkout/httpCheckoutByIdView.pact.js +0 -109
- package/dist/src/infrastructure/projection/checkout/httpFirstAvailableCheckoutByCustomerIdView.pact.d.ts +0 -1
- package/dist/src/infrastructure/projection/checkout/httpFirstAvailableCheckoutByCustomerIdView.pact.js +0 -49
- package/dist/src/infrastructure/projection/checkout/httpFiveItemsDiscountByCustomerIdView.pact.d.ts +0 -1
- package/dist/src/infrastructure/projection/checkout/httpFiveItemsDiscountByCustomerIdView.pact.js +0 -44
- package/dist/src/infrastructure/projection/checkout/httpIsCheckoutEnabledByCustomerIdView.pact.d.ts +0 -1
- package/dist/src/infrastructure/projection/checkout/httpIsCheckoutEnabledByCustomerIdView.pact.js +0 -44
- package/dist/src/infrastructure/projection/checkout/httpIsSizeChangeEnabledByCheckoutIdView.pact.d.ts +0 -1
- package/dist/src/infrastructure/projection/checkout/httpIsSizeChangeEnabledByCheckoutIdView.pact.js +0 -44
- package/dist/src/infrastructure/projection/checkout/react/useViewIsCheckoutAccessibleByCustomerId.d.ts +0 -10
- package/dist/src/infrastructure/projection/checkout/react/useViewIsCheckoutAccessibleByCustomerId.js +0 -17
- package/dist/src/infrastructure/projection/checkoutBooking/checkoutBooking.mock.d.ts +0 -3
- package/dist/src/infrastructure/projection/checkoutBooking/checkoutBooking.mock.js +0 -6
- package/dist/src/infrastructure/projection/checkoutBooking/httpCheckoutBookingByIdView.pact.d.ts +0 -1
- package/dist/src/infrastructure/projection/checkoutBooking/httpCheckoutBookingByIdView.pact.js +0 -49
- package/dist/src/infrastructure/projection/checkoutItem/checkoutItem.mock.d.ts +0 -15
- package/dist/src/infrastructure/projection/checkoutItem/checkoutItem.mock.js +0 -43
- package/dist/src/infrastructure/projection/checkoutItem/httpCheckoutItemByIdView.pact.d.ts +0 -1
- package/dist/src/infrastructure/projection/checkoutItem/httpCheckoutItemByIdView.pact.js +0 -50
- package/dist/src/infrastructure/projection/checkoutQuestion/checkoutQuestions.mock.d.ts +0 -3
- package/dist/src/infrastructure/projection/checkoutQuestion/checkoutQuestions.mock.js +0 -103
- package/dist/src/infrastructure/projection/checkoutQuestion/httpCheckoutQuestionsByCheckoutIdView.pact.d.ts +0 -1
- package/dist/src/infrastructure/projection/checkoutQuestion/httpCheckoutQuestionsByCheckoutIdView.pact.js +0 -48
- package/dist/src/infrastructure/projection/payment/httpPaymentFlowPayloadByCheckoutIdView.pact.d.ts +0 -1
- package/dist/src/infrastructure/projection/payment/httpPaymentFlowPayloadByCheckoutIdView.pact.js +0 -109
- package/dist/src/infrastructure/projection/payment/paymentFlowPayload.mock.d.ts +0 -6
- package/dist/src/infrastructure/projection/payment/paymentFlowPayload.mock.js +0 -183
- package/dist/src/infrastructure/projection/pricing/httpPricingByCheckoutIdView.pact.d.ts +0 -1
- package/dist/src/infrastructure/projection/pricing/httpPricingByCheckoutIdView.pact.js +0 -48
- package/dist/src/infrastructure/projection/pricing/pricing.mock.d.ts +0 -9
- package/dist/src/infrastructure/projection/pricing/pricing.mock.js +0 -42
- package/dist/src/infrastructure/projection/returnQuestion/httpReturnQuestionsByCheckoutItemIdView.pact.d.ts +0 -1
- package/dist/src/infrastructure/projection/returnQuestion/httpReturnQuestionsByCheckoutItemIdView.pact.js +0 -48
- package/dist/src/infrastructure/projection/returnQuestion/returnQuestions.mock.d.ts +0 -3
- package/dist/src/infrastructure/projection/returnQuestion/returnQuestions.mock.js +0 -400
- package/dist/src/infrastructure/ui/components/layouts/layout/Layout.d.ts +0 -21
- package/dist/src/infrastructure/ui/components/layouts/layout/Layout.js +0 -1
- package/dist/src/infrastructure/ui/components/layouts/layout/components/footer/Footer.d.ts +0 -6
- package/dist/src/infrastructure/ui/components/layouts/layout/components/footer/Footer.js +0 -4
- package/dist/src/infrastructure/ui/components/layouts/layout/components/header/Header.d.ts +0 -6
- package/dist/src/infrastructure/ui/components/layouts/layout/components/header/Header.js +0 -5
- package/dist/src/infrastructure/ui/components/layouts/layout/components/header/Header.style.d.ts +0 -4
- package/dist/src/infrastructure/ui/components/layouts/layout/components/header/Header.style.js +0 -19
- package/dist/src/infrastructure/ui/components/layouts/layout/dummyLayout/DummyLayout.d.ts +0 -3
- package/dist/src/infrastructure/ui/components/layouts/layout/dummyLayout/DummyLayout.js +0 -18
- package/dist/src/infrastructure/ui/components/layouts/layout/dummyLayout/DummyLayout.style.d.ts +0 -12
- package/dist/src/infrastructure/ui/components/layouts/layout/dummyLayout/DummyLayout.style.js +0 -13
- package/dist/src/infrastructure/ui/components/templates/header/defaultHeader/DefaultHeader.d.ts +0 -6
- package/dist/src/infrastructure/ui/components/templates/header/defaultHeader/DefaultHeader.js +0 -11
- package/dist/src/infrastructure/ui/components/templates/header/defaultHeader/DefaultHeader.style.d.ts +0 -8
- package/dist/src/infrastructure/ui/components/templates/header/defaultHeader/DefaultHeader.style.js +0 -11
- package/dist/src/infrastructure/ui/hooks/useNewFeedbackExperiment.d.ts +0 -11
- package/dist/src/infrastructure/ui/hooks/useNewFeedbackExperiment.js +0 -49
- package/dist/src/infrastructure/ui/i18n/fetchTranslations.d.ts +0 -9
- package/dist/src/infrastructure/ui/i18n/fetchTranslations.js +0 -9
- package/dist/src/infrastructure/ui/i18n/translationEndpoint.d.ts +0 -19
- package/dist/src/infrastructure/ui/i18n/translationEndpoint.js +0 -21
- package/dist/src/infrastructure/ui/routing/CheckoutAccessibilityMiddleware.d.ts +0 -9
- package/dist/src/infrastructure/ui/routing/CheckoutAccessibilityMiddleware.js +0 -21
- package/dist/src/infrastructure/ui/views/App.style.d.ts +0 -6
- package/dist/src/infrastructure/ui/views/App.style.js +0 -7
- package/dist/src/infrastructure/ui/views/feedback/components/checkoutQuestionsForm/CheckoutQuestionsForm.style.d.ts +0 -7
- package/dist/src/infrastructure/ui/views/feedback/components/checkoutQuestionsForm/CheckoutQuestionsForm.style.js +0 -10
- package/dist/src/infrastructure/ui/views/item/components/returnQuestionsForm/ReturnQuestionsForm.d.ts +0 -11
- package/dist/src/infrastructure/ui/views/item/components/returnQuestionsForm/ReturnQuestionsForm.js +0 -40
- package/dist/src/infrastructure/ui/views/item/components/returnQuestionsForm/ReturnQuestionsForm.style.d.ts +0 -12
- package/dist/src/infrastructure/ui/views/item/components/returnQuestionsForm/ReturnQuestionsForm.style.js +0 -15
- package/dist/src/infrastructure/ui/views/return/Return.style.d.ts +0 -40
- package/dist/src/infrastructure/ui/views/return/Return.style.js +0 -43
- package/dist/src/infrastructure/ui/views/summary/components/stickyPricing/StickyPricing.d.ts +0 -13
- package/dist/src/infrastructure/ui/views/summary/components/stickyPricing/StickyPricing.js +0 -9
- package/dist/src/infrastructure/ui/views/summary/components/stickyPricing/StickyPricing.style.d.ts +0 -7
- package/dist/src/infrastructure/ui/views/summary/components/stickyPricing/StickyPricing.style.js +0 -10
- package/dist/src/projection/checkout/viewIsCheckoutAccessibleByCustomerId.d.ts +0 -17
- package/dist/src/projection/checkout/viewIsCheckoutAccessibleByCustomerId.js +0 -13
- package/dist/src/projection/shared/country.d.ts +0 -14
- package/dist/src/projection/shared/country.js +0 -15
- package/dist/src/projection/shared/customer.d.ts +0 -8
- package/dist/src/projection/shared/customer.js +0 -1
- package/dist/src/projection/shared/locale.d.ts +0 -12
- package/dist/src/projection/shared/locale.js +0 -13
- package/dist/src/projection/shared/order.d.ts +0 -6
- package/dist/src/projection/shared/order.js +0 -1
- package/dist/src/projection/shared/price.d.ts +0 -10
- package/dist/src/projection/shared/price.js +0 -1
- package/dist/src/projection/shared/size.d.ts +0 -20
- package/dist/src/projection/shared/size.js +0 -3
- package/dist/src/projection/shared/subscription.d.ts +0 -2
- package/dist/src/projection/shared/subscription.js +0 -1
- package/dist/src/shared/ui/components/atoms/error/Error.d.ts +0 -10
- package/dist/src/shared/ui/components/atoms/error/Error.js +0 -4
- package/pact.config.ts +0 -31
- package/pact.publish.js +0 -32
- package/src/infrastructure/projection/bookedProductsVariants/httpBookedProductsVariantsForCheckoutItemView.pact.ts +0 -62
- package/src/infrastructure/projection/checkout/httpCheckoutByIdView.pact.ts +0 -128
- package/src/infrastructure/projection/checkout/httpFirstAvailableCheckoutByCustomerIdView.pact.ts +0 -63
- package/src/infrastructure/projection/checkout/httpFiveItemsDiscountByCustomerIdView.pact.ts +0 -57
- package/src/infrastructure/projection/checkout/httpIsCheckoutEnabledByCustomerIdView.pact.ts +0 -57
- package/src/infrastructure/projection/checkout/httpIsSizeChangeEnabledByCheckoutIdView.pact.ts +0 -57
- package/src/infrastructure/projection/checkoutBooking/httpCheckoutBookingByIdView.pact.ts +0 -63
- package/src/infrastructure/projection/checkoutItem/httpCheckoutItemByIdView.pact.ts +0 -64
- package/src/infrastructure/projection/checkoutQuestion/httpCheckoutQuestionsByCheckoutIdView.pact.ts +0 -62
- package/src/infrastructure/projection/payment/httpPaymentFlowPayloadByCheckoutIdView.pact.ts +0 -136
- package/src/infrastructure/projection/pricing/httpPricingByCheckoutIdView.pact.ts +0 -62
- package/src/infrastructure/projection/returnQuestion/httpReturnQuestionsByCheckoutItemIdView.pact.ts +0 -62
- package/src/infrastructure/ui/views/App.style.ts +0 -9
|
@@ -1,14 +1,16 @@
|
|
|
1
|
+
/* eslint-disable react/prop-types */
|
|
1
2
|
import React from "react";
|
|
2
3
|
import { Text, View } from "@lookiero/aurora";
|
|
3
|
-
import {
|
|
4
|
+
import { useIntl } from "@lookiero/i18n-react";
|
|
5
|
+
import { returnQuestionWithTranslationKey } from "../../../../../../../projection/returnQuestion/returnQuestion.typeguard";
|
|
4
6
|
import { I18nMessages } from "../../../../../i18n/i18n";
|
|
5
7
|
import { style } from "./HostDefaultReturnQuestionItem.style";
|
|
6
|
-
const HostDefaultReturnQuestionItem = ({ returnQuestion, children }) => {
|
|
7
|
-
const
|
|
8
|
-
const isAllOptions = returnQuestion.
|
|
8
|
+
const HostDefaultReturnQuestionItem = ({ returnQuestion, children, }) => {
|
|
9
|
+
const { formatMessage } = useIntl();
|
|
10
|
+
const isAllOptions = returnQuestion.translationKey === I18nMessages.RETURN_QUESTION_MAIN_ALL_OPINION;
|
|
9
11
|
return (React.createElement(React.Fragment, null,
|
|
10
|
-
|
|
11
|
-
React.createElement(Text, { level: 3, action: true },
|
|
12
|
+
returnQuestionWithTranslationKey(returnQuestion) && returnQuestion.translationKey !== " " && !isAllOptions ? (React.createElement(View, { style: style.title },
|
|
13
|
+
React.createElement(Text, { level: 3, action: true }, formatMessage({ id: returnQuestion.translationKey })))) : null,
|
|
12
14
|
children));
|
|
13
15
|
};
|
|
14
16
|
export { HostDefaultReturnQuestionItem };
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
+
import { ReturnQuestionType } from "../../../../../../../projection/returnQuestion/returnQuestion.constants";
|
|
1
2
|
import { ReturnQuestionItem } from "../ReturnQuestionItem";
|
|
2
3
|
import { style } from "./HostRadioGroupReturnQuestionItem.style";
|
|
3
|
-
declare const HostRadioGroupReturnQuestionItem: ReturnQuestionItem
|
|
4
|
+
declare const HostRadioGroupReturnQuestionItem: ReturnQuestionItem<ReturnQuestionType.HOST_SELECT>;
|
|
4
5
|
export { HostRadioGroupReturnQuestionItem, style };
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/* eslint-disable react/prop-types */
|
|
1
2
|
import React, { useMemo } from "react";
|
|
2
3
|
import { View } from "react-native";
|
|
3
4
|
import { Text } from "@lookiero/aurora";
|
|
@@ -5,7 +6,7 @@ import { useIntl } from "@lookiero/i18n-react";
|
|
|
5
6
|
import { style } from "./HostRadioGroupReturnQuestionItem.style";
|
|
6
7
|
const HostRadioGroupReturnQuestionItem = ({ returnQuestion, children, testID, }) => {
|
|
7
8
|
const { formatMessage } = useIntl();
|
|
8
|
-
const placeholderText = useMemo(() => (returnQuestion.placeholder ? formatMessage({ id: returnQuestion.placeholder }) : ""), [formatMessage, returnQuestion.placeholder]);
|
|
9
|
+
const placeholderText = useMemo(() => (returnQuestion.metadata.placeholder ? formatMessage({ id: returnQuestion.metadata.placeholder }) : ""), [formatMessage, returnQuestion.metadata.placeholder]);
|
|
9
10
|
return (React.createElement(React.Fragment, null,
|
|
10
11
|
React.createElement(View, { style: style.wrapper, testID: testID },
|
|
11
12
|
React.createElement(Text, { level: 3, style: style.title, action: true }, placeholderText),
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { ReturnQuestionType } from "../../../../../../../projection/returnQuestion/returnQuestion.constants";
|
|
1
2
|
import { ReturnQuestionItem } from "../ReturnQuestionItem";
|
|
2
|
-
declare const HostSelectReturnQuestionItem: ReturnQuestionItem
|
|
3
|
+
declare const HostSelectReturnQuestionItem: ReturnQuestionItem<ReturnQuestionType.HOST_SELECT>;
|
|
3
4
|
export { HostSelectReturnQuestionItem };
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
+
/* eslint-disable react/prop-types */
|
|
1
2
|
import React, { useCallback, useEffect, useMemo, useState } from "react";
|
|
2
3
|
import { TouchableHighlight, View } from "react-native";
|
|
3
4
|
import { ButtonIcon } from "@lookiero/aurora";
|
|
4
5
|
import { useIntl } from "@lookiero/i18n-react";
|
|
5
|
-
import { Modal
|
|
6
|
+
import { Modal } from "@lookiero/sty-psp-ui";
|
|
6
7
|
import { InputField } from "../../../../../../../shared/ui/components/molecules/inputField/InputField";
|
|
7
8
|
import { useReturnQuestionFeedback, useReturnQuestionFeedbackForReturnQuestion, } from "../../behaviors/useReturnQuestionFeedback";
|
|
8
9
|
import { deepestReturnQuestionWithFeedbackForReturnQuestion, feedbackForReturnQuestion, } from "../../util/returnQuestionFeedback";
|
|
9
10
|
import { style, containerUnderlayColor } from "./HostSelectReturnQuestionItem.style";
|
|
10
11
|
const HostSelectReturnQuestionItem = ({ returnQuestion, children, portalHostName, testID, }) => {
|
|
11
|
-
const { modal } = useEnvironmentStyle();
|
|
12
12
|
const { formatMessage } = useIntl();
|
|
13
|
-
const placeholderText = useMemo(() => (returnQuestion.placeholder ? formatMessage({ id: returnQuestion.placeholder }) : ""), [formatMessage, returnQuestion.placeholder]);
|
|
13
|
+
const placeholderText = useMemo(() => (returnQuestion.metadata.placeholder ? formatMessage({ id: returnQuestion.metadata.placeholder }) : ""), [formatMessage, returnQuestion.metadata.placeholder]);
|
|
14
14
|
const [modalVisible, setModalVisible] = useState(false);
|
|
15
15
|
const handleOnPress = useCallback(() => setModalVisible(true), []);
|
|
16
16
|
const handleOnModalClose = useCallback(() => setModalVisible(false), []);
|
|
@@ -36,6 +36,6 @@ const HostSelectReturnQuestionItem = ({ returnQuestion, children, portalHostName
|
|
|
36
36
|
React.createElement(View, { pointerEvents: "none" },
|
|
37
37
|
React.createElement(InputField, { editable: false, icon: "arrow_down", label: placeholderText, value: inputValue }))),
|
|
38
38
|
React.createElement(Modal, { portalHostName: portalHostName, style: deepestReturnQuestionWithFeedback && { header: style.header }, visible: modalVisible, header: deepestReturnQuestionWithFeedback && (React.createElement(ButtonIcon, { name: "arrow_left", style: style.backButton, testID: "modal-back-button", onPress: handleOnBackButtonPress })), scroll: true, showCloseButton: true, onClose: handleOnModalClose },
|
|
39
|
-
React.createElement(View, { style:
|
|
39
|
+
React.createElement(View, { style: style.modalContent }, children))));
|
|
40
40
|
};
|
|
41
41
|
export { HostSelectReturnQuestionItem };
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { ReturnQuestionType } from "../../../../../../../../projection/returnQuestion/returnQuestion.constants";
|
|
1
2
|
import { ReturnQuestionItem } from "../../ReturnQuestionItem";
|
|
2
|
-
declare const HostStackReturnQuestionItem: ReturnQuestionItem
|
|
3
|
+
declare const HostStackReturnQuestionItem: ReturnQuestionItem<ReturnQuestionType.HOST_STACK>;
|
|
3
4
|
export { HostStackReturnQuestionItem };
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/* eslint-disable react/prop-types */
|
|
1
2
|
import React from "react";
|
|
2
3
|
import ReturnQuestion from "../../../ReturnQuestion";
|
|
3
4
|
const HostStackReturnQuestionItem = ({ returnQuestion, portalHostName, }) => (React.createElement(React.Fragment, null, returnQuestion.children?.map((childReturnQuestion) => (React.createElement(ReturnQuestion, { key: childReturnQuestion.id, portalHostName: portalHostName, returnQuestion: childReturnQuestion, returnQuestionParent: returnQuestion })))));
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { ReturnQuestionType } from "../../../../../../../../projection/returnQuestion/returnQuestion.constants";
|
|
1
2
|
import { ReturnQuestionItem } from "../../ReturnQuestionItem";
|
|
2
|
-
declare const HostStackReturnQuestionItem: ReturnQuestionItem
|
|
3
|
+
declare const HostStackReturnQuestionItem: ReturnQuestionItem<ReturnQuestionType.HOST_STACK>;
|
|
3
4
|
export { HostStackReturnQuestionItem };
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
+
/* eslint-disable react/prop-types */
|
|
1
2
|
import { animated, useSpring } from "@react-spring/native";
|
|
2
3
|
import React, { useCallback, useMemo, useState } from "react";
|
|
3
4
|
import { View } from "react-native";
|
|
4
5
|
import { COLOR, Text } from "@lookiero/aurora";
|
|
5
6
|
import { useIntl } from "@lookiero/i18n-react";
|
|
7
|
+
import { returnQuestionHasChildren } from "../../../../../../../../projection/returnQuestion/returnQuestion.typeguard";
|
|
6
8
|
import ReturnQuestion from "../../../ReturnQuestion";
|
|
7
9
|
import { useReturnQuestionFeedbackForReturnQuestion } from "../../../behaviors/useReturnQuestionFeedback";
|
|
8
10
|
import { style } from "./HostStackReturnQuestionItem.style";
|
|
@@ -12,15 +14,15 @@ const HostStackReturnQuestionItem = ({ returnQuestion, children, portalHostName,
|
|
|
12
14
|
const feedbackReturnQuestion = feedback
|
|
13
15
|
? returnQuestion.children?.find((returnQuestion) => returnQuestion.id === feedback)
|
|
14
16
|
: undefined;
|
|
15
|
-
const titleText = useMemo(() => (returnQuestion.
|
|
16
|
-
const feedbackText = useMemo(() => (feedbackReturnQuestion ? formatMessage({ id: feedbackReturnQuestion.
|
|
17
|
+
const titleText = useMemo(() => (returnQuestion.translationKey ? formatMessage({ id: returnQuestion.translationKey }) : undefined), [formatMessage, returnQuestion.translationKey]);
|
|
18
|
+
const feedbackText = useMemo(() => (feedbackReturnQuestion ? formatMessage({ id: feedbackReturnQuestion.translationKey }) : undefined), [feedbackReturnQuestion, formatMessage]);
|
|
17
19
|
const [stackHeight, setStackHeight] = useState();
|
|
18
20
|
const handleOnLayout = useCallback(({ nativeEvent: { layout: { height }, }, }) => setStackHeight(height), []);
|
|
19
21
|
const stackSyle = useSpring({ height: stackHeight });
|
|
20
22
|
return (React.createElement(animated.View, { style: stackSyle },
|
|
21
23
|
React.createElement(View, { onLayout: handleOnLayout },
|
|
22
24
|
titleText && (React.createElement(Text, { level: 3, style: style.title, heading: true }, titleText)),
|
|
23
|
-
feedbackReturnQuestion ? (React.createElement(React.Fragment, null,
|
|
25
|
+
feedbackReturnQuestion && returnQuestionHasChildren(feedbackReturnQuestion) ? (React.createElement(React.Fragment, null,
|
|
24
26
|
React.createElement(Text, { color: COLOR.TEXT_MEDIUM, level: 3 }, feedbackText),
|
|
25
27
|
feedbackReturnQuestion.children?.map((childReturnQuestion) => (React.createElement(ReturnQuestion, { key: childReturnQuestion.id, portalHostName: portalHostName, returnQuestion: childReturnQuestion, returnQuestionParent: feedbackReturnQuestion }))))) : (children))));
|
|
26
28
|
};
|
|
@@ -2,16 +2,17 @@ import React from "react";
|
|
|
2
2
|
import { View } from "react-native";
|
|
3
3
|
import { COLOR, Text } from "@lookiero/aurora";
|
|
4
4
|
import { useIntl } from "@lookiero/i18n-react";
|
|
5
|
-
import { Modal
|
|
5
|
+
import { Modal } from "@lookiero/sty-psp-ui";
|
|
6
|
+
import { returnQuestionHasChildren } from "../../../../../../../projection/returnQuestion/returnQuestion.typeguard";
|
|
6
7
|
import ReturnQuestion from "../../ReturnQuestion";
|
|
7
8
|
import { style } from "./ModalOptionReturnQuestionItems.style";
|
|
8
9
|
const ModalOptionReturnQuestionItems = ({ portalHostName, returnQuestion, visible, onClose, }) => {
|
|
9
|
-
const { modal } = useEnvironmentStyle();
|
|
10
10
|
const { formatMessage } = useIntl();
|
|
11
|
-
const title = formatMessage({ id: returnQuestion.
|
|
11
|
+
const title = formatMessage({ id: returnQuestion.translationKey });
|
|
12
12
|
return (React.createElement(Modal, { portalHostName: portalHostName, visible: visible, scroll: true, showCloseButton: true, onClose: onClose },
|
|
13
|
-
React.createElement(View, { style:
|
|
13
|
+
React.createElement(View, { style: style.modalContent },
|
|
14
14
|
React.createElement(Text, { color: COLOR.TEXT_MEDIUM, level: 2, style: style.optionText }, title),
|
|
15
|
-
React.createElement(React.Fragment, null, returnQuestion
|
|
15
|
+
React.createElement(React.Fragment, null, returnQuestionHasChildren(returnQuestion) &&
|
|
16
|
+
returnQuestion.children?.map((childReturnQuestion) => (React.createElement(ReturnQuestion, { key: childReturnQuestion.id, portalHostName: "", returnQuestion: childReturnQuestion, returnQuestionParent: returnQuestion })))))));
|
|
16
17
|
};
|
|
17
18
|
export { ModalOptionReturnQuestionItems };
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { ReturnQuestionType } from "../../../../../../../projection/returnQuestion/returnQuestion.constants";
|
|
1
2
|
import { ReturnQuestionItem } from "../ReturnQuestionItem";
|
|
2
|
-
declare const OptionReturnQuestionItem: ReturnQuestionItem
|
|
3
|
+
declare const OptionReturnQuestionItem: ReturnQuestionItem<ReturnQuestionType.OPTION>;
|
|
3
4
|
export { OptionReturnQuestionItem };
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/* eslint-disable react/prop-types */
|
|
1
2
|
import React, { useCallback } from "react";
|
|
2
3
|
import { TouchableHighlight } from "react-native";
|
|
3
4
|
import { Text } from "@lookiero/aurora";
|
|
@@ -6,7 +7,7 @@ import { useReturnQuestionFeedbackForReturnQuestion } from "../../behaviors/useR
|
|
|
6
7
|
import { containerUnderlayColor, style } from "./OptionReturnQuestionItem.style";
|
|
7
8
|
const OptionReturnQuestionItem = ({ returnQuestion, returnQuestionParent, testID, }) => {
|
|
8
9
|
const { onChange } = useReturnQuestionFeedbackForReturnQuestion({ returnQuestion: returnQuestionParent });
|
|
9
|
-
const optionText = useI18nMessage({ id: returnQuestion.
|
|
10
|
+
const optionText = useI18nMessage({ id: returnQuestion.translationKey });
|
|
10
11
|
const handleOnPress = useCallback(() => onChange({ returnQuestionId: returnQuestionParent.id, returnQuestionFeedback: returnQuestion.id }), [onChange, returnQuestion.id, returnQuestionParent.id]);
|
|
11
12
|
return (React.createElement(TouchableHighlight, { accessibilityLabel: testID, style: style.container, testID: testID, underlayColor: containerUnderlayColor, onPress: handleOnPress },
|
|
12
13
|
React.createElement(Text, { level: 3, style: style.text }, optionText)));
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { ReturnQuestionType } from "../../../../../../../projection/returnQuestion/returnQuestion.constants";
|
|
1
2
|
import { ReturnQuestionItem } from "../ReturnQuestionItem";
|
|
2
|
-
declare const RadioReturnQuestionItem: ReturnQuestionItem
|
|
3
|
+
declare const RadioReturnQuestionItem: ReturnQuestionItem<ReturnQuestionType.OPTION>;
|
|
3
4
|
export { RadioReturnQuestionItem };
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/* eslint-disable react/prop-types */
|
|
1
2
|
import React, { useCallback, useEffect, useState } from "react";
|
|
2
3
|
import { View, Option, OPTION_VARIANT, SIZE } from "@lookiero/aurora";
|
|
3
4
|
import { useIntl } from "@lookiero/i18n-react";
|
|
@@ -12,7 +13,7 @@ const RadioReturnQuestionItem = ({ returnQuestion, returnQuestionParent, testID,
|
|
|
12
13
|
const feedback = useReturnQuestionFeedback();
|
|
13
14
|
const translate = useCallback((returnQuestionName) => intl.formatMessage({ id: returnQuestionName, defaultMessage: returnQuestionName }), [intl]);
|
|
14
15
|
const inputValue = feedbackForReturnQuestion({ feedback, returnQuestion, translate }).join(" / ");
|
|
15
|
-
const optionText = intl.formatMessage({ id: returnQuestion.
|
|
16
|
+
const optionText = intl.formatMessage({ id: returnQuestion.translationKey });
|
|
16
17
|
const hasChildren = Boolean(returnQuestion.children && returnQuestion.children.length > 0);
|
|
17
18
|
const handleOnModalClose = useCallback(() => {
|
|
18
19
|
// Uncomment if we want to clear current selection (and update callback's dependencies)
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { ReturnQuestionType } from "../../../../../../../projection/returnQuestion/returnQuestion.constants";
|
|
1
2
|
import { ReturnQuestionItem } from "../ReturnQuestionItem";
|
|
2
|
-
declare const ReturnQuestionFeedbackItem: ReturnQuestionItem
|
|
3
|
+
declare const ReturnQuestionFeedbackItem: ReturnQuestionItem<ReturnQuestionType.HOST_DEFAULT>;
|
|
3
4
|
export { ReturnQuestionFeedbackItem };
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/* eslint-disable react/prop-types */
|
|
1
2
|
import React, { useCallback } from "react";
|
|
2
3
|
import { View } from "react-native";
|
|
3
4
|
import { Text } from "@lookiero/aurora";
|
|
@@ -7,7 +8,7 @@ import { useReturnQuestionFeedback } from "../../behaviors/useReturnQuestionFeed
|
|
|
7
8
|
import { feedbackForReturnQuestion } from "../../util/returnQuestionFeedback";
|
|
8
9
|
import { style } from "./ReturnQuestionFeedbackItem.style";
|
|
9
10
|
const ReturnQuestionFeedbackItem = ({ returnQuestion }) => {
|
|
10
|
-
const titleText = useI18nMessage({ id: returnQuestion.
|
|
11
|
+
const titleText = useI18nMessage({ id: returnQuestion.translationKey });
|
|
11
12
|
const unansweredText = useI18nMessage({ id: I18nMessages.FEEDBACK_UNANSWERED });
|
|
12
13
|
const returnQuestionFeedback = useReturnQuestionFeedback();
|
|
13
14
|
const intl = useIntl();
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { ReturnQuestionType } from "../../../../../../../projection/returnQuestion/returnQuestion.constants";
|
|
1
2
|
import { ReturnQuestionItem } from "../ReturnQuestionItem";
|
|
2
|
-
declare const TextareaReturnQuestionItem: ReturnQuestionItem
|
|
3
|
+
declare const TextareaReturnQuestionItem: ReturnQuestionItem<ReturnQuestionType.TEXTAREA>;
|
|
3
4
|
export { TextareaReturnQuestionItem };
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/* eslint-disable react/prop-types */
|
|
1
2
|
import React, { useCallback, useMemo } from "react";
|
|
2
3
|
import { View } from "@lookiero/aurora";
|
|
3
4
|
import { useIntl } from "@lookiero/i18n-react";
|
|
@@ -6,7 +7,7 @@ import { useReturnQuestionFeedbackForReturnQuestion } from "../../behaviors/useR
|
|
|
6
7
|
import { style } from "./TextareaReturnQuestionItem.style";
|
|
7
8
|
const TextareaReturnQuestionItem = ({ returnQuestion, returnQuestionParent, testID, }) => {
|
|
8
9
|
const { formatMessage } = useIntl();
|
|
9
|
-
const placeholderText = useMemo(() => (returnQuestion.placeholder ? formatMessage({ id: returnQuestion.placeholder }) : ""), [formatMessage, returnQuestion.placeholder]);
|
|
10
|
+
const placeholderText = useMemo(() => (returnQuestion.metadata.placeholder ? formatMessage({ id: returnQuestion.metadata.placeholder }) : ""), [formatMessage, returnQuestion.metadata.placeholder]);
|
|
10
11
|
const { feedback, onChange } = useReturnQuestionFeedbackForReturnQuestion({ returnQuestion: returnQuestionParent });
|
|
11
12
|
const handleOnChange = useCallback((value) => onChange({ returnQuestionId: returnQuestionParent.id, returnQuestionFeedback: value }), [onChange, returnQuestionParent.id]);
|
|
12
13
|
return (React.createElement(View, { style: style.wrapper },
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { returnQuestionHasChildren, returnQuestionWithTranslationKey, } from "../../../../../../projection/returnQuestion/returnQuestion.typeguard";
|
|
1
2
|
const REGEX = /^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;
|
|
2
3
|
const isUuid = (value) => {
|
|
3
4
|
return typeof value === "string" && REGEX.test(value);
|
|
@@ -7,11 +8,14 @@ const feedbackForReturnQuestion = ({ feedback, returnQuestion, translate, acc =
|
|
|
7
8
|
if (returnQuestionId) {
|
|
8
9
|
const returnQuestionFeedback = feedback[returnQuestionId];
|
|
9
10
|
if (isUuid(returnQuestionFeedback)) {
|
|
10
|
-
const feebackReturnQuestionChild = returnQuestion
|
|
11
|
+
const feebackReturnQuestionChild = returnQuestionHasChildren(returnQuestion) &&
|
|
12
|
+
returnQuestion.children?.find((childReturnQuestion) => childReturnQuestion.id === returnQuestionFeedback);
|
|
11
13
|
if (feebackReturnQuestionChild) {
|
|
12
14
|
return [
|
|
13
15
|
...acc,
|
|
14
|
-
|
|
16
|
+
...(returnQuestionWithTranslationKey(feebackReturnQuestionChild)
|
|
17
|
+
? [translate(feebackReturnQuestionChild.translationKey)]
|
|
18
|
+
: []),
|
|
15
19
|
...feedbackForReturnQuestion({ feedback, returnQuestion: feebackReturnQuestionChild, translate, acc }),
|
|
16
20
|
];
|
|
17
21
|
}
|
|
@@ -19,17 +23,20 @@ const feedbackForReturnQuestion = ({ feedback, returnQuestion, translate, acc =
|
|
|
19
23
|
}
|
|
20
24
|
return [...acc, returnQuestionFeedback];
|
|
21
25
|
}
|
|
22
|
-
return (
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
+
return ((returnQuestionHasChildren(returnQuestion) &&
|
|
27
|
+
returnQuestion.children?.reduce((acc, childReturnQuestion) => [
|
|
28
|
+
...acc,
|
|
29
|
+
...feedbackForReturnQuestion({ feedback, returnQuestion: childReturnQuestion, translate, acc }),
|
|
30
|
+
], [])) ||
|
|
31
|
+
[]);
|
|
26
32
|
};
|
|
27
33
|
const deepestReturnQuestionWithFeedbackForReturnQuestion = ({ feedback, returnQuestion, deepestReturnQuestion, }) => {
|
|
28
34
|
const returnQuestionId = Object.keys(feedback).find((id) => id === returnQuestion.id);
|
|
29
35
|
if (returnQuestionId) {
|
|
30
36
|
const returnQuestionFeedback = feedback[returnQuestionId];
|
|
31
37
|
if (isUuid(returnQuestionFeedback)) {
|
|
32
|
-
const feebackReturnQuestionChild = returnQuestion
|
|
38
|
+
const feebackReturnQuestionChild = returnQuestionHasChildren(returnQuestion) &&
|
|
39
|
+
returnQuestion.children?.find((childReturnQuestion) => childReturnQuestion.id === returnQuestionFeedback);
|
|
33
40
|
if (feebackReturnQuestionChild) {
|
|
34
41
|
return deepestReturnQuestionWithFeedbackForReturnQuestion({
|
|
35
42
|
feedback,
|
|
@@ -41,7 +48,8 @@ const deepestReturnQuestionWithFeedbackForReturnQuestion = ({ feedback, returnQu
|
|
|
41
48
|
}
|
|
42
49
|
return [returnQuestion, false];
|
|
43
50
|
}
|
|
44
|
-
const feebackReturnQuestionChild = returnQuestion
|
|
51
|
+
const feebackReturnQuestionChild = returnQuestionHasChildren(returnQuestion) &&
|
|
52
|
+
returnQuestion.children?.find((childReturnQuestion) => Object.keys(feedback).find((id) => id === childReturnQuestion.id));
|
|
45
53
|
if (feebackReturnQuestionChild) {
|
|
46
54
|
return deepestReturnQuestionWithFeedbackForReturnQuestion({
|
|
47
55
|
feedback,
|
|
@@ -49,6 +57,7 @@ const deepestReturnQuestionWithFeedbackForReturnQuestion = ({ feedback, returnQu
|
|
|
49
57
|
deepestReturnQuestion: feebackReturnQuestionChild,
|
|
50
58
|
});
|
|
51
59
|
}
|
|
52
|
-
|
|
60
|
+
const hasChildren = Boolean(returnQuestionHasChildren(returnQuestion) && returnQuestion.children && returnQuestion.children.length > 0);
|
|
61
|
+
return [deepestReturnQuestion, !hasChildren];
|
|
53
62
|
};
|
|
54
63
|
export { feedbackForReturnQuestion, deepestReturnQuestionWithFeedbackForReturnQuestion };
|
|
@@ -4,7 +4,6 @@ import React, { Fragment } from "react";
|
|
|
4
4
|
import { IntlProvider } from "react-intl";
|
|
5
5
|
import { Aurora } from "@lookiero/aurora";
|
|
6
6
|
import { LoggerProvider } from "@lookiero/sty-psp-logging";
|
|
7
|
-
import { EnvironmentStyleProvider } from "@lookiero/sty-psp-ui";
|
|
8
7
|
import { BasePathProvider } from "../routing/useBasePath";
|
|
9
8
|
const renderWrapper = ({ locale, messages = {}, wrapper: Wrapper = Fragment, logger = mock() }) =>
|
|
10
9
|
// eslint-disable-next-line react/display-name, react/prop-types
|
|
@@ -12,7 +11,6 @@ const renderWrapper = ({ locale, messages = {}, wrapper: Wrapper = Fragment, log
|
|
|
12
11
|
React.createElement(IntlProvider, { locale: locale, messages: messages, onError: () => void 0 },
|
|
13
12
|
React.createElement(LoggerProvider, { logger: logger },
|
|
14
13
|
React.createElement(BasePathProvider, { basePath: "" },
|
|
15
|
-
React.createElement(
|
|
16
|
-
React.createElement(Wrapper, null, children)))))));
|
|
14
|
+
React.createElement(Wrapper, null, children))))));
|
|
17
15
|
const renderWithProviders = (ui, { locale, messages, wrapper } = { locale: "en" }) => render(ui, { wrapper: renderWrapper({ locale, messages, wrapper }) });
|
|
18
16
|
export { renderWithProviders as render };
|
|
@@ -1,20 +1,15 @@
|
|
|
1
1
|
import { PortalProvider } from "@gorhom/portal";
|
|
2
2
|
import React from "react";
|
|
3
|
-
import { StatusBar
|
|
3
|
+
import { StatusBar } from "react-native";
|
|
4
4
|
import { SafeAreaProvider } from "react-native-safe-area-context";
|
|
5
5
|
import { PortalProvider as AuroraPortalProvider } from "@lookiero/aurora";
|
|
6
6
|
import { Notifications } from "@lookiero/sty-psp-notifications";
|
|
7
|
-
import { theme
|
|
7
|
+
import { theme } from "@lookiero/sty-psp-ui";
|
|
8
8
|
import { MESSAGING_CONTEXT_ID } from "../../delivery/baseBootstrap";
|
|
9
|
-
import { style } from "./App.style";
|
|
10
9
|
const { colorBgBase } = theme();
|
|
11
|
-
const App = ({ children }) =>
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
React.createElement(
|
|
15
|
-
|
|
16
|
-
React.createElement(StatusBar, { backgroundColor: colorBgBase, barStyle: "dark-content", translucent: true }),
|
|
17
|
-
React.createElement(Notifications, { contextId: MESSAGING_CONTEXT_ID }),
|
|
18
|
-
React.createElement(AuroraPortalProvider, null, children)))));
|
|
19
|
-
};
|
|
10
|
+
const App = ({ children }) => (React.createElement(SafeAreaProvider, null,
|
|
11
|
+
React.createElement(PortalProvider, null,
|
|
12
|
+
React.createElement(StatusBar, { backgroundColor: colorBgBase, barStyle: "dark-content", translucent: true }),
|
|
13
|
+
React.createElement(Notifications, { contextId: MESSAGING_CONTEXT_ID }),
|
|
14
|
+
React.createElement(AuroraPortalProvider, null, children))));
|
|
20
15
|
export { App };
|
|
@@ -2,17 +2,16 @@ import React from "react";
|
|
|
2
2
|
import { View } from "react-native";
|
|
3
3
|
import { ALIGN, Button, BUTTON_VARIANT, Text } from "@lookiero/aurora";
|
|
4
4
|
import { useI18nMessage } from "@lookiero/i18n-react";
|
|
5
|
-
import { Modal
|
|
5
|
+
import { Modal } from "@lookiero/sty-psp-ui";
|
|
6
6
|
import { I18nMessages } from "../../../../i18n/i18n";
|
|
7
7
|
import { style } from "./GetOutOfCheckoutModal.style";
|
|
8
8
|
const GetOutOfCheckoutModal = ({ visible, onDismiss, onConfirm }) => {
|
|
9
|
-
const { modal } = useEnvironmentStyle();
|
|
10
9
|
const titleText = useI18nMessage({ id: I18nMessages.GET_OUT_OF_CHECKOUT_MODAL_TITLE });
|
|
11
10
|
const descriptionText = useI18nMessage({ id: I18nMessages.GET_OUT_OF_CHECKOUT_MODAL_DESCRIPTION });
|
|
12
11
|
const dismissButtonText = useI18nMessage({ id: I18nMessages.GET_OUT_OF_CHECKOUT_MODAL_DISMISS_BUTTON });
|
|
13
12
|
const confirmButtonText = useI18nMessage({ id: I18nMessages.GET_OUT_OF_CHECKOUT_MODAL_CONFIRM_BUTTON });
|
|
14
13
|
return (React.createElement(Modal, { visible: visible, onClose: onDismiss },
|
|
15
|
-
React.createElement(View, { style:
|
|
14
|
+
React.createElement(View, { style: style.modalContent },
|
|
16
15
|
React.createElement(Text, { align: ALIGN.CENTER, level: 1, style: style.title }, titleText),
|
|
17
16
|
React.createElement(Text, { level: 3, style: style.description }, descriptionText),
|
|
18
17
|
React.createElement(Button, { style: style.button, onPress: onDismiss },
|
|
@@ -2,7 +2,7 @@ import React from "react";
|
|
|
2
2
|
import { View } from "react-native";
|
|
3
3
|
import { ButtonIcon, Text } from "@lookiero/aurora";
|
|
4
4
|
import { useI18nMessage } from "@lookiero/i18n-react";
|
|
5
|
-
import { ReturnQuestionType
|
|
5
|
+
import { ReturnQuestionType } from "../../../../../../projection/returnQuestion/returnQuestion.constants";
|
|
6
6
|
import { ReturnQuestions } from "../../../../components/organisms/returnQuestions/ReturnQuestions";
|
|
7
7
|
import { ReturnQuestionItemProvider, } from "../../../../components/organisms/returnQuestions/behaviors/useReturnQuestionItem";
|
|
8
8
|
import { HostDefaultReturnQuestionFeedbackItem } from "../../../../components/organisms/returnQuestions/components/hostDefaultReturnQuestionFeedbackItem/HostDefaultReturnQuestionFeedbackItem";
|
|
@@ -1,4 +1,10 @@
|
|
|
1
1
|
import { FC } from "react";
|
|
2
|
+
import { StyleProp, TextStyle, ViewStyle } from "react-native";
|
|
3
|
+
interface SelectModalStyle {
|
|
4
|
+
readonly modalContent: StyleProp<ViewStyle>;
|
|
5
|
+
readonly option: StyleProp<ViewStyle>;
|
|
6
|
+
readonly optionText: StyleProp<TextStyle>;
|
|
7
|
+
}
|
|
2
8
|
interface Option {
|
|
3
9
|
readonly label: string;
|
|
4
10
|
readonly value: string;
|
|
@@ -7,10 +13,11 @@ interface SelectModalProps {
|
|
|
7
13
|
readonly title?: string;
|
|
8
14
|
readonly value: string | undefined;
|
|
9
15
|
readonly options: Option[];
|
|
10
|
-
readonly
|
|
11
|
-
readonly testID?: string;
|
|
16
|
+
readonly style?: Partial<SelectModalStyle>;
|
|
12
17
|
readonly onChange?: (value: string) => void;
|
|
13
18
|
readonly onClose?: () => void;
|
|
19
|
+
readonly modalVisible: boolean;
|
|
20
|
+
readonly testID?: string;
|
|
14
21
|
}
|
|
15
22
|
declare const SelectModal: FC<SelectModalProps>;
|
|
16
23
|
export type { Option };
|
|
@@ -1,19 +1,18 @@
|
|
|
1
1
|
import React, { useCallback } from "react";
|
|
2
2
|
import { TouchableHighlight, View } from "react-native";
|
|
3
3
|
import { COLOR, Text } from "@lookiero/aurora";
|
|
4
|
-
import { Modal, theme
|
|
4
|
+
import { Modal, theme } from "@lookiero/sty-psp-ui";
|
|
5
5
|
import { style } from "./SelectModal.style";
|
|
6
6
|
const { colorBgPrimaryLight } = theme();
|
|
7
|
-
const SelectModal = ({ modalVisible,
|
|
8
|
-
const { modal } = useEnvironmentStyle();
|
|
7
|
+
const SelectModal = ({ modalVisible, onChange = () => void 0, onClose = () => void 0, options, style: customStyle, testID, title, value, }) => {
|
|
9
8
|
const handleOnPressOption = useCallback((value) => {
|
|
10
9
|
onChange(value);
|
|
11
10
|
onClose();
|
|
12
11
|
}, [onClose, onChange]);
|
|
13
12
|
return (React.createElement(Modal, { testID: testID, visible: modalVisible, scroll: true, showCloseButton: true, onClose: onClose },
|
|
14
|
-
React.createElement(View, { style: [style.
|
|
13
|
+
React.createElement(View, { style: [style.modalContent, customStyle?.modalContent] },
|
|
15
14
|
title && (React.createElement(Text, { level: 3, style: style.modalTitle, heading: true }, title)),
|
|
16
|
-
options.map(({ label, value: optionValue }) => (React.createElement(TouchableHighlight, { key: optionValue, accessibilityLabel: optionValue, disabled: value === optionValue, style: style.option, testID: optionValue, underlayColor: colorBgPrimaryLight, accessible: true, onPress: value !== optionValue ? () => handleOnPressOption(optionValue) : undefined },
|
|
17
|
-
React.createElement(Text, { color: value === optionValue ? COLOR.TEXT_MEDIUM : COLOR.TEXT, level: 3, style: style.optionText }, label)))))));
|
|
15
|
+
options.map(({ label, value: optionValue }) => (React.createElement(TouchableHighlight, { key: optionValue, accessibilityLabel: optionValue, disabled: value === optionValue, style: [style.option, customStyle?.option], testID: optionValue, underlayColor: colorBgPrimaryLight, accessible: true, onPress: value !== optionValue ? () => handleOnPressOption(optionValue) : undefined },
|
|
16
|
+
React.createElement(Text, { color: value === optionValue ? COLOR.TEXT_MEDIUM : COLOR.TEXT, level: 3, style: [style.optionText, customStyle?.optionText] }, label)))))));
|
|
18
17
|
};
|
|
19
18
|
export { SelectModal };
|
|
@@ -2,7 +2,7 @@ import { StyleSheet } from "react-native";
|
|
|
2
2
|
import { theme } from "@lookiero/sty-psp-ui";
|
|
3
3
|
const { borderWidth1, colorBorderInteractive, space1, space5, space6 } = theme();
|
|
4
4
|
const style = StyleSheet.create({
|
|
5
|
-
|
|
5
|
+
modalContent: {
|
|
6
6
|
paddingBottom: space6,
|
|
7
7
|
paddingHorizontal: space6,
|
|
8
8
|
},
|
|
@@ -2,16 +2,15 @@ import React from "react";
|
|
|
2
2
|
import { View } from "react-native";
|
|
3
3
|
import { Button, Text } from "@lookiero/aurora";
|
|
4
4
|
import { useI18nMessage } from "@lookiero/i18n-react";
|
|
5
|
-
import { Modal
|
|
5
|
+
import { Modal } from "@lookiero/sty-psp-ui";
|
|
6
6
|
import { I18nMessages } from "../../../../i18n/i18n";
|
|
7
7
|
import { style } from "./SizeWithoutStockModal.style";
|
|
8
8
|
const SizeWithoutStockModal = ({ visible, onDismiss }) => {
|
|
9
|
-
const { modal } = useEnvironmentStyle();
|
|
10
9
|
const titleText = useI18nMessage({ id: I18nMessages.SIZE_WITHOUT_STOCK_MODAL_TITLE });
|
|
11
10
|
const descriptionText = useI18nMessage({ id: I18nMessages.SIZE_WITHOUT_STOCK_MODAL_DESCRIPTION });
|
|
12
11
|
const buttonText = useI18nMessage({ id: I18nMessages.SIZE_WITHOUT_STOCK_MODAL_BUTTON });
|
|
13
12
|
return (React.createElement(Modal, { visible: visible, showCloseButton: true, onClose: onDismiss },
|
|
14
|
-
React.createElement(View, { style:
|
|
13
|
+
React.createElement(View, { style: style.modalContent },
|
|
15
14
|
React.createElement(Text, { level: 3, style: style.title, heading: true }, titleText),
|
|
16
15
|
React.createElement(Text, { level: 3, style: style.description }, descriptionText),
|
|
17
16
|
React.createElement(Button, { onPress: onDismiss }, buttonText))));
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import { PortalHost } from "@gorhom/portal";
|
|
2
2
|
import React, { useCallback, useMemo } from "react";
|
|
3
|
-
import {
|
|
3
|
+
import { Platform } from "react-native";
|
|
4
|
+
import { KeyboardAwareScrollView } from "react-native-keyboard-aware-scroll-view";
|
|
4
5
|
import { generatePath, useNavigate } from "react-router-native";
|
|
5
6
|
import { Box, Button, Layout as AuroraLayout, Spinner, Text, View, useDevice } from "@lookiero/aurora";
|
|
6
7
|
import { useI18nMessage } from "@lookiero/i18n-react";
|
|
7
8
|
import { CommandStatus } from "@lookiero/messaging-react";
|
|
8
9
|
import { useLogger } from "@lookiero/sty-psp-logging";
|
|
9
|
-
import { ReturnQuestionType } from "../../../../../../projection/returnQuestion/returnQuestion";
|
|
10
|
+
import { ReturnQuestionType } from "../../../../../../projection/returnQuestion/returnQuestion.constants";
|
|
10
11
|
import { useReturnCheckoutItem } from "../../../../../domain/checkoutItem/react/useReturnCheckoutItem";
|
|
11
12
|
import { useListReturnQuestionsByCheckoutItemId } from "../../../../../projection/returnQuestion/react/useListReturnQuestionsByCheckoutItemId";
|
|
12
13
|
import { TrackingPage } from "../../../../../tracking/tracking";
|
|
@@ -100,7 +101,7 @@ const ReturnQuestionsForm = ({ checkout, checkoutItem, country, layout: Layout,
|
|
|
100
101
|
header: style.header,
|
|
101
102
|
} },
|
|
102
103
|
React.createElement(ProductVariantPreview, { country: country, item: checkoutItem }),
|
|
103
|
-
React.createElement(
|
|
104
|
+
React.createElement(KeyboardAwareScrollView, { extraScrollHeight: Platform.OS === "android" ? 10 : 120, keyboardShouldPersistTaps: "handled", showsVerticalScrollIndicator: false, testID: "return-questions-form" },
|
|
104
105
|
React.createElement(View, { style: style.background },
|
|
105
106
|
React.createElement(AuroraLayout, { fullWidth: !screen.L, style: [style.layout, screen.L ? style.desktopLayoutSpacing : undefined] },
|
|
106
107
|
React.createElement(Box, { size: { L: "2/3" } },
|
package/dist/src/infrastructure/ui/views/summary/components/collapsiblePricing/CollapsiblePricing.js
CHANGED
|
@@ -26,8 +26,8 @@ const CollapsiblePricing = ({ pricing, totalCheckoutItemsKept, collapsible = tru
|
|
|
26
26
|
totalCheckoutItemsKeptText),
|
|
27
27
|
React.createElement(Price, { price: pendingToPay, variant: "detail" })),
|
|
28
28
|
React.createElement(View, { style: style.collapsedContent },
|
|
29
|
-
React.createElement(Button, { testID: "
|
|
29
|
+
React.createElement(Button, { testID: "submit-checkout-collpased-button", small: true, onPress: onSubmit }, submitButtonText)))) : (React.createElement(animated.View, { style: { opacity: notCollapsedStyle.opacitiy } },
|
|
30
30
|
React.createElement(Pricing, { pricing: pricing, totalCheckoutItemsKept: totalCheckoutItemsKept }),
|
|
31
|
-
React.createElement(Button, { testID: "
|
|
31
|
+
React.createElement(Button, { testID: "submit-checkout-button", onPress: onSubmit }, submitButtonText)))));
|
|
32
32
|
};
|
|
33
33
|
export { CollapsiblePricing };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
var ReturnQuestionType;
|
|
2
|
+
(function (ReturnQuestionType) {
|
|
3
|
+
ReturnQuestionType["HOST_DEFAULT"] = "HOST_DEFAULT";
|
|
4
|
+
ReturnQuestionType["HOST_TEXTAREA"] = "HOST_TEXTAREA";
|
|
5
|
+
ReturnQuestionType["HOST_SELECT"] = "HOST_SELECT";
|
|
6
|
+
ReturnQuestionType["HOST_STACK"] = "HOST_STACK";
|
|
7
|
+
ReturnQuestionType["TEXTAREA"] = "TEXTAREA";
|
|
8
|
+
ReturnQuestionType["OPTION"] = "OPTION";
|
|
9
|
+
})(ReturnQuestionType || (ReturnQuestionType = {}));
|
|
10
|
+
export { ReturnQuestionType };
|