@bigbinary/neeto-payments-frontend 3.3.40 → 3.3.42

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 (79) hide show
  1. package/README.md +3 -3
  2. package/app/javascript/src/translations/en.json +2 -1
  3. package/dist/AccountsDashboard.js +3 -3
  4. package/dist/AdminCancelRecurringPaymentButton.js +1 -1
  5. package/dist/CashPaymentButton.js +2 -2
  6. package/dist/ConfirmCashPaymentButton.js +2 -2
  7. package/dist/ConfirmUpiPaymentButton.js +2 -2
  8. package/dist/CustomerCancelRecurringPaymentForm.js +1 -1
  9. package/dist/{ExportModal-DHkDL8S0.js → ExportModal-DT0vcTac.js} +2 -2
  10. package/dist/{ExportModal-DHkDL8S0.js.map → ExportModal-DT0vcTac.js.map} +1 -1
  11. package/dist/ManualUpiPaymentConfirmButton.js +1 -1
  12. package/dist/PaymentsDashboard.js +2 -2
  13. package/dist/PayoutsDashboard.js +4 -4
  14. package/dist/PayoutsPage.js +3 -3
  15. package/dist/RazorpayPaymentButton.js +2 -2
  16. package/dist/RecurringPaymentSettings.js +1 -1
  17. package/dist/RefundsDashboard.js +2 -2
  18. package/dist/SplitTransfersDashboard.js +2 -2
  19. package/dist/TaxesDashboard.js +1 -1
  20. package/dist/UpiPayment.js +7 -3
  21. package/dist/UpiPayment.js.map +1 -1
  22. package/dist/buildStripeTransactionLink.js +1 -1
  23. package/dist/cjs/AccountsDashboard.js +3 -3
  24. package/dist/cjs/AdminCancelRecurringPaymentButton.js +1 -1
  25. package/dist/cjs/CashPaymentButton.js +2 -2
  26. package/dist/cjs/ConfirmCashPaymentButton.js +2 -2
  27. package/dist/cjs/ConfirmUpiPaymentButton.js +2 -2
  28. package/dist/cjs/CustomerCancelRecurringPaymentForm.js +1 -1
  29. package/dist/cjs/{ExportModal-BG48z32O.js → ExportModal-DHYiDlh7.js} +2 -2
  30. package/dist/cjs/{ExportModal-BG48z32O.js.map → ExportModal-DHYiDlh7.js.map} +1 -1
  31. package/dist/cjs/ManualUpiPaymentConfirmButton.js +1 -1
  32. package/dist/cjs/PaymentsDashboard.js +2 -2
  33. package/dist/cjs/PayoutsDashboard.js +4 -4
  34. package/dist/cjs/PayoutsPage.js +3 -3
  35. package/dist/cjs/RazorpayPaymentButton.js +2 -2
  36. package/dist/cjs/RecurringPaymentSettings.js +1 -1
  37. package/dist/cjs/RefundsDashboard.js +2 -2
  38. package/dist/cjs/SplitTransfersDashboard.js +2 -2
  39. package/dist/cjs/TaxesDashboard.js +1 -1
  40. package/dist/cjs/UpiPayment.js +7 -3
  41. package/dist/cjs/UpiPayment.js.map +1 -1
  42. package/dist/cjs/buildStripeTransactionLink.js +1 -1
  43. package/dist/cjs/constants.js +1 -1
  44. package/dist/cjs/{dashboard-CJ_m2Dt3.js → dashboard-Xb5zQInQ.js} +2 -2
  45. package/dist/cjs/{dashboard-CJ_m2Dt3.js.map → dashboard-Xb5zQInQ.js.map} +1 -1
  46. package/dist/cjs/getAmountInSmallestCurrencyUnit.js +1 -1
  47. package/dist/cjs/{index-CtTWebii.js → index-BXQqCPIU.js} +8 -3
  48. package/dist/cjs/{index-CtTWebii.js.map → index-BXQqCPIU.js.map} +1 -1
  49. package/dist/cjs/index.js +8 -8
  50. package/dist/cjs/{renderFunctions-BkrGVpSO.js → renderFunctions-ChnAUwcP.js} +2 -2
  51. package/dist/cjs/{renderFunctions-BkrGVpSO.js.map → renderFunctions-ChnAUwcP.js.map} +1 -1
  52. package/dist/cjs/{usePaymentApi-CEbTENBB.js → usePaymentApi-DTeHYEjG.js} +2 -2
  53. package/dist/cjs/{usePaymentApi-CEbTENBB.js.map → usePaymentApi-DTeHYEjG.js.map} +1 -1
  54. package/dist/cjs/{usePaymentApi-DI7XEOax.js → usePaymentApi-IBjhCSrY.js} +2 -2
  55. package/dist/cjs/{usePaymentApi-DI7XEOax.js.map → usePaymentApi-IBjhCSrY.js.map} +1 -1
  56. package/dist/cjs/{usePaymentsApi-6pF1wGMT.js → usePaymentsApi-CW2I4NuQ.js} +2 -2
  57. package/dist/cjs/{usePaymentsApi-6pF1wGMT.js.map → usePaymentsApi-CW2I4NuQ.js.map} +1 -1
  58. package/dist/cjs/{usePlatformApi-BWxqAH1A.js → usePlatformApi-CNcOdGla.js} +2 -2
  59. package/dist/cjs/{usePlatformApi-BWxqAH1A.js.map → usePlatformApi-CNcOdGla.js.map} +1 -1
  60. package/dist/cjs/useRazorpayPayment.js +2 -2
  61. package/dist/constants.js +1 -1
  62. package/dist/{dashboard-D_x2CFTM.js → dashboard-H1FaB24l.js} +2 -2
  63. package/dist/{dashboard-D_x2CFTM.js.map → dashboard-H1FaB24l.js.map} +1 -1
  64. package/dist/getAmountInSmallestCurrencyUnit.js +1 -1
  65. package/dist/{index-D0hxo4Ei.js → index-DxhI_gau.js} +8 -3
  66. package/dist/{index-D0hxo4Ei.js.map → index-DxhI_gau.js.map} +1 -1
  67. package/dist/index.js +8 -8
  68. package/dist/{renderFunctions-d_DYxlmU.js → renderFunctions-DtoDuKzR.js} +2 -2
  69. package/dist/{renderFunctions-d_DYxlmU.js.map → renderFunctions-DtoDuKzR.js.map} +1 -1
  70. package/dist/{usePaymentApi-Dp2t_boj.js → usePaymentApi-D7fqImzK.js} +2 -2
  71. package/dist/{usePaymentApi-Dp2t_boj.js.map → usePaymentApi-D7fqImzK.js.map} +1 -1
  72. package/dist/{usePaymentApi-CRvon9jb.js → usePaymentApi-Dy3Swac-.js} +2 -2
  73. package/dist/{usePaymentApi-CRvon9jb.js.map → usePaymentApi-Dy3Swac-.js.map} +1 -1
  74. package/dist/{usePaymentsApi-BnNW64vz.js → usePaymentsApi-BwF1E4GX.js} +2 -2
  75. package/dist/{usePaymentsApi-BnNW64vz.js.map → usePaymentsApi-BwF1E4GX.js.map} +1 -1
  76. package/dist/{usePlatformApi-BBVtu75Q.js → usePlatformApi-IdRP9TJl.js} +2 -2
  77. package/dist/{usePlatformApi-BBVtu75Q.js.map → usePlatformApi-IdRP9TJl.js.map} +1 -1
  78. package/dist/useRazorpayPayment.js +2 -2
  79. package/package.json +5 -5
package/README.md CHANGED
@@ -594,13 +594,13 @@ Import components into your React application as needed.
594
594
 
595
595
  ### 6. utils
596
596
 
597
- 1. `getFormattedAmount(taxes, amount, isTaxEnabled = false)`
597
+ 1. `getFormattedAmount({ amount, taxes=[], isTaxEnabled = false})`
598
598
 
599
599
  Returns the final amount as a **string**, truncated to **2 decimal places**, after applying taxes if `isTaxEnabled` is set to `true` and taxes are present.
600
600
 
601
- #### Parameters:
602
- - `taxes`: List of tax objects with `value` and `kind` (`"percentage"` or `"fixed"`).
601
+ #### Parameter keys
603
602
  - `amount`: The base amount to which taxes may be applied.
603
+ - `taxes`: List of tax objects with `value` and `kind` (`"percentage"` or `"fixed"`). Defaults is `[]`
604
604
  - `isTaxEnabled` : Whether taxes should be applied. Defaults to `false`.
605
605
 
606
606
  #### Returns:
@@ -392,7 +392,8 @@
392
392
  "invalidUrl": "Enter a valid URL",
393
393
  "nameRequired": "Name is required",
394
394
  "kindRequired": "Kind is required",
395
- "valueRequired": "Value is required"
395
+ "valueRequired": "Value is required",
396
+ "invalidField": "{{entity, anyCase}} is invalid"
396
397
  },
