@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,16 +1,12 @@
|
|
|
1
1
|
import { FC, ReactNode } from "react";
|
|
2
|
-
import { StyleProp, ViewStyle } from "react-native";
|
|
3
2
|
import { ReturnQuestionProjection } from "../../../../../../projection/returnQuestion/returnQuestion";
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
}
|
|
7
|
-
interface ReturnQuestionItemProps {
|
|
3
|
+
import { ReturnQuestionType } from "../../../../../../projection/returnQuestion/returnQuestion.constants";
|
|
4
|
+
interface ReturnQuestionItemProps<RQT extends ReturnQuestionType> {
|
|
8
5
|
readonly returnQuestionParent: ReturnQuestionProjection;
|
|
9
|
-
readonly returnQuestion: ReturnQuestionProjection
|
|
6
|
+
readonly returnQuestion: ReturnQuestionProjection<RQT>;
|
|
10
7
|
readonly children?: ReactNode;
|
|
11
8
|
readonly portalHostName?: string;
|
|
12
9
|
readonly testID?: string;
|
|
13
|
-
readonly style?: Partial<ReturnQuestionItemStyle>;
|
|
14
10
|
}
|
|
15
|
-
type ReturnQuestionItem = FC<ReturnQuestionItemProps
|
|
11
|
+
type ReturnQuestionItem<QT extends ReturnQuestionType> = FC<ReturnQuestionItemProps<QT>>;
|
|
16
12
|
export type { ReturnQuestionItem, ReturnQuestionItemProps };
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { ReturnQuestionType } from "../../../../../../../projection/returnQuestion/returnQuestion.constants";
|
|
1
2
|
import { ReturnQuestionItem } from "../ReturnQuestionItem";
|
|
2
|
-
declare const HostDefaultReturnQuestionFeedbackItem: ReturnQuestionItem
|
|
3
|
+
declare const HostDefaultReturnQuestionFeedbackItem: ReturnQuestionItem<ReturnQuestionType.HOST_DEFAULT>;
|
|
3
4
|
export { HostDefaultReturnQuestionFeedbackItem };
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { ReturnQuestionType } from "../../../../../../../projection/returnQuestion/returnQuestion.constants";
|
|
1
2
|
import { ReturnQuestionItem } from "../ReturnQuestionItem";
|
|
2
|
-
declare const HostDefaultReturnQuestionItem: ReturnQuestionItem
|
|
3
|
+
declare const HostDefaultReturnQuestionItem: ReturnQuestionItem<ReturnQuestionType.HOST_DEFAULT>;
|
|
3
4
|
export { HostDefaultReturnQuestionItem };
|
|
@@ -1,14 +1,16 @@
|
|
|
1
|
+
/* eslint-disable react/prop-types */
|
|
1
2
|
import React from "react";
|
|
2
3
|
import { Text, View } from "@lookiero/aurora";
|
|
3
|
-
import {
|
|
4
|
+
import { useIntl } from "@lookiero/i18n-react";
|
|
5
|
+
import { returnQuestionWithTranslationKey } from "../../../../../../../projection/returnQuestion/returnQuestion.typeguard";
|
|
4
6
|
import { I18nMessages } from "../../../../../i18n/i18n";
|
|
5
7
|
import { style } from "./HostDefaultReturnQuestionItem.style";
|
|
6
|
-
const HostDefaultReturnQuestionItem = ({ returnQuestion, children }) => {
|
|
7
|
-
const
|
|
8
|
-
const isAllOptions = returnQuestion.
|
|
8
|
+
const HostDefaultReturnQuestionItem = ({ returnQuestion, children, }) => {
|
|
9
|
+
const { formatMessage } = useIntl();
|
|
10
|
+
const isAllOptions = returnQuestion.translationKey === I18nMessages.RETURN_QUESTION_MAIN_ALL_OPINION;
|
|
9
11
|
return (React.createElement(React.Fragment, null,
|
|
10
|
-
|
|
11
|
-
React.createElement(Text, { level: 3, action: true },
|
|
12
|
+
returnQuestionWithTranslationKey(returnQuestion) && returnQuestion.translationKey !== " " && !isAllOptions ? (React.createElement(View, { style: style.title },
|
|
13
|
+
React.createElement(Text, { level: 3, action: true }, formatMessage({ id: returnQuestion.translationKey })))) : null,
|
|
12
14
|
children));
|
|
13
15
|
};
|
|
14
16
|
export { HostDefaultReturnQuestionItem };
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
+
import { ReturnQuestionType } from "../../../../../../../projection/returnQuestion/returnQuestion.constants";
|
|
1
2
|
import { ReturnQuestionItem } from "../ReturnQuestionItem";
|
|
2
3
|
import { style } from "./HostRadioGroupReturnQuestionItem.style";
|
|
3
|
-
declare const HostRadioGroupReturnQuestionItem: ReturnQuestionItem
|
|
4
|
+
declare const HostRadioGroupReturnQuestionItem: ReturnQuestionItem<ReturnQuestionType.HOST_SELECT>;
|
|
4
5
|
export { HostRadioGroupReturnQuestionItem, style };
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/* eslint-disable react/prop-types */
|
|
1
2
|
import React, { useMemo } from "react";
|
|
2
3
|
import { View } from "react-native";
|
|
3
4
|
import { Text } from "@lookiero/aurora";
|
|
@@ -5,7 +6,7 @@ import { useIntl } from "@lookiero/i18n-react";
|
|
|
5
6
|
import { style } from "./HostRadioGroupReturnQuestionItem.style";
|
|
6
7
|
const HostRadioGroupReturnQuestionItem = ({ returnQuestion, children, testID, }) => {
|
|
7
8
|
const { formatMessage } = useIntl();
|
|
8
|
-
const placeholderText = useMemo(() => (returnQuestion.placeholder ? formatMessage({ id: returnQuestion.placeholder }) : ""), [formatMessage, returnQuestion.placeholder]);
|
|
9
|
+
const placeholderText = useMemo(() => (returnQuestion.metadata.placeholder ? formatMessage({ id: returnQuestion.metadata.placeholder }) : ""), [formatMessage, returnQuestion.metadata.placeholder]);
|
|
9
10
|
return (React.createElement(React.Fragment, null,
|
|
10
11
|
React.createElement(View, { style: style.wrapper, testID: testID },
|
|
11
12
|
React.createElement(Text, { level: 3, style: style.title, action: true }, placeholderText),
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { ReturnQuestionType } from "../../../../../../../projection/returnQuestion/returnQuestion.constants";
|
|
1
2
|
import { ReturnQuestionItem } from "../ReturnQuestionItem";
|
|
2
|
-
declare const HostSelectReturnQuestionItem: ReturnQuestionItem
|
|
3
|
+
declare const HostSelectReturnQuestionItem: ReturnQuestionItem<ReturnQuestionType.HOST_SELECT>;
|
|
3
4
|
export { HostSelectReturnQuestionItem };
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/* eslint-disable react/prop-types */
|
|
1
2
|
import React, { useCallback, useEffect, useMemo, useState } from "react";
|
|
2
3
|
import { TouchableHighlight, View } from "react-native";
|
|
3
4
|
import { ButtonIcon } from "@lookiero/aurora";
|
|
@@ -7,9 +8,9 @@ import { InputField } from "../../../../../../../shared/ui/components/molecules/
|
|
|
7
8
|
import { useReturnQuestionFeedback, useReturnQuestionFeedbackForReturnQuestion, } from "../../behaviors/useReturnQuestionFeedback";
|
|
8
9
|
import { deepestReturnQuestionWithFeedbackForReturnQuestion, feedbackForReturnQuestion, } from "../../util/returnQuestionFeedback";
|
|
9
10
|
import { style, containerUnderlayColor } from "./HostSelectReturnQuestionItem.style";
|
|
10
|
-
const HostSelectReturnQuestionItem = ({ returnQuestion, children, portalHostName, testID,
|
|
11
|
+
const HostSelectReturnQuestionItem = ({ returnQuestion, children, portalHostName, testID, }) => {
|
|
11
12
|
const { formatMessage } = useIntl();
|
|
12
|
-
const placeholderText = useMemo(() => (returnQuestion.placeholder ? formatMessage({ id: returnQuestion.placeholder }) : ""), [formatMessage, returnQuestion.placeholder]);
|
|
13
|
+
const placeholderText = useMemo(() => (returnQuestion.metadata.placeholder ? formatMessage({ id: returnQuestion.metadata.placeholder }) : ""), [formatMessage, returnQuestion.metadata.placeholder]);
|
|
13
14
|
const [modalVisible, setModalVisible] = useState(false);
|
|
14
15
|
const handleOnPress = useCallback(() => setModalVisible(true), []);
|
|
15
16
|
const handleOnModalClose = useCallback(() => setModalVisible(false), []);
|
|
@@ -35,6 +36,6 @@ const HostSelectReturnQuestionItem = ({ returnQuestion, children, portalHostName
|
|
|
35
36
|
React.createElement(View, { pointerEvents: "none" },
|
|
36
37
|
React.createElement(InputField, { editable: false, icon: "arrow_down", label: placeholderText, value: inputValue }))),
|
|
37
38
|
React.createElement(Modal, { portalHostName: portalHostName, style: deepestReturnQuestionWithFeedback && { header: style.header }, visible: modalVisible, header: deepestReturnQuestionWithFeedback && (React.createElement(ButtonIcon, { name: "arrow_left", style: style.backButton, testID: "modal-back-button", onPress: handleOnBackButtonPress })), scroll: true, showCloseButton: true, onClose: handleOnModalClose },
|
|
38
|
-
React.createElement(View, { style:
|
|
39
|
+
React.createElement(View, { style: style.modalContent }, children))));
|
|
39
40
|
};
|
|
40
41
|
export { HostSelectReturnQuestionItem };
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { ReturnQuestionType } from "../../../../../../../../projection/returnQuestion/returnQuestion.constants";
|
|
1
2
|
import { ReturnQuestionItem } from "../../ReturnQuestionItem";
|
|
2
|
-
declare const HostStackReturnQuestionItem: ReturnQuestionItem
|
|
3
|
+
declare const HostStackReturnQuestionItem: ReturnQuestionItem<ReturnQuestionType.HOST_STACK>;
|
|
3
4
|
export { HostStackReturnQuestionItem };
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
+
/* eslint-disable react/prop-types */
|
|
1
2
|
import React from "react";
|
|
2
3
|
import ReturnQuestion from "../../../ReturnQuestion";
|
|
3
|
-
const HostStackReturnQuestionItem = ({ returnQuestion, portalHostName,
|
|
4
|
+
const HostStackReturnQuestionItem = ({ returnQuestion, portalHostName, }) => (React.createElement(React.Fragment, null, returnQuestion.children?.map((childReturnQuestion) => (React.createElement(ReturnQuestion, { key: childReturnQuestion.id, portalHostName: portalHostName, returnQuestion: childReturnQuestion, returnQuestionParent: returnQuestion })))));
|
|
4
5
|
export { HostStackReturnQuestionItem };
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { ReturnQuestionType } from "../../../../../../../../projection/returnQuestion/returnQuestion.constants";
|
|
1
2
|
import { ReturnQuestionItem } from "../../ReturnQuestionItem";
|
|
2
|
-
declare const HostStackReturnQuestionItem: ReturnQuestionItem
|
|
3
|
+
declare const HostStackReturnQuestionItem: ReturnQuestionItem<ReturnQuestionType.HOST_STACK>;
|
|
3
4
|
export { HostStackReturnQuestionItem };
|
|
@@ -1,27 +1,29 @@
|
|
|
1
|
+
/* eslint-disable react/prop-types */
|
|
1
2
|
import { animated, useSpring } from "@react-spring/native";
|
|
2
3
|
import React, { useCallback, useMemo, useState } from "react";
|
|
3
4
|
import { View } from "react-native";
|
|
4
5
|
import { COLOR, Text } from "@lookiero/aurora";
|
|
5
6
|
import { useIntl } from "@lookiero/i18n-react";
|
|
7
|
+
import { returnQuestionHasChildren } from "../../../../../../../../projection/returnQuestion/returnQuestion.typeguard";
|
|
6
8
|
import ReturnQuestion from "../../../ReturnQuestion";
|
|
7
9
|
import { useReturnQuestionFeedbackForReturnQuestion } from "../../../behaviors/useReturnQuestionFeedback";
|
|
8
10
|
import { style } from "./HostStackReturnQuestionItem.style";
|
|
9
|
-
const HostStackReturnQuestionItem = ({ returnQuestion, children, portalHostName,
|
|
11
|
+
const HostStackReturnQuestionItem = ({ returnQuestion, children, portalHostName, }) => {
|
|
10
12
|
const { formatMessage } = useIntl();
|
|
11
13
|
const { feedback } = useReturnQuestionFeedbackForReturnQuestion({ returnQuestion });
|
|
12
14
|
const feedbackReturnQuestion = feedback
|
|
13
15
|
? returnQuestion.children?.find((returnQuestion) => returnQuestion.id === feedback)
|
|
14
16
|
: undefined;
|
|
15
|
-
const titleText = useMemo(() => (returnQuestion.
|
|
16
|
-
const feedbackText = useMemo(() => (feedbackReturnQuestion ? formatMessage({ id: feedbackReturnQuestion.
|
|
17
|
+
const titleText = useMemo(() => (returnQuestion.translationKey ? formatMessage({ id: returnQuestion.translationKey }) : undefined), [formatMessage, returnQuestion.translationKey]);
|
|
18
|
+
const feedbackText = useMemo(() => (feedbackReturnQuestion ? formatMessage({ id: feedbackReturnQuestion.translationKey }) : undefined), [feedbackReturnQuestion, formatMessage]);
|
|
17
19
|
const [stackHeight, setStackHeight] = useState();
|
|
18
20
|
const handleOnLayout = useCallback(({ nativeEvent: { layout: { height }, }, }) => setStackHeight(height), []);
|
|
19
21
|
const stackSyle = useSpring({ height: stackHeight });
|
|
20
22
|
return (React.createElement(animated.View, { style: stackSyle },
|
|
21
23
|
React.createElement(View, { onLayout: handleOnLayout },
|
|
22
24
|
titleText && (React.createElement(Text, { level: 3, style: style.title, heading: true }, titleText)),
|
|
23
|
-
feedbackReturnQuestion ? (React.createElement(React.Fragment, null,
|
|
25
|
+
feedbackReturnQuestion && returnQuestionHasChildren(feedbackReturnQuestion) ? (React.createElement(React.Fragment, null,
|
|
24
26
|
React.createElement(Text, { color: COLOR.TEXT_MEDIUM, level: 3 }, feedbackText),
|
|
25
|
-
feedbackReturnQuestion.children?.map((childReturnQuestion) => (React.createElement(ReturnQuestion, { key: childReturnQuestion.id, portalHostName: portalHostName, returnQuestion: childReturnQuestion, returnQuestionParent: feedbackReturnQuestion
|
|
27
|
+
feedbackReturnQuestion.children?.map((childReturnQuestion) => (React.createElement(ReturnQuestion, { key: childReturnQuestion.id, portalHostName: portalHostName, returnQuestion: childReturnQuestion, returnQuestionParent: feedbackReturnQuestion }))))) : (children))));
|
|
26
28
|
};
|
|
27
29
|
export { HostStackReturnQuestionItem };
|
|
@@ -1,13 +1,11 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import { StyleProp, ViewStyle } from "react-native";
|
|
3
2
|
import { ReturnQuestionProjection } from "../../../../../../../projection/returnQuestion/returnQuestion";
|
|
4
3
|
interface ModalOptionReturnQuestionItemsProps {
|
|
5
4
|
readonly portalHostName?: string;
|
|
6
5
|
readonly returnQuestion: ReturnQuestionProjection;
|
|
7
6
|
readonly returnQuestionParent: ReturnQuestionProjection;
|
|
8
7
|
readonly visible: boolean;
|
|
9
|
-
readonly style?: StyleProp<ViewStyle>;
|
|
10
8
|
readonly onClose: () => void;
|
|
11
9
|
}
|
|
12
|
-
declare const ModalOptionReturnQuestionItems: ({ portalHostName, returnQuestion, visible,
|
|
10
|
+
declare const ModalOptionReturnQuestionItems: ({ portalHostName, returnQuestion, visible, onClose, }: ModalOptionReturnQuestionItemsProps) => React.JSX.Element;
|
|
13
11
|
export { ModalOptionReturnQuestionItems };
|
|
@@ -3,14 +3,16 @@ import { View } from "react-native";
|
|
|
3
3
|
import { COLOR, Text } from "@lookiero/aurora";
|
|
4
4
|
import { useIntl } from "@lookiero/i18n-react";
|
|
5
5
|
import { Modal } from "@lookiero/sty-psp-ui";
|
|
6
|
+
import { returnQuestionHasChildren } from "../../../../../../../projection/returnQuestion/returnQuestion.typeguard";
|
|
6
7
|
import ReturnQuestion from "../../ReturnQuestion";
|
|
7
8
|
import { style } from "./ModalOptionReturnQuestionItems.style";
|
|
8
|
-
const ModalOptionReturnQuestionItems = ({ portalHostName, returnQuestion, visible,
|
|
9
|
+
const ModalOptionReturnQuestionItems = ({ portalHostName, returnQuestion, visible, onClose, }) => {
|
|
9
10
|
const { formatMessage } = useIntl();
|
|
10
|
-
const title = formatMessage({ id: returnQuestion.
|
|
11
|
+
const title = formatMessage({ id: returnQuestion.translationKey });
|
|
11
12
|
return (React.createElement(Modal, { portalHostName: portalHostName, visible: visible, scroll: true, showCloseButton: true, onClose: onClose },
|
|
12
|
-
React.createElement(View, { style:
|
|
13
|
+
React.createElement(View, { style: style.modalContent },
|
|
13
14
|
React.createElement(Text, { color: COLOR.TEXT_MEDIUM, level: 2, style: style.optionText }, title),
|
|
14
|
-
React.createElement(React.Fragment, null, returnQuestion
|
|
15
|
+
React.createElement(React.Fragment, null, returnQuestionHasChildren(returnQuestion) &&
|
|
16
|
+
returnQuestion.children?.map((childReturnQuestion) => (React.createElement(ReturnQuestion, { key: childReturnQuestion.id, portalHostName: "", returnQuestion: childReturnQuestion, returnQuestionParent: returnQuestion })))))));
|
|
15
17
|
};
|
|
16
18
|
export { ModalOptionReturnQuestionItems };
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { ReturnQuestionType } from "../../../../../../../projection/returnQuestion/returnQuestion.constants";
|
|
1
2
|
import { ReturnQuestionItem } from "../ReturnQuestionItem";
|
|
2
|
-
declare const OptionReturnQuestionItem: ReturnQuestionItem
|
|
3
|
+
declare const OptionReturnQuestionItem: ReturnQuestionItem<ReturnQuestionType.OPTION>;
|
|
3
4
|
export { OptionReturnQuestionItem };
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/* eslint-disable react/prop-types */
|
|
1
2
|
import React, { useCallback } from "react";
|
|
2
3
|
import { TouchableHighlight } from "react-native";
|
|
3
4
|
import { Text } from "@lookiero/aurora";
|
|
@@ -6,7 +7,7 @@ import { useReturnQuestionFeedbackForReturnQuestion } from "../../behaviors/useR
|
|
|
6
7
|
import { containerUnderlayColor, style } from "./OptionReturnQuestionItem.style";
|
|
7
8
|
const OptionReturnQuestionItem = ({ returnQuestion, returnQuestionParent, testID, }) => {
|
|
8
9
|
const { onChange } = useReturnQuestionFeedbackForReturnQuestion({ returnQuestion: returnQuestionParent });
|
|
9
|
-
const optionText = useI18nMessage({ id: returnQuestion.
|
|
10
|
+
const optionText = useI18nMessage({ id: returnQuestion.translationKey });
|
|
10
11
|
const handleOnPress = useCallback(() => onChange({ returnQuestionId: returnQuestionParent.id, returnQuestionFeedback: returnQuestion.id }), [onChange, returnQuestion.id, returnQuestionParent.id]);
|
|
11
12
|
return (React.createElement(TouchableHighlight, { accessibilityLabel: testID, style: style.container, testID: testID, underlayColor: containerUnderlayColor, onPress: handleOnPress },
|
|
12
13
|
React.createElement(Text, { level: 3, style: style.text }, optionText)));
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { ReturnQuestionType } from "../../../../../../../projection/returnQuestion/returnQuestion.constants";
|
|
1
2
|
import { ReturnQuestionItem } from "../ReturnQuestionItem";
|
|
2
|
-
declare const RadioReturnQuestionItem: ReturnQuestionItem
|
|
3
|
+
declare const RadioReturnQuestionItem: ReturnQuestionItem<ReturnQuestionType.OPTION>;
|
|
3
4
|
export { RadioReturnQuestionItem };
|
|
@@ -1,18 +1,19 @@
|
|
|
1
|
+
/* eslint-disable react/prop-types */
|
|
1
2
|
import React, { useCallback, useEffect, useState } from "react";
|
|
2
|
-
import { View, Option, OPTION_VARIANT } from "@lookiero/aurora";
|
|
3
|
+
import { View, Option, OPTION_VARIANT, SIZE } from "@lookiero/aurora";
|
|
3
4
|
import { useIntl } from "@lookiero/i18n-react";
|
|
4
5
|
import { useReturnQuestionFeedback, useReturnQuestionFeedbackForReturnQuestion, } from "../../behaviors/useReturnQuestionFeedback";
|
|
5
6
|
import { deepestReturnQuestionWithFeedbackForReturnQuestion, feedbackForReturnQuestion, } from "../../util/returnQuestionFeedback";
|
|
6
7
|
import { ModalOptionReturnQuestionItems } from "../modalOptionReturnQuestionItems/ModalOptionReturnQuestionItems";
|
|
7
8
|
import { style } from "./RadioReturnQuestionItem.style";
|
|
8
|
-
const RadioReturnQuestionItem = ({ returnQuestion, returnQuestionParent, testID, portalHostName,
|
|
9
|
+
const RadioReturnQuestionItem = ({ returnQuestion, returnQuestionParent, testID, portalHostName, }) => {
|
|
9
10
|
const intl = useIntl();
|
|
10
11
|
const [modalVisible, setModalVisible] = useState(false);
|
|
11
12
|
const { feedback: feedbackId, onChange, clear, } = useReturnQuestionFeedbackForReturnQuestion({ returnQuestion: returnQuestionParent });
|
|
12
13
|
const feedback = useReturnQuestionFeedback();
|
|
13
14
|
const translate = useCallback((returnQuestionName) => intl.formatMessage({ id: returnQuestionName, defaultMessage: returnQuestionName }), [intl]);
|
|
14
15
|
const inputValue = feedbackForReturnQuestion({ feedback, returnQuestion, translate }).join(" / ");
|
|
15
|
-
const optionText = intl.formatMessage({ id: returnQuestion.
|
|
16
|
+
const optionText = intl.formatMessage({ id: returnQuestion.translationKey });
|
|
16
17
|
const hasChildren = Boolean(returnQuestion.children && returnQuestion.children.length > 0);
|
|
17
18
|
const handleOnModalClose = useCallback(() => {
|
|
18
19
|
// Uncomment if we want to clear current selection (and update callback's dependencies)
|
|
@@ -43,7 +44,7 @@ const RadioReturnQuestionItem = ({ returnQuestion, returnQuestionParent, testID,
|
|
|
43
44
|
*/
|
|
44
45
|
return (React.createElement(React.Fragment, null,
|
|
45
46
|
React.createElement(View, { style: style.wrapper, testID: testID },
|
|
46
|
-
React.createElement(Option, { checked: returnQuestion.id === feedbackId, name: returnQuestion.id, title: inputValue ? `${optionText} / ${inputValue}` : `${optionText}`, value: returnQuestion.id, variant: OPTION_VARIANT.BUTTON, onChange: handleOnPress })),
|
|
47
|
-
hasChildren ? (React.createElement(ModalOptionReturnQuestionItems, { portalHostName: portalHostName, returnQuestion: returnQuestion, returnQuestionParent: returnQuestion,
|
|
47
|
+
React.createElement(Option, { checked: returnQuestion.id === feedbackId, flex: SIZE.XS, name: returnQuestion.id, title: inputValue ? `${optionText} / ${inputValue}` : `${optionText}`, value: returnQuestion.id, variant: OPTION_VARIANT.BUTTON, onChange: handleOnPress })),
|
|
48
|
+
hasChildren ? (React.createElement(ModalOptionReturnQuestionItems, { portalHostName: portalHostName, returnQuestion: returnQuestion, returnQuestionParent: returnQuestion, visible: modalVisible, onClose: handleOnModalClose })) : null));
|
|
48
49
|
};
|
|
49
50
|
export { RadioReturnQuestionItem };
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { ReturnQuestionType } from "../../../../../../../projection/returnQuestion/returnQuestion.constants";
|
|
1
2
|
import { ReturnQuestionItem } from "../ReturnQuestionItem";
|
|
2
|
-
declare const ReturnQuestionFeedbackItem: ReturnQuestionItem
|
|
3
|
+
declare const ReturnQuestionFeedbackItem: ReturnQuestionItem<ReturnQuestionType.HOST_DEFAULT>;
|
|
3
4
|
export { ReturnQuestionFeedbackItem };
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/* eslint-disable react/prop-types */
|
|
1
2
|
import React, { useCallback } from "react";
|
|
2
3
|
import { View } from "react-native";
|
|
3
4
|
import { Text } from "@lookiero/aurora";
|
|
@@ -7,7 +8,7 @@ import { useReturnQuestionFeedback } from "../../behaviors/useReturnQuestionFeed
|
|
|
7
8
|
import { feedbackForReturnQuestion } from "../../util/returnQuestionFeedback";
|
|
8
9
|
import { style } from "./ReturnQuestionFeedbackItem.style";
|
|
9
10
|
const ReturnQuestionFeedbackItem = ({ returnQuestion }) => {
|
|
10
|
-
const titleText = useI18nMessage({ id: returnQuestion.
|
|
11
|
+
const titleText = useI18nMessage({ id: returnQuestion.translationKey });
|
|
11
12
|
const unansweredText = useI18nMessage({ id: I18nMessages.FEEDBACK_UNANSWERED });
|
|
12
13
|
const returnQuestionFeedback = useReturnQuestionFeedback();
|
|
13
14
|
const intl = useIntl();
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { ReturnQuestionType } from "../../../../../../../projection/returnQuestion/returnQuestion.constants";
|
|
1
2
|
import { ReturnQuestionItem } from "../ReturnQuestionItem";
|
|
2
|
-
declare const TextareaReturnQuestionItem: ReturnQuestionItem
|
|
3
|
+
declare const TextareaReturnQuestionItem: ReturnQuestionItem<ReturnQuestionType.TEXTAREA>;
|
|
3
4
|
export { TextareaReturnQuestionItem };
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/* eslint-disable react/prop-types */
|
|
1
2
|
import React, { useCallback, useMemo } from "react";
|
|
2
3
|
import { View } from "@lookiero/aurora";
|
|
3
4
|
import { useIntl } from "@lookiero/i18n-react";
|
|
@@ -6,7 +7,7 @@ import { useReturnQuestionFeedbackForReturnQuestion } from "../../behaviors/useR
|
|
|
6
7
|
import { style } from "./TextareaReturnQuestionItem.style";
|
|
7
8
|
const TextareaReturnQuestionItem = ({ returnQuestion, returnQuestionParent, testID, }) => {
|
|
8
9
|
const { formatMessage } = useIntl();
|
|
9
|
-
const placeholderText = useMemo(() => (returnQuestion.placeholder ? formatMessage({ id: returnQuestion.placeholder }) : ""), [formatMessage, returnQuestion.placeholder]);
|
|
10
|
+
const placeholderText = useMemo(() => (returnQuestion.metadata.placeholder ? formatMessage({ id: returnQuestion.metadata.placeholder }) : ""), [formatMessage, returnQuestion.metadata.placeholder]);
|
|
10
11
|
const { feedback, onChange } = useReturnQuestionFeedbackForReturnQuestion({ returnQuestion: returnQuestionParent });
|
|
11
12
|
const handleOnChange = useCallback((value) => onChange({ returnQuestionId: returnQuestionParent.id, returnQuestionFeedback: value }), [onChange, returnQuestionParent.id]);
|
|
12
13
|
return (React.createElement(View, { style: style.wrapper },
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { returnQuestionHasChildren, returnQuestionWithTranslationKey, } from "../../../../../../projection/returnQuestion/returnQuestion.typeguard";
|
|
1
2
|
const REGEX = /^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;
|
|
2
3
|
const isUuid = (value) => {
|
|
3
4
|
return typeof value === "string" && REGEX.test(value);
|
|
@@ -7,11 +8,14 @@ const feedbackForReturnQuestion = ({ feedback, returnQuestion, translate, acc =
|
|
|
7
8
|
if (returnQuestionId) {
|
|
8
9
|
const returnQuestionFeedback = feedback[returnQuestionId];
|
|
9
10
|
if (isUuid(returnQuestionFeedback)) {
|
|
10
|
-
const feebackReturnQuestionChild = returnQuestion
|
|
11
|
+
const feebackReturnQuestionChild = returnQuestionHasChildren(returnQuestion) &&
|
|
12
|
+
returnQuestion.children?.find((childReturnQuestion) => childReturnQuestion.id === returnQuestionFeedback);
|
|
11
13
|
if (feebackReturnQuestionChild) {
|
|
12
14
|
return [
|
|
13
15
|
...acc,
|
|
14
|
-
|
|
16
|
+
...(returnQuestionWithTranslationKey(feebackReturnQuestionChild)
|
|
17
|
+
? [translate(feebackReturnQuestionChild.translationKey)]
|
|
18
|
+
: []),
|
|
15
19
|
...feedbackForReturnQuestion({ feedback, returnQuestion: feebackReturnQuestionChild, translate, acc }),
|
|
16
20
|
];
|
|
17
21
|
}
|
|
@@ -19,17 +23,20 @@ const feedbackForReturnQuestion = ({ feedback, returnQuestion, translate, acc =
|
|
|
19
23
|
}
|
|
20
24
|
return [...acc, returnQuestionFeedback];
|
|
21
25
|
}
|
|
22
|
-
return (
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
+
return ((returnQuestionHasChildren(returnQuestion) &&
|
|
27
|
+
returnQuestion.children?.reduce((acc, childReturnQuestion) => [
|
|
28
|
+
...acc,
|
|
29
|
+
...feedbackForReturnQuestion({ feedback, returnQuestion: childReturnQuestion, translate, acc }),
|
|
30
|
+
], [])) ||
|
|
31
|
+
[]);
|
|
26
32
|
};
|
|
27
33
|
const deepestReturnQuestionWithFeedbackForReturnQuestion = ({ feedback, returnQuestion, deepestReturnQuestion, }) => {
|
|
28
34
|
const returnQuestionId = Object.keys(feedback).find((id) => id === returnQuestion.id);
|
|
29
35
|
if (returnQuestionId) {
|
|
30
36
|
const returnQuestionFeedback = feedback[returnQuestionId];
|
|
31
37
|
if (isUuid(returnQuestionFeedback)) {
|
|
32
|
-
const feebackReturnQuestionChild = returnQuestion
|
|
38
|
+
const feebackReturnQuestionChild = returnQuestionHasChildren(returnQuestion) &&
|
|
39
|
+
returnQuestion.children?.find((childReturnQuestion) => childReturnQuestion.id === returnQuestionFeedback);
|
|
33
40
|
if (feebackReturnQuestionChild) {
|
|
34
41
|
return deepestReturnQuestionWithFeedbackForReturnQuestion({
|
|
35
42
|
feedback,
|
|
@@ -41,7 +48,8 @@ const deepestReturnQuestionWithFeedbackForReturnQuestion = ({ feedback, returnQu
|
|
|
41
48
|
}
|
|
42
49
|
return [returnQuestion, false];
|
|
43
50
|
}
|
|
44
|
-
const feebackReturnQuestionChild = returnQuestion
|
|
51
|
+
const feebackReturnQuestionChild = returnQuestionHasChildren(returnQuestion) &&
|
|
52
|
+
returnQuestion.children?.find((childReturnQuestion) => Object.keys(feedback).find((id) => id === childReturnQuestion.id));
|
|
45
53
|
if (feebackReturnQuestionChild) {
|
|
46
54
|
return deepestReturnQuestionWithFeedbackForReturnQuestion({
|
|
47
55
|
feedback,
|
|
@@ -49,6 +57,7 @@ const deepestReturnQuestionWithFeedbackForReturnQuestion = ({ feedback, returnQu
|
|
|
49
57
|
deepestReturnQuestion: feebackReturnQuestionChild,
|
|
50
58
|
});
|
|
51
59
|
}
|
|
52
|
-
|
|
60
|
+
const hasChildren = Boolean(returnQuestionHasChildren(returnQuestion) && returnQuestion.children && returnQuestion.children.length > 0);
|
|
61
|
+
return [deepestReturnQuestion, !hasChildren];
|
|
53
62
|
};
|
|
54
63
|
export { feedbackForReturnQuestion, deepestReturnQuestionWithFeedbackForReturnQuestion };
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import { StyleProp, ViewStyle } from "react-native";
|
|
3
2
|
import { useRoutes as reactRouterUseRoutes } from "react-router-native";
|
|
4
3
|
import { I18n } from "@lookiero/i18n-react";
|
|
5
4
|
import { Locale } from "@lookiero/sty-psp-locale";
|
|
@@ -8,10 +7,6 @@ import { Customer } from "../../../projection/customer/customer";
|
|
|
8
7
|
import { Order } from "../../../projection/order/order";
|
|
9
8
|
import { Subscription } from "../../../projection/subscription/subscription";
|
|
10
9
|
import { KameleoonEnvironment } from "../../ab-testing/kameleoonEnvironment";
|
|
11
|
-
import { AppStyle } from "../views/App";
|
|
12
|
-
interface RoutingStyle extends AppStyle {
|
|
13
|
-
readonly modal: StyleProp<ViewStyle>;
|
|
14
|
-
}
|
|
15
10
|
interface RoutingProps {
|
|
16
11
|
readonly basePath?: string;
|
|
17
12
|
readonly customer: Customer;
|
|
@@ -21,7 +16,6 @@ interface RoutingProps {
|
|
|
21
16
|
readonly I18n: I18n;
|
|
22
17
|
readonly kameleoon: KameleoonEnvironment;
|
|
23
18
|
readonly layout: Layout;
|
|
24
|
-
readonly style?: Partial<RoutingStyle>;
|
|
25
19
|
readonly getAuthToken: () => Promise<string>;
|
|
26
20
|
readonly onNotAccessible: () => void;
|
|
27
21
|
readonly onCheckoutSubmitted?: () => void;
|
|
@@ -37,4 +31,3 @@ interface RoutingProps {
|
|
|
37
31
|
*/
|
|
38
32
|
declare const MemoizedRouting: React.NamedExoticComponent<RoutingProps>;
|
|
39
33
|
export { MemoizedRouting as Routing };
|
|
40
|
-
export type { RoutingStyle };
|
|
@@ -14,7 +14,7 @@ import { SummaryTabs } from "../views/summaryTabs/SummaryTabs";
|
|
|
14
14
|
import { CheckoutMiddleware } from "./CheckoutMiddleware";
|
|
15
15
|
import { Routes } from "./routes";
|
|
16
16
|
import { BasePathProvider } from "./useBasePath";
|
|
17
|
-
const Routing = ({ basePath = "", customer, order, subscription, locale, I18n, kameleoon, layout,
|
|
17
|
+
const Routing = ({ basePath = "", customer, order, subscription, locale, I18n, kameleoon, layout, getAuthToken, onI18nError, onNotAccessible, onCheckoutSubmitted, useRedirect, useRoutes = reactRouterUseRoutes, }) => {
|
|
18
18
|
return useRoutes([
|
|
19
19
|
{
|
|
20
20
|
path: "",
|
|
@@ -23,18 +23,18 @@ const Routing = ({ basePath = "", customer, order, subscription, locale, I18n, k
|
|
|
23
23
|
React.createElement(I18n, { loader: React.createElement(Spinner, null), locale: locale, onError: onI18nError },
|
|
24
24
|
React.createElement(Kameleoon, { loader: React.createElement(Spinner, null), siteCode: kameleoon.siteCode },
|
|
25
25
|
React.createElement(CheckoutMiddleware, { customerId: customer?.customerId, onNotAccessible: onNotAccessible },
|
|
26
|
-
React.createElement(App,
|
|
26
|
+
React.createElement(App, null,
|
|
27
27
|
React.createElement(Outlet, null)))))))),
|
|
28
28
|
children: [
|
|
29
29
|
{
|
|
30
30
|
path: Routes.ITEM,
|
|
31
31
|
element: (React.createElement(Suspense, { fallback: React.createElement(Spinner, null) },
|
|
32
|
-
React.createElement(Item, { layout: layout
|
|
32
|
+
React.createElement(Item, { layout: layout }))),
|
|
33
33
|
},
|
|
34
34
|
{
|
|
35
35
|
path: Routes.ITEM_DETAIL,
|
|
36
36
|
element: (React.createElement(Suspense, { fallback: React.createElement(Spinner, null) },
|
|
37
|
-
React.createElement(Item, { layout: layout
|
|
37
|
+
React.createElement(Item, { layout: layout }))),
|
|
38
38
|
},
|
|
39
39
|
{
|
|
40
40
|
path: Routes.SUMMARY,
|
|
@@ -69,7 +69,7 @@ const Routing = ({ basePath = "", customer, order, subscription, locale, I18n, k
|
|
|
69
69
|
{
|
|
70
70
|
path: Routes.RETURN,
|
|
71
71
|
element: (React.createElement(Suspense, { fallback: React.createElement(Spinner, null) },
|
|
72
|
-
React.createElement(Return, { layout: layout
|
|
72
|
+
React.createElement(Return, { layout: layout }))),
|
|
73
73
|
},
|
|
74
74
|
{
|
|
75
75
|
path: "*",
|
|
@@ -1,14 +1,6 @@
|
|
|
1
1
|
import { FC } from "react";
|
|
2
|
-
import { StyleProp, ViewStyle } from "react-native";
|
|
3
|
-
import { NotificationsStyle } from "@lookiero/sty-psp-notifications";
|
|
4
|
-
interface AppStyle {
|
|
5
|
-
readonly container: StyleProp<ViewStyle>;
|
|
6
|
-
readonly notifications: Partial<NotificationsStyle>;
|
|
7
|
-
}
|
|
8
2
|
interface AppProps {
|
|
9
3
|
readonly children: JSX.Element;
|
|
10
|
-
readonly style?: Partial<AppStyle>;
|
|
11
4
|
}
|
|
12
5
|
declare const App: FC<AppProps>;
|
|
13
|
-
export type { AppStyle };
|
|
14
6
|
export { App };
|
|
@@ -1,17 +1,15 @@
|
|
|
1
1
|
import { PortalProvider } from "@gorhom/portal";
|
|
2
2
|
import React from "react";
|
|
3
|
-
import { StatusBar
|
|
3
|
+
import { StatusBar } from "react-native";
|
|
4
4
|
import { SafeAreaProvider } from "react-native-safe-area-context";
|
|
5
5
|
import { PortalProvider as AuroraPortalProvider } from "@lookiero/aurora";
|
|
6
6
|
import { Notifications } from "@lookiero/sty-psp-notifications";
|
|
7
7
|
import { theme } from "@lookiero/sty-psp-ui";
|
|
8
8
|
import { MESSAGING_CONTEXT_ID } from "../../delivery/baseBootstrap";
|
|
9
|
-
import { style } from "./App.style";
|
|
10
9
|
const { colorBgBase } = theme();
|
|
11
|
-
const App = ({ children
|
|
12
|
-
React.createElement(
|
|
13
|
-
React.createElement(
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
React.createElement(AuroraPortalProvider, null, children)))));
|
|
10
|
+
const App = ({ children }) => (React.createElement(SafeAreaProvider, null,
|
|
11
|
+
React.createElement(PortalProvider, null,
|
|
12
|
+
React.createElement(StatusBar, { backgroundColor: colorBgBase, barStyle: "dark-content", translucent: true }),
|
|
13
|
+
React.createElement(Notifications, { contextId: MESSAGING_CONTEXT_ID }),
|
|
14
|
+
React.createElement(AuroraPortalProvider, null, children))));
|
|
17
15
|
export { App };
|
|
@@ -1,12 +1,7 @@
|
|
|
1
1
|
import { FC } from "react";
|
|
2
|
-
import { StyleProp, ViewStyle } from "react-native";
|
|
3
2
|
import { Layout } from "@lookiero/sty-psp-ui";
|
|
4
|
-
interface ItemStyle {
|
|
5
|
-
readonly modal: StyleProp<ViewStyle>;
|
|
6
|
-
}
|
|
7
3
|
interface ItemProps {
|
|
8
4
|
readonly layout: Layout;
|
|
9
|
-
readonly style?: Partial<ItemStyle>;
|
|
10
5
|
}
|
|
11
6
|
declare const Item: FC<ItemProps>;
|
|
12
7
|
export { Item };
|
|
@@ -26,7 +26,7 @@ import { useBasePath } from "../../routing/useBasePath";
|
|
|
26
26
|
import { style } from "./Item.style";
|
|
27
27
|
import { ItemWithCustomerDecission, } from "./views/itemWithCustomerDecission/ItemWithCustomerDecission";
|
|
28
28
|
import { ItemWithoutCustomerDecission, } from "./views/itemWithoutCustomerDecission/ItemWithoutCustomerDecission";
|
|
29
|
-
const Item = ({ layout: Layout
|
|
29
|
+
const Item = ({ layout: Layout }) => {
|
|
30
30
|
const logger = useLogger();
|
|
31
31
|
const screenSize = useScreenSize();
|
|
32
32
|
const navigate = useNavigate();
|
|
@@ -141,10 +141,10 @@ const Item = ({ layout: Layout, style: customStyle }) => {
|
|
|
141
141
|
return React.createElement(Spinner, { testID: "spinner" });
|
|
142
142
|
}
|
|
143
143
|
return (React.createElement(ReturnQuestionFeedbackProvider, { key: checkoutItem.id, feedback: checkoutItem.feedbacks || {} },
|
|
144
|
-
React.createElement(Layout, { header: header, scrollEnabled: !itemWithoutCustomerDecission, style: {
|
|
144
|
+
React.createElement(Layout, { footer: null, header: header, scrollEnabled: !itemWithoutCustomerDecission, style: {
|
|
145
145
|
header: fiveItemsDiscount !== 0 ? style.headerWithDoubleHeight : style.header,
|
|
146
146
|
scrollView: { height: itemWithoutCustomerDecission ? "100%" : "auto" },
|
|
147
147
|
safeAreaView: isDesktopScreen ? style.safeAreaView : null,
|
|
148
|
-
} }, itemWithoutCustomerDecission ? (React.createElement(ItemWithoutCustomerDecission, { bookedProductsVariants: bookedProductsVariants, checkoutId: checkout.id, checkoutItem: checkoutItem, currentProductVariant: currentProductVariant,
|
|
148
|
+
} }, itemWithoutCustomerDecission ? (React.createElement(ItemWithoutCustomerDecission, { bookedProductsVariants: bookedProductsVariants, checkoutId: checkout.id, checkoutItem: checkoutItem, currentProductVariant: currentProductVariant, onReturn: goToReturnPage })) : (React.createElement(ItemWithCustomerDecission, { checkoutId: checkout.id, checkoutItem: checkoutItem, currentProductVariant: currentProductVariant, returnQuestions: returnQuestions, onEditFeedback: goToReturnPage })))));
|
|
149
149
|
};
|
|
150
150
|
export { Item };
|
|
@@ -5,13 +5,13 @@ 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 "./GetOutOfCheckoutModal.style";
|
|
8
|
-
const GetOutOfCheckoutModal = ({ visible,
|
|
8
|
+
const GetOutOfCheckoutModal = ({ visible, onDismiss, onConfirm }) => {
|
|
9
9
|
const titleText = useI18nMessage({ id: I18nMessages.GET_OUT_OF_CHECKOUT_MODAL_TITLE });
|
|
10
10
|
const descriptionText = useI18nMessage({ id: I18nMessages.GET_OUT_OF_CHECKOUT_MODAL_DESCRIPTION });
|
|
11
11
|
const dismissButtonText = useI18nMessage({ id: I18nMessages.GET_OUT_OF_CHECKOUT_MODAL_DISMISS_BUTTON });
|
|
12
12
|
const confirmButtonText = useI18nMessage({ id: I18nMessages.GET_OUT_OF_CHECKOUT_MODAL_CONFIRM_BUTTON });
|
|
13
13
|
return (React.createElement(Modal, { visible: visible, onClose: onDismiss },
|
|
14
|
-
React.createElement(View, { style:
|
|
14
|
+
React.createElement(View, { style: style.modalContent },
|
|
15
15
|
React.createElement(Text, { align: ALIGN.CENTER, level: 1, style: style.title }, titleText),
|
|
16
16
|
React.createElement(Text, { level: 3, style: style.description }, descriptionText),
|
|
17
17
|
React.createElement(Button, { style: style.button, onPress: onDismiss },
|