@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,19 +1,21 @@
|
|
|
1
|
+
/* eslint-disable react/prop-types */
|
|
1
2
|
import React, { useCallback } from "react";
|
|
2
3
|
import { TouchableHighlight, ViewStyle } from "react-native";
|
|
3
4
|
import { Text } from "@lookiero/aurora";
|
|
4
5
|
import { useI18nMessage } from "@lookiero/i18n-react";
|
|
6
|
+
import { ReturnQuestionType } from "../../../../../../../projection/returnQuestion/returnQuestion.constants";
|
|
5
7
|
import { useReturnQuestionFeedbackForReturnQuestion } from "../../behaviors/useReturnQuestionFeedback";
|
|
6
|
-
import { ReturnQuestionItem
|
|
8
|
+
import { ReturnQuestionItem } from "../ReturnQuestionItem";
|
|
7
9
|
import { containerUnderlayColor, style } from "./OptionReturnQuestionItem.style";
|
|
8
10
|
|
|
9
|
-
const OptionReturnQuestionItem: ReturnQuestionItem = ({
|
|
11
|
+
const OptionReturnQuestionItem: ReturnQuestionItem<ReturnQuestionType.OPTION> = ({
|
|
10
12
|
returnQuestion,
|
|
11
13
|
returnQuestionParent,
|
|
12
14
|
testID,
|
|
13
|
-
}
|
|
15
|
+
}) => {
|
|
14
16
|
const { onChange } = useReturnQuestionFeedbackForReturnQuestion({ returnQuestion: returnQuestionParent });
|
|
15
17
|
|
|
16
|
-
const optionText = useI18nMessage({ id: returnQuestion.
|
|
18
|
+
const optionText = useI18nMessage({ id: returnQuestion.translationKey });
|
|
17
19
|
const handleOnPress = useCallback(
|
|
18
20
|
() => onChange({ returnQuestionId: returnQuestionParent.id, returnQuestionFeedback: returnQuestion.id }),
|
|
19
21
|
[onChange, returnQuestion.id, returnQuestionParent.id],
|
|
@@ -1,6 +1,8 @@
|
|
|
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";
|
|
5
|
+
import { ReturnQuestionType } from "../../../../../../../projection/returnQuestion/returnQuestion.constants";
|
|
4
6
|
import {
|
|
5
7
|
useReturnQuestionFeedback,
|
|
6
8
|
useReturnQuestionFeedbackForReturnQuestion,
|
|
@@ -9,16 +11,16 @@ import {
|
|
|
9
11
|
deepestReturnQuestionWithFeedbackForReturnQuestion,
|
|
10
12
|
feedbackForReturnQuestion,
|
|
11
13
|
} from "../../util/returnQuestionFeedback";
|
|
12
|
-
import { ReturnQuestionItem
|
|
14
|
+
import { ReturnQuestionItem } from "../ReturnQuestionItem";
|
|
13
15
|
import { ModalOptionReturnQuestionItems } from "../modalOptionReturnQuestionItems/ModalOptionReturnQuestionItems";
|
|
14
16
|
import { style } from "./RadioReturnQuestionItem.style";
|
|
15
17
|
|
|
16
|
-
const RadioReturnQuestionItem: ReturnQuestionItem = ({
|
|
18
|
+
const RadioReturnQuestionItem: ReturnQuestionItem<ReturnQuestionType.OPTION> = ({
|
|
17
19
|
returnQuestion,
|
|
18
20
|
returnQuestionParent,
|
|
19
21
|
testID,
|
|
20
22
|
portalHostName,
|
|
21
|
-
}
|
|
23
|
+
}) => {
|
|
22
24
|
const intl = useIntl();
|
|
23
25
|
const [modalVisible, setModalVisible] = useState(false);
|
|
24
26
|
const {
|
|
@@ -33,7 +35,7 @@ const RadioReturnQuestionItem: ReturnQuestionItem = ({
|
|
|
33
35
|
);
|
|
34
36
|
|
|
35
37
|
const inputValue = feedbackForReturnQuestion({ feedback, returnQuestion, translate }).join(" / ");
|
|
36
|
-
const optionText = intl.formatMessage({ id: returnQuestion.
|
|
38
|
+
const optionText = intl.formatMessage({ id: returnQuestion.translationKey });
|
|
37
39
|
|
|
38
40
|
const hasChildren = Boolean(returnQuestion.children && returnQuestion.children.length > 0);
|
|
39
41
|
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
ReturnQuestionType,
|
|
5
|
-
} from "../../../../../../../projection/returnQuestion/returnQuestion";
|
|
2
|
+
import { ReturnQuestionProjection } from "../../../../../../../projection/returnQuestion/returnQuestion";
|
|
3
|
+
import { ReturnQuestionType } from "../../../../../../../projection/returnQuestion/returnQuestion.constants";
|
|
6
4
|
import { feedback as mockFeedback } from "../../../../../../projection/feedback/feedback.mock";
|
|
7
5
|
import { I18nMessages } from "../../../../../i18n/i18n";
|
|
8
6
|
import { render } from "../../../../../test/render";
|
|
@@ -12,40 +10,34 @@ jest.mock("../../behaviors/useReturnQuestionFeedback", () => ({
|
|
|
12
10
|
useReturnQuestionFeedback: () => mockFeedback,
|
|
13
11
|
}));
|
|
14
12
|
|
|
15
|
-
const returnQuestion: ReturnQuestionProjection = {
|
|
13
|
+
const returnQuestion: ReturnQuestionProjection<ReturnQuestionType.HOST_DEFAULT> = {
|
|
16
14
|
id: "0ad1dba8-b02c-4121-a1e3-981f1c30800d",
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
type: ReturnQuestionType.HOST_STACK,
|
|
15
|
+
translationKey: "size_title",
|
|
16
|
+
type: ReturnQuestionType.HOST_DEFAULT,
|
|
20
17
|
children: [
|
|
21
18
|
{
|
|
22
19
|
id: "9251dc2c-d76a-484d-9299-346929af932f",
|
|
23
|
-
|
|
24
|
-
placeholder: "",
|
|
20
|
+
translationKey: "size_large",
|
|
25
21
|
type: ReturnQuestionType.OPTION,
|
|
26
22
|
children: [
|
|
27
23
|
{
|
|
28
24
|
id: "542c4d24-e1da-484f-8c3a-7d89ee135adc",
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
type: ReturnQuestionType.HOST_STACK,
|
|
25
|
+
translationKey: "",
|
|
26
|
+
type: ReturnQuestionType.HOST_DEFAULT,
|
|
32
27
|
children: [
|
|
33
28
|
{
|
|
34
29
|
id: "68c0bb98-b00a-4b86-af43-528fe903cb69",
|
|
35
|
-
|
|
36
|
-
placeholder: "",
|
|
30
|
+
translationKey: "size_overall",
|
|
37
31
|
type: ReturnQuestionType.OPTION,
|
|
38
32
|
},
|
|
39
33
|
{
|
|
40
34
|
id: "85e84a77-461c-41e6-8544-95b5294d0b80",
|
|
41
|
-
|
|
42
|
-
placeholder: "",
|
|
35
|
+
translationKey: "size_trousers_too_long",
|
|
43
36
|
type: ReturnQuestionType.OPTION,
|
|
44
37
|
},
|
|
45
38
|
{
|
|
46
39
|
id: "29441d25-8d9f-471e-a13e-a03f61c88091",
|
|
47
|
-
|
|
48
|
-
placeholder: "",
|
|
40
|
+
translationKey: "size_fit_cut_does_not_fit",
|
|
49
41
|
type: ReturnQuestionType.OPTION,
|
|
50
42
|
},
|
|
51
43
|
],
|
|
@@ -54,11 +46,17 @@ const returnQuestion: ReturnQuestionProjection = {
|
|
|
54
46
|
},
|
|
55
47
|
],
|
|
56
48
|
};
|
|
57
|
-
const returnQuestionUnanswered: ReturnQuestionProjection = {
|
|
49
|
+
const returnQuestionUnanswered: ReturnQuestionProjection<ReturnQuestionType.HOST_DEFAULT> = {
|
|
58
50
|
id: "fd7ff4a0-78ed-4c0d-aa4d-64962739c322",
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
51
|
+
translationKey: "style_title",
|
|
52
|
+
type: ReturnQuestionType.HOST_DEFAULT,
|
|
53
|
+
children: [
|
|
54
|
+
{
|
|
55
|
+
id: "68c0bb98-b00a-4b86-af43-528fe903cb69",
|
|
56
|
+
translationKey: "size_overall",
|
|
57
|
+
type: ReturnQuestionType.OPTION,
|
|
58
|
+
},
|
|
59
|
+
],
|
|
62
60
|
};
|
|
63
61
|
|
|
64
62
|
describe("ReturnQuestionFeedbackItem component (ReturnQuestions organism)", () => {
|
|
@@ -70,7 +68,7 @@ describe("ReturnQuestionFeedbackItem component (ReturnQuestions organism)", () =
|
|
|
70
68
|
/>,
|
|
71
69
|
);
|
|
72
70
|
|
|
73
|
-
expect(getByText(returnQuestion.
|
|
71
|
+
expect(getByText(returnQuestion.translationKey)).toBeTruthy();
|
|
74
72
|
expect(getByText("size_large / size_overall")).toBeTruthy();
|
|
75
73
|
});
|
|
76
74
|
|
|
@@ -82,7 +80,7 @@ describe("ReturnQuestionFeedbackItem component (ReturnQuestions organism)", () =
|
|
|
82
80
|
/>,
|
|
83
81
|
);
|
|
84
82
|
|
|
85
|
-
expect(getByText(returnQuestionUnanswered.
|
|
83
|
+
expect(getByText(returnQuestionUnanswered.translationKey)).toBeTruthy();
|
|
86
84
|
expect(getByText(I18nMessages.FEEDBACK_UNANSWERED)).toBeTruthy();
|
|
87
85
|
});
|
|
88
86
|
});
|
|
@@ -1,15 +1,17 @@
|
|
|
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";
|
|
4
5
|
import { useI18nMessage, useIntl } from "@lookiero/i18n-react";
|
|
6
|
+
import { ReturnQuestionType } from "../../../../../../../projection/returnQuestion/returnQuestion.constants";
|
|
5
7
|
import { I18nMessages } from "../../../../../i18n/i18n";
|
|
6
8
|
import { useReturnQuestionFeedback } from "../../behaviors/useReturnQuestionFeedback";
|
|
7
9
|
import { feedbackForReturnQuestion } from "../../util/returnQuestionFeedback";
|
|
8
|
-
import { ReturnQuestionItem
|
|
10
|
+
import { ReturnQuestionItem } from "../ReturnQuestionItem";
|
|
9
11
|
import { style } from "./ReturnQuestionFeedbackItem.style";
|
|
10
12
|
|
|
11
|
-
const ReturnQuestionFeedbackItem: ReturnQuestionItem = ({ returnQuestion }
|
|
12
|
-
const titleText = useI18nMessage({ id: returnQuestion.
|
|
13
|
+
const ReturnQuestionFeedbackItem: ReturnQuestionItem<ReturnQuestionType.HOST_DEFAULT> = ({ returnQuestion }) => {
|
|
14
|
+
const titleText = useI18nMessage({ id: returnQuestion.translationKey });
|
|
13
15
|
const unansweredText = useI18nMessage({ id: I18nMessages.FEEDBACK_UNANSWERED });
|
|
14
16
|
|
|
15
17
|
const returnQuestionFeedback = useReturnQuestionFeedback();
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import { fireEvent } from "@testing-library/react-native";
|
|
2
2
|
import React from "react";
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
ReturnQuestionType,
|
|
6
|
-
} from "../../../../../../../projection/returnQuestion/returnQuestion";
|
|
3
|
+
import { ReturnQuestionProjection } from "../../../../../../../projection/returnQuestion/returnQuestion";
|
|
4
|
+
import { ReturnQuestionType } from "../../../../../../../projection/returnQuestion/returnQuestion.constants";
|
|
7
5
|
import { render } from "../../../../../test/render";
|
|
8
6
|
import { TextareaReturnQuestionItem } from "./TextareaReturnQuestionItem";
|
|
9
7
|
|
|
@@ -15,31 +13,13 @@ jest.mock("../../behaviors/useReturnQuestionFeedback", () => ({
|
|
|
15
13
|
const returnQuestionParent = {
|
|
16
14
|
id: "0ad1dba8-b02c-4121-a1e3-981f1c30800d",
|
|
17
15
|
} as ReturnQuestionProjection;
|
|
18
|
-
const returnQuestion: ReturnQuestionProjection = {
|
|
19
|
-
id: "
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
id: "68c0bb98-b00a-4b86-af43-528fe903cb69",
|
|
26
|
-
name: "size_overall",
|
|
27
|
-
placeholder: "",
|
|
28
|
-
type: ReturnQuestionType.OPTION,
|
|
29
|
-
},
|
|
30
|
-
{
|
|
31
|
-
id: "85e84a77-461c-41e6-8544-95b5294d0b80",
|
|
32
|
-
name: "size_trousers_too_long",
|
|
33
|
-
placeholder: "",
|
|
34
|
-
type: ReturnQuestionType.OPTION,
|
|
35
|
-
},
|
|
36
|
-
{
|
|
37
|
-
id: "29441d25-8d9f-471e-a13e-a03f61c88091",
|
|
38
|
-
name: "size_fit_cut_does_not_fit",
|
|
39
|
-
placeholder: "",
|
|
40
|
-
type: ReturnQuestionType.OPTION,
|
|
41
|
-
},
|
|
42
|
-
],
|
|
16
|
+
const returnQuestion: ReturnQuestionProjection<ReturnQuestionType.TEXTAREA> = {
|
|
17
|
+
id: "1123a37d-bc00-43a4-9d28-cee1dfaf356c",
|
|
18
|
+
translationKey: "comment_textarea",
|
|
19
|
+
type: ReturnQuestionType.TEXTAREA,
|
|
20
|
+
metadata: {
|
|
21
|
+
placeholder: "comment_textarea_placeholder",
|
|
22
|
+
},
|
|
43
23
|
};
|
|
44
24
|
|
|
45
25
|
describe("TextareaReturnQuestionItem component (ReturnQuestions organism)", () => {
|
|
@@ -1,21 +1,23 @@
|
|
|
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";
|
|
5
|
+
import { ReturnQuestionType } from "../../../../../../../projection/returnQuestion/returnQuestion.constants";
|
|
4
6
|
import { InputField } from "../../../../../../../shared/ui/components/molecules/inputField/InputField";
|
|
5
7
|
import { useReturnQuestionFeedbackForReturnQuestion } from "../../behaviors/useReturnQuestionFeedback";
|
|
6
|
-
import { ReturnQuestionItem
|
|
8
|
+
import { ReturnQuestionItem } from "../ReturnQuestionItem";
|
|
7
9
|
import { style } from "./TextareaReturnQuestionItem.style";
|
|
8
10
|
|
|
9
|
-
const TextareaReturnQuestionItem: ReturnQuestionItem = ({
|
|
11
|
+
const TextareaReturnQuestionItem: ReturnQuestionItem<ReturnQuestionType.TEXTAREA> = ({
|
|
10
12
|
returnQuestion,
|
|
11
13
|
returnQuestionParent,
|
|
12
14
|
testID,
|
|
13
|
-
}
|
|
15
|
+
}) => {
|
|
14
16
|
const { formatMessage } = useIntl();
|
|
15
17
|
|
|
16
18
|
const placeholderText = useMemo(
|
|
17
|
-
() => (returnQuestion.placeholder ? formatMessage({ id: returnQuestion.placeholder }) : ""),
|
|
18
|
-
[formatMessage, returnQuestion.placeholder],
|
|
19
|
+
() => (returnQuestion.metadata.placeholder ? formatMessage({ id: returnQuestion.metadata.placeholder }) : ""),
|
|
20
|
+
[formatMessage, returnQuestion.metadata.placeholder],
|
|
19
21
|
);
|
|
20
22
|
|
|
21
23
|
const { feedback, onChange } = useReturnQuestionFeedbackForReturnQuestion({ returnQuestion: returnQuestionParent });
|
|
@@ -13,14 +13,15 @@ exports[`returnQuestionFeedback utils return the deepest returnQuestion with fee
|
|
|
13
13
|
"children": [
|
|
14
14
|
{
|
|
15
15
|
"id": "1123a37d-bc00-43a4-9d28-cee1dfaf356c",
|
|
16
|
-
"
|
|
17
|
-
|
|
16
|
+
"metadata": {
|
|
17
|
+
"placeholder": "comment_textarea_placeholder",
|
|
18
|
+
},
|
|
19
|
+
"translationKey": "comment_textarea",
|
|
18
20
|
"type": "TEXTAREA",
|
|
19
21
|
},
|
|
20
22
|
],
|
|
21
23
|
"id": "ce3e8d57-5eea-4dd3-bef4-2e811a143612",
|
|
22
|
-
"
|
|
23
|
-
"placeholder": "",
|
|
24
|
+
"translationKey": "comment_title",
|
|
24
25
|
"type": "HOST_TEXTAREA",
|
|
25
26
|
},
|
|
26
27
|
false,
|
package/src/infrastructure/ui/components/organisms/returnQuestions/util/returnQuestionFeedback.ts
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import { FeedbackProjection } from "../../../../../../projection/feedback/feedback";
|
|
2
2
|
import { ReturnQuestionProjection } from "../../../../../../projection/returnQuestion/returnQuestion";
|
|
3
|
+
import {
|
|
4
|
+
returnQuestionHasChildren,
|
|
5
|
+
returnQuestionWithTranslationKey,
|
|
6
|
+
} from "../../../../../../projection/returnQuestion/returnQuestion.typeguard";
|
|
3
7
|
|
|
4
8
|
type Uuid = string;
|
|
5
9
|
|
|
@@ -32,14 +36,16 @@ const feedbackForReturnQuestion: RecursiveFeedbackForReturnQuestionFunction = ({
|
|
|
32
36
|
const returnQuestionFeedback = feedback[returnQuestionId];
|
|
33
37
|
|
|
34
38
|
if (isUuid(returnQuestionFeedback as string)) {
|
|
35
|
-
const feebackReturnQuestionChild =
|
|
36
|
-
(
|
|
37
|
-
|
|
39
|
+
const feebackReturnQuestionChild =
|
|
40
|
+
returnQuestionHasChildren(returnQuestion) &&
|
|
41
|
+
returnQuestion.children?.find((childReturnQuestion) => childReturnQuestion.id === returnQuestionFeedback);
|
|
38
42
|
|
|
39
43
|
if (feebackReturnQuestionChild) {
|
|
40
44
|
return [
|
|
41
45
|
...acc,
|
|
42
|
-
|
|
46
|
+
...(returnQuestionWithTranslationKey(feebackReturnQuestionChild)
|
|
47
|
+
? [translate(feebackReturnQuestionChild.translationKey)]
|
|
48
|
+
: []),
|
|
43
49
|
...feedbackForReturnQuestion({ feedback, returnQuestion: feebackReturnQuestionChild, translate, acc }),
|
|
44
50
|
];
|
|
45
51
|
}
|
|
@@ -51,13 +57,15 @@ const feedbackForReturnQuestion: RecursiveFeedbackForReturnQuestionFunction = ({
|
|
|
51
57
|
}
|
|
52
58
|
|
|
53
59
|
return (
|
|
54
|
-
returnQuestion
|
|
55
|
-
(
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
60
|
+
(returnQuestionHasChildren(returnQuestion) &&
|
|
61
|
+
returnQuestion.children?.reduce(
|
|
62
|
+
(acc, childReturnQuestion) => [
|
|
63
|
+
...acc,
|
|
64
|
+
...feedbackForReturnQuestion({ feedback, returnQuestion: childReturnQuestion, translate, acc }),
|
|
65
|
+
],
|
|
66
|
+
[] as string[],
|
|
67
|
+
)) ||
|
|
68
|
+
[]
|
|
61
69
|
);
|
|
62
70
|
};
|
|
63
71
|
|
|
@@ -84,9 +92,9 @@ const deepestReturnQuestionWithFeedbackForReturnQuestion: RecursiveDeepestReturn
|
|
|
84
92
|
const returnQuestionFeedback = feedback[returnQuestionId];
|
|
85
93
|
|
|
86
94
|
if (isUuid(returnQuestionFeedback as string)) {
|
|
87
|
-
const feebackReturnQuestionChild =
|
|
88
|
-
(
|
|
89
|
-
|
|
95
|
+
const feebackReturnQuestionChild =
|
|
96
|
+
returnQuestionHasChildren(returnQuestion) &&
|
|
97
|
+
returnQuestion.children?.find((childReturnQuestion) => childReturnQuestion.id === returnQuestionFeedback);
|
|
90
98
|
|
|
91
99
|
if (feebackReturnQuestionChild) {
|
|
92
100
|
return deepestReturnQuestionWithFeedbackForReturnQuestion({
|
|
@@ -102,9 +110,11 @@ const deepestReturnQuestionWithFeedbackForReturnQuestion: RecursiveDeepestReturn
|
|
|
102
110
|
return [returnQuestion, false];
|
|
103
111
|
}
|
|
104
112
|
|
|
105
|
-
const feebackReturnQuestionChild =
|
|
106
|
-
|
|
107
|
-
|
|
113
|
+
const feebackReturnQuestionChild =
|
|
114
|
+
returnQuestionHasChildren(returnQuestion) &&
|
|
115
|
+
returnQuestion.children?.find((childReturnQuestion) =>
|
|
116
|
+
Object.keys(feedback).find((id) => id === childReturnQuestion.id),
|
|
117
|
+
);
|
|
108
118
|
|
|
109
119
|
if (feebackReturnQuestionChild) {
|
|
110
120
|
return deepestReturnQuestionWithFeedbackForReturnQuestion({
|
|
@@ -114,7 +124,11 @@ const deepestReturnQuestionWithFeedbackForReturnQuestion: RecursiveDeepestReturn
|
|
|
114
124
|
});
|
|
115
125
|
}
|
|
116
126
|
|
|
117
|
-
|
|
127
|
+
const hasChildren = Boolean(
|
|
128
|
+
returnQuestionHasChildren(returnQuestion) && returnQuestion.children && returnQuestion.children.length > 0,
|
|
129
|
+
);
|
|
130
|
+
|
|
131
|
+
return [deepestReturnQuestion, !hasChildren];
|
|
118
132
|
};
|
|
119
133
|
|
|
120
134
|
export { feedbackForReturnQuestion, deepestReturnQuestionWithFeedbackForReturnQuestion };
|
|
@@ -5,7 +5,6 @@ import { IntlProvider } from "react-intl";
|
|
|
5
5
|
import { Aurora } from "@lookiero/aurora";
|
|
6
6
|
import { TranslationMessages } from "@lookiero/i18n/domain/translation/model/translationMessages";
|
|
7
7
|
import { Logger, LoggerProvider } from "@lookiero/sty-psp-logging";
|
|
8
|
-
import { EnvironmentStyleProvider } from "@lookiero/sty-psp-ui";
|
|
9
8
|
import { BasePathProvider } from "../routing/useBasePath";
|
|
10
9
|
|
|
11
10
|
interface RenderArgs {
|
|
@@ -28,9 +27,7 @@ const renderWrapper: RenderWrapperFunction =
|
|
|
28
27
|
<IntlProvider locale={locale as string} messages={messages} onError={() => void 0}>
|
|
29
28
|
<LoggerProvider logger={logger}>
|
|
30
29
|
<BasePathProvider basePath="">
|
|
31
|
-
<
|
|
32
|
-
<Wrapper>{children}</Wrapper>
|
|
33
|
-
</EnvironmentStyleProvider>
|
|
30
|
+
<Wrapper>{children}</Wrapper>
|
|
34
31
|
</BasePathProvider>
|
|
35
32
|
</LoggerProvider>
|
|
36
33
|
</IntlProvider>
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import { PortalProvider } from "@gorhom/portal";
|
|
2
2
|
import React, { FC } 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
|
|
|
11
10
|
const { colorBgBase } = theme();
|
|
12
11
|
|
|
@@ -14,26 +13,20 @@ interface AppProps {
|
|
|
14
13
|
readonly children: JSX.Element;
|
|
15
14
|
}
|
|
16
15
|
|
|
17
|
-
const App: FC<AppProps> = ({ children }) =>
|
|
18
|
-
|
|
16
|
+
const App: FC<AppProps> = ({ children }) => (
|
|
17
|
+
<SafeAreaProvider>
|
|
18
|
+
<PortalProvider>
|
|
19
|
+
<StatusBar backgroundColor={colorBgBase} barStyle="dark-content" translucent />
|
|
20
|
+
<Notifications contextId={MESSAGING_CONTEXT_ID} />
|
|
21
|
+
{/*
|
|
22
|
+
We are using the Aurora's PortalProvider at this level for notifications to work properly.
|
|
19
23
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
We are using the Aurora's PortalProvider at this level for notifications to work properly.
|
|
28
|
-
|
|
29
|
-
PaymentInstrumentSelect uses Aurora's Portal, and if we rely on UAF's Portal (injected by <Aurora>)
|
|
30
|
-
notifications would be displayed in a layer below Portal's one (not visible).
|
|
31
|
-
*/}
|
|
32
|
-
<AuroraPortalProvider>{children}</AuroraPortalProvider>
|
|
33
|
-
</PortalProvider>
|
|
34
|
-
</SafeAreaProvider>
|
|
35
|
-
</View>
|
|
36
|
-
);
|
|
37
|
-
};
|
|
24
|
+
PaymentInstrumentSelect uses Aurora's Portal, and if we rely on UAF's Portal (injected by <Aurora>)
|
|
25
|
+
notifications would be displayed in a layer below Portal's one (not visible).
|
|
26
|
+
*/}
|
|
27
|
+
<AuroraPortalProvider>{children}</AuroraPortalProvider>
|
|
28
|
+
</PortalProvider>
|
|
29
|
+
</SafeAreaProvider>
|
|
30
|
+
);
|
|
38
31
|
|
|
39
32
|
export { App };
|
package/src/infrastructure/ui/views/item/components/getOutOfCheckoutModal/GetOutOfCheckoutModal.tsx
CHANGED
|
@@ -2,7 +2,7 @@ import React, { FC } 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
|
|
|
@@ -12,7 +12,6 @@ interface GetOutOfCheckoutModalProps {
|
|
|
12
12
|
readonly onConfirm: () => void;
|
|
13
13
|
}
|
|
14
14
|
const GetOutOfCheckoutModal: FC<GetOutOfCheckoutModalProps> = ({ visible, onDismiss, onConfirm }) => {
|
|
15
|
-
const { modal } = useEnvironmentStyle();
|
|
16
15
|
const titleText = useI18nMessage({ id: I18nMessages.GET_OUT_OF_CHECKOUT_MODAL_TITLE });
|
|
17
16
|
const descriptionText = useI18nMessage({ id: I18nMessages.GET_OUT_OF_CHECKOUT_MODAL_DESCRIPTION });
|
|
18
17
|
const dismissButtonText = useI18nMessage({ id: I18nMessages.GET_OUT_OF_CHECKOUT_MODAL_DISMISS_BUTTON });
|
|
@@ -20,7 +19,7 @@ const GetOutOfCheckoutModal: FC<GetOutOfCheckoutModalProps> = ({ visible, onDism
|
|
|
20
19
|
|
|
21
20
|
return (
|
|
22
21
|
<Modal visible={visible} onClose={onDismiss}>
|
|
23
|
-
<View style={
|
|
22
|
+
<View style={style.modalContent}>
|
|
24
23
|
<Text align={ALIGN.CENTER} level={1} style={style.title}>
|
|
25
24
|
{titleText}
|
|
26
25
|
</Text>
|
|
@@ -76,6 +76,7 @@ exports[`GetOutOfCheckoutModal component matches the snapshot 1`] = `
|
|
|
76
76
|
"zIndex": 1,
|
|
77
77
|
}
|
|
78
78
|
}
|
|
79
|
+
testID="modal-close-button"
|
|
79
80
|
/>
|
|
80
81
|
<View
|
|
81
82
|
pointerEvents="box-none"
|
|
@@ -132,6 +133,12 @@ exports[`GetOutOfCheckoutModal component matches the snapshot 1`] = `
|
|
|
132
133
|
}
|
|
133
134
|
>
|
|
134
135
|
<View
|
|
136
|
+
contentInset={
|
|
137
|
+
{
|
|
138
|
+
"bottom": 0,
|
|
139
|
+
"top": 0,
|
|
140
|
+
}
|
|
141
|
+
}
|
|
135
142
|
keyboardShouldPersistTaps="handled"
|
|
136
143
|
showsVerticalScrollIndicator={false}
|
|
137
144
|
>
|
|
@@ -144,12 +151,9 @@ exports[`GetOutOfCheckoutModal component matches the snapshot 1`] = `
|
|
|
144
151
|
>
|
|
145
152
|
<View
|
|
146
153
|
style={
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
},
|
|
151
|
-
undefined,
|
|
152
|
-
]
|
|
154
|
+
{
|
|
155
|
+
"paddingHorizontal": 24,
|
|
156
|
+
}
|
|
153
157
|
}
|
|
154
158
|
>
|
|
155
159
|
<Text
|
|
@@ -2,10 +2,8 @@ import React, { FC } 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 {
|
|
6
|
-
|
|
7
|
-
ReturnQuestionType,
|
|
8
|
-
} from "../../../../../../projection/returnQuestion/returnQuestion";
|
|
5
|
+
import { ReturnQuestionProjection } from "../../../../../../projection/returnQuestion/returnQuestion";
|
|
6
|
+
import { ReturnQuestionType } from "../../../../../../projection/returnQuestion/returnQuestion.constants";
|
|
9
7
|
import { ReturnQuestions } from "../../../../components/organisms/returnQuestions/ReturnQuestions";
|
|
10
8
|
import {
|
|
11
9
|
ReturnQuestionItemProvider,
|
|
@@ -1,11 +1,17 @@
|
|
|
1
1
|
import React, { FC, useCallback } from "react";
|
|
2
|
-
import { TouchableHighlight, View } from "react-native";
|
|
2
|
+
import { StyleProp, TextStyle, TouchableHighlight, View, ViewStyle } 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
|
|
|
7
7
|
const { colorBgPrimaryLight } = theme();
|
|
8
8
|
|
|
9
|
+
interface SelectModalStyle {
|
|
10
|
+
readonly modalContent: StyleProp<ViewStyle>;
|
|
11
|
+
readonly option: StyleProp<ViewStyle>;
|
|
12
|
+
readonly optionText: StyleProp<TextStyle>;
|
|
13
|
+
}
|
|
14
|
+
|
|
9
15
|
interface Option {
|
|
10
16
|
readonly label: string;
|
|
11
17
|
readonly value: string;
|
|
@@ -15,22 +21,23 @@ interface SelectModalProps {
|
|
|
15
21
|
readonly title?: string;
|
|
16
22
|
readonly value: string | undefined;
|
|
17
23
|
readonly options: Option[];
|
|
18
|
-
readonly
|
|
19
|
-
readonly testID?: string;
|
|
24
|
+
readonly style?: Partial<SelectModalStyle>;
|
|
20
25
|
readonly onChange?: (value: string) => void;
|
|
21
26
|
readonly onClose?: () => void;
|
|
27
|
+
readonly modalVisible: boolean;
|
|
28
|
+
readonly testID?: string;
|
|
22
29
|
}
|
|
23
30
|
|
|
24
31
|
const SelectModal: FC<SelectModalProps> = ({
|
|
25
32
|
modalVisible,
|
|
33
|
+
onChange = () => void 0,
|
|
34
|
+
onClose = () => void 0,
|
|
26
35
|
options,
|
|
36
|
+
style: customStyle,
|
|
27
37
|
testID,
|
|
28
38
|
title,
|
|
29
39
|
value,
|
|
30
|
-
onChange = () => void 0,
|
|
31
|
-
onClose = () => void 0,
|
|
32
40
|
}) => {
|
|
33
|
-
const { modal } = useEnvironmentStyle();
|
|
34
41
|
const handleOnPressOption = useCallback(
|
|
35
42
|
(value: string) => {
|
|
36
43
|
onChange(value);
|
|
@@ -41,7 +48,7 @@ const SelectModal: FC<SelectModalProps> = ({
|
|
|
41
48
|
|
|
42
49
|
return (
|
|
43
50
|
<Modal testID={testID} visible={modalVisible} scroll showCloseButton onClose={onClose}>
|
|
44
|
-
<View style={[style.
|
|
51
|
+
<View style={[style.modalContent, customStyle?.modalContent]}>
|
|
45
52
|
{title && (
|
|
46
53
|
<Text level={3} style={style.modalTitle} heading>
|
|
47
54
|
{title}
|
|
@@ -52,13 +59,17 @@ const SelectModal: FC<SelectModalProps> = ({
|
|
|
52
59
|
key={optionValue}
|
|
53
60
|
accessibilityLabel={optionValue}
|
|
54
61
|
disabled={value === optionValue}
|
|
55
|
-
style={style.option}
|
|
62
|
+
style={[style.option, customStyle?.option]}
|
|
56
63
|
testID={optionValue}
|
|
57
64
|
underlayColor={colorBgPrimaryLight}
|
|
58
65
|
accessible
|
|
59
66
|
onPress={value !== optionValue ? () => handleOnPressOption(optionValue) : undefined}
|
|
60
67
|
>
|
|
61
|
-
<Text
|
|
68
|
+
<Text
|
|
69
|
+
color={value === optionValue ? COLOR.TEXT_MEDIUM : COLOR.TEXT}
|
|
70
|
+
level={3}
|
|
71
|
+
style={[style.optionText as ViewStyle, customStyle?.optionText]}
|
|
72
|
+
>
|
|
62
73
|
{label}
|
|
63
74
|
</Text>
|
|
64
75
|
</TouchableHighlight>
|