@bigbinary/neeto-payments-frontend 6.1.12 → 6.1.14
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-CoRuQVas.js +120 -0
- package/dist/ExportModal-CoRuQVas.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-ClKqp-oy.js +122 -0
- package/dist/cjs/ExportModal-ClKqp-oy.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-B1R6fLcS.js +96 -0
- package/dist/cjs/dashboard-B1R6fLcS.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-C3LUTqjR.js +855 -0
- package/dist/cjs/{index-CZ_VFGNj.js.map → index-C3LUTqjR.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-ghFUoYiM.js +48 -0
- package/dist/cjs/renderFunctions-ghFUoYiM.js.map +1 -0
- package/dist/cjs/useAccountsApi-Dw9yNiOj.js +42 -0
- package/dist/cjs/useAccountsApi-Dw9yNiOj.js.map +1 -0
- package/dist/cjs/useIntegrationsApi-B8JBENJ0.js +20 -0
- package/dist/cjs/{useIntegrationsApi-BO9PhVVO.js.map → useIntegrationsApi-B8JBENJ0.js.map} +1 -1
- package/dist/cjs/usePaymentApi-C034qyn4.js +29 -0
- package/dist/cjs/usePaymentApi-C034qyn4.js.map +1 -0
- package/dist/cjs/usePaymentApi-Dvv-jkNC.js +44 -0
- package/dist/cjs/usePaymentApi-Dvv-jkNC.js.map +1 -0
- package/dist/cjs/usePaymentApi-HlugiqX9.js +29 -0
- package/dist/cjs/{usePaymentApi-BE8xfY-U.js.map → usePaymentApi-HlugiqX9.js.map} +1 -1
- package/dist/cjs/usePlatformApi-DpOqBsBn.js +55 -0
- package/dist/cjs/{usePlatformApi-C7lXP6ev.js.map → usePlatformApi-DpOqBsBn.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-CKB3Vyop.js +90 -0
- package/dist/dashboard-CKB3Vyop.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-BTVToZp9.js +804 -0
- package/dist/{index-C7irWceQ.js.map → index-BTVToZp9.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-BB3hiqhN.js +44 -0
- package/dist/renderFunctions-BB3hiqhN.js.map +1 -0
- package/dist/useAccountsApi-C4KOwjWh.js +38 -0
- package/dist/useAccountsApi-C4KOwjWh.js.map +1 -0
- package/dist/useIntegrationsApi-CDqBFq32.js +18 -0
- package/dist/{useIntegrationsApi-D1bkKtoy.js.map → useIntegrationsApi-CDqBFq32.js.map} +1 -1
- package/dist/usePaymentApi-B3dzQqWN.js +26 -0
- package/dist/usePaymentApi-B3dzQqWN.js.map +1 -0
- package/dist/usePaymentApi-DG2ApS6s.js +41 -0
- package/dist/usePaymentApi-DG2ApS6s.js.map +1 -0
- package/dist/usePaymentApi-_dPcALic.js +27 -0
- package/dist/{usePaymentApi-DcMNbOMk.js.map → usePaymentApi-_dPcALic.js.map} +1 -1
- package/dist/usePlatformApi-DBLpH3rH.js +50 -0
- package/dist/{usePlatformApi-Di7Dg-Gn.js.map → usePlatformApi-DBLpH3rH.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 +12 -11
- 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,8 +1,5 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var _defineProperty = require('@babel/runtime/helpers/defineProperty');
|
|
4
|
-
var _toConsumableArray = require('@babel/runtime/helpers/toConsumableArray');
|
|
5
|
-
var _slicedToArray = require('@babel/runtime/helpers/slicedToArray');
|
|
6
3
|
var react = require('react');
|
|
7
4
|
var constants$1 = require('neetocommons/constants');
|
|
8
5
|
var utils = require('neetocommons/utils');
|
|
@@ -10,60 +7,52 @@ var neetoFiltersFrontend = require('@bigbinary/neeto-filters-frontend');
|
|
|
10
7
|
var neetoui = require('@bigbinary/neetoui');
|
|
11
8
|
var ramda = require('ramda');
|
|
12
9
|
var reactRouterDom = require('react-router-dom');
|
|
13
|
-
var ExportModal = require('./ExportModal-
|
|
10
|
+
var ExportModal = require('./ExportModal-ClKqp-oy.js');
|
|
14
11
|
var reactQuery = require('@tanstack/react-query');
|
|
15
12
|
var axios = require('axios');
|
|
16
|
-
var constants = require('./index-
|
|
17
|
-
var queryConstants = require('./queryConstants-
|
|
13
|
+
var constants = require('./index-C3LUTqjR.js');
|
|
14
|
+
var queryConstants = require('./queryConstants-Dc6wh21D.js');
|
|
18
15
|
var i18next = require('i18next');
|
|
19
16
|
var neetocist = require('neetocist');
|
|
20
17
|
var Columns = require('@bigbinary/neeto-molecules/Columns');
|
|
21
18
|
var TableWrapper = require('@bigbinary/neeto-molecules/TableWrapper');
|
|
22
19
|
var reactI18next = require('react-i18next');
|
|
23
|
-
var exportChannel = require('./exportChannel-
|
|
20
|
+
var exportChannel = require('./exportChannel-BL2RGGhP.js');
|
|
24
21
|
var DateFormat = require('@bigbinary/neeto-molecules/DateFormat');
|
|
25
|
-
var CopyButtonWrapper = require('./CopyButtonWrapper-
|
|
22
|
+
var CopyButtonWrapper = require('./CopyButtonWrapper-I-kdKiiB.js');
|
|
23
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
26
24
|
var Header = require('@bigbinary/neeto-molecules/Header');
|
|
27
25
|
var SubHeader = require('@bigbinary/neeto-molecules/SubHeader');
|
|
28
26
|
require('@bigbinary/neeto-icons');
|
|
29
27
|
require('decimal.js');
|
|
30
28
|
require('@bigbinary/neeto-molecules/CopyToClipboardButton');
|
|
31
29
|
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
var refundsApi = {
|
|
38
|
-
list: list
|
|
30
|
+
const list = payload => axios.get(`${constants.BASE_URL}/api/v1/refunds`, {
|
|
31
|
+
params: payload
|
|
32
|
+
});
|
|
33
|
+
const refundsApi = {
|
|
34
|
+
list
|
|
39
35
|
};
|
|
40
36
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
return reactQuery.useQuery(_objectSpread$2({
|
|
47
|
-
queryKey: [queryConstants.QUERY_KEYS.REFUNDS_LIST, payload],
|
|
48
|
-
queryFn: function queryFn() {
|
|
49
|
-
return refundsApi.list(payload);
|
|
50
|
-
}
|
|
51
|
-
}, options));
|
|
52
|
-
};
|
|
37
|
+
const useFetchRefunds = (payload = {}, options = {}) => reactQuery.useQuery({
|
|
38
|
+
queryKey: [queryConstants.QUERY_KEYS.REFUNDS_LIST, payload],
|
|
39
|
+
queryFn: () => refundsApi.list(payload),
|
|
40
|
+
...options
|
|
41
|
+
});
|
|
53
42
|
|
|
54
|
-
|
|
43
|
+
const REFUND_DASHBOARD_TAB = {
|
|
55
44
|
all: "all",
|
|
56
45
|
successful: "successful",
|
|
57
46
|
declined: "declined",
|
|
58
47
|
pending: "pending"
|
|
59
48
|
};
|
|
60
|
-
|
|
49
|
+
const SEARCH_PROPS = {
|
|
61
50
|
node: "identifier,",
|
|
62
51
|
key: "search_term",
|
|
63
52
|
model: "NeetoPaymentsEngine::Refund,",
|
|
64
53
|
placeholder: i18next.t("neetoPayments.common.searchByIdentifier")
|
|
65
54
|
};
|
|
66
|
-
|
|
55
|
+
const FILTER_COLUMNS = [{
|
|
67
56
|
key: "payment_provider",
|
|
68
57
|
label: i18next.t("neetoPayments.common.paymentProvider"),
|
|
69
58
|
node: "payment_provider",
|
|
@@ -86,7 +75,7 @@ var FILTER_COLUMNS = [{
|
|
|
86
75
|
node: "refunded_at",
|
|
87
76
|
type: "date"
|
|
88
77
|
}];
|
|
89
|
-
|
|
78
|
+
const TAG_STYLE = {
|
|
90
79
|
initiated: "info",
|
|
91
80
|
declined: "danger",
|
|
92
81
|
successful: "success",
|
|
@@ -94,415 +83,403 @@ var TAG_STYLE = {
|
|
|
94
83
|
pending: "warning"
|
|
95
84
|
};
|
|
96
85
|
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
86
|
+
const renderIdentifier = (identifier, {
|
|
87
|
+
receiptUrl
|
|
88
|
+
}) => {
|
|
89
|
+
const isTemporaryIdentifier = identifier?.startsWith("temp_");
|
|
100
90
|
if (isTemporaryIdentifier) {
|
|
101
|
-
return /*#__PURE__*/
|
|
91
|
+
return /*#__PURE__*/jsxRuntime.jsx(neetoui.Tooltip, {
|
|
102
92
|
content: i18next.t("neetoPayments.tooltipContent.paymentIdentifierUnavailable"),
|
|
103
|
-
position: "top"
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
93
|
+
position: "top",
|
|
94
|
+
children: /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
95
|
+
className: "text-center",
|
|
96
|
+
children: /*#__PURE__*/jsxRuntime.jsx(neetoui.Typography, {
|
|
97
|
+
style: "body2",
|
|
98
|
+
children: i18next.t("neetoPayments.common.notAvailable")
|
|
99
|
+
})
|
|
100
|
+
})
|
|
101
|
+
});
|
|
109
102
|
}
|
|
110
|
-
return /*#__PURE__*/
|
|
111
|
-
content: identifier
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
};
|
|
120
|
-
var getTagStyle = function getTagStyle(status) {
|
|
121
|
-
return TAG_STYLE[status] || constants.DEFAULT_TAG_STYLE;
|
|
103
|
+
return /*#__PURE__*/jsxRuntime.jsx(CopyButtonWrapper.CopyButtonWrapper, {
|
|
104
|
+
content: identifier,
|
|
105
|
+
children: /*#__PURE__*/jsxRuntime.jsx(neetoui.Button, {
|
|
106
|
+
href: receiptUrl,
|
|
107
|
+
label: identifier,
|
|
108
|
+
size: "small",
|
|
109
|
+
style: "link",
|
|
110
|
+
target: "_blank"
|
|
111
|
+
})
|
|
112
|
+
});
|
|
122
113
|
};
|
|
123
|
-
|
|
124
|
-
|
|
114
|
+
const getTagStyle = status => TAG_STYLE[status] || constants.DEFAULT_TAG_STYLE;
|
|
115
|
+
const preProcessStatus = (type, status, record = {}) => {
|
|
125
116
|
if (type === "payment") {
|
|
126
117
|
return record.isRefunded ? "refunded" : status;
|
|
127
118
|
}
|
|
128
119
|
return neetocist.snakeToCamelCase(status);
|
|
129
120
|
};
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
return /*#__PURE__*/
|
|
133
|
-
content: i18next.t(
|
|
134
|
-
position: "top"
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
121
|
+
const renderStatus = ramda.curry((type, status, record) => {
|
|
122
|
+
const processedStatus = preProcessStatus(type, status, record);
|
|
123
|
+
return /*#__PURE__*/jsxRuntime.jsx(neetoui.Tooltip, {
|
|
124
|
+
content: i18next.t(`neetoPayments.tooltipContent.${type}.${processedStatus}`),
|
|
125
|
+
position: "top",
|
|
126
|
+
children: /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
127
|
+
className: "w-fit",
|
|
128
|
+
children: /*#__PURE__*/jsxRuntime.jsx(neetoui.Tag, {
|
|
129
|
+
style: getTagStyle(processedStatus),
|
|
130
|
+
label: neetocist.humanize(i18next.t(`neetoPayments.tagLabels.${type}.${processedStatus}`))
|
|
131
|
+
})
|
|
132
|
+
})
|
|
133
|
+
});
|
|
141
134
|
});
|
|
142
|
-
|
|
135
|
+
const renderDate = date => {
|
|
143
136
|
if (neetocist.isPresent(date)) {
|
|
144
|
-
return /*#__PURE__*/
|
|
145
|
-
date
|
|
137
|
+
return /*#__PURE__*/jsxRuntime.jsx(DateFormat.DateTime, {
|
|
138
|
+
date
|
|
146
139
|
});
|
|
147
140
|
}
|
|
148
|
-
return /*#__PURE__*/
|
|
149
|
-
style: "body2"
|
|
150
|
-
|
|
151
|
-
};
|
|
152
|
-
var getDefaultColumns = function getDefaultColumns() {
|
|
153
|
-
return [{
|
|
154
|
-
title: i18next.t("neetoPayments.common.id"),
|
|
155
|
-
dataIndex: "id",
|
|
156
|
-
key: "id",
|
|
157
|
-
width: 85,
|
|
158
|
-
position: 0,
|
|
159
|
-
isHidable: false
|
|
160
|
-
}, {
|
|
161
|
-
title: i18next.t("neetoPayments.common.identifier"),
|
|
162
|
-
dataIndex: "identifier",
|
|
163
|
-
key: "identifier",
|
|
164
|
-
width: 300,
|
|
165
|
-
render: renderIdentifier,
|
|
166
|
-
position: 1,
|
|
167
|
-
isHidable: false
|
|
168
|
-
}, {
|
|
169
|
-
title: i18next.t("neetoPayments.common.provider"),
|
|
170
|
-
dataIndex: "paymentProvider",
|
|
171
|
-
key: "paymentProvider",
|
|
172
|
-
width: 150,
|
|
173
|
-
render: neetocist.humanize,
|
|
174
|
-
position: 2,
|
|
175
|
-
sorter: false
|
|
176
|
-
}, {
|
|
177
|
-
title: i18next.t("neetoPayments.common.status"),
|
|
178
|
-
dataIndex: "status",
|
|
179
|
-
key: "status",
|
|
180
|
-
width: 200,
|
|
181
|
-
render: renderStatus("refund"),
|
|
182
|
-
sorter: true,
|
|
183
|
-
position: 3,
|
|
184
|
-
isHidable: false
|
|
185
|
-
}, {
|
|
186
|
-
title: i18next.t("neetoPayments.common.refundAmount"),
|
|
187
|
-
dataIndex: "amount",
|
|
188
|
-
key: "amount",
|
|
189
|
-
width: 203,
|
|
190
|
-
sorter: true,
|
|
191
|
-
render: constants.formatAmount,
|
|
192
|
-
position: 4
|
|
193
|
-
}, {
|
|
194
|
-
title: i18next.t("neetoPayments.common.paymentAmount"),
|
|
195
|
-
dataIndex: ["payment", "amount"],
|
|
196
|
-
key: "paymentAmount",
|
|
197
|
-
width: 210,
|
|
198
|
-
sorter: true,
|
|
199
|
-
render: constants.formatAmount,
|
|
200
|
-
position: 4
|
|
201
|
-
}, {
|
|
202
|
-
title: i18next.t("neetoPayments.common.currency"),
|
|
203
|
-
dataIndex: "currency",
|
|
204
|
-
key: "currency",
|
|
205
|
-
width: 180,
|
|
206
|
-
sorter: true,
|
|
207
|
-
render: constants.formatCurrency,
|
|
208
|
-
position: 4
|
|
209
|
-
}, {
|
|
210
|
-
title: i18next.t("neetoPayments.common.refundTime"),
|
|
211
|
-
dataIndex: "refundedAt",
|
|
212
|
-
key: "refundedAt",
|
|
213
|
-
width: 190,
|
|
214
|
-
render: renderDate,
|
|
215
|
-
sorter: true,
|
|
216
|
-
position: 5
|
|
217
|
-
}, {
|
|
218
|
-
title: i18next.t("neetoPayments.common.paymentIdentifier"),
|
|
219
|
-
dataIndex: ["payment", "identifier"],
|
|
220
|
-
key: "paymentIdentifier",
|
|
221
|
-
width: 300,
|
|
222
|
-
render: renderIdentifier,
|
|
223
|
-
position: 6
|
|
224
|
-
}];
|
|
225
|
-
};
|
|
226
|
-
|
|
227
|
-
function ownKeys$1(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; }
|
|
228
|
-
function _objectSpread$1(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$1(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$1(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
229
|
-
var buildSearchProps = function buildSearchProps(searchProps, searchTerm) {
|
|
230
|
-
return ramda.mergeDeepWith(ramda.concat, SEARCH_PROPS, ramda.mergeLeft({
|
|
231
|
-
value: searchTerm.trim()
|
|
232
|
-
}, searchProps));
|
|
233
|
-
};
|
|
234
|
-
var buildFilterColumns = function buildFilterColumns() {
|
|
235
|
-
var payableEntityColumns = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
236
|
-
return ramda.reject(ramda.isNil, ramda.concat(FILTER_COLUMNS, ramda.map(ramda.prop("filterProps"), payableEntityColumns)));
|
|
237
|
-
};
|
|
238
|
-
var buildRowData = function buildRowData(_ref) {
|
|
239
|
-
var refunds = _ref.refunds,
|
|
240
|
-
_ref$pageProperties = _ref.pageProperties,
|
|
241
|
-
pageProperties = _ref$pageProperties === void 0 ? {} : _ref$pageProperties;
|
|
242
|
-
return refunds === null || refunds === void 0 ? void 0 : refunds.map(function (element, index) {
|
|
243
|
-
return _objectSpread$1(_objectSpread$1({}, element), {}, {
|
|
244
|
-
id: ramda.isEmpty(pageProperties) ? index + 1 : pageProperties.pageSize * (pageProperties.page - 1) + index + 1
|
|
245
|
-
});
|
|
141
|
+
return /*#__PURE__*/jsxRuntime.jsx(neetoui.Typography, {
|
|
142
|
+
style: "body2",
|
|
143
|
+
children: i18next.t("neetoPayments.common.notAvailable")
|
|
246
144
|
});
|
|
247
145
|
};
|
|
146
|
+
const getDefaultColumns = () => [{
|
|
147
|
+
title: i18next.t("neetoPayments.common.id"),
|
|
148
|
+
dataIndex: "id",
|
|
149
|
+
key: "id",
|
|
150
|
+
width: 85,
|
|
151
|
+
position: 0,
|
|
152
|
+
isHidable: false
|
|
153
|
+
}, {
|
|
154
|
+
title: i18next.t("neetoPayments.common.identifier"),
|
|
155
|
+
dataIndex: "identifier",
|
|
156
|
+
key: "identifier",
|
|
157
|
+
width: 300,
|
|
158
|
+
render: renderIdentifier,
|
|
159
|
+
position: 1,
|
|
160
|
+
isHidable: false
|
|
161
|
+
}, {
|
|
162
|
+
title: i18next.t("neetoPayments.common.provider"),
|
|
163
|
+
dataIndex: "paymentProvider",
|
|
164
|
+
key: "paymentProvider",
|
|
165
|
+
width: 150,
|
|
166
|
+
render: neetocist.humanize,
|
|
167
|
+
position: 2,
|
|
168
|
+
sorter: false
|
|
169
|
+
}, {
|
|
170
|
+
title: i18next.t("neetoPayments.common.status"),
|
|
171
|
+
dataIndex: "status",
|
|
172
|
+
key: "status",
|
|
173
|
+
width: 200,
|
|
174
|
+
render: renderStatus("refund"),
|
|
175
|
+
sorter: true,
|
|
176
|
+
position: 3,
|
|
177
|
+
isHidable: false
|
|
178
|
+
}, {
|
|
179
|
+
title: i18next.t("neetoPayments.common.refundAmount"),
|
|
180
|
+
dataIndex: "amount",
|
|
181
|
+
key: "amount",
|
|
182
|
+
width: 203,
|
|
183
|
+
sorter: true,
|
|
184
|
+
render: constants.formatAmount,
|
|
185
|
+
position: 4
|
|
186
|
+
}, {
|
|
187
|
+
title: i18next.t("neetoPayments.common.paymentAmount"),
|
|
188
|
+
dataIndex: ["payment", "amount"],
|
|
189
|
+
key: "paymentAmount",
|
|
190
|
+
width: 210,
|
|
191
|
+
sorter: true,
|
|
192
|
+
render: constants.formatAmount,
|
|
193
|
+
position: 4
|
|
194
|
+
}, {
|
|
195
|
+
title: i18next.t("neetoPayments.common.currency"),
|
|
196
|
+
dataIndex: "currency",
|
|
197
|
+
key: "currency",
|
|
198
|
+
width: 180,
|
|
199
|
+
sorter: true,
|
|
200
|
+
render: constants.formatCurrency,
|
|
201
|
+
position: 4
|
|
202
|
+
}, {
|
|
203
|
+
title: i18next.t("neetoPayments.common.refundTime"),
|
|
204
|
+
dataIndex: "refundedAt",
|
|
205
|
+
key: "refundedAt",
|
|
206
|
+
width: 190,
|
|
207
|
+
render: renderDate,
|
|
208
|
+
sorter: true,
|
|
209
|
+
position: 5
|
|
210
|
+
}, {
|
|
211
|
+
title: i18next.t("neetoPayments.common.paymentIdentifier"),
|
|
212
|
+
dataIndex: ["payment", "identifier"],
|
|
213
|
+
key: "paymentIdentifier",
|
|
214
|
+
width: 300,
|
|
215
|
+
render: renderIdentifier,
|
|
216
|
+
position: 6
|
|
217
|
+
}];
|
|
218
|
+
|
|
219
|
+
const buildSearchProps = (searchProps, searchTerm) => ramda.mergeDeepWith(ramda.concat, SEARCH_PROPS, ramda.mergeLeft({
|
|
220
|
+
value: searchTerm.trim()
|
|
221
|
+
}, searchProps));
|
|
222
|
+
const buildFilterColumns = (payableEntityColumns = []) => ramda.reject(ramda.isNil, ramda.concat(FILTER_COLUMNS, ramda.map(ramda.prop("filterProps"), payableEntityColumns)));
|
|
223
|
+
const buildRowData = ({
|
|
224
|
+
refunds,
|
|
225
|
+
pageProperties = {}
|
|
226
|
+
}) => refunds?.map((element, index) => ({
|
|
227
|
+
...element,
|
|
228
|
+
id: ramda.isEmpty(pageProperties) ? index + 1 : pageProperties.pageSize * (pageProperties.page - 1) + index + 1
|
|
229
|
+
}));
|
|
248
230
|
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
231
|
+
const List = ({
|
|
232
|
+
isFetching,
|
|
233
|
+
refunds,
|
|
234
|
+
views,
|
|
235
|
+
payableEntityColumns,
|
|
236
|
+
setSortProperties,
|
|
237
|
+
pageProperties,
|
|
238
|
+
handleTablePagination
|
|
239
|
+
}) => {
|
|
240
|
+
const {
|
|
241
|
+
t
|
|
242
|
+
} = reactI18next.useTranslation();
|
|
243
|
+
const {
|
|
244
|
+
tab = REFUND_DASHBOARD_TAB.all
|
|
245
|
+
} = utils.getQueryParams();
|
|
246
|
+
const refundsCount = views[tab];
|
|
247
|
+
const allColumns = constants.buildDefaultTableColumns({
|
|
248
|
+
payableEntityColumns,
|
|
265
249
|
defaultColumns: getDefaultColumns(),
|
|
266
250
|
isAllTab: tab === REFUND_DASHBOARD_TAB.all
|
|
267
251
|
});
|
|
268
|
-
|
|
269
|
-
isTableConfigurationLoading
|
|
270
|
-
customizedColumns
|
|
271
|
-
hideColumn
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
252
|
+
const {
|
|
253
|
+
isTableConfigurationLoading,
|
|
254
|
+
customizedColumns,
|
|
255
|
+
hideColumn
|
|
256
|
+
} = Columns.useTableConfigurations(`${exportChannel.TABLE_KEYS.REFUNDS_TABLE}-${tab}`, allColumns);
|
|
257
|
+
const handleTableChange = (_, __, sorter) => {
|
|
258
|
+
const processedDataIndex = neetocist.camelToSnakeCase(constants.processDataIndex(sorter.field));
|
|
259
|
+
const sortBy = neetocist.isPresent(constants.ASSOCIATED_TABLE_COLUMNS[processedDataIndex]) ? constants.ASSOCIATED_TABLE_COLUMNS[processedDataIndex] : processedDataIndex;
|
|
260
|
+
setSortProperties(neetocist.isPresent(sorter?.column) ? {
|
|
261
|
+
sortBy,
|
|
277
262
|
orderBy: sorter.order === "ascend" ? "ASC" : "DESC"
|
|
278
263
|
} : constants.DEFAULT_SORT_PROPERTIES);
|
|
279
264
|
};
|
|
280
265
|
if (neetocist.isNotPresent(refunds)) {
|
|
281
|
-
return /*#__PURE__*/
|
|
282
|
-
className: "flex h-full w-full items-center justify-center"
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
266
|
+
return /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
267
|
+
className: "flex h-full w-full items-center justify-center",
|
|
268
|
+
children: /*#__PURE__*/jsxRuntime.jsx(neetoui.NoData, {
|
|
269
|
+
title: tab === REFUND_DASHBOARD_TAB.all ? t("neetoPayments.emptyState.refund") : t("neetoPayments.emptyState.refundWithStatus", {
|
|
270
|
+
status: tab
|
|
271
|
+
})
|
|
286
272
|
})
|
|
287
|
-
})
|
|
273
|
+
});
|
|
288
274
|
}
|
|
289
|
-
return /*#__PURE__*/
|
|
290
|
-
hasPagination: refundsCount >
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
}
|
|
317
|
-
})
|
|
275
|
+
return /*#__PURE__*/jsxRuntime.jsx(TableWrapper, {
|
|
276
|
+
hasPagination: refundsCount > pageProperties?.pageSize,
|
|
277
|
+
children: /*#__PURE__*/jsxRuntime.jsx(neetoui.Table, {
|
|
278
|
+
fixedHeight: true,
|
|
279
|
+
allowRowClick: false,
|
|
280
|
+
columnData: customizedColumns,
|
|
281
|
+
currentPageNumber: pageProperties?.page,
|
|
282
|
+
handlePageChange: handleTablePagination,
|
|
283
|
+
loading: isFetching || isTableConfigurationLoading,
|
|
284
|
+
rowData: buildRowData({
|
|
285
|
+
refunds,
|
|
286
|
+
pageProperties,
|
|
287
|
+
tab
|
|
288
|
+
}),
|
|
289
|
+
rowSelection: false,
|
|
290
|
+
sortDirections: constants.SORT_DIRECTIONS,
|
|
291
|
+
totalCount: refundsCount,
|
|
292
|
+
paginationProps: {
|
|
293
|
+
showSizeChanger: true,
|
|
294
|
+
hideOnSinglePage: true,
|
|
295
|
+
pageSize: pageProperties?.pageSize,
|
|
296
|
+
total: refundsCount
|
|
297
|
+
},
|
|
298
|
+
onChange: handleTableChange,
|
|
299
|
+
onColumnHide: ({
|
|
300
|
+
key
|
|
301
|
+
}) => hideColumn(key)
|
|
302
|
+
})
|
|
303
|
+
});
|
|
318
304
|
};
|
|
319
305
|
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
react.startTransition(function () {
|
|
306
|
+
const TopSection = ({
|
|
307
|
+
views,
|
|
308
|
+
filters,
|
|
309
|
+
setFilters,
|
|
310
|
+
filterableColumns,
|
|
311
|
+
searchKeywordProps,
|
|
312
|
+
payableEntityColumns,
|
|
313
|
+
setIsExportModalOpen
|
|
314
|
+
}) => {
|
|
315
|
+
const [isFilterPaneOpen, setIsFilterPaneOpen] = react.useState(false);
|
|
316
|
+
const {
|
|
317
|
+
t
|
|
318
|
+
} = reactI18next.useTranslation();
|
|
319
|
+
const history = reactRouterDom.useHistory();
|
|
320
|
+
const {
|
|
321
|
+
tab = REFUND_DASHBOARD_TAB.all
|
|
322
|
+
} = utils.getQueryParams();
|
|
323
|
+
const refundsCount = views?.[tab];
|
|
324
|
+
const isRefundCountVisible = refundsCount > 0 || refundsCount === 0 && neetocist.isPresent(filters);
|
|
325
|
+
const isFilterButtonVisible = isRefundCountVisible || neetocist.isPresent(filters);
|
|
326
|
+
const handleFiltersChange = filters => {
|
|
327
|
+
react.startTransition(() => {
|
|
343
328
|
setFilters(filters);
|
|
344
329
|
});
|
|
345
330
|
};
|
|
346
|
-
|
|
347
|
-
|
|
331
|
+
const handleTabChange = tab => {
|
|
332
|
+
const queryParams = utils.getQueryParams({
|
|
348
333
|
toCamelCase: false
|
|
349
334
|
});
|
|
350
|
-
|
|
351
|
-
tab
|
|
335
|
+
const newParams = {
|
|
336
|
+
tab,
|
|
352
337
|
page: constants$1.DEFAULT_PAGE_INDEX,
|
|
353
338
|
page_size: constants$1.DEFAULT_PAGE_SIZE
|
|
354
339
|
};
|
|
355
340
|
history.push(utils.buildUrl(window.location.pathname, ramda.mergeLeft(newParams, queryParams)));
|
|
356
341
|
};
|
|
357
|
-
return /*#__PURE__*/
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
}), constants.shouldTabsVisible(views) && /*#__PURE__*/React.createElement(neetoui.Tab, null, Object.keys(REFUND_DASHBOARD_TAB).map(function (item) {
|
|
364
|
-
return /*#__PURE__*/React.createElement(neetoui.Tab.Item, {
|
|
365
|
-
active: tab === item,
|
|
366
|
-
key: item,
|
|
367
|
-
onClick: function onClick() {
|
|
368
|
-
return handleTabChange(item);
|
|
342
|
+
return /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
343
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(Header, {
|
|
344
|
+
title: t("neetoPayments.title.refunds"),
|
|
345
|
+
searchProps: isFilterButtonVisible && {
|
|
346
|
+
placeholder: searchKeywordProps.placeholder,
|
|
347
|
+
className: "w-80"
|
|
369
348
|
}
|
|
370
|
-
},
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
},
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
349
|
+
}), constants.shouldTabsVisible(views) && /*#__PURE__*/jsxRuntime.jsx(neetoui.Tab, {
|
|
350
|
+
children: Object.keys(REFUND_DASHBOARD_TAB).map(item => /*#__PURE__*/jsxRuntime.jsx(neetoui.Tab.Item, {
|
|
351
|
+
active: tab === item,
|
|
352
|
+
onClick: () => handleTabChange(item),
|
|
353
|
+
children: t(`neetoPayments.common.${item}`)
|
|
354
|
+
}, item))
|
|
355
|
+
}), /*#__PURE__*/jsxRuntime.jsx(SubHeader, {
|
|
356
|
+
className: "my-4",
|
|
357
|
+
leftActionBlock: isRefundCountVisible && /*#__PURE__*/jsxRuntime.jsx(neetoui.Typography, {
|
|
358
|
+
className: "neeto-ui-gray-800 me-2 font-semibold",
|
|
359
|
+
component: "h4",
|
|
360
|
+
children: tab === REFUND_DASHBOARD_TAB.all ? t("neetoPayments.countOf.refund", {
|
|
361
|
+
count: refundsCount
|
|
362
|
+
}) : t("neetoPayments.countOf.refundWithStatus", {
|
|
363
|
+
count: refundsCount,
|
|
364
|
+
status: tab
|
|
365
|
+
})
|
|
366
|
+
}),
|
|
367
|
+
rightActionBlock: isFilterButtonVisible && /*#__PURE__*/jsxRuntime.jsx(SubHeader.RightBlock, {
|
|
368
|
+
columnsButtonProps: {
|
|
369
|
+
columnData: constants.buildDefaultTableColumns({
|
|
370
|
+
defaultColumns: getDefaultColumns(),
|
|
371
|
+
payableEntityColumns,
|
|
372
|
+
isAllTab: tab === REFUND_DASHBOARD_TAB.all
|
|
373
|
+
}).map(ramda.modify("dataIndex", constants.processDataIndex)),
|
|
374
|
+
fixedColumns: constants.UN_HIDEABLE_COLUMNS,
|
|
375
|
+
tableKey: `${exportChannel.TABLE_KEYS.REFUNDS_TABLE}-${tab}`
|
|
376
|
+
},
|
|
377
|
+
downloadButtonProps: {
|
|
378
|
+
onClick: () => setIsExportModalOpen(true)
|
|
379
|
+
},
|
|
380
|
+
filterProps: {
|
|
381
|
+
columns: filterableColumns,
|
|
382
|
+
isOpen: isFilterPaneOpen,
|
|
383
|
+
keyword: searchKeywordProps,
|
|
384
|
+
setIsOpen: setIsFilterPaneOpen,
|
|
385
|
+
onChange: handleFiltersChange
|
|
395
386
|
}
|
|
396
|
-
}
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
})
|
|
405
|
-
}), /*#__PURE__*/React.createElement(neetoFiltersFrontend.Bar, {
|
|
406
|
-
columns: filterableColumns,
|
|
407
|
-
keyword: searchKeywordProps,
|
|
408
|
-
setIsPaneOpen: setIsFilterPaneOpen,
|
|
409
|
-
onChange: handleFiltersChange
|
|
410
|
-
}));
|
|
387
|
+
})
|
|
388
|
+
}), /*#__PURE__*/jsxRuntime.jsx(neetoFiltersFrontend.Bar, {
|
|
389
|
+
columns: filterableColumns,
|
|
390
|
+
keyword: searchKeywordProps,
|
|
391
|
+
setIsPaneOpen: setIsFilterPaneOpen,
|
|
392
|
+
onChange: handleFiltersChange
|
|
393
|
+
})]
|
|
394
|
+
});
|
|
411
395
|
};
|
|
412
396
|
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
enabled: true
|
|
451
|
-
}),
|
|
452
|
-
_useFetchRefunds$data = _useFetchRefunds.data,
|
|
453
|
-
_useFetchRefunds$data2 = _useFetchRefunds$data === void 0 ? {} : _useFetchRefunds$data,
|
|
454
|
-
refunds = _useFetchRefunds$data2.refunds,
|
|
455
|
-
views = _useFetchRefunds$data2.views,
|
|
456
|
-
isFetching = _useFetchRefunds.isFetching,
|
|
457
|
-
isRefundsLoading = _useFetchRefunds.isPending;
|
|
458
|
-
var handleTablePagination = function handleTablePagination(page, pageSize) {
|
|
459
|
-
var queryParams = utils.getQueryParams({
|
|
397
|
+
const RefundsDashboard = ({
|
|
398
|
+
searchProps,
|
|
399
|
+
payableEntityColumns,
|
|
400
|
+
accountIds
|
|
401
|
+
}) => {
|
|
402
|
+
const {
|
|
403
|
+
searchTerm = ""
|
|
404
|
+
} = utils.getQueryParams();
|
|
405
|
+
const filterableColumns = buildFilterColumns(payableEntityColumns);
|
|
406
|
+
const searchKeywordProps = buildSearchProps(searchProps, searchTerm);
|
|
407
|
+
const [sortProperties, setSortProperties] = react.useState(constants.DEFAULT_SORT_PROPERTIES);
|
|
408
|
+
const [pageProperties, setPageProperties] = react.useState(constants.DEFAULT_PAGE_VALUES);
|
|
409
|
+
const [isExportModalOpen, setIsExportModalOpen] = react.useState(false);
|
|
410
|
+
const [filters, setFilters] = react.useState(neetoFiltersFrontend.buildFiltersFromURL([...filterableColumns, searchKeywordProps]));
|
|
411
|
+
const history = reactRouterDom.useHistory();
|
|
412
|
+
const {
|
|
413
|
+
tab = REFUND_DASHBOARD_TAB.all
|
|
414
|
+
} = utils.getQueryParams();
|
|
415
|
+
const payload = {
|
|
416
|
+
tab,
|
|
417
|
+
filters,
|
|
418
|
+
accountIds,
|
|
419
|
+
...pageProperties,
|
|
420
|
+
...sortProperties
|
|
421
|
+
};
|
|
422
|
+
const {
|
|
423
|
+
data: {
|
|
424
|
+
refunds,
|
|
425
|
+
views
|
|
426
|
+
} = {},
|
|
427
|
+
isFetching,
|
|
428
|
+
isPending: isRefundsLoading
|
|
429
|
+
} = useFetchRefunds(payload, {
|
|
430
|
+
enabled: true
|
|
431
|
+
});
|
|
432
|
+
const handleTablePagination = (page, pageSize) => {
|
|
433
|
+
const queryParams = utils.getQueryParams({
|
|
460
434
|
toCamelCase: false
|
|
461
435
|
});
|
|
462
436
|
history.push(utils.buildUrl(window.location.pathname, ramda.mergeLeft({
|
|
463
|
-
page
|
|
437
|
+
page,
|
|
464
438
|
page_size: pageSize
|
|
465
439
|
}, queryParams)));
|
|
466
440
|
setPageProperties({
|
|
467
|
-
page
|
|
468
|
-
pageSize
|
|
441
|
+
page,
|
|
442
|
+
pageSize
|
|
469
443
|
});
|
|
470
444
|
};
|
|
471
|
-
react.useEffect(
|
|
445
|
+
react.useEffect(() => {
|
|
472
446
|
handleTablePagination(constants$1.DEFAULT_PAGE_INDEX, constants$1.DEFAULT_PAGE_SIZE);
|
|
473
447
|
setSortProperties(constants.DEFAULT_SORT_PROPERTIES);
|
|
474
448
|
}, [filters, tab]);
|
|
475
449
|
if (isRefundsLoading) {
|
|
476
|
-
return /*#__PURE__*/
|
|
477
|
-
className: "flex h-full w-full items-center justify-center"
|
|
478
|
-
|
|
450
|
+
return /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
451
|
+
className: "flex h-full w-full items-center justify-center",
|
|
452
|
+
children: /*#__PURE__*/jsxRuntime.jsx(neetoui.Spinner, {})
|
|
453
|
+
});
|
|
479
454
|
}
|
|
480
|
-
return /*#__PURE__*/
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
455
|
+
return /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
456
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(TopSection, {
|
|
457
|
+
filterableColumns,
|
|
458
|
+
filters,
|
|
459
|
+
pageProperties,
|
|
460
|
+
payableEntityColumns,
|
|
461
|
+
searchKeywordProps,
|
|
462
|
+
setFilters,
|
|
463
|
+
setIsExportModalOpen,
|
|
464
|
+
setPageProperties,
|
|
465
|
+
setSortProperties,
|
|
466
|
+
views
|
|
467
|
+
}), /*#__PURE__*/jsxRuntime.jsx(List, {
|
|
468
|
+
handleTablePagination,
|
|
469
|
+
isFetching,
|
|
470
|
+
pageProperties,
|
|
471
|
+
payableEntityColumns,
|
|
472
|
+
refunds,
|
|
473
|
+
setSortProperties,
|
|
474
|
+
views
|
|
475
|
+
}), /*#__PURE__*/jsxRuntime.jsx(ExportModal.ExportModal, {
|
|
476
|
+
filters,
|
|
477
|
+
isExportModalOpen,
|
|
478
|
+
setIsExportModalOpen,
|
|
479
|
+
sortProperties,
|
|
480
|
+
dashboardKind: constants.DASHBOARD_KIND.refunds
|
|
481
|
+
})]
|
|
482
|
+
});
|
|
506
483
|
};
|
|
507
484
|
|
|
508
485
|
module.exports = RefundsDashboard;
|