@lookiero/checkout 15.0.0 → 15.0.2
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/ui/views/return/components/returnQuestionsForm/ReturnQuestionsForm.js +2 -2
- package/dist/src/version.d.ts +2 -2
- package/dist/src/version.js +2 -2
- package/package.json +3 -3
- package/public/index.html +128 -0
- package/src/infrastructure/projection/checkoutFeedback/react/useViewCheckoutFeedbackDefinitionByCheckoutId.test.ts +1 -0
- package/src/infrastructure/ui/components/organisms/checkoutQuestions/CheckoutQuestion.test.tsx +3 -0
- package/src/infrastructure/ui/components/organisms/checkoutQuestions/CheckoutQuestions.test.tsx +3 -0
- package/src/infrastructure/ui/components/organisms/checkoutQuestions/components/hostSelectCheckoutQuestionItem/HostSelectCheckoutQuestionItem.test.tsx +4 -1
- package/src/infrastructure/ui/components/organisms/returnQuestions/ReturnQuestion.test.tsx +1 -0
- package/src/infrastructure/ui/components/organisms/returnQuestions/ReturnQuestions.test.tsx +1 -0
- package/src/infrastructure/ui/components/organisms/returnQuestions/behaviors/useReturnQuestionItem.test.tsx +4 -0
- package/src/infrastructure/ui/components/organisms/returnQuestions/components/hostDefaultReturnQuestionItem/HostDefaultReturnQuestionItem.test.tsx +1 -1
- package/src/infrastructure/ui/components/organisms/returnQuestions/components/returnQuestionFeedbackItem/ReturnQuestionFeedbackItem.test.tsx +2 -2
- package/src/infrastructure/ui/hooks/useCheckoutFlow.test.tsx +2 -14
- package/src/infrastructure/ui/routing/CheckoutMiddleware.test.tsx +1 -0
- package/src/infrastructure/ui/views/checkout/Checkout.test.tsx +0 -12
- package/src/infrastructure/ui/views/item/components/getOutOfCheckoutModal/__snapshots__/GetOutOfCheckoutModal.test.tsx.snap +1 -10
- package/src/infrastructure/ui/views/item/components/productVariantSlider/ProductVariantSlider.test.tsx +4 -2
- package/src/infrastructure/ui/views/item/components/sizeWithoutStockModal/__snapshots__/SizeWithoutStockModal.test.tsx.snap +1 -10
- package/src/infrastructure/ui/views/item/views/itemWithCustomerDecission/ItemWithCustomerDecission.test.tsx +1 -0
- package/src/infrastructure/ui/views/item/views/itemWithoutCustomerDecission/ItemWithoutCustomerDecission.test.tsx +1 -0
- package/src/infrastructure/ui/views/item/views/productVariant/ProductVariant.test.tsx +1 -0
- package/src/infrastructure/ui/views/return/components/returnQuestionsForm/ReturnQuestionsForm.tsx +2 -2
- package/src/projection/checkoutFeedback/viewCheckoutFeedbackDefinitionByCheckoutId.test.ts +1 -0
- /package/{web → dist/public}/index.html +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { PortalHost } from "@gorhom/portal";
|
|
2
2
|
import React, { useCallback, useMemo } from "react";
|
|
3
3
|
import { Platform, View } from "react-native";
|
|
4
|
-
import { KeyboardAwareScrollView } from "react-native-keyboard-
|
|
4
|
+
import { KeyboardAwareScrollView } from "react-native-keyboard-controller";
|
|
5
5
|
import { generatePath, useNavigate } from "react-router-native";
|
|
6
6
|
import { Box, Layout as AuroraLayout, Spinner } from "@lookiero/aurora";
|
|
7
7
|
import { useI18nMessage } from "@lookiero/i18n-react";
|
|
@@ -111,7 +111,7 @@ const ReturnQuestionsForm = ({ checkout, checkoutItem, country, layout: Layout,
|
|
|
111
111
|
header: style.header,
|
|
112
112
|
} },
|
|
113
113
|
React.createElement(ProductVariantPreview, { country: country, item: checkoutItem }),
|
|
114
|
-
React.createElement(KeyboardAwareScrollView, {
|
|
114
|
+
React.createElement(KeyboardAwareScrollView, { bottomOffset: Platform.OS === "android" ? 10 : 120, keyboardShouldPersistTaps: "handled", showsVerticalScrollIndicator: false, testID: "return-questions-form" },
|
|
115
115
|
React.createElement(View, { style: style.background },
|
|
116
116
|
React.createElement(AuroraLayout, { fullWidth: !isDektopScreen, style: [style.layout, isDektopScreen ? style.desktopLayoutSpacing : undefined] },
|
|
117
117
|
React.createElement(Box, { size: { L: "2/3" } },
|
package/dist/src/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const VERSION = "15.0.
|
|
2
|
-
export declare const RELEASE = "checkout@15.0.
|
|
1
|
+
export declare const VERSION = "15.0.2";
|
|
2
|
+
export declare const RELEASE = "checkout@15.0.2";
|
package/dist/src/version.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export const VERSION = "15.0.
|
|
2
|
-
export const RELEASE = "checkout@15.0.
|
|
1
|
+
export const VERSION = "15.0.2";
|
|
2
|
+
export const RELEASE = "checkout@15.0.2";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lookiero/checkout",
|
|
3
|
-
"version": "15.0.
|
|
3
|
+
"version": "15.0.2",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"types": "dist/index.d.ts",
|
|
6
6
|
"sideEffects": "false",
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
"@lookiero/sty-psp-segment": "^0.1",
|
|
34
34
|
"@lookiero/sty-psp-storage": "^1.1",
|
|
35
35
|
"@lookiero/sty-psp-tracking": "^2.5",
|
|
36
|
-
"@lookiero/sty-psp-ui": "^5.
|
|
36
|
+
"@lookiero/sty-psp-ui": "^5.1",
|
|
37
37
|
"@lookiero/sty-psp-ui-settings": "^1.7",
|
|
38
38
|
"@lookiero/sty-psp-units": "^0.1",
|
|
39
39
|
"@lookiero/sty-psp-uuid": "^0.2",
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
"@sentry/react-native": "~7.2.0",
|
|
42
42
|
"react": "19.1.0",
|
|
43
43
|
"react-native": "0.81.5",
|
|
44
|
-
"react-native-keyboard-
|
|
44
|
+
"react-native-keyboard-controller": "~1.18.5",
|
|
45
45
|
"react-native-reanimated": "~4.1.1",
|
|
46
46
|
"react-native-svg": "15.12.1",
|
|
47
47
|
"react-native-worklets": "0.5.1",
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<html lang="%LANG_ISO_CODE%">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="utf-8" />
|
|
5
|
+
<meta httpEquiv="X-UA-Compatible" content="IE=edge" />
|
|
6
|
+
<!--
|
|
7
|
+
This viewport works for phones with notches.
|
|
8
|
+
It's optimized for gestures by disabling global zoom.
|
|
9
|
+
-->
|
|
10
|
+
<meta
|
|
11
|
+
name="viewport"
|
|
12
|
+
content="width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=1.00001, viewport-fit=cover"
|
|
13
|
+
/>
|
|
14
|
+
<title>%WEB_TITLE%</title>
|
|
15
|
+
<style>
|
|
16
|
+
/**
|
|
17
|
+
* Extend the react-native-web reset:
|
|
18
|
+
* https://github.com/necolas/react-native-web/blob/master/packages/react-native-web/src/exports/StyleSheet/initialRules.js
|
|
19
|
+
*/
|
|
20
|
+
html,
|
|
21
|
+
body,
|
|
22
|
+
#root {
|
|
23
|
+
width: 100%;
|
|
24
|
+
/* To smooth any scrolling behavior */
|
|
25
|
+
-webkit-overflow-scrolling: touch;
|
|
26
|
+
margin: 0px;
|
|
27
|
+
padding: 0px;
|
|
28
|
+
/* Allows content to fill the viewport and go beyond the bottom */
|
|
29
|
+
min-height: 100%;
|
|
30
|
+
}
|
|
31
|
+
#root {
|
|
32
|
+
flex-shrink: 0;
|
|
33
|
+
flex-basis: auto;
|
|
34
|
+
flex-grow: 1;
|
|
35
|
+
display: flex;
|
|
36
|
+
flex: 1;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
html {
|
|
40
|
+
scroll-behavior: smooth;
|
|
41
|
+
/* Prevent text size change on orientation change https://gist.github.com/tfausak/2222823#file-ios-8-web-app-html-L138 */
|
|
42
|
+
-webkit-text-size-adjust: 100%;
|
|
43
|
+
height: calc(100% + env(safe-area-inset-top));
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
body {
|
|
47
|
+
display: flex;
|
|
48
|
+
/* Allows you to scroll below the viewport; default value is visible */
|
|
49
|
+
overflow-y: auto;
|
|
50
|
+
overscroll-behavior-y: none;
|
|
51
|
+
text-rendering: optimizeLegibility;
|
|
52
|
+
-webkit-font-smoothing: antialiased;
|
|
53
|
+
-moz-osx-font-smoothing: grayscale;
|
|
54
|
+
-ms-overflow-style: scrollbar;
|
|
55
|
+
}
|
|
56
|
+
/* Enable for apps that support dark-theme */
|
|
57
|
+
/*@media (prefers-color-scheme: dark) {
|
|
58
|
+
body {
|
|
59
|
+
background-color: black;
|
|
60
|
+
}
|
|
61
|
+
}*/
|
|
62
|
+
</style>
|
|
63
|
+
<!-- RNW recommended styles (https://necolas.github.io/react-native-web/docs/setup/#root-element) -->
|
|
64
|
+
<style>
|
|
65
|
+
html,
|
|
66
|
+
body {
|
|
67
|
+
height: 100%;
|
|
68
|
+
}
|
|
69
|
+
#root {
|
|
70
|
+
display: flex;
|
|
71
|
+
height: 100%;
|
|
72
|
+
}
|
|
73
|
+
</style>
|
|
74
|
+
<!-- RNW recommended styles -->
|
|
75
|
+
|
|
76
|
+
<!-- Google Tag Manager -->
|
|
77
|
+
<script>
|
|
78
|
+
(function (w, d, s, l, i) {
|
|
79
|
+
w[l] = w[l] || [];
|
|
80
|
+
w[l].push({ "gtm.start": new Date().getTime(), event: "gtm.js" });
|
|
81
|
+
var f = d.getElementsByTagName(s)[0],
|
|
82
|
+
j = d.createElement(s),
|
|
83
|
+
dl = l != "dataLayer" ? "&l=" + l : "";
|
|
84
|
+
j.async = true;
|
|
85
|
+
j.src = "https://www.googletagmanager.com/gtm.js?id=" + i + dl;
|
|
86
|
+
f.parentNode.insertBefore(j, f);
|
|
87
|
+
})(window, document, "script", "dataLayer", "GTM-TCZ662G");
|
|
88
|
+
</script>
|
|
89
|
+
<!-- End Google Tag Manager -->
|
|
90
|
+
</head>
|
|
91
|
+
|
|
92
|
+
<body>
|
|
93
|
+
<!--
|
|
94
|
+
A generic no script element with a reload button and a message.
|
|
95
|
+
Feel free to customize this however you'd like.
|
|
96
|
+
-->
|
|
97
|
+
<noscript>
|
|
98
|
+
<form
|
|
99
|
+
action=""
|
|
100
|
+
style="background-color: #fff; position: fixed; top: 0; left: 0; right: 0; bottom: 0; z-index: 9999"
|
|
101
|
+
>
|
|
102
|
+
<div style="font-size: 18px; font-family: Helvetica, sans-serif; line-height: 24px; margin: 10%; width: 80%">
|
|
103
|
+
<p>Oh no! It looks like JavaScript is not enabled in your browser.</p>
|
|
104
|
+
<p style="margin: 20px 0">
|
|
105
|
+
<button
|
|
106
|
+
type="submit"
|
|
107
|
+
style="
|
|
108
|
+
background-color: #4630eb;
|
|
109
|
+
border-radius: 100px;
|
|
110
|
+
border: none;
|
|
111
|
+
box-shadow: none;
|
|
112
|
+
color: #fff;
|
|
113
|
+
cursor: pointer;
|
|
114
|
+
font-weight: bold;
|
|
115
|
+
line-height: 20px;
|
|
116
|
+
padding: 6px 16px;
|
|
117
|
+
"
|
|
118
|
+
>
|
|
119
|
+
Reload
|
|
120
|
+
</button>
|
|
121
|
+
</p>
|
|
122
|
+
</div>
|
|
123
|
+
</form>
|
|
124
|
+
</noscript>
|
|
125
|
+
<!-- The root element for your Expo app. -->
|
|
126
|
+
<div id="root"></div>
|
|
127
|
+
</body>
|
|
128
|
+
</html>
|
|
@@ -22,6 +22,7 @@ const checkoutFeedbackDefinition: CheckoutFeedbackQuestionProjection[] = [
|
|
|
22
22
|
{
|
|
23
23
|
id: "01975911-d451-7651-b1ae-3f977928e8a2",
|
|
24
24
|
type: CheckoutFeedbackQuestionType.HOST_TEXTAREA,
|
|
25
|
+
translationKey: "checkout.feedback.question.textarea",
|
|
25
26
|
metadata: {
|
|
26
27
|
showCondition: [],
|
|
27
28
|
},
|
package/src/infrastructure/ui/components/organisms/checkoutQuestions/CheckoutQuestion.test.tsx
CHANGED
|
@@ -26,16 +26,19 @@ const checkoutQuestion: CheckoutFeedbackQuestionProjection = {
|
|
|
26
26
|
id: "68c0bb98-b00a-4b86-af43-528fe903cb69",
|
|
27
27
|
translationKey: "checkout.checkout_question.icon.bad",
|
|
28
28
|
type: CheckoutFeedbackQuestionType.ICON,
|
|
29
|
+
metadata: { icon: "checkout_feedback.icon.bad" },
|
|
29
30
|
},
|
|
30
31
|
{
|
|
31
32
|
id: "85e84a77-461c-41e6-8544-95b5294d0b80",
|
|
32
33
|
translationKey: "checkout.checkout_question.icon.regular",
|
|
33
34
|
type: CheckoutFeedbackQuestionType.ICON,
|
|
35
|
+
metadata: { icon: "checkout_feedback.icon.regular" },
|
|
34
36
|
},
|
|
35
37
|
{
|
|
36
38
|
id: "29441d25-8d9f-471e-a13e-a03f61c88091",
|
|
37
39
|
translationKey: "checkout.checkout_question.icon.good",
|
|
38
40
|
type: CheckoutFeedbackQuestionType.ICON,
|
|
41
|
+
metadata: { icon: "checkout_feedback.icon.good" },
|
|
39
42
|
},
|
|
40
43
|
],
|
|
41
44
|
};
|
package/src/infrastructure/ui/components/organisms/checkoutQuestions/CheckoutQuestions.test.tsx
CHANGED
|
@@ -14,16 +14,19 @@ const checkoutQuestions: CheckoutFeedbackQuestionProjection[] = [
|
|
|
14
14
|
id: "68c0bb98-b00a-4b86-af43-528fe903cb69",
|
|
15
15
|
translationKey: "checkout.checkout_question.icon.bad",
|
|
16
16
|
type: CheckoutFeedbackQuestionType.ICON,
|
|
17
|
+
metadata: { icon: "checkout_feedback.icon.bad" },
|
|
17
18
|
},
|
|
18
19
|
{
|
|
19
20
|
id: "85e84a77-461c-41e6-8544-95b5294d0b80",
|
|
20
21
|
translationKey: "checkout.checkout_question.icon.regular",
|
|
21
22
|
type: CheckoutFeedbackQuestionType.ICON,
|
|
23
|
+
metadata: { icon: "checkout_feedback.icon.regular" },
|
|
22
24
|
},
|
|
23
25
|
{
|
|
24
26
|
id: "29441d25-8d9f-471e-a13e-a03f61c88091",
|
|
25
27
|
translationKey: "checkout.checkout_question.icon.good",
|
|
26
28
|
type: CheckoutFeedbackQuestionType.ICON,
|
|
29
|
+
metadata: { icon: "checkout_feedback.icon.good" },
|
|
27
30
|
},
|
|
28
31
|
];
|
|
29
32
|
|
|
@@ -19,16 +19,19 @@ const checkoutQuestion: CheckoutFeedbackQuestionProjection = {
|
|
|
19
19
|
id: "68c0bb98-b00a-4b86-af43-528fe903cb69",
|
|
20
20
|
translationKey: "checkout.checkout_question.icon.bad",
|
|
21
21
|
type: CheckoutFeedbackQuestionType.ICON,
|
|
22
|
+
metadata: { icon: "checkout_feedback.icon.bad" },
|
|
22
23
|
},
|
|
23
24
|
{
|
|
24
25
|
id: "85e84a77-461c-41e6-8544-95b5294d0b80",
|
|
25
26
|
translationKey: "checkout.checkout_question.icon.regular",
|
|
26
27
|
type: CheckoutFeedbackQuestionType.ICON,
|
|
28
|
+
metadata: { icon: "checkout_feedback.icon.regular" },
|
|
27
29
|
},
|
|
28
30
|
{
|
|
29
31
|
id: "29441d25-8d9f-471e-a13e-a03f61c88091",
|
|
30
32
|
translationKey: "checkout.checkout_question.icon.good",
|
|
31
33
|
type: CheckoutFeedbackQuestionType.ICON,
|
|
34
|
+
metadata: { icon: "checkout_feedback.icon.good" },
|
|
32
35
|
},
|
|
33
36
|
],
|
|
34
37
|
};
|
|
@@ -47,7 +50,7 @@ describe("HostSelectCheckoutQuestionItem component (CheckoutQuestions organism)"
|
|
|
47
50
|
it("renders correctly", async () => {
|
|
48
51
|
const { getByText } = renderHostSelectCheckoutQuestionItem();
|
|
49
52
|
|
|
50
|
-
expect(getByText(checkoutQuestion.translationKey)).toBeTruthy();
|
|
53
|
+
expect(getByText(checkoutQuestion.translationKey!)).toBeTruthy();
|
|
51
54
|
expect(getByText("HostSelectCheckoutQuestionItem children")).toBeTruthy();
|
|
52
55
|
});
|
|
53
56
|
});
|
|
@@ -48,6 +48,7 @@ const returnQuestionItems: ReturnQuestionItems = {
|
|
|
48
48
|
[ReturnQuestionType.HOST_TEXTAREA]: Item,
|
|
49
49
|
[ReturnQuestionType.HOST_SELECT]: Item,
|
|
50
50
|
[ReturnQuestionType.HOST_STACK]: Item,
|
|
51
|
+
[ReturnQuestionType.HOST_RADIO_GROUP]: Item,
|
|
51
52
|
[ReturnQuestionType.OPTION]: Item,
|
|
52
53
|
[ReturnQuestionType.TEXTAREA]: Item,
|
|
53
54
|
};
|
|
@@ -36,6 +36,7 @@ const returnQuestionItems: ReturnQuestionItems = {
|
|
|
36
36
|
[ReturnQuestionType.HOST_TEXTAREA]: Item,
|
|
37
37
|
[ReturnQuestionType.HOST_SELECT]: Item,
|
|
38
38
|
[ReturnQuestionType.HOST_STACK]: Item,
|
|
39
|
+
[ReturnQuestionType.HOST_RADIO_GROUP]: Item,
|
|
39
40
|
[ReturnQuestionType.OPTION]: Item,
|
|
40
41
|
[ReturnQuestionType.TEXTAREA]: Item,
|
|
41
42
|
};
|
|
@@ -14,6 +14,8 @@ const hostSelectText = "host select";
|
|
|
14
14
|
const HostSelect: ReturnQuestionItem<ReturnQuestionType.HOST_SELECT> = () => <Text>{hostSelectText}</Text>;
|
|
15
15
|
const hostStackText = "host stack";
|
|
16
16
|
const HostStack: ReturnQuestionItem<ReturnQuestionType.HOST_STACK> = () => <Text>{hostStackText}</Text>;
|
|
17
|
+
const hostRadioGroupText = "host radio group";
|
|
18
|
+
const HostRadioGroup: ReturnQuestionItem<ReturnQuestionType.HOST_RADIO_GROUP> = () => <Text>{hostRadioGroupText}</Text>;
|
|
17
19
|
const optionText = "option";
|
|
18
20
|
const Option: ReturnQuestionItem<ReturnQuestionType.OPTION> = () => <Text>{optionText}</Text>;
|
|
19
21
|
const textareaText = "textarea";
|
|
@@ -24,6 +26,7 @@ const returnQuestionItems: ReturnQuestionItems = {
|
|
|
24
26
|
[ReturnQuestionType.HOST_TEXTAREA]: HostDefault,
|
|
25
27
|
[ReturnQuestionType.HOST_SELECT]: HostSelect,
|
|
26
28
|
[ReturnQuestionType.HOST_STACK]: HostStack,
|
|
29
|
+
[ReturnQuestionType.HOST_RADIO_GROUP]: HostRadioGroup,
|
|
27
30
|
[ReturnQuestionType.OPTION]: Option,
|
|
28
31
|
[ReturnQuestionType.TEXTAREA]: Textarea,
|
|
29
32
|
};
|
|
@@ -33,6 +36,7 @@ const scenarios: [ReturnQuestionType, string][] = [
|
|
|
33
36
|
[ReturnQuestionType.HOST_TEXTAREA, hostDefaultText],
|
|
34
37
|
[ReturnQuestionType.HOST_SELECT, hostSelectText],
|
|
35
38
|
[ReturnQuestionType.HOST_STACK, hostStackText],
|
|
39
|
+
[ReturnQuestionType.HOST_RADIO_GROUP, hostRadioGroupText],
|
|
36
40
|
[ReturnQuestionType.OPTION, optionText],
|
|
37
41
|
[ReturnQuestionType.TEXTAREA, textareaText],
|
|
38
42
|
];
|
|
@@ -44,7 +44,7 @@ describe("HostDefaultReturnQuestionItem component (ReturnQuestions organism)", (
|
|
|
44
44
|
</HostDefaultReturnQuestionItem>,
|
|
45
45
|
);
|
|
46
46
|
|
|
47
|
-
expect(getByText(returnQuestion.translationKey)).toBeTruthy();
|
|
47
|
+
expect(getByText(returnQuestion.translationKey!)).toBeTruthy();
|
|
48
48
|
expect(getByText("HostDefaultReturnQuestionItem children")).toBeTruthy();
|
|
49
49
|
});
|
|
50
50
|
});
|
|
@@ -68,7 +68,7 @@ describe("ReturnQuestionFeedbackItem component (ReturnQuestions organism)", () =
|
|
|
68
68
|
/>,
|
|
69
69
|
);
|
|
70
70
|
|
|
71
|
-
expect(getByText(returnQuestion.translationKey)).toBeTruthy();
|
|
71
|
+
expect(getByText(returnQuestion.translationKey!)).toBeTruthy();
|
|
72
72
|
expect(getByText("size_large / size_overall")).toBeTruthy();
|
|
73
73
|
});
|
|
74
74
|
|
|
@@ -80,7 +80,7 @@ describe("ReturnQuestionFeedbackItem component (ReturnQuestions organism)", () =
|
|
|
80
80
|
/>,
|
|
81
81
|
);
|
|
82
82
|
|
|
83
|
-
expect(getByText(returnQuestionUnanswered.translationKey)).toBeTruthy();
|
|
83
|
+
expect(getByText(returnQuestionUnanswered.translationKey!)).toBeTruthy();
|
|
84
84
|
expect(getByText(I18nMessages.FEEDBACK_UNANSWERED)).toBeTruthy();
|
|
85
85
|
});
|
|
86
86
|
});
|
|
@@ -7,8 +7,6 @@ import { Segment } from "@lookiero/sty-psp-segment";
|
|
|
7
7
|
import { CheckoutItemStatus } from "../../../domain/checkoutItem/model/checkoutItem";
|
|
8
8
|
import { CheckoutBookingProjection } from "../../../projection/checkoutBooking/checkoutBooking";
|
|
9
9
|
import { Customer } from "../../../projection/customer/customer";
|
|
10
|
-
import { OrderProjection } from "../../../projection/order/order";
|
|
11
|
-
import { SubscriptionProjection } from "../../../projection/subscription/subscription";
|
|
12
10
|
import { useSubmitCheckout } from "../../domain/checkout/react/useSubmitCheckout";
|
|
13
11
|
import { checkout } from "../../projection/checkout/checkout.mock";
|
|
14
12
|
import { useViewIsSizeChangeEnabledByCheckoutId } from "../../projection/checkout/react/useViewIsSizeChangeEnabledByCheckoutId";
|
|
@@ -32,13 +30,7 @@ const mockCheckout = checkout({
|
|
|
32
30
|
{ status: CheckoutItemStatus.RETURNED },
|
|
33
31
|
],
|
|
34
32
|
});
|
|
35
|
-
const order: OrderProjection = {
|
|
36
|
-
orderNumber: 12345,
|
|
37
|
-
isFirstOrder: false,
|
|
38
|
-
coupon: null,
|
|
39
|
-
};
|
|
40
33
|
const mockPricing = mockCheckoutPricingProjection;
|
|
41
|
-
const subscription: SubscriptionProjection = "o";
|
|
42
34
|
const customerId = "a8fff6d7-708c-41a7-b42a-58c5706d33df";
|
|
43
35
|
const basePath = "/checkout";
|
|
44
36
|
const country = Country.ES;
|
|
@@ -114,9 +106,7 @@ describe("useCheckoutFlow custom hook", () => {
|
|
|
114
106
|
setTimeout(() => onSuccess(), 1000);
|
|
115
107
|
});
|
|
116
108
|
|
|
117
|
-
const { result } = renderHook(() =>
|
|
118
|
-
sut({ checkout: mockCheckout, order, subscription, getAuthToken, onSuccess: mockOnSuccess }),
|
|
119
|
-
);
|
|
109
|
+
const { result } = renderHook(() => sut({ checkout: mockCheckout, getAuthToken, onSuccess: mockOnSuccess }));
|
|
120
110
|
|
|
121
111
|
let checkoutFlow: () => void, status, paymentFlowComponent;
|
|
122
112
|
|
|
@@ -167,9 +157,7 @@ describe("useCheckoutFlow custom hook", () => {
|
|
|
167
157
|
setTimeout(() => onError({ metadata: null }), 1000);
|
|
168
158
|
});
|
|
169
159
|
|
|
170
|
-
const { result } = renderHook(() =>
|
|
171
|
-
sut({ checkout: mockCheckout, order, subscription, getAuthToken, onSuccess: mockOnSuccess }),
|
|
172
|
-
);
|
|
160
|
+
const { result } = renderHook(() => sut({ checkout: mockCheckout, getAuthToken, onSuccess: mockOnSuccess }));
|
|
173
161
|
|
|
174
162
|
let checkoutFlow: () => void, status, paymentFlowComponent;
|
|
175
163
|
|
|
@@ -8,8 +8,6 @@ import { DummyLayout } from "@lookiero/sty-psp-ui";
|
|
|
8
8
|
import { Tradename } from "@lookiero/sty-sp-tradename";
|
|
9
9
|
import { CheckoutItemStatus } from "../../../../domain/checkoutItem/model/checkoutItem";
|
|
10
10
|
import { Customer } from "../../../../projection/customer/customer";
|
|
11
|
-
import { OrderProjection } from "../../../../projection/order/order";
|
|
12
|
-
import { SubscriptionProjection } from "../../../../projection/subscription/subscription";
|
|
13
11
|
import { checkout } from "../../../projection/checkout/checkout.mock";
|
|
14
12
|
import { useViewFirstAvailableCheckoutByCustomerId } from "../../../projection/checkout/react/useViewFirstAvailableCheckoutByCustomerId";
|
|
15
13
|
import { mockCheckoutPricingProjection } from "../../../projection/pricing/pricing.mock";
|
|
@@ -38,12 +36,6 @@ const mockCheckout = checkout({
|
|
|
38
36
|
{ status: CheckoutItemStatus.REPLACED },
|
|
39
37
|
],
|
|
40
38
|
});
|
|
41
|
-
const order: OrderProjection = {
|
|
42
|
-
orderNumber: 12345,
|
|
43
|
-
isFirstOrder: false,
|
|
44
|
-
coupon: null,
|
|
45
|
-
};
|
|
46
|
-
const subscription: SubscriptionProjection = "o";
|
|
47
39
|
const mockUseRedirect = jest.fn(() => ({ returnUrl: "https://web2.dev.aws.lookiero.es/user/" }));
|
|
48
40
|
|
|
49
41
|
const mockOnSuccess = jest.fn();
|
|
@@ -95,8 +87,6 @@ describe("Checkout view", () => {
|
|
|
95
87
|
<Checkout
|
|
96
88
|
getAuthToken={getAuthToken}
|
|
97
89
|
layout={DummyLayout}
|
|
98
|
-
order={order}
|
|
99
|
-
subscription={subscription}
|
|
100
90
|
useRedirect={mockUseRedirect}
|
|
101
91
|
onCheckoutFlowSuccess={mockOnSuccess}
|
|
102
92
|
/>,
|
|
@@ -144,8 +134,6 @@ describe("Checkout view", () => {
|
|
|
144
134
|
<Checkout
|
|
145
135
|
getAuthToken={getAuthToken}
|
|
146
136
|
layout={DummyLayout}
|
|
147
|
-
order={order}
|
|
148
|
-
subscription={subscription}
|
|
149
137
|
useRedirect={mockUseRedirect}
|
|
150
138
|
onCheckoutFlowSuccess={mockOnSuccess}
|
|
151
139
|
/>,
|
|
@@ -148,16 +148,7 @@ exports[`GetOutOfCheckoutModal component matches the snapshot 1`] = `
|
|
|
148
148
|
]
|
|
149
149
|
}
|
|
150
150
|
>
|
|
151
|
-
<View
|
|
152
|
-
contentInset={
|
|
153
|
-
{
|
|
154
|
-
"bottom": 0,
|
|
155
|
-
"top": 0,
|
|
156
|
-
}
|
|
157
|
-
}
|
|
158
|
-
keyboardShouldPersistTaps="handled"
|
|
159
|
-
showsVerticalScrollIndicator={false}
|
|
160
|
-
>
|
|
151
|
+
<View>
|
|
161
152
|
<View
|
|
162
153
|
style={
|
|
163
154
|
{
|
|
@@ -26,7 +26,9 @@ afterAll(() => {
|
|
|
26
26
|
|
|
27
27
|
describe("ProductVariantSlider", () => {
|
|
28
28
|
test("matches the snapshot", async () => {
|
|
29
|
-
const { findByTestId, toJSON } = render(
|
|
29
|
+
const { findByTestId, toJSON } = render(
|
|
30
|
+
<ProductVariantSlider availableHeight={400} producVariantMedia={producVariantMedia} />,
|
|
31
|
+
);
|
|
30
32
|
|
|
31
33
|
fireEvent(await findByTestId("carousel-layout"), "layout", {
|
|
32
34
|
nativeEvent: { layout: { width: 300, height: 400 } },
|
|
@@ -37,7 +39,7 @@ describe("ProductVariantSlider", () => {
|
|
|
37
39
|
|
|
38
40
|
test("renders correctly", async () => {
|
|
39
41
|
const { findByTestId, findAllByTestId } = render(
|
|
40
|
-
<ProductVariantSlider producVariantMedia={producVariantMedia} onChanged={mockOnChanged} />,
|
|
42
|
+
<ProductVariantSlider availableHeight={400} producVariantMedia={producVariantMedia} onChanged={mockOnChanged} />,
|
|
41
43
|
);
|
|
42
44
|
|
|
43
45
|
fireEvent(await findByTestId("carousel-layout"), "layout", {
|
|
@@ -236,16 +236,7 @@ exports[`SizeWithoutStockModal component matches the snapshot 1`] = `
|
|
|
236
236
|
</Text>
|
|
237
237
|
</View>
|
|
238
238
|
</View>
|
|
239
|
-
<View
|
|
240
|
-
contentInset={
|
|
241
|
-
{
|
|
242
|
-
"bottom": 0,
|
|
243
|
-
"top": 0,
|
|
244
|
-
}
|
|
245
|
-
}
|
|
246
|
-
keyboardShouldPersistTaps="handled"
|
|
247
|
-
showsVerticalScrollIndicator={false}
|
|
248
|
-
>
|
|
239
|
+
<View>
|
|
249
240
|
<View
|
|
250
241
|
style={
|
|
251
242
|
{
|
|
@@ -50,6 +50,7 @@ const renderItemWithCustomerDecission: RenderItemWithCustomerDecissionFunction =
|
|
|
50
50
|
<ItemWithCustomerDecission
|
|
51
51
|
checkoutId={checkoutId}
|
|
52
52
|
checkoutItem={checkoutItem}
|
|
53
|
+
headerHeight={0}
|
|
53
54
|
returnQuestions={mockReturnQuestions}
|
|
54
55
|
currentProductVariant={{
|
|
55
56
|
id: checkoutItem.productVariant.id,
|
|
@@ -60,6 +60,7 @@ const renderItemWithoutCustomerDecission: RenderItemWithoutCustomerDecissionFunc
|
|
|
60
60
|
bookedProductsVariants={bookedProductVariants}
|
|
61
61
|
checkoutId={checkoutId}
|
|
62
62
|
checkoutItem={checkoutItem}
|
|
63
|
+
headerHeight={0}
|
|
63
64
|
currentProductVariant={{
|
|
64
65
|
id: checkoutItem.productVariant.id,
|
|
65
66
|
size: checkoutItem.productVariant.size,
|
package/src/infrastructure/ui/views/return/components/returnQuestionsForm/ReturnQuestionsForm.tsx
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { PortalHost } from "@gorhom/portal";
|
|
2
2
|
import React, { FC, useCallback, useMemo } from "react";
|
|
3
3
|
import { Platform, View } from "react-native";
|
|
4
|
-
import { KeyboardAwareScrollView } from "react-native-keyboard-
|
|
4
|
+
import { KeyboardAwareScrollView } from "react-native-keyboard-controller";
|
|
5
5
|
import { generatePath, useNavigate } from "react-router-native";
|
|
6
6
|
import { Box, Layout as AuroraLayout, Spinner } from "@lookiero/aurora";
|
|
7
7
|
import { useI18nMessage } from "@lookiero/i18n-react";
|
|
@@ -164,7 +164,7 @@ const ReturnQuestionsForm: FC<ReturnQuestionsFormProps> = ({
|
|
|
164
164
|
<ProductVariantPreview country={country} item={checkoutItem} />
|
|
165
165
|
|
|
166
166
|
<KeyboardAwareScrollView
|
|
167
|
-
|
|
167
|
+
bottomOffset={Platform.OS === "android" ? 10 : 120}
|
|
168
168
|
keyboardShouldPersistTaps="handled"
|
|
169
169
|
showsVerticalScrollIndicator={false}
|
|
170
170
|
testID="return-questions-form"
|
|
@@ -20,6 +20,7 @@ const checkoutFeedbackDefinition: CheckoutFeedbackQuestionProjection[] = [
|
|
|
20
20
|
{
|
|
21
21
|
id: "01975911-d451-7651-b1ae-3f977928e8a2",
|
|
22
22
|
type: CheckoutFeedbackQuestionType.HOST_TEXTAREA,
|
|
23
|
+
translationKey: "checkout.feedback.question.textarea",
|
|
23
24
|
metadata: {
|
|
24
25
|
showCondition: [],
|
|
25
26
|
},
|
|
File without changes
|