@redneckz/wildless-cms-uni-blocks 0.14.884 → 0.14.886

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 (243) hide show
  1. package/bundle/bundle.umd.js +220 -58
  2. package/bundle/bundle.umd.min.js +1 -1
  3. package/bundle/components/ApplicationForm/renderAgreementSubmit.d.ts +6 -1
  4. package/bundle/components/ApplicationLeadForm/EsiaLoginBanner.d.ts +2 -1
  5. package/bundle/components/ApplicationLeadForm/renderAgreementSubmit.d.ts +5 -1
  6. package/bundle/components/DebitForm/DebitFormStepsData.d.ts +1 -0
  7. package/bundle/components/DebitForm/utils.d.ts +2 -0
  8. package/bundle/retail/components/DraftDialog/EmptyDraftDialog.d.ts +4 -1
  9. package/bundle/retail/components/DraftDialog/creditProgramCodes.d.ts +39 -0
  10. package/bundle/retail/components/DraftDialog/utils.d.ts +5 -34
  11. package/bundle/retail/model/LeadFormState.d.ts +0 -1
  12. package/dist/components/ApplicationForm/ApplicationForm.js +6 -1
  13. package/dist/components/ApplicationForm/ApplicationForm.js.map +1 -1
  14. package/dist/components/ApplicationForm/renderAgreementSubmit.d.ts +6 -1
  15. package/dist/components/ApplicationForm/renderAgreementSubmit.js +2 -1
  16. package/dist/components/ApplicationForm/renderAgreementSubmit.js.map +1 -1
  17. package/dist/components/ApplicationLeadForm/ApplicationLeadForm.js +1 -1
  18. package/dist/components/ApplicationLeadForm/ApplicationLeadForm.js.map +1 -1
  19. package/dist/components/ApplicationLeadForm/EsiaLoginBanner.d.ts +2 -1
  20. package/dist/components/ApplicationLeadForm/EsiaLoginBanner.js +2 -2
  21. package/dist/components/ApplicationLeadForm/EsiaLoginBanner.js.map +1 -1
  22. package/dist/components/ApplicationLeadForm/consents.js +0 -4
  23. package/dist/components/ApplicationLeadForm/consents.js.map +1 -1
  24. package/dist/components/ApplicationLeadForm/renderAgreementSubmit.d.ts +5 -1
  25. package/dist/components/ApplicationLeadForm/renderAgreementSubmit.js +1 -1
  26. package/dist/components/ApplicationLeadForm/renderAgreementSubmit.js.map +1 -1
  27. package/dist/components/DebitForm/DebitForm.js +5 -1
  28. package/dist/components/DebitForm/DebitForm.js.map +1 -1
  29. package/dist/components/DebitForm/DebitFormStepsData.d.ts +1 -0
  30. package/dist/components/DebitForm/DebitFormStepsData.js +122 -6
  31. package/dist/components/DebitForm/DebitFormStepsData.js.map +1 -1
  32. package/dist/components/DebitForm/formStateMap.js +1 -0
  33. package/dist/components/DebitForm/formStateMap.js.map +1 -1
  34. package/dist/components/DebitForm/utils.d.ts +2 -0
  35. package/dist/components/DebitForm/utils.js +2 -0
  36. package/dist/components/DebitForm/utils.js.map +1 -1
  37. package/dist/retail/adaptors/getPersonalInfoData.js +4 -1
  38. package/dist/retail/adaptors/getPersonalInfoData.js.map +1 -1
  39. package/dist/retail/components/DraftDialog/DraftDialog.js +7 -14
  40. package/dist/retail/components/DraftDialog/DraftDialog.js.map +1 -1
  41. package/dist/retail/components/DraftDialog/EmptyDraftDialog.d.ts +4 -1
  42. package/dist/retail/components/DraftDialog/EmptyDraftDialog.js +4 -2
  43. package/dist/retail/components/DraftDialog/EmptyDraftDialog.js.map +1 -1
  44. package/dist/retail/components/DraftDialog/creditProgramCodes.d.ts +39 -0
  45. package/dist/retail/components/DraftDialog/creditProgramCodes.js +39 -0
  46. package/dist/retail/components/DraftDialog/creditProgramCodes.js.map +1 -0
  47. package/dist/retail/components/DraftDialog/useDraftDialog.js +1 -1
  48. package/dist/retail/components/DraftDialog/useDraftDialog.js.map +1 -1
  49. package/dist/retail/components/DraftDialog/utils.d.ts +5 -34
  50. package/dist/retail/components/DraftDialog/utils.js +23 -24
  51. package/dist/retail/components/DraftDialog/utils.js.map +1 -1
  52. package/dist/retail/components/Fields/CardCategoryField.js +8 -2
  53. package/dist/retail/components/Fields/CardCategoryField.js.map +1 -1
  54. package/dist/retail/model/LeadFormState.d.ts +0 -1
  55. package/dist/ui-kit/FormField/getObjectValidator.js +1 -1
  56. package/lib/common.css +1 -1
  57. package/lib/components/ApplicationForm/ApplicationForm.js +6 -1
  58. package/lib/components/ApplicationForm/ApplicationForm.js.map +1 -1
  59. package/lib/components/ApplicationForm/renderAgreementSubmit.d.ts +6 -1
  60. package/lib/components/ApplicationForm/renderAgreementSubmit.js +2 -1
  61. package/lib/components/ApplicationForm/renderAgreementSubmit.js.map +1 -1
  62. package/lib/components/ApplicationLeadForm/ApplicationLeadForm.js +1 -1
  63. package/lib/components/ApplicationLeadForm/ApplicationLeadForm.js.map +1 -1
  64. package/lib/components/ApplicationLeadForm/EsiaLoginBanner.d.ts +2 -1
  65. package/lib/components/ApplicationLeadForm/EsiaLoginBanner.js +2 -2
  66. package/lib/components/ApplicationLeadForm/EsiaLoginBanner.js.map +1 -1
  67. package/lib/components/ApplicationLeadForm/consents.js +0 -4
  68. package/lib/components/ApplicationLeadForm/consents.js.map +1 -1
  69. package/lib/components/ApplicationLeadForm/renderAgreementSubmit.d.ts +5 -1
  70. package/lib/components/ApplicationLeadForm/renderAgreementSubmit.js +1 -1
  71. package/lib/components/ApplicationLeadForm/renderAgreementSubmit.js.map +1 -1
  72. package/lib/components/DebitForm/DebitForm.js +5 -1
  73. package/lib/components/DebitForm/DebitForm.js.map +1 -1
  74. package/lib/components/DebitForm/DebitFormStepsData.d.ts +1 -0
  75. package/lib/components/DebitForm/DebitFormStepsData.js +122 -6
  76. package/lib/components/DebitForm/DebitFormStepsData.js.map +1 -1
  77. package/lib/components/DebitForm/formStateMap.js +1 -0
  78. package/lib/components/DebitForm/formStateMap.js.map +1 -1
  79. package/lib/components/DebitForm/utils.d.ts +2 -0
  80. package/lib/components/DebitForm/utils.js +2 -0
  81. package/lib/components/DebitForm/utils.js.map +1 -1
  82. package/lib/retail/adaptors/getPersonalInfoData.js +4 -1
  83. package/lib/retail/adaptors/getPersonalInfoData.js.map +1 -1
  84. package/lib/retail/components/DraftDialog/DraftDialog.js +6 -13
  85. package/lib/retail/components/DraftDialog/DraftDialog.js.map +1 -1
  86. package/lib/retail/components/DraftDialog/EmptyDraftDialog.d.ts +4 -1
  87. package/lib/retail/components/DraftDialog/EmptyDraftDialog.js +4 -2
  88. package/lib/retail/components/DraftDialog/EmptyDraftDialog.js.map +1 -1
  89. package/lib/retail/components/DraftDialog/creditProgramCodes.d.ts +39 -0
  90. package/lib/retail/components/DraftDialog/creditProgramCodes.js +37 -0
  91. package/lib/retail/components/DraftDialog/creditProgramCodes.js.map +1 -0
  92. package/lib/retail/components/DraftDialog/useDraftDialog.js +1 -1
  93. package/lib/retail/components/DraftDialog/useDraftDialog.js.map +1 -1
  94. package/lib/retail/components/DraftDialog/utils.d.ts +5 -34
  95. package/lib/retail/components/DraftDialog/utils.js +21 -23
  96. package/lib/retail/components/DraftDialog/utils.js.map +1 -1
  97. package/lib/retail/components/Fields/CardCategoryField.js +9 -3
  98. package/lib/retail/components/Fields/CardCategoryField.js.map +1 -1
  99. package/lib/retail/model/LeadFormState.d.ts +0 -1
  100. package/lib/ui-kit/FormField/getObjectValidator.js +1 -1
  101. package/mobile/bundle/bundle.umd.js +220 -58
  102. package/mobile/bundle/bundle.umd.min.js +1 -1
  103. package/mobile/bundle/components/ApplicationForm/renderAgreementSubmit.d.ts +6 -1
  104. package/mobile/bundle/components/ApplicationLeadForm/EsiaLoginBanner.d.ts +2 -1
  105. package/mobile/bundle/components/ApplicationLeadForm/renderAgreementSubmit.d.ts +5 -1
  106. package/mobile/bundle/components/DebitForm/DebitFormStepsData.d.ts +1 -0
  107. package/mobile/bundle/components/DebitForm/utils.d.ts +2 -0
  108. package/mobile/bundle/retail/components/DraftDialog/EmptyDraftDialog.d.ts +4 -1
  109. package/mobile/bundle/retail/components/DraftDialog/creditProgramCodes.d.ts +39 -0
  110. package/mobile/bundle/retail/components/DraftDialog/utils.d.ts +5 -34
  111. package/mobile/bundle/retail/model/LeadFormState.d.ts +0 -1
  112. package/mobile/dist/components/ApplicationForm/ApplicationForm.js +6 -1
  113. package/mobile/dist/components/ApplicationForm/ApplicationForm.js.map +1 -1
  114. package/mobile/dist/components/ApplicationForm/renderAgreementSubmit.d.ts +6 -1
  115. package/mobile/dist/components/ApplicationForm/renderAgreementSubmit.js +2 -1
  116. package/mobile/dist/components/ApplicationForm/renderAgreementSubmit.js.map +1 -1
  117. package/mobile/dist/components/ApplicationLeadForm/ApplicationLeadForm.js +1 -1
  118. package/mobile/dist/components/ApplicationLeadForm/ApplicationLeadForm.js.map +1 -1
  119. package/mobile/dist/components/ApplicationLeadForm/EsiaLoginBanner.d.ts +2 -1
  120. package/mobile/dist/components/ApplicationLeadForm/EsiaLoginBanner.js +2 -2
  121. package/mobile/dist/components/ApplicationLeadForm/EsiaLoginBanner.js.map +1 -1
  122. package/mobile/dist/components/ApplicationLeadForm/consents.js +0 -4
  123. package/mobile/dist/components/ApplicationLeadForm/consents.js.map +1 -1
  124. package/mobile/dist/components/ApplicationLeadForm/renderAgreementSubmit.d.ts +5 -1
  125. package/mobile/dist/components/ApplicationLeadForm/renderAgreementSubmit.js +1 -1
  126. package/mobile/dist/components/ApplicationLeadForm/renderAgreementSubmit.js.map +1 -1
  127. package/mobile/dist/components/DebitForm/DebitForm.js +5 -1
  128. package/mobile/dist/components/DebitForm/DebitForm.js.map +1 -1
  129. package/mobile/dist/components/DebitForm/DebitFormStepsData.d.ts +1 -0
  130. package/mobile/dist/components/DebitForm/DebitFormStepsData.js +122 -6
  131. package/mobile/dist/components/DebitForm/DebitFormStepsData.js.map +1 -1
  132. package/mobile/dist/components/DebitForm/formStateMap.js +1 -0
  133. package/mobile/dist/components/DebitForm/formStateMap.js.map +1 -1
  134. package/mobile/dist/components/DebitForm/utils.d.ts +2 -0
  135. package/mobile/dist/components/DebitForm/utils.js +2 -0
  136. package/mobile/dist/components/DebitForm/utils.js.map +1 -1
  137. package/mobile/dist/retail/adaptors/getPersonalInfoData.js +4 -1
  138. package/mobile/dist/retail/adaptors/getPersonalInfoData.js.map +1 -1
  139. package/mobile/dist/retail/components/DraftDialog/DraftDialog.js +7 -14
  140. package/mobile/dist/retail/components/DraftDialog/DraftDialog.js.map +1 -1
  141. package/mobile/dist/retail/components/DraftDialog/EmptyDraftDialog.d.ts +4 -1
  142. package/mobile/dist/retail/components/DraftDialog/EmptyDraftDialog.js +4 -2
  143. package/mobile/dist/retail/components/DraftDialog/EmptyDraftDialog.js.map +1 -1
  144. package/mobile/dist/retail/components/DraftDialog/creditProgramCodes.d.ts +39 -0
  145. package/mobile/dist/retail/components/DraftDialog/creditProgramCodes.js +39 -0
  146. package/mobile/dist/retail/components/DraftDialog/creditProgramCodes.js.map +1 -0
  147. package/mobile/dist/retail/components/DraftDialog/useDraftDialog.js +1 -1
  148. package/mobile/dist/retail/components/DraftDialog/useDraftDialog.js.map +1 -1
  149. package/mobile/dist/retail/components/DraftDialog/utils.d.ts +5 -34
  150. package/mobile/dist/retail/components/DraftDialog/utils.js +23 -24
  151. package/mobile/dist/retail/components/DraftDialog/utils.js.map +1 -1
  152. package/mobile/dist/retail/components/Fields/CardCategoryField.js +8 -2
  153. package/mobile/dist/retail/components/Fields/CardCategoryField.js.map +1 -1
  154. package/mobile/dist/retail/model/LeadFormState.d.ts +0 -1
  155. package/mobile/dist/ui-kit/FormField/getObjectValidator.js +1 -1
  156. package/mobile/lib/common.css +1 -1
  157. package/mobile/lib/components/ApplicationForm/ApplicationForm.js +6 -1
  158. package/mobile/lib/components/ApplicationForm/ApplicationForm.js.map +1 -1
  159. package/mobile/lib/components/ApplicationForm/renderAgreementSubmit.d.ts +6 -1
  160. package/mobile/lib/components/ApplicationForm/renderAgreementSubmit.js +2 -1
  161. package/mobile/lib/components/ApplicationForm/renderAgreementSubmit.js.map +1 -1
  162. package/mobile/lib/components/ApplicationLeadForm/ApplicationLeadForm.js +1 -1
  163. package/mobile/lib/components/ApplicationLeadForm/ApplicationLeadForm.js.map +1 -1
  164. package/mobile/lib/components/ApplicationLeadForm/EsiaLoginBanner.d.ts +2 -1
  165. package/mobile/lib/components/ApplicationLeadForm/EsiaLoginBanner.js +2 -2
  166. package/mobile/lib/components/ApplicationLeadForm/EsiaLoginBanner.js.map +1 -1
  167. package/mobile/lib/components/ApplicationLeadForm/consents.js +0 -4
  168. package/mobile/lib/components/ApplicationLeadForm/consents.js.map +1 -1
  169. package/mobile/lib/components/ApplicationLeadForm/renderAgreementSubmit.d.ts +5 -1
  170. package/mobile/lib/components/ApplicationLeadForm/renderAgreementSubmit.js +1 -1
  171. package/mobile/lib/components/ApplicationLeadForm/renderAgreementSubmit.js.map +1 -1
  172. package/mobile/lib/components/DebitForm/DebitForm.js +5 -1
  173. package/mobile/lib/components/DebitForm/DebitForm.js.map +1 -1
  174. package/mobile/lib/components/DebitForm/DebitFormStepsData.d.ts +1 -0
  175. package/mobile/lib/components/DebitForm/DebitFormStepsData.js +122 -6
  176. package/mobile/lib/components/DebitForm/DebitFormStepsData.js.map +1 -1
  177. package/mobile/lib/components/DebitForm/formStateMap.js +1 -0
  178. package/mobile/lib/components/DebitForm/formStateMap.js.map +1 -1
  179. package/mobile/lib/components/DebitForm/utils.d.ts +2 -0
  180. package/mobile/lib/components/DebitForm/utils.js +2 -0
  181. package/mobile/lib/components/DebitForm/utils.js.map +1 -1
  182. package/mobile/lib/retail/adaptors/getPersonalInfoData.js +4 -1
  183. package/mobile/lib/retail/adaptors/getPersonalInfoData.js.map +1 -1
  184. package/mobile/lib/retail/components/DraftDialog/DraftDialog.js +6 -13
  185. package/mobile/lib/retail/components/DraftDialog/DraftDialog.js.map +1 -1
  186. package/mobile/lib/retail/components/DraftDialog/EmptyDraftDialog.d.ts +4 -1
  187. package/mobile/lib/retail/components/DraftDialog/EmptyDraftDialog.js +4 -2
  188. package/mobile/lib/retail/components/DraftDialog/EmptyDraftDialog.js.map +1 -1
  189. package/mobile/lib/retail/components/DraftDialog/creditProgramCodes.d.ts +39 -0
  190. package/mobile/lib/retail/components/DraftDialog/creditProgramCodes.js +37 -0
  191. package/mobile/lib/retail/components/DraftDialog/creditProgramCodes.js.map +1 -0
  192. package/mobile/lib/retail/components/DraftDialog/useDraftDialog.js +1 -1
  193. package/mobile/lib/retail/components/DraftDialog/useDraftDialog.js.map +1 -1
  194. package/mobile/lib/retail/components/DraftDialog/utils.d.ts +5 -34
  195. package/mobile/lib/retail/components/DraftDialog/utils.js +21 -23
  196. package/mobile/lib/retail/components/DraftDialog/utils.js.map +1 -1
  197. package/mobile/lib/retail/components/Fields/CardCategoryField.js +9 -3
  198. package/mobile/lib/retail/components/Fields/CardCategoryField.js.map +1 -1
  199. package/mobile/lib/retail/model/LeadFormState.d.ts +0 -1
  200. package/mobile/lib/ui-kit/FormField/getObjectValidator.js +1 -1
  201. package/mobile/src/components/ApplicationForm/ApplicationForm.example.json +1 -1
  202. package/mobile/src/components/ApplicationForm/ApplicationForm.tsx +4 -3
  203. package/mobile/src/components/ApplicationForm/renderAgreementSubmit.tsx +13 -6
  204. package/mobile/src/components/ApplicationLeadForm/ApplicationLeadForm.tsx +3 -1
  205. package/mobile/src/components/ApplicationLeadForm/EsiaLoginBanner.tsx +16 -11
  206. package/mobile/src/components/ApplicationLeadForm/consents.ts +0 -4
  207. package/mobile/src/components/ApplicationLeadForm/renderAgreementSubmit.tsx +9 -5
  208. package/mobile/src/components/DebitForm/DebitForm.tsx +6 -1
  209. package/mobile/src/components/DebitForm/DebitFormStepsData.tsx +123 -6
  210. package/mobile/src/components/DebitForm/formStateMap.tsx +1 -0
  211. package/mobile/src/components/DebitForm/utils.ts +2 -0
  212. package/mobile/src/retail/adaptors/getPersonalInfoData.tsx +4 -1
  213. package/mobile/src/retail/components/DraftDialog/DraftDialog.tsx +6 -13
  214. package/mobile/src/retail/components/DraftDialog/EmptyDraftDialog.tsx +8 -2
  215. package/mobile/src/retail/components/DraftDialog/creditProgramCodes.ts +40 -0
  216. package/mobile/src/retail/components/DraftDialog/useDraftDialog.tsx +1 -1
  217. package/mobile/src/retail/components/DraftDialog/utils.ts +22 -27
  218. package/mobile/src/retail/components/Fields/CardCategoryField.tsx +14 -3
  219. package/mobile/src/retail/model/LeadFormState.ts +0 -1
  220. package/mobile/src/ui-kit/FormField/getObjectValidator.tsx +1 -1
  221. package/package.json +1 -1
  222. package/src/components/ApplicationForm/ApplicationForm.example.json +1 -1
  223. package/src/components/ApplicationForm/ApplicationForm.fixture.mobile.tsx +1 -1
  224. package/src/components/ApplicationForm/ApplicationForm.fixture.tsx +1 -1
  225. package/src/components/ApplicationForm/ApplicationForm.tsx +4 -3
  226. package/src/components/ApplicationForm/renderAgreementSubmit.tsx +13 -6
  227. package/src/components/ApplicationLeadForm/ApplicationLeadForm.tsx +3 -1
  228. package/src/components/ApplicationLeadForm/EsiaLoginBanner.tsx +16 -11
  229. package/src/components/ApplicationLeadForm/consents.ts +0 -4
  230. package/src/components/ApplicationLeadForm/renderAgreementSubmit.tsx +9 -5
  231. package/src/components/DebitForm/DebitForm.tsx +6 -1
  232. package/src/components/DebitForm/DebitFormStepsData.tsx +123 -6
  233. package/src/components/DebitForm/formStateMap.tsx +1 -0
  234. package/src/components/DebitForm/utils.ts +2 -0
  235. package/src/retail/adaptors/getPersonalInfoData.tsx +4 -1
  236. package/src/retail/components/DraftDialog/DraftDialog.tsx +6 -13
  237. package/src/retail/components/DraftDialog/EmptyDraftDialog.tsx +8 -2
  238. package/src/retail/components/DraftDialog/creditProgramCodes.ts +40 -0
  239. package/src/retail/components/DraftDialog/useDraftDialog.tsx +1 -1
  240. package/src/retail/components/DraftDialog/utils.ts +22 -27
  241. package/src/retail/components/Fields/CardCategoryField.tsx +14 -3
  242. package/src/retail/model/LeadFormState.ts +0 -1
  243. package/src/ui-kit/FormField/getObjectValidator.tsx +1 -1
