@lookiero/checkout 8.14.0 → 8.17.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/ui/components/organisms/returnQuestions/ReturnQuestion.js +1 -3
- package/dist/src/infrastructure/ui/components/organisms/returnQuestions/behaviors/isChildReturnQuestion.js +1 -2
- 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 +3 -4
- package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/hostDefaultReturnQuestionFeedbackItem/HostDefaultReturnQuestionFeedbackItem.d.ts +1 -2
- package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/hostDefaultReturnQuestionFeedbackItem/HostDefaultReturnQuestionFeedbackItem.js +0 -1
- package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/hostDefaultReturnQuestionItem/HostDefaultReturnQuestionItem.d.ts +1 -2
- package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/hostDefaultReturnQuestionItem/HostDefaultReturnQuestionItem.js +6 -8
- package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/hostRadioGroupReturnQuestionItem/HostRadioGroupReturnQuestionItem.d.ts +1 -2
- package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/hostRadioGroupReturnQuestionItem/HostRadioGroupReturnQuestionItem.js +1 -2
- package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/hostSelectReturnQuestionItem/HostSelectReturnQuestionItem.d.ts +1 -2
- package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/hostSelectReturnQuestionItem/HostSelectReturnQuestionItem.js +1 -2
- package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/hostStackReturnQuestionItem/form/HostStackReturnQuestionItem.d.ts +1 -2
- package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/hostStackReturnQuestionItem/form/HostStackReturnQuestionItem.js +0 -1
- package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/hostStackReturnQuestionItem/modal/HostStackReturnQuestionItem.d.ts +1 -2
- package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/hostStackReturnQuestionItem/modal/HostStackReturnQuestionItem.js +3 -5
- package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/modalOptionReturnQuestionItems/ModalOptionReturnQuestionItems.js +2 -4
- package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/optionReturnQuestionItem/OptionReturnQuestionItem.d.ts +1 -2
- package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/optionReturnQuestionItem/OptionReturnQuestionItem.js +1 -2
- package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/radioReturnQuestionItem/RadioReturnQuestionItem.d.ts +1 -2
- package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/radioReturnQuestionItem/RadioReturnQuestionItem.js +1 -2
- package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/returnQuestionFeedbackItem/ReturnQuestionFeedbackItem.d.ts +1 -2
- package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/returnQuestionFeedbackItem/ReturnQuestionFeedbackItem.js +1 -2
- package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/textareaReturnQuestionItem/TextareaReturnQuestionItem.d.ts +1 -2
- package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/textareaReturnQuestionItem/TextareaReturnQuestionItem.js +1 -2
- package/dist/src/infrastructure/ui/components/organisms/returnQuestions/util/returnQuestionFeedback.js +10 -22
- package/dist/src/infrastructure/ui/views/item/components/returnQuestionsFeedback/ReturnQuestionsFeedback.js +1 -1
- package/dist/src/infrastructure/ui/views/return/components/returnQuestionsForm/ReturnQuestionsForm.js +1 -1
- package/dist/src/infrastructure/ui/views/summaryTabs/components/checkoutItemsTabs/CheckoutItemsTabs.js +1 -1
- package/dist/src/projection/returnQuestion/returnQuestion.d.ts +16 -23
- package/dist/src/projection/returnQuestion/returnQuestion.js +11 -1
- package/dist/src/version.d.ts +1 -1
- package/dist/src/version.js +1 -1
- package/package.json +4 -4
- package/src/infrastructure/projection/returnQuestion/react/useListReturnQuestionsByCheckoutItemId.test.ts +9 -4
- package/src/infrastructure/projection/returnQuestion/returnQuestions.mock.ts +117 -72
- package/src/infrastructure/ui/components/organisms/returnQuestions/ReturnQuestion.test.tsx +12 -10
- package/src/infrastructure/ui/components/organisms/returnQuestions/ReturnQuestion.tsx +8 -10
- package/src/infrastructure/ui/components/organisms/returnQuestions/ReturnQuestions.test.tsx +9 -10
- package/src/infrastructure/ui/components/organisms/returnQuestions/behaviors/isChildReturnQuestion.ts +1 -2
- package/src/infrastructure/ui/components/organisms/returnQuestions/behaviors/useReturnQuestionItem.test.tsx +9 -7
- package/src/infrastructure/ui/components/organisms/returnQuestions/behaviors/useReturnQuestionItem.tsx +3 -3
- package/src/infrastructure/ui/components/organisms/returnQuestions/components/ReturnQuestionItem.ts +3 -4
- package/src/infrastructure/ui/components/organisms/returnQuestions/components/hostDefaultReturnQuestionFeedbackItem/HostDefaultReturnQuestionFeedbackItem.test.tsx +13 -7
- package/src/infrastructure/ui/components/organisms/returnQuestions/components/hostDefaultReturnQuestionFeedbackItem/HostDefaultReturnQuestionFeedbackItem.tsx +2 -4
- package/src/infrastructure/ui/components/organisms/returnQuestions/components/hostDefaultReturnQuestionItem/HostDefaultReturnQuestionItem.test.tsx +14 -8
- package/src/infrastructure/ui/components/organisms/returnQuestions/components/hostDefaultReturnQuestionItem/HostDefaultReturnQuestionItem.tsx +7 -13
- package/src/infrastructure/ui/components/organisms/returnQuestions/components/hostRadioGroupReturnQuestionItem/HostRadioGroupReturnQuestionItem.tsx +5 -7
- package/src/infrastructure/ui/components/organisms/returnQuestions/components/hostSelectReturnQuestionItem/HostSelectReturnQuestionItem.test.tsx +14 -10
- package/src/infrastructure/ui/components/organisms/returnQuestions/components/hostSelectReturnQuestionItem/HostSelectReturnQuestionItem.tsx +5 -7
- package/src/infrastructure/ui/components/organisms/returnQuestions/components/hostStackReturnQuestionItem/form/HostStackReturnQuestionItem.tsx +3 -5
- package/src/infrastructure/ui/components/organisms/returnQuestions/components/hostStackReturnQuestionItem/modal/HostStackReturnQuestionItem.test.tsx +36 -43
- package/src/infrastructure/ui/components/organisms/returnQuestions/components/hostStackReturnQuestionItem/modal/HostStackReturnQuestionItem.tsx +7 -10
- package/src/infrastructure/ui/components/organisms/returnQuestions/components/modalOptionReturnQuestionItems/ModalOptionReturnQuestionItems.tsx +9 -11
- package/src/infrastructure/ui/components/organisms/returnQuestions/components/optionReturnQuestionItem/OptionReturnQuestionItem.test.tsx +14 -8
- package/src/infrastructure/ui/components/organisms/returnQuestions/components/optionReturnQuestionItem/OptionReturnQuestionItem.tsx +4 -6
- package/src/infrastructure/ui/components/organisms/returnQuestions/components/radioReturnQuestionItem/RadioReturnQuestionItem.tsx +4 -6
- package/src/infrastructure/ui/components/organisms/returnQuestions/components/returnQuestionFeedbackItem/ReturnQuestionFeedbackItem.test.tsx +25 -23
- package/src/infrastructure/ui/components/organisms/returnQuestions/components/returnQuestionFeedbackItem/ReturnQuestionFeedbackItem.tsx +3 -5
- package/src/infrastructure/ui/components/organisms/returnQuestions/components/textareaReturnQuestionItem/TextareaReturnQuestionItem.test.tsx +29 -9
- package/src/infrastructure/ui/components/organisms/returnQuestions/components/textareaReturnQuestionItem/TextareaReturnQuestionItem.tsx +5 -7
- package/src/infrastructure/ui/components/organisms/returnQuestions/util/__snapshots__/returnQuestionFeedback.test.ts.snap +4 -5
- package/src/infrastructure/ui/components/organisms/returnQuestions/util/returnQuestionFeedback.ts +19 -40
- package/src/infrastructure/ui/views/item/components/productVariantSlider/__snapshots__/ProductVariantSlider.test.tsx.snap +26 -24
- package/src/infrastructure/ui/views/item/components/returnQuestionsFeedback/ReturnQuestionsFeedback.tsx +4 -2
- package/src/infrastructure/ui/views/item/views/productVariant/__snapshots__/ProductVariant.test.tsx.snap +78 -72
- package/src/infrastructure/ui/views/return/components/returnQuestionsForm/ReturnQuestionsForm.tsx +1 -1
- package/src/infrastructure/ui/views/shared/components/productVariant/__snapshots__/ProductVariant.test.tsx.snap +4 -4
- package/src/infrastructure/ui/views/summaryTabs/components/checkoutItemsTabs/CheckoutItemsTabs.tsx +2 -2
- package/src/infrastructure/ui/views/summaryTabs/components/checkoutItemsTabs/__snapshots__/CheckoutItemsTabs.test.tsx.snap +30 -28
- package/src/projection/returnQuestion/listReturnQuestionsByCheckoutItemId.test.ts +12 -4
- package/src/projection/returnQuestion/returnQuestion.ts +20 -42
- package/dist/src/projection/returnQuestion/returnQuestion.constants.d.ts +0 -9
- package/dist/src/projection/returnQuestion/returnQuestion.constants.js +0 -10
- package/dist/src/projection/returnQuestion/returnQuestion.metadata.d.ts +0 -12
- package/dist/src/projection/returnQuestion/returnQuestion.metadata.js +0 -1
- package/dist/src/projection/returnQuestion/returnQuestion.typeguard.d.ts +0 -5
- package/dist/src/projection/returnQuestion/returnQuestion.typeguard.js +0 -10
- package/src/projection/returnQuestion/returnQuestion.constants.ts +0 -10
- package/src/projection/returnQuestion/returnQuestion.metadata.ts +0 -17
- package/src/projection/returnQuestion/returnQuestion.typeguard.ts +0 -24
|
@@ -1,47 +1,52 @@
|
|
|
1
|
-
import { ReturnQuestionProjection } from "../../../projection/returnQuestion/returnQuestion";
|
|
2
|
-
import { ReturnQuestionType } from "../../../projection/returnQuestion/returnQuestion.constants";
|
|
1
|
+
import { ReturnQuestionProjection, ReturnQuestionType } from "../../../projection/returnQuestion/returnQuestion";
|
|
3
2
|
|
|
4
3
|
const returnQuestions: ReturnQuestionProjection[] = [
|
|
5
4
|
{
|
|
6
5
|
id: "efe07b97-f6fb-4b6a-ba92-b68519320b2c",
|
|
7
|
-
|
|
6
|
+
name: "main_title",
|
|
7
|
+
placeholder: "",
|
|
8
8
|
type: ReturnQuestionType.HOST_DEFAULT,
|
|
9
9
|
children: [
|
|
10
10
|
{
|
|
11
11
|
id: "ed396b68-1436-48ab-842f-fbfea996fad4",
|
|
12
|
-
|
|
12
|
+
name: "size",
|
|
13
|
+
placeholder: "size_placeholder",
|
|
13
14
|
type: ReturnQuestionType.HOST_SELECT,
|
|
14
|
-
metadata: {
|
|
15
|
-
placeholder: "size_placeholder",
|
|
16
|
-
},
|
|
17
15
|
children: [
|
|
18
16
|
{
|
|
19
17
|
id: "0ad1dba8-b02c-4121-a1e3-981f1c30800d",
|
|
20
|
-
|
|
18
|
+
name: "size_title",
|
|
19
|
+
placeholder: "",
|
|
21
20
|
type: ReturnQuestionType.HOST_STACK,
|
|
22
21
|
children: [
|
|
23
22
|
{
|
|
24
23
|
id: "9251dc2c-d76a-484d-9299-346929af932f",
|
|
25
|
-
|
|
24
|
+
name: "size_large",
|
|
25
|
+
placeholder: "",
|
|
26
26
|
type: ReturnQuestionType.OPTION,
|
|
27
27
|
children: [
|
|
28
28
|
{
|
|
29
29
|
id: "542c4d24-e1da-484f-8c3a-7d89ee135adc",
|
|
30
|
+
name: "",
|
|
31
|
+
placeholder: "",
|
|
30
32
|
type: ReturnQuestionType.HOST_STACK,
|
|
31
33
|
children: [
|
|
32
34
|
{
|
|
33
35
|
id: "68c0bb98-b00a-4b86-af43-528fe903cb69",
|
|
34
|
-
|
|
36
|
+
name: "size_overall",
|
|
37
|
+
placeholder: "",
|
|
35
38
|
type: ReturnQuestionType.OPTION,
|
|
36
39
|
},
|
|
37
40
|
{
|
|
38
41
|
id: "85e84a77-461c-41e6-8544-95b5294d0b80",
|
|
39
|
-
|
|
42
|
+
name: "size_trousers_too_long",
|
|
43
|
+
placeholder: "",
|
|
40
44
|
type: ReturnQuestionType.OPTION,
|
|
41
45
|
},
|
|
42
46
|
{
|
|
43
47
|
id: "29441d25-8d9f-471e-a13e-a03f61c88091",
|
|
44
|
-
|
|
48
|
+
name: "size_fit_cut_does_not_fit",
|
|
49
|
+
placeholder: "",
|
|
45
50
|
type: ReturnQuestionType.OPTION,
|
|
46
51
|
},
|
|
47
52
|
],
|
|
@@ -50,31 +55,38 @@ const returnQuestions: ReturnQuestionProjection[] = [
|
|
|
50
55
|
},
|
|
51
56
|
{
|
|
52
57
|
id: "a081c3e9-1904-4a60-8899-b72c1a3a0291",
|
|
53
|
-
|
|
58
|
+
name: "size_correct",
|
|
59
|
+
placeholder: "",
|
|
54
60
|
type: ReturnQuestionType.OPTION,
|
|
55
61
|
},
|
|
56
62
|
{
|
|
57
63
|
id: "624cce3d-bd86-463a-b16b-c862ad73d5f3",
|
|
58
|
-
|
|
64
|
+
name: "size_small",
|
|
65
|
+
placeholder: "",
|
|
59
66
|
type: ReturnQuestionType.OPTION,
|
|
60
67
|
children: [
|
|
61
68
|
{
|
|
62
69
|
id: "58e5ae9a-bc0d-4d27-b267-854a51c2a79a",
|
|
70
|
+
name: "",
|
|
71
|
+
placeholder: "",
|
|
63
72
|
type: ReturnQuestionType.HOST_STACK,
|
|
64
73
|
children: [
|
|
65
74
|
{
|
|
66
75
|
id: "6a3d11fc-570c-4085-a850-1967228cdd4c",
|
|
67
|
-
|
|
76
|
+
name: "size_overall",
|
|
77
|
+
placeholder: "",
|
|
68
78
|
type: ReturnQuestionType.OPTION,
|
|
69
79
|
},
|
|
70
80
|
{
|
|
71
81
|
id: "c27e1936-deea-4dbe-a8f1-fe4fb8564deb",
|
|
72
|
-
|
|
82
|
+
name: "size_trousers_too_short",
|
|
83
|
+
placeholder: "",
|
|
73
84
|
type: ReturnQuestionType.OPTION,
|
|
74
85
|
},
|
|
75
86
|
{
|
|
76
87
|
id: "e77232ae-eeec-4722-b2d3-f5c0d34fd0ca",
|
|
77
|
-
|
|
88
|
+
name: "size_fit_cut_does_not_fit",
|
|
89
|
+
placeholder: "",
|
|
78
90
|
type: ReturnQuestionType.OPTION,
|
|
79
91
|
},
|
|
80
92
|
],
|
|
@@ -87,39 +99,44 @@ const returnQuestions: ReturnQuestionProjection[] = [
|
|
|
87
99
|
},
|
|
88
100
|
{
|
|
89
101
|
id: "6a6d3878-5561-412c-96f3-7ed79ee587bb",
|
|
90
|
-
|
|
102
|
+
name: "style",
|
|
103
|
+
placeholder: "style_placeholder",
|
|
91
104
|
type: ReturnQuestionType.HOST_SELECT,
|
|
92
|
-
metadata: {
|
|
93
|
-
placeholder: "style_placeholder",
|
|
94
|
-
},
|
|
95
105
|
children: [
|
|
96
106
|
{
|
|
97
107
|
id: "fd7ff4a0-78ed-4c0d-aa4d-64962739c322",
|
|
98
|
-
|
|
108
|
+
name: "style_title",
|
|
109
|
+
placeholder: "",
|
|
99
110
|
type: ReturnQuestionType.HOST_STACK,
|
|
100
111
|
children: [
|
|
101
112
|
{
|
|
102
113
|
id: "56631448-d33d-49fb-b3f8-4486b68b60c3",
|
|
103
|
-
|
|
114
|
+
name: "style_i_love_it_but",
|
|
115
|
+
placeholder: "",
|
|
104
116
|
type: ReturnQuestionType.OPTION,
|
|
105
117
|
children: [
|
|
106
118
|
{
|
|
107
119
|
id: "90329d91-bd5d-4439-bb0a-b338caaeff2b",
|
|
120
|
+
name: "",
|
|
121
|
+
placeholder: "",
|
|
108
122
|
type: ReturnQuestionType.HOST_STACK,
|
|
109
123
|
children: [
|
|
110
124
|
{
|
|
111
125
|
id: "a3d937b6-7499-4a3c-86bf-5c0af9ab2e23",
|
|
112
|
-
|
|
126
|
+
name: "style_i_already_have_something_similar",
|
|
127
|
+
placeholder: "",
|
|
113
128
|
type: ReturnQuestionType.OPTION,
|
|
114
129
|
},
|
|
115
130
|
{
|
|
116
131
|
id: "7970edd3-fb5c-42d3-afe3-ce31bcbb856c",
|
|
117
|
-
|
|
132
|
+
name: "style_very_basic_simple",
|
|
133
|
+
placeholder: "",
|
|
118
134
|
type: ReturnQuestionType.OPTION,
|
|
119
135
|
},
|
|
120
136
|
{
|
|
121
137
|
id: "bab3d4f9-0227-4550-a53f-3c125d68429c",
|
|
122
|
-
|
|
138
|
+
name: "style_i_dont_need_it_at_the_moment",
|
|
139
|
+
placeholder: "",
|
|
123
140
|
type: ReturnQuestionType.OPTION,
|
|
124
141
|
},
|
|
125
142
|
],
|
|
@@ -128,26 +145,32 @@ const returnQuestions: ReturnQuestionProjection[] = [
|
|
|
128
145
|
},
|
|
129
146
|
{
|
|
130
147
|
id: "5287d1df-a28a-42cd-9138-01f82aeea4c2",
|
|
131
|
-
|
|
148
|
+
name: "style_i_like_it_but",
|
|
149
|
+
placeholder: "",
|
|
132
150
|
type: ReturnQuestionType.OPTION,
|
|
133
151
|
children: [
|
|
134
152
|
{
|
|
135
153
|
id: "35b86395-6b6b-4a39-ab16-05511f58acdd",
|
|
154
|
+
name: "",
|
|
155
|
+
placeholder: "",
|
|
136
156
|
type: ReturnQuestionType.HOST_STACK,
|
|
137
157
|
children: [
|
|
138
158
|
{
|
|
139
159
|
id: "e1f6ac53-f203-4b32-9ff0-782c028d9e95",
|
|
140
|
-
|
|
160
|
+
name: "style_i_already_have_something_similar",
|
|
161
|
+
placeholder: "",
|
|
141
162
|
type: ReturnQuestionType.OPTION,
|
|
142
163
|
},
|
|
143
164
|
{
|
|
144
165
|
id: "12875926-b67a-4ad3-852c-1608c7dcc558",
|
|
145
|
-
|
|
166
|
+
name: "style_very_basic_simple",
|
|
167
|
+
placeholder: "",
|
|
146
168
|
type: ReturnQuestionType.OPTION,
|
|
147
169
|
},
|
|
148
170
|
{
|
|
149
171
|
id: "a5eb96bf-73d4-4df5-8ad8-097410b24526",
|
|
150
|
-
|
|
172
|
+
name: "style_i_dont_need_it_at_the_moment",
|
|
173
|
+
placeholder: "",
|
|
151
174
|
type: ReturnQuestionType.OPTION,
|
|
152
175
|
},
|
|
153
176
|
],
|
|
@@ -156,36 +179,44 @@ const returnQuestions: ReturnQuestionProjection[] = [
|
|
|
156
179
|
},
|
|
157
180
|
{
|
|
158
181
|
id: "757107a9-8e2d-4194-a7fe-0d55cde49c11",
|
|
159
|
-
|
|
182
|
+
name: "style_not_bad_but",
|
|
183
|
+
placeholder: "",
|
|
160
184
|
type: ReturnQuestionType.OPTION,
|
|
161
185
|
children: [
|
|
162
186
|
{
|
|
163
187
|
id: "c6f75ee3-a445-4103-a682-f0c3a742108d",
|
|
188
|
+
name: "",
|
|
189
|
+
placeholder: "",
|
|
164
190
|
type: ReturnQuestionType.HOST_STACK,
|
|
165
191
|
children: [
|
|
166
192
|
{
|
|
167
193
|
id: "4f46d4b1-b103-43b2-b669-be721ab46e03",
|
|
168
|
-
|
|
194
|
+
name: "style_i_dont_like_the_color",
|
|
195
|
+
placeholder: "",
|
|
169
196
|
type: ReturnQuestionType.OPTION,
|
|
170
197
|
},
|
|
171
198
|
{
|
|
172
199
|
id: "48412165-5e05-4806-8e21-ea59c41d0479",
|
|
173
|
-
|
|
200
|
+
name: "style_very_basic_simple",
|
|
201
|
+
placeholder: "",
|
|
174
202
|
type: ReturnQuestionType.OPTION,
|
|
175
203
|
},
|
|
176
204
|
{
|
|
177
205
|
id: "51262c01-eaa3-4d3a-aeb9-95dc8b0dd687",
|
|
178
|
-
|
|
206
|
+
name: "style_i_dont_like_the_fabric",
|
|
207
|
+
placeholder: "",
|
|
179
208
|
type: ReturnQuestionType.OPTION,
|
|
180
209
|
},
|
|
181
210
|
{
|
|
182
211
|
id: "9dea1c2b-4f8c-4192-a547-999df55e77e4",
|
|
183
|
-
|
|
212
|
+
name: "style_i_dont_like_the_print",
|
|
213
|
+
placeholder: "",
|
|
184
214
|
type: ReturnQuestionType.OPTION,
|
|
185
215
|
},
|
|
186
216
|
{
|
|
187
217
|
id: "b1277bf3-4bbb-487a-8e58-88efecc61c3f",
|
|
188
|
-
|
|
218
|
+
name: "style_not_my_style_in_general",
|
|
219
|
+
placeholder: "",
|
|
189
220
|
type: ReturnQuestionType.OPTION,
|
|
190
221
|
},
|
|
191
222
|
],
|
|
@@ -194,36 +225,44 @@ const returnQuestions: ReturnQuestionProjection[] = [
|
|
|
194
225
|
},
|
|
195
226
|
{
|
|
196
227
|
id: "8a9cd6f8-db4b-4904-8a48-3d9bbd6f7a69",
|
|
197
|
-
|
|
228
|
+
name: "style_i_dont_like",
|
|
229
|
+
placeholder: "",
|
|
198
230
|
type: ReturnQuestionType.OPTION,
|
|
199
231
|
children: [
|
|
200
232
|
{
|
|
201
233
|
id: "f604240d-c093-4a9e-ab85-4adc0744066a",
|
|
234
|
+
name: "",
|
|
235
|
+
placeholder: "",
|
|
202
236
|
type: ReturnQuestionType.HOST_STACK,
|
|
203
237
|
children: [
|
|
204
238
|
{
|
|
205
239
|
id: "42dbbb93-7808-4ac3-8431-582f812cb314",
|
|
206
|
-
|
|
240
|
+
name: "style_i_dont_like_the_color",
|
|
241
|
+
placeholder: "",
|
|
207
242
|
type: ReturnQuestionType.OPTION,
|
|
208
243
|
},
|
|
209
244
|
{
|
|
210
245
|
id: "af1ade81-7b22-4f7e-a505-2ae275a6440f",
|
|
211
|
-
|
|
246
|
+
name: "style_very_basic_simple",
|
|
247
|
+
placeholder: "",
|
|
212
248
|
type: ReturnQuestionType.OPTION,
|
|
213
249
|
},
|
|
214
250
|
{
|
|
215
251
|
id: "26d073b4-2588-4391-9b4c-e8e4a8eba2a8",
|
|
216
|
-
|
|
252
|
+
name: "style_i_dont_like_the_fabric",
|
|
253
|
+
placeholder: "",
|
|
217
254
|
type: ReturnQuestionType.OPTION,
|
|
218
255
|
},
|
|
219
256
|
{
|
|
220
257
|
id: "ee50ab07-b7a6-415e-a04a-c9f350396185",
|
|
221
|
-
|
|
258
|
+
name: "style_i_dont_like_the_print",
|
|
259
|
+
placeholder: "",
|
|
222
260
|
type: ReturnQuestionType.OPTION,
|
|
223
261
|
},
|
|
224
262
|
{
|
|
225
263
|
id: "ce3227e4-851e-47b7-98c1-c63a402e8477",
|
|
226
|
-
|
|
264
|
+
name: "style_not_my_style_in_general",
|
|
265
|
+
placeholder: "",
|
|
227
266
|
type: ReturnQuestionType.OPTION,
|
|
228
267
|
},
|
|
229
268
|
],
|
|
@@ -236,30 +275,32 @@ const returnQuestions: ReturnQuestionProjection[] = [
|
|
|
236
275
|
},
|
|
237
276
|
{
|
|
238
277
|
id: "a1acdb2d-62c8-467f-b7cc-dc24d967290c",
|
|
239
|
-
|
|
278
|
+
name: "quality",
|
|
279
|
+
placeholder: "quality_placeholder",
|
|
240
280
|
type: ReturnQuestionType.HOST_SELECT,
|
|
241
|
-
metadata: {
|
|
242
|
-
placeholder: "quality_placeholder",
|
|
243
|
-
},
|
|
244
281
|
children: [
|
|
245
282
|
{
|
|
246
283
|
id: "405de847-188f-46c1-b66d-941c22a6b7a9",
|
|
247
|
-
|
|
284
|
+
name: "quality_title",
|
|
285
|
+
placeholder: "",
|
|
248
286
|
type: ReturnQuestionType.HOST_STACK,
|
|
249
287
|
children: [
|
|
250
288
|
{
|
|
251
289
|
id: "cce7851c-92c7-461b-8dcb-903c5de59ed1",
|
|
252
|
-
|
|
290
|
+
name: "quality_good",
|
|
291
|
+
placeholder: "",
|
|
253
292
|
type: ReturnQuestionType.OPTION,
|
|
254
293
|
},
|
|
255
294
|
{
|
|
256
295
|
id: "4bf8f27d-669b-4d36-8d39-b5599c671816",
|
|
257
|
-
|
|
296
|
+
name: "quality_regular",
|
|
297
|
+
placeholder: "",
|
|
258
298
|
type: ReturnQuestionType.OPTION,
|
|
259
299
|
},
|
|
260
300
|
{
|
|
261
301
|
id: "48bfe766-92c0-4ff5-a793-e107b60786ff",
|
|
262
|
-
|
|
302
|
+
name: "quality_bad",
|
|
303
|
+
placeholder: "",
|
|
263
304
|
type: ReturnQuestionType.OPTION,
|
|
264
305
|
},
|
|
265
306
|
],
|
|
@@ -268,30 +309,32 @@ const returnQuestions: ReturnQuestionProjection[] = [
|
|
|
268
309
|
},
|
|
269
310
|
{
|
|
270
311
|
id: "f25ccdcf-b648-479e-b4a1-86129e3e8c0b",
|
|
271
|
-
|
|
312
|
+
name: "price",
|
|
313
|
+
placeholder: "price_placeholder",
|
|
272
314
|
type: ReturnQuestionType.HOST_SELECT,
|
|
273
|
-
metadata: {
|
|
274
|
-
placeholder: "price_placeholder",
|
|
275
|
-
},
|
|
276
315
|
children: [
|
|
277
316
|
{
|
|
278
317
|
id: "b0e0463c-787f-4d6c-adf3-5151ab6fc959",
|
|
279
|
-
|
|
318
|
+
name: "price_title",
|
|
319
|
+
placeholder: "",
|
|
280
320
|
type: ReturnQuestionType.HOST_STACK,
|
|
281
321
|
children: [
|
|
282
322
|
{
|
|
283
323
|
id: "9c59e396-4135-4255-9437-22555837d686",
|
|
284
|
-
|
|
324
|
+
name: "price_expensive",
|
|
325
|
+
placeholder: "",
|
|
285
326
|
type: ReturnQuestionType.OPTION,
|
|
286
327
|
},
|
|
287
328
|
{
|
|
288
329
|
id: "10db17f8-0982-49ee-9aeb-f752d953654c",
|
|
289
|
-
|
|
330
|
+
name: "price_cheap",
|
|
331
|
+
placeholder: "",
|
|
290
332
|
type: ReturnQuestionType.OPTION,
|
|
291
333
|
},
|
|
292
334
|
{
|
|
293
335
|
id: "acf64bb3-b91b-48e7-bba1-0541620ed1c5",
|
|
294
|
-
|
|
336
|
+
name: "price_fair",
|
|
337
|
+
placeholder: "",
|
|
295
338
|
type: ReturnQuestionType.OPTION,
|
|
296
339
|
},
|
|
297
340
|
],
|
|
@@ -300,35 +343,38 @@ const returnQuestions: ReturnQuestionProjection[] = [
|
|
|
300
343
|
},
|
|
301
344
|
{
|
|
302
345
|
id: "b7ad1665-5e54-4ee4-b455-e7189f33083c",
|
|
303
|
-
|
|
346
|
+
name: "others",
|
|
347
|
+
placeholder: "others_placeholder",
|
|
304
348
|
type: ReturnQuestionType.HOST_SELECT,
|
|
305
|
-
metadata: {
|
|
306
|
-
placeholder: "others_placeholder",
|
|
307
|
-
},
|
|
308
349
|
children: [
|
|
309
350
|
{
|
|
310
351
|
id: "32cd0ef9-78d7-4605-a279-556749b36d4a",
|
|
311
|
-
|
|
352
|
+
name: "others_title",
|
|
353
|
+
placeholder: "",
|
|
312
354
|
type: ReturnQuestionType.HOST_STACK,
|
|
313
355
|
children: [
|
|
314
356
|
{
|
|
315
357
|
id: "95c4fd13-9ca3-45a6-8795-23415bbd0a5e",
|
|
316
|
-
|
|
358
|
+
name: "others_i_dont_like_the_brand",
|
|
359
|
+
placeholder: "",
|
|
317
360
|
type: ReturnQuestionType.OPTION,
|
|
318
361
|
},
|
|
319
362
|
{
|
|
320
363
|
id: "f25c63bd-42d3-4242-9b81-927025aa9d67",
|
|
321
|
-
|
|
364
|
+
name: "others_different_from_preview",
|
|
365
|
+
placeholder: "",
|
|
322
366
|
type: ReturnQuestionType.OPTION,
|
|
323
367
|
},
|
|
324
368
|
{
|
|
325
369
|
id: "0e0b16c1-a721-4a14-aea6-e0cf5c262222",
|
|
326
|
-
|
|
370
|
+
name: "others_delivery_delay",
|
|
371
|
+
placeholder: "",
|
|
327
372
|
type: ReturnQuestionType.OPTION,
|
|
328
373
|
},
|
|
329
374
|
{
|
|
330
375
|
id: "11699ae8-325d-429c-9c05-ff2d6cc45d54",
|
|
331
|
-
|
|
376
|
+
name: "others_item_is_defective",
|
|
377
|
+
placeholder: "",
|
|
332
378
|
type: ReturnQuestionType.OPTION,
|
|
333
379
|
},
|
|
334
380
|
],
|
|
@@ -339,16 +385,15 @@ const returnQuestions: ReturnQuestionProjection[] = [
|
|
|
339
385
|
},
|
|
340
386
|
{
|
|
341
387
|
id: "ce3e8d57-5eea-4dd3-bef4-2e811a143612",
|
|
342
|
-
|
|
388
|
+
name: "comment_title",
|
|
389
|
+
placeholder: "",
|
|
343
390
|
type: ReturnQuestionType.HOST_TEXTAREA,
|
|
344
391
|
children: [
|
|
345
392
|
{
|
|
346
393
|
id: "1123a37d-bc00-43a4-9d28-cee1dfaf356c",
|
|
347
|
-
|
|
394
|
+
name: "comment_textarea",
|
|
395
|
+
placeholder: "comment_textarea_placeholder",
|
|
348
396
|
type: ReturnQuestionType.TEXTAREA,
|
|
349
|
-
metadata: {
|
|
350
|
-
placeholder: "comment_textarea_placeholder",
|
|
351
|
-
},
|
|
352
397
|
},
|
|
353
398
|
],
|
|
354
399
|
},
|
|
@@ -1,12 +1,10 @@
|
|
|
1
|
-
/* eslint-disable react/prop-types */
|
|
2
1
|
import { render } from "@testing-library/react-native";
|
|
3
2
|
import React, { ReactNode } from "react";
|
|
4
3
|
import { Text } from "react-native";
|
|
5
|
-
import { ReturnQuestionProjection } from "../../../../../projection/returnQuestion/returnQuestion";
|
|
6
|
-
import { ReturnQuestionType } from "../../../../../projection/returnQuestion/returnQuestion.constants";
|
|
4
|
+
import { ReturnQuestionProjection, ReturnQuestionType } from "../../../../../projection/returnQuestion/returnQuestion";
|
|
7
5
|
import ReturnQuestion from "./ReturnQuestion";
|
|
8
6
|
import { ReturnQuestionItemProvider, ReturnQuestionItems } from "./behaviors/useReturnQuestionItem";
|
|
9
|
-
import { ReturnQuestionItem } from "./components/ReturnQuestionItem";
|
|
7
|
+
import { ReturnQuestionItem, ReturnQuestionItemProps } from "./components/ReturnQuestionItem";
|
|
10
8
|
|
|
11
9
|
const mockOnChange = jest.fn();
|
|
12
10
|
jest.mock("./behaviors/useReturnQuestionFeedback", () => ({
|
|
@@ -15,30 +13,34 @@ jest.mock("./behaviors/useReturnQuestionFeedback", () => ({
|
|
|
15
13
|
|
|
16
14
|
const returnQuestion: ReturnQuestionProjection = {
|
|
17
15
|
id: "9251dc2c-d76a-484d-9299-346929af932f",
|
|
18
|
-
|
|
16
|
+
name: "size_large",
|
|
17
|
+
placeholder: "",
|
|
19
18
|
type: ReturnQuestionType.OPTION,
|
|
20
19
|
children: [
|
|
21
20
|
{
|
|
22
21
|
id: "68c0bb98-b00a-4b86-af43-528fe903cb69",
|
|
23
|
-
|
|
22
|
+
name: "size_overall",
|
|
23
|
+
placeholder: "",
|
|
24
24
|
type: ReturnQuestionType.OPTION,
|
|
25
25
|
},
|
|
26
26
|
{
|
|
27
27
|
id: "85e84a77-461c-41e6-8544-95b5294d0b80",
|
|
28
|
-
|
|
28
|
+
name: "size_trousers_too_long",
|
|
29
|
+
placeholder: "",
|
|
29
30
|
type: ReturnQuestionType.OPTION,
|
|
30
31
|
},
|
|
31
32
|
{
|
|
32
33
|
id: "29441d25-8d9f-471e-a13e-a03f61c88091",
|
|
33
|
-
|
|
34
|
+
name: "size_fit_cut_does_not_fit",
|
|
35
|
+
placeholder: "",
|
|
34
36
|
type: ReturnQuestionType.OPTION,
|
|
35
37
|
},
|
|
36
38
|
],
|
|
37
39
|
};
|
|
38
40
|
|
|
39
|
-
const Item: ReturnQuestionItem
|
|
41
|
+
const Item: ReturnQuestionItem = ({ returnQuestion, children }: ReturnQuestionItemProps) => (
|
|
40
42
|
<>
|
|
41
|
-
<Text>{returnQuestion.
|
|
43
|
+
<Text>{returnQuestion.name}</Text>
|
|
42
44
|
{children}
|
|
43
45
|
</>
|
|
44
46
|
);
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import React, { FC, memo } from "react";
|
|
2
2
|
import { ReturnQuestionProjection } from "../../../../../projection/returnQuestion/returnQuestion";
|
|
3
|
-
import { returnQuestionHasChildren } from "../../../../../projection/returnQuestion/returnQuestion.typeguard";
|
|
4
3
|
import { useReturnQuestionItem } from "./behaviors/useReturnQuestionItem";
|
|
5
4
|
|
|
6
5
|
interface ReturnQuestionProps {
|
|
@@ -20,15 +19,14 @@ const ReturnQuestion: FC<ReturnQuestionProps> = ({ returnQuestionParent, returnQ
|
|
|
20
19
|
testID={returnQuestion.id}
|
|
21
20
|
>
|
|
22
21
|
<>
|
|
23
|
-
{
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
))}
|
|
22
|
+
{returnQuestion.children?.map((childReturnQuestion) => (
|
|
23
|
+
<ReturnQuestion
|
|
24
|
+
key={childReturnQuestion.id}
|
|
25
|
+
portalHostName={portalHostName}
|
|
26
|
+
returnQuestion={childReturnQuestion}
|
|
27
|
+
returnQuestionParent={returnQuestion}
|
|
28
|
+
/>
|
|
29
|
+
))}
|
|
32
30
|
</>
|
|
33
31
|
</Item>
|
|
34
32
|
);
|
|
@@ -1,35 +1,34 @@
|
|
|
1
|
-
/* eslint-disable react/prop-types */
|
|
2
1
|
import { render } from "@testing-library/react-native";
|
|
3
2
|
import React, { ReactNode } from "react";
|
|
4
3
|
import { Text } from "react-native";
|
|
5
|
-
import { ReturnQuestionProjection } from "../../../../../projection/returnQuestion/returnQuestion";
|
|
6
|
-
import { ReturnQuestionType } from "../../../../../projection/returnQuestion/returnQuestion.constants";
|
|
4
|
+
import { ReturnQuestionProjection, ReturnQuestionType } from "../../../../../projection/returnQuestion/returnQuestion";
|
|
7
5
|
import { ReturnQuestions } from "./ReturnQuestions";
|
|
8
6
|
import { ReturnQuestionFeedbackProvider } from "./behaviors/useReturnQuestionFeedback";
|
|
9
7
|
import { ReturnQuestionItemProvider, ReturnQuestionItems } from "./behaviors/useReturnQuestionItem";
|
|
10
|
-
import { ReturnQuestionItem } from "./components/ReturnQuestionItem";
|
|
8
|
+
import { ReturnQuestionItem, ReturnQuestionItemProps } from "./components/ReturnQuestionItem";
|
|
11
9
|
|
|
12
10
|
const returnQuestions: ReturnQuestionProjection[] = [
|
|
13
11
|
{
|
|
14
12
|
id: "68c0bb98-b00a-4b86-af43-528fe903cb69",
|
|
15
|
-
|
|
13
|
+
name: "size_overall",
|
|
14
|
+
placeholder: "",
|
|
16
15
|
type: ReturnQuestionType.OPTION,
|
|
17
16
|
},
|
|
18
17
|
{
|
|
19
18
|
id: "85e84a77-461c-41e6-8544-95b5294d0b80",
|
|
20
|
-
|
|
19
|
+
name: "size_trousers_too_long",
|
|
20
|
+
placeholder: "",
|
|
21
21
|
type: ReturnQuestionType.OPTION,
|
|
22
22
|
},
|
|
23
23
|
{
|
|
24
24
|
id: "29441d25-8d9f-471e-a13e-a03f61c88091",
|
|
25
|
-
|
|
25
|
+
name: "size_fit_cut_does_not_fit",
|
|
26
|
+
placeholder: "",
|
|
26
27
|
type: ReturnQuestionType.OPTION,
|
|
27
28
|
},
|
|
28
29
|
];
|
|
29
30
|
|
|
30
|
-
const Item: ReturnQuestionItem
|
|
31
|
-
<Text>{returnQuestion.translationKey}</Text>
|
|
32
|
-
);
|
|
31
|
+
const Item: ReturnQuestionItem = ({ returnQuestion }: ReturnQuestionItemProps) => <Text>{returnQuestion.name}</Text>;
|
|
33
32
|
|
|
34
33
|
const returnQuestionItems: ReturnQuestionItems = {
|
|
35
34
|
[ReturnQuestionType.HOST_DEFAULT]: Item,
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { ReturnQuestionProjection } from "../../../../../../projection/returnQuestion/returnQuestion";
|
|
2
|
-
import { returnQuestionHasChildren } from "../../../../../../projection/returnQuestion/returnQuestion.typeguard";
|
|
3
2
|
|
|
4
3
|
interface IsChildReturnQuestionFunctionArgs {
|
|
5
4
|
readonly returnQuestionId: string;
|
|
@@ -14,7 +13,7 @@ const isChildReturnQuestion: IsChildReturnQuestionFunction = ({ returnQuestionId
|
|
|
14
13
|
return true;
|
|
15
14
|
}
|
|
16
15
|
|
|
17
|
-
const children =
|
|
16
|
+
const children = returnQuestion.children || [];
|
|
18
17
|
|
|
19
18
|
for (let index = 0; index < children.length; index++) {
|
|
20
19
|
const isChild = isChildReturnQuestion({
|
|
@@ -1,23 +1,25 @@
|
|
|
1
1
|
import { renderHook } from "@testing-library/react-native";
|
|
2
2
|
import React from "react";
|
|
3
3
|
import { Text } from "react-native";
|
|
4
|
-
import {
|
|
5
|
-
|
|
4
|
+
import {
|
|
5
|
+
ReturnQuestionProjection,
|
|
6
|
+
ReturnQuestionType,
|
|
7
|
+
} from "../../../../../../projection/returnQuestion/returnQuestion";
|
|
6
8
|
import { createWrapper } from "../../../../test/createWrapper";
|
|
7
9
|
import { render } from "../../../../test/render";
|
|
8
10
|
import { ReturnQuestionItem } from "../components/ReturnQuestionItem";
|
|
9
11
|
import { ReturnQuestionItemProvider, ReturnQuestionItems, useReturnQuestionItem as sut } from "./useReturnQuestionItem";
|
|
10
12
|
|
|
11
13
|
const hostDefaultText = "host default";
|
|
12
|
-
const HostDefault: ReturnQuestionItem
|
|
14
|
+
const HostDefault: ReturnQuestionItem = () => <Text>{hostDefaultText}</Text>;
|
|
13
15
|
const hostSelectText = "host select";
|
|
14
|
-
const HostSelect: ReturnQuestionItem
|
|
16
|
+
const HostSelect: ReturnQuestionItem = () => <Text>{hostSelectText}</Text>;
|
|
15
17
|
const hostStackText = "host stack";
|
|
16
|
-
const HostStack: ReturnQuestionItem
|
|
18
|
+
const HostStack: ReturnQuestionItem = () => <Text>{hostStackText}</Text>;
|
|
17
19
|
const optionText = "option";
|
|
18
|
-
const Option: ReturnQuestionItem
|
|
20
|
+
const Option: ReturnQuestionItem = () => <Text>{optionText}</Text>;
|
|
19
21
|
const textareaText = "textarea";
|
|
20
|
-
const Textarea: ReturnQuestionItem
|
|
22
|
+
const Textarea: ReturnQuestionItem = () => <Text>{textareaText}</Text>;
|
|
21
23
|
|
|
22
24
|
const returnQuestionItems: ReturnQuestionItems = {
|
|
23
25
|
[ReturnQuestionType.HOST_DEFAULT]: HostDefault,
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import React, { createContext, FC, ReactNode, useContext, useMemo } from "react";
|
|
2
2
|
import invariant from "tiny-invariant";
|
|
3
|
-
import { ReturnQuestionType } from "../../../../../../projection/returnQuestion/returnQuestion
|
|
3
|
+
import { ReturnQuestionType } from "../../../../../../projection/returnQuestion/returnQuestion";
|
|
4
4
|
import { ReturnQuestionItem } from "../components/ReturnQuestionItem";
|
|
5
5
|
|
|
6
|
-
type ReturnQuestionItems = Record<ReturnQuestionType, ReturnQuestionItem
|
|
6
|
+
type ReturnQuestionItems = Record<ReturnQuestionType, ReturnQuestionItem>;
|
|
7
7
|
|
|
8
8
|
const ReturnQuestionItemContext = createContext<ReturnQuestionItems>({} as ReturnQuestionItems);
|
|
9
9
|
|
|
@@ -21,7 +21,7 @@ interface UseReturnQuestionItemFunctionArgs {
|
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
interface UseReturnQuestionItemFunction {
|
|
24
|
-
(args: UseReturnQuestionItemFunctionArgs): ReturnQuestionItem
|
|
24
|
+
(args: UseReturnQuestionItemFunctionArgs): ReturnQuestionItem;
|
|
25
25
|
}
|
|
26
26
|
|
|
27
27
|
const useReturnQuestionItem: UseReturnQuestionItemFunction = ({ type }) => {
|