@lookiero/checkout 8.13.5-beta.0 → 8.14.0-beta.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/dist/src/infrastructure/projection/payment/react/useViewPaymentFlowPayloadByCheckoutId.js +1 -1
- package/dist/src/infrastructure/ui/Root.d.ts +2 -0
- package/dist/src/infrastructure/ui/Root.js +2 -2
- package/dist/src/infrastructure/ui/components/organisms/returnQuestions/ReturnQuestion.d.ts +5 -0
- package/dist/src/infrastructure/ui/components/organisms/returnQuestions/ReturnQuestion.js +3 -3
- package/dist/src/infrastructure/ui/components/organisms/returnQuestions/ReturnQuestions.d.ts +5 -0
- package/dist/src/infrastructure/ui/components/organisms/returnQuestions/ReturnQuestions.js +1 -1
- package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/ReturnQuestionItem.d.ts +5 -0
- package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/hostSelectReturnQuestionItem/HostSelectReturnQuestionItem.js +2 -2
- 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.js +1 -1
- package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/hostStackReturnQuestionItem/modal/HostStackReturnQuestionItem.js +2 -2
- package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/modalOptionReturnQuestionItems/ModalOptionReturnQuestionItems.d.ts +3 -1
- package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/modalOptionReturnQuestionItems/ModalOptionReturnQuestionItems.js +3 -3
- package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/radioReturnQuestionItem/RadioReturnQuestionItem.js +4 -4
- package/dist/src/infrastructure/ui/routing/Routing.d.ts +7 -0
- package/dist/src/infrastructure/ui/routing/Routing.js +5 -5
- package/dist/src/infrastructure/ui/views/App.d.ts +8 -0
- package/dist/src/infrastructure/ui/views/App.js +8 -6
- package/dist/src/infrastructure/ui/views/App.style.d.ts +6 -0
- package/dist/src/infrastructure/ui/views/App.style.js +7 -0
- package/dist/src/infrastructure/ui/views/item/Item.d.ts +5 -0
- package/dist/src/infrastructure/ui/views/item/Item.js +3 -3
- package/dist/src/infrastructure/ui/views/item/components/getOutOfCheckoutModal/GetOutOfCheckoutModal.d.ts +2 -0
- 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 +5 -1
- 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 +5 -0
- package/dist/src/infrastructure/ui/views/item/components/returnQuestionsFeedback/ReturnQuestionsFeedback.js +2 -2
- 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 +2 -0
- 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 +5 -0
- 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 +5 -0
- package/dist/src/infrastructure/ui/views/item/views/itemWithoutCustomerDecission/ItemWithoutCustomerDecission.js +2 -2
- package/dist/src/infrastructure/ui/views/return/Return.d.ts +5 -0
- package/dist/src/infrastructure/ui/views/return/Return.js +2 -2
- package/dist/src/infrastructure/ui/views/return/components/returnQuestionsForm/ReturnQuestionsForm.d.ts +5 -0
- package/dist/src/infrastructure/ui/views/return/components/returnQuestionsForm/ReturnQuestionsForm.js +12 -14
- package/dist/src/infrastructure/ui/views/return/components/returnQuestionsForm/ReturnQuestionsForm.style.d.ts +2 -6
- package/dist/src/infrastructure/ui/views/return/components/returnQuestionsForm/ReturnQuestionsForm.style.js +2 -6
- package/dist/src/version.d.ts +1 -1
- package/dist/src/version.js +1 -1
- package/jest.setup.js +20 -0
- package/package.json +4 -3
- package/pact.config.ts +31 -0
- package/pact.publish.js +32 -0
- package/src/infrastructure/projection/bookedProductsVariants/httpBookedProductsVariantsForCheckoutItemView.pact.ts +62 -0
- package/src/infrastructure/projection/checkout/httpCheckoutByIdView.pact.ts +128 -0
- package/src/infrastructure/projection/checkout/httpFirstAvailableCheckoutByCustomerIdView.pact.ts +63 -0
- package/src/infrastructure/projection/checkout/httpFiveItemsDiscountByCustomerIdView.pact.ts +57 -0
- package/src/infrastructure/projection/checkout/httpIsCheckoutEnabledByCustomerIdView.pact.ts +57 -0
- package/src/infrastructure/projection/checkout/httpIsSizeChangeEnabledByCheckoutIdView.pact.ts +57 -0
- package/src/infrastructure/projection/checkoutBooking/httpCheckoutBookingByIdView.pact.ts +63 -0
- package/src/infrastructure/projection/checkoutItem/httpCheckoutItemByIdView.pact.ts +64 -0
- package/src/infrastructure/projection/checkoutQuestion/httpCheckoutQuestionsByCheckoutIdView.pact.ts +62 -0
- package/src/infrastructure/projection/payment/httpPaymentFlowPayloadByCheckoutIdView.pact.ts +136 -0
- package/src/infrastructure/projection/payment/react/useViewPaymentFlowPayloadByCheckoutId.ts +1 -1
- package/src/infrastructure/projection/pricing/httpPricingByCheckoutIdView.pact.ts +62 -0
- package/src/infrastructure/projection/returnQuestion/httpReturnQuestionsByCheckoutItemIdView.pact.ts +62 -0
- package/src/infrastructure/ui/Root.tsx +4 -1
- package/src/infrastructure/ui/components/organisms/returnQuestions/ReturnQuestion.tsx +14 -1
- package/src/infrastructure/ui/components/organisms/returnQuestions/ReturnQuestions.tsx +8 -1
- package/src/infrastructure/ui/components/organisms/returnQuestions/components/ReturnQuestionItem.ts +6 -0
- package/src/infrastructure/ui/components/organisms/returnQuestions/components/hostSelectReturnQuestionItem/HostSelectReturnQuestionItem.style.ts +1 -1
- package/src/infrastructure/ui/components/organisms/returnQuestions/components/hostSelectReturnQuestionItem/HostSelectReturnQuestionItem.tsx +2 -1
- package/src/infrastructure/ui/components/organisms/returnQuestions/components/hostStackReturnQuestionItem/form/HostStackReturnQuestionItem.tsx +2 -0
- package/src/infrastructure/ui/components/organisms/returnQuestions/components/hostStackReturnQuestionItem/modal/HostStackReturnQuestionItem.tsx +2 -0
- package/src/infrastructure/ui/components/organisms/returnQuestions/components/modalOptionReturnQuestionItems/ModalOptionReturnQuestionItems.tsx +5 -2
- package/src/infrastructure/ui/components/organisms/returnQuestions/components/radioReturnQuestionItem/RadioReturnQuestionItem.tsx +3 -2
- package/src/infrastructure/ui/routing/Routing.tsx +13 -5
- package/src/infrastructure/ui/views/App.style.ts +9 -0
- package/src/infrastructure/ui/views/App.tsx +21 -11
- package/src/infrastructure/ui/views/item/Item.tsx +8 -2
- package/src/infrastructure/ui/views/item/components/getOutOfCheckoutModal/GetOutOfCheckoutModal.style.ts +1 -1
- package/src/infrastructure/ui/views/item/components/getOutOfCheckoutModal/GetOutOfCheckoutModal.tsx +9 -3
- package/src/infrastructure/ui/views/item/components/itemActions/ItemActions.tsx +8 -1
- package/src/infrastructure/ui/views/item/components/returnQuestionsFeedback/ReturnQuestionsFeedback.tsx +12 -3
- 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/sizeWithoutStockModal/SizeWithoutStockModal.tsx +4 -3
- package/src/infrastructure/ui/views/item/views/itemWithCustomerDecission/ItemWithCustomerDecission.tsx +12 -2
- package/src/infrastructure/ui/views/item/views/itemWithoutCustomerDecission/ItemWithoutCustomerDecission.tsx +14 -4
- package/src/infrastructure/ui/views/return/Return.tsx +8 -1
- package/src/infrastructure/ui/views/return/components/returnQuestionsForm/ReturnQuestionsForm.style.ts +2 -6
- package/src/infrastructure/ui/views/return/components/returnQuestionsForm/ReturnQuestionsForm.tsx +33 -38
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { FC, useCallback, useState } from "react";
|
|
2
|
-
import { LayoutRectangle, Platform, ScrollView } from "react-native";
|
|
2
|
+
import { LayoutRectangle, Platform, ScrollView, StyleProp, ViewStyle } from "react-native";
|
|
3
3
|
import { Spinner } from "@lookiero/aurora";
|
|
4
4
|
import { CommandStatus } from "@lookiero/messaging-react";
|
|
5
5
|
import { useLogger } from "@lookiero/sty-psp-logging";
|
|
@@ -23,6 +23,12 @@ import { SizeWithoutStockModal } from "../../components/sizeWithoutStockModal/Si
|
|
|
23
23
|
import { ProductVariant } from "../productVariant/ProductVariant";
|
|
24
24
|
import { style } from "./ItemWithoutCustomerDecission.style";
|
|
25
25
|
|
|
26
|
+
const { space6 } = theme();
|
|
27
|
+
|
|
28
|
+
interface ItemWithoutCustomerDecissionStyle {
|
|
29
|
+
readonly modal: StyleProp<ViewStyle>;
|
|
30
|
+
}
|
|
31
|
+
|
|
26
32
|
interface CheckoutItemWithoutCustomerDecission extends CheckoutItemProjection {
|
|
27
33
|
readonly status: CheckoutItemStatus.INITIAL;
|
|
28
34
|
}
|
|
@@ -32,16 +38,16 @@ interface ItemWithoutCustomerDecissionProps {
|
|
|
32
38
|
readonly checkoutItem: CheckoutItemWithoutCustomerDecission;
|
|
33
39
|
readonly bookedProductsVariants: BookedProductsVariantsProjection;
|
|
34
40
|
readonly currentProductVariant: ProductVariantProjection;
|
|
41
|
+
readonly style?: Partial<ItemWithoutCustomerDecissionStyle>;
|
|
35
42
|
readonly onReturn: () => void;
|
|
36
43
|
}
|
|
37
44
|
|
|
38
|
-
const { space6 } = theme();
|
|
39
|
-
|
|
40
45
|
const ItemWithoutCustomerDecission: FC<ItemWithoutCustomerDecissionProps> = ({
|
|
41
46
|
checkoutId,
|
|
42
47
|
checkoutItem,
|
|
43
48
|
bookedProductsVariants,
|
|
44
49
|
currentProductVariant,
|
|
50
|
+
style: customStyle,
|
|
45
51
|
onReturn,
|
|
46
52
|
}) => {
|
|
47
53
|
const logger = useLogger();
|
|
@@ -102,7 +108,11 @@ const ItemWithoutCustomerDecission: FC<ItemWithoutCustomerDecissionProps> = ({
|
|
|
102
108
|
|
|
103
109
|
return (
|
|
104
110
|
<>
|
|
105
|
-
<SizeWithoutStockModal
|
|
111
|
+
<SizeWithoutStockModal
|
|
112
|
+
style={customStyle?.modal}
|
|
113
|
+
visible={sizeWithoutStockModalVisible}
|
|
114
|
+
onDismiss={handleOnHideSizeWithoutStockModal}
|
|
115
|
+
/>
|
|
106
116
|
|
|
107
117
|
<ScrollView showsVerticalScrollIndicator={false}>
|
|
108
118
|
<Body style={{ row: style.container }}>
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import React, { FC } from "react";
|
|
2
|
+
import { StyleProp, ViewStyle } from "react-native";
|
|
2
3
|
import { useParams } from "react-router-native";
|
|
3
4
|
import { Spinner } from "@lookiero/aurora";
|
|
4
5
|
import { QueryStatus } from "@lookiero/messaging-react";
|
|
@@ -9,11 +10,16 @@ import { ReturnQuestionFeedbackProvider } from "../../components/organisms/retur
|
|
|
9
10
|
import { useStaticInfo } from "../../hooks/useStaticInfo";
|
|
10
11
|
import { ReturnQuestionsForm } from "./components/returnQuestionsForm/ReturnQuestionsForm";
|
|
11
12
|
|
|
13
|
+
interface ReturnStyle {
|
|
14
|
+
readonly modal: StyleProp<ViewStyle>;
|
|
15
|
+
}
|
|
16
|
+
|
|
12
17
|
interface ReturnProps {
|
|
13
18
|
readonly layout: UiLayout;
|
|
19
|
+
readonly style?: Partial<ReturnStyle>;
|
|
14
20
|
}
|
|
15
21
|
|
|
16
|
-
const Return: FC<ReturnProps> = ({ layout }) => {
|
|
22
|
+
const Return: FC<ReturnProps> = ({ layout, style: customStyle }) => {
|
|
17
23
|
const { id } = useParams();
|
|
18
24
|
const {
|
|
19
25
|
customer: { customerId, country, segment },
|
|
@@ -37,6 +43,7 @@ const Return: FC<ReturnProps> = ({ layout }) => {
|
|
|
37
43
|
country={country}
|
|
38
44
|
layout={layout}
|
|
39
45
|
segment={segment}
|
|
46
|
+
style={customStyle}
|
|
40
47
|
/>
|
|
41
48
|
</ReturnQuestionFeedbackProvider>
|
|
42
49
|
);
|
|
@@ -5,9 +5,6 @@ import { HEADER_HEIGHT } from "../../../../components/templates/header/Header.st
|
|
|
5
5
|
const { borderRadius5, colorBgPrimaryLight, colorBgBase, colorTextMedium, space4, space6, space8 } = theme();
|
|
6
6
|
|
|
7
7
|
const style = StyleSheet.create({
|
|
8
|
-
background: {
|
|
9
|
-
backgroundColor: colorBgPrimaryLight,
|
|
10
|
-
},
|
|
11
8
|
description: {
|
|
12
9
|
color: colorTextMedium,
|
|
13
10
|
},
|
|
@@ -36,6 +33,7 @@ const style = StyleSheet.create({
|
|
|
36
33
|
justifyContent: "center",
|
|
37
34
|
},
|
|
38
35
|
safeAreaView: {
|
|
36
|
+
backgroundColor: colorBgPrimaryLight,
|
|
39
37
|
flex: 1,
|
|
40
38
|
},
|
|
41
39
|
scrollView: {
|
|
@@ -43,11 +41,9 @@ const style = StyleSheet.create({
|
|
|
43
41
|
},
|
|
44
42
|
submit: {
|
|
45
43
|
backgroundColor: colorBgBase,
|
|
46
|
-
padding: space6,
|
|
47
|
-
},
|
|
48
|
-
submitDesktop: {
|
|
49
44
|
borderBottomLeftRadius: borderRadius5,
|
|
50
45
|
borderBottomRightRadius: borderRadius5,
|
|
46
|
+
padding: space6,
|
|
51
47
|
},
|
|
52
48
|
});
|
|
53
49
|
|
package/src/infrastructure/ui/views/return/components/returnQuestionsForm/ReturnQuestionsForm.tsx
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { PortalHost } from "@gorhom/portal";
|
|
2
2
|
import React, { FC, useCallback, useMemo } from "react";
|
|
3
|
-
import {
|
|
4
|
-
import { KeyboardAwareScrollView } from "react-native-keyboard-aware-scroll-view";
|
|
3
|
+
import { ScrollView, StyleProp, ViewStyle } from "react-native";
|
|
5
4
|
import { generatePath, useNavigate } from "react-router-native";
|
|
6
5
|
import { Box, Button, Layout as AuroraLayout, Spinner, Text, View, useDevice } from "@lookiero/aurora";
|
|
7
6
|
import { useI18nMessage } from "@lookiero/i18n-react";
|
|
@@ -49,12 +48,17 @@ const returnQuestionItems: ReturnQuestionItems = {
|
|
|
49
48
|
[ReturnQuestionType.OPTION]: RadioReturnQuestionItem,
|
|
50
49
|
};
|
|
51
50
|
|
|
51
|
+
interface ReturnQuestionsFormStyle {
|
|
52
|
+
readonly modal: StyleProp<ViewStyle>;
|
|
53
|
+
}
|
|
54
|
+
|
|
52
55
|
interface ReturnQuestionsFormProps {
|
|
53
56
|
readonly checkout: CheckoutProjection;
|
|
54
57
|
readonly checkoutItem: CheckoutItemProjection;
|
|
55
58
|
readonly country: Country;
|
|
56
59
|
readonly layout: UiLayout;
|
|
57
60
|
readonly segment: Segment;
|
|
61
|
+
readonly style?: Partial<ReturnQuestionsFormStyle>;
|
|
58
62
|
}
|
|
59
63
|
|
|
60
64
|
const ReturnQuestionsForm: FC<ReturnQuestionsFormProps> = ({
|
|
@@ -63,6 +67,7 @@ const ReturnQuestionsForm: FC<ReturnQuestionsFormProps> = ({
|
|
|
63
67
|
country,
|
|
64
68
|
layout: Layout,
|
|
65
69
|
segment,
|
|
70
|
+
style: customStyle,
|
|
66
71
|
}) => {
|
|
67
72
|
const navigate = useNavigate();
|
|
68
73
|
const basePath = useBasePath();
|
|
@@ -143,7 +148,6 @@ const ReturnQuestionsForm: FC<ReturnQuestionsFormProps> = ({
|
|
|
143
148
|
<PortalHost name={RETURN_QUESTION_FORM_PORTAL_HOST_NAME} />
|
|
144
149
|
|
|
145
150
|
<Layout
|
|
146
|
-
footer={null}
|
|
147
151
|
header={header}
|
|
148
152
|
scrollEnabled={false}
|
|
149
153
|
style={{
|
|
@@ -154,41 +158,32 @@ const ReturnQuestionsForm: FC<ReturnQuestionsFormProps> = ({
|
|
|
154
158
|
>
|
|
155
159
|
<ProductVariantPreview country={country} item={checkoutItem} />
|
|
156
160
|
|
|
157
|
-
<
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
<View style={[style.submit, !screen.S && style.submitDesktop]}>
|
|
184
|
-
<Button testID="return-questions-button" onPress={handleOnSubmit}>
|
|
185
|
-
{submitButtonText}
|
|
186
|
-
</Button>
|
|
187
|
-
</View>
|
|
188
|
-
</Box>
|
|
189
|
-
</AuroraLayout>
|
|
190
|
-
</View>
|
|
191
|
-
</KeyboardAwareScrollView>
|
|
161
|
+
<ScrollView showsVerticalScrollIndicator={false} testID="return-questions-form">
|
|
162
|
+
<AuroraLayout fullWidth={!screen.L} style={[style.layout, screen.L ? style.desktopLayoutSpacing : undefined]}>
|
|
163
|
+
<Box size={{ L: "2/3" }}>
|
|
164
|
+
<View style={[style.info, !screen.S && style.desktopInfo]}>
|
|
165
|
+
<Text level={3} heading>
|
|
166
|
+
{titleText}
|
|
167
|
+
</Text>
|
|
168
|
+
<Text level={1} style={style.description} detail>
|
|
169
|
+
{descriptionText}
|
|
170
|
+
</Text>
|
|
171
|
+
</View>
|
|
172
|
+
|
|
173
|
+
<ReturnQuestions
|
|
174
|
+
portalHostName={RETURN_QUESTION_FORM_PORTAL_HOST_NAME}
|
|
175
|
+
returnQuestions={returnQuestions}
|
|
176
|
+
style={customStyle}
|
|
177
|
+
/>
|
|
178
|
+
|
|
179
|
+
<View style={style.submit}>
|
|
180
|
+
<Button testID="return-questions-button" onPress={handleOnSubmit}>
|
|
181
|
+
{submitButtonText}
|
|
182
|
+
</Button>
|
|
183
|
+
</View>
|
|
184
|
+
</Box>
|
|
185
|
+
</AuroraLayout>
|
|
186
|
+
</ScrollView>
|
|
192
187
|
</Layout>
|
|
193
188
|
</ReturnQuestionItemProvider>
|
|
194
189
|
);
|