@redneckz/wildless-cms-uni-blocks 0.14.1042 → 0.14.1043

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 (53) hide show
  1. package/bundle/bundle.umd.js +22 -6
  2. package/bundle/bundle.umd.min.js +1 -1
  3. package/bundle/retail/components/DraftDialog/DraftDialog.d.ts +1 -1
  4. package/bundle/retail/components/DraftDialog/DraftDialogContent.d.ts +10 -0
  5. package/bundle/retail/components/DraftDialog/creditProgramCodes.d.ts +2 -0
  6. package/dist/retail/components/DraftDialog/DraftDialog.d.ts +1 -1
  7. package/dist/retail/components/DraftDialog/DraftDialog.js +3 -8
  8. package/dist/retail/components/DraftDialog/DraftDialog.js.map +1 -1
  9. package/dist/retail/components/DraftDialog/DraftDialogContent.d.ts +10 -0
  10. package/dist/retail/components/DraftDialog/DraftDialogContent.js +11 -0
  11. package/dist/retail/components/DraftDialog/DraftDialogContent.js.map +1 -0
  12. package/dist/retail/components/DraftDialog/creditProgramCodes.d.ts +2 -0
  13. package/dist/retail/components/DraftDialog/creditProgramCodes.js +17 -1
  14. package/dist/retail/components/DraftDialog/creditProgramCodes.js.map +1 -1
  15. package/lib/retail/components/DraftDialog/DraftDialog.d.ts +1 -1
  16. package/lib/retail/components/DraftDialog/DraftDialog.js +5 -10
  17. package/lib/retail/components/DraftDialog/DraftDialog.js.map +1 -1
  18. package/lib/retail/components/DraftDialog/DraftDialogContent.d.ts +10 -0
  19. package/lib/retail/components/DraftDialog/DraftDialogContent.js +9 -0
  20. package/lib/retail/components/DraftDialog/DraftDialogContent.js.map +1 -0
  21. package/lib/retail/components/DraftDialog/creditProgramCodes.d.ts +2 -0
  22. package/lib/retail/components/DraftDialog/creditProgramCodes.js +15 -0
  23. package/lib/retail/components/DraftDialog/creditProgramCodes.js.map +1 -1
  24. package/mobile/bundle/bundle.umd.js +22 -6
  25. package/mobile/bundle/bundle.umd.min.js +1 -1
  26. package/mobile/bundle/retail/components/DraftDialog/DraftDialog.d.ts +1 -1
  27. package/mobile/bundle/retail/components/DraftDialog/DraftDialogContent.d.ts +10 -0
  28. package/mobile/bundle/retail/components/DraftDialog/creditProgramCodes.d.ts +2 -0
  29. package/mobile/dist/retail/components/DraftDialog/DraftDialog.d.ts +1 -1
  30. package/mobile/dist/retail/components/DraftDialog/DraftDialog.js +3 -8
  31. package/mobile/dist/retail/components/DraftDialog/DraftDialog.js.map +1 -1
  32. package/mobile/dist/retail/components/DraftDialog/DraftDialogContent.d.ts +10 -0
  33. package/mobile/dist/retail/components/DraftDialog/DraftDialogContent.js +11 -0
  34. package/mobile/dist/retail/components/DraftDialog/DraftDialogContent.js.map +1 -0
  35. package/mobile/dist/retail/components/DraftDialog/creditProgramCodes.d.ts +2 -0
  36. package/mobile/dist/retail/components/DraftDialog/creditProgramCodes.js +17 -1
  37. package/mobile/dist/retail/components/DraftDialog/creditProgramCodes.js.map +1 -1
  38. package/mobile/lib/retail/components/DraftDialog/DraftDialog.d.ts +1 -1
  39. package/mobile/lib/retail/components/DraftDialog/DraftDialog.js +5 -10
  40. package/mobile/lib/retail/components/DraftDialog/DraftDialog.js.map +1 -1
  41. package/mobile/lib/retail/components/DraftDialog/DraftDialogContent.d.ts +10 -0
  42. package/mobile/lib/retail/components/DraftDialog/DraftDialogContent.js +9 -0
  43. package/mobile/lib/retail/components/DraftDialog/DraftDialogContent.js.map +1 -0
  44. package/mobile/lib/retail/components/DraftDialog/creditProgramCodes.d.ts +2 -0
  45. package/mobile/lib/retail/components/DraftDialog/creditProgramCodes.js +15 -0
  46. package/mobile/lib/retail/components/DraftDialog/creditProgramCodes.js.map +1 -1
  47. package/mobile/src/retail/components/DraftDialog/DraftDialog.tsx +14 -39
  48. package/mobile/src/retail/components/DraftDialog/DraftDialogContent.tsx +49 -0
  49. package/mobile/src/retail/components/DraftDialog/creditProgramCodes.ts +24 -0
  50. package/package.json +1 -1
  51. package/src/retail/components/DraftDialog/DraftDialog.tsx +14 -39
  52. package/src/retail/components/DraftDialog/DraftDialogContent.tsx +49 -0
  53. package/src/retail/components/DraftDialog/creditProgramCodes.ts +24 -0
@@ -1,4 +1,4 @@
1
- import type { OnCloseProps } from '../../../model/OnCloseProps';
1
+ import { type OnCloseProps } from '../../../model/OnCloseProps';
2
2
  import { type Task } from '../../api/draftTasksKZO';
3
3
  import { type DraftTaskType } from '../../model/DraftTaskType';