397
398
  "razorpay": {
398
399
  "loadError": "Failed to load Razorpay!!"
@@ -9,20 +9,20 @@ import SubHeader from '@bigbinary/neeto-molecules/SubHeader';
9
9
  import Tab from '@bigbinary/neetoui/Tab';
10
10
  import Typography from '@bigbinary/neetoui/Typography';
11
11
  import { useTranslation } from 'react-i18next';
12
- import { u as useExportData, b as buildDefaultPageProperties, a as buildPayload, c as buildRowData, w as withReactQuery } from './dashboard-D_x2CFTM.js';
12
+ import { u as useExportData, b as buildDefaultPageProperties, a as buildPayload, c as buildRowData, w as withReactQuery } from './dashboard-H1FaB24l.js';
13
13
  import _defineProperty from '@babel/runtime/helpers/defineProperty';
14
14
  import Download from '@bigbinary/neeto-icons/Download';
15
15
  import Button from '@bigbinary/neetoui/Button';
16
16
  import Modal from '@bigbinary/neetoui/Modal';
17
17
  import { e as exportChannel } from './exportChannel-CViICC6x.js';
18
- import { u as uuidV4, e as buildStripeAccountLink, D as DEFAULT_SORT_PROPERTIES, B as BASE_URL, S as SORT_DIRECTIONS } from './index-D0hxo4Ei.js';
18
+ import { u as uuidV4, e as buildStripeAccountLink, D as DEFAULT_SORT_PROPERTIES, B as BASE_URL, S as SORT_DIRECTIONS } from './index-DxhI_gau.js';
19
19
  import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
20
20
  import _toConsumableArray from '@babel/runtime/helpers/toConsumableArray';
21
21
  import { getQueryParams, buildUrl } from '@bigbinary/neeto-commons-frontend/utils';
22
22
  import { buildFiltersFromURL } from '@bigbinary/neeto-filters-frontend/utils';
23
23
  import { pipe, split, map, join, mergeLeft, assoc } from 'ramda';
24
24
  import { useHistory } from 'react-router-dom';
25
- import { r as renderStatus, a as renderFullName, b as renderDate } from './renderFunctions-d_DYxlmU.js';
25
+ import { r as renderStatus, a as renderFullName, b as renderDate } from './renderFunctions-DtoDuKzR.js';
26
26
  import { C as CopyButtonWrapper } from './CopyButtonWrapper-SoJkwX-d.js';
27
27
  import { DEFAULT_PAGE_SIZE, DEFAULT_PAGE_INDEX } from '@bigbinary/neeto-commons-frontend/constants';
28
28
  import { useHiddenColumns } from '@bigbinary/neeto-molecules/Columns';
@@ -6,7 +6,7 @@ import { useTranslation } from 'react-i18next';
6
6
  import _toConsumableArray from '@babel/runtime/helpers/toConsumableArray';
7
7
  import { useMutationWithInvalidation } from '@bigbinary/neeto-commons-frontend/react-utils';
8
8
  import axios from 'axios';
9
- import { B as BASE_URL } from './index-D0hxo4Ei.js';
9
+ import { B as BASE_URL } from './index-DxhI_gau.js';
10
10
  import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
11
11
  import 'i18next';
12
12
  import '@bigbinary/neeto-commons-frontend/constants';
@@ -1,12 +1,12 @@
1
1
  import { noop } from '@bigbinary/neeto-cist';
2
2
  import Button from '@bigbinary/neetoui/Button';
3
3
  import { useTranslation } from 'react-i18next';
4
- import { u as useCreateCashPayment } from './usePaymentApi-Dp2t_boj.js';
4
+ import { u as useCreateCashPayment } from './usePaymentApi-D7fqImzK.js';
5
5
  import { jsx } from 'react/jsx-runtime';
6
6
  import '@babel/runtime/helpers/defineProperty';
7
7
  import '@tanstack/react-query';
8
8
  import 'axios';
9
- import './index-D0hxo4Ei.js';
9
+ import './index-DxhI_gau.js';
10
10
  import 'i18next';
11
11
  import '@bigbinary/neeto-commons-frontend/constants';
12
12
  import 'decimal.js';
@@ -8,12 +8,12 @@ import Form from '@bigbinary/neetoui/formik/Form';
8
8
  import Textarea from '@bigbinary/neetoui/formik/Textarea';
9
9
  import ActionBlock from '@bigbinary/neetoui/formik/ActionBlock';
10
10
  import { useTranslation } from 'react-i18next';
11
- import { a as useUpdateCashPayment } from './usePaymentApi-Dp2t_boj.js';
11
+ import { a as useUpdateCashPayment } from './usePaymentApi-D7fqImzK.js';
12
12
  import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
13
13
  import '@babel/runtime/helpers/defineProperty';
14
14
  import '@tanstack/react-query';
15
15
  import 'axios';
16
- import './index-D0hxo4Ei.js';
16
+ import './index-DxhI_gau.js';
17
17
  import 'i18next';
18
18
  import '@bigbinary/neeto-commons-frontend/constants';
19
19
  import 'decimal.js';
@@ -10,14 +10,14 @@ import Select from '@bigbinary/neetoui/formik/Select';
10
10
  import ActionBlock from '@bigbinary/neetoui/formik/ActionBlock';
11
11
  import { mergeLeft } from 'ramda';
12
12
  import { useTranslation } from 'react-i18next';
13
- import { u as useUpdateUpiPayment } from './usePaymentsApi-BnNW64vz.js';
13
+ import { u as useUpdateUpiPayment } from './usePaymentsApi-BwF1E4GX.js';
14
14
  import { t } from 'i18next';
15
15
  import * as yup from 'yup';
16
16
  import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
17
17
  import '@babel/runtime/helpers/defineProperty';
18
18
  import '@tanstack/react-query';
19
19
  import 'axios';
20
- import './index-D0hxo4Ei.js';
20
+ import './index-DxhI_gau.js';
21
21
  import '@bigbinary/neeto-commons-frontend/constants';
22
22
  import 'decimal.js';
23
23
  import '@bigbinary/neeto-commons-frontend/utils';
@@ -6,7 +6,7 @@ import Button from '@bigbinary/neetoui/formik/Button';
6
6
  import { useTranslation } from 'react-i18next';
7
7
  import { useMutationWithInvalidation } from '@bigbinary/neeto-commons-frontend/react-utils';
8
8
  import axios from 'axios';
9
- import { B as BASE_URL } from './index-D0hxo4Ei.js';
9
+ import { B as BASE_URL } from './index-DxhI_gau.js';
10
10
  import { useQuery } from '@tanstack/react-query';
11
11
  import { isNotNil } from 'ramda';
12
12
  import { Q as QUERY_KEYS } from './queryConstants-mgjK5Hgk.js';
@@ -10,7 +10,7 @@ import { mergeLeft } from 'ramda';
10
10
  import { useTranslation } from 'react-i18next';
11
11
  import { useMutation } from '@tanstack/react-query';
12
12
  import axios from 'axios';
13
- import { B as BASE_URL, u as uuidV4 } from './index-D0hxo4Ei.js';
13
+ import { B as BASE_URL, u as uuidV4 } from './index-DxhI_gau.js';
14
14
  import { e as exportChannel } from './exportChannel-CViICC6x.js';
15
15
  import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
16
16
 
@@ -128,4 +128,4 @@ var ExportModal = function ExportModal(_ref) {
128
128
  };
129
129
 
130
130
  export { ExportModal as E };
131
- //# sourceMappingURL=ExportModal-DHkDL8S0.js.map
131
+ //# sourceMappingURL=ExportModal-DT0vcTac.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ExportModal-DHkDL8S0.js","sources":["../app/javascript/src/apis/exports.js","../app/javascript/src/hooks/reactQuery/useExportsApi.js","../app/javascript/src/components/Common/ExportModal.jsx"],"sourcesContent":["import axios from \"axios\";\n\nimport { BASE_URL } from \"src/constants\";\n\nconst create = payload =>\n axios.post(\n `${BASE_URL}/api/v1/exports`,\n { export: payload },\n { showToastr: false }\n );\n\nconst exportsApi = { create };\n\nexport default exportsApi;\n","import { useMutation } from \"@tanstack/react-query\";\n\nimport exportsApi from \"apis/exports\";\n\nexport const useExportsData = () =>\n useMutation({ mutationFn: exportsApi.create });\n","import { useEffect, useMemo, useState } from \"react\";\n\nimport { isPresent, camelToSnakeCase } from \"neetocist\";\nimport { getQueryParams } from \"neetocommons/utils\";\nimport { Download } from \"neetoicons\";\nimport { Button, Modal, Typography } from \"neetoui\";\nimport { mergeLeft } from \"ramda\";\nimport { useTranslation } from \"react-i18next\";\n\nimport { useExportsData } from \"hooks/reactQuery/useExportsApi\";\nimport exportChannel from \"src/channels/exportChannel\";\nimport { uuidV4 } from \"utils\";\n\nconst ExportModal = ({\n filters,\n dashboardKind,\n holdableIds,\n sortProperties,\n isExportModalOpen,\n setIsExportModalOpen,\n}) => {\n const { t } = useTranslation();\n const [downloadUrl, setDownloadUrl] = useState(\"\");\n const [isGenerating, setIsGenerating] = useState(false);\n\n const { tab = \"all\" } = getQueryParams();\n\n const { mutate: exportsData } = useExportsData();\n\n const token = useMemo(\n () => `${dashboardKind}-report-${uuidV4()}`,\n [dashboardKind]\n );\n\n const receivedCallback = data => {\n if (!data.download_url) return;\n setDownloadUrl(data.download_url);\n setIsGenerating(false);\n };\n\n useEffect(() => {\n if (isExportModalOpen) {\n const channel = exportChannel(token, receivedCallback);\n setDownloadUrl(\"\");\n setIsGenerating(false);\n\n return () => {\n channel.disconnected();\n };\n }\n\n return undefined;\n }, [isExportModalOpen, token]);\n\n const onClose = () => setIsExportModalOpen(false);\n\n const handleExport = () => {\n setDownloadUrl(\"\");\n setIsGenerating(true);\n const payload = mergeLeft(sortProperties, {\n token,\n filters,\n tab,\n holdableIds,\n dashboard: camelToSnakeCase(dashboardKind),\n });\n\n exportsData(payload);\n };\n\n return (\n <Modal {...{ onClose }} isOpen={isExportModalOpen}>\n <Modal.Header>\n <Typography style=\"h2\">\n {t(`neetoPayments.export.title.${dashboardKind}`)}\n </Typography>\n </Modal.Header>\n <Modal.Body>\n {isGenerating ? (\n <Typography style=\"body2\">\n {t(\"neetoPayments.export.pleaseWait\")}\n </Typography>\n ) : (\n <Typography style=\"body2\">\n {isPresent(downloadUrl)\n ? t(\"neetoPayments.export.fileReady\")\n : t(`neetoPayments.export.download.${dashboardKind}`)}\n </Typography>\n )}\n </Modal.Body>\n <Modal.Footer className=\"space-x-2\">\n {isPresent(downloadUrl) ? (\n <Button\n href={downloadUrl}\n icon={Download}\n label={t(\"neetoPayments.common.download\")}\n onClick={onClose}\n />\n ) : (\n <>\n <Button\n disabled={isGenerating}\n label={t(\"neetoPayments.common.cancel\")}\n style=\"tertiary\"\n onClick={onClose}\n />\n <Button\n disabled={isGenerating}\n label={t(\"neetoPayments.common.export\")}\n loading={isGenerating}\n onClick={handleExport}\n />\n </>\n )}\n </Modal.Footer>\n </Modal>\n );\n};\n\nexport default ExportModal;\n"],"names":["create","payload","axios","post","concat","BASE_URL","showToastr","exportsApi","useExportsData","useMutation","mutationFn","ExportModal","_ref","filters","dashboardKind","holdableIds","sortProperties","isExportModalOpen","setIsExportModalOpen","_useTranslation","useTranslation","t","_useState","useState","_useState2","_slicedToArray","downloadUrl","setDownloadUrl","_useState3","_useState4","isGenerating","setIsGenerating","_getQueryParams","getQueryParams","_getQueryParams$tab","tab","_useExportsData","exportsData","mutate","token","useMemo","uuidV4","receivedCallback","data","download_url","useEffect","channel","exportChannel","disconnected","undefined","onClose","handleExport","mergeLeft","dashboard","camelToSnakeCase","_jsxs","Modal","isOpen","children","_jsx","Header","Typography","style","Body","isPresent","Footer","className","Button","href","icon","Download","label","onClick","_Fragment","disabled","loading"],"mappings":";;;;;;;;;;;;;;;;AAIA,IAAMA,MAAM,GAAG,SAATA,MAAMA,CAAGC,OAAO,EAAA;AAAA,EAAA,OACpBC,KAAK,CAACC,IAAI,IAAAC,MAAA,CACLC,QAAQ,EACX,iBAAA,CAAA,EAAA;IAAE,QAAQJ,EAAAA;AAAQ,GAAC,EACnB;AAAEK,IAAAA,UAAU,EAAE;AAAM,GACtB,CAAC;AAAA,CAAA;AAEH,IAAMC,UAAU,GAAG;AAAEP,EAA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CAAAkB,QAAA,EAAA;QAAAf,QAAA,EAAA,cACEC,GAAA,CAACQ,MAAM,EAAA;AACLO,UAAAA,QAAQ,EAAE5C,YAAa;AACvByC,UAAAA,KAAK,EAAElD,CAAC,CAAC,6BAA6B,CAAE;AACxCyC,UAAAA,KAAK,EAAC,UAAU;AAChBU,UAAAA,OAAO,EAAEtB;AAAQ,SAClB,CAAC,eACFS,GAAA,CAACQ,MAAM,EAAA;AACLO,UAAAA,QAAQ,EAAE5C,YAAa;AACvByC,UAAAA,KAAK,EAAElD,CAAC,CAAC,6BAA6B,CAAE;AACxCsD,UAAAA,OAAO,EAAE7C,YAAa;AACtB0C,UAAAA,OAAO,EAAErB;AAAa,SACvB,CAAC;OACF;AACH,KACW,CAAC;AAAA,GACV,CAAC;AAEZ;;;;"}
1
+ {"version":3,"file":"ExportModal-DT0vcTac.js","sources":["../app/javascript/src/apis/exports.js","../app/javascript/src/hooks/reactQuery/useExportsApi.js","../app/javascript/src/components/Common/ExportModal.jsx"],"sourcesContent":["import axios from \"axios\";\n\nimport { BASE_URL } from \"src/constants\";\n\nconst create = payload =>\n axios.post(\n `${BASE_URL}/api/v1/exports`,\n { export: payload },\n { showToastr: false }\n );\n\nconst exportsApi = { create };\n\nexport default exportsApi;\n","import { useMutation } from \"@tanstack/react-query\";\n\nimport exportsApi from \"apis/exports\";\n\nexport const useExportsData = () =>\n useMutation({ mutationFn: exportsApi.create });\n","import { useEffect, useMemo, useState } from \"react\";\n\nimport { isPresent, camelToSnakeCase } from \"neetocist\";\nimport { getQueryParams } from \"neetocommons/utils\";\nimport { Download } from \"neetoicons\";\nimport { Button, Modal, Typography } from \"neetoui\";\nimport { mergeLeft } from \"ramda\";\nimport { useTranslation } from \"react-i18next\";\n\nimport { useExportsData } from \"hooks/reactQuery/useExportsApi\";\nimport exportChannel from \"src/channels/exportChannel\";\nimport { uuidV4 } from \"utils\";\n\nconst ExportModal = ({\n filters,\n dashboardKind,\n holdableIds,\n sortProperties,\n isExportModalOpen,\n setIsExportModalOpen,\n}) => {\n const { t } = useTranslation();\n const [downloadUrl, setDownloadUrl] = useState(\"\");\n const [isGenerating, setIsGenerating] = useState(false);\n\n const { tab = \"all\" } = getQueryParams();\n\n const { mutate: exportsData } = useExportsData();\n\n const token = useMemo(\n () => `${dashboardKind}-report-${uuidV4()}`,\n [dashboardKind]\n );\n\n const receivedCallback = data => {\n if (!data.download_url) return;\n setDownloadUrl(data.download_url);\n setIsGenerating(false);\n };\n\n useEffect(() => {\n if (isExportModalOpen) {\n const channel = exportChannel(token, receivedCallback);\n setDownloadUrl(\"\");\n setIsGenerating(false);\n\n return () => {\n channel.disconnected();\n };\n }\n\n return undefined;\n }, [isExportModalOpen, token]);\n\n const onClose = () => setIsExportModalOpen(false);\n\n const handleExport = () => {\n setDownloadUrl(\"\");\n setIsGenerating(true);\n const payload = mergeLeft(sortProperties, {\n token,\n filters,\n tab,\n holdableIds,\n dashboard: camelToSnakeCase(dashboardKind),\n });\n\n exportsData(payload);\n };\n\n return (\n <Modal {...{ onClose }} isOpen={isExportModalOpen}>\n <Modal.Header>\n <Typography style=\"h2\">\n {t(`neetoPayments.export.title.${dashboardKind}`)}\n </Typography>\n </Modal.Header>\n <Modal.Body>\n {isGenerating ? (\n <Typography style=\"body2\">\n {t(\"neetoPayments.export.pleaseWait\")}\n </Typography>\n ) : (\n <Typography style=\"body2\">\n {isPresent(downloadUrl)\n ? t(\"neetoPayments.export.fileReady\")\n : t(`neetoPayments.export.download.${dashboardKind}`)}\n </Typography>\n )}\n </Modal.Body>\n <Modal.Footer className=\"space-x-2\">\n {isPresent(downloadUrl) ? (\n <Button\n href={downloadUrl}\n icon={Download}\n label={t(\"neetoPayments.common.download\")}\n onClick={onClose}\n />\n ) : (\n <>\n <Button\n disabled={isGenerating}\n label={t(\"neetoPayments.common.cancel\")}\n style=\"tertiary\"\n onClick={onClose}\n />\n <Button\n disabled={isGenerating}\n label={t(\"neetoPayments.common.export\")}\n loading={isGenerating}\n onClick={handleExport}\n />\n </>\n )}\n </Modal.Footer>\n </Modal>\n );\n};\n\nexport default ExportModal;\n"],"names":["create","payload","axios","post","concat","BASE_URL","showToastr","exportsApi","useExportsData","useMutation","mutationFn","ExportModal","_ref","filters","dashboardKind","holdableIds","sortProperties","isExportModalOpen","setIsExportModalOpen","_useTranslation","useTranslation","t","_useState","useState","_useState2","_slicedToArray","downloadUrl","setDownloadUrl","_useState3","_useState4","isGenerating","setIsGenerating","_getQueryParams","getQueryParams","_getQueryParams$tab","tab","_useExportsData","exportsData","mutate","token","useMemo","uuidV4","receivedCallback","data","download_url","useEffect","channel","exportChannel","disconnected","undefined","onClose","handleExport","mergeLeft","dashboard","camelToSnakeCase","_jsxs","Modal","isOpen","children","_jsx","Header","Typography","style","Body","isPresent","Footer","className","Button","href","icon","Download","label","onClick","_Fragment","disabled","loading"],"mappings":";;;;;;;;;;;;;;;;AAIA,IAAMA,MAAM,GAAG,SAATA,MAAMA,CAAGC,OAAO,EAAA;AAAA,EAAA,OACpBC,KAAK,CAACC,IAAI,IAAAC,MAAA,CACLC,QAAQ,EACX,iBAAA,CAAA,EAAA;IAAE,QAAQJ,EAAAA;AAAQ,GAAC,EACnB;AAAEK,IAAAA,UAAU,EAAE;AAAM,GACtB,CAAC;AAAA,CAAA;AAEH,IAAMC,UAAU,GAAG;AAAEP,EAAAA,MAAM,EAANA;AAAO,CAAC;;ACPtB,IAAMQ,cAAc,GAAG,SAAjBA,cAAcA,GAAA;AAAA,EAAA,OACzBC,WAAW,CAAC;IAAEC,UAAU,EAAEH,UAAU,CAACP;AAAO,GAAC,CAAC;AAAA,CAAA;;ACQhD,IAAMW,WAAW,GAAG,SAAdA,WAAWA,CAAAC,IAAA,EAOX;AAAA,EAAA,IANJC,OAAO,GAAAD,IAAA,CAAPC,OAAO;IACPC,aAAa,GAAAF,IAAA,CAAbE,aAAa;IACbC,WAAW,GAAAH,IAAA,CAAXG,WAAW;IACXC,cAAc,GAAAJ,IAAA,CAAdI,cAAc;IACdC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,UAAAA,OAAO,EAAErB;AAAa,SACvB,CAAC;OACF;AACH,KACW,CAAC;AAAA,GACV,CAAC;AAEZ;;;;"}
@@ -14,7 +14,7 @@ import _toConsumableArray from '@babel/runtime/helpers/toConsumableArray';
14
14
  import _defineProperty from '@babel/runtime/helpers/defineProperty';
15
15
  import { useMutationWithInvalidation } from '@bigbinary/neeto-commons-frontend/react-utils';
16
16
  import axios from 'axios';
17
- import { B as BASE_URL } from './index-D0hxo4Ei.js';
17
+ import { B as BASE_URL } from './index-DxhI_gau.js';
18
18
  import { t } from 'i18next';
19
19
  import * as yup from 'yup';
20
20
  import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
@@ -8,10 +8,10 @@ import { buildFiltersFromURL } from '@bigbinary/neeto-filters-frontend/utils';
8
8
  import Spinner from '@bigbinary/neetoui/Spinner';
9
9
  import { map, curry, concat, mergeDeepWith, mergeLeft, reject, isNil, prop, isEmpty, modify } from 'ramda';
10
10
  import { useHistory } from 'react-router-dom';
11
- import { E as ExportModal } from './ExportModal-DHkDL8S0.js';
11
+ import { E as ExportModal } from './ExportModal-DT0vcTac.js';
12
12
  import { useQuery } from '@tanstack/react-query';
13
13
  import axios from 'axios';
14
- import { B as BASE_URL, P as PAYMENT_PROVIDERS, f as DEFAULT_TAG_STYLE, h as formatAmount, i as formatCurrency, j as getUniquePaymentProviders, k as buildDefaultTableColumns, S as SORT_DIRECTIONS, p as processDataIndex, s as shouldTabsVisible, U as UN_HIDEABLE_COLUMNS, l as DEFAULT_PAGE_VALUES, m as DASHBOARD_KIND } from './index-D0hxo4Ei.js';
14
+ import { B as BASE_URL, P as PAYMENT_PROVIDERS, f as DEFAULT_TAG_STYLE, h as formatAmount, i as formatCurrency, j as getUniquePaymentProviders, k as buildDefaultTableColumns, S as SORT_DIRECTIONS, p as processDataIndex, s as shouldTabsVisible, U as UN_HIDEABLE_COLUMNS, l as DEFAULT_PAGE_VALUES, m as DASHBOARD_KIND } from './index-DxhI_gau.js';
15
15
  import { Q as QUERY_KEYS } from './queryConstants-mgjK5Hgk.js';
16
16
  import { t } from 'i18next';
17
17
  import { toLabelAndValue, isNotPresent, snakeToCamelCase, humanize, isPresent, camelToSnakeCase } from '@bigbinary/neeto-cist';
@@ -8,13 +8,13 @@ import SubHeader from '@bigbinary/neeto-molecules/SubHeader';
8
8
  import Tab from '@bigbinary/neetoui/Tab';
9
9
  import Typography from '@bigbinary/neetoui/Typography';
10
10
  import { useTranslation } from 'react-i18next';
11
- import { u as useExportData, b as buildDefaultPageProperties, a as buildPayload, c as buildRowData, w as withReactQuery } from './dashboard-D_x2CFTM.js';
11
+ import { u as useExportData, b as buildDefaultPageProperties, a as buildPayload, c as buildRowData, w as withReactQuery } from './dashboard-H1FaB24l.js';
12
12
  import _defineProperty from '@babel/runtime/helpers/defineProperty';
13
13
  import Download from '@bigbinary/neeto-icons/Download';
14
14
  import Button from '@bigbinary/neetoui/Button';
15
15
  import Modal from '@bigbinary/neetoui/Modal';
16
16
  import { e as exportChannel } from './exportChannel-CViICC6x.js';
17
- import { u as uuidV4, D as DEFAULT_SORT_PROPERTIES$1, S as SORT_DIRECTIONS } from './index-D0hxo4Ei.js';
17
+ import { u as uuidV4, D as DEFAULT_SORT_PROPERTIES$1, S as SORT_DIRECTIONS } from './index-DxhI_gau.js';
18
18
  import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
19
19
  import _toConsumableArray from '@babel/runtime/helpers/toConsumableArray';
20
20
  import { camelToSnakeCase, removeBy, snakeToCamelCase, isPresent } from '@bigbinary/neeto-cist';
@@ -22,7 +22,7 @@ import { buildUrl, getQueryParams } from '@bigbinary/neeto-commons-frontend/util
22
22
  import { buildFiltersFromURL } from '@bigbinary/neeto-filters-frontend/utils';
23
23
  import { curry, assoc, insert, mergeLeft } from 'ramda';
24
24
  import { useHistory } from 'react-router-dom';
25
- import { r as renderStatus, b as renderDate } from './renderFunctions-d_DYxlmU.js';
25
+ import { r as renderStatus, b as renderDate } from './renderFunctions-DtoDuKzR.js';
26
26
  import { C as CopyButtonWrapper } from './CopyButtonWrapper-SoJkwX-d.js';
27
27
  import { DEFAULT_PAGE_SIZE, DEFAULT_PAGE_INDEX } from '@bigbinary/neeto-commons-frontend/constants';
28
28
  import { useHiddenColumns } from '@bigbinary/neeto-molecules/Columns';
@@ -30,7 +30,7 @@ import TableWrapper from '@bigbinary/neeto-molecules/TableWrapper';
30
30
  import Table from '@bigbinary/neetoui/Table';
31
31
  import NoData from '@bigbinary/neetoui/NoData';
32
32
  import Spinner from '@bigbinary/neetoui/Spinner';
33
- import { u as useFetchStripePayouts, a as useFetchStripePlatformPayouts } from './usePlatformApi-BBVtu75Q.js';
33
+ import { u as useFetchStripePayouts, a as useFetchStripePlatformPayouts } from './usePlatformApi-IdRP9TJl.js';
34
34
  import '@tanstack/react-query';
35
35
  import '@tanstack/react-query-devtools';
36
36
  import 'axios';
@@ -4,11 +4,11 @@ import Spinner from '@bigbinary/neetoui/Spinner';
4
4
  import Typography from '@bigbinary/neetoui/Typography';
5
5
  import { useTranslation } from 'react-i18next';
6
6
  import { useParams } from 'react-router-dom/cjs/react-router-dom';
7
- import { r as renderStatus, b as renderDate } from './renderFunctions-d_DYxlmU.js';
8
- import { b as useShowStripePayout, c as useShowStripePlatformPayout } from './usePlatformApi-BBVtu75Q.js';
7
+ import { r as renderStatus, b as renderDate } from './renderFunctions-DtoDuKzR.js';
8
+ import { b as useShowStripePayout, c as useShowStripePlatformPayout } from './usePlatformApi-IdRP9TJl.js';
9
9
  import Button from '@bigbinary/neetoui/Button';
10
10
  import { C as CopyButtonWrapper } from './CopyButtonWrapper-SoJkwX-d.js';
11
- import { n as buildStripePayoutLink } from './index-D0hxo4Ei.js';
11
+ import { n as buildStripePayoutLink } from './index-DxhI_gau.js';
12
12
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
13
13
  import 'i18next';
14
14
  import '@bigbinary/neeto-molecules/DateFormat';
@@ -4,8 +4,8 @@ import { noop, findBy, isNotPresent } from '@bigbinary/neeto-cist';
4
4
  import Button from '@bigbinary/neetoui/Button';
5
5
  import { mergeDeepLeft } from 'ramda';
6
6
  import { useTranslation } from 'react-i18next';
7
- import { u as useCreateRazorpayPayment } from './usePaymentApi-CRvon9jb.js';
8
- import { R as RAZORPAY_PAYMENT_BUTTON_OPTIONS } from './index-D0hxo4Ei.js';
7
+ import { u as useCreateRazorpayPayment } from './usePaymentApi-Dy3Swac-.js';
8
+ import { R as RAZORPAY_PAYMENT_BUTTON_OPTIONS } from './index-DxhI_gau.js';
9
9
  import { jsx } from 'react/jsx-runtime';
10
10
  import '@babel/runtime/helpers/defineProperty';
11
11
  import '@tanstack/react-query';
@@ -14,7 +14,7 @@ import _defineProperty from '@babel/runtime/helpers/defineProperty';
14
14
  import { useQuery } from '@tanstack/react-query';
15
15
  import { useMutationWithInvalidation } from '@bigbinary/neeto-commons-frontend/react-utils';
16
16
  import axios from 'axios';
17
- import { B as BASE_URL } from './index-D0hxo4Ei.js';
17
+ import { B as BASE_URL } from './index-DxhI_gau.js';
18
18
  import { Q as QUERY_KEYS } from './queryConstants-mgjK5Hgk.js';
19
19
  import { t } from 'i18next';
20
20
  import * as yup from 'yup';
@@ -8,10 +8,10 @@ import { buildFiltersFromURL } from '@bigbinary/neeto-filters-frontend/utils';
8
8
  import Spinner from '@bigbinary/neetoui/Spinner';
9
9
  import { map, curry, mergeDeepWith, concat, mergeLeft, reject, isNil, prop, isEmpty, modify } from 'ramda';
10
10
  import { useHistory } from 'react-router-dom';
11
- import { E as ExportModal } from './ExportModal-DHkDL8S0.js';
11
+ import { E as ExportModal } from './ExportModal-DT0vcTac.js';
12
12
  import { useQuery } from '@tanstack/react-query';
13
13
  import axios from 'axios';
14
- import { B as BASE_URL, P as PAYMENT_PROVIDERS, f as DEFAULT_TAG_STYLE, h as formatAmount, i as formatCurrency, k as buildDefaultTableColumns, S as SORT_DIRECTIONS, p as processDataIndex, A as ASSOCIATED_TABLE_COLUMNS, D as DEFAULT_SORT_PROPERTIES, s as shouldTabsVisible, U as UN_HIDEABLE_COLUMNS, l as DEFAULT_PAGE_VALUES, m as DASHBOARD_KIND } from './index-D0hxo4Ei.js';
14
+ import { B as BASE_URL, P as PAYMENT_PROVIDERS, f as DEFAULT_TAG_STYLE, h as formatAmount, i as formatCurrency, k as buildDefaultTableColumns, S as SORT_DIRECTIONS, p as processDataIndex, A as ASSOCIATED_TABLE_COLUMNS, D as DEFAULT_SORT_PROPERTIES, s as shouldTabsVisible, U as UN_HIDEABLE_COLUMNS, l as DEFAULT_PAGE_VALUES, m as DASHBOARD_KIND } from './index-DxhI_gau.js';
15
15
  import { Q as QUERY_KEYS } from './queryConstants-mgjK5Hgk.js';
16
16
  import { t } from 'i18next';
17
17
  import { toLabelAndValue, snakeToCamelCase, humanize, isPresent, isNotPresent, camelToSnakeCase } from '@bigbinary/neeto-cist';
@@ -8,11 +8,11 @@ import { buildFiltersFromURL } from '@bigbinary/neeto-filters-frontend/utils';
8
8
  import Spinner from '@bigbinary/neetoui/Spinner';
9
9
  import { mergeLeft, curry, mergeDeepWith, concat, reject, isNil, map, prop, sortBy, isEmpty, modify, pluck } from 'ramda';
10
10
  import { useHistory } from 'react-router-dom';
11
- import { E as ExportModal } from './ExportModal-DHkDL8S0.js';
11
+ import { E as ExportModal } from './ExportModal-DT0vcTac.js';
12
12
  import { useQuery } from '@tanstack/react-query';
13
13
  import { useMutationWithInvalidation } from '@bigbinary/neeto-commons-frontend/react-utils';
14
14
  import axios from 'axios';
15
- import { B as BASE_URL, o as preProcessStatus, q as getTagStyle, h as formatAmount, i as formatCurrency, r as PAYMENT_KIND, p as processDataIndex, S as SORT_DIRECTIONS, D as DEFAULT_SORT_PROPERTIES, s as shouldTabsVisible, U as UN_HIDEABLE_COLUMNS, l as DEFAULT_PAGE_VALUES, m as DASHBOARD_KIND } from './index-D0hxo4Ei.js';
15
+ import { B as BASE_URL, o as preProcessStatus, q as getTagStyle, h as formatAmount, i as formatCurrency, r as PAYMENT_KIND, p as processDataIndex, S as SORT_DIRECTIONS, D as DEFAULT_SORT_PROPERTIES, s as shouldTabsVisible, U as UN_HIDEABLE_COLUMNS, l as DEFAULT_PAGE_VALUES, m as DASHBOARD_KIND } from './index-DxhI_gau.js';
16
16
  import { Q as QUERY_KEYS } from './queryConstants-mgjK5Hgk.js';
17
17
  import Modal from '@bigbinary/neetoui/Modal';
18
18
  import Typography from '@bigbinary/neetoui/Typography';
@@ -15,7 +15,7 @@ import _defineProperty from '@babel/runtime/helpers/defineProperty';
15
15
  import { useQuery } from '@tanstack/react-query';
16
16
  import { useMutationWithInvalidation } from '@bigbinary/neeto-commons-frontend/react-utils';
17
17
  import axios from 'axios';
18
- import { B as BASE_URL } from './index-D0hxo4Ei.js';
18
+ import { B as BASE_URL } from './index-DxhI_gau.js';
19
19
  import { Q as QUERY_KEYS } from './queryConstants-mgjK5Hgk.js';
20
20
  import Label from '@bigbinary/neetoui/Label';
21
21
  import Typography from '@bigbinary/neetoui/Typography';
@@ -7,19 +7,23 @@ import Input from '@bigbinary/neetoui/formik/Input';
7
7
  import QRCodeImage from 'qrcode.react';
8
8
  import { pluck } from 'ramda';
9
9
  import { useTranslation } from 'react-i18next';
10
- import { a as useCreateUpiPayment } from './usePaymentsApi-BnNW64vz.js';
10
+ import { a as useCreateUpiPayment } from './usePaymentsApi-BwF1E4GX.js';
11
11
  import { t } from 'i18next';
12
12
  import * as yup from 'yup';
13
13
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
14
14
  import '@tanstack/react-query';
15
15
  import 'axios';
16
- import './index-D0hxo4Ei.js';
16
+ import './index-DxhI_gau.js';
17
17
  import '@bigbinary/neeto-commons-frontend/constants';
18
18
  import 'decimal.js';
19
19
  import '@bigbinary/neeto-commons-frontend/utils';
20
20
 
21
21
  var VALIDATION_SCHEMA = yup.object({
22
- identifier: yup.string().required(t("neetoPayments.upi.payment.transaction.required")).min(6, t("neetoPayments.upi.payment.transaction.sixCharacters")).max(6, t("neetoPayments.upi.payment.transaction.sixCharacters"))
22
+ identifier: yup.string().required(t("neetoPayments.upi.payment.transaction.required")).min(6, t("neetoPayments.upi.payment.transaction.sixCharacters")).test("is-integer", t("neetoPayments.validations.invalidField", {
23
+ entity: t("neetoPayments.common.transactionId")
24
+ }), function (value) {
25
+ return Number.isInteger(value);
26
+ }).max(6, t("neetoPayments.upi.payment.transaction.sixCharacters"))
23
27
  });
24
28
 
25
29
  var vpaIdToQrCodeValue = function vpaIdToQrCodeValue(vpaId) {
@@ -1 +1 @@
1
- {"version":3,"file":"UpiPayment.js","sources":["../app/javascript/src/components/UpiPayment/constants.js","../app/javascript/src/components/UpiPayment/utils.js","../app/javascript/src/components/UpiPayment/index.jsx"],"sourcesContent":["import { t } from \"i18next\";\nimport * as yup from \"yup\";\n\nexport const VALIDATION_SCHEMA = yup.object({\n identifier: yup\n .string()\n .required(t(\"neetoPayments.upi.payment.transaction.required\"))\n .min(6, t(\"neetoPayments.upi.payment.transaction.sixCharacters\"))\n .max(6, t(\"neetoPayments.upi.payment.transaction.sixCharacters\")),\n});\n","export const vpaIdToQrCodeValue = vpaId => `upi://pay?pa=${vpaId}`;\n","import { noop, isPresent } from \"neetocist\";\nimport { Typography } from \"neetoui\";\nimport { ActionBlock, Form, Input } from \"neetoui/formik\";\nimport QRCodeImage from \"qrcode.react\";\nimport { pluck } from \"ramda\";\nimport { useTranslation } from \"react-i18next\";\n\nimport { useCreateUpiPayment } from \"hooks/reactQuery/upi/usePaymentsApi\";\n\nimport { VALIDATION_SCHEMA } from \"./constants\";\nimport { vpaIdToQrCodeValue } from \"./utils\";\n\nconst UpiPayment = ({\n fee,\n payableId,\n discountCode,\n customAmount,\n handleCancel,\n payableType = null,\n onBeforePayment = noop,\n onFailedPayment = noop,\n onSuccessfulPayment = noop,\n}) => {\n const { t } = useTranslation();\n\n const vpaIds = pluck(\"address\", fee?.vpas);\n\n const { isPending, mutate: createPayment } = useCreateUpiPayment({\n onSuccess: onSuccessfulPayment,\n onError: onFailedPayment,\n });\n\n const handleSubmit = values => {\n onBeforePayment();\n const payload = { ...values, payableId, customAmount, payableType, discountCode };\n createPayment(payload);\n };\n\n return (\n <Form\n className=\"space-y-4\"\n formikProps={{\n onSubmit: handleSubmit,\n initialValues: { identifier: \"\" },\n validationSchema: VALIDATION_SCHEMA,\n }}\n >\n {({ dirty }) => (\n <>\n <Typography style=\"body1\">\n {t(\"neetoPayments.upi.payment.vpaText\", { count: vpaIds.length })}\n </Typography>\n {isPresent(vpaIds) && (\n <div className=\"grid grid-cols-1 gap-8 gap-y-4 sm:grid-cols-2\">\n {vpaIds.map(vpaId => (\n <div\n className=\"flex flex-col items-center justify-center\"\n key={vpaId}\n >\n <QRCodeImage\n size={256}\n style={{ width: 80, height: 80 }}\n value={vpaIdToQrCodeValue(vpaId)}\n />\n <Typography\n className=\"w-full mt-2 text-center break-words\"\n style=\"body2\"\n >\n {vpaId}\n </Typography>\n </div>\n ))}\n </div>\n )}\n <Input\n required\n label={t(\"neetoPayments.upi.payment.transaction.label\")}\n name=\"identifier\"\n placeholder={t(\"neetoPayments.upi.payment.transaction.placeholder\")}\n />\n <ActionBlock\n cancelButtonProps={{\n label: t(\"neetoPayments.upi.payment.buttons.back\"),\n onClick: handleCancel,\n disabled: isPending,\n }}\n submitButtonProps={{\n label: t(\"neetoPayments.upi.payment.buttons.submit\"),\n disabled: !dirty || isPending,\n loading: isPending,\n }}\n />\n </>\n )}\n </Form>\n );\n};\n\nexport default UpiPayment;\n"],"names":["VALIDATION_SCHEMA","yup","object","identifier","string","required","t","min","max","vpaIdToQrCodeValue","vpaId","concat","UpiPayment","_ref","fee","payableId","discountCode","customAmount","handleCancel","_ref$payableType","payableType","_ref$onBeforePayment","onBeforePayment","noop","_ref$onFailedPayment","onFailedPayment","_ref$onSuccessfulPaym","onSuccessfulPayment","_useTranslation","useTranslation","vpaIds","pluck","vpas","_useCreateUpiPayment","useCreateUpiPayment","onSuccess","onError","isPending","createPayment","mutate","handleSubmit","values","payload","_objectSpread","_jsx","Form","className","formikProps","onSubmit","initialValues","validationSchema","children","_ref2","dirty","_jsxs","_Fragment","Typography","style","count","length","isPresent","map","QRCodeImage","size","width","height","value","Input","label","name","placeholder","ActionBlock","cancelButtonProps","onClick","disabled","submitButtonProps","loading"],"mappings":";;;;;;;;;;;;;;;;;;;;AAGO,IAAMA,iBAAiB,GAAGC,GAAG,CAACC,MAAM,CAAC;AAC1CC,EAAAA,UAAU,EAAEF,GAAG,CACZG,MAAM,EAAE,CACRC,QAAQ,CAACC,CAAC,CAAC,gDAAgD,CAAC,CAAC,CAC7DC,GAAG,CAAC,CAAC,EAAED,CAAC,CAAC,qDAAqD,CAAC,CAAC,CAChEE,GAAG,CAAC,CAAC,EAAEF,CAAC,CAAC,qDAAqD,CAAC;AACpE,CAAC,CAAC;;ACTK,IAAMG,kBAAkB,GAAG,SAArBA,kBAAkBA,CAAGC,KAAK,EAAA;EAAA,OAAAC,eAAAA,CAAAA,MAAA,CAAoBD,KAAK,CAAA;AAAA,CAAE;;;;ACYlE,IAAME,UAAU,GAAG,SAAbA,UAAUA,CAAAC,IAAA,EAUV;AAAA,EAAA,IATJC,GAAG,GAAAD,IAAA,CAAHC,GAAG;IACHC,SAAS,GAAAF,IAAA,CAATE,SAAS;IACTC,YAAY,GAAAH,IAAA,CAAZG,YAAY;IACZC,YAAY,GAAAJ,IAAA,CAAZI,YAAY;IACZC,YAAY,GAAAL,IAAA,CAAZK,YAAY;IAAAC,gBAAA,GAAAN,IAAA,CACZO,WAAW;AAAXA,IAAAA,WAAW,GAAAD,gBAAA,KAAG,KAAA,CAAA,GAAA,IAAI,GAAAA,gBAAA;IAAAE,oBAAA,GAAAR,IAAA,CAClBS,eAAe;AAAfA,IAAAA,eAAe,GAAAD,oBAAA,KAAGE,KAAAA,CAAAA,GAAAA,IAAI,GAAAF,oBAAA;IAAAG,oBAAA,GAAAX,IAAA,CACtBY,eAAe;AAAfA,IAAAA,eAAe,GAAAD,oBAAA,KAAGD,KAAAA,CAAAA,GAAAA,IAAI,GAA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AAA;AACVC,UAAAA,iBAAiB,EAAE;AACjBJ,YAAAA,KAAK,EAAE9D,CAAC,CAAC,wCAAwC,CAAC;AAClDmE,YAAAA,OAAO,EAAEvD,YAAY;AACrBwD,YAAAA,QAAQ,EAAErC;WACV;AACFsC,UAAAA,iBAAiB,EAAE;AACjBP,YAAAA,KAAK,EAAE9D,CAAC,CAAC,0CAA0C,CAAC;AACpDoE,YAAAA,QAAQ,EAAE,CAACrB,KAAK,IAAIhB,SAAS;AAC7BuC,YAAAA,OAAO,EAAEvC;AACX;AAAE,SACH,CAAC;AAAA,OACF,CAAC;AAAA;AACJ,GACG,CAAC;AAEX;;;;"}
1
+ {"version":3,"file":"UpiPayment.js","sources":["../app/javascript/src/components/UpiPayment/constants.js","../app/javascript/src/components/UpiPayment/utils.js","../app/javascript/src/components/UpiPayment/index.jsx"],"sourcesContent":["import { t } from \"i18next\";\nimport * as yup from \"yup\";\n\nexport const VALIDATION_SCHEMA = yup.object({\n identifier: yup\n .string()\n .required(t(\"neetoPayments.upi.payment.transaction.required\"))\n .min(6, t(\"neetoPayments.upi.payment.transaction.sixCharacters\"))\n .test(\n \"is-integer\",\n t(\"neetoPayments.validations.invalidField\", {\n entity: t(\"neetoPayments.common.transactionId\"),\n }),\n value => Number.isInteger(value)\n )\n .max(6, t(\"neetoPayments.upi.payment.transaction.sixCharacters\")),\n});\n","export const vpaIdToQrCodeValue = vpaId => `upi://pay?pa=${vpaId}`;\n","import { noop, isPresent } from \"neetocist\";\nimport { Typography } from \"neetoui\";\nimport { ActionBlock, Form, Input } from \"neetoui/formik\";\nimport QRCodeImage from \"qrcode.react\";\nimport { pluck } from \"ramda\";\nimport { useTranslation } from \"react-i18next\";\n\nimport { useCreateUpiPayment } from \"hooks/reactQuery/upi/usePaymentsApi\";\n\nimport { VALIDATION_SCHEMA } from \"./constants\";\nimport { vpaIdToQrCodeValue } from \"./utils\";\n\nconst UpiPayment = ({\n fee,\n payableId,\n discountCode,\n customAmount,\n handleCancel,\n payableType = null,\n onBeforePayment = noop,\n onFailedPayment = noop,\n onSuccessfulPayment = noop,\n}) => {\n const { t } = useTranslation();\n\n const vpaIds = pluck(\"address\", fee?.vpas);\n\n const { isPending, mutate: createPayment } = useCreateUpiPayment({\n onSuccess: onSuccessfulPayment,\n onError: onFailedPayment,\n });\n\n const handleSubmit = values => {\n onBeforePayment();\n const payload = {\n ...values,\n payableId,\n customAmount,\n payableType,\n discountCode,\n };\n createPayment(payload);\n };\n\n return (\n <Form\n className=\"space-y-4\"\n formikProps={{\n onSubmit: handleSubmit,\n initialValues: { identifier: \"\" },\n validationSchema: VALIDATION_SCHEMA,\n }}\n >\n {({ dirty }) => (\n <>\n <Typography style=\"body1\">\n {t(\"neetoPayments.upi.payment.vpaText\", { count: vpaIds.length })}\n </Typography>\n {isPresent(vpaIds) && (\n <div className=\"grid grid-cols-1 gap-8 gap-y-4 sm:grid-cols-2\">\n {vpaIds.map(vpaId => (\n <div\n className=\"flex flex-col items-center justify-center\"\n key={vpaId}\n >\n <QRCodeImage\n size={256}\n style={{ width: 80, height: 80 }}\n value={vpaIdToQrCodeValue(vpaId)}\n />\n <Typography\n className=\"w-full mt-2 text-center break-words\"\n style=\"body2\"\n >\n {vpaId}\n </Typography>\n </div>\n ))}\n </div>\n )}\n <Input\n required\n label={t(\"neetoPayments.upi.payment.transaction.label\")}\n name=\"identifier\"\n placeholder={t(\"neetoPayments.upi.payment.transaction.placeholder\")}\n />\n <ActionBlock\n cancelButtonProps={{\n label: t(\"neetoPayments.upi.payment.buttons.back\"),\n onClick: handleCancel,\n disabled: isPending,\n }}\n submitButtonProps={{\n label: t(\"neetoPayments.upi.payment.buttons.submit\"),\n disabled: !dirty || isPending,\n loading: isPending,\n }}\n />\n </>\n )}\n </Form>\n );\n};\n\nexport default UpiPayment;\n"],"names":["VALIDATION_SCHEMA","yup","object","identifier","string","required","t","min","test","entity","value","Number","isInteger","max","vpaIdToQrCodeValue","vpaId","concat","UpiPayment","_ref","fee","payableId","discountCode","customAmount","handleCancel","_ref$payableType","payableType","_ref$onBeforePayment","onBeforePayment","noop","_ref$onFailedPayment","onFailedPayment","_ref$onSuccessfulPaym","onSuccessfulPayment","_useTranslation","useTranslation","vpaIds","pluck","vpas","_useCreateUpiPayment","useCreateUpiPayment","onSuccess","onError","isPending","createPayment","mutate","handleSubmit","values","payload","_objectSpread","_jsx","Form","className","formikProps","onSubmit","initialValues","validationSchema","children","_ref2","dirty","_jsxs","_Fragment","Typography","style","count","length","isPresent","map","QRCodeImage","size","width","height","Input","label","name","placeholder","ActionBlock","cancelButtonProps","onClick","disabled","submitButtonProps","loading"],"mappings":";;;;;;;;;;;;;;;;;;;;AAGO,IAAMA,iBAAiB,GAAGC,GAAG,CAACC,MAAM,CAAC;AAC1CC,EAAAA,UAAU,EAAEF,GAAG,CACZG,MAAM,EAAE,CACRC,QAAQ,CAACC,CAAC,CAAC,gDAAgD,CAAC,CAAC,CAC7DC,GAAG,CAAC,CAAC,EAAED,CAAC,CAAC,qDAAqD,CAAC,CAAC,CAChEE,IAAI,CACH,YAAY,EACZF,CAAC,CAAC,wCAAwC,EAAE;IAC1CG,MAAM,EAAEH,CAAC,CAAC,oCAAoC;GAC/C,CAAC,EACF,UAAAI,KAAK,EAAA;AAAA,IAAA,OAAIC,MAAM,CAACC,SAAS,CAACF,KAAK,CAAC;GAClC,CAAC,CACAG,GAAG,CAAC,CAAC,EAAEP,CAAC,CAAC,qDAAqD,CAAC;AACpE,CAAC,CAAC;;AChBK,IAAMQ,kBAAkB,GAAG,SAArBA,kBAAkBA,CAAGC,KAAK,EAAA;EAAA,OAAAC,eAAAA,CAAAA,MAAA,CAAoBD,KAAK,CAAA;AAAA,CAAE;;;;ACYlE,IAAME,UAAU,GAAG,SAAbA,UAAUA,CAAAC,IAAA,EAUV;AAAA,EAAA,IATJC,GAAG,GAAAD,IAAA,CAAHC,GAAG;IACHC,SAAS,GAAAF,IAAA,CAATE,SAAS;IACTC,YAAY,GAAAH,IAAA,CAAZG,Y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FkC,GAAA,CAACY,UAAU,EAAA;AACTV,gBAAAA,SAAS,EAAC,qCAAqC;AAC/CW,gBAAAA,KAAK,EAAC,OAAO;AAAAN,gBAAAA,QAAA,EAEZzC;AAAK,eACI,CAAC;AAAA,aAAA,EAZRA,KAaF,CAAC;WACP;AAAC,SACC,CACN,eACDkC,GAAA,CAACsB,KAAK,EAAA;UACJlE,QAAQ,EAAA,IAAA;AACRmE,UAAAA,KAAK,EAAElE,CAAC,CAAC,6CAA6C,CAAE;AACxDmE,UAAAA,IAAI,EAAC,YAAY;UACjBC,WAAW,EAAEpE,CAAC,CAAC,mDAAmD;AAAE,SACrE,CAAC,eACF2C,GAAA,CAAC0B,WAAW,EAAA;AACVC,UAAAA,iBAAiB,EAAE;AACjBJ,YAAAA,KAAK,EAAElE,CAAC,CAAC,wCAAwC,CAAC;AAClDuE,YAAAA,OAAO,EAAEtD,YAAY;AACrBuD,YAAAA,QAAQ,EAAEpC;WACV;AACFqC,UAAAA,iBAAiB,EAAE;AACjBP,YAAAA,KAAK,EAAElE,CAAC,CAAC,0CAA0C,CAAC;AACpDwE,YAAAA,QAAQ,EAAE,CAACpB,KAAK,IAAIhB,SAAS;AAC7BsC,YAAAA,OAAO,EAAEtC;AACX;AAAE,SACH,CAAC;AAAA,OACF,CAAC;AAAA;AACJ,GACG,CAAC;AAEX;;;;"}
@@ -1,4 +1,4 @@
1
- import { b as buildStripeTransactionLink } from './index-D0hxo4Ei.js';
1
+ import { b as buildStripeTransactionLink } from './index-DxhI_gau.js';
2
2
  import 'i18next';
3
3
  import '@bigbinary/neeto-commons-frontend/constants';
4
4
  import 'decimal.js';
@@ -11,20 +11,20 @@ var SubHeader = require('@bigbinary/neeto-molecules/SubHeader');
11
11
  var Tab = require('@bigbinary/neetoui/Tab');
12
12
  var Typography = require('@bigbinary/neetoui/Typography');
13
13
  var reactI18next = require('react-i18next');
14
- var dashboard = require('./dashboard-CJ_m2Dt3.js');
14
+ var dashboard = require('./dashboard-Xb5zQInQ.js');
15
15
  var _defineProperty = require('@babel/runtime/helpers/defineProperty');
16
16
  var Download = require('@bigbinary/neeto-icons/Download');
17
17
  var Button = require('@bigbinary/neetoui/Button');
18
18
  var Modal = require('@bigbinary/neetoui/Modal');
19
19
  var exportChannel = require('./exportChannel-BsZ3fusx.js');
20
- var constants = require('./index-CtTWebii.js');
20
+ var constants = require('./index-BXQqCPIU.js');
21
21
  var jsxRuntime = require('react/jsx-runtime');
22
22
  var _toConsumableArray = require('@babel/runtime/helpers/toConsumableArray');
23
23
  var utils = require('@bigbinary/neeto-commons-frontend/utils');
24
24
  var utils$1 = require('@bigbinary/neeto-filters-frontend/utils');
25
25
  var ramda = require('ramda');
26
26
  var reactRouterDom = require('react-router-dom');
27
- var renderFunctions = require('./renderFunctions-BkrGVpSO.js');
27
+ var renderFunctions = require('./renderFunctions-ChnAUwcP.js');
28
28
  var CopyButtonWrapper = require('./CopyButtonWrapper-Ds1k64E0.js');
29
29
  var constants$1 = require('@bigbinary/neeto-commons-frontend/constants');
30
30
  var Columns = require('@bigbinary/neeto-molecules/Columns');
@@ -8,7 +8,7 @@ var reactI18next = require('react-i18next');
8
8
  var _toConsumableArray = require('@babel/runtime/helpers/toConsumableArray');
9
9
  var reactUtils = require('@bigbinary/neeto-commons-frontend/react-utils');
10
10
  var axios = require('axios');
11
- var constants = require('./index-CtTWebii.js');
11
+ var constants = require('./index-BXQqCPIU.js');
12
12
  var jsxRuntime = require('react/jsx-runtime');
13
13
  require('i18next');
14
14
  require('@bigbinary/neeto-commons-frontend/constants');
@@ -3,12 +3,12 @@
3
3
  var neetoCist = require('@bigbinary/neeto-cist');
4
4
  var Button = require('@bigbinary/neetoui/Button');
5
5
  var reactI18next = require('react-i18next');
6
- var usePaymentApi = require('./usePaymentApi-CEbTENBB.js');
6
+ var usePaymentApi = require('./usePaymentApi-DTeHYEjG.js');
7
7
  var jsxRuntime = require('react/jsx-runtime');
8
8
  require('@babel/runtime/helpers/defineProperty');
9
9
  require('@tanstack/react-query');
10
10
  require('axios');
11
- require('./index-CtTWebii.js');
11
+ require('./index-BXQqCPIU.js');
12
12
  require('i18next');
13
13
  require('@bigbinary/neeto-commons-frontend/constants');
14
14
  require('decimal.js');
@@ -10,12 +10,12 @@ var Form = require('@bigbinary/neetoui/formik/Form');
10
10
  var Textarea = require('@bigbinary/neetoui/formik/Textarea');
11
11
  var ActionBlock = require('@bigbinary/neetoui/formik/ActionBlock');
12
12
  var reactI18next = require('react-i18next');
13
- var usePaymentApi = require('./usePaymentApi-CEbTENBB.js');
13
+ var usePaymentApi = require('./usePaymentApi-DTeHYEjG.js');
14
14
  var jsxRuntime = require('react/jsx-runtime');
15
15
  require('@babel/runtime/helpers/defineProperty');
16
16
  require('@tanstack/react-query');
17
17
  require('axios');
18
- require('./index-CtTWebii.js');
18
+ require('./index-BXQqCPIU.js');
19
19
  require('i18next');
20
20
  require('@bigbinary/neeto-commons-frontend/constants');
21
21
  require('decimal.js');
@@ -12,14 +12,14 @@ var Select = require('@bigbinary/neetoui/formik/Select');
12
12
  var ActionBlock = require('@bigbinary/neetoui/formik/ActionBlock');
13
13
  var ramda = require('ramda');
14
14
  var reactI18next = require('react-i18next');
15
- var usePaymentsApi = require('./usePaymentsApi-6pF1wGMT.js');
15
+ var usePaymentsApi = require('./usePaymentsApi-CW2I4NuQ.js');
16
16
  var i18next = require('i18next');
17
17
  var yup = require('yup');
18
18
  var jsxRuntime = require('react/jsx-runtime');
19
19
  require('@babel/runtime/helpers/defineProperty');
20
20
  require('@tanstack/react-query');
21
21
  require('axios');
22
- require('./index-CtTWebii.js');
22
+ require('./index-BXQqCPIU.js');
23
23
  require('@bigbinary/neeto-commons-frontend/constants');
24
24
  require('decimal.js');
25
25
  require('@bigbinary/neeto-commons-frontend/utils');
@@ -8,7 +8,7 @@ var Button = require('@bigbinary/neetoui/formik/Button');
8
8
  var reactI18next = require('react-i18next');
9
9
  var reactUtils = require('@bigbinary/neeto-commons-frontend/react-utils');
10
10
  var axios = require('axios');
11
- var constants = require('./index-CtTWebii.js');
11
+ var constants = require('./index-BXQqCPIU.js');
12
12
  var reactQuery = require('@tanstack/react-query');
13
13
  var ramda = require('ramda');
14
14
  var queryConstants = require('./queryConstants-DGg4cX3r.js');
@@ -12,7 +12,7 @@ var ramda = require('ramda');
12
12
  var reactI18next = require('react-i18next');
13
13
  var reactQuery = require('@tanstack/react-query');
14
14
  var axios = require('axios');
15
- var constants = require('./index-CtTWebii.js');
15
+ var constants = require('./index-BXQqCPIU.js');
16
16
  var exportChannel = require('./exportChannel-BsZ3fusx.js');
17
17
  var jsxRuntime = require('react/jsx-runtime');
18
18
 
@@ -130,4 +130,4 @@ var ExportModal = function ExportModal(_ref) {
130
130
  };
131
131
 
132
132
  exports.ExportModal = ExportModal;
133
- //# sourceMappingURL=ExportModal-BG48z32O.js.map
133
+ //# sourceMappingURL=ExportModal-DHYiDlh7.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ExportModal-BG48z32O.js","sources":["../../app/javascript/src/apis/exports.js","../../app/javascript/src/hooks/reactQuery/useExportsApi.js","../../app/javascript/src/components/Common/ExportModal.jsx"],"sourcesContent":["import axios from \"axios\";\n\nimport { BASE_URL } from \"src/constants\";\n\nconst create = payload =>\n axios.post(\n `${BASE_URL}/api/v1/exports`,\n { export: payload },\n { showToastr: false }\n );\n\nconst exportsApi = { create };\n\nexport default exportsApi;\n","import { useMutation } from \"@tanstack/react-query\";\n\nimport exportsApi from \"apis/exports\";\n\nexport const useExportsData = () =>\n useMutation({ mutationFn: exportsApi.create });\n","import { useEffect, useMemo, useState } from \"react\";\n\nimport { isPresent, camelToSnakeCase } from \"neetocist\";\nimport { getQueryParams } from \"neetocommons/utils\";\nimport { Download } from \"neetoicons\";\nimport { Button, Modal, Typography } from \"neetoui\";\nimport { mergeLeft } from \"ramda\";\nimport { useTranslation } from \"react-i18next\";\n\nimport { useExportsData } from \"hooks/reactQuery/useExportsApi\";\nimport exportChannel from \"src/channels/exportChannel\";\nimport { uuidV4 } from \"utils\";\n\nconst ExportModal = ({\n filters,\n dashboardKind,\n holdableIds,\n sortProperties,\n isExportModalOpen,\n setIsExportModalOpen,\n}) => {\n const { t } = useTranslation();\n const [downloadUrl, setDownloadUrl] = useState(\"\");\n const [isGenerating, setIsGenerating] = useState(false);\n\n const { tab = \"all\" } = getQueryParams();\n\n const { mutate: exportsData } = useExportsData();\n\n const token = useMemo(\n () => `${dashboardKind}-report-${uuidV4()}`,\n [dashboardKind]\n );\n\n const receivedCallback = data => {\n if (!data.download_url) return;\n setDownloadUrl(data.download_url);\n setIsGenerating(false);\n };\n\n useEffect(() => {\n if (isExportModalOpen) {\n const channel = exportChannel(token, receivedCallback);\n setDownloadUrl(\"\");\n setIsGenerating(false);\n\n return () => {\n channel.disconnected();\n };\n }\n\n return undefined;\n }, [isExportModalOpen, token]);\n\n const onClose = () => setIsExportModalOpen(false);\n\n const handleExport = () => {\n setDownloadUrl(\"\");\n setIsGenerating(true);\n const payload = mergeLeft(sortProperties, {\n token,\n filters,\n tab,\n holdableIds,\n dashboard: camelToSnakeCase(dashboardKind),\n });\n\n exportsData(payload);\n };\n\n return (\n <Modal {...{ onClose }} isOpen={isExportModalOpen}>\n <Modal.Header>\n <Typography style=\"h2\">\n {t(`neetoPayments.export.title.${dashboardKind}`)}\n </Typography>\n </Modal.Header>\n <Modal.Body>\n {isGenerating ? (\n <Typography style=\"body2\">\n {t(\"neetoPayments.export.pleaseWait\")}\n </Typography>\n ) : (\n <Typography style=\"body2\">\n {isPresent(downloadUrl)\n ? t(\"neetoPayments.export.fileReady\")\n : t(`neetoPayments.export.download.${dashboardKind}`)}\n </Typography>\n )}\n </Modal.Body>\n <Modal.Footer className=\"space-x-2\">\n {isPresent(downloadUrl) ? (\n <Button\n href={downloadUrl}\n icon={Download}\n label={t(\"neetoPayments.common.download\")}\n onClick={onClose}\n />\n ) : (\n <>\n <Button\n disabled={isGenerating}\n label={t(\"neetoPayments.common.cancel\")}\n style=\"tertiary\"\n onClick={onClose}\n />\n <Button\n disabled={isGenerating}\n label={t(\"neetoPayments.common.export\")}\n loading={isGenerating}\n onClick={handleExport}\n />\n </>\n )}\n </Modal.Footer>\n </Modal>\n );\n};\n\nexport default ExportModal;\n"],"names":["create","payload","axios","post","concat","BASE_URL","showToastr","exportsApi","useExportsData","useMutation","mutationFn","ExportModal","_ref","filters","dashboardKind","holdableIds","sortProperties","isExportModalOpen","setIsExportModalOpen","_useTranslation","useTranslation","t","_useState","useState","_useState2","_slicedToArray","downloadUrl","setDownloadUrl","_useState3","_useState4","isGenerating","setIsGenerating","_getQueryParams","getQueryParams","_getQueryParams$tab","tab","_useExportsData","exportsData","mutate","token","useMemo","uuidV4","receivedCallback","data","download_url","useEffect","channel","exportChannel","disconnected","undefined","onClose","handleExport","mergeLeft","dashboard","camelToSnakeCase","_jsxs","Modal","isOpen","children","_jsx","Header","Typography","style","Body","isPresent","Footer","className","Button","href","icon","Download","label","onClick","_Fragment","disabled","loading"],"mappings":";;;;;;;;;;;;;;;;;;AAIA,IAAMA,MAAM,GAAG,SAATA,MAAMA,CAAGC,OAAO,EAAA;AAAA,EAAA,OACpBC,KAAK,CAACC,IAAI,IAAAC,MAAA,CACLC,kBAAQ,EACX,iBAAA,CAAA,EAAA;IAAE,QAAQJ,EAAAA;AAAQ,GAAC,EACnB;AAAEK,IAAAA,UAAU,EAAE;AAAM,GACtB,CAAC;AAAA,CAAA;AAEH,IAAMC,UAAU,GAAG;AAAEP,EAAAA,MAAM,EAANA;AAAO,CAAC;;ACPtB,IAAMQ,cAAc,GAAG,SAAjBA,cAAcA,GAAA;AAAA,EAAA,OACzBC,sBAAW,CAAC;IAAEC,UAAU,EAAEH,UAAU,CAACP;AAAO,GAAC,CAAC;AAAA,CAAA;;ACQhD,IAAMW,WAAW,GAAG,SAAdA,WAAWA,CAAAC,IAAA,EAOX;AAAA,EAAA,IANJC,OAAO,GAAAD,IAAA,CAAPC,OAAO;IACPC,aAAa,GAAAF,IAAA,CAAbE,aAAa;IACbC,WA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KAAK,EAAElD,CAAC,CAAC,6BAA6B,CAAE;AACxCsD,UAAAA,OAAO,EAAE7C,YAAa;AACtB0C,UAAAA,OAAO,EAAErB;AAAa,SACvB,CAAC;OACF;AACH,KACW,CAAC;AAAA,GACV,CAAC;AAEZ;;;;"}
1
+ {"version":3,"file":"ExportModal-DHYiDlh7.js","sources":["../../app/javascript/src/apis/exports.js","../../app/javascript/src/hooks/reactQuery/useExportsApi.js","../../app/javascript/src/components/Common/ExportModal.jsx"],"sourcesContent":["import axios from \"axios\";\n\nimport { BASE_URL } from \"src/constants\";\n\nconst create = payload =>\n axios.post(\n `${BASE_URL}/api/v1/exports`,\n { export: payload },\n { showToastr: false }\n );\n\nconst exportsApi = { create };\n\nexport default exportsApi;\n","import { useMutation } from \"@tanstack/react-query\";\n\nimport exportsApi from \"apis/exports\";\n\nexport const useExportsData = () =>\n useMutation({ mutationFn: exportsApi.create });\n","import { useEffect, useMemo, useState } from \"react\";\n\nimport { isPresent, camelToSnakeCase } from \"neetocist\";\nimport { getQueryParams } from \"neetocommons/utils\";\nimport { Download } from \"neetoicons\";\nimport { Button, Modal, Typography } from \"neetoui\";\nimport { mergeLeft } from \"ramda\";\nimport { useTranslation } from \"react-i18next\";\n\nimport { useExportsData } from \"hooks/reactQuery/useExportsApi\";\nimport exportChannel from \"src/channels/exportChannel\";\nimport { uuidV4 } from \"utils\";\n\nconst ExportModal = ({\n filters,\n dashboardKind,\n holdableIds,\n sortProperties,\n isExportModalOpen,\n setIsExportModalOpen,\n}) => {\n const { t } = useTranslation();\n const [downloadUrl, setDownloadUrl] = useState(\"\");\n const [isGenerating, setIsGenerating] = useState(false);\n\n const { tab = \"all\" } = getQueryParams();\n\n const { mutate: exportsData } = useExportsData();\n\n const token = useMemo(\n () => `${dashboardKind}-report-${uuidV4()}`,\n [dashboardKind]\n );\n\n const receivedCallback = data => {\n if (!data.download_url) return;\n setDownloadUrl(data.download_url);\n setIsGenerating(false);\n };\n\n useEffect(() => {\n if (isExportModalOpen) {\n const channel = exportChannel(token, receivedCallback);\n setDownloadUrl(\"\");\n setIsGenerating(false);\n\n return () => {\n channel.disconnected();\n };\n }\n\n return undefined;\n }, [isExportModalOpen, token]);\n\n const onClose = () => setIsExportModalOpen(false);\n\n const handleExport = () => {\n setDownloadUrl(\"\");\n setIsGenerating(true);\n const payload = mergeLeft(sortProperties, {\n token,\n filters,\n tab,\n holdableIds,\n dashboard: camelToSnakeCase(dashboardKind),\n });\n\n exportsData(payload);\n };\n\n return (\n <Modal {...{ onClose }} isOpen={isExportModalOpen}>\n <Modal.Header>\n <Typography style=\"h2\">\n {t(`neetoPayments.export.title.${dashboardKind}`)}\n </Typography>\n </Modal.Header>\n <Modal.Body>\n {isGenerating ? (\n <Typography style=\"body2\">\n {t(\"neetoPayments.export.pleaseWait\")}\n </Typography>\n ) : (\n <Typography style=\"body2\">\n {isPresent(downloadUrl)\n ? t(\"neetoPayments.export.fileReady\")\n : t(`neetoPayments.export.download.${dashboardKind}`)}\n </Typography>\n )}\n </Modal.Body>\n <Modal.Footer className=\"space-x-2\">\n {isPresent(downloadUrl) ? (\n <Button\n href={downloadUrl}\n icon={Download}\n label={t(\"neetoPayments.common.download\")}\n onClick={onClose}\n />\n ) : (\n <>\n <Button\n disabled={isGenerating}\n label={t(\"neetoPayments.common.cancel\")}\n style=\"tertiary\"\n onClick={onClose}\n />\n <Button\n disabled={isGenerating}\n label={t(\"neetoPayments.common.export\")}\n loading={isGenerating}\n onClick={handleExport}\n />\n </>\n )}\n </Modal.Footer>\n </Modal>\n );\n};\n\nexport default ExportModal;\n"],"names":["create","payload","axios","post","concat","BASE_URL","showToastr","exportsApi","useExportsData","useMutation","mutationFn","ExportModal","_ref","filters","dashboardKind","holdableIds","sortProperties","isExportModalOpen","setIsExportModalOpen","_useTranslation","useTranslation","t","_useState","useState","_useState2","_slicedToArray","downloadUrl","setDownloadUrl","_useState3","_useState4","isGenerating","setIsGenerating","_getQueryParams","getQueryParams","_getQueryParams$tab","tab","_useExportsData","exportsData","mutate","token","useMemo","uuidV4","receivedCallback","data","download_url","useEffect","channel","exportChannel","disconnected","undefined","onClose","handleExport","mergeLeft","dashboard","camelToSnakeCase","_jsxs","Modal","isOpen","children","_jsx","Header","Typography","style","Body","isPresent","Footer","className","Button","href","icon","Download","label","onClick","_Fragment","disabled","loading"],"mappings":";;;;;;;;;;;;;;;;;;AAIA,IAAMA,MAAM,GAAG,SAATA,MAAMA,CAAGC,OAAO,EAAA;AAAA,EAAA,OACpBC,KAAK,CAACC,IAAI,IAAAC,MAAA,CACLC,kBAAQ,EACX,iBAAA,CAAA,EAAA;IAAE,QAAQJ,EAAAA;AAAQ,GAAC,EACnB;AAAEK,IAAAA,UAAU,EAAE;AAAM,GACtB,CAAC;AAAA,CAAA;AAEH,IAAMC,UAAU,GAAG;AAAEP,EAAAA,MAAM,EAANA;AAAO,CAAC;;ACPtB,IAAMQ,cAAc,GAAG,SAAjBA,cAAcA,GAAA;AAAA,EAAA,OACzBC,sBAAW,CAAC;IAAEC,UAAU,EAAEH,UAAU,CAACP;AAAO,GAAC,CAAC;AAAA,CAAA;;ACQhD,IAAMW,WAAW,GAAG,SAAdA,WAAWA,CAAAC,IAAA,EAOX;AAAA,EAAA,IANJC,OAAO,GAAAD,IAAA,CAAPC,OAAO;IACPC,aAAa,GAAAF,IAAA,CAAbE,aAAa;IACbC,WAAW,GAAAH,IAAA,CAAXG,WAAW;IACXC,cAAc,GAAAJ,IAAA,CAAdI,cAAc;IACdC,iBAAiB,GAAAL,IAAA,CAAjBK,iBAAiB;IACjBC,oBAAoB,GAAAN,IAAA,CAApBM,oBAAoB;AAEpB,EAAA,IAAAC,eAAA,GAAcC,2BAAc,EAAE;IAAtBC,CAAC,GAAAF,eAAA,CAADE,CAAC;AACT,EAAA,IAAAC,SAAA,GAAsCC,cAAQ,CAAC,EAAE,CAAC;IAAAC,UAAA,GAAAC,cAAA,CAAAH,SAAA,EAAA,CAAA,CAAA;AAA3CI,IAAAA,WAAW,GAAA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AAO;AAAAJ,QAAAA,QAAA,EACtBM,mBAAS,CAACtC,WAAW,CAAC,GACnBL,CAAC,CAAC,gCAAgC,CAAC,GACnCA,CAAC,CAAA,gCAAA,CAAAjB,MAAA,CAAkCU,aAAa,CAAE;OAC5C;AACb,KACS,CAAC,eACb6C,cAAA,CAACH,KAAK,CAACS,MAAM,EAAA;AAACC,MAAAA,SAAS,EAAC,WAAW;MAAAR,QAAA,EAChCM,mBAAS,CAACtC,WAAW,CAAC,gBACrBiC,cAAA,CAACQ,MAAM,EAAA;AACLC,QAAAA,IAAI,EAAE1C,WAAY;AAClB2C,QAAAA,IAAI,EAAEC,QAAS;AACfC,QAAAA,KAAK,EAAElD,CAAC,CAAC,+BAA+B,CAAE;AAC1CmD,QAAAA,OAAO,EAAEtB;AAAQ,OAClB,CAAC,gBAEFK,eAAA,CAAAkB,mBAAA,EAAA;QAAAf,QAAA,EAAA,cACEC,cAAA,CAACQ,MAAM,EAAA;AACLO,UAAAA,QAAQ,EAAE5C,YAAa;AACvByC,UAAAA,KAAK,EAAElD,CAAC,CAAC,6BAA6B,CAAE;AACxCyC,UAAAA,KAAK,EAAC,UAAU;AAChBU,UAAAA,OAAO,EAAEtB;AAAQ,SAClB,CAAC,eACFS,cAAA,CAACQ,MAAM,EAAA;AACLO,UAAAA,QAAQ,EAAE5C,YAAa;AACvByC,UAAAA,KAAK,EAAElD,CAAC,CAAC,6BAA6B,CAAE;AACxCsD,UAAAA,OAAO,EAAE7C,YAAa;AACtB0C,UAAAA,OAAO,EAAErB;AAAa,SACvB,CAAC;OACF;AACH,KACW,CAAC;AAAA,GACV,CAAC;AAEZ;;;;"}
@@ -16,7 +16,7 @@ var _toConsumableArray = require('@babel/runtime/helpers/toConsumableArray');
16
16
  var _defineProperty = require('@babel/runtime/helpers/defineProperty');
17
17
  var reactUtils = require('@bigbinary/neeto-commons-frontend/react-utils');
18
18
  var axios = require('axios');
19
- var constants = require('./index-CtTWebii.js');
19
+ var constants = require('./index-BXQqCPIU.js');
20
20
  var i18next = require('i18next');
21
21
  var yup = require('yup');
22
22
  var jsxRuntime = require('react/jsx-runtime');