@bigbinary/neeto-payments-frontend 6.1.12 → 6.1.13
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.
- package/dist/AccountsDashboard.js +308 -333
- package/dist/AccountsDashboard.js.map +1 -1
- package/dist/AdminCancelRecurringPaymentButton.js +43 -54
- package/dist/AdminCancelRecurringPaymentButton.js.map +1 -1
- package/dist/CashPaymentButton.js +32 -34
- package/dist/CashPaymentButton.js.map +1 -1
- package/dist/ConfirmCashPaymentButton.js +77 -71
- package/dist/ConfirmCashPaymentButton.js.map +1 -1
- package/dist/{CopyButtonWrapper-rv-OaINx.js → CopyButtonWrapper-Bp5IVO76.js} +16 -14
- package/dist/CopyButtonWrapper-Bp5IVO76.js.map +1 -0
- package/dist/CustomerCancelRecurringPaymentForm.js +76 -75
- package/dist/CustomerCancelRecurringPaymentForm.js.map +1 -1
- package/dist/ExportModal-DyRGg_4o.js +120 -0
- package/dist/ExportModal-DyRGg_4o.js.map +1 -0
- package/dist/ManualUpiConnect.js +159 -178
- package/dist/ManualUpiConnect.js.map +1 -1
- package/dist/ManualUpiPayment.js +85 -89
- package/dist/ManualUpiPayment.js.map +1 -1
- package/dist/ManualUpiPaymentConfirmButton.js +119 -115
- package/dist/ManualUpiPaymentConfirmButton.js.map +1 -1
- package/dist/ManualUpiPaymentRejectButton.js +98 -92
- package/dist/ManualUpiPaymentRejectButton.js.map +1 -1
- package/dist/PaymentKindRestrictionAlert.js +14 -19
- package/dist/PaymentKindRestrictionAlert.js.map +1 -1
- package/dist/PaymentsDashboard.js +318 -349
- package/dist/PaymentsDashboard.js.map +1 -1
- package/dist/PayoutsDashboard.js +327 -350
- package/dist/PayoutsDashboard.js.map +1 -1
- package/dist/PayoutsPage.js +114 -92
- package/dist/PayoutsPage.js.map +1 -1
- package/dist/RazorpayConnect.js +71 -62
- package/dist/RazorpayConnect.js.map +1 -1
- package/dist/RazorpayLinkedAccountForm.js +145 -156
- package/dist/RazorpayLinkedAccountForm.js.map +1 -1
- package/dist/RazorpayPaymentButton.js +72 -100
- package/dist/RazorpayPaymentButton.js.map +1 -1
- package/dist/RecurringPaymentSettings.js +85 -85
- package/dist/RecurringPaymentSettings.js.map +1 -1
- package/dist/RefundsDashboard.js +363 -386
- package/dist/RefundsDashboard.js.map +1 -1
- package/dist/SplitTransfersDashboard.js +868 -829
- package/dist/SplitTransfersDashboard.js.map +1 -1
- package/dist/StripeCheckoutSetting.js +63 -75
- package/dist/StripeCheckoutSetting.js.map +1 -1
- package/dist/StripeConnect.js +257 -259
- package/dist/StripeConnect.js.map +1 -1
- package/dist/StripeManage.js +28 -25
- package/dist/StripeManage.js.map +1 -1
- package/dist/TaxesDashboard.js +284 -292
- package/dist/TaxesDashboard.js.map +1 -1
- package/dist/buildStripeTransactionLink.js +1 -1
- package/dist/cjs/AccountsDashboard.js +308 -333
- package/dist/cjs/AccountsDashboard.js.map +1 -1
- package/dist/cjs/AdminCancelRecurringPaymentButton.js +43 -54
- package/dist/cjs/AdminCancelRecurringPaymentButton.js.map +1 -1
- package/dist/cjs/CashPaymentButton.js +32 -34
- package/dist/cjs/CashPaymentButton.js.map +1 -1
- package/dist/cjs/ConfirmCashPaymentButton.js +77 -71
- package/dist/cjs/ConfirmCashPaymentButton.js.map +1 -1
- package/dist/cjs/{CopyButtonWrapper-BkpN0Wmd.js → CopyButtonWrapper-I-kdKiiB.js} +16 -14
- package/dist/cjs/CopyButtonWrapper-I-kdKiiB.js.map +1 -0
- package/dist/cjs/CustomerCancelRecurringPaymentForm.js +76 -75
- package/dist/cjs/CustomerCancelRecurringPaymentForm.js.map +1 -1
- package/dist/cjs/ExportModal-DE-VcN1X.js +122 -0
- package/dist/cjs/ExportModal-DE-VcN1X.js.map +1 -0
- package/dist/cjs/ManualUpiConnect.js +159 -178
- package/dist/cjs/ManualUpiConnect.js.map +1 -1
- package/dist/cjs/ManualUpiPayment.js +85 -89
- package/dist/cjs/ManualUpiPayment.js.map +1 -1
- package/dist/cjs/ManualUpiPaymentConfirmButton.js +118 -114
- package/dist/cjs/ManualUpiPaymentConfirmButton.js.map +1 -1
- package/dist/cjs/ManualUpiPaymentRejectButton.js +98 -92
- package/dist/cjs/ManualUpiPaymentRejectButton.js.map +1 -1
- package/dist/cjs/PaymentKindRestrictionAlert.js +14 -19
- package/dist/cjs/PaymentKindRestrictionAlert.js.map +1 -1
- package/dist/cjs/PaymentsDashboard.js +318 -349
- package/dist/cjs/PaymentsDashboard.js.map +1 -1
- package/dist/cjs/PayoutsDashboard.js +327 -350
- package/dist/cjs/PayoutsDashboard.js.map +1 -1
- package/dist/cjs/PayoutsPage.js +114 -92
- package/dist/cjs/PayoutsPage.js.map +1 -1
- package/dist/cjs/RazorpayConnect.js +71 -62
- package/dist/cjs/RazorpayConnect.js.map +1 -1
- package/dist/cjs/RazorpayLinkedAccountForm.js +145 -156
- package/dist/cjs/RazorpayLinkedAccountForm.js.map +1 -1
- package/dist/cjs/RazorpayPaymentButton.js +72 -100
- package/dist/cjs/RazorpayPaymentButton.js.map +1 -1
- package/dist/cjs/RecurringPaymentSettings.js +85 -85
- package/dist/cjs/RecurringPaymentSettings.js.map +1 -1
- package/dist/cjs/RefundsDashboard.js +363 -386
- package/dist/cjs/RefundsDashboard.js.map +1 -1
- package/dist/cjs/SplitTransfersDashboard.js +867 -828
- package/dist/cjs/SplitTransfersDashboard.js.map +1 -1
- package/dist/cjs/StripeCheckoutSetting.js +63 -75
- package/dist/cjs/StripeCheckoutSetting.js.map +1 -1
- package/dist/cjs/StripeConnect.js +257 -259
- package/dist/cjs/StripeConnect.js.map +1 -1
- package/dist/cjs/StripeManage.js +28 -25
- package/dist/cjs/StripeManage.js.map +1 -1
- package/dist/cjs/TaxesDashboard.js +284 -292
- package/dist/cjs/TaxesDashboard.js.map +1 -1
- package/dist/cjs/buildStripeTransactionLink.js +1 -1
- package/dist/cjs/constants.js +1 -1
- package/dist/cjs/dashboard-BiCB2A6S.js +96 -0
- package/dist/cjs/dashboard-BiCB2A6S.js.map +1 -0
- package/dist/cjs/{exportChannel-D1Wls92m.js → exportChannel-BL2RGGhP.js} +16 -18
- package/dist/cjs/{exportChannel-D1Wls92m.js.map → exportChannel-BL2RGGhP.js.map} +1 -1
- package/dist/cjs/getAddressElementOptions.js +1 -1
- package/dist/cjs/getAmountInLargestCurrencyUnit.js +1 -1
- package/dist/cjs/getAmountInSmallestCurrencyUnit.js +1 -1
- package/dist/cjs/getAmountWithAppliedTax.js +1 -1
- package/dist/cjs/getFormattedAmount.js +1 -1
- package/dist/cjs/getFormattedDiscountedAmount.js +1 -1
- package/dist/cjs/getFormattedDiscountedPercentage.js +1 -1
- package/dist/cjs/getFormattedTaxAmount.js +1 -1
- package/dist/cjs/getFormattedTipAmount.js +1 -1
- package/dist/cjs/getQrCodeValue.js +1 -1
- package/dist/cjs/getTaxAmount.js +1 -1
- package/dist/cjs/getTipAmount.js +1 -1
- package/dist/cjs/hasAmountToPay.js +1 -1
- package/dist/cjs/index-D6V3Vofs.js +855 -0
- package/dist/cjs/{index-CZ_VFGNj.js.map → index-D6V3Vofs.js.map} +1 -1
- package/dist/cjs/index.js +14 -20
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/{queryConstants-Cka1X6GX.js → queryConstants-Dc6wh21D.js} +2 -2
- package/dist/cjs/{queryConstants-Cka1X6GX.js.map → queryConstants-Dc6wh21D.js.map} +1 -1
- package/dist/cjs/renderFunctions-DhCwlBWw.js +48 -0
- package/dist/cjs/renderFunctions-DhCwlBWw.js.map +1 -0
- package/dist/cjs/useAccountsApi-B2MZWHMY.js +42 -0
- package/dist/cjs/useAccountsApi-B2MZWHMY.js.map +1 -0
- package/dist/cjs/useIntegrationsApi-CVlTmLKc.js +20 -0
- package/dist/cjs/{useIntegrationsApi-BO9PhVVO.js.map → useIntegrationsApi-CVlTmLKc.js.map} +1 -1
- package/dist/cjs/usePaymentApi-BCE_Ql18.js +29 -0
- package/dist/cjs/usePaymentApi-BCE_Ql18.js.map +1 -0
- package/dist/cjs/usePaymentApi-Bl8jWvnG.js +44 -0
- package/dist/cjs/usePaymentApi-Bl8jWvnG.js.map +1 -0
- package/dist/cjs/usePaymentApi-CiwXBe90.js +29 -0
- package/dist/cjs/{usePaymentApi-BE8xfY-U.js.map → usePaymentApi-CiwXBe90.js.map} +1 -1
- package/dist/cjs/usePlatformApi-CcGVG4Qi.js +55 -0
- package/dist/cjs/{usePlatformApi-C7lXP6ev.js.map → usePlatformApi-CcGVG4Qi.js.map} +1 -1
- package/dist/cjs/useRazorpayPayment.js +48 -73
- package/dist/cjs/useRazorpayPayment.js.map +1 -1
- package/dist/cjs/useStripePromise.js +22 -48
- package/dist/cjs/useStripePromise.js.map +1 -1
- package/dist/constants.js +1 -1
- package/dist/dashboard-CwvqEeOl.js +90 -0
- package/dist/dashboard-CwvqEeOl.js.map +1 -0
- package/dist/{exportChannel-DAxJ44QB.js → exportChannel-Db0U5gc1.js} +16 -18
- package/dist/{exportChannel-DAxJ44QB.js.map → exportChannel-Db0U5gc1.js.map} +1 -1
- package/dist/getAddressElementOptions.js +1 -1
- package/dist/getAmountInLargestCurrencyUnit.js +1 -1
- package/dist/getAmountInSmallestCurrencyUnit.js +1 -1
- package/dist/getAmountWithAppliedTax.js +1 -1
- package/dist/getFormattedAmount.js +1 -1
- package/dist/getFormattedDiscountedAmount.js +1 -1
- package/dist/getFormattedDiscountedPercentage.js +1 -1
- package/dist/getFormattedTaxAmount.js +1 -1
- package/dist/getFormattedTipAmount.js +1 -1
- package/dist/getQrCodeValue.js +1 -1
- package/dist/getTaxAmount.js +1 -1
- package/dist/getTipAmount.js +1 -1
- package/dist/hasAmountToPay.js +1 -1
- package/dist/index-CNouM9_z.js +804 -0
- package/dist/{index-C7irWceQ.js.map → index-CNouM9_z.js.map} +1 -1
- package/dist/index.js +14 -20
- package/dist/index.js.map +1 -1
- package/dist/{queryConstants-DFKKEEo0.js → queryConstants-C7AqdemO.js} +2 -2
- package/dist/{queryConstants-DFKKEEo0.js.map → queryConstants-C7AqdemO.js.map} +1 -1
- package/dist/renderFunctions-Bx5nzyE_.js +44 -0
- package/dist/renderFunctions-Bx5nzyE_.js.map +1 -0
- package/dist/useAccountsApi-C9_eNmEZ.js +38 -0
- package/dist/useAccountsApi-C9_eNmEZ.js.map +1 -0
- package/dist/useIntegrationsApi-D9eA_FrB.js +18 -0
- package/dist/{useIntegrationsApi-D1bkKtoy.js.map → useIntegrationsApi-D9eA_FrB.js.map} +1 -1
- package/dist/usePaymentApi-B98qoM7U.js +26 -0
- package/dist/usePaymentApi-B98qoM7U.js.map +1 -0
- package/dist/usePaymentApi-DMHHdCK1.js +41 -0
- package/dist/usePaymentApi-DMHHdCK1.js.map +1 -0
- package/dist/usePaymentApi-DSlW_EBq.js +27 -0
- package/dist/{usePaymentApi-DcMNbOMk.js.map → usePaymentApi-DSlW_EBq.js.map} +1 -1
- package/dist/usePlatformApi-sJUY6wju.js +50 -0
- package/dist/{usePlatformApi-Di7Dg-Gn.js.map → usePlatformApi-sJUY6wju.js.map} +1 -1
- package/dist/useRazorpayPayment.js +48 -73
- package/dist/useRazorpayPayment.js.map +1 -1
- package/dist/useStripePromise.js +22 -48
- package/dist/useStripePromise.js.map +1 -1
- package/package.json +1 -1
- package/dist/CopyButtonWrapper-rv-OaINx.js.map +0 -1
- package/dist/ExportModal-CxKyrlwf.js +0 -120
- package/dist/ExportModal-CxKyrlwf.js.map +0 -1
- package/dist/cjs/CopyButtonWrapper-BkpN0Wmd.js.map +0 -1
- package/dist/cjs/ExportModal-DxCzPCh0.js +0 -122
- package/dist/cjs/ExportModal-DxCzPCh0.js.map +0 -1
- package/dist/cjs/dashboard-DKHencVn.js +0 -110
- package/dist/cjs/dashboard-DKHencVn.js.map +0 -1
- package/dist/cjs/index-CZ_VFGNj.js +0 -899
- package/dist/cjs/renderFunctions-CX_K4qf8.js +0 -51
- package/dist/cjs/renderFunctions-CX_K4qf8.js.map +0 -1
- package/dist/cjs/useAccountsApi-DC617yB4.js +0 -62
- package/dist/cjs/useAccountsApi-DC617yB4.js.map +0 -1
- package/dist/cjs/useIntegrationsApi-BO9PhVVO.js +0 -26
- package/dist/cjs/usePaymentApi-BE8xfY-U.js +0 -39
- package/dist/cjs/usePaymentApi-C9aQhuda.js +0 -56
- package/dist/cjs/usePaymentApi-C9aQhuda.js.map +0 -1
- package/dist/cjs/usePaymentApi-CrKom4eT.js +0 -41
- package/dist/cjs/usePaymentApi-CrKom4eT.js.map +0 -1
- package/dist/cjs/usePlatformApi-C7lXP6ev.js +0 -84
- package/dist/dashboard-ClEN2ygs.js +0 -104
- package/dist/dashboard-ClEN2ygs.js.map +0 -1
- package/dist/index-C7irWceQ.js +0 -848
- package/dist/renderFunctions-D9sAy3V_.js +0 -47
- package/dist/renderFunctions-D9sAy3V_.js.map +0 -1
- package/dist/useAccountsApi-DPem_UA-.js +0 -58
- package/dist/useAccountsApi-DPem_UA-.js.map +0 -1
- package/dist/useIntegrationsApi-D1bkKtoy.js +0 -24
- package/dist/usePaymentApi-BV0jXF-6.js +0 -38
- package/dist/usePaymentApi-BV0jXF-6.js.map +0 -1
- package/dist/usePaymentApi-DHARy-kC.js +0 -53
- package/dist/usePaymentApi-DHARy-kC.js.map +0 -1
- package/dist/usePaymentApi-DcMNbOMk.js +0 -37
- package/dist/usePlatformApi-Di7Dg-Gn.js +0 -79
|
@@ -1,122 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var _slicedToArray = require('@babel/runtime/helpers/slicedToArray');
|
|
4
|
-
var react = require('react');
|
|
5
|
-
var neetocist = require('neetocist');
|
|
6
|
-
var neetoIcons = require('@bigbinary/neeto-icons');
|
|
7
|
-
var ramda = require('ramda');
|
|
8
|
-
var reactI18next = require('react-i18next');
|
|
9
|
-
var reactQuery = require('@tanstack/react-query');
|
|
10
|
-
var axios = require('axios');
|
|
11
|
-
var constants = require('./index-CZ_VFGNj.js');
|
|
12
|
-
var utils = require('neetocommons/utils');
|
|
13
|
-
var neetoui = require('@bigbinary/neetoui');
|
|
14
|
-
var exportChannel = require('./exportChannel-D1Wls92m.js');
|
|
15
|
-
|
|
16
|
-
var create = function create(payload) {
|
|
17
|
-
return axios.post("".concat(constants.BASE_URL, "/api/v1/exports"), {
|
|
18
|
-
"export": payload
|
|
19
|
-
}, {
|
|
20
|
-
showToastr: false
|
|
21
|
-
});
|
|
22
|
-
};
|
|
23
|
-
var exportsApi = {
|
|
24
|
-
create: create
|
|
25
|
-
};
|
|
26
|
-
|
|
27
|
-
var useExportsData = function useExportsData() {
|
|
28
|
-
return reactQuery.useMutation({
|
|
29
|
-
mutationFn: exportsApi.create
|
|
30
|
-
});
|
|
31
|
-
};
|
|
32
|
-
|
|
33
|
-
var ExportModal = function ExportModal(_ref) {
|
|
34
|
-
var filters = _ref.filters,
|
|
35
|
-
dashboardKind = _ref.dashboardKind,
|
|
36
|
-
holdableIds = _ref.holdableIds,
|
|
37
|
-
sortProperties = _ref.sortProperties,
|
|
38
|
-
isExportModalOpen = _ref.isExportModalOpen,
|
|
39
|
-
setIsExportModalOpen = _ref.setIsExportModalOpen;
|
|
40
|
-
var _useTranslation = reactI18next.useTranslation(),
|
|
41
|
-
t = _useTranslation.t;
|
|
42
|
-
var _useState = react.useState(""),
|
|
43
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
44
|
-
downloadUrl = _useState2[0],
|
|
45
|
-
setDownloadUrl = _useState2[1];
|
|
46
|
-
var _useState3 = react.useState(false),
|
|
47
|
-
_useState4 = _slicedToArray(_useState3, 2),
|
|
48
|
-
isGenerating = _useState4[0],
|
|
49
|
-
setIsGenerating = _useState4[1];
|
|
50
|
-
var _getQueryParams = utils.getQueryParams(),
|
|
51
|
-
_getQueryParams$tab = _getQueryParams.tab,
|
|
52
|
-
tab = _getQueryParams$tab === void 0 ? "all" : _getQueryParams$tab;
|
|
53
|
-
var _useExportsData = useExportsData(),
|
|
54
|
-
exportsData = _useExportsData.mutate;
|
|
55
|
-
var token = react.useMemo(function () {
|
|
56
|
-
return "".concat(dashboardKind, "-report-").concat(constants.uuidV4());
|
|
57
|
-
}, [dashboardKind]);
|
|
58
|
-
var receivedCallback = function receivedCallback(data) {
|
|
59
|
-
if (!data.download_url) return;
|
|
60
|
-
setDownloadUrl(data.download_url);
|
|
61
|
-
setIsGenerating(false);
|
|
62
|
-
};
|
|
63
|
-
react.useEffect(function () {
|
|
64
|
-
if (isExportModalOpen) {
|
|
65
|
-
var channel = exportChannel.exportChannel(token, receivedCallback);
|
|
66
|
-
setDownloadUrl("");
|
|
67
|
-
setIsGenerating(false);
|
|
68
|
-
return function () {
|
|
69
|
-
channel.disconnected();
|
|
70
|
-
};
|
|
71
|
-
}
|
|
72
|
-
return undefined;
|
|
73
|
-
}, [isExportModalOpen, token]);
|
|
74
|
-
var onClose = function onClose() {
|
|
75
|
-
return setIsExportModalOpen(false);
|
|
76
|
-
};
|
|
77
|
-
var handleExport = function handleExport() {
|
|
78
|
-
setDownloadUrl("");
|
|
79
|
-
setIsGenerating(true);
|
|
80
|
-
var payload = ramda.mergeLeft(sortProperties, {
|
|
81
|
-
token: token,
|
|
82
|
-
filters: filters,
|
|
83
|
-
tab: tab,
|
|
84
|
-
holdableIds: holdableIds,
|
|
85
|
-
dashboard: neetocist.camelToSnakeCase(dashboardKind)
|
|
86
|
-
});
|
|
87
|
-
exportsData(payload);
|
|
88
|
-
};
|
|
89
|
-
return /*#__PURE__*/React.createElement(neetoui.Modal, {
|
|
90
|
-
onClose: onClose,
|
|
91
|
-
isOpen: isExportModalOpen
|
|
92
|
-
}, /*#__PURE__*/React.createElement(neetoui.Modal.Header, null, /*#__PURE__*/React.createElement(neetoui.Typography, {
|
|
93
|
-
style: "h2"
|
|
94
|
-
}, t("neetoPayments.export.title.".concat(dashboardKind)))), /*#__PURE__*/React.createElement(neetoui.Modal.Body, null, isGenerating ? /*#__PURE__*/React.createElement(neetoui.Typography, {
|
|
95
|
-
style: "body2"
|
|
96
|
-
}, t("neetoPayments.export.pleaseWait")) : /*#__PURE__*/React.createElement(neetoui.Typography, {
|
|
97
|
-
style: "body2"
|
|
98
|
-
}, neetocist.isPresent(downloadUrl) ? t("neetoPayments.export.fileReady") : t("neetoPayments.export.download.".concat(dashboardKind)))), /*#__PURE__*/React.createElement(neetoui.Modal.Footer, {
|
|
99
|
-
className: "space-x-2"
|
|
100
|
-
}, neetocist.isPresent(downloadUrl) ? /*#__PURE__*/React.createElement(neetoui.Button, {
|
|
101
|
-
"data-testid": "neeto-payments-download-button",
|
|
102
|
-
href: downloadUrl,
|
|
103
|
-
icon: neetoIcons.Download,
|
|
104
|
-
label: t("neetoPayments.common.download"),
|
|
105
|
-
onClick: onClose
|
|
106
|
-
}) : /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(neetoui.Button, {
|
|
107
|
-
"data-testid": "cancel-button",
|
|
108
|
-
disabled: isGenerating,
|
|
109
|
-
label: t("neetoPayments.common.cancel"),
|
|
110
|
-
style: "tertiary",
|
|
111
|
-
onClick: onClose
|
|
112
|
-
}), /*#__PURE__*/React.createElement(neetoui.Button, {
|
|
113
|
-
"data-testid": "neeto-payments-export-button",
|
|
114
|
-
disabled: isGenerating,
|
|
115
|
-
label: t("neetoPayments.common.export"),
|
|
116
|
-
loading: isGenerating,
|
|
117
|
-
onClick: handleExport
|
|
118
|
-
}))));
|
|
119
|
-
};
|
|
120
|
-
|
|
121
|
-
exports.ExportModal = ExportModal;
|
|
122
|
-
//# sourceMappingURL=ExportModal-DxCzPCh0.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ExportModal-DxCzPCh0.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 { Download } from \"neetoicons\";\nimport { mergeLeft } from \"ramda\";\nimport { useTranslation } from \"react-i18next\";\n\nimport { useExportsData } from \"hooks/reactQuery/useExportsApi\";\nimport { getQueryParams } from \"neetocommons/utils\";\nimport { Button, Modal, Typography } from \"neetoui\";\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 data-testid=\"neeto-payments-download-button\"\n href={downloadUrl}\n icon={Download}\n label={t(\"neetoPayments.common.download\")}\n onClick={onClose}\n />\n ) : (\n <>\n <Button\n data-testid=\"cancel-button\"\n disabled={isGenerating}\n label={t(\"neetoPayments.common.cancel\")}\n style=\"tertiary\"\n onClick={onClose}\n />\n <Button\n data-testid=\"neeto-payments-export-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","React","createElement","Modal","isOpen","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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C,WAAY;AAClB0C,IAAAA,IAAI,EAAEC,mBAAS;AACfC,IAAAA,KAAK,EAAEjD,CAAC,CAAC,+BAA+B,CAAE;AAC1CkD,IAAAA,OAAO,EAAErB;AAAQ,GAClB,CAAC,gBAEFK,KAAA,CAAAC,aAAA,CAAAD,KAAA,CAAAiB,QAAA,EACEjB,IAAAA,eAAAA,KAAA,CAAAC,aAAA,CAACU,cAAM,EAAA;AACL,IAAA,aAAA,EAAY,eAAe;AAC3BO,IAAAA,QAAQ,EAAE3C,YAAa;AACvBwC,IAAAA,KAAK,EAAEjD,CAAC,CAAC,6BAA6B,CAAE;AACxCwC,IAAAA,KAAK,EAAC,UAAU;AAChBU,IAAAA,OAAO,EAAErB;AAAQ,GAClB,CAAC,eACFK,KAAA,CAAAC,aAAA,CAACU,cAAM,EAAA;AACL,IAAA,aAAA,EAAY,8BAA8B;AAC1CO,IAAAA,QAAQ,EAAE3C,YAAa;AACvBwC,IAAAA,KAAK,EAAEjD,CAAC,CAAC,6BAA6B,CAAE;AACxCqD,IAAAA,OAAO,EAAE5C,YAAa;AACtByC,IAAAA,OAAO,EAAEpB;GACV,CACD,CAEQ,CACT,CAAC;AAEZ;;;;"}
|
|
@@ -1,110 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var reactQuery = require('@tanstack/react-query');
|
|
4
|
-
var reactQueryDevtools = require('@tanstack/react-query-devtools');
|
|
5
|
-
var constants = require('neetocommons/constants');
|
|
6
|
-
var axios = require('axios');
|
|
7
|
-
var constants$1 = require('./index-CZ_VFGNj.js');
|
|
8
|
-
var _defineProperty = require('@babel/runtime/helpers/defineProperty');
|
|
9
|
-
var neetocist = require('neetocist');
|
|
10
|
-
var ramda = require('ramda');
|
|
11
|
-
|
|
12
|
-
/* eslint-disable @bigbinary/neeto/api-connector-name-should-match-filename */
|
|
13
|
-
/* eslint-disable @bigbinary/neeto/file-name-and-export-name-standards */
|
|
14
|
-
var queryClient = new reactQuery.QueryClient({
|
|
15
|
-
queryCache: new reactQuery.QueryCache(),
|
|
16
|
-
defaultOptions: {
|
|
17
|
-
queries: {
|
|
18
|
-
staleTime: constants.DEFAULT_STALE_TIME,
|
|
19
|
-
placeholderData: reactQuery.keepPreviousData
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
});
|
|
23
|
-
|
|
24
|
-
/* eslint-disable sonarjs/prefer-immediate-return */
|
|
25
|
-
/* eslint-disable @bigbinary/neeto/file-name-and-export-name-standards */
|
|
26
|
-
var withReactQuery = function withReactQuery(Component) {
|
|
27
|
-
var QueryWrapper = function QueryWrapper(props) {
|
|
28
|
-
return /*#__PURE__*/React.createElement(reactQuery.QueryClientProvider, {
|
|
29
|
-
client: queryClient
|
|
30
|
-
}, /*#__PURE__*/React.createElement(Component, props), /*#__PURE__*/React.createElement(reactQueryDevtools.ReactQueryDevtools, {
|
|
31
|
-
initialIsOpen: false,
|
|
32
|
-
position: "bottom"
|
|
33
|
-
}));
|
|
34
|
-
};
|
|
35
|
-
return QueryWrapper;
|
|
36
|
-
};
|
|
37
|
-
|
|
38
|
-
var exportData = function exportData(payload) {
|
|
39
|
-
return axios.post("".concat(constants$1.BASE_URL, "/api/v1/stripe/exports"), payload, {
|
|
40
|
-
showToastr: false
|
|
41
|
-
});
|
|
42
|
-
};
|
|
43
|
-
var exportsApi = {
|
|
44
|
-
exportData: exportData
|
|
45
|
-
};
|
|
46
|
-
|
|
47
|
-
var useExportData = function useExportData() {
|
|
48
|
-
return reactQuery.useMutation({
|
|
49
|
-
mutationFn: exportsApi.exportData
|
|
50
|
-
});
|
|
51
|
-
};
|
|
52
|
-
|
|
53
|
-
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
54
|
-
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
55
|
-
var processSortProperties = function processSortProperties(sortProperties) {
|
|
56
|
-
if (sortProperties.sortBy === "payment_amount") {
|
|
57
|
-
return ramda.assoc("sortBy", "neeto_payments_engine_payments.amount", sortProperties);
|
|
58
|
-
}
|
|
59
|
-
if (sortProperties.sortBy === "email" || sortProperties.sortBy === "first_name") {
|
|
60
|
-
return ramda.modify("sortBy", ramda.concat("users."), sortProperties);
|
|
61
|
-
}
|
|
62
|
-
if (sortProperties.sortBy === "payable,ends_at") {
|
|
63
|
-
return ramda.assoc("sortBy", "bookings.ends_at", sortProperties);
|
|
64
|
-
}
|
|
65
|
-
return sortProperties;
|
|
66
|
-
};
|
|
67
|
-
var buildDefaultPageProperties = function buildDefaultPageProperties(tabs) {
|
|
68
|
-
return tabs.reduce(function (pageProperties, tab) {
|
|
69
|
-
return _objectSpread(_objectSpread({}, pageProperties), {}, _defineProperty({}, tab, constants$1.DEFAULT_PAGE_VALUES));
|
|
70
|
-
}, {});
|
|
71
|
-
};
|
|
72
|
-
var buildPayload = function buildPayload(_ref) {
|
|
73
|
-
var _pageProperties$tab, _pageProperties$tab2;
|
|
74
|
-
var tab = _ref.tab,
|
|
75
|
-
filters = _ref.filters,
|
|
76
|
-
pageProperties = _ref.pageProperties,
|
|
77
|
-
_ref$sortProperties = _ref.sortProperties,
|
|
78
|
-
sortProperties = _ref$sortProperties === void 0 ? {} : _ref$sortProperties,
|
|
79
|
-
_ref$payoutId = _ref.payoutId,
|
|
80
|
-
payoutId = _ref$payoutId === void 0 ? null : _ref$payoutId;
|
|
81
|
-
return _objectSpread({
|
|
82
|
-
tab: neetocist.camelToSnakeCase(tab),
|
|
83
|
-
payoutId: payoutId,
|
|
84
|
-
page: (_pageProperties$tab = pageProperties[tab]) === null || _pageProperties$tab === void 0 ? void 0 : _pageProperties$tab.page,
|
|
85
|
-
pageSize: (_pageProperties$tab2 = pageProperties[tab]) === null || _pageProperties$tab2 === void 0 ? void 0 : _pageProperties$tab2.pageSize,
|
|
86
|
-
filters: filters
|
|
87
|
-
}, processSortProperties(sortProperties));
|
|
88
|
-
};
|
|
89
|
-
var buildRowData = function buildRowData(_ref2) {
|
|
90
|
-
var data = _ref2.data,
|
|
91
|
-
_ref2$pageProperties = _ref2.pageProperties,
|
|
92
|
-
pageProperties = _ref2$pageProperties === void 0 ? {} : _ref2$pageProperties,
|
|
93
|
-
_ref2$tab = _ref2.tab,
|
|
94
|
-
tab = _ref2$tab === void 0 ? "all" : _ref2$tab;
|
|
95
|
-
return data.map(function (element, index) {
|
|
96
|
-
var _pageProperties$tab3, _pageProperties$tab4;
|
|
97
|
-
return _objectSpread(_objectSpread({}, element), {}, {
|
|
98
|
-
payable: element.payable,
|
|
99
|
-
identifier: element,
|
|
100
|
-
id: ramda.isEmpty(pageProperties) ? index + 1 : ((_pageProperties$tab3 = pageProperties[tab]) === null || _pageProperties$tab3 === void 0 ? void 0 : _pageProperties$tab3.pageSize) * (((_pageProperties$tab4 = pageProperties[tab]) === null || _pageProperties$tab4 === void 0 ? void 0 : _pageProperties$tab4.page) - 1) + index + 1
|
|
101
|
-
});
|
|
102
|
-
});
|
|
103
|
-
};
|
|
104
|
-
|
|
105
|
-
exports.buildDefaultPageProperties = buildDefaultPageProperties;
|
|
106
|
-
exports.buildPayload = buildPayload;
|
|
107
|
-
exports.buildRowData = buildRowData;
|
|
108
|
-
exports.useExportData = useExportData;
|
|
109
|
-
exports.withReactQuery = withReactQuery;
|
|
110
|
-
//# sourceMappingURL=dashboard-DKHencVn.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"dashboard-DKHencVn.js","sources":["../../app/javascript/src/apis/queryClient.js","../../app/javascript/src/components/Common/withReactQuery.jsx","../../app/javascript/src/apis/stripe/holdables/exports.js","../../app/javascript/src/hooks/reactQuery/stripe/useExportsApi.js","../../app/javascript/src/utils/dashboard.js"],"sourcesContent":["/* eslint-disable @bigbinary/neeto/api-connector-name-should-match-filename */\n/* eslint-disable @bigbinary/neeto/file-name-and-export-name-standards */\nimport {\n QueryCache,\n QueryClient,\n keepPreviousData,\n} from \"@tanstack/react-query\";\nimport { DEFAULT_STALE_TIME } from \"neetocommons/constants\";\n\nconst queryClient = new QueryClient({\n queryCache: new QueryCache(),\n defaultOptions: {\n queries: {\n staleTime: DEFAULT_STALE_TIME,\n placeholderData: keepPreviousData,\n },\n },\n});\n\nexport default queryClient;\n","/* eslint-disable sonarjs/prefer-immediate-return */\n/* eslint-disable @bigbinary/neeto/file-name-and-export-name-standards */\nimport { QueryClientProvider } from \"@tanstack/react-query\";\nimport { ReactQueryDevtools } from \"@tanstack/react-query-devtools\";\n\nimport queryClient from \"apis/queryClient\";\n\nconst withReactQuery = Component => {\n const QueryWrapper = props => (\n <QueryClientProvider client={queryClient}>\n <Component {...props} />\n <ReactQueryDevtools initialIsOpen={false} position=\"bottom\" />\n </QueryClientProvider>\n );\n\n return QueryWrapper;\n};\n\nexport default withReactQuery;\n","import axios from \"axios\";\n\nimport { BASE_URL } from \"src/constants\";\n\nconst exportData = payload =>\n axios.post(`${BASE_URL}/api/v1/stripe/exports`, payload, {\n showToastr: false,\n });\n\nconst exportsApi = { exportData };\n\nexport default exportsApi;\n","import { useMutation } from \"@tanstack/react-query\";\n\nimport exportsApi from \"apis/stripe/holdables/exports\";\n\nconst useExportData = () => useMutation({ mutationFn: exportsApi.exportData });\n\nexport { useExportData };\n","import { camelToSnakeCase } from \"neetocist\";\nimport { assoc, concat, isEmpty, modify } from \"ramda\";\n\nimport { DEFAULT_PAGE_VALUES } from \"src/constants\";\n\nconst processSortProperties = sortProperties => {\n if (sortProperties.sortBy === \"payment_amount\") {\n return assoc(\n \"sortBy\",\n \"neeto_payments_engine_payments.amount\",\n sortProperties\n );\n }\n\n if (\n sortProperties.sortBy === \"email\" ||\n sortProperties.sortBy === \"first_name\"\n ) {\n return modify(\"sortBy\", concat(\"users.\"), sortProperties);\n }\n\n if (sortProperties.sortBy === \"payable,ends_at\") {\n return assoc(\"sortBy\", \"bookings.ends_at\", sortProperties);\n }\n\n return sortProperties;\n};\n\nexport const buildDefaultPageProperties = tabs =>\n tabs.reduce(\n (pageProperties, tab) => ({\n ...pageProperties,\n [tab]: DEFAULT_PAGE_VALUES,\n }),\n {}\n );\n\nexport const buildPayload = ({\n tab,\n filters,\n pageProperties,\n sortProperties = {},\n payoutId = null,\n}) => ({\n tab: camelToSnakeCase(tab),\n payoutId,\n page: pageProperties[tab]?.page,\n pageSize: pageProperties[tab]?.pageSize,\n filters,\n ...processSortProperties(sortProperties),\n});\n\nexport const buildRowData = ({ data, pageProperties = {}, tab = \"all\" }) =>\n data.map((element, index) => ({\n ...element,\n payable: element.payable,\n identifier: element,\n id: isEmpty(pageProperties)\n ? index + 1\n : pageProperties[tab]?.pageSize * (pageProperties[tab]?.page - 1) +\n index +\n 1,\n }));\n"],"names":["queryClient","QueryClient","queryCache","QueryCache","defaultOptions","queries","staleTime","DEFAULT_STALE_TIME","placeholderData","keepPreviousData","withReactQuery","Component","QueryWrapper","props","React","createElement","QueryClientProvider","client","ReactQueryDevtools","initialIsOpen","position","exportData","payload","axios","post","concat","BASE_URL","showToastr","exportsApi","useExportData","useMutation","mutationFn","processSortProperties","sortProperties","sortBy","assoc","modify","buildDefaultPageProperties","tabs","reduce","pageProperties","tab","_objectSpread","_defineProperty","DEFAULT_PAGE_VALUES","buildPayload","_ref","_pageProperties$tab","_pageProperties$tab2","filters","_ref$sortProperties","_ref$payoutId","payoutId","camelToSnakeCase","page","pageSize","buildRowData","_ref2","data","_ref2$pageProperties","_ref2$tab","map","element","index","_pageProperties$tab3","_pageProperties$tab4","payable","identifier","id","isEmpty"],"mappings":";;;;;;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