4
4
  export interface DraftDialogProps extends OnCloseProps {
@@ -0,0 +1,10 @@
1
+ import { type OnCloseProps } from '../../../model/OnCloseProps';
2
+ import { type getProductData } from './utils';
3
+ export interface DraftDialogContentProps extends OnCloseProps {
4
+ createdDate: string;
5
+ productData: ReturnType<typeof getProductData>;
6
+ isFromLead: boolean;
7
+ handleGoToDraft: () => void;
8
+ handleGoToNewTask: () => void;
9
+ }
10
+ export declare const DraftDialogContent: import("@redneckz/uni-jsx").UNIComponent<DraftDialogContentProps, any, any>;
@@ -1,3 +1,4 @@
1
+ import { type DraftTaskType } from '../../model/DraftTaskType';
1
2
  export declare const creditCodesToProgrammIdMap: {
2
3
  credit_cash: string;
3
4
  credit_cash_single_doc: string;
@@ -37,3 +38,4 @@ export declare const creditProgramCodeToProductIdMap: {
37
38
  summer_cash: string;
38
39
  summer_cash_pens: string;
39
40
  };
41
+ export declare const getCreditProgramTaskType: (creditProgramCode?: string, isDebit?: boolean) => DraftTaskType | undefined;
@@ -1,4 +1,4 @@
1
- import type { OnCloseProps } from '../../../model/OnCloseProps';
1
+ import { type OnCloseProps } from '../../../model/OnCloseProps';
2
2
  import { type Task } from '../../api/draftTasksKZO';
3
3
  import { type DraftTaskType } from '../../model/DraftTaskType';
4
4
  export interface DraftDialogProps extends OnCloseProps {
@@ -5,26 +5,21 @@ const uni_jsx_1 = require("@redneckz/uni-jsx");
5
5
  const hooks_1 = require("@redneckz/uni-jsx/lib/hooks");
6
6
  const locationNavigator_1 = require("../../../external/locationNavigator");
7
7
  const Dialog_1 = require("../../../ui-kit/DialogManager/Dialog");
8
- const Heading_1 = require("../../../ui-kit/Heading/Heading");
9
- const formatDate_1 = require("../../../utils/formatDate");
10
8
  const noop_1 = require("../../../utils/noop");
11
9
  const sendMessage_1 = require("../../api/sendMessage");
12
10
  const useRetailFormStore_1 = require("../../hooks/useRetailFormStore");
13
11
  const checkNewMicroservice_1 = require("../../utils/checkNewMicroservice");
14
12
  const creditProgramCodes_1 = require("./creditProgramCodes");
15
- const DraftActionButton_1 = require("./DraftActionButton");
13
+ const DraftDialogContent_1 = require("./DraftDialogContent");
16
14
  const parseDraftTask_1 = require("./parseDraftTask");
17
15
  const utils_1 = require("./utils");
18
- const getTaskTypeOrDebit = (taskType, isDebit) => {
19
- return taskType || (isDebit ? 'debit' : undefined);
20
- };
21
16
  exports.DraftDialog = (0, uni_jsx_1.JSX)(function ({ task, taskType, isDebit, isFromLead = false, sendAspects = noop_1.noop, onClose = noop_1.noop, }) {
22
17
  const retailFormStore = (0, useRetailFormStore_1.useRetailFormStore)();
23
18
  const navigator = (0, locationNavigator_1.locationNavigator)();
24
19
  const isNewMicroservice = (0, checkNewMicroservice_1.checkNewMicroservice)();
25
20
  const { participants, participant, creditProgram, createdDate = '', id: taskId } = task;
26
21
  const programmId = creditProgramCodes_1.creditProgramCodeToProductIdMap[creditProgram.code];
27
- const productData = (0, utils_1.getProductData)(getTaskTypeOrDebit(taskType, isDebit));
22
+ const productData = (0, utils_1.getProductData)(taskType ?? (0, creditProgramCodes_1.getCreditProgramTaskType)(task.creditProgram.code, isDebit));
28
23
  const currentParticipant = participant || participants?.[0];
29
24
  const { id: participantId, profile } = currentParticipant || {};
30
25
  const handleGoToDraft = (0, hooks_1.useCallback)(() => {
@@ -54,6 +49,6 @@ exports.DraftDialog = (0, uni_jsx_1.JSX)(function ({ task, taskType, isDebit, is
54
49
  }
55
50
  navigator.assign(productData.newTaskLink);
56
51
  }, [task.id, productData.newTaskLink, isNewMicroservice]);
57
- return ((0, jsx_runtime_1.jsx)(Dialog_1.Dialog, { onClose: onClose, children: (0, jsx_runtime_1.jsxs)("div", { className: "flex flex-col gap-lg items-center mt-xs mx-6xl", children: [(0, jsx_runtime_1.jsx)(Heading_1.Heading, { className: "whitespace-pre-wrap text-center", title: "\u041D\u0430\u0448\u043B\u0438 \u0447\u0435\u0440\u043D\u043E\u0432\u0438\u043A \u0432\u0430\u0448\u0435\u0439 \u0437\u0430\u044F\u0432\u043A\u0438", headingType: "h5" }), (0, jsx_runtime_1.jsxs)("div", { className: "flex flex-col gap-m max-w-lg", children: [(0, jsx_runtime_1.jsx)(DraftActionButton_1.DraftActionButton, { title: "\u041F\u0440\u043E\u0434\u043E\u043B\u0436\u0438\u0442\u044C \u0437\u0430\u043F\u043E\u043B\u043D\u0435\u043D\u0438\u0435 \u0447\u0435\u0440\u043D\u043E\u0432\u0438\u043A\u0430", icon: "BankColorIcon", description: createdDate ? `Черновик от ${(0, formatDate_1.formatDate)(new Date(createdDate))}` : '', onClick: handleGoToDraft, name: "go-to-draft-button" }), (0, jsx_runtime_1.jsx)(DraftActionButton_1.DraftActionButton, { title: isFromLead ? 'Продолжить заполнение текущей заявки' : 'Создать новую заявку', icon: "NewLoanIcon", description: productData.description, onClick: isFromLead ? onClose : handleGoToNewTask, name: "go-to-current-task-button" })] })] }) }));
52
+ return ((0, jsx_runtime_1.jsx)(Dialog_1.Dialog, { onClose: onClose, children: (0, jsx_runtime_1.jsx)(DraftDialogContent_1.DraftDialogContent, { createdDate: createdDate, productData: productData, isFromLead: isFromLead, handleGoToDraft: handleGoToDraft, handleGoToNewTask: handleGoToNewTask, onClose: onClose }) }));
58
53
  });
59
54
  //# sourceMappingURL=DraftDialog.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"DraftDialog.js","sourceRoot":"","sources":["../../../../src/retail/components/DraftDialog/DraftDialog.tsx"],"names":[],"mappings":";;;AAAA,+CAAwC;AACxC,uDAA0D;AAC1D,2EAAwE;AAExE,iEAA8D;AAC9D,6DAA0D;AAC1D,0DAAuD;AACvD,8CAA2C;AAE3C,uDAAo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C,CAAC,CAAC,eAAe,IAAA,uBAAU,EAAC,IAAI,IAAI,CAAC,WAAW,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,EAClF,OAAO,EAAE,eAAe,EACxB,IAAI,EAAC,oBAAoB,GACzB,EACF,uBAAC,qCAAiB,IAChB,KAAK,EAAE,UAAU,CAAC,CAAC,CAAC,sCAAsC,CAAC,CAAC,CAAC,sBAAsB,EACnF,IAAI,EAAC,aAAa,EAClB,WAAW,EAAE,WAAW,CAAC,WAAW,EACpC,OAAO,EAAE,UAAU,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,iBAAiB,EACjD,IAAI,EAAC,2BAA2B,GAChC,IACE,IACF,GACC,CACV,CAAC;AACJ,CAAC,CAAC,CAAC"}
1
+ {"version":3,"file":"DraftDialog.js","sourceRoot":"","sources":["../../../../src/retail/components/DraftDialog/DraftDialog.tsx"],"names":[],"mappings":";;;AAAA,+CAAwC;AACxC,uDAA0D;AAC1D,2EAAwE;AAExE,iEAA8D;AAC9D,8CAA2C;AAE3C,uDAAoD;AACpD,uEAAoE;AAEpE,2EAAwE;AACxE,6DAAiG;AACjG,6DAA0D;AAC1D,qDAAkD;AAClD,mCAAyC;AAU5B,QAAA,WAAW,GAAG,IAAA,aAAG,EAAmB,UAAU,EACzD,IAAI,EACJ,QAAQ,EACR,OAAO,EACP,UAAU,GAAG,KAAK,EAClB,WAAW,GAAG,WAAI,EAClB,OAAO,GAAG,WAAI,GACf;IACC,MAAM,eAAe,GAAG,IAAA,uCAAkB,GAAE,CAAC;IAC7C,MAAM,SAAS,GAAG,IAAA,qCAAiB,GAAE,CAAC;IACtC,MAAM,iBAAiB,GAAG,IAAA,2CAAoB,GAAE,CAAC;IACjD,MAAM,EAAE,YAAY,EAAE,WAAW,EAAE,aAAa,EAAE,WAAW,GAAG,EAAE,EAAE,EAAE,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC;IACxF,MAAM,UAAU,GAAW,oDAA+B,CAAC,aAA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C,EAAE,CAAC,CAAC;aACnB;SACF;QACD,SAAS,CAAC,MAAM,CAAC,WAAW,CAAC,WAAW,CAAC,CAAC;IAC5C,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,EAAE,WAAW,CAAC,WAAW,EAAE,iBAAiB,CAAC,CAAC,CAAC;IAE1D,OAAO,CACL,uBAAC,eAAM,IAAC,OAAO,EAAE,OAAO,YACtB,uBAAC,uCAAkB,IACjB,WAAW,EAAE,WAAW,EACxB,WAAW,EAAE,WAAW,EACxB,UAAU,EAAE,UAAU,EACtB,eAAe,EAAE,eAAe,EAChC,iBAAiB,EAAE,iBAAiB,EACpC,OAAO,EAAE,OAAO,GAChB,GACK,CACV,CAAC;AACJ,CAAC,CAAC,CAAC"}
@@ -0,0 +1,10 @@
1
+ import { type OnCloseProps } from '../../../model/OnCloseProps';
2
+ import { type getProductData } from './utils';
3
+ export interface DraftDialogContentProps extends OnCloseProps {
4
+ createdDate: string;
5
+ productData: ReturnType<typeof getProductData>;
6
+ isFromLead: boolean;
7
+ handleGoToDraft: () => void;
8
+ handleGoToNewTask: () => void;
9
+ }
10
+ export declare const DraftDialogContent: import("@redneckz/uni-jsx").UNIComponent<DraftDialogContentProps, any, any>;
@@ -0,0 +1,11 @@
1
+ Object.defineProperty(exports, "__esModule", { value: true });
2
+ exports.DraftDialogContent = void 0;
3
+ const jsx_runtime_1 = require("@redneckz/uni-jsx/jsx-runtime");
4
+ const uni_jsx_1 = require("@redneckz/uni-jsx");
5
+ const Heading_1 = require("../../../ui-kit/Heading/Heading");
6
+ const formatDate_1 = require("../../../utils/formatDate");
7
+ const DraftActionButton_1 = require("./DraftActionButton");
8
+ exports.DraftDialogContent = (0, uni_jsx_1.JSX)(function ({ createdDate, productData, isFromLead, handleGoToDraft, handleGoToNewTask, onClose, }) {
9
+ return ((0, jsx_runtime_1.jsxs)("div", { className: "flex flex-col gap-lg items-center mt-xs mx-6xl", children: [(0, jsx_runtime_1.jsx)(Heading_1.Heading, { className: "whitespace-pre-wrap text-center", title: "\u041D\u0430\u0448\u043B\u0438 \u0447\u0435\u0440\u043D\u043E\u0432\u0438\u043A \u0432\u0430\u0448\u0435\u0439 \u0437\u0430\u044F\u0432\u043A\u0438", headingType: "h5" }), (0, jsx_runtime_1.jsxs)("div", { className: "flex flex-col gap-m max-w-lg", children: [(0, jsx_runtime_1.jsx)(DraftActionButton_1.DraftActionButton, { title: "\u041F\u0440\u043E\u0434\u043E\u043B\u0436\u0438\u0442\u044C \u0437\u0430\u043F\u043E\u043B\u043D\u0435\u043D\u0438\u0435 \u0447\u0435\u0440\u043D\u043E\u0432\u0438\u043A\u0430", icon: "BankColorIcon", description: createdDate ? `Черновик от ${(0, formatDate_1.formatDate)(new Date(createdDate))}` : '', onClick: handleGoToDraft, name: "go-to-draft-button" }), (0, jsx_runtime_1.jsx)(DraftActionButton_1.DraftActionButton, { title: isFromLead ? 'Продолжить заполнение текущей заявки' : 'Создать новую заявку', icon: "NewLoanIcon", description: productData.description, onClick: isFromLead ? onClose : handleGoToNewTask, name: "go-to-current-task-button" })] })] }));
10
+ });
11
+ //# sourceMappingURL=DraftDialogContent.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DraftDialogContent.js","sourceRoot":"","sources":["../../../../src/retail/components/DraftDialog/DraftDialogContent.tsx"],"names":[],"mappings":";;;AAAA,+CAAwC;AAExC,6DAA0D;AAC1D,0DAAuD;AACvD,2DAAwD;AAW3C,QAAA,kBAAkB,GAAG,IAAA,aAAG,EAA0B,UAAU,EACvE,WAAW,EACX,WAAW,EACX,UAAU,EACV,eAAe,EACf,iBAAiB,EACjB,OAAO,GACR;IACC,OAAO,CACL,iCAAK,SAAS,EAAC,gDAAgD,aAC7D,uBAAC,iBAAO,IACN,SAAS,EAAC,iCAAiC,EAC3C,KAAK,EAAC,qJAA6B,EACnC,WAAW,EAAC,IAAI,GAChB,EACF,iCAAK,SAAS,EAAC,8BAA8B,aAC3C,uBAAC,qCAAiB,IAChB,KAAK,EAAC,kLAAiC,EACvC,IAAI,EAAC,eAAe,EACpB,WAAW,EAAE,WAAW,CAAC,CAAC,CAAC,eAAe,IAAA,uBAAU,EAAC,IAAI,IAAI,CAAC,WAAW,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,EAClF,OAAO,EAAE,eAAe,EACxB,IAAI,EAAC,oBAAoB,GACzB,EACF,uBAAC,qCAAiB,IAChB,KAAK,EAAE,UAAU,CAAC,CAAC,CAAC,sCAAsC,CAAC,CAAC,CAAC,sBAAsB,EACnF,IAAI,EAAC,aAAa,EAClB,WAAW,EAAE,WAAW,CAAC,WAAW,EACpC,OAAO,EAAE,UAAU,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,iBAAiB,EACjD,IAAI,EAAC,2BAA2B,GAChC,IACE,IACF,CACP,CAAC;AACJ,CAAC,CAAC,CAAC"}
@@ -1,3 +1,4 @@
1
+ import { type DraftTaskType } from '../../model/DraftTaskType';
1
2
  export declare const creditCodesToProgrammIdMap: {
2
3
  credit_cash: string;
3
4
  credit_cash_single_doc: string;
@@ -37,3 +38,4 @@ export declare const creditProgramCodeToProductIdMap: {
37
38
  summer_cash: string;
38
39
  summer_cash_pens: string;
39
40
  };
41
+ export declare const getCreditProgramTaskType: (creditProgramCode?: string, isDebit?: boolean) => DraftTaskType | undefined;
@@ -1,6 +1,6 @@
1
1
  /* eslint-disable camelcase */
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.creditProgramCodeToProductIdMap = exports.creditCodesToProgrammIdMap = void 0;
3
+ exports.getCreditProgramTaskType = exports.creditProgramCodeToProductIdMap = exports.creditCodesToProgrammIdMap = void 0;
4
4
  exports.creditCodesToProgrammIdMap = {
5
5
  credit_cash: '10',
6
6
  credit_cash_single_doc: '28',
@@ -36,4 +36,20 @@ exports.creditProgramCodeToProductIdMap = {
36
36
  ...cardCodesToProgrammIdMap,
37
37
  ...debitCardCodesToProgrammIdMap,
38
38
  };
39
+ const getCreditProgramTaskType = (creditProgramCode, isDebit) => {
40
+ if (isDebit || (creditProgramCode && creditProgramCode in debitCardCodesToProgrammIdMap)) {
41
+ return 'debit';
42
+ }
43
+ if (!creditProgramCode) {
44
+ return undefined;
45
+ }
46
+ if (creditProgramCode in exports.creditCodesToProgrammIdMap) {
47
+ return 'credit';
48
+ }
49
+ if (creditProgramCode in cardCodesToProgrammIdMap) {
50
+ return 'card';
51
+ }
52
+ return undefined;
53
+ };
54
+ exports.getCreditProgramTaskType = getCreditProgramTaskType;
39
55
  //# sourceMappingURL=creditProgramCodes.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"creditProgramCodes.js","sourceRoot":"","sources":["../../../../src/retail/components/DraftDialog/creditProgramCodes.ts"],"names":[],"mappings":"AAAA,8BAA8B;;;AAEjB,QAAA,0BAA0B,GAAG;IACxC,WAAW,EAAE,IAAI;IACjB,sBAAsB,EAAE,IAAI;IAC5B,UAAU,EAAE,IAAI;IAChB,mBAAmB,EAAE,IAAI;IACzB,eAAe,EAAE,IAAI;IACrB,cAAc,EAAE,IAAI;IACpB,UAAU,EAAE,IAAI;IAChB,qBAAqB,EAAE,IAAI;IAC3B,aAAa,EAAE,IAAI;IACnB,WAAW,EAAE,IAAI;IACjB,gBAAgB,EAAE,IAAI;CACvB,CAAC;AAEF,MAAM,6BAA6B,GAAG;IACpC,eAAe,EAAE,IAAI;IACrB,gBAAgB,EAAE,IAAI;IACtB,kBAAkB,EAAE,IAAI;IACxB,iBAAiB,EAAE,IAAI;IACvB,gBAAgB,EAAE,IAAI;IACtB,cAAc,EAAE,IAAI;IACpB,iBAAiB,EAAE,IAAI;IACvB,kBAAkB,EAAE,IAAI;IACxB,qBAAqB,EAAE,IAAI;IAC3B,0BAA0B,EAAE,IAAI;CACjC,CAAC;AAEF,MAAM,wBAAwB,GAAG;IAC/B,SAAS,EAAE,IAAI;IACf,UAAU,EAAE,IAAI;IAChB,WAAW,EAAE,IAAI;CAClB,CAAC;AAEW,QAAA,+BAA+B,GAAG;IAC7C,GAAG,kCAA0B;IAC7B,GAAG,wBAAwB;IAC3B,GAAG,6BAA6B;CACjC,CAAC"}
1
+ {"version":3,"file":"creditProgramCodes.js","sourceRoot":"","sources":["../../../../src/retail/components/DraftDialog/creditProgramCodes.ts"],"names":[],"mappings":"AAAA,8BAA8B;;;AAIjB,QAAA,0BAA0B,GAAG;IACxC,WAAW,EAAE,IAAI;IACjB,sBAAsB,EAAE,IAAI;IAC5B,UAAU,EAAE,IAAI;IAChB,mBAAmB,EAAE,IAAI;IACzB,eAAe,EAAE,IAAI;IACrB,cAAc,EAAE,IAAI;IACpB,UAAU,EAAE,IAAI;IAChB,qBAAqB,EAAE,IAAI;IAC3B,aAAa,EAAE,IAAI;IACnB,WAAW,EAAE,IAAI;IACjB,gBAAgB,EAAE,IAAI;CACvB,CAAC;AAEF,MAAM,6BAA6B,GAAG;IACpC,eAAe,EAAE,IAAI;IACrB,gBAAgB,EAAE,IAAI;IACtB,kBAAkB,EAAE,IAAI;IACxB,iBAAiB,EAAE,IAAI;IACvB,gBAAgB,EAAE,IAAI;IACtB,cAAc,EAAE,IAAI;IACpB,iBAAiB,EAAE,IAAI;IACvB,kBAAkB,EAAE,IAAI;IACxB,qBAAqB,EAAE,IAAI;IAC3B,0BAA0B,EAAE,IAAI;CACjC,CAAC;AAEF,MAAM,wBAAwB,GAAG;IAC/B,SAAS,EAAE,IAAI;IACf,UAAU,EAAE,IAAI;IAChB,WAAW,EAAE,IAAI;CAClB,CAAC;AAEW,QAAA,+BAA+B,GAAG;IAC7C,GAAG,kCAA0B;IAC7B,GAAG,wBAAwB;IAC3B,GAAG,6BAA6B;CACjC,CAAC;AAEK,MAAM,wBAAwB,GAAG,CACtC,iBAA0B,EAC1B,OAAiB,EACU,EAAE;IAC7B,IAAI,OAAO,IAAI,CAAC,iBAAiB,IAAI,iBAAiB,IAAI,6BAA6B,CAAC,EAAE;QACxF,OAAO,OAAO,CAAC;KAChB;IAED,IAAI,CAAC,iBAAiB,EAAE;QACtB,OAAO,SAAS,CAAC;KAClB;IAED,IAAI,iBAAiB,IAAI,kCAA0B,EAAE;QACnD,OAAO,QAAQ,CAAC;KACjB;IACD,IAAI,iBAAiB,IAAI,wBAAwB,EAAE;QACjD,OAAO,MAAM,CAAC;KACf;IAED,OAAO,SAAS,CAAC;AACnB,CAAC,CAAC;AApBW,QAAA,wBAAwB,4BAoBnC"}
@@ -1,4 +1,4 @@
1
- import type { OnCloseProps } from '../../../model/OnCloseProps';
1
+ import { type OnCloseProps } from '../../../model/OnCloseProps';
2
2
  import { type Task } from '../../api/draftTasksKZO';
3
3
  import { type DraftTaskType } from '../../model/DraftTaskType';
4
4
  export interface DraftDialogProps extends OnCloseProps {
@@ -1,28 +1,23 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "@redneckz/uni-jsx/jsx-runtime";
1
+ import { jsx as _jsx } from "@redneckz/uni-jsx/jsx-runtime";
2
2
  import { JSX } from '@redneckz/uni-jsx';
3
3
  import { useCallback } from '@redneckz/uni-jsx/lib/hooks';
4
4
  import { locationNavigator } from '../../../external/locationNavigator.js';
5
5
  import { Dialog } from '../../../ui-kit/DialogManager/Dialog.js';
6
- import { Heading } from '../../../ui-kit/Heading/Heading.js';
7
- import { formatDate } from '../../../utils/formatDate.js';
8
6
  import { noop } from '../../../utils/noop.js';
9
7
  import { sendMessage } from '../../api/sendMessage.js';
10
8
  import { useRetailFormStore } from '../../hooks/useRetailFormStore.js';
11
9
  import { checkNewMicroservice } from '../../utils/checkNewMicroservice.js';
12
- import { creditProgramCodeToProductIdMap } from './creditProgramCodes.js';
13
- import { DraftActionButton } from './DraftActionButton.js';
10
+ import { creditProgramCodeToProductIdMap, getCreditProgramTaskType } from './creditProgramCodes.js';
11
+ import { DraftDialogContent } from './DraftDialogContent.js';
14
12
  import { parseDraftTask } from './parseDraftTask.js';
15
13
  import { getProductData } from './utils.js';
16
- const getTaskTypeOrDebit = (taskType, isDebit) => {
17
- return taskType || (isDebit ? 'debit' : undefined);
18
- };
19
14
  export const DraftDialog = JSX(function ({ task, taskType, isDebit, isFromLead = false, sendAspects = noop, onClose = noop, }) {
20
15
  const retailFormStore = useRetailFormStore();
21
16
  const navigator = locationNavigator();
22
17
  const isNewMicroservice = checkNewMicroservice();
23
18
  const { participants, participant, creditProgram, createdDate = '', id: taskId } = task;
24
19
  const programmId = creditProgramCodeToProductIdMap[creditProgram.code];
25
- const productData = getProductData(getTaskTypeOrDebit(taskType, isDebit));
20
+ const productData = getProductData(taskType ?? getCreditProgramTaskType(task.creditProgram.code, isDebit));
26
21
  const currentParticipant = participant || participants?.[0];
27
22
  const { id: participantId, profile } = currentParticipant || {};
28
23
  const handleGoToDraft = useCallback(() => {
@@ -52,6 +47,6 @@ export const DraftDialog = JSX(function ({ task, taskType, isDebit, isFromLead =
52
47
  }
53
48
  navigator.assign(productData.newTaskLink);
54
49
  }, [task.id, productData.newTaskLink, isNewMicroservice]);
55
- return (_jsx(Dialog, { onClose: onClose, children: _jsxs("div", { className: "flex flex-col gap-lg items-center mt-xs mx-6xl", children: [_jsx(Heading, { className: "whitespace-pre-wrap text-center", title: "\u041D\u0430\u0448\u043B\u0438 \u0447\u0435\u0440\u043D\u043E\u0432\u0438\u043A \u0432\u0430\u0448\u0435\u0439 \u0437\u0430\u044F\u0432\u043A\u0438", headingType: "h5" }), _jsxs("div", { className: "flex flex-col gap-m max-w-lg", children: [_jsx(DraftActionButton, { title: "\u041F\u0440\u043E\u0434\u043E\u043B\u0436\u0438\u0442\u044C \u0437\u0430\u043F\u043E\u043B\u043D\u0435\u043D\u0438\u0435 \u0447\u0435\u0440\u043D\u043E\u0432\u0438\u043A\u0430", icon: "BankColorIcon", description: createdDate ? `Черновик от ${formatDate(new Date(createdDate))}` : '', onClick: handleGoToDraft, name: "go-to-draft-button" }), _jsx(DraftActionButton, { title: isFromLead ? 'Продолжить заполнение текущей заявки' : 'Создать новую заявку', icon: "NewLoanIcon", description: productData.description, onClick: isFromLead ? onClose : handleGoToNewTask, name: "go-to-current-task-button" })] })] }) }));
50
+ return (_jsx(Dialog, { onClose: onClose, children: _jsx(DraftDialogContent, { createdDate: createdDate, productData: productData, isFromLead: isFromLead, handleGoToDraft: handleGoToDraft, handleGoToNewTask: handleGoToNewTask, onClose: onClose }) }));
56
51
  });
57
52
  //# sourceMappingURL=DraftDialog.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"DraftDialog.js","sourceRoot":"","sources":["../../../../src/retail/components/DraftDialog/DraftDialog.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AACxC,OAAO,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAC1D,OAAO,EAAE,iBAAiB,EAAE,MAAM,qCAAqC,CAAC;AAExE,OAAO,EAAE,MAAM,EAAE,MAAM,sCAAsC,CAAC;AAC9D,OAAO,EAAE,OAAO,EAAE,MAAM,iCAAiC,CAAC;AAC1D,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AACvD,OAAO,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAC;AAE3C,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACpD,OAAO,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AAEpE,OAAO,EAAE,oBAAoB,EAAE,MAAM,kCAAkC,CAAC;AACxE,OAAO,EAAE,+BAA+B,EAAE,MAAM,sBAAsB,CAAC;AACvE,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAUzC,MAAM,kBAAkB,GAAG,CAAC,QAAwB,EAAE,OAAiB,EAAE,EAAE;IACzE,OAAO,QAAQ,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC;AACrD,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,WA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AAE,EAAE;gBACX,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;aACnB;SACF;QACD,SAAS,CAAC,MAAM,CAAC,WAAW,CAAC,WAAW,CAAC,CAAC;IAC5C,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,EAAE,WAAW,CAAC,WAAW,EAAE,iBAAiB,CAAC,CAAC,CAAC;IAE1D,OAAO,CACL,KAAC,MAAM,IAAC,OAAO,EAAE,OAAO,YACtB,KAAC,kBAAkB,IACjB,WAAW,EAAE,WAAW,EACxB,WAAW,EAAE,WAAW,EACxB,UAAU,EAAE,UAAU,EACtB,eAAe,EAAE,eAAe,EAChC,iBAAiB,EAAE,iBAAiB,EACpC,OAAO,EAAE,OAAO,GAChB,GACK,CACV,CAAC;AACJ,CAAC,CAAC,CAAC"}
@@ -0,0 +1,10 @@
1
+ import { type OnCloseProps } from '../../../model/OnCloseProps';
2
+ import { type getProductData } from './utils';
3
+ export interface DraftDialogContentProps extends OnCloseProps {
4
+ createdDate: string;
5
+ productData: ReturnType<typeof getProductData>;
6
+ isFromLead: boolean;
7
+ handleGoToDraft: () => void;
8
+ handleGoToNewTask: () => void;
9
+ }
10
+ export declare const DraftDialogContent: import("@redneckz/uni-jsx").UNIComponent<DraftDialogContentProps, any, any>;
@@ -0,0 +1,9 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "@redneckz/uni-jsx/jsx-runtime";
2
+ import { JSX } from '@redneckz/uni-jsx';
3
+ import { Heading } from '../../../ui-kit/Heading/Heading.js';
4
+ import { formatDate } from '../../../utils/formatDate.js';
5
+ import { DraftActionButton } from './DraftActionButton.js';
6
+ export const DraftDialogContent = JSX(function ({ createdDate, productData, isFromLead, handleGoToDraft, handleGoToNewTask, onClose, }) {
7
+ return (_jsxs("div", { className: "flex flex-col gap-lg items-center mt-xs mx-6xl", children: [_jsx(Heading, { className: "whitespace-pre-wrap text-center", title: "\u041D\u0430\u0448\u043B\u0438 \u0447\u0435\u0440\u043D\u043E\u0432\u0438\u043A \u0432\u0430\u0448\u0435\u0439 \u0437\u0430\u044F\u0432\u043A\u0438", headingType: "h5" }), _jsxs("div", { className: "flex flex-col gap-m max-w-lg", children: [_jsx(DraftActionButton, { title: "\u041F\u0440\u043E\u0434\u043E\u043B\u0436\u0438\u0442\u044C \u0437\u0430\u043F\u043E\u043B\u043D\u0435\u043D\u0438\u0435 \u0447\u0435\u0440\u043D\u043E\u0432\u0438\u043A\u0430", icon: "BankColorIcon", description: createdDate ? `Черновик от ${formatDate(new Date(createdDate))}` : '', onClick: handleGoToDraft, name: "go-to-draft-button" }), _jsx(DraftActionButton, { title: isFromLead ? 'Продолжить заполнение текущей заявки' : 'Создать новую заявку', icon: "NewLoanIcon", description: productData.description, onClick: isFromLead ? onClose : handleGoToNewTask, name: "go-to-current-task-button" })] })] }));
8
+ });
9
+ //# sourceMappingURL=DraftDialogContent.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DraftDialogContent.js","sourceRoot":"","sources":["../../../../src/retail/components/DraftDialog/DraftDialogContent.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAExC,OAAO,EAAE,OAAO,EAAE,MAAM,iCAAiC,CAAC;AAC1D,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AACvD,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAWxD,MAAM,CAAC,MAAM,kBAAkB,GAAG,GAAG,CAA0B,UAAU,EACvE,WAAW,EACX,WAAW,EACX,UAAU,EACV,eAAe,EACf,iBAAiB,EACjB,OAAO,GACR;IACC,OAAO,CACL,eAAK,SAAS,EAAC,gDAAgD,aAC7D,KAAC,OAAO,IACN,SAAS,EAAC,iCAAiC,EAC3C,KAAK,EAAC,qJAA6B,EACnC,WAAW,EAAC,IAAI,GAChB,EACF,eAAK,SAAS,EAAC,8BAA8B,aAC3C,KAAC,iBAAiB,IAChB,KAAK,EAAC,kLAAiC,EACvC,IAAI,EAAC,eAAe,EACpB,WAAW,EAAE,WAAW,CAAC,CAAC,CAAC,eAAe,UAAU,CAAC,IAAI,IAAI,CAAC,WAAW,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,EAClF,OAAO,EAAE,eAAe,EACxB,IAAI,EAAC,oBAAoB,GACzB,EACF,KAAC,iBAAiB,IAChB,KAAK,EAAE,UAAU,CAAC,CAAC,CAAC,sCAAsC,CAAC,CAAC,CAAC,sBAAsB,EACnF,IAAI,EAAC,aAAa,EAClB,WAAW,EAAE,WAAW,CAAC,WAAW,EACpC,OAAO,EAAE,UAAU,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,iBAAiB,EACjD,IAAI,EAAC,2BAA2B,GAChC,IACE,IACF,CACP,CAAC;AACJ,CAAC,CAAC,CAAC"}
@@ -1,3 +1,4 @@
1
+ import { type DraftTaskType } from '../../model/DraftTaskType';
1
2
  export declare const creditCodesToProgrammIdMap: {
2
3
  credit_cash: string;
3
4
  credit_cash_single_doc: string;
@@ -37,3 +38,4 @@ export declare const creditProgramCodeToProductIdMap: {
37
38
  summer_cash: string;
38
39
  summer_cash_pens: string;
39
40
  };
41
+ export declare const getCreditProgramTaskType: (creditProgramCode?: string, isDebit?: boolean) => DraftTaskType | undefined;
@@ -34,4 +34,19 @@ export const creditProgramCodeToProductIdMap = {
34
34
  ...cardCodesToProgrammIdMap,
35
35
  ...debitCardCodesToProgrammIdMap,
36
36
  };
37
+ export const getCreditProgramTaskType = (creditProgramCode, isDebit) => {
38
+ if (isDebit || (creditProgramCode && creditProgramCode in debitCardCodesToProgrammIdMap)) {
39
+ return 'debit';
40
+ }
41
+ if (!creditProgramCode) {
42
+ return undefined;
43
+ }
44
+ if (creditProgramCode in creditCodesToProgrammIdMap) {
45
+ return 'credit';
46
+ }
47
+ if (creditProgramCode in cardCodesToProgrammIdMap) {
48
+ return 'card';
49
+ }
50
+ return undefined;
51
+ };
37
52
  //# sourceMappingURL=creditProgramCodes.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"creditProgramCodes.js","sourceRoot":"","sources":["../../../../src/retail/components/DraftDialog/creditProgramCodes.ts"],"names":[],"mappings":"AAAA,8BAA8B;AAE9B,MAAM,CAAC,MAAM,0BAA0B,GAAG;IACxC,WAAW,EAAE,IAAI;IACjB,sBAAsB,EAAE,IAAI;IAC5B,UAAU,EAAE,IAAI;IAChB,mBAAmB,EAAE,IAAI;IACzB,eAAe,EAAE,IAAI;IACrB,cAAc,EAAE,IAAI;IACpB,UAAU,EAAE,IAAI;IAChB,qBAAqB,EAAE,IAAI;IAC3B,aAAa,EAAE,IAAI;IACnB,WAAW,EAAE,IAAI;IACjB,gBAAgB,EAAE,IAAI;CACvB,CAAC;AAEF,MAAM,6BAA6B,GAAG;IACpC,eAAe,EAAE,IAAI;IACrB,gBAAgB,EAAE,IAAI;IACtB,kBAAkB,EAAE,IAAI;IACxB,iBAAiB,EAAE,IAAI;IACvB,gBAAgB,EAAE,IAAI;IACtB,cAAc,EAAE,IAAI;IACpB,iBAAiB,EAAE,IAAI;IACvB,kBAAkB,EAAE,IAAI;IACxB,qBAAqB,EAAE,IAAI;IAC3B,0BAA0B,EAAE,IAAI;CACjC,CAAC;AAEF,MAAM,wBAAwB,GAAG;IAC/B,SAAS,EAAE,IAAI;IACf,UAAU,EAAE,IAAI;IAChB,WAAW,EAAE,IAAI;CAClB,CAAC;AAEF,MAAM,CAAC,MAAM,+BAA+B,GAAG;IAC7C,GAAG,0BAA0B;IAC7B,GAAG,wBAAwB;IAC3B,GAAG,6BAA6B;CACjC,CAAC"}
1
+ {"version":3,"file":"creditProgramCodes.js","sourceRoot":"","sources":["../../../../src/retail/components/DraftDialog/creditProgramCodes.ts"],"names":[],"mappings":"AAAA,8BAA8B;AAI9B,MAAM,CAAC,MAAM,0BAA0B,GAAG;IACxC,WAAW,EAAE,IAAI;IACjB,sBAAsB,EAAE,IAAI;IAC5B,UAAU,EAAE,IAAI;IAChB,mBAAmB,EAAE,IA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/lib/hooks';
3
3
  import { locationNavigator } from '../../../external/locationNavigator';
4
- import type { OnCloseProps } from '../../../model/OnCloseProps';
4
+ import { type OnCloseProps } from '../../../model/OnCloseProps';
5
5
  import { Dialog } from '../../../ui-kit/DialogManager/Dialog';
6
- import { Heading } from '../../../ui-kit/Heading/Heading';
7
- import { formatDate } from '../../../utils/formatDate';
8
6
  import { noop } from '../../../utils/noop';
9
7
  import { type Task } from '../../api/draftTasksKZO';
10
8
  import { sendMessage } from '../../api/sendMessage';
11
9
  import { useRetailFormStore } from '../../hooks/useRetailFormStore';
12
10
  import { type DraftTaskType } from '../../model/DraftTaskType';
13
11
  import { checkNewMicroservice } from '../../utils/checkNewMicroservice';
14
- import { creditProgramCodeToProductIdMap } from './creditProgramCodes';
15
- import { DraftActionButton } from './DraftActionButton';
12
+ import { creditProgramCodeToProductIdMap, getCreditProgramTaskType } from './creditProgramCodes';
13
+ import { DraftDialogContent } from './DraftDialogContent';
16
14
  import { parseDraftTask } from './parseDraftTask';
17
15
  import { getProductData } from './utils';
18
16
 
@@ -24,10 +22,6 @@ export interface DraftDialogProps extends OnCloseProps {
24
22
  sendAspects?: (userId: number, taskId: number) => void;
25
23
  }
26
24
 
27
- const getTaskTypeOrDebit = (taskType?: DraftTaskType, isDebit?: boolean) => {
28
- return taskType || (isDebit ? 'debit' : undefined);
29
- };
30
-
31
25
  export const DraftDialog = JSX<DraftDialogProps>(function ({
32
26
  task,
33
27
  taskType,
@@ -39,15 +33,13 @@ export const DraftDialog = JSX<DraftDialogProps>(function ({
39
33
  const retailFormStore = useRetailFormStore();
40
34
  const navigator = locationNavigator();
41
35
  const isNewMicroservice = checkNewMicroservice();
42
-
43
36
  const { participants, participant, creditProgram, createdDate = '', id: taskId } = task;
44
-
45
37
  const programmId: string = creditProgramCodeToProductIdMap[creditProgram.code];
46
- const productData = getProductData(getTaskTypeOrDebit(taskType, isDebit));
47
-
38
+ const productData = getProductData(
39
+ taskType ?? getCreditProgramTaskType(task.creditProgram.code, isDebit),
40
+ );
48
41
  const currentParticipant = participant || participants?.[0];
49
42
  const { id: participantId, profile } = currentParticipant || {};
50
-
51
43
  const handleGoToDraft = useCallback(() => {
52
44
  const taskFromDraft = parseDraftTask(task);
53
45
  retailFormStore.participantId = participantId ?? null;
@@ -56,13 +48,11 @@ export const DraftDialog = JSX<DraftDialogProps>(function ({
56
48
  retailFormStore.userId = profile?.id ?? null;
57
49
  retailFormStore.programId = programmId;
58
50
  retailFormStore.leadForm = taskFromDraft;
59
-
60
51
  if (profile?.id) {
61
52
  sendAspects(profile.id, taskId);
62
53
  }
63
54
  navigator.assign(productData.nextStepLink);
64
55
  }, []);
65
-
66
56
  const handleGoToNewTask = useCallback(async () => {
67
57
  if (isNewMicroservice) {
68
58
  try {
@@ -79,29 +69,14 @@ export const DraftDialog = JSX<DraftDialogProps>(function ({
79
69
 
80
70
  return (
81
71
  <Dialog onClose={onClose}>
82
- <div className="flex flex-col gap-lg items-center mt-xs mx-6xl">
83
- <Heading
84
- className="whitespace-pre-wrap text-center"
85
- title="Нашли черновик вашей заявки"
86
- headingType="h5"
87
- />
88
- <div className="flex flex-col gap-m max-w-lg">
89
- <DraftActionButton
90
- title="Продолжить заполнение черновика"
91
- icon="BankColorIcon"
92
- description={createdDate ? `Черновик от ${formatDate(new Date(createdDate))}` : ''}
93
- onClick={handleGoToDraft}
94
- name="go-to-draft-button"
95
- />
96
- <DraftActionButton
97
- title={isFromLead ? 'Продолжить заполнение текущей заявки' : 'Создать новую заявку'}
98
- icon="NewLoanIcon"
99
- description={productData.description}
100
- onClick={isFromLead ? onClose : handleGoToNewTask}
101
- name="go-to-current-task-button"
102
- />
103
- </div>
104
- </div>
72
+ <DraftDialogContent
73
+ createdDate={createdDate}
74
+ productData={productData}
75
+ isFromLead={isFromLead}
76
+ handleGoToDraft={handleGoToDraft}
77
+ handleGoToNewTask={handleGoToNewTask}
78
+ onClose={onClose}
79
+ />
105
80
  </Dialog>
106
81
  );
107
82
  });
@@ -0,0 +1,49 @@
1
+ import { JSX } from '@redneckz/uni-jsx';
2
+ import { type OnCloseProps } from '../../../model/OnCloseProps';
3
+ import { Heading } from '../../../ui-kit/Heading/Heading';
4
+ import { formatDate } from '../../../utils/formatDate';
5
+ import { DraftActionButton } from './DraftActionButton';
6
+ import { type getProductData } from './utils';
7
+
8
+ export interface DraftDialogContentProps extends OnCloseProps {
9
+ createdDate: string;
10
+ productData: ReturnType<typeof getProductData>;
11
+ isFromLead: boolean;
12
+ handleGoToDraft: () => void;
13
+ handleGoToNewTask: () => void;
14
+ }
15
+
16
+ export const DraftDialogContent = JSX<DraftDialogContentProps>(function ({
17
+ createdDate,
18
+ productData,
19
+ isFromLead,
20
+ handleGoToDraft,
21
+ handleGoToNewTask,
22
+ onClose,
23
+ }) {
24
+ return (
25
+ <div className="flex flex-col gap-lg items-center mt-xs mx-6xl">
26
+ <Heading
27
+ className="whitespace-pre-wrap text-center"
28
+ title="Нашли черновик вашей заявки"
29
+ headingType="h5"
30
+ />
31
+ <div className="flex flex-col gap-m max-w-lg">
32
+ <DraftActionButton
33
+ title="Продолжить заполнение черновика"
34
+ icon="BankColorIcon"
35
+ description={createdDate ? `Черновик от ${formatDate(new Date(createdDate))}` : ''}
36
+ onClick={handleGoToDraft}
37
+ name="go-to-draft-button"
38
+ />
39
+ <DraftActionButton
40
+ title={isFromLead ? 'Продолжить заполнение текущей заявки' : 'Создать новую заявку'}
41
+ icon="NewLoanIcon"
42
+ description={productData.description}
43
+ onClick={isFromLead ? onClose : handleGoToNewTask}
44
+ name="go-to-current-task-button"
45
+ />
46
+ </div>
47
+ </div>
48
+ );
49
+ });
@@ -1,5 +1,7 @@
1
1
  /* eslint-disable camelcase */
2
2
 
3
+ import { type DraftTaskType } from '../../model/DraftTaskType';
4
+
3
5
  export const creditCodesToProgrammIdMap = {
4
6
  credit_cash: '10',
5
7
  credit_cash_single_doc: '28',
@@ -38,3 +40,25 @@ export const creditProgramCodeToProductIdMap = {
38
40
  ...cardCodesToProgrammIdMap,
39
41
  ...debitCardCodesToProgrammIdMap,
40
42
  };
43
+
44
+ export const getCreditProgramTaskType = (
45
+ creditProgramCode?: string,
46
+ isDebit?: boolean,
47
+ ): DraftTaskType | undefined => {
48
+ if (isDebit || (creditProgramCode && creditProgramCode in debitCardCodesToProgrammIdMap)) {
49
+ return 'debit';
50
+ }
51
+
52
+ if (!creditProgramCode) {
53
+ return undefined;
54
+ }
55
+
56
+ if (creditProgramCode in creditCodesToProgrammIdMap) {
57
+ return 'credit';
58
+ }
59
+ if (creditProgramCode in cardCodesToProgrammIdMap) {
60
+ return 'card';
61
+ }
62
+
63
+ return undefined;
64
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@redneckz/wildless-cms-uni-blocks",
3
- "version": "0.14.1042",
3
+ "version": "0.14.1043",
4
4
  "private": false,
5
5
  "license": "MIT",
6
6
  "author": "ЦК",
@@ -1,18 +1,16 @@
1
1
  import { JSX } from '@redneckz/uni-jsx';
2
2
  import { useCallback } from '@redneckz/uni-jsx/lib/hooks';
3
3
  import { locationNavigator } from '../../../external/locationNavigator';
4
- import type { OnCloseProps } from '../../../model/OnCloseProps';
4
+ import { type OnCloseProps } from '../../../model/OnCloseProps';
5
5
  import { Dialog } from '../../../ui-kit/DialogManager/Dialog';
6
- import { Heading } from '../../../ui-kit/Heading/Heading';
7
- import { formatDate } from '../../../utils/formatDate';
8
6
  import { noop } from '../../../utils/noop';
9
7
  import { type Task } from '../../api/draftTasksKZO';
10
8
  import { sendMessage } from '../../api/sendMessage';
11
9
  import { useRetailFormStore } from '../../hooks/useRetailFormStore';
12
10
  import { type DraftTaskType } from '../../model/DraftTaskType';
13
11
  import { checkNewMicroservice } from '../../utils/checkNewMicroservice';
14
- import { creditProgramCodeToProductIdMap } from './creditProgramCodes';
15
- import { DraftActionButton } from './DraftActionButton';
12
+ import { creditProgramCodeToProductIdMap, getCreditProgramTaskType } from './creditProgramCodes';
13
+ import { DraftDialogContent } from './DraftDialogContent';
16
14
  import { parseDraftTask } from './parseDraftTask';
17
15
  import { getProductData } from './utils';
18
16
 
@@ -24,10 +22,6 @@ export interface DraftDialogProps extends OnCloseProps {
24
22
  sendAspects?: (userId: number, taskId: number) => void;
25
23
  }
26
24
 
27
- const getTaskTypeOrDebit = (taskType?: DraftTaskType, isDebit?: boolean) => {
28
- return taskType || (isDebit ? 'debit' : undefined);
29
- };
30
-
31
25
  export const DraftDialog = JSX<DraftDialogProps>(function ({
32
26
  task,
33
27
  taskType,
@@ -39,15 +33,13 @@ export const DraftDialog = JSX<DraftDialogProps>(function ({
39
33
  const retailFormStore = useRetailFormStore();
40
34
  const navigator = locationNavigator();
41
35
  const isNewMicroservice = checkNewMicroservice();
42
-
43
36
  const { participants, participant, creditProgram, createdDate = '', id: taskId } = task;
44
-
45
37
  const programmId: string = creditProgramCodeToProductIdMap[creditProgram.code];
46
- const productData = getProductData(getTaskTypeOrDebit(taskType, isDebit));
47
-
38
+ const productData = getProductData(
39
+ taskType ?? getCreditProgramTaskType(task.creditProgram.code, isDebit),
40
+ );
48
41
  const currentParticipant = participant || participants?.[0];
49
42
  const { id: participantId, profile } = currentParticipant || {};
50
-
51
43
  const handleGoToDraft = useCallback(() => {
52
44
  const taskFromDraft = parseDraftTask(task);
53
45
  retailFormStore.participantId = participantId ?? null;
@@ -56,13 +48,11 @@ export const DraftDialog = JSX<DraftDialogProps>(function ({
56
48
  retailFormStore.userId = profile?.id ?? null;
57
49
  retailFormStore.programId = programmId;
58
50
  retailFormStore.leadForm = taskFromDraft;
59
-
60
51
  if (profile?.id) {
61
52
  sendAspects(profile.id, taskId);
62
53
  }
63
54
  navigator.assign(productData.nextStepLink);
64
55
  }, []);
65
-
66
56
  const handleGoToNewTask = useCallback(async () => {
67
57
  if (isNewMicroservice) {
68
58
  try {
@@ -79,29 +69,14 @@ export const DraftDialog = JSX<DraftDialogProps>(function ({
79
69
 
80
70
  return (
81
71
  <Dialog onClose={onClose}>
82
- <div className="flex flex-col gap-lg items-center mt-xs mx-6xl">
83
- <Heading
84
- className="whitespace-pre-wrap text-center"
85
- title="Нашли черновик вашей заявки"
86
- headingType="h5"
87
- />
88
- <div className="flex flex-col gap-m max-w-lg">
89
- <DraftActionButton
90
- title="Продолжить заполнение черновика"
91
- icon="BankColorIcon"
92
- description={createdDate ? `Черновик от ${formatDate(new Date(createdDate))}` : ''}
93
- onClick={handleGoToDraft}
94
- name="go-to-draft-button"
95
- />
96
- <DraftActionButton
97
- title={isFromLead ? 'Продолжить заполнение текущей заявки' : 'Создать новую заявку'}
98
- icon="NewLoanIcon"
99
- description={productData.description}
100
- onClick={isFromLead ? onClose : handleGoToNewTask}
101
- name="go-to-current-task-button"
102
- />
103
- </div>
104
- </div>
72
+ <DraftDialogContent
73
+ createdDate={createdDate}
74
+ productData={productData}
75
+ isFromLead={isFromLead}
76
+ handleGoToDraft={handleGoToDraft}
77
+ handleGoToNewTask={handleGoToNewTask}
78
+ onClose={onClose}
79
+ />
105
80
  </Dialog>
106
81
  );
107
82
  });