@lookiero/checkout 12.4.0 → 12.5.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 (85) hide show
  1. package/dist/public/public/assets/adaptive-icon.png +0 -0
  2. package/dist/public/public/assets/favicon.png +0 -0
  3. package/dist/public/public/assets/icon.png +0 -0
  4. package/dist/public/public/assets/splash.png +0 -0
  5. package/dist/public/public/images/not-found.png +0 -0
  6. package/dist/src/ExpoRoot.js +1 -1
  7. package/dist/src/domain/checkoutItem/model/currency.d.ts +6 -0
  8. package/dist/src/domain/checkoutItem/model/currency.js +7 -0
  9. package/dist/src/domain/uiSetting/command/updateUiSetting.d.ts +15 -0
  10. package/dist/src/domain/uiSetting/command/updateUiSetting.js +10 -0
  11. package/dist/src/domain/uiSetting/model/uiSetting.d.ts +9 -0
  12. package/dist/src/domain/uiSetting/model/uiSetting.js +11 -0
  13. package/dist/src/domain/uiSetting/model/uiSettingUpdated.d.ts +15 -0
  14. package/dist/src/domain/uiSetting/model/uiSettingUpdated.js +8 -0
  15. package/dist/src/domain/uiSetting/model/uiSettings.d.ts +7 -0
  16. package/dist/src/domain/uiSetting/model/uiSettings.js +1 -0
  17. package/dist/src/infrastructure/domain/uiSetting/model/storageUiSettings.d.ts +17 -0
  18. package/dist/src/infrastructure/domain/uiSetting/model/storageUiSettings.js +20 -0
  19. package/dist/src/infrastructure/domain/uiSetting/react/useUpdateUiSetting.d.ts +18 -0
  20. package/dist/src/infrastructure/domain/uiSetting/react/useUpdateUiSetting.js +22 -0
  21. package/dist/src/infrastructure/integration/useRedirect.d.ts +7 -0
  22. package/dist/src/infrastructure/integration/useRedirect.js +1 -0
  23. package/dist/src/infrastructure/persistence/asyncStorageStorage.d.ts +5 -0
  24. package/dist/src/infrastructure/persistence/asyncStorageStorage.js +7 -0
  25. package/dist/src/infrastructure/persistence/uiSettingData.d.ts +6 -0
  26. package/dist/src/infrastructure/persistence/uiSettingData.js +1 -0
  27. package/dist/src/infrastructure/projection/checkoutQuestion/checkoutQuestions.mock.d.ts +3 -0
  28. package/dist/src/infrastructure/projection/checkoutQuestion/checkoutQuestions.mock.js +103 -0
  29. package/dist/src/infrastructure/projection/checkoutQuestion/httpCheckoutQuestionsByCheckoutIdView.d.ts +12 -0
  30. package/dist/src/infrastructure/projection/checkoutQuestion/httpCheckoutQuestionsByCheckoutIdView.js +10 -0
  31. package/dist/src/infrastructure/projection/checkoutQuestion/react/useListCheckoutQuestionsByCheckoutId.d.ts +10 -0
  32. package/dist/src/infrastructure/projection/checkoutQuestion/react/useListCheckoutQuestionsByCheckoutId.js +9 -0
  33. package/dist/src/infrastructure/projection/returnQuestion/returnQuestions.mock.js +47 -58
  34. package/dist/src/infrastructure/projection/uiSetting/react/useViewUiSettingByKey.d.ts +10 -0
  35. package/dist/src/infrastructure/projection/uiSetting/react/useViewUiSettingByKey.js +11 -0
  36. package/dist/src/infrastructure/projection/uiSetting/storageUiSettingByKeyView.d.ts +13 -0
  37. package/dist/src/infrastructure/projection/uiSetting/storageUiSettingByKeyView.js +15 -0
  38. package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/hostDefaultReturnQuestionItem/HostDefaultReturnQuestionItem.js +1 -2
  39. package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/hostLegacyRadioGroupReturnQuestionItem/HostLegacyRadioGroupReturnQuestionItem.d.ts +4 -0
  40. package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/hostLegacyRadioGroupReturnQuestionItem/HostLegacyRadioGroupReturnQuestionItem.js +17 -0
  41. package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/hostLegacyRadioGroupReturnQuestionItem/HostLegacyRadioGroupReturnQuestionItem.style.d.ts +11 -0
  42. package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/hostLegacyRadioGroupReturnQuestionItem/HostLegacyRadioGroupReturnQuestionItem.style.js +16 -0
  43. package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/hostRadioGroupReturnQuestionItem/HostRadioGroupReturnQuestionItem.d.ts +1 -1
  44. package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/hostRadioGroupReturnQuestionItem/HostRadioGroupReturnQuestionItem.js +3 -5
  45. package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/returnQuestionFeedbackItem/ReturnQuestionFeedbackItem.js +2 -3
  46. package/dist/src/infrastructure/ui/components/organisms/returnQuestions/util/returnQuestionFeedback.js +2 -4
  47. package/dist/src/infrastructure/ui/hooks/useSubmitCheckout.d.ts +27 -0
  48. package/dist/src/infrastructure/ui/hooks/useSubmitCheckout.js +97 -0
  49. package/dist/src/infrastructure/ui/routing/useBasePath.d.ts +8 -0
  50. package/dist/src/infrastructure/ui/routing/useBasePath.js +9 -0
  51. package/dist/src/infrastructure/ui/settings/UISettings.d.ts +3 -0
  52. package/dist/src/infrastructure/ui/settings/UISettings.js +4 -0
  53. package/dist/src/infrastructure/ui/views/checkout/components/checkoutPaymentModal/CheckoutPaymentModal.d.ts +12 -0
  54. package/dist/src/infrastructure/ui/views/checkout/components/checkoutPaymentModal/CheckoutPaymentModal.js +90 -0
  55. package/dist/src/infrastructure/ui/views/item/components/returnQuestionsFeedback/ReturnQuestionsFeedback.js +1 -0
  56. package/dist/src/infrastructure/ui/views/return/components/returnQuestionsForm/ReturnQuestionsForm.js +3 -1
  57. package/dist/src/projection/checkoutQuestion/checkoutQuestion.d.ts +18 -0
  58. package/dist/src/projection/checkoutQuestion/checkoutQuestion.js +10 -0
  59. package/dist/src/projection/checkoutQuestion/listCheckoutQuestionsByCheckoutId.d.ts +25 -0
  60. package/dist/src/projection/checkoutQuestion/listCheckoutQuestionsByCheckoutId.js +8 -0
  61. package/dist/src/projection/returnQuestion/returnQuestion.constants.d.ts +1 -0
  62. package/dist/src/projection/returnQuestion/returnQuestion.constants.js +1 -0
  63. package/dist/src/projection/returnQuestion/returnQuestion.d.ts +2 -2
  64. package/dist/src/projection/returnQuestion/returnQuestion.typeguard.d.ts +2 -4
  65. package/dist/src/projection/returnQuestion/returnQuestion.typeguard.js +2 -2
  66. package/dist/src/projection/uiSetting/viewUiSettingByKey.d.ts +29 -0
  67. package/dist/src/projection/uiSetting/viewUiSettingByKey.js +8 -0
  68. package/dist/src/version.d.ts +1 -1
  69. package/dist/src/version.js +1 -1
  70. package/package.json +1 -1
  71. package/src/ExpoRoot.tsx +1 -1
  72. package/src/infrastructure/projection/returnQuestion/returnQuestions.mock.ts +47 -58
  73. package/src/infrastructure/ui/components/organisms/returnQuestions/components/hostDefaultReturnQuestionItem/HostDefaultReturnQuestionItem.tsx +1 -2
  74. package/src/infrastructure/ui/components/organisms/returnQuestions/components/hostLegacyRadioGroupReturnQuestionItem/HostLegacyRadioGroupReturnQuestionItem.style.ts +19 -0
  75. package/src/infrastructure/ui/components/organisms/returnQuestions/components/hostLegacyRadioGroupReturnQuestionItem/HostLegacyRadioGroupReturnQuestionItem.tsx +36 -0
  76. package/src/infrastructure/ui/components/organisms/returnQuestions/components/hostRadioGroupReturnQuestionItem/HostRadioGroupReturnQuestionItem.test.tsx +46 -0
  77. package/src/infrastructure/ui/components/organisms/returnQuestions/components/hostRadioGroupReturnQuestionItem/HostRadioGroupReturnQuestionItem.tsx +7 -12
  78. package/src/infrastructure/ui/components/organisms/returnQuestions/components/returnQuestionFeedbackItem/ReturnQuestionFeedbackItem.tsx +6 -5
  79. package/src/infrastructure/ui/components/organisms/returnQuestions/util/__snapshots__/returnQuestionFeedback.test.ts.snap +22 -2
  80. package/src/infrastructure/ui/components/organisms/returnQuestions/util/returnQuestionFeedback.ts +2 -7
  81. package/src/infrastructure/ui/views/item/components/returnQuestionsFeedback/ReturnQuestionsFeedback.tsx +1 -0
  82. package/src/infrastructure/ui/views/return/components/returnQuestionsForm/ReturnQuestionsForm.tsx +3 -1
  83. package/src/projection/returnQuestion/returnQuestion.constants.ts +1 -0
  84. package/src/projection/returnQuestion/returnQuestion.ts +6 -2
  85. package/src/projection/returnQuestion/returnQuestion.typeguard.ts +3 -11
@@ -8,76 +8,65 @@ const returnQuestions: ReturnQuestionProjection[] = [
8
8
  type: ReturnQuestionType.HOST_DEFAULT,
9
9
  children: [
10
10
  {
11
- id: "ed396b68-1436-48ab-842f-fbfea996fad4",
12
- translationKey: "size",
13
- type: ReturnQuestionType.HOST_SELECT,
14
- metadata: {
15
- placeholder: "size_placeholder",
16
- },
11
+ id: "0ad1dba8-b02c-4121-a1e3-981f1c30800d",
12
+ type: ReturnQuestionType.HOST_RADIO_GROUP,
17
13
  children: [
18
14
  {
19
- id: "0ad1dba8-b02c-4121-a1e3-981f1c30800d",
20
- translationKey: "size_title",
21
- type: ReturnQuestionType.HOST_STACK,
15
+ id: "9251dc2c-d76a-484d-9299-346929af932f",
16
+ translationKey: "size_large",
17
+ type: ReturnQuestionType.OPTION,
22
18
  children: [
23
19
  {
24
- id: "9251dc2c-d76a-484d-9299-346929af932f",
25
- translationKey: "size_large",
26
- type: ReturnQuestionType.OPTION,
20
+ id: "542c4d24-e1da-484f-8c3a-7d89ee135adc",
21
+ type: ReturnQuestionType.HOST_STACK,
27
22
  children: [
28
23
  {
29
- id: "542c4d24-e1da-484f-8c3a-7d89ee135adc",
30
- type: ReturnQuestionType.HOST_STACK,
31
- children: [
32
- {
33
- id: "68c0bb98-b00a-4b86-af43-528fe903cb69",
34
- translationKey: "size_overall",
35
- type: ReturnQuestionType.OPTION,
36
- },
37
- {
38
- id: "85e84a77-461c-41e6-8544-95b5294d0b80",
39
- translationKey: "size_trousers_too_long",
40
- type: ReturnQuestionType.OPTION,
41
- },
42
- {
43
- id: "29441d25-8d9f-471e-a13e-a03f61c88091",
44
- translationKey: "size_fit_cut_does_not_fit",
45
- type: ReturnQuestionType.OPTION,
46
- },
47
- ],
24
+ id: "68c0bb98-b00a-4b86-af43-528fe903cb69",
25
+ translationKey: "size_overall",
26
+ type: ReturnQuestionType.OPTION,
27
+ },
28
+ {
29
+ id: "85e84a77-461c-41e6-8544-95b5294d0b80",
30
+ translationKey: "size_trousers_too_long",
31
+ type: ReturnQuestionType.OPTION,
32
+ },
33
+ {
34
+ id: "29441d25-8d9f-471e-a13e-a03f61c88091",
35
+ translationKey: "size_fit_cut_does_not_fit",
36
+ type: ReturnQuestionType.OPTION,
48
37
  },
49
38
  ],
50
39
  },
40
+ ],
41
+ },
42
+ {
43
+ id: "a081c3e9-1904-4a60-8899-b72c1a3a0291",
44
+ translationKey: "size_correct",
45
+ type: ReturnQuestionType.OPTION,
46
+ },
47
+ {
48
+ id: "624cce3d-bd86-463a-b16b-c862ad73d5f3",
49
+ translationKey: "size_small",
50
+ type: ReturnQuestionType.OPTION,
51
+ children: [
51
52
  {
52
- id: "a081c3e9-1904-4a60-8899-b72c1a3a0291",
53
- translationKey: "size_correct",
54
- type: ReturnQuestionType.OPTION,
55
- },
56
- {
57
- id: "624cce3d-bd86-463a-b16b-c862ad73d5f3",
58
- translationKey: "size_small",
59
- type: ReturnQuestionType.OPTION,
53
+ id: "58e5ae9a-bc0d-4d27-b267-854a51c2a79a",
54
+ type: ReturnQuestionType.HOST_STACK,
60
55
  children: [
61
56
  {
62
- id: "58e5ae9a-bc0d-4d27-b267-854a51c2a79a",
63
- type: ReturnQuestionType.HOST_STACK,
64
- children: [
65
- {
66
- id: "6a3d11fc-570c-4085-a850-1967228cdd4c",
67
- translationKey: "size_overall",
68
- type: ReturnQuestionType.OPTION,
69
- },
70
- {
71
- id: "c27e1936-deea-4dbe-a8f1-fe4fb8564deb",
72
- translationKey: "size_trousers_too_short",
73
- type: ReturnQuestionType.OPTION,
74
- },
75
- {
76
- id: "e77232ae-eeec-4722-b2d3-f5c0d34fd0ca",
77
- translationKey: "size_fit_cut_does_not_fit",
78
- type: ReturnQuestionType.OPTION,
79
- },
80
- ],
57
+ id: "6a3d11fc-570c-4085-a850-1967228cdd4c",
58
+ translationKey: "size_overall",
59
+ type: ReturnQuestionType.OPTION,
60
+ },
61
+ {
62
+ id: "c27e1936-deea-4dbe-a8f1-fe4fb8564deb",
63
+ translationKey: "size_trousers_too_short",
64
+ type: ReturnQuestionType.OPTION,
65
+ },
66
+ {
67
+ id: "e77232ae-eeec-4722-b2d3-f5c0d34fd0ca",
68
+ translationKey: "size_fit_cut_does_not_fit",
69
+ type: ReturnQuestionType.OPTION,
81
70
  },
82
71
  ],
83
72
  },
@@ -4,7 +4,6 @@ import { View } from "react-native";
4
4
  import { Text } from "@lookiero/aurora";
5
5
  import { useI18n } from "@lookiero/i18n-react";
6
6
  import { ReturnQuestionType } from "../../../../../../../projection/returnQuestion/returnQuestion.constants";
7
- import { returnQuestionWithTranslationKey } from "../../../../../../../projection/returnQuestion/returnQuestion.typeguard";
8
7
  import { DOMAIN, I18nMessages } from "../../../../../i18n/i18n";
9
8
  import { ReturnQuestionItem } from "../ReturnQuestionItem";
10
9
  import { style as hostDefaultReturnQuestionItemStyle } from "./HostDefaultReturnQuestionItem.style";
@@ -20,7 +19,7 @@ const HostDefaultReturnQuestionItem: ReturnQuestionItem<ReturnQuestionType.HOST_
20
19
 
21
20
  return (
22
21
  <>
23
- {returnQuestionWithTranslationKey(returnQuestion) && returnQuestion.translationKey !== " " && !isAllOptions ? (
22
+ {returnQuestion.translationKey && returnQuestion.translationKey !== " " && !isAllOptions ? (
24
23
  <View style={style.title}>
25
24
  <Text level={3} action>
26
25
  {formatMessage({ id: returnQuestion.translationKey })}
@@ -0,0 +1,19 @@
1
+ import { StyleSheet } from "react-native";
2
+ import { theme } from "@lookiero/sty-psp-ui";
3
+
4
+ const style = () => {
5
+ const { colorBgBase, space2, space6 } = theme();
6
+
7
+ return StyleSheet.create({
8
+ title: {
9
+ marginBottom: space2,
10
+ },
11
+ wrapper: {
12
+ backgroundColor: colorBgBase,
13
+ marginBottom: space2,
14
+ padding: space6,
15
+ },
16
+ });
17
+ };
18
+
19
+ export { style };
@@ -0,0 +1,36 @@
1
+ /* eslint-disable react/prop-types */
2
+ import React, { useMemo } from "react";
3
+ import { View } from "react-native";
4
+ import { Text } from "@lookiero/aurora";
5
+ import { useI18n } from "@lookiero/i18n-react";
6
+ import { ReturnQuestionType } from "../../../../../../../projection/returnQuestion/returnQuestion.constants";
7
+ import { DOMAIN } from "../../../../../i18n/i18n";
8
+ import { ReturnQuestionItem } from "../ReturnQuestionItem";
9
+ import { style as hostLegacyRadioGroupReturnQuestionItemStyle } from "./HostLegacyRadioGroupReturnQuestionItem.style";
10
+
11
+ const HostLegacyRadioGroupReturnQuestionItem: ReturnQuestionItem<ReturnQuestionType.HOST_SELECT> = ({
12
+ returnQuestion,
13
+ children,
14
+ testID,
15
+ }) => {
16
+ const { formatMessage } = useI18n({ domain: DOMAIN });
17
+ const placeholderText = useMemo(
18
+ () => (returnQuestion.metadata.placeholder ? formatMessage({ id: returnQuestion.metadata.placeholder }) : ""),
19
+ [formatMessage, returnQuestion.metadata.placeholder],
20
+ );
21
+
22
+ const style = useMemo(() => hostLegacyRadioGroupReturnQuestionItemStyle(), []);
23
+
24
+ return (
25
+ <>
26
+ <View style={style.wrapper} testID={testID}>
27
+ <Text level={3} style={style.title} action>
28
+ {placeholderText}
29
+ </Text>
30
+ {children}
31
+ </View>
32
+ </>
33
+ );
34
+ };
35
+
36
+ export { HostLegacyRadioGroupReturnQuestionItem };
@@ -0,0 +1,46 @@
1
+ import React from "react";
2
+ import { Text } from "react-native";
3
+ import { ReturnQuestionProjection } from "../../../../../../../projection/returnQuestion/returnQuestion";
4
+ import { ReturnQuestionType } from "../../../../../../../projection/returnQuestion/returnQuestion.constants";
5
+ import { render } from "../../../../../test/render";
6
+ import { HostRadioGroupReturnQuestionItem } from "./HostRadioGroupReturnQuestionItem";
7
+
8
+ const returnQuestion: ReturnQuestionProjection<ReturnQuestionType.HOST_RADIO_GROUP> = {
9
+ id: "9251dc2c-d76a-484d-9299-346929af932f",
10
+ translationKey: "size_large",
11
+ type: ReturnQuestionType.HOST_RADIO_GROUP,
12
+ children: [
13
+ {
14
+ id: "68c0bb98-b00a-4b86-af43-528fe903cb69",
15
+ translationKey: "size_overall",
16
+ type: ReturnQuestionType.OPTION,
17
+ },
18
+ {
19
+ id: "85e84a77-461c-41e6-8544-95b5294d0b80",
20
+ translationKey: "size_trousers_too_long",
21
+ type: ReturnQuestionType.OPTION,
22
+ },
23
+ {
24
+ id: "29441d25-8d9f-471e-a13e-a03f61c88091",
25
+ translationKey: "size_fit_cut_does_not_fit",
26
+ type: ReturnQuestionType.OPTION,
27
+ },
28
+ ],
29
+ };
30
+
31
+ describe("HostRadioGroupReturnQuestionItem component (ReturnQuestions organism)", () => {
32
+ it("renders correctly", () => {
33
+ const childrenText = "HostRadioGroupReturnQuestionItem children";
34
+ const { getByText } = render(
35
+ <HostRadioGroupReturnQuestionItem
36
+ returnQuestion={returnQuestion}
37
+ returnQuestionParent={{} as ReturnQuestionProjection}
38
+ >
39
+ <Text>{childrenText}</Text>
40
+ </HostRadioGroupReturnQuestionItem>,
41
+ );
42
+
43
+ expect(getByText(returnQuestion.translationKey as string)).toBeTruthy();
44
+ expect(getByText(childrenText)).toBeTruthy();
45
+ });
46
+ });
@@ -8,28 +8,23 @@ import { DOMAIN } from "../../../../../i18n/i18n";
8
8
  import { ReturnQuestionItem } from "../ReturnQuestionItem";
9
9
  import { style as hostRadioGroupReturnQuestionItemStyle } from "./HostRadioGroupReturnQuestionItem.style";
10
10
 
11
- const HostRadioGroupReturnQuestionItem: ReturnQuestionItem<ReturnQuestionType.HOST_SELECT> = ({
11
+ const HostRadioGroupReturnQuestionItem: ReturnQuestionItem<ReturnQuestionType.HOST_RADIO_GROUP> = ({
12
12
  returnQuestion,
13
13
  children,
14
14
  testID,
15
15
  }) => {
16
16
  const { formatMessage } = useI18n({ domain: DOMAIN });
17
- const placeholderText = useMemo(
18
- () => (returnQuestion.metadata.placeholder ? formatMessage({ id: returnQuestion.metadata.placeholder }) : ""),
19
- [formatMessage, returnQuestion.metadata.placeholder],
20
- );
21
-
22
17
  const style = useMemo(() => hostRadioGroupReturnQuestionItemStyle(), []);
23
18
 
24
19
  return (
25
- <>
26
- <View style={style.wrapper} testID={testID}>
20
+ <View style={style.wrapper} testID={testID}>
21
+ {returnQuestion.translationKey && (
27
22
  <Text level={3} style={style.title} action>
28
- {placeholderText}
23
+ {formatMessage({ id: returnQuestion.translationKey })}
29
24
  </Text>
30
- {children}
31
- </View>
32
- </>
25
+ )}
26
+ {children}
27
+ </View>
33
28
  );
34
29
  };
35
30
 
@@ -11,12 +11,11 @@ import { ReturnQuestionItem } from "../ReturnQuestionItem";
11
11
  import { style as returnQuestionFeedbackItemStyle } from "./ReturnQuestionFeedbackItem.style";
12
12
 
13
13
  const ReturnQuestionFeedbackItem: ReturnQuestionItem<ReturnQuestionType.HOST_DEFAULT> = ({ returnQuestion }) => {
14
- const titleText = useI18nMessage({ domain: DOMAIN, id: returnQuestion.translationKey });
14
+ const { formatMessage } = useI18n({ domain: DOMAIN });
15
15
  const unansweredText = useI18nMessage({ domain: DOMAIN, id: I18nMessages.FEEDBACK_UNANSWERED });
16
16
 
17
17
  const returnQuestionFeedback = useReturnQuestionFeedback();
18
18
 
19
- const { formatMessage } = useI18n({ domain: DOMAIN });
20
19
  const translate = useCallback(
21
20
  (returnQuestionName: string) => formatMessage({ id: returnQuestionName, defaultMessage: returnQuestionName }),
22
21
  [formatMessage],
@@ -29,9 +28,11 @@ const ReturnQuestionFeedbackItem: ReturnQuestionItem<ReturnQuestionType.HOST_DEF
29
28
 
30
29
  return (
31
30
  <View style={style.container}>
32
- <Text level={2} style={style.title} detailBold>
33
- {titleText}
34
- </Text>
31
+ {returnQuestion.translationKey && (
32
+ <Text level={2} style={style.title} detailBold>
33
+ {formatMessage({ id: returnQuestion.translationKey })}
34
+ </Text>
35
+ )}
35
36
  <Text level={1} detail>
36
37
  {feedback || unansweredText}
37
38
  </Text>
@@ -2,8 +2,28 @@
2
2
 
3
3
  exports[`returnQuestionFeedback utils return the deepest returnQuestion with feedback recursively 1`] = `
4
4
  [
5
- undefined,
6
- false,
5
+ {
6
+ "children": [
7
+ {
8
+ "id": "68c0bb98-b00a-4b86-af43-528fe903cb69",
9
+ "translationKey": "size_overall",
10
+ "type": "OPTION",
11
+ },
12
+ {
13
+ "id": "85e84a77-461c-41e6-8544-95b5294d0b80",
14
+ "translationKey": "size_trousers_too_long",
15
+ "type": "OPTION",
16
+ },
17
+ {
18
+ "id": "29441d25-8d9f-471e-a13e-a03f61c88091",
19
+ "translationKey": "size_fit_cut_does_not_fit",
20
+ "type": "OPTION",
21
+ },
22
+ ],
23
+ "id": "542c4d24-e1da-484f-8c3a-7d89ee135adc",
24
+ "type": "HOST_STACK",
25
+ },
26
+ true,
7
27
  ]
8
28
  `;
9
29
 
@@ -1,10 +1,7 @@
1
1
  import { isUuid } from "@lookiero/sty-psp-uuid";
2
2
  import { FeedbackProjection } from "../../../../../../projection/feedback/feedback";
3
3
  import { ReturnQuestionProjection } from "../../../../../../projection/returnQuestion/returnQuestion";
4
- import {
5
- returnQuestionHasChildren,
6
- returnQuestionWithTranslationKey,
7
- } from "../../../../../../projection/returnQuestion/returnQuestion.typeguard";
4
+ import { returnQuestionHasChildren } from "../../../../../../projection/returnQuestion/returnQuestion.typeguard";
8
5
 
9
6
  interface RecursiveFeedbackForReturnQuestionFunctionArgs {
10
7
  readonly feedback: FeedbackProjection;
@@ -36,9 +33,7 @@ const feedbackForReturnQuestion: RecursiveFeedbackForReturnQuestionFunction = ({
36
33
  if (feebackReturnQuestionChild) {
37
34
  return [
38
35
  ...acc,
39
- ...(returnQuestionWithTranslationKey(feebackReturnQuestionChild)
40
- ? [translate(feebackReturnQuestionChild.translationKey)]
41
- : []),
36
+ ...(feebackReturnQuestionChild.translationKey ? [translate(feebackReturnQuestionChild.translationKey)] : []),
42
37
  ...feedbackForReturnQuestion({ feedback, returnQuestion: feebackReturnQuestionChild, translate, acc }),
43
38
  ];
44
39
  }
@@ -22,6 +22,7 @@ const returnQuestionItems: ReturnQuestionItems = {
22
22
  [ReturnQuestionType.HOST_STACK]: ReturnQuestionFeedbackItem,
23
23
  [ReturnQuestionType.TEXTAREA]: ReturnQuestionFeedbackItem,
24
24
  [ReturnQuestionType.OPTION]: ReturnQuestionFeedbackItem,
25
+ [ReturnQuestionType.HOST_RADIO_GROUP]: ReturnQuestionFeedbackItem,
25
26
  };
26
27
 
27
28
  interface ReturnQuestionsFeedbackProps {
@@ -27,6 +27,7 @@ import {
27
27
  ReturnQuestionItems,
28
28
  } from "../../../../components/organisms/returnQuestions/behaviors/useReturnQuestionItem";
29
29
  import { HostDefaultReturnQuestionItem } from "../../../../components/organisms/returnQuestions/components/hostDefaultReturnQuestionItem/HostDefaultReturnQuestionItem";
30
+ import { HostLegacyRadioGroupReturnQuestionItem } from "../../../../components/organisms/returnQuestions/components/hostLegacyRadioGroupReturnQuestionItem/HostLegacyRadioGroupReturnQuestionItem";
30
31
  import { HostRadioGroupReturnQuestionItem } from "../../../../components/organisms/returnQuestions/components/hostRadioGroupReturnQuestionItem/HostRadioGroupReturnQuestionItem";
31
32
  import { HostStackReturnQuestionItem } from "../../../../components/organisms/returnQuestions/components/hostStackReturnQuestionItem/form/HostStackReturnQuestionItem";
32
33
  import { RadioReturnQuestionItem } from "../../../../components/organisms/returnQuestions/components/radioReturnQuestionItem/RadioReturnQuestionItem";
@@ -43,7 +44,8 @@ const RETURN_QUESTION_FORM_PORTAL_HOST_NAME = "return-question-form-portal";
43
44
  const returnQuestionItems: ReturnQuestionItems = {
44
45
  [ReturnQuestionType.HOST_DEFAULT]: HostDefaultReturnQuestionItem,
45
46
  [ReturnQuestionType.HOST_TEXTAREA]: HostDefaultReturnQuestionItem,
46
- [ReturnQuestionType.HOST_SELECT]: HostRadioGroupReturnQuestionItem,
47
+ [ReturnQuestionType.HOST_SELECT]: HostLegacyRadioGroupReturnQuestionItem,
48
+ [ReturnQuestionType.HOST_RADIO_GROUP]: HostRadioGroupReturnQuestionItem,
47
49
  [ReturnQuestionType.HOST_STACK]: HostStackReturnQuestionItem,
48
50
  [ReturnQuestionType.TEXTAREA]: TextareaReturnQuestionItem,
49
51
  [ReturnQuestionType.OPTION]: RadioReturnQuestionItem,
@@ -3,6 +3,7 @@ enum ReturnQuestionType {
3
3
  HOST_TEXTAREA = "HOST_TEXTAREA",
4
4
  HOST_SELECT = "HOST_SELECT",
5
5
  HOST_STACK = "HOST_STACK",
6
+ HOST_RADIO_GROUP = "HOST_RADIO_GROUP",
6
7
  TEXTAREA = "TEXTAREA",
7
8
  OPTION = "OPTION",
8
9
  }
@@ -6,11 +6,15 @@ type ReturnQuestionTypesWithChildren =
6
6
  | ReturnQuestionType.HOST_DEFAULT
7
7
  | ReturnQuestionType.HOST_SELECT
8
8
  | ReturnQuestionType.HOST_STACK
9
- | ReturnQuestionType.HOST_TEXTAREA;
9
+ | ReturnQuestionType.HOST_TEXTAREA
10
+ | ReturnQuestionType.HOST_RADIO_GROUP;
10
11
 
11
12
  type ReturnQuestionTypesWithOptionalChildren = ReturnQuestionType.OPTION;
12
13
 
13
- type ReturnQuestionTypesWithOptionalTranslationKeys = ReturnQuestionType.HOST_STACK;
14
+ type ReturnQuestionTypesWithOptionalTranslationKeys =
15
+ | ReturnQuestionType.HOST_DEFAULT
16
+ | ReturnQuestionType.HOST_STACK
17
+ | ReturnQuestionType.HOST_RADIO_GROUP;
14
18
 
15
19
  type ReturnQuestionMetadata<RQT extends ReturnQuestionType> = ExcludePropertyIfOptional<
16
20
  "metadata",
@@ -1,15 +1,6 @@
1
- import {
2
- ReturnQuestionProjection,
3
- ReturnQuestionTypesWithChildren,
4
- ReturnQuestionTypesWithOptionalTranslationKeys,
5
- } from "./returnQuestion";
1
+ import { ReturnQuestionProjection, ReturnQuestionTypesWithChildren } from "./returnQuestion";
6
2
  import { ReturnQuestionType } from "./returnQuestion.constants";
7
3
 
8
- const returnQuestionWithTranslationKey = (
9
- question: ReturnQuestionProjection,
10
- ): question is ReturnQuestionProjection<Exclude<ReturnQuestionType, ReturnQuestionTypesWithOptionalTranslationKeys>> =>
11
- Boolean(question.translationKey);
12
-
13
4
  const returnQuestionHasChildren = (
14
5
  question: ReturnQuestionProjection,
15
6
  ): question is ReturnQuestionProjection<ReturnQuestionTypesWithChildren> =>
@@ -18,7 +9,8 @@ const returnQuestionHasChildren = (
18
9
  ReturnQuestionType.HOST_SELECT,
19
10
  ReturnQuestionType.HOST_STACK,
20
11
  ReturnQuestionType.HOST_TEXTAREA,
12
+ ReturnQuestionType.HOST_RADIO_GROUP,
21
13
  ReturnQuestionType.OPTION,
22
14
  ].includes(question.type);
23
15
 
24
- export { returnQuestionWithTranslationKey, returnQuestionHasChildren };
16
+ export { returnQuestionHasChildren };