@lookiero/checkout 8.14.0-beta.2 → 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 +0 -2
- package/dist/src/infrastructure/ui/Root.js +2 -2
- package/dist/src/infrastructure/ui/components/organisms/returnQuestions/ReturnQuestion.d.ts +0 -5
- package/dist/src/infrastructure/ui/components/organisms/returnQuestions/ReturnQuestion.js +5 -3
- package/dist/src/infrastructure/ui/components/organisms/returnQuestions/ReturnQuestions.d.ts +0 -5
- package/dist/src/infrastructure/ui/components/organisms/returnQuestions/ReturnQuestions.js +1 -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 -8
- 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 -3
- 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 +2 -1
- 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 +7 -5
- package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/modalOptionReturnQuestionItems/ModalOptionReturnQuestionItems.d.ts +1 -3
- package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/modalOptionReturnQuestionItems/ModalOptionReturnQuestionItems.js +6 -4
- 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 +6 -5
- 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/routing/Routing.d.ts +0 -7
- package/dist/src/infrastructure/ui/routing/Routing.js +5 -5
- package/dist/src/infrastructure/ui/views/App.d.ts +0 -8
- package/dist/src/infrastructure/ui/views/App.js +6 -8
- package/dist/src/infrastructure/ui/views/item/Item.d.ts +0 -5
- package/dist/src/infrastructure/ui/views/item/Item.js +3 -3
- package/dist/src/infrastructure/ui/views/item/components/getOutOfCheckoutModal/GetOutOfCheckoutModal.d.ts +0 -2
- package/dist/src/infrastructure/ui/views/item/components/getOutOfCheckoutModal/GetOutOfCheckoutModal.js +2 -2
- 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/itemActions/ItemActions.d.ts +1 -5
- package/dist/src/infrastructure/ui/views/item/components/itemActions/ItemActions.js +2 -2
- package/dist/src/infrastructure/ui/views/item/components/returnQuestionsFeedback/ReturnQuestionsFeedback.d.ts +0 -5
- package/dist/src/infrastructure/ui/views/item/components/returnQuestionsFeedback/ReturnQuestionsFeedback.js +3 -3
- package/dist/src/infrastructure/ui/views/item/components/selectModal/SelectModal.d.ts +3 -3
- package/dist/src/infrastructure/ui/views/item/components/selectModal/SelectModal.js +2 -2
- 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.d.ts +0 -2
- package/dist/src/infrastructure/ui/views/item/components/sizeWithoutStockModal/SizeWithoutStockModal.js +2 -2
- package/dist/src/infrastructure/ui/views/item/views/itemWithCustomerDecission/ItemWithCustomerDecission.d.ts +0 -5
- package/dist/src/infrastructure/ui/views/item/views/itemWithCustomerDecission/ItemWithCustomerDecission.js +2 -2
- package/dist/src/infrastructure/ui/views/item/views/itemWithoutCustomerDecission/ItemWithoutCustomerDecission.d.ts +0 -5
- package/dist/src/infrastructure/ui/views/item/views/itemWithoutCustomerDecission/ItemWithoutCustomerDecission.js +2 -2
- package/dist/src/infrastructure/ui/views/return/Return.d.ts +0 -5
- package/dist/src/infrastructure/ui/views/return/Return.js +2 -2
- package/dist/src/infrastructure/ui/views/return/components/returnQuestionsForm/ReturnQuestionsForm.d.ts +0 -5
- package/dist/src/infrastructure/ui/views/return/components/returnQuestionsForm/ReturnQuestionsForm.js +15 -13
- package/dist/src/infrastructure/ui/views/return/components/returnQuestionsForm/ReturnQuestionsForm.style.d.ts +6 -2
- package/dist/src/infrastructure/ui/views/return/components/returnQuestionsForm/ReturnQuestionsForm.style.js +6 -2
- 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 +9 -8
- 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 +1 -4
- package/src/infrastructure/ui/components/organisms/returnQuestions/ReturnQuestion.test.tsx +10 -12
- package/src/infrastructure/ui/components/organisms/returnQuestions/ReturnQuestion.tsx +11 -22
- package/src/infrastructure/ui/components/organisms/returnQuestions/ReturnQuestions.test.tsx +10 -9
- package/src/infrastructure/ui/components/organisms/returnQuestions/ReturnQuestions.tsx +1 -8
- 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 -9
- 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 +8 -7
- package/src/infrastructure/ui/components/organisms/returnQuestions/components/hostStackReturnQuestionItem/form/HostStackReturnQuestionItem.tsx +5 -5
- 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 -9
- package/src/infrastructure/ui/components/organisms/returnQuestions/components/modalOptionReturnQuestionItems/ModalOptionReturnQuestionItems.tsx +13 -14
- 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 +8 -7
- 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/routing/Routing.tsx +5 -13
- package/src/infrastructure/ui/views/App.tsx +11 -21
- package/src/infrastructure/ui/views/item/Item.tsx +2 -8
- package/src/infrastructure/ui/views/item/components/getOutOfCheckoutModal/GetOutOfCheckoutModal.style.ts +1 -1
- package/src/infrastructure/ui/views/item/components/getOutOfCheckoutModal/GetOutOfCheckoutModal.tsx +3 -9
- package/src/infrastructure/ui/views/item/components/getOutOfCheckoutModal/__snapshots__/GetOutOfCheckoutModal.test.tsx.snap +7 -0
- package/src/infrastructure/ui/views/item/components/itemActions/ItemActions.tsx +1 -8
- package/src/infrastructure/ui/views/item/components/returnQuestionsFeedback/ReturnQuestionsFeedback.tsx +5 -16
- package/src/infrastructure/ui/views/item/components/selectModal/SelectModal.style.ts +1 -1
- package/src/infrastructure/ui/views/item/components/selectModal/SelectModal.tsx +6 -6
- package/src/infrastructure/ui/views/item/components/selectModal/__snapshots__/SelecModal.test.tsx.snap +7 -0
- package/src/infrastructure/ui/views/item/components/sizeWithoutStockModal/SizeWithoutStockModal.tsx +3 -4
- package/src/infrastructure/ui/views/item/components/sizeWithoutStockModal/__snapshots__/SizeWithoutStockModal.test.tsx.snap +7 -0
- package/src/infrastructure/ui/views/item/views/itemWithCustomerDecission/ItemWithCustomerDecission.tsx +2 -12
- package/src/infrastructure/ui/views/item/views/itemWithoutCustomerDecission/ItemWithoutCustomerDecission.tsx +4 -14
- package/src/infrastructure/ui/views/return/Return.tsx +1 -8
- package/src/infrastructure/ui/views/return/components/returnQuestionsForm/ReturnQuestionsForm.style.ts +6 -2
- package/src/infrastructure/ui/views/return/components/returnQuestionsForm/ReturnQuestionsForm.tsx +39 -34
- 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/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/views/App.style.d.ts +0 -6
- package/dist/src/infrastructure/ui/views/App.style.js +0 -7
- 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,15 +1,11 @@
|
|
|
1
1
|
import { FC } from "react";
|
|
2
|
-
import { LayoutRectangle
|
|
2
|
+
import { LayoutRectangle } from "react-native";
|
|
3
3
|
import { Country } from "@lookiero/sty-psp-locale";
|
|
4
4
|
import { ProductVariantProjection } from "../../../../../../projection/bookedProductsVariants/bookedProductsVariants";
|
|
5
|
-
interface ItemActionsStyle {
|
|
6
|
-
readonly modal: StyleProp<ViewStyle>;
|
|
7
|
-
}
|
|
8
5
|
interface ItemActionsProps {
|
|
9
6
|
readonly productVariants?: ProductVariantProjection[];
|
|
10
7
|
readonly currentProductVariant: ProductVariantProjection;
|
|
11
8
|
readonly country: Country;
|
|
12
|
-
readonly style?: Partial<ItemActionsStyle>;
|
|
13
9
|
readonly onShowSizeWithoutStockModal?: () => void;
|
|
14
10
|
readonly onKeep: () => void;
|
|
15
11
|
readonly onReturn: () => void;
|
|
@@ -8,7 +8,7 @@ import { Body } from "../../../../components/layouts/body/Body";
|
|
|
8
8
|
import { I18nMessages } from "../../../../i18n/i18n";
|
|
9
9
|
import { SelectModal } from "../selectModal/SelectModal";
|
|
10
10
|
import { style } from "./ItemActions.style";
|
|
11
|
-
const ItemActions = ({ productVariants, currentProductVariant, country,
|
|
11
|
+
const ItemActions = ({ productVariants, currentProductVariant, country, onShowSizeWithoutStockModal = () => void 0, onKeep, onReplace, onReturn, onLayout, }) => {
|
|
12
12
|
const [modalVisible, setModalVisible] = useState(false);
|
|
13
13
|
const changeSizeButtonText = useI18nMessage({ id: I18nMessages.ITEM_CHANGE_SIZE_BUTTON });
|
|
14
14
|
const keepButtonText = useI18nMessage({ id: I18nMessages.ITEM_KEEP_BUTTON });
|
|
@@ -34,6 +34,6 @@ const ItemActions = ({ productVariants, currentProductVariant, country, style: c
|
|
|
34
34
|
!currentProductVariant.size.unique && productVariants ? (React.createElement(Button, { style: style.sizeSelector, testID: "size-selector", variant: BUTTON_VARIANT.SECONDARY, small: true, onPress: handleOnPressSelectField }, changeSizeButtonText)) : null,
|
|
35
35
|
React.createElement(Button, { style: style.returnButton, testID: "return-button", variant: BUTTON_VARIANT.SECONDARY, small: true, onPress: onReturn }, returnButtonText)),
|
|
36
36
|
React.createElement(Button, { testID: "keep-button", small: true, onPress: onKeep }, keepButtonText)),
|
|
37
|
-
React.createElement(SelectModal, { modalVisible: modalVisible, options: sizeSelectorOptions,
|
|
37
|
+
React.createElement(SelectModal, { modalVisible: modalVisible, options: sizeSelectorOptions, testID: "select-field-modal", title: changeSizeButtonText, value: currentProductVariant.id, onChange: onReplace, onClose: handleOnModalClose })));
|
|
38
38
|
};
|
|
39
39
|
export { ItemActions };
|
|
@@ -1,12 +1,7 @@
|
|
|
1
1
|
import { FC } from "react";
|
|
2
|
-
import { StyleProp, ViewStyle } from "react-native";
|
|
3
2
|
import { ReturnQuestionProjection } from "../../../../../../projection/returnQuestion/returnQuestion";
|
|
4
|
-
interface ReturnQuestionsFeedbackStyle {
|
|
5
|
-
readonly modal: StyleProp<ViewStyle>;
|
|
6
|
-
}
|
|
7
3
|
interface ReturnQuestionsFeedbackProps {
|
|
8
4
|
readonly returnQuestions: ReturnQuestionProjection[];
|
|
9
|
-
readonly style?: Partial<ReturnQuestionsFeedbackStyle>;
|
|
10
5
|
readonly onEditFeedback: () => void;
|
|
11
6
|
}
|
|
12
7
|
declare const ReturnQuestionsFeedback: FC<ReturnQuestionsFeedbackProps>;
|
|
@@ -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";
|
|
@@ -17,13 +17,13 @@ const returnQuestionItems = {
|
|
|
17
17
|
[ReturnQuestionType.TEXTAREA]: ReturnQuestionFeedbackItem,
|
|
18
18
|
[ReturnQuestionType.OPTION]: ReturnQuestionFeedbackItem,
|
|
19
19
|
};
|
|
20
|
-
const ReturnQuestionsFeedback = ({ returnQuestions,
|
|
20
|
+
const ReturnQuestionsFeedback = ({ returnQuestions, onEditFeedback }) => {
|
|
21
21
|
const titleText = useI18nMessage({ id: I18nMessages.FEEDBACK_TITLE });
|
|
22
22
|
return (React.createElement(View, null,
|
|
23
23
|
React.createElement(View, { style: style.titleContainer },
|
|
24
24
|
React.createElement(Text, { level: 2 }, titleText),
|
|
25
25
|
React.createElement(ButtonIcon, { name: "pencil", testID: "edit-feedback", onPress: onEditFeedback })),
|
|
26
26
|
React.createElement(ReturnQuestionItemProvider, { returnQuestionItems: returnQuestionItems },
|
|
27
|
-
React.createElement(ReturnQuestions, { returnQuestions: returnQuestions
|
|
27
|
+
React.createElement(ReturnQuestions, { returnQuestions: returnQuestions }))));
|
|
28
28
|
};
|
|
29
29
|
export { ReturnQuestionsFeedback };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { FC } from "react";
|
|
2
2
|
import { StyleProp, TextStyle, ViewStyle } from "react-native";
|
|
3
3
|
interface SelectModalStyle {
|
|
4
|
-
readonly
|
|
4
|
+
readonly modalContent: StyleProp<ViewStyle>;
|
|
5
5
|
readonly option: StyleProp<ViewStyle>;
|
|
6
6
|
readonly optionText: StyleProp<TextStyle>;
|
|
7
7
|
}
|
|
@@ -14,10 +14,10 @@ interface SelectModalProps {
|
|
|
14
14
|
readonly value: string | undefined;
|
|
15
15
|
readonly options: Option[];
|
|
16
16
|
readonly style?: Partial<SelectModalStyle>;
|
|
17
|
-
readonly modalVisible: boolean;
|
|
18
|
-
readonly testID?: string;
|
|
19
17
|
readonly onChange?: (value: string) => void;
|
|
20
18
|
readonly onClose?: () => void;
|
|
19
|
+
readonly modalVisible: boolean;
|
|
20
|
+
readonly testID?: string;
|
|
21
21
|
}
|
|
22
22
|
declare const SelectModal: FC<SelectModalProps>;
|
|
23
23
|
export type { Option };
|
|
@@ -4,13 +4,13 @@ import { COLOR, Text } from "@lookiero/aurora";
|
|
|
4
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,
|
|
7
|
+
const SelectModal = ({ modalVisible, onChange = () => void 0, onClose = () => void 0, options, style: customStyle, testID, title, value, }) => {
|
|
8
8
|
const handleOnPressOption = useCallback((value) => {
|
|
9
9
|
onChange(value);
|
|
10
10
|
onClose();
|
|
11
11
|
}, [onClose, onChange]);
|
|
12
12
|
return (React.createElement(Modal, { testID: testID, visible: modalVisible, scroll: true, showCloseButton: true, onClose: onClose },
|
|
13
|
-
React.createElement(View, { style: [style.
|
|
13
|
+
React.createElement(View, { style: [style.modalContent, customStyle?.modalContent] },
|
|
14
14
|
title && (React.createElement(Text, { level: 3, style: style.modalTitle, heading: true }, title)),
|
|
15
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
16
|
React.createElement(Text, { color: value === optionValue ? COLOR.TEXT_MEDIUM : COLOR.TEXT, level: 3, style: [style.optionText, customStyle?.optionText] }, label)))))));
|
|
@@ -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
|
},
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import { FC } from "react";
|
|
2
|
-
import { StyleProp, ViewStyle } from "react-native";
|
|
3
2
|
interface SizeWithoutStockModalProps {
|
|
4
3
|
readonly visible: boolean;
|
|
5
|
-
readonly style?: StyleProp<ViewStyle>;
|
|
6
4
|
readonly onDismiss: () => void;
|
|
7
5
|
}
|
|
8
6
|
declare const SizeWithoutStockModal: FC<SizeWithoutStockModalProps>;
|
|
@@ -5,12 +5,12 @@ import { useI18nMessage } from "@lookiero/i18n-react";
|
|
|
5
5
|
import { Modal } from "@lookiero/sty-psp-ui";
|
|
6
6
|
import { I18nMessages } from "../../../../i18n/i18n";
|
|
7
7
|
import { style } from "./SizeWithoutStockModal.style";
|
|
8
|
-
const SizeWithoutStockModal = ({ visible,
|
|
8
|
+
const SizeWithoutStockModal = ({ visible, onDismiss }) => {
|
|
9
9
|
const titleText = useI18nMessage({ id: I18nMessages.SIZE_WITHOUT_STOCK_MODAL_TITLE });
|
|
10
10
|
const descriptionText = useI18nMessage({ id: I18nMessages.SIZE_WITHOUT_STOCK_MODAL_DESCRIPTION });
|
|
11
11
|
const buttonText = useI18nMessage({ id: I18nMessages.SIZE_WITHOUT_STOCK_MODAL_BUTTON });
|
|
12
12
|
return (React.createElement(Modal, { visible: visible, showCloseButton: true, onClose: onDismiss },
|
|
13
|
-
React.createElement(View, { style:
|
|
13
|
+
React.createElement(View, { style: style.modalContent },
|
|
14
14
|
React.createElement(Text, { level: 3, style: style.title, heading: true }, titleText),
|
|
15
15
|
React.createElement(Text, { level: 3, style: style.description }, descriptionText),
|
|
16
16
|
React.createElement(Button, { onPress: onDismiss }, buttonText))));
|
|
@@ -1,12 +1,8 @@
|
|
|
1
1
|
import { FC } from "react";
|
|
2
|
-
import { StyleProp, ViewStyle } from "react-native";
|
|
3
2
|
import { CheckoutItemStatus } from "../../../../../../domain/checkoutItem/model/checkoutItem";
|
|
4
3
|
import { ProductVariantProjection } from "../../../../../../projection/bookedProductsVariants/bookedProductsVariants";
|
|
5
4
|
import { CheckoutItemProjection } from "../../../../../../projection/checkoutItem/checkoutItem";
|
|
6
5
|
import { ReturnQuestionProjection } from "../../../../../../projection/returnQuestion/returnQuestion";
|
|
7
|
-
interface ItemWithCustomerDecissionStyle {
|
|
8
|
-
readonly modal: StyleProp<ViewStyle>;
|
|
9
|
-
}
|
|
10
6
|
interface CheckoutItemWithCustomerDecission extends CheckoutItemProjection {
|
|
11
7
|
readonly status: Exclude<CheckoutItemStatus, CheckoutItemStatus.INITIAL>;
|
|
12
8
|
}
|
|
@@ -15,7 +11,6 @@ interface ItemWithCustomerDecissionProps {
|
|
|
15
11
|
readonly checkoutItem: CheckoutItemWithCustomerDecission;
|
|
16
12
|
readonly returnQuestions: ReturnQuestionProjection[];
|
|
17
13
|
readonly currentProductVariant: ProductVariantProjection;
|
|
18
|
-
readonly style?: Partial<ItemWithCustomerDecissionStyle>;
|
|
19
14
|
readonly onEditFeedback: () => void;
|
|
20
15
|
}
|
|
21
16
|
declare const ItemWithCustomerDecission: FC<ItemWithCustomerDecissionProps>;
|
|
@@ -14,7 +14,7 @@ import { CustomerDecissionBanner, } from "../../components/banner/CustomerDeciss
|
|
|
14
14
|
import { ReturnQuestionsFeedback } from "../../components/returnQuestionsFeedback/ReturnQuestionsFeedback";
|
|
15
15
|
import { ProductVariant } from "../../views/productVariant/ProductVariant";
|
|
16
16
|
import { style } from "./ItemWithCustomerDecission.style";
|
|
17
|
-
const ItemWithCustomerDecission = ({ checkoutId, checkoutItem, returnQuestions, currentProductVariant,
|
|
17
|
+
const ItemWithCustomerDecission = ({ checkoutId, checkoutItem, returnQuestions, currentProductVariant, onEditFeedback, }) => {
|
|
18
18
|
const screenSize = useScreenSize();
|
|
19
19
|
const isMobile = screenSize === "S";
|
|
20
20
|
const logger = useLogger();
|
|
@@ -42,6 +42,6 @@ const ItemWithCustomerDecission = ({ checkoutId, checkoutItem, returnQuestions,
|
|
|
42
42
|
}
|
|
43
43
|
return (React.createElement(Body, { style: { row: style.container } },
|
|
44
44
|
React.createElement(ProductVariant, { checkoutId: checkoutId, checkoutItem: checkoutItem, country: country, currentProductVariant: currentProductVariant, segment: segment, customerDecissionBanner: React.createElement(CustomerDecissionBanner, { checkoutItemStatus: checkoutItem.status, onPress: resetItem }) }, checkoutItem.status === CheckoutItemStatus.RETURNED && (React.createElement(View, { style: [style.feedbackContainer, isMobile ? style.feedbackContainerMobile : undefined] },
|
|
45
|
-
React.createElement(ReturnQuestionsFeedback, { returnQuestions: returnQuestions,
|
|
45
|
+
React.createElement(ReturnQuestionsFeedback, { returnQuestions: returnQuestions, onEditFeedback: onEditFeedback }))))));
|
|
46
46
|
};
|
|
47
47
|
export { ItemWithCustomerDecission };
|
|
@@ -1,12 +1,8 @@
|
|
|
1
1
|
import { FC } from "react";
|
|
2
|
-
import { StyleProp, ViewStyle } from "react-native";
|
|
3
2
|
import { CheckoutItemStatus } from "../../../../../../domain/checkoutItem/model/checkoutItem";
|
|
4
3
|
import { BookedProductsVariantsProjection, ProductVariantProjection } from "../../../../../../projection/bookedProductsVariants/bookedProductsVariants";
|
|
5
4
|
import "../../../../../../projection/checkout/viewFirstAvailableCheckoutByCustomerId";
|
|
6
5
|
import { CheckoutItemProjection } from "../../../../../../projection/checkoutItem/checkoutItem";
|
|
7
|
-
interface ItemWithoutCustomerDecissionStyle {
|
|
8
|
-
readonly modal: StyleProp<ViewStyle>;
|
|
9
|
-
}
|
|
10
6
|
interface CheckoutItemWithoutCustomerDecission extends CheckoutItemProjection {
|
|
11
7
|
readonly status: CheckoutItemStatus.INITIAL;
|
|
12
8
|
}
|
|
@@ -15,7 +11,6 @@ interface ItemWithoutCustomerDecissionProps {
|
|
|
15
11
|
readonly checkoutItem: CheckoutItemWithoutCustomerDecission;
|
|
16
12
|
readonly bookedProductsVariants: BookedProductsVariantsProjection;
|
|
17
13
|
readonly currentProductVariant: ProductVariantProjection;
|
|
18
|
-
readonly style?: Partial<ItemWithoutCustomerDecissionStyle>;
|
|
19
14
|
readonly onReturn: () => void;
|
|
20
15
|
}
|
|
21
16
|
declare const ItemWithoutCustomerDecission: FC<ItemWithoutCustomerDecissionProps>;
|
|
@@ -17,7 +17,7 @@ import { SizeWithoutStockModal } from "../../components/sizeWithoutStockModal/Si
|
|
|
17
17
|
import { ProductVariant } from "../productVariant/ProductVariant";
|
|
18
18
|
import { style } from "./ItemWithoutCustomerDecission.style";
|
|
19
19
|
const { space6 } = theme();
|
|
20
|
-
const ItemWithoutCustomerDecission = ({ checkoutId, checkoutItem, bookedProductsVariants, currentProductVariant,
|
|
20
|
+
const ItemWithoutCustomerDecission = ({ checkoutId, checkoutItem, bookedProductsVariants, currentProductVariant, onReturn, }) => {
|
|
21
21
|
const logger = useLogger();
|
|
22
22
|
const { customer: { country, segment }, } = useStaticInfo();
|
|
23
23
|
/* KeepCheckoutItem */
|
|
@@ -62,7 +62,7 @@ const ItemWithoutCustomerDecission = ({ checkoutId, checkoutItem, bookedProducts
|
|
|
62
62
|
return React.createElement(Spinner, { testID: "spinner" });
|
|
63
63
|
}
|
|
64
64
|
return (React.createElement(React.Fragment, null,
|
|
65
|
-
React.createElement(SizeWithoutStockModal, {
|
|
65
|
+
React.createElement(SizeWithoutStockModal, { visible: sizeWithoutStockModalVisible, onDismiss: handleOnHideSizeWithoutStockModal }),
|
|
66
66
|
React.createElement(ScrollView, { showsVerticalScrollIndicator: false },
|
|
67
67
|
React.createElement(Body, { style: { row: style.container } },
|
|
68
68
|
React.createElement(ProductVariant, { checkoutId: checkoutId, checkoutItem: checkoutItem, country: country, currentProductVariant: currentProductVariant, segment: segment, style: { content: { paddingBottom: Platform.OS === "web" ? space6 : stickyHeight } } }))),
|
|
@@ -1,12 +1,7 @@
|
|
|
1
1
|
import { FC } from "react";
|
|
2
|
-
import { StyleProp, ViewStyle } from "react-native";
|
|
3
2
|
import { Layout as UiLayout } from "@lookiero/sty-psp-ui";
|
|
4
|
-
interface ReturnStyle {
|
|
5
|
-
readonly modal: StyleProp<ViewStyle>;
|
|
6
|
-
}
|
|
7
3
|
interface ReturnProps {
|
|
8
4
|
readonly layout: UiLayout;
|
|
9
|
-
readonly style?: Partial<ReturnStyle>;
|
|
10
5
|
}
|
|
11
6
|
declare const Return: FC<ReturnProps>;
|
|
12
7
|
export { Return };
|
|
@@ -6,7 +6,7 @@ import { useViewFirstAvailableCheckoutByCustomerId } from "../../../projection/c
|
|
|
6
6
|
import { ReturnQuestionFeedbackProvider } from "../../components/organisms/returnQuestions/behaviors/useReturnQuestionFeedback";
|
|
7
7
|
import { useStaticInfo } from "../../hooks/useStaticInfo";
|
|
8
8
|
import { ReturnQuestionsForm } from "./components/returnQuestionsForm/ReturnQuestionsForm";
|
|
9
|
-
const Return = ({ layout
|
|
9
|
+
const Return = ({ layout }) => {
|
|
10
10
|
const { id } = useParams();
|
|
11
11
|
const { customer: { customerId, country, segment }, } = useStaticInfo();
|
|
12
12
|
const [checkout, checkoutStatus] = useViewFirstAvailableCheckoutByCustomerId({ customerId });
|
|
@@ -16,6 +16,6 @@ const Return = ({ layout, style: customStyle }) => {
|
|
|
16
16
|
return React.createElement(Spinner, null);
|
|
17
17
|
}
|
|
18
18
|
return (React.createElement(ReturnQuestionFeedbackProvider, { key: checkoutItem.id, feedback: checkoutItem.feedbacks || {} },
|
|
19
|
-
React.createElement(ReturnQuestionsForm, { checkout: checkout, checkoutItem: checkoutItem, country: country, layout: layout, segment: segment
|
|
19
|
+
React.createElement(ReturnQuestionsForm, { checkout: checkout, checkoutItem: checkoutItem, country: country, layout: layout, segment: segment })));
|
|
20
20
|
};
|
|
21
21
|
export { Return };
|
|
@@ -1,20 +1,15 @@
|
|
|
1
1
|
import { FC } from "react";
|
|
2
|
-
import { StyleProp, ViewStyle } from "react-native";
|
|
3
2
|
import { Country } from "@lookiero/sty-psp-locale";
|
|
4
3
|
import { Segment } from "@lookiero/sty-psp-segment";
|
|
5
4
|
import { Layout as UiLayout } from "@lookiero/sty-psp-ui";
|
|
6
5
|
import { CheckoutProjection } from "../../../../../../projection/checkout/checkout";
|
|
7
6
|
import { CheckoutItemProjection } from "../../../../../../projection/checkoutItem/checkoutItem";
|
|
8
|
-
interface ReturnQuestionsFormStyle {
|
|
9
|
-
readonly modal: StyleProp<ViewStyle>;
|
|
10
|
-
}
|
|
11
7
|
interface ReturnQuestionsFormProps {
|
|
12
8
|
readonly checkout: CheckoutProjection;
|
|
13
9
|
readonly checkoutItem: CheckoutItemProjection;
|
|
14
10
|
readonly country: Country;
|
|
15
11
|
readonly layout: UiLayout;
|
|
16
12
|
readonly segment: Segment;
|
|
17
|
-
readonly style?: Partial<ReturnQuestionsFormStyle>;
|
|
18
13
|
}
|
|
19
14
|
declare const ReturnQuestionsForm: FC<ReturnQuestionsFormProps>;
|
|
20
15
|
export { ReturnQuestionsForm };
|
|
@@ -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";
|
|
@@ -37,7 +38,7 @@ const returnQuestionItems = {
|
|
|
37
38
|
[ReturnQuestionType.TEXTAREA]: TextareaReturnQuestionItem,
|
|
38
39
|
[ReturnQuestionType.OPTION]: RadioReturnQuestionItem,
|
|
39
40
|
};
|
|
40
|
-
const ReturnQuestionsForm = ({ checkout, checkoutItem, country, layout: Layout, segment,
|
|
41
|
+
const ReturnQuestionsForm = ({ checkout, checkoutItem, country, layout: Layout, segment, }) => {
|
|
41
42
|
const navigate = useNavigate();
|
|
42
43
|
const basePath = useBasePath();
|
|
43
44
|
const logger = useLogger();
|
|
@@ -94,20 +95,21 @@ const ReturnQuestionsForm = ({ checkout, checkoutItem, country, layout: Layout,
|
|
|
94
95
|
}
|
|
95
96
|
return (React.createElement(ReturnQuestionItemProvider, { returnQuestionItems: returnQuestionItems },
|
|
96
97
|
React.createElement(PortalHost, { name: RETURN_QUESTION_FORM_PORTAL_HOST_NAME }),
|
|
97
|
-
React.createElement(Layout, { header: header, scrollEnabled: false, style: {
|
|
98
|
+
React.createElement(Layout, { footer: null, header: header, scrollEnabled: false, style: {
|
|
98
99
|
safeAreaView: style.safeAreaView,
|
|
99
100
|
scrollView: style.scrollView,
|
|
100
101
|
header: style.header,
|
|
101
102
|
} },
|
|
102
103
|
React.createElement(ProductVariantPreview, { country: country, item: checkoutItem }),
|
|
103
|
-
React.createElement(
|
|
104
|
-
React.createElement(
|
|
105
|
-
React.createElement(
|
|
106
|
-
React.createElement(
|
|
107
|
-
React.createElement(
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
React.createElement(
|
|
104
|
+
React.createElement(KeyboardAwareScrollView, { extraScrollHeight: Platform.OS === "android" ? 10 : 120, keyboardShouldPersistTaps: "handled", showsVerticalScrollIndicator: false, testID: "return-questions-form" },
|
|
105
|
+
React.createElement(View, { style: style.background },
|
|
106
|
+
React.createElement(AuroraLayout, { fullWidth: !screen.L, style: [style.layout, screen.L ? style.desktopLayoutSpacing : undefined] },
|
|
107
|
+
React.createElement(Box, { size: { L: "2/3" } },
|
|
108
|
+
React.createElement(View, { style: [style.info, !screen.S && style.desktopInfo] },
|
|
109
|
+
React.createElement(Text, { level: 3, heading: true }, titleText),
|
|
110
|
+
React.createElement(Text, { level: 1, style: style.description, detail: true }, descriptionText)),
|
|
111
|
+
React.createElement(ReturnQuestions, { portalHostName: RETURN_QUESTION_FORM_PORTAL_HOST_NAME, returnQuestions: returnQuestions }),
|
|
112
|
+
React.createElement(View, { style: [style.submit, !screen.S && style.submitDesktop] },
|
|
113
|
+
React.createElement(Button, { testID: "return-questions-button", onPress: handleOnSubmit }, submitButtonText)))))))));
|
|
112
114
|
};
|
|
113
115
|
export { ReturnQuestionsForm };
|
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
declare const style: {
|
|
2
|
+
background: {
|
|
3
|
+
backgroundColor: string;
|
|
4
|
+
};
|
|
2
5
|
description: {
|
|
3
6
|
color: string;
|
|
4
7
|
};
|
|
@@ -27,7 +30,6 @@ declare const style: {
|
|
|
27
30
|
justifyContent: "center";
|
|
28
31
|
};
|
|
29
32
|
safeAreaView: {
|
|
30
|
-
backgroundColor: string;
|
|
31
33
|
flex: number;
|
|
32
34
|
};
|
|
33
35
|
scrollView: {
|
|
@@ -35,9 +37,11 @@ declare const style: {
|
|
|
35
37
|
};
|
|
36
38
|
submit: {
|
|
37
39
|
backgroundColor: string;
|
|
40
|
+
padding: number;
|
|
41
|
+
};
|
|
42
|
+
submitDesktop: {
|
|
38
43
|
borderBottomLeftRadius: number;
|
|
39
44
|
borderBottomRightRadius: number;
|
|
40
|
-
padding: number;
|
|
41
45
|
};
|
|
42
46
|
};
|
|
43
47
|
export { style };
|
|
@@ -3,6 +3,9 @@ import { theme } from "@lookiero/sty-psp-ui";
|
|
|
3
3
|
import { HEADER_HEIGHT } from "../../../../components/templates/header/Header.style";
|
|
4
4
|
const { borderRadius5, colorBgPrimaryLight, colorBgBase, colorTextMedium, space4, space6, space8 } = theme();
|
|
5
5
|
const style = StyleSheet.create({
|
|
6
|
+
background: {
|
|
7
|
+
backgroundColor: colorBgPrimaryLight,
|
|
8
|
+
},
|
|
6
9
|
description: {
|
|
7
10
|
color: colorTextMedium,
|
|
8
11
|
},
|
|
@@ -31,7 +34,6 @@ const style = StyleSheet.create({
|
|
|
31
34
|
justifyContent: "center",
|
|
32
35
|
},
|
|
33
36
|
safeAreaView: {
|
|
34
|
-
backgroundColor: colorBgPrimaryLight,
|
|
35
37
|
flex: 1,
|
|
36
38
|
},
|
|
37
39
|
scrollView: {
|
|
@@ -39,9 +41,11 @@ const style = StyleSheet.create({
|
|
|
39
41
|
},
|
|
40
42
|
submit: {
|
|
41
43
|
backgroundColor: colorBgBase,
|
|
44
|
+
padding: space6,
|
|
45
|
+
},
|
|
46
|
+
submitDesktop: {
|
|
42
47
|
borderBottomLeftRadius: borderRadius5,
|
|
43
48
|
borderBottomRightRadius: borderRadius5,
|
|
44
|
-
padding: space6,
|
|
45
49
|
},
|
|
46
50
|
});
|
|
47
51
|
export { style };
|
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 };
|
|
@@ -1,17 +1,24 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
import { EmptyObject, ExcludePropertyIfOptional, NonEmptyArray } from "@lookiero/sty-psp-typescript";
|
|
2
|
+
import { ReturnQuestionType } from "./returnQuestion.constants";
|
|
3
|
+
import { Metadata } from "./returnQuestion.metadata";
|
|
4
|
+
type ReturnQuestionTypesWithChildren = ReturnQuestionType.HOST_DEFAULT | ReturnQuestionType.HOST_SELECT | ReturnQuestionType.HOST_STACK | ReturnQuestionType.HOST_TEXTAREA;
|
|
5
|
+
type ReturnQuestionTypesWithOptionalChildren = ReturnQuestionType.OPTION;
|
|
6
|
+
type ReturnQuestionTypesWithOptionalTranslationKeys = ReturnQuestionType.HOST_STACK;
|
|
7
|
+
type ReturnQuestionMetadata<RQT extends ReturnQuestionType> = ExcludePropertyIfOptional<"metadata", {
|
|
8
|
+
readonly metadata: Metadata<RQT>;
|
|
9
|
+
}>;
|
|
10
|
+
type ReturnQuestionChildren<RQT extends ReturnQuestionType> = RQT extends ReturnQuestionTypesWithChildren ? {
|
|
11
|
+
readonly children: NonEmptyArray<ReturnQuestion>;
|
|
12
|
+
} : RQT extends ReturnQuestionTypesWithOptionalChildren ? {
|
|
13
|
+
readonly children?: NonEmptyArray<ReturnQuestion>;
|
|
14
|
+
} : EmptyObject;
|
|
15
|
+
type ReturnQuestionTranslationKey<RQT extends ReturnQuestionType> = RQT extends ReturnQuestionTypesWithOptionalTranslationKeys ? {
|
|
16
|
+
readonly translationKey?: string;
|
|
17
|
+
} : {
|
|
18
|
+
readonly translationKey: string;
|
|
19
|
+
};
|
|
20
|
+
type ReturnQuestion<RQT extends ReturnQuestionType = ReturnQuestionType> = RQT extends infer K extends ReturnQuestionType ? {
|
|
10
21
|
readonly id: string;
|
|
11
|
-
readonly
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
readonly children?: ReturnQuestionProjection[];
|
|
15
|
-
}
|
|
16
|
-
export { ReturnQuestionType };
|
|
17
|
-
export type { ReturnQuestionProjection };
|
|
22
|
+
readonly type: K;
|
|
23
|
+
} & ReturnQuestionTranslationKey<K> & ReturnQuestionChildren<K> & ReturnQuestionMetadata<K> : never;
|
|
24
|
+
export type { ReturnQuestion as ReturnQuestionProjection, ReturnQuestionTypesWithOptionalTranslationKeys, ReturnQuestionTypesWithChildren, };
|
|
@@ -1,11 +1 @@
|
|
|
1
|
-
|
|
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
|
-
// ICON = "ICON",
|
|
10
|
-
})(ReturnQuestionType || (ReturnQuestionType = {}));
|
|
11
|
-
export { ReturnQuestionType };
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { EmptyObject } from "@lookiero/sty-psp-typescript";
|
|
2
|
+
import { ReturnQuestionType } from "./returnQuestion.constants";
|
|
3
|
+
interface ComponentPlaceholder {
|
|
4
|
+
readonly placeholder: string;
|
|
5
|
+
}
|
|
6
|
+
type MetadataDictionary = Record<ReturnQuestionType, EmptyObject>;
|
|
7
|
+
type ComponentMetadata = MetadataDictionary & {
|
|
8
|
+
[ReturnQuestionType.HOST_SELECT]: ComponentPlaceholder;
|
|
9
|
+
[ReturnQuestionType.TEXTAREA]: ComponentPlaceholder;
|
|
10
|
+
};
|
|
11
|
+
type Metadata<RQT extends ReturnQuestionType> = ComponentMetadata[RQT];
|
|
12
|
+
export type { Metadata };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import { ReturnQuestionType } from "./returnQuestion.constants";
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { ReturnQuestionProjection, ReturnQuestionTypesWithChildren } from "./returnQuestion";
|
|
2
|
+
import { ReturnQuestionType } from "./returnQuestion.constants";
|
|
3
|
+
declare const returnQuestionWithTranslationKey: (question: ReturnQuestionProjection) => question is ReturnQuestionProjection<ReturnQuestionType.HOST_DEFAULT | ReturnQuestionType.HOST_TEXTAREA | ReturnQuestionType.HOST_SELECT | ReturnQuestionType.TEXTAREA | ReturnQuestionType.OPTION>;
|
|
4
|
+
declare const returnQuestionHasChildren: (question: ReturnQuestionProjection) => question is ReturnQuestionProjection<ReturnQuestionTypesWithChildren>;
|
|
5
|
+
export { returnQuestionWithTranslationKey, returnQuestionHasChildren };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ReturnQuestionType } from "./returnQuestion.constants";
|
|
2
|
+
const returnQuestionWithTranslationKey = (question) => Boolean(question.translationKey);
|
|
3
|
+
const returnQuestionHasChildren = (question) => [
|
|
4
|
+
ReturnQuestionType.HOST_DEFAULT,
|
|
5
|
+
ReturnQuestionType.HOST_SELECT,
|
|
6
|
+
ReturnQuestionType.HOST_STACK,
|
|
7
|
+
ReturnQuestionType.HOST_TEXTAREA,
|
|
8
|
+
ReturnQuestionType.OPTION,
|
|
9
|
+
].includes(question.type);
|
|
10
|
+
export { returnQuestionWithTranslationKey, returnQuestionHasChildren };
|
package/dist/src/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const VERSION = "8.14.0
|
|
1
|
+
export declare const VERSION = "8.14.0";
|
package/dist/src/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const VERSION = "8.14.0
|
|
1
|
+
export const VERSION = "8.14.0";
|
package/jest.setup.js
CHANGED
|
@@ -11,26 +11,6 @@ jest.mock("@react-native-async-storage/async-storage", () => mockAsyncStorage);
|
|
|
11
11
|
* Without these, jest will break or pollute the log warnings.
|
|
12
12
|
*/
|
|
13
13
|
jest.mock("expo-linear-gradient", () => ({ LinearGradient: require("react-native").View }));
|
|
14
|
-
jest.mock("expo-image-picker", () => ({
|
|
15
|
-
PermissionStatus: {
|
|
16
|
-
GRANTED: "granted",
|
|
17
|
-
UNDETERMINED: "undetermined",
|
|
18
|
-
DENIED: "denied",
|
|
19
|
-
},
|
|
20
|
-
MediaTypeOptions: {
|
|
21
|
-
Images: "Images",
|
|
22
|
-
},
|
|
23
|
-
requestMediaLibraryPermissionsAsync: jest.fn(),
|
|
24
|
-
requestCameraPermissionsAsync: jest.fn(),
|
|
25
|
-
launchImageLibraryAsync: jest.fn(),
|
|
26
|
-
launchCameraAsync: jest.fn(),
|
|
27
|
-
}));
|
|
28
|
-
jest.mock("expo-image-manipulator", () => ({
|
|
29
|
-
manipulateAsync: jest.fn(),
|
|
30
|
-
SaveFormat: {
|
|
31
|
-
JPEG: "jpeg",
|
|
32
|
-
},
|
|
33
|
-
}));
|
|
34
14
|
|
|
35
15
|
jest.mock("react-native-safe-area-context", () => ({
|
|
36
16
|
SafeAreaProvider: ({ children }) => children,
|