@@ -8,9 +8,10 @@ import { formatDate } from '../../../utils/formatDate';
8
8
  import { noop } from '../../../utils/noop';
9
9
  import { type Task } from '../../api/draftTasksKZO';
10
10
  import { useRetailFormStore } from '../../hooks/useRetailFormStore';
11
+ import { creditCodesToProgrammIdMap, creditProgramCodeToProductIdMap } from './creditProgramCodes';
11
12
  import { DraftActionButton } from './DraftActionButton';
12
13
  import { parseDraftTask } from './parseDraftTask';
13
- import { creditCodesToProgrammIdMap, creditProgramCodeToProductIdMap } from './utils';
14
+ import { getProductData } from './utils';
14
15
 
15
16
  export interface DraftDialogProps extends OnCloseProps {
16
17
  task: Task;
@@ -33,15 +34,7 @@ export const DraftDialog = JSX<DraftDialogProps>(function ({
33
34
 
34
35
  const programmId: string = creditProgramCodeToProductIdMap[creditProgram.code];
35
36
  const isCredit = Boolean(creditCodesToProgrammIdMap[creditProgram.code]);
36
- const getNextStepLink = () => {
37
- if (isDebit) {
38
- return '/debit-card-lead';
39
- } else if (isCredit) {
40
- return '/credit-lead';
41
- }
42
-
43
- return '/credit-card-lead';
44
- };
37
+ const productData = getProductData(isDebit, isCredit);
45
38
 
46
39
  const { id: participantId, profile } = participants[0];
47
40
 
@@ -56,11 +49,11 @@ export const DraftDialog = JSX<DraftDialogProps>(function ({
56
49
  if (profile?.id) {
57
50
  sendAspects(profile.id, taskId);
58
51
  }
59
- navigator.assign(getNextStepLink());
52
+ navigator.assign(productData.nextStepLink);
60
53
  }, []);
61
54
 
62
55
  const handleGoToNewTask = useCallback(() => {
63
- navigator.assign(isCredit ? '/natural/loans/all-goals' : '/natural/creditcards/svoya');
56
+ navigator.assign(productData.newTaskLink);
64
57
  }, []);
65
58
 
66
59
  return (
@@ -81,7 +74,7 @@ export const DraftDialog = JSX<DraftDialogProps>(function ({
81
74
  <DraftActionButton
82
75
  title={isFromLead ? 'Продолжить заполнение текущей заявки' : 'Создать новую заявку'}
83
76
  icon="NewLoanIcon"
84
- description="На получение кредита"
77
+ description={productData.description}
85
78
  onClick={isFromLead ? onClose : handleGoToNewTask}
86
79
  />
87
80
  </div>
@@ -7,12 +7,18 @@ import { Dialog } from '../../../ui-kit/DialogManager/Dialog';
7
7
  import { Heading } from '../../../ui-kit/Heading/Heading';
8
8
  import { Paragraph } from '../../../ui-kit/Paragraph/Paragraph';
9
9
  import { noop } from '../../../utils/noop';
10
+ import { getProductData } from './utils';
10
11
 
11
- export const EmptyDraftDialog = JSX<OnCloseProps>(function ({ onClose = noop }) {
12
+ export interface EmptyDraftDialogProps extends OnCloseProps {
13
+ isDebit?: boolean;
14
+ }
15
+
16
+ export const EmptyDraftDialog = JSX<EmptyDraftDialogProps>(function ({ isDebit, onClose = noop }) {
12
17
  const navigator = locationNavigator();
18
+ const productData = getProductData(isDebit);
13
19
 
14
20
  const handleGoNewTask = useCallback(() => {
15
- navigator.assign('/natural/loans/all-goals');
21
+ navigator.assign(productData.newTaskLink);
16
22
  }, []);
17
23
 
18
24
  const handleGoMainPage = useCallback(() => {
@@ -0,0 +1,40 @@
1
+ /* eslint-disable camelcase */
2
+
3
+ export const creditCodesToProgrammIdMap = {
4
+ credit_cash: '10',
5
+ credit_cash_single_doc: '28',
6
+ credit_mcx: '39',
7
+ family_offer_credit: '41',
8
+ gas_engine_fuel: '33',
9
+ pension_credit: '12',
10
+ ref_credit: '11',
11
+ ref_credit_single_doc: '29',
12
+ self_employed: '34',
13
+ summer_cash: '35',
14
+ summer_cash_pens: '36',
15
+ };
16
+
17
+ const debitCardCodesToProgrammIdMap = {
18
+ amur_debit_card: '17',
19
+ owner_debit_card: '16',
20
+ pension_debit_card: '18',
21
+ salary_debit_card: '38',
22
+ vordi_debit_card: '40',
23
+ eco_debit_card: '42',
24
+ junior_debit_card: '43',
25
+ appetit_debit_card: '44',
26
+ owner_debit_card_plus: '46',
27
+ owner_debit_card_pens_plus: '47',
28
+ };
29
+
30
+ const cardCodesToProgrammIdMap = {
31
+ amur_card: '14',
32
+ owner_card: '13',
33
+ travel_card: '15',
34
+ };
35
+
36
+ export const creditProgramCodeToProductIdMap = {
37
+ ...creditCodesToProgrammIdMap,
38
+ ...cardCodesToProgrammIdMap,
39
+ ...debitCardCodesToProgrammIdMap,
40
+ };
@@ -10,7 +10,7 @@ export const useDraftDialog = () => {
10
10
  open: ({ task, isFromLead, isDebit, onClose, sendAspects }: Partial<DraftDialogProps>) => {
11
11
  task
12
12
  ? openDraftDialog({ task, isFromLead, isDebit, onClose, sendAspects })
13
- : openEmptyDraftDialog({});
13
+ : openEmptyDraftDialog({ isDebit });
14
14
  },
15
15
  };
16
16
  };
@@ -1,5 +1,3 @@
1
- /* eslint-disable camelcase */
2
-
3
1
  import { type Option } from '../../../ui-kit/Select/Option';
4
2
  import { countIncomeAverage } from '../../adaptors/getFamilyStatusAndIncomeData';
5
3
  import { type Participant } from '../../api/updateUserTask';
@@ -43,31 +41,6 @@ export const INCOME_CERTIFICATE = {
43
41
  OTHER: 'Другое',
44
42
  };
45
43
 
46
- export const creditCodesToProgrammIdMap = {
47
- credit_cash: '10',
48
- credit_cash_single_doc: '28',
49
- credit_mcx: '39',
50
- family_offer_credit: '41',
51
- gas_engine_fuel: '33',
52
- pension_credit: '12',
53
- ref_credit: '11',
54
- ref_credit_single_doc: '29',
55
- self_employed: '34',
56
- summer_cash: '35',
57
- summer_cash_pens: '36',
58
- };
59
-
60
- export const cardCodesToProgrammIdMap = {
61
- amur_card: '14',
62
- owner_card: '13',
63
- travel_card: '15',
64
- };
65
-
66
- export const creditProgramCodeToProductIdMap = {
67
- ...creditCodesToProgrammIdMap,
68
- ...cardCodesToProgrammIdMap,
69
- };
70
-
71
44
  export const getParticipantIncomes = (participantIncomes: Participant['participantIncomes']) => {
72
45
  const wages = participantIncomes?.find(
73
46
  (contact) => contact.incomeTypeCd.key === EIncomesType.WAGES,
@@ -161,3 +134,25 @@ export const getSelectValue = (
161
134
  }
162
135
  : undefined;
163
136
  };
137
+
138
+ export const getProductData = (isDebit = false, isCredit = false) => {
139
+ if (isDebit) {
140
+ return {
141
+ nextStepLink: '/debit-card-lead',
142
+ newTaskLink: '/natural/debetcards',
143
+ description: 'На дебетовую карту',
144
+ };
145
+ } else if (isCredit) {
146
+ return {
147
+ nextStepLink: '/credit-lead',
148
+ newTaskLink: '/natural/loans/all-goals',
149
+ description: 'На получение кредита',
150
+ };
151
+ }
152
+
153
+ return {
154
+ nextStepLink: '/credit-card-lead',
155
+ newTaskLink: '/natural/creditcards/svoya',
156
+ description: 'На получение кредитной карты',
157
+ };
158
+ };
@@ -1,5 +1,5 @@
1
1
  import { JSX } from '@redneckz/uni-jsx';
2
- import { useEffect, useMemo, useState } from '@redneckz/uni-jsx/lib/hooks';
2
+ import { useCallback, useEffect, useMemo, useState } from '@redneckz/uni-jsx/lib/hooks';
3
3
  import { useLocalStorage } from '../../../hooks/useLocalStorage';
4
4
  import { type CustomFieldProps } from '../../../ui-kit/FormField/CustomFieldProps';
5
5
  import { InfoCard } from '../../../ui-kit/InfoCard/InfoCard';
@@ -13,6 +13,17 @@ export const CardCategoryField = JSX<CustomFieldProps>(({ field, input }) => {
13
13
  const { value: selectedCardCategory, onChange: cardCategoryChange } = field('cardCategory');
14
14
  const selectedPaymentSystem = field('paymentSystem')?.value?.key;
15
15
 
16
+ const getCardCategoryValue = useCallback(
17
+ (fetchedCardTypes: CardTypeData[]) =>
18
+ fetchedCardTypes.length === 1
19
+ ? {
20
+ key: fetchedCardTypes[0].key,
21
+ text: fetchedCardTypes[0].value,
22
+ }
23
+ : null,
24
+ [],
25
+ );
26
+
16
27
  useEffect(() => {
17
28
  if (selectedPaymentSystem && programId) {
18
29
  (async () => {
@@ -20,11 +31,11 @@ export const CardCategoryField = JSX<CustomFieldProps>(({ field, input }) => {
20
31
  setCardTypes(fetchedCardTypes);
21
32
 
22
33
  if (!isValidCardCategory(fetchedCardTypes, selectedCardCategory as Option)) {
23
- cardCategoryChange && cardCategoryChange(null);
34
+ cardCategoryChange?.(getCardCategoryValue(fetchedCardTypes));
24
35
  }
25
36
  })();
26
37
  }
27
- }, [selectedPaymentSystem]);
38
+ }, [selectedPaymentSystem, getCardCategoryValue]);
28
39
 
29
40
  const description = useMemo(
30
41
  () => cardTypes?.find((_) => _.key === selectedCardCategory?.key)?.description,
@@ -20,7 +20,6 @@ export interface CreditCardFormConsents {
20
20
 
21
21
  export interface DebitCardFormConsents {
22
22
  processPersonalDataFlg?: boolean;
23
- consentProviderFlg?: boolean;
24
23
  consentOthersFlg?: boolean;
25
24
  consentInformFlg?: boolean;
26
25
  consentFATCA?: boolean;
@@ -80,7 +80,7 @@ const byCondition =
80
80
  <FormState extends Record<string, any>>(formState: FormState) =>
81
81
  (fieldDef: BaseFieldDef) =>
82
82
  !fieldDef?.condition ||
83
- fieldDef.condition.values.find((_) => {
83
+ fieldDef.condition.values.some((_) => {
84
84
  const dependencyValue = formState?.[fieldDef?.condition?.name ?? ''];
85
85
 
86
86
  return _ === (dependencyValue?.key ?? dependencyValue);