@lookiero/checkout 8.14.0 → 8.15.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.
Files changed (81) hide show
  1. package/dist/src/infrastructure/ui/components/organisms/returnQuestions/ReturnQuestion.js +1 -3
  2. package/dist/src/infrastructure/ui/components/organisms/returnQuestions/behaviors/isChildReturnQuestion.js +1 -2
  3. package/dist/src/infrastructure/ui/components/organisms/returnQuestions/behaviors/useReturnQuestionItem.d.ts +3 -3
  4. package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/ReturnQuestionItem.d.ts +3 -4
  5. package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/hostDefaultReturnQuestionFeedbackItem/HostDefaultReturnQuestionFeedbackItem.d.ts +1 -2
  6. package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/hostDefaultReturnQuestionFeedbackItem/HostDefaultReturnQuestionFeedbackItem.js +0 -1
  7. package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/hostDefaultReturnQuestionItem/HostDefaultReturnQuestionItem.d.ts +1 -2
  8. package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/hostDefaultReturnQuestionItem/HostDefaultReturnQuestionItem.js +6 -8
  9. package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/hostRadioGroupReturnQuestionItem/HostRadioGroupReturnQuestionItem.d.ts +1 -2
  10. package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/hostRadioGroupReturnQuestionItem/HostRadioGroupReturnQuestionItem.js +1 -2
  11. package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/hostSelectReturnQuestionItem/HostSelectReturnQuestionItem.d.ts +1 -2
  12. package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/hostSelectReturnQuestionItem/HostSelectReturnQuestionItem.js +1 -2
  13. package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/hostStackReturnQuestionItem/form/HostStackReturnQuestionItem.d.ts +1 -2
  14. package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/hostStackReturnQuestionItem/form/HostStackReturnQuestionItem.js +0 -1
  15. package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/hostStackReturnQuestionItem/modal/HostStackReturnQuestionItem.d.ts +1 -2
  16. package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/hostStackReturnQuestionItem/modal/HostStackReturnQuestionItem.js +3 -5
  17. package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/modalOptionReturnQuestionItems/ModalOptionReturnQuestionItems.js +2 -4
  18. package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/optionReturnQuestionItem/OptionReturnQuestionItem.d.ts +1 -2
  19. package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/optionReturnQuestionItem/OptionReturnQuestionItem.js +1 -2
  20. package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/radioReturnQuestionItem/RadioReturnQuestionItem.d.ts +1 -2
  21. package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/radioReturnQuestionItem/RadioReturnQuestionItem.js +1 -2
  22. package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/returnQuestionFeedbackItem/ReturnQuestionFeedbackItem.d.ts +1 -2
  23. package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/returnQuestionFeedbackItem/ReturnQuestionFeedbackItem.js +1 -2
  24. package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/textareaReturnQuestionItem/TextareaReturnQuestionItem.d.ts +1 -2
  25. package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/textareaReturnQuestionItem/TextareaReturnQuestionItem.js +1 -2
  26. package/dist/src/infrastructure/ui/components/organisms/returnQuestions/util/returnQuestionFeedback.js +9 -18
  27. package/dist/src/infrastructure/ui/views/item/components/returnQuestionsFeedback/ReturnQuestionsFeedback.js +1 -1
  28. package/dist/src/infrastructure/ui/views/return/components/returnQuestionsForm/ReturnQuestionsForm.js +1 -1
  29. package/dist/src/infrastructure/ui/views/summaryTabs/components/checkoutItemsTabs/CheckoutItemsTabs.js +1 -1
  30. package/dist/src/projection/returnQuestion/returnQuestion.d.ts +16 -23
  31. package/dist/src/projection/returnQuestion/returnQuestion.js +11 -1
  32. package/dist/src/version.d.ts +1 -1
  33. package/dist/src/version.js +1 -1
  34. package/package.json +3 -3
  35. package/src/infrastructure/projection/returnQuestion/react/useListReturnQuestionsByCheckoutItemId.test.ts +9 -4
  36. package/src/infrastructure/projection/returnQuestion/returnQuestions.mock.ts +117 -72
  37. package/src/infrastructure/ui/components/organisms/returnQuestions/ReturnQuestion.test.tsx +12 -10
  38. package/src/infrastructure/ui/components/organisms/returnQuestions/ReturnQuestion.tsx +8 -10
  39. package/src/infrastructure/ui/components/organisms/returnQuestions/ReturnQuestions.test.tsx +9 -10
  40. package/src/infrastructure/ui/components/organisms/returnQuestions/behaviors/isChildReturnQuestion.ts +1 -2
  41. package/src/infrastructure/ui/components/organisms/returnQuestions/behaviors/useReturnQuestionItem.test.tsx +9 -7
  42. package/src/infrastructure/ui/components/organisms/returnQuestions/behaviors/useReturnQuestionItem.tsx +3 -3
  43. package/src/infrastructure/ui/components/organisms/returnQuestions/components/ReturnQuestionItem.ts +3 -4
  44. package/src/infrastructure/ui/components/organisms/returnQuestions/components/hostDefaultReturnQuestionFeedbackItem/HostDefaultReturnQuestionFeedbackItem.test.tsx +13 -7
  45. package/src/infrastructure/ui/components/organisms/returnQuestions/components/hostDefaultReturnQuestionFeedbackItem/HostDefaultReturnQuestionFeedbackItem.tsx +2 -4
  46. package/src/infrastructure/ui/components/organisms/returnQuestions/components/hostDefaultReturnQuestionItem/HostDefaultReturnQuestionItem.test.tsx +14 -8
  47. package/src/infrastructure/ui/components/organisms/returnQuestions/components/hostDefaultReturnQuestionItem/HostDefaultReturnQuestionItem.tsx +7 -13
  48. package/src/infrastructure/ui/components/organisms/returnQuestions/components/hostRadioGroupReturnQuestionItem/HostRadioGroupReturnQuestionItem.tsx +5 -7
  49. package/src/infrastructure/ui/components/organisms/returnQuestions/components/hostSelectReturnQuestionItem/HostSelectReturnQuestionItem.test.tsx +14 -10
  50. package/src/infrastructure/ui/components/organisms/returnQuestions/components/hostSelectReturnQuestionItem/HostSelectReturnQuestionItem.tsx +5 -7
  51. package/src/infrastructure/ui/components/organisms/returnQuestions/components/hostStackReturnQuestionItem/form/HostStackReturnQuestionItem.tsx +3 -5
  52. package/src/infrastructure/ui/components/organisms/returnQuestions/components/hostStackReturnQuestionItem/modal/HostStackReturnQuestionItem.test.tsx +36 -43
  53. package/src/infrastructure/ui/components/organisms/returnQuestions/components/hostStackReturnQuestionItem/modal/HostStackReturnQuestionItem.tsx +7 -10
  54. package/src/infrastructure/ui/components/organisms/returnQuestions/components/modalOptionReturnQuestionItems/ModalOptionReturnQuestionItems.tsx +9 -11
  55. package/src/infrastructure/ui/components/organisms/returnQuestions/components/optionReturnQuestionItem/OptionReturnQuestionItem.test.tsx +14 -8
  56. package/src/infrastructure/ui/components/organisms/returnQuestions/components/optionReturnQuestionItem/OptionReturnQuestionItem.tsx +4 -6
  57. package/src/infrastructure/ui/components/organisms/returnQuestions/components/radioReturnQuestionItem/RadioReturnQuestionItem.tsx +4 -6
  58. package/src/infrastructure/ui/components/organisms/returnQuestions/components/returnQuestionFeedbackItem/ReturnQuestionFeedbackItem.test.tsx +25 -23
  59. package/src/infrastructure/ui/components/organisms/returnQuestions/components/returnQuestionFeedbackItem/ReturnQuestionFeedbackItem.tsx +3 -5
  60. package/src/infrastructure/ui/components/organisms/returnQuestions/components/textareaReturnQuestionItem/TextareaReturnQuestionItem.test.tsx +29 -9
  61. package/src/infrastructure/ui/components/organisms/returnQuestions/components/textareaReturnQuestionItem/TextareaReturnQuestionItem.tsx +5 -7
  62. package/src/infrastructure/ui/components/organisms/returnQuestions/util/__snapshots__/returnQuestionFeedback.test.ts.snap +4 -5
  63. package/src/infrastructure/ui/components/organisms/returnQuestions/util/returnQuestionFeedback.ts +18 -32
  64. package/src/infrastructure/ui/views/item/components/productVariantSlider/__snapshots__/ProductVariantSlider.test.tsx.snap +26 -24
  65. package/src/infrastructure/ui/views/item/components/returnQuestionsFeedback/ReturnQuestionsFeedback.tsx +4 -2
  66. package/src/infrastructure/ui/views/item/views/productVariant/__snapshots__/ProductVariant.test.tsx.snap +78 -72
  67. package/src/infrastructure/ui/views/return/components/returnQuestionsForm/ReturnQuestionsForm.tsx +1 -1
  68. package/src/infrastructure/ui/views/shared/components/productVariant/__snapshots__/ProductVariant.test.tsx.snap +4 -4
  69. package/src/infrastructure/ui/views/summaryTabs/components/checkoutItemsTabs/CheckoutItemsTabs.tsx +2 -2
  70. package/src/infrastructure/ui/views/summaryTabs/components/checkoutItemsTabs/__snapshots__/CheckoutItemsTabs.test.tsx.snap +30 -28
  71. package/src/projection/returnQuestion/listReturnQuestionsByCheckoutItemId.test.ts +12 -4
  72. package/src/projection/returnQuestion/returnQuestion.ts +20 -42
  73. package/dist/src/projection/returnQuestion/returnQuestion.constants.d.ts +0 -9
  74. package/dist/src/projection/returnQuestion/returnQuestion.constants.js +0 -10
  75. package/dist/src/projection/returnQuestion/returnQuestion.metadata.d.ts +0 -12
  76. package/dist/src/projection/returnQuestion/returnQuestion.metadata.js +0 -1
  77. package/dist/src/projection/returnQuestion/returnQuestion.typeguard.d.ts +0 -5
  78. package/dist/src/projection/returnQuestion/returnQuestion.typeguard.js +0 -10
  79. package/src/projection/returnQuestion/returnQuestion.constants.ts +0 -10
  80. package/src/projection/returnQuestion/returnQuestion.metadata.ts +0 -17
  81. package/src/projection/returnQuestion/returnQuestion.typeguard.ts +0 -24
@@ -1,6 +1,8 @@
1
1
  import React from "react";
2
- import { ReturnQuestionProjection } from "../../../../../../../projection/returnQuestion/returnQuestion";
3
- import { ReturnQuestionType } from "../../../../../../../projection/returnQuestion/returnQuestion.constants";
2
+ import {
3
+ ReturnQuestionProjection,
4
+ ReturnQuestionType,
5
+ } from "../../../../../../../projection/returnQuestion/returnQuestion";
4
6
  import { feedback as mockFeedback } from "../../../../../../projection/feedback/feedback.mock";
5
7
  import { I18nMessages } from "../../../../../i18n/i18n";
6
8
  import { render } from "../../../../../test/render";
@@ -10,34 +12,40 @@ jest.mock("../../behaviors/useReturnQuestionFeedback", () => ({
10
12
  useReturnQuestionFeedback: () => mockFeedback,
11
13
  }));
12
14
 
13
- const returnQuestion: ReturnQuestionProjection<ReturnQuestionType.HOST_DEFAULT> = {
15
+ const returnQuestion: ReturnQuestionProjection = {
14
16
  id: "0ad1dba8-b02c-4121-a1e3-981f1c30800d",
15
- translationKey: "size_title",
16
- type: ReturnQuestionType.HOST_DEFAULT,
17
+ name: "size_title",
18
+ placeholder: "",
19
+ type: ReturnQuestionType.HOST_STACK,
17
20
  children: [
18
21
  {
19
22
  id: "9251dc2c-d76a-484d-9299-346929af932f",
20
- translationKey: "size_large",
23
+ name: "size_large",
24
+ placeholder: "",
21
25
  type: ReturnQuestionType.OPTION,
22
26
  children: [
23
27
  {
24
28
  id: "542c4d24-e1da-484f-8c3a-7d89ee135adc",
25
- translationKey: "",
26
- type: ReturnQuestionType.HOST_DEFAULT,
29
+ name: "",
30
+ placeholder: "",
31
+ type: ReturnQuestionType.HOST_STACK,
27
32
  children: [
28
33
  {
29
34
  id: "68c0bb98-b00a-4b86-af43-528fe903cb69",
30
- translationKey: "size_overall",
35
+ name: "size_overall",
36
+ placeholder: "",
31
37
  type: ReturnQuestionType.OPTION,
32
38
  },
33
39
  {
34
40
  id: "85e84a77-461c-41e6-8544-95b5294d0b80",
35
- translationKey: "size_trousers_too_long",
41
+ name: "size_trousers_too_long",
42
+ placeholder: "",
36
43
  type: ReturnQuestionType.OPTION,
37
44
  },
38
45
  {
39
46
  id: "29441d25-8d9f-471e-a13e-a03f61c88091",
40
- translationKey: "size_fit_cut_does_not_fit",
47
+ name: "size_fit_cut_does_not_fit",
48
+ placeholder: "",
41
49
  type: ReturnQuestionType.OPTION,
42
50
  },
43
51
  ],
@@ -46,17 +54,11 @@ const returnQuestion: ReturnQuestionProjection<ReturnQuestionType.HOST_DEFAULT>
46
54
  },
47
55
  ],
48
56
  };
49
- const returnQuestionUnanswered: ReturnQuestionProjection<ReturnQuestionType.HOST_DEFAULT> = {
57
+ const returnQuestionUnanswered: ReturnQuestionProjection = {
50
58
  id: "fd7ff4a0-78ed-4c0d-aa4d-64962739c322",
51
- translationKey: "style_title",
52
- type: ReturnQuestionType.HOST_DEFAULT,
53
- children: [
54
- {
55
- id: "68c0bb98-b00a-4b86-af43-528fe903cb69",
56
- translationKey: "size_overall",
57
- type: ReturnQuestionType.OPTION,
58
- },
59
- ],
59
+ name: "style_title",
60
+ placeholder: "",
61
+ type: ReturnQuestionType.HOST_STACK,
60
62
  };
61
63
 
62
64
  describe("ReturnQuestionFeedbackItem component (ReturnQuestions organism)", () => {
@@ -68,7 +70,7 @@ describe("ReturnQuestionFeedbackItem component (ReturnQuestions organism)", () =
68
70
  />,
69
71
  );
70
72
 
71
- expect(getByText(returnQuestion.translationKey)).toBeTruthy();
73
+ expect(getByText(returnQuestion.name)).toBeTruthy();
72
74
  expect(getByText("size_large / size_overall")).toBeTruthy();
73
75
  });
74
76
 
@@ -80,7 +82,7 @@ describe("ReturnQuestionFeedbackItem component (ReturnQuestions organism)", () =
80
82
  />,
81
83
  );
82
84
 
83
- expect(getByText(returnQuestionUnanswered.translationKey)).toBeTruthy();
85
+ expect(getByText(returnQuestionUnanswered.name)).toBeTruthy();
84
86
  expect(getByText(I18nMessages.FEEDBACK_UNANSWERED)).toBeTruthy();
85
87
  });
86
88
  });
@@ -1,17 +1,15 @@
1
- /* eslint-disable react/prop-types */
2
1
  import React, { useCallback } from "react";
3
2
  import { View } from "react-native";
4
3
  import { Text } from "@lookiero/aurora";
5
4
  import { useI18nMessage, useIntl } from "@lookiero/i18n-react";
6
- import { ReturnQuestionType } from "../../../../../../../projection/returnQuestion/returnQuestion.constants";
7
5
  import { I18nMessages } from "../../../../../i18n/i18n";
8
6
  import { useReturnQuestionFeedback } from "../../behaviors/useReturnQuestionFeedback";
9
7
  import { feedbackForReturnQuestion } from "../../util/returnQuestionFeedback";
10
- import { ReturnQuestionItem } from "../ReturnQuestionItem";
8
+ import { ReturnQuestionItem, ReturnQuestionItemProps } from "../ReturnQuestionItem";
11
9
  import { style } from "./ReturnQuestionFeedbackItem.style";
12
10
 
13
- const ReturnQuestionFeedbackItem: ReturnQuestionItem<ReturnQuestionType.HOST_DEFAULT> = ({ returnQuestion }) => {
14
- const titleText = useI18nMessage({ id: returnQuestion.translationKey });
11
+ const ReturnQuestionFeedbackItem: ReturnQuestionItem = ({ returnQuestion }: ReturnQuestionItemProps) => {
12
+ const titleText = useI18nMessage({ id: returnQuestion.name });
15
13
  const unansweredText = useI18nMessage({ id: I18nMessages.FEEDBACK_UNANSWERED });
16
14
 
17
15
  const returnQuestionFeedback = useReturnQuestionFeedback();
@@ -1,7 +1,9 @@
1
1
  import { fireEvent } from "@testing-library/react-native";
2
2
  import React from "react";
3
- import { ReturnQuestionProjection } from "../../../../../../../projection/returnQuestion/returnQuestion";
4
- import { ReturnQuestionType } from "../../../../../../../projection/returnQuestion/returnQuestion.constants";
3
+ import {
4
+ ReturnQuestionProjection,
5
+ ReturnQuestionType,
6
+ } from "../../../../../../../projection/returnQuestion/returnQuestion";
5
7
  import { render } from "../../../../../test/render";
6
8
  import { TextareaReturnQuestionItem } from "./TextareaReturnQuestionItem";
7
9
 
@@ -13,13 +15,31 @@ jest.mock("../../behaviors/useReturnQuestionFeedback", () => ({
13
15
  const returnQuestionParent = {
14
16
  id: "0ad1dba8-b02c-4121-a1e3-981f1c30800d",
15
17
  } as ReturnQuestionProjection;
16
- const returnQuestion: ReturnQuestionProjection<ReturnQuestionType.TEXTAREA> = {
17
- id: "1123a37d-bc00-43a4-9d28-cee1dfaf356c",
18
- translationKey: "comment_textarea",
19
- type: ReturnQuestionType.TEXTAREA,
20
- metadata: {
21
- placeholder: "comment_textarea_placeholder",
22
- },
18
+ const returnQuestion: ReturnQuestionProjection = {
19
+ id: "9251dc2c-d76a-484d-9299-346929af932f",
20
+ name: "size_large",
21
+ placeholder: "",
22
+ type: ReturnQuestionType.OPTION,
23
+ children: [
24
+ {
25
+ id: "68c0bb98-b00a-4b86-af43-528fe903cb69",
26
+ name: "size_overall",
27
+ placeholder: "",
28
+ type: ReturnQuestionType.OPTION,
29
+ },
30
+ {
31
+ id: "85e84a77-461c-41e6-8544-95b5294d0b80",
32
+ name: "size_trousers_too_long",
33
+ placeholder: "",
34
+ type: ReturnQuestionType.OPTION,
35
+ },
36
+ {
37
+ id: "29441d25-8d9f-471e-a13e-a03f61c88091",
38
+ name: "size_fit_cut_does_not_fit",
39
+ placeholder: "",
40
+ type: ReturnQuestionType.OPTION,
41
+ },
42
+ ],
23
43
  };
24
44
 
25
45
  describe("TextareaReturnQuestionItem component (ReturnQuestions organism)", () => {
@@ -1,23 +1,21 @@
1
- /* eslint-disable react/prop-types */
2
1
  import React, { useCallback, useMemo } from "react";
3
2
  import { View } from "@lookiero/aurora";
4
3
  import { useIntl } from "@lookiero/i18n-react";
5
- import { ReturnQuestionType } from "../../../../../../../projection/returnQuestion/returnQuestion.constants";
6
4
  import { InputField } from "../../../../../../../shared/ui/components/molecules/inputField/InputField";
7
5
  import { useReturnQuestionFeedbackForReturnQuestion } from "../../behaviors/useReturnQuestionFeedback";
8
- import { ReturnQuestionItem } from "../ReturnQuestionItem";
6
+ import { ReturnQuestionItem, ReturnQuestionItemProps } from "../ReturnQuestionItem";
9
7
  import { style } from "./TextareaReturnQuestionItem.style";
10
8
 
11
- const TextareaReturnQuestionItem: ReturnQuestionItem<ReturnQuestionType.TEXTAREA> = ({
9
+ const TextareaReturnQuestionItem: ReturnQuestionItem = ({
12
10
  returnQuestion,
13
11
  returnQuestionParent,
14
12
  testID,
15
- }) => {
13
+ }: ReturnQuestionItemProps) => {
16
14
  const { formatMessage } = useIntl();
17
15
 
18
16
  const placeholderText = useMemo(
19
- () => (returnQuestion.metadata.placeholder ? formatMessage({ id: returnQuestion.metadata.placeholder }) : ""),
20
- [formatMessage, returnQuestion.metadata.placeholder],
17
+ () => (returnQuestion.placeholder ? formatMessage({ id: returnQuestion.placeholder }) : ""),
18
+ [formatMessage, returnQuestion.placeholder],
21
19
  );
22
20
 
23
21
  const { feedback, onChange } = useReturnQuestionFeedbackForReturnQuestion({ returnQuestion: returnQuestionParent });
@@ -13,15 +13,14 @@ exports[`returnQuestionFeedback utils return the deepest returnQuestion with fee
13
13
  "children": [
14
14
  {
15
15
  "id": "1123a37d-bc00-43a4-9d28-cee1dfaf356c",
16
- "metadata": {
17
- "placeholder": "comment_textarea_placeholder",
18
- },
19
- "translationKey": "comment_textarea",
16
+ "name": "comment_textarea",
17
+ "placeholder": "comment_textarea_placeholder",
20
18
  "type": "TEXTAREA",
21
19
  },
22
20
  ],
23
21
  "id": "ce3e8d57-5eea-4dd3-bef4-2e811a143612",
24
- "translationKey": "comment_title",
22
+ "name": "comment_title",
23
+ "placeholder": "",
25
24
  "type": "HOST_TEXTAREA",
26
25
  },
27
26
  false,
@@ -1,9 +1,5 @@
1
1
  import { FeedbackProjection } from "../../../../../../projection/feedback/feedback";
2
2
  import { ReturnQuestionProjection } from "../../../../../../projection/returnQuestion/returnQuestion";
3
- import {
4
- returnQuestionHasChildren,
5
- returnQuestionWithTranslationKey,
6
- } from "../../../../../../projection/returnQuestion/returnQuestion.typeguard";
7
3
 
8
4
  type Uuid = string;
9
5
 
@@ -36,16 +32,14 @@ const feedbackForReturnQuestion: RecursiveFeedbackForReturnQuestionFunction = ({
36
32
  const returnQuestionFeedback = feedback[returnQuestionId];
37
33
 
38
34
  if (isUuid(returnQuestionFeedback as string)) {
39
- const feebackReturnQuestionChild =
40
- returnQuestionHasChildren(returnQuestion) &&
41
- returnQuestion.children?.find((childReturnQuestion) => childReturnQuestion.id === returnQuestionFeedback);
35
+ const feebackReturnQuestionChild = returnQuestion.children?.find(
36
+ (childReturnQuestion) => childReturnQuestion.id === returnQuestionFeedback,
37
+ );
42
38
 
43
39
  if (feebackReturnQuestionChild) {
44
40
  return [
45
41
  ...acc,
46
- ...(returnQuestionWithTranslationKey(feebackReturnQuestionChild)
47
- ? [translate(feebackReturnQuestionChild.translationKey)]
48
- : []),
42
+ translate(feebackReturnQuestionChild?.name),
49
43
  ...feedbackForReturnQuestion({ feedback, returnQuestion: feebackReturnQuestionChild, translate, acc }),
50
44
  ];
51
45
  }
@@ -57,15 +51,13 @@ const feedbackForReturnQuestion: RecursiveFeedbackForReturnQuestionFunction = ({
57
51
  }
58
52
 
59
53
  return (
60
- (returnQuestionHasChildren(returnQuestion) &&
61
- returnQuestion.children?.reduce(
62
- (acc, childReturnQuestion) => [
63
- ...acc,
64
- ...feedbackForReturnQuestion({ feedback, returnQuestion: childReturnQuestion, translate, acc }),
65
- ],
66
- [] as string[],
67
- )) ||
68
- []
54
+ returnQuestion.children?.reduce(
55
+ (acc, childReturnQuestion) => [
56
+ ...acc,
57
+ ...feedbackForReturnQuestion({ feedback, returnQuestion: childReturnQuestion, translate, acc }),
58
+ ],
59
+ [] as string[],
60
+ ) || []
69
61
  );
70
62
  };
71
63
 
@@ -92,9 +84,9 @@ const deepestReturnQuestionWithFeedbackForReturnQuestion: RecursiveDeepestReturn
92
84
  const returnQuestionFeedback = feedback[returnQuestionId];
93
85
 
94
86
  if (isUuid(returnQuestionFeedback as string)) {
95
- const feebackReturnQuestionChild =
96
- returnQuestionHasChildren(returnQuestion) &&
97
- returnQuestion.children?.find((childReturnQuestion) => childReturnQuestion.id === returnQuestionFeedback);
87
+ const feebackReturnQuestionChild = returnQuestion.children?.find(
88
+ (childReturnQuestion) => childReturnQuestion.id === returnQuestionFeedback,
89
+ );
98
90
 
99
91
  if (feebackReturnQuestionChild) {
100
92
  return deepestReturnQuestionWithFeedbackForReturnQuestion({
@@ -110,11 +102,9 @@ const deepestReturnQuestionWithFeedbackForReturnQuestion: RecursiveDeepestReturn
110
102
  return [returnQuestion, false];
111
103
  }
112
104
 
113
- const feebackReturnQuestionChild =
114
- returnQuestionHasChildren(returnQuestion) &&
115
- returnQuestion.children?.find((childReturnQuestion) =>
116
- Object.keys(feedback).find((id) => id === childReturnQuestion.id),
117
- );
105
+ const feebackReturnQuestionChild = returnQuestion.children?.find((childReturnQuestion) =>
106
+ Object.keys(feedback).find((id) => id === childReturnQuestion.id),
107
+ );
118
108
 
119
109
  if (feebackReturnQuestionChild) {
120
110
  return deepestReturnQuestionWithFeedbackForReturnQuestion({
@@ -124,11 +114,7 @@ const deepestReturnQuestionWithFeedbackForReturnQuestion: RecursiveDeepestReturn
124
114
  });
125
115
  }
126
116
 
127
- const hasChildren = Boolean(
128
- returnQuestionHasChildren(returnQuestion) && returnQuestion.children && returnQuestion.children.length > 0,
129
- );
130
-
131
- return [deepestReturnQuestion, !hasChildren];
117
+ return [deepestReturnQuestion, !returnQuestion.children || returnQuestion.children.length === 0];
132
118
  };
133
119
 
134
120
  export { feedbackForReturnQuestion, deepestReturnQuestionWithFeedbackForReturnQuestion };
@@ -77,7 +77,8 @@ exports[`ProductVariantSlider matches the snapshot 1`] = `
77
77
  style={{}}
78
78
  >
79
79
  <View
80
- animatedStyle={
80
+ collapsable={false}
81
+ jestAnimatedStyle={
81
82
  {
82
83
  "value": {
83
84
  "transform": [
@@ -88,7 +89,6 @@ exports[`ProductVariantSlider matches the snapshot 1`] = `
88
89
  },
89
90
  }
90
91
  }
91
- collapsable={false}
92
92
  style={
93
93
  {
94
94
  "flex": 1,
@@ -105,16 +105,17 @@ exports[`ProductVariantSlider matches the snapshot 1`] = `
105
105
  testID="carousel-track"
106
106
  >
107
107
  <View
108
+ collapsable={false}
109
+ jestAnimatedStyle={
110
+ {
111
+ "value": {},
112
+ }
113
+ }
108
114
  style={
109
- [
110
- {
111
- "flex": 1,
112
- },
113
- undefined,
114
- {
115
- "width": 300,
116
- },
117
- ]
115
+ {
116
+ "flex": 1,
117
+ "width": 300,
118
+ }
118
119
  }
119
120
  testID="carousel-item"
120
121
  >
@@ -231,14 +232,14 @@ exports[`ProductVariantSlider matches the snapshot 1`] = `
231
232
  </View>
232
233
  </View>
233
234
  <Image
234
- animatedStyle={
235
+ collapsable={false}
236
+ jestAnimatedStyle={
235
237
  {
236
238
  "value": {
237
239
  "opacity": 0,
238
240
  },
239
241
  }
240
242
  }
241
- collapsable={false}
242
243
  onLoad={[Function]}
243
244
  resizeMode="stretch"
244
245
  source={
@@ -263,16 +264,17 @@ exports[`ProductVariantSlider matches the snapshot 1`] = `
263
264
  </View>
264
265
  </View>
265
266
  <View
267
+ collapsable={false}
268
+ jestAnimatedStyle={
269
+ {
270
+ "value": {},
271
+ }
272
+ }
266
273
  style={
267
- [
268
- {
269
- "flex": 1,
270
- },
271
- undefined,
272
- {
273
- "width": 300,
274
- },
275
- ]
274
+ {
275
+ "flex": 1,
276
+ "width": 300,
277
+ }
276
278
  }
277
279
  testID="carousel-item"
278
280
  >
@@ -389,14 +391,14 @@ exports[`ProductVariantSlider matches the snapshot 1`] = `
389
391
  </View>
390
392
  </View>
391
393
  <Image
392
- animatedStyle={
394
+ collapsable={false}
395
+ jestAnimatedStyle={
393
396
  {
394
397
  "value": {
395
398
  "opacity": 0,
396
399
  },
397
400
  }
398
401
  }
399
- collapsable={false}
400
402
  onLoad={[Function]}
401
403
  resizeMode="stretch"
402
404
  source={
@@ -2,8 +2,10 @@ import React, { FC } from "react";
2
2
  import { View } from "react-native";
3
3
  import { ButtonIcon, Text } from "@lookiero/aurora";
4
4
  import { useI18nMessage } from "@lookiero/i18n-react";
5
- import { ReturnQuestionProjection } from "../../../../../../projection/returnQuestion/returnQuestion";
6
- import { ReturnQuestionType } from "../../../../../../projection/returnQuestion/returnQuestion.constants";
5
+ import {
6
+ ReturnQuestionProjection,
7
+ ReturnQuestionType,
8
+ } from "../../../../../../projection/returnQuestion/returnQuestion";
7
9
  import { ReturnQuestions } from "../../../../components/organisms/returnQuestions/ReturnQuestions";
8
10
  import {
9
11
  ReturnQuestionItemProvider,