@bigbinary/neeto-payments-frontend 6.1.0 → 6.1.2
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/package.json +1 -7
- package/dist/AccountsDashboard.js +0 -528
- package/dist/AccountsDashboard.js.map +0 -1
- package/dist/AdminCancelRecurringPaymentButton.js +0 -80
- package/dist/AdminCancelRecurringPaymentButton.js.map +0 -1
- package/dist/CashPaymentButton.js +0 -61
- package/dist/CashPaymentButton.js.map +0 -1
- package/dist/ConfirmCashPaymentButton.js +0 -109
- package/dist/ConfirmCashPaymentButton.js.map +0 -1
- package/dist/CopyButtonWrapper-SoJkwX-d.js +0 -27
- package/dist/CopyButtonWrapper-SoJkwX-d.js.map +0 -1
- package/dist/CustomerCancelRecurringPaymentForm.js +0 -112
- package/dist/CustomerCancelRecurringPaymentForm.js.map +0 -1
- package/dist/ExportModal-BnP3xriD.js +0 -134
- package/dist/ExportModal-BnP3xriD.js.map +0 -1
- package/dist/ManualUpiConnect.js +0 -260
- package/dist/ManualUpiConnect.js.map +0 -1
- package/dist/ManualUpiPayment.js +0 -138
- package/dist/ManualUpiPayment.js.map +0 -1
- package/dist/ManualUpiPaymentConfirmButton.js +0 -171
- package/dist/ManualUpiPaymentConfirmButton.js.map +0 -1
- package/dist/ManualUpiPaymentRejectButton.js +0 -139
- package/dist/ManualUpiPaymentRejectButton.js.map +0 -1
- package/dist/PaymentKindRestrictionAlert.js +0 -39
- package/dist/PaymentKindRestrictionAlert.js.map +0 -1
- package/dist/PaymentsDashboard.js +0 -615
- package/dist/PaymentsDashboard.js.map +0 -1
- package/dist/PayoutsDashboard.js +0 -563
- package/dist/PayoutsDashboard.js.map +0 -1
- package/dist/PayoutsPage.js +0 -163
- package/dist/PayoutsPage.js.map +0 -1
- package/dist/RazorpayConnect.js +0 -119
- package/dist/RazorpayConnect.js.map +0 -1
- package/dist/RazorpayLinkedAccountForm.js +0 -225
- package/dist/RazorpayLinkedAccountForm.js.map +0 -1
- package/dist/RazorpayPaymentButton.js +0 -147
- package/dist/RazorpayPaymentButton.js.map +0 -1
- package/dist/RecurringPaymentSettings.js +0 -133
- package/dist/RecurringPaymentSettings.js.map +0 -1
- package/dist/RefundsDashboard.js +0 -534
- package/dist/RefundsDashboard.js.map +0 -1
- package/dist/SplitTransfersDashboard.js +0 -1118
- package/dist/SplitTransfersDashboard.js.map +0 -1
- package/dist/StripeCheckoutSetting.js +0 -99
- package/dist/StripeCheckoutSetting.js.map +0 -1
- package/dist/StripeConnect.js +0 -401
- package/dist/StripeConnect.js.map +0 -1
- package/dist/StripeManage.js +0 -51
- package/dist/StripeManage.js.map +0 -1
- package/dist/TaxesDashboard.js +0 -401
- package/dist/TaxesDashboard.js.map +0 -1
- package/dist/buildStripeTransactionLink.js +0 -12
- package/dist/buildStripeTransactionLink.js.map +0 -1
- package/dist/cjs/AccountsDashboard.js +0 -530
- package/dist/cjs/AccountsDashboard.js.map +0 -1
- package/dist/cjs/AdminCancelRecurringPaymentButton.js +0 -82
- package/dist/cjs/AdminCancelRecurringPaymentButton.js.map +0 -1
- package/dist/cjs/CashPaymentButton.js +0 -63
- package/dist/cjs/CashPaymentButton.js.map +0 -1
- package/dist/cjs/ConfirmCashPaymentButton.js +0 -111
- package/dist/cjs/ConfirmCashPaymentButton.js.map +0 -1
- package/dist/cjs/CopyButtonWrapper-Ds1k64E0.js +0 -30
- package/dist/cjs/CopyButtonWrapper-Ds1k64E0.js.map +0 -1
- package/dist/cjs/CustomerCancelRecurringPaymentForm.js +0 -114
- package/dist/cjs/CustomerCancelRecurringPaymentForm.js.map +0 -1
- package/dist/cjs/ExportModal-BmHgt24q.js +0 -136
- package/dist/cjs/ExportModal-BmHgt24q.js.map +0 -1
- package/dist/cjs/ManualUpiConnect.js +0 -281
- package/dist/cjs/ManualUpiConnect.js.map +0 -1
- package/dist/cjs/ManualUpiPayment.js +0 -159
- package/dist/cjs/ManualUpiPayment.js.map +0 -1
- package/dist/cjs/ManualUpiPaymentConfirmButton.js +0 -192
- package/dist/cjs/ManualUpiPaymentConfirmButton.js.map +0 -1
- package/dist/cjs/ManualUpiPaymentRejectButton.js +0 -141
- package/dist/cjs/ManualUpiPaymentRejectButton.js.map +0 -1
- package/dist/cjs/PaymentKindRestrictionAlert.js +0 -41
- package/dist/cjs/PaymentKindRestrictionAlert.js.map +0 -1
- package/dist/cjs/PaymentsDashboard.js +0 -617
- package/dist/cjs/PaymentsDashboard.js.map +0 -1
- package/dist/cjs/PayoutsDashboard.js +0 -565
- package/dist/cjs/PayoutsDashboard.js.map +0 -1
- package/dist/cjs/PayoutsPage.js +0 -165
- package/dist/cjs/PayoutsPage.js.map +0 -1
- package/dist/cjs/RazorpayConnect.js +0 -121
- package/dist/cjs/RazorpayConnect.js.map +0 -1
- package/dist/cjs/RazorpayLinkedAccountForm.js +0 -227
- package/dist/cjs/RazorpayLinkedAccountForm.js.map +0 -1
- package/dist/cjs/RazorpayPaymentButton.js +0 -149
- package/dist/cjs/RazorpayPaymentButton.js.map +0 -1
- package/dist/cjs/RecurringPaymentSettings.js +0 -154
- package/dist/cjs/RecurringPaymentSettings.js.map +0 -1
- package/dist/cjs/RefundsDashboard.js +0 -536
- package/dist/cjs/RefundsDashboard.js.map +0 -1
- package/dist/cjs/SplitTransfersDashboard.js +0 -1139
- package/dist/cjs/SplitTransfersDashboard.js.map +0 -1
- package/dist/cjs/StripeCheckoutSetting.js +0 -101
- package/dist/cjs/StripeCheckoutSetting.js.map +0 -1
- package/dist/cjs/StripeConnect.js +0 -422
- package/dist/cjs/StripeConnect.js.map +0 -1
- package/dist/cjs/StripeManage.js +0 -53
- package/dist/cjs/StripeManage.js.map +0 -1
- package/dist/cjs/TaxesDashboard.js +0 -422
- package/dist/cjs/TaxesDashboard.js.map +0 -1
- package/dist/cjs/buildStripeTransactionLink.js +0 -14
- package/dist/cjs/buildStripeTransactionLink.js.map +0 -1
- package/dist/cjs/constants.js +0 -38
- package/dist/cjs/constants.js.map +0 -1
- package/dist/cjs/dashboard-DLj_eVV0.js +0 -112
- package/dist/cjs/dashboard-DLj_eVV0.js.map +0 -1
- package/dist/cjs/exportChannel-BB1psKzT.js +0 -40
- package/dist/cjs/exportChannel-BB1psKzT.js.map +0 -1
- package/dist/cjs/getAddressElementOptions.js +0 -14
- package/dist/cjs/getAddressElementOptions.js.map +0 -1
- package/dist/cjs/getAmountInSmallestCurrencyUnit.js +0 -14
- package/dist/cjs/getAmountInSmallestCurrencyUnit.js.map +0 -1
- package/dist/cjs/getAmountWithAppliedTax.js +0 -14
- package/dist/cjs/getAmountWithAppliedTax.js.map +0 -1
- package/dist/cjs/getFormattedAmount.js +0 -14
- package/dist/cjs/getFormattedAmount.js.map +0 -1
- package/dist/cjs/getFormattedDiscountedAmount.js +0 -14
- package/dist/cjs/getFormattedDiscountedAmount.js.map +0 -1
- package/dist/cjs/getFormattedDiscountedPercentage.js +0 -14
- package/dist/cjs/getFormattedDiscountedPercentage.js.map +0 -1
- package/dist/cjs/getFormattedTaxAmount.js +0 -14
- package/dist/cjs/getFormattedTaxAmount.js.map +0 -1
- package/dist/cjs/getFormattedTipAmount.js +0 -14
- package/dist/cjs/getFormattedTipAmount.js.map +0 -1
- package/dist/cjs/getQrCodeValue.js +0 -14
- package/dist/cjs/getQrCodeValue.js.map +0 -1
- package/dist/cjs/getTaxAmount.js +0 -14
- package/dist/cjs/getTaxAmount.js.map +0 -1
- package/dist/cjs/getTipAmount.js +0 -14
- package/dist/cjs/getTipAmount.js.map +0 -1
- package/dist/cjs/hasAmountToPay.js +0 -14
- package/dist/cjs/hasAmountToPay.js.map +0 -1
- package/dist/cjs/index-KqkPP267.js +0 -892
- package/dist/cjs/index-KqkPP267.js.map +0 -1
- package/dist/cjs/index.js +0 -150
- package/dist/cjs/index.js.map +0 -1
- package/dist/cjs/queryConstants-Cka1X6GX.js +0 -35
- package/dist/cjs/queryConstants-Cka1X6GX.js.map +0 -1
- package/dist/cjs/renderFunctions-ydTbw8WO.js +0 -56
- package/dist/cjs/renderFunctions-ydTbw8WO.js.map +0 -1
- package/dist/cjs/stripe.esm-CrNYjPcC.js +0 -132
- package/dist/cjs/stripe.esm-CrNYjPcC.js.map +0 -1
- package/dist/cjs/useAccountsApi-CJf2ILqh.js +0 -62
- package/dist/cjs/useAccountsApi-CJf2ILqh.js.map +0 -1
- package/dist/cjs/useIntegrationsApi-BLP7KuIR.js +0 -26
- package/dist/cjs/useIntegrationsApi-BLP7KuIR.js.map +0 -1
- package/dist/cjs/usePaymentApi-B_4I2IeI.js +0 -41
- package/dist/cjs/usePaymentApi-B_4I2IeI.js.map +0 -1
- package/dist/cjs/usePaymentApi-Bf9f9dFY.js +0 -56
- package/dist/cjs/usePaymentApi-Bf9f9dFY.js.map +0 -1
- package/dist/cjs/usePaymentApi-C90HGytr.js +0 -39
- package/dist/cjs/usePaymentApi-C90HGytr.js.map +0 -1
- package/dist/cjs/usePlatformApi-CPdK_K-y.js +0 -84
- package/dist/cjs/usePlatformApi-CPdK_K-y.js.map +0 -1
- package/dist/cjs/useRazorpayPayment.js +0 -113
- package/dist/cjs/useRazorpayPayment.js.map +0 -1
- package/dist/cjs/useStripePromise.js +0 -57
- package/dist/cjs/useStripePromise.js.map +0 -1
- package/dist/constants.js +0 -8
- package/dist/constants.js.map +0 -1
- package/dist/dashboard-Dn2TZTXF.js +0 -106
- package/dist/dashboard-Dn2TZTXF.js.map +0 -1
- package/dist/exportChannel-h2JJKPT1.js +0 -37
- package/dist/exportChannel-h2JJKPT1.js.map +0 -1
- package/dist/getAddressElementOptions.js +0 -12
- package/dist/getAddressElementOptions.js.map +0 -1
- package/dist/getAmountInSmallestCurrencyUnit.js +0 -12
- package/dist/getAmountInSmallestCurrencyUnit.js.map +0 -1
- package/dist/getAmountWithAppliedTax.js +0 -12
- package/dist/getAmountWithAppliedTax.js.map +0 -1
- package/dist/getFormattedAmount.js +0 -12
- package/dist/getFormattedAmount.js.map +0 -1
- package/dist/getFormattedDiscountedAmount.js +0 -12
- package/dist/getFormattedDiscountedAmount.js.map +0 -1
- package/dist/getFormattedDiscountedPercentage.js +0 -12
- package/dist/getFormattedDiscountedPercentage.js.map +0 -1
- package/dist/getFormattedTaxAmount.js +0 -12
- package/dist/getFormattedTaxAmount.js.map +0 -1
- package/dist/getFormattedTipAmount.js +0 -12
- package/dist/getFormattedTipAmount.js.map +0 -1
- package/dist/getQrCodeValue.js +0 -12
- package/dist/getQrCodeValue.js.map +0 -1
- package/dist/getTaxAmount.js +0 -12
- package/dist/getTaxAmount.js.map +0 -1
- package/dist/getTipAmount.js +0 -12
- package/dist/getTipAmount.js.map +0 -1
- package/dist/hasAmountToPay.js +0 -12
- package/dist/hasAmountToPay.js.map +0 -1
- package/dist/index-Xdf4XpRc.js +0 -842
- package/dist/index-Xdf4XpRc.js.map +0 -1
- package/dist/index.js +0 -108
- package/dist/index.js.map +0 -1
- package/dist/queryConstants-DFKKEEo0.js +0 -33
- package/dist/queryConstants-DFKKEEo0.js.map +0 -1
- package/dist/renderFunctions-BCW1POD1.js +0 -52
- package/dist/renderFunctions-BCW1POD1.js.map +0 -1
- package/dist/stripe.esm-DuZ_gsAa.js +0 -130
- package/dist/stripe.esm-DuZ_gsAa.js.map +0 -1
- package/dist/useAccountsApi-qzNkKYfX.js +0 -58
- package/dist/useAccountsApi-qzNkKYfX.js.map +0 -1
- package/dist/useIntegrationsApi-DkA7eXBT.js +0 -24
- package/dist/useIntegrationsApi-DkA7eXBT.js.map +0 -1
- package/dist/usePaymentApi-B1qMca2A.js +0 -53
- package/dist/usePaymentApi-B1qMca2A.js.map +0 -1
- package/dist/usePaymentApi-D8FEXicG.js +0 -37
- package/dist/usePaymentApi-D8FEXicG.js.map +0 -1
- package/dist/usePaymentApi-jZmkutky.js +0 -38
- package/dist/usePaymentApi-jZmkutky.js.map +0 -1
- package/dist/usePlatformApi-0sGcYfsx.js +0 -79
- package/dist/usePlatformApi-0sGcYfsx.js.map +0 -1
- package/dist/useRazorpayPayment.js +0 -111
- package/dist/useRazorpayPayment.js.map +0 -1
- package/dist/useStripePromise.js +0 -55
- package/dist/useStripePromise.js.map +0 -1
|
@@ -1,1118 +0,0 @@
|
|
|
1
|
-
import _defineProperty from '@babel/runtime/helpers/defineProperty';
|
|
2
|
-
import _toConsumableArray from '@babel/runtime/helpers/toConsumableArray';
|
|
3
|
-
import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
|
|
4
|
-
import { useState, startTransition, useEffect } from 'react';
|
|
5
|
-
import { DEFAULT_PAGE_INDEX, DEFAULT_PAGE_SIZE } from '@bigbinary/neeto-commons-frontend/constants';
|
|
6
|
-
import { currencyFormat, getQueryParams, buildUrl } from '@bigbinary/neeto-commons-frontend/utils';
|
|
7
|
-
import { buildFiltersFromURL } from '@bigbinary/neeto-filters-frontend/utils';
|
|
8
|
-
import Spinner from '@bigbinary/neetoui/Spinner';
|
|
9
|
-
import { mergeLeft, curry, mergeDeepWith, concat, reject, isNil, map, prop, sortBy, isEmpty, modify, pluck } from 'ramda';
|
|
10
|
-
import { useHistory } from 'react-router-dom';
|
|
11
|
-
import { E as ExportModal } from './ExportModal-BnP3xriD.js';
|
|
12
|
-
import { useQuery } from '@tanstack/react-query';
|
|
13
|
-
import { useMutationWithInvalidation } from '@bigbinary/neeto-commons-frontend/react-utils';
|
|
14
|
-
import axios from 'axios';
|
|
15
|
-
import { B as BASE_URL, v as preProcessStatus, w as getTagStyle, l as formatAmount, m as formatCurrency, x as PAYMENT_KIND, S as SORT_DIRECTIONS, p as processDataIndex, D as DEFAULT_SORT_PROPERTIES, s as shouldTabsVisible, U as UN_HIDEABLE_COLUMNS, i as DEFAULT_PAGE_VALUES, q as DASHBOARD_KIND } from './index-Xdf4XpRc.js';
|
|
16
|
-
import { Q as QUERY_KEYS } from './queryConstants-DFKKEEo0.js';
|
|
17
|
-
import Modal from '@bigbinary/neetoui/Modal';
|
|
18
|
-
import Typography from '@bigbinary/neetoui/Typography';
|
|
19
|
-
import Form from '@bigbinary/neetoui/formik/Form';
|
|
20
|
-
import Textarea from '@bigbinary/neetoui/formik/Textarea';
|
|
21
|
-
import ActionBlock from '@bigbinary/neetoui/formik/ActionBlock';
|
|
22
|
-
import { useTranslation, Trans } from 'react-i18next';
|
|
23
|
-
import { t } from 'i18next';
|
|
24
|
-
import * as yup from 'yup';
|
|
25
|
-
import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
|
|
26
|
-
import { isNotPresent, humanize, isPresent, removeBy, camelToSnakeCase, isNotEmpty, existsBy } from '@bigbinary/neeto-cist';
|
|
27
|
-
import { useTableConfigurations } from '@bigbinary/neeto-molecules/Columns';
|
|
28
|
-
import TableWrapper from '@bigbinary/neeto-molecules/TableWrapper';
|
|
29
|
-
import Table from '@bigbinary/neetoui/Table';
|
|
30
|
-
import NoData from '@bigbinary/neetoui/NoData';
|
|
31
|
-
import { T as TABLE_KEYS } from './exportChannel-h2JJKPT1.js';
|
|
32
|
-
import HelpPopover from '@bigbinary/neeto-molecules/HelpPopover';
|
|
33
|
-
import Pane from '@bigbinary/neetoui/Pane';
|
|
34
|
-
import Button from '@bigbinary/neetoui/Button';
|
|
35
|
-
import Tag from '@bigbinary/neetoui/Tag';
|
|
36
|
-
import Tooltip from '@bigbinary/neetoui/Tooltip';
|
|
37
|
-
import DateFormat from '@bigbinary/neeto-molecules/DateFormat';
|
|
38
|
-
import { C as CopyButtonWrapper } from './CopyButtonWrapper-SoJkwX-d.js';
|
|
39
|
-
import FiltersBar from '@bigbinary/neeto-filters-frontend/Bar';
|
|
40
|
-
import Header from '@bigbinary/neeto-molecules/Header';
|
|
41
|
-
import SubHeader from '@bigbinary/neeto-molecules/SubHeader';
|
|
42
|
-
import Tab from '@bigbinary/neetoui/Tab';
|
|
43
|
-
import Dropdown from '@bigbinary/neetoui/Dropdown';
|
|
44
|
-
import '@bigbinary/neeto-icons/Download';
|
|
45
|
-
import 'decimal.js';
|
|
46
|
-
import '@bigbinary/neeto-molecules/CopyToClipboardButton';
|
|
47
|
-
|
|
48
|
-
var list = function list(payload) {
|
|
49
|
-
return axios.get("".concat(BASE_URL, "/api/v1/split_transfers"), {
|
|
50
|
-
params: payload
|
|
51
|
-
});
|
|
52
|
-
};
|
|
53
|
-
var show = function show(id) {
|
|
54
|
-
return axios.get("".concat(BASE_URL, "/api/v1/split_transfers/").concat(id));
|
|
55
|
-
};
|
|
56
|
-
var bulkUpdate = function bulkUpdate(payload) {
|
|
57
|
-
return axios.post("".concat(BASE_URL, "/api/v1/split_transfers/bulk_update"), {
|
|
58
|
-
splitTransfer: payload
|
|
59
|
-
});
|
|
60
|
-
};
|
|
61
|
-
var splitTransfersApi = {
|
|
62
|
-
list: list,
|
|
63
|
-
show: show,
|
|
64
|
-
bulkUpdate: bulkUpdate
|
|
65
|
-
};
|
|
66
|
-
|
|
67
|
-
function ownKeys$2(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; }
|
|
68
|
-
function _objectSpread$2(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$2(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$2(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
69
|
-
var useFetchSplitTransfers = function useFetchSplitTransfers() {
|
|
70
|
-
var payload = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
71
|
-
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
72
|
-
return useQuery(_objectSpread$2({
|
|
73
|
-
queryKey: [QUERY_KEYS.SPLIT_TRANSFERS_LIST, payload],
|
|
74
|
-
queryFn: function queryFn() {
|
|
75
|
-
return splitTransfersApi.list(payload);
|
|
76
|
-
}
|
|
77
|
-
}, options));
|
|
78
|
-
};
|
|
79
|
-
var useShowSplitTransfers = function useShowSplitTransfers(id, options) {
|
|
80
|
-
return useQuery(_objectSpread$2({
|
|
81
|
-
queryKey: [QUERY_KEYS.SPLIT_TRANSFERS_DETAILS, id],
|
|
82
|
-
queryFn: function queryFn() {
|
|
83
|
-
return splitTransfersApi.show(id);
|
|
84
|
-
}
|
|
85
|
-
}, options));
|
|
86
|
-
};
|
|
87
|
-
var useBulkUpdateSplitTransfers = function useBulkUpdateSplitTransfers(options) {
|
|
88
|
-
return useMutationWithInvalidation(splitTransfersApi.bulkUpdate, _objectSpread$2({
|
|
89
|
-
keysToInvalidate: [QUERY_KEYS.SPLIT_TRANSFERS_LISTw]
|
|
90
|
-
}, options));
|
|
91
|
-
};
|
|
92
|
-
|
|
93
|
-
var SPLIT_TRANSFERS_DASHBOARD_TAB = {
|
|
94
|
-
all: "all",
|
|
95
|
-
successful: "successful",
|
|
96
|
-
cancelled: "cancelled",
|
|
97
|
-
pending: "pending"
|
|
98
|
-
};
|
|
99
|
-
var SEARCH_PROPS = {
|
|
100
|
-
node: "identifier,",
|
|
101
|
-
key: "search_term",
|
|
102
|
-
model: "NeetoPaymentsEngine::Payments::Split,"
|
|
103
|
-
};
|
|
104
|
-
var FILTER_COLUMNS = [{
|
|
105
|
-
key: "amount",
|
|
106
|
-
label: t("neetoPayments.common.amount"),
|
|
107
|
-
node: "amount",
|
|
108
|
-
type: "decimal"
|
|
109
|
-
}, {
|
|
110
|
-
key: "payment_at",
|
|
111
|
-
label: t("neetoPayments.common.transferTime"),
|
|
112
|
-
node: "payment_at",
|
|
113
|
-
type: "date"
|
|
114
|
-
}];
|
|
115
|
-
var INITIAL_TRANSFER_DETAILS = {
|
|
116
|
-
id: null,
|
|
117
|
-
isPaneOpen: false
|
|
118
|
-
};
|
|
119
|
-
var VALIDATION_SCHEMA = yup.object().shape({
|
|
120
|
-
reason: yup.string().required(t("neetoPayments.cancelSplitTransfers.reasonRequired"))
|
|
121
|
-
});
|
|
122
|
-
|
|
123
|
-
var CancelModal = function CancelModal(_ref) {
|
|
124
|
-
var isOpen = _ref.isOpen,
|
|
125
|
-
onClose = _ref.onClose,
|
|
126
|
-
handleSplitTransfersUpdate = _ref.handleSplitTransfersUpdate;
|
|
127
|
-
var _useTranslation = useTranslation(),
|
|
128
|
-
t = _useTranslation.t;
|
|
129
|
-
var handleSubmit = function handleSubmit(_ref2) {
|
|
130
|
-
var reason = _ref2.reason;
|
|
131
|
-
handleSplitTransfersUpdate("cancelled", reason);
|
|
132
|
-
};
|
|
133
|
-
return /*#__PURE__*/jsxs(Modal, {
|
|
134
|
-
isOpen: isOpen,
|
|
135
|
-
onClose: onClose,
|
|
136
|
-
size: "large",
|
|
137
|
-
children: [/*#__PURE__*/jsx(Modal.Header, {
|
|
138
|
-
children: /*#__PURE__*/jsx(Typography, {
|
|
139
|
-
style: "h2",
|
|
140
|
-
weight: "medium",
|
|
141
|
-
children: t("neetoPayments.cancelSplitTransfers.modal.title")
|
|
142
|
-
})
|
|
143
|
-
}), /*#__PURE__*/jsx(Form, {
|
|
144
|
-
formikProps: {
|
|
145
|
-
initialValues: {
|
|
146
|
-
reason: ""
|
|
147
|
-
},
|
|
148
|
-
validationSchema: VALIDATION_SCHEMA,
|
|
149
|
-
onSubmit: handleSubmit
|
|
150
|
-
},
|
|
151
|
-
children: /*#__PURE__*/jsxs(Fragment, {
|
|
152
|
-
children: [/*#__PURE__*/jsx(Modal.Body, {
|
|
153
|
-
children: /*#__PURE__*/jsx("div", {
|
|
154
|
-
className: "flex flex-col space-y-4",
|
|
155
|
-
children: /*#__PURE__*/jsx(Textarea, {
|
|
156
|
-
required: true,
|
|
157
|
-
label: t("neetoPayments.cancelSplitTransfers.modal.reason"),
|
|
158
|
-
name: "reason"
|
|
159
|
-
})
|
|
160
|
-
})
|
|
161
|
-
}), /*#__PURE__*/jsx(Modal.Footer, {
|
|
162
|
-
children: /*#__PURE__*/jsx(ActionBlock, {
|
|
163
|
-
position: "right",
|
|
164
|
-
cancelButtonProps: {
|
|
165
|
-
onClick: onClose,
|
|
166
|
-
style: "tertiary"
|
|
167
|
-
},
|
|
168
|
-
submitButtonProps: {
|
|
169
|
-
disabled: false,
|
|
170
|
-
label: t("neetoPayments.common.submit")
|
|
171
|
-
}
|
|
172
|
-
})
|
|
173
|
-
})]
|
|
174
|
-
})
|
|
175
|
-
})]
|
|
176
|
-
});
|
|
177
|
-
};
|
|
178
|
-
|
|
179
|
-
var Status = function Status(_ref) {
|
|
180
|
-
var type = _ref.type,
|
|
181
|
-
_ref$status = _ref.status,
|
|
182
|
-
status = _ref$status === void 0 ? "" : _ref$status;
|
|
183
|
-
var _useTranslation = useTranslation(),
|
|
184
|
-
t = _useTranslation.t;
|
|
185
|
-
var processedStatus = preProcessStatus(type, status);
|
|
186
|
-
if (isNotPresent(status)) {
|
|
187
|
-
return /*#__PURE__*/jsx(Typography, {
|
|
188
|
-
style: "body2",
|
|
189
|
-
children: t("neetoPayments.common.notAvailable")
|
|
190
|
-
});
|
|
191
|
-
}
|
|
192
|
-
return /*#__PURE__*/jsx(Tooltip, {
|
|
193
|
-
content: t("neetoPayments.tooltipContent.".concat(type, ".").concat(processedStatus)),
|
|
194
|
-
position: "top",
|
|
195
|
-
children: /*#__PURE__*/jsx("div", {
|
|
196
|
-
className: "w-fit",
|
|
197
|
-
children: /*#__PURE__*/jsx(Tag, {
|
|
198
|
-
style: getTagStyle(processedStatus),
|
|
199
|
-
label: humanize(t("neetoPayments.tagLabels.".concat(type, ".").concat(processedStatus)))
|
|
200
|
-
})
|
|
201
|
-
})
|
|
202
|
-
});
|
|
203
|
-
};
|
|
204
|
-
|
|
205
|
-
var Date = function Date(_ref) {
|
|
206
|
-
var date = _ref.date,
|
|
207
|
-
_ref$isTimeVisible = _ref.isTimeVisible,
|
|
208
|
-
isTimeVisible = _ref$isTimeVisible === void 0 ? false : _ref$isTimeVisible;
|
|
209
|
-
var _useTranslation = useTranslation(),
|
|
210
|
-
t = _useTranslation.t;
|
|
211
|
-
if (isNotPresent(date)) {
|
|
212
|
-
return /*#__PURE__*/jsx(Typography, {
|
|
213
|
-
style: "body2",
|
|
214
|
-
children: t("neetoPayments.common.notAvailable")
|
|
215
|
-
});
|
|
216
|
-
}
|
|
217
|
-
if (isTimeVisible) {
|
|
218
|
-
return /*#__PURE__*/jsx("div", {
|
|
219
|
-
className: "flex items-center",
|
|
220
|
-
children: /*#__PURE__*/jsx(DateFormat.DateTime, {
|
|
221
|
-
date: date
|
|
222
|
-
})
|
|
223
|
-
});
|
|
224
|
-
}
|
|
225
|
-
return /*#__PURE__*/jsx("div", {
|
|
226
|
-
className: "flex items-center",
|
|
227
|
-
children: /*#__PURE__*/jsx(DateFormat.Date, {
|
|
228
|
-
date: date
|
|
229
|
-
})
|
|
230
|
-
});
|
|
231
|
-
};
|
|
232
|
-
|
|
233
|
-
var DiscountCode = function DiscountCode(_ref) {
|
|
234
|
-
var discountCode = _ref.discountCode,
|
|
235
|
-
currency = _ref.currency;
|
|
236
|
-
var _useTranslation = useTranslation(),
|
|
237
|
-
t = _useTranslation.t;
|
|
238
|
-
var code = discountCode.code,
|
|
239
|
-
value = discountCode.value,
|
|
240
|
-
kind = discountCode.kind;
|
|
241
|
-
return /*#__PURE__*/jsx(Typography, {
|
|
242
|
-
style: "body2",
|
|
243
|
-
children: kind === "percentage" ? t("neetoPayments.splitTransferDetails.discountCodeOfPercentageApplied", {
|
|
244
|
-
code: code,
|
|
245
|
-
percentage: value.toFixed(1)
|
|
246
|
-
}) : t("neetoPayments.splitTransferDetails.discountCodeOfAmountApplied", {
|
|
247
|
-
code: code,
|
|
248
|
-
amount: currencyFormat.withSymbol(value, currency.toUpperCase(), {
|
|
249
|
-
maximumFractionDigits: 2,
|
|
250
|
-
minimumFractionDigits: 2
|
|
251
|
-
})
|
|
252
|
-
})
|
|
253
|
-
});
|
|
254
|
-
};
|
|
255
|
-
|
|
256
|
-
var Details = function Details(_ref) {
|
|
257
|
-
var _splitTransfer$source, _splitTransfer$curren, _splitTransfer$source2, _splitTransfer$curren2, _splitTransfer$curren3, _splitTransfer$curren4, _splitTransfer$destin, _splitTransfer$destin2, _splitTransfer$destin3;
|
|
258
|
-
var selectedTransfer = _ref.selectedTransfer,
|
|
259
|
-
setSelectedTransfer = _ref.setSelectedTransfer;
|
|
260
|
-
var _useTranslation = useTranslation(),
|
|
261
|
-
t = _useTranslation.t;
|
|
262
|
-
var _useShowSplitTransfer = useShowSplitTransfers(selectedTransfer["id"], {
|
|
263
|
-
enabled: isPresent(selectedTransfer["id"])
|
|
264
|
-
}),
|
|
265
|
-
isPending = _useShowSplitTransfer.isPending,
|
|
266
|
-
_useShowSplitTransfer2 = _useShowSplitTransfer.data,
|
|
267
|
-
_useShowSplitTransfer3 = _useShowSplitTransfer2 === void 0 ? {} : _useShowSplitTransfer2,
|
|
268
|
-
splitTransfer = _useShowSplitTransfer3.splitTransfer;
|
|
269
|
-
return /*#__PURE__*/jsxs(Pane, {
|
|
270
|
-
isOpen: selectedTransfer["isPaneOpen"],
|
|
271
|
-
size: "large",
|
|
272
|
-
onClose: function onClose() {
|
|
273
|
-
return setSelectedTransfer(mergeLeft({
|
|
274
|
-
isPaneOpen: false
|
|
275
|
-
}, selectedTransfer));
|
|
276
|
-
},
|
|
277
|
-
children: [/*#__PURE__*/jsx(Pane.Header, {
|
|
278
|
-
children: /*#__PURE__*/jsx(Typography, {
|
|
279
|
-
style: "h2",
|
|
280
|
-
children: t("neetoPayments.splitTransferDetails.title")
|
|
281
|
-
})
|
|
282
|
-
}), /*#__PURE__*/jsx(Pane.Body, {
|
|
283
|
-
children: isPending ? /*#__PURE__*/jsx("div", {
|
|
284
|
-
className: "flex h-full w-full items-center justify-center",
|
|
285
|
-
children: /*#__PURE__*/jsx(Spinner, {})
|
|
286
|
-
}) : /*#__PURE__*/jsxs("div", {
|
|
287
|
-
className: "space-y-4 p-3",
|
|
288
|
-
children: [/*#__PURE__*/jsxs("div", {
|
|
289
|
-
className: "flex grid-cols-2 flex-col gap-3 lg:grid",
|
|
290
|
-
children: [/*#__PURE__*/jsx(Typography, {
|
|
291
|
-
style: "body1",
|
|
292
|
-
weight: "medium",
|
|
293
|
-
children: t("neetoPayments.common.identifier")
|
|
294
|
-
}), /*#__PURE__*/jsx(Button, {
|
|
295
|
-
href: splitTransfer.transferUrl,
|
|
296
|
-
label: splitTransfer.identifier,
|
|
297
|
-
size: "small",
|
|
298
|
-
style: "link",
|
|
299
|
-
target: "_blank"
|
|
300
|
-
}), /*#__PURE__*/jsx(Typography, {
|
|
301
|
-
style: "body1",
|
|
302
|
-
weight: "medium",
|
|
303
|
-
children: t("neetoPayments.common.status")
|
|
304
|
-
}), /*#__PURE__*/jsx(Status, {
|
|
305
|
-
status: splitTransfer.status,
|
|
306
|
-
type: "splitTransfers"
|
|
307
|
-
}), /*#__PURE__*/jsx(Typography, {
|
|
308
|
-
style: "body1",
|
|
309
|
-
weight: "medium",
|
|
310
|
-
children: t("neetoPayments.common.transferTime")
|
|
311
|
-
}), /*#__PURE__*/jsx(Date, {
|
|
312
|
-
isTimeVisible: true,
|
|
313
|
-
date: splitTransfer.paymentAt
|
|
314
|
-
}), /*#__PURE__*/jsx(Typography, {
|
|
315
|
-
style: "body1",
|
|
316
|
-
weight: "medium",
|
|
317
|
-
children: t("neetoPayments.common.paymentAmount")
|
|
318
|
-
}), /*#__PURE__*/jsx(Typography, {
|
|
319
|
-
style: "body2",
|
|
320
|
-
children: currencyFormat.withCode((_splitTransfer$source = splitTransfer.sourcePayment) === null || _splitTransfer$source === void 0 ? void 0 : _splitTransfer$source.amount, (_splitTransfer$curren = splitTransfer.currency) === null || _splitTransfer$curren === void 0 ? void 0 : _splitTransfer$curren.toUpperCase())
|
|
321
|
-
}), isPresent(splitTransfer.discountCode) && /*#__PURE__*/jsxs(Fragment, {
|
|
322
|
-
children: [/*#__PURE__*/jsx(Typography, {
|
|
323
|
-
style: "body1",
|
|
324
|
-
weight: "medium",
|
|
325
|
-
children: t("neetoPayments.common.discountCode")
|
|
326
|
-
}), /*#__PURE__*/jsx(DiscountCode, {
|
|
327
|
-
currency: splitTransfer.currency,
|
|
328
|
-
discountCode: splitTransfer.discountCode
|
|
329
|
-
})]
|
|
330
|
-
}), /*#__PURE__*/jsxs("div", {
|
|
331
|
-
className: "flex items-center space-x-1",
|
|
332
|
-
children: [/*#__PURE__*/jsx(Typography, {
|
|
333
|
-
style: "body1",
|
|
334
|
-
weight: "medium",
|
|
335
|
-
children: t("neetoPayments.common.netAmount")
|
|
336
|
-
}), /*#__PURE__*/jsx(HelpPopover, {
|
|
337
|
-
popoverProps: {
|
|
338
|
-
position: "right"
|
|
339
|
-
},
|
|
340
|
-
description: t("neetoPayments.splitTransferDetails.netAmountDescription"),
|
|
341
|
-
title: t("neetoPayments.splitTransferDetails.netAmountHelpTitle")
|
|
342
|
-
})]
|
|
343
|
-
}), /*#__PURE__*/jsx(Typography, {
|
|
344
|
-
style: "body2",
|
|
345
|
-
children: currencyFormat.withCode((_splitTransfer$source2 = splitTransfer.sourcePayment) === null || _splitTransfer$source2 === void 0 ? void 0 : _splitTransfer$source2.netAmount, (_splitTransfer$curren2 = splitTransfer.currency) === null || _splitTransfer$curren2 === void 0 ? void 0 : _splitTransfer$curren2.toUpperCase())
|
|
346
|
-
}), /*#__PURE__*/jsxs("div", {
|
|
347
|
-
className: "flex space-x-1",
|
|
348
|
-
children: [/*#__PURE__*/jsx(Typography, {
|
|
349
|
-
style: "body1",
|
|
350
|
-
weight: "medium",
|
|
351
|
-
children: t("neetoPayments.common.platformShare")
|
|
352
|
-
}), /*#__PURE__*/jsx(HelpPopover, {
|
|
353
|
-
popoverProps: {
|
|
354
|
-
position: "right"
|
|
355
|
-
},
|
|
356
|
-
description: t("neetoPayments.splitTransferDetails.platformShareDescription"),
|
|
357
|
-
title: t("neetoPayments.splitTransferDetails.platformShareHelpTitle")
|
|
358
|
-
})]
|
|
359
|
-
}), /*#__PURE__*/jsx(Typography, {
|
|
360
|
-
style: "body2",
|
|
361
|
-
children: currencyFormat.withCode(splitTransfer.platformShare, (_splitTransfer$curren3 = splitTransfer.currency) === null || _splitTransfer$curren3 === void 0 ? void 0 : _splitTransfer$curren3.toUpperCase())
|
|
362
|
-
}), /*#__PURE__*/jsx(Typography, {
|
|
363
|
-
style: "body1",
|
|
364
|
-
weight: "medium",
|
|
365
|
-
children: t("neetoPayments.common.transferredAmount")
|
|
366
|
-
}), /*#__PURE__*/jsx(Typography, {
|
|
367
|
-
style: "body2",
|
|
368
|
-
children: currencyFormat.withCode(splitTransfer.amount, (_splitTransfer$curren4 = splitTransfer.currency) === null || _splitTransfer$curren4 === void 0 ? void 0 : _splitTransfer$curren4.toUpperCase())
|
|
369
|
-
})]
|
|
370
|
-
}), /*#__PURE__*/jsx(Typography, {
|
|
371
|
-
style: "h3",
|
|
372
|
-
children: t("neetoPayments.splitTransferDetails.destinationDetails")
|
|
373
|
-
}), /*#__PURE__*/jsxs("div", {
|
|
374
|
-
className: "flex grid-cols-2 flex-col gap-3 lg:grid",
|
|
375
|
-
children: [/*#__PURE__*/jsx(Typography, {
|
|
376
|
-
style: "body1",
|
|
377
|
-
weight: "medium",
|
|
378
|
-
children: t("neetoPayments.common.destinationAccountIdentifier")
|
|
379
|
-
}), /*#__PURE__*/jsx(Button, {
|
|
380
|
-
href: splitTransfer.destinationAccount.dashboardUrl,
|
|
381
|
-
label: splitTransfer.destinationAccount.identifier,
|
|
382
|
-
size: "small",
|
|
383
|
-
style: "link",
|
|
384
|
-
target: "_blank"
|
|
385
|
-
}), /*#__PURE__*/jsx(Typography, {
|
|
386
|
-
style: "body1",
|
|
387
|
-
weight: "medium",
|
|
388
|
-
children: t("neetoPayments.common.destinationAccountName")
|
|
389
|
-
}), /*#__PURE__*/jsx(Typography, {
|
|
390
|
-
style: "body2",
|
|
391
|
-
children: splitTransfer.destinationAccount.userName
|
|
392
|
-
}), /*#__PURE__*/jsx(Typography, {
|
|
393
|
-
style: "body1",
|
|
394
|
-
weight: "medium",
|
|
395
|
-
children: t("neetoPayments.common.destinationAccountEmail")
|
|
396
|
-
}), /*#__PURE__*/jsx(Typography, {
|
|
397
|
-
style: "body2",
|
|
398
|
-
children: splitTransfer.destinationAccount.userEmail
|
|
399
|
-
}), /*#__PURE__*/jsx(Typography, {
|
|
400
|
-
style: "body1",
|
|
401
|
-
weight: "medium",
|
|
402
|
-
children: t("neetoPayments.common.payoutStatus")
|
|
403
|
-
}), /*#__PURE__*/jsx(Status, {
|
|
404
|
-
status: (_splitTransfer$destin = splitTransfer.destinationPayout) === null || _splitTransfer$destin === void 0 ? void 0 : _splitTransfer$destin.status,
|
|
405
|
-
type: "payout"
|
|
406
|
-
}), /*#__PURE__*/jsx(Typography, {
|
|
407
|
-
style: "body1",
|
|
408
|
-
weight: "medium",
|
|
409
|
-
children: t("neetoPayments.splitTransferDetails.payoutInitiatedDate")
|
|
410
|
-
}), /*#__PURE__*/jsx(Date, {
|
|
411
|
-
date: (_splitTransfer$destin2 = splitTransfer.destinationPayout) === null || _splitTransfer$destin2 === void 0 ? void 0 : _splitTransfer$destin2.createdAt
|
|
412
|
-
}), /*#__PURE__*/jsx(Typography, {
|
|
413
|
-
style: "body1",
|
|
414
|
-
weight: "medium",
|
|
415
|
-
children: t("neetoPayments.splitTransferDetails.payoutArrivalDate")
|
|
416
|
-
}), /*#__PURE__*/jsx(Date, {
|
|
417
|
-
date: (_splitTransfer$destin3 = splitTransfer.destinationPayout) === null || _splitTransfer$destin3 === void 0 ? void 0 : _splitTransfer$destin3.arrivalDate
|
|
418
|
-
}), /*#__PURE__*/jsx("div", {})]
|
|
419
|
-
})]
|
|
420
|
-
})
|
|
421
|
-
})]
|
|
422
|
-
});
|
|
423
|
-
};
|
|
424
|
-
|
|
425
|
-
var renderIdentifier = curry(function (setSelectedTransfer, identifier, _ref) {
|
|
426
|
-
var id = _ref.id;
|
|
427
|
-
if (isNotPresent(identifier)) {
|
|
428
|
-
return /*#__PURE__*/jsx(Tooltip, {
|
|
429
|
-
content: t("neetoPayments.tooltipContent.identifierUnavailable"),
|
|
430
|
-
position: "top",
|
|
431
|
-
children: /*#__PURE__*/jsx("div", {
|
|
432
|
-
className: "text-center",
|
|
433
|
-
children: /*#__PURE__*/jsx(Typography, {
|
|
434
|
-
style: "body2",
|
|
435
|
-
children: t("neetoPayments.common.notAvailable")
|
|
436
|
-
})
|
|
437
|
-
})
|
|
438
|
-
});
|
|
439
|
-
}
|
|
440
|
-
return /*#__PURE__*/jsx(CopyButtonWrapper, {
|
|
441
|
-
content: identifier,
|
|
442
|
-
children: /*#__PURE__*/jsx(Button, {
|
|
443
|
-
label: identifier,
|
|
444
|
-
size: "small",
|
|
445
|
-
style: "link",
|
|
446
|
-
onClick: function onClick() {
|
|
447
|
-
return setSelectedTransfer({
|
|
448
|
-
id: id,
|
|
449
|
-
isPaneOpen: true
|
|
450
|
-
});
|
|
451
|
-
}
|
|
452
|
-
})
|
|
453
|
-
});
|
|
454
|
-
});
|
|
455
|
-
var renderPlatformPaymentIdentifier = function renderPlatformPaymentIdentifier(_ref2) {
|
|
456
|
-
var identifier = _ref2.identifier,
|
|
457
|
-
receiptUrl = _ref2.receiptUrl,
|
|
458
|
-
kind = _ref2.kind;
|
|
459
|
-
if (kind === PAYMENT_KIND.temporary) {
|
|
460
|
-
return /*#__PURE__*/jsx(CopyButtonWrapper, {
|
|
461
|
-
content: identifier,
|
|
462
|
-
children: identifier
|
|
463
|
-
});
|
|
464
|
-
}
|
|
465
|
-
return /*#__PURE__*/jsx(CopyButtonWrapper, {
|
|
466
|
-
content: identifier,
|
|
467
|
-
children: /*#__PURE__*/jsx(Button, {
|
|
468
|
-
href: receiptUrl,
|
|
469
|
-
label: identifier,
|
|
470
|
-
size: "small",
|
|
471
|
-
style: "link",
|
|
472
|
-
target: "_blank"
|
|
473
|
-
})
|
|
474
|
-
});
|
|
475
|
-
};
|
|
476
|
-
var renderDestinationAccountIdentifier = function renderDestinationAccountIdentifier(_ref3) {
|
|
477
|
-
var identifier = _ref3.identifier,
|
|
478
|
-
dashboardUrl = _ref3.dashboardUrl;
|
|
479
|
-
return /*#__PURE__*/jsx(CopyButtonWrapper, {
|
|
480
|
-
content: identifier,
|
|
481
|
-
children: /*#__PURE__*/jsx(Button, {
|
|
482
|
-
href: dashboardUrl,
|
|
483
|
-
label: identifier,
|
|
484
|
-
size: "small",
|
|
485
|
-
style: "link",
|
|
486
|
-
target: "_blank"
|
|
487
|
-
})
|
|
488
|
-
});
|
|
489
|
-
};
|
|
490
|
-
var renderStatus = curry(function (type, status) {
|
|
491
|
-
return /*#__PURE__*/jsx(Status, {
|
|
492
|
-
status: status,
|
|
493
|
-
type: type
|
|
494
|
-
});
|
|
495
|
-
});
|
|
496
|
-
var renderDate = function renderDate(date) {
|
|
497
|
-
if (isNotPresent(date)) {
|
|
498
|
-
return /*#__PURE__*/jsx(Tooltip, {
|
|
499
|
-
content: t("neetoPayments.tooltipContent.dateUnavailable"),
|
|
500
|
-
position: "top",
|
|
501
|
-
children: /*#__PURE__*/jsx("div", {
|
|
502
|
-
className: "text-center",
|
|
503
|
-
children: /*#__PURE__*/jsx(Typography, {
|
|
504
|
-
style: "body2",
|
|
505
|
-
children: t("neetoPayments.common.notAvailable")
|
|
506
|
-
})
|
|
507
|
-
})
|
|
508
|
-
});
|
|
509
|
-
}
|
|
510
|
-
return /*#__PURE__*/jsx(DateFormat.DateTime, {
|
|
511
|
-
date: date
|
|
512
|
-
});
|
|
513
|
-
};
|
|
514
|
-
var renderPlatformShare = function renderPlatformShare(amount) {
|
|
515
|
-
if (isNotPresent(amount)) {
|
|
516
|
-
return /*#__PURE__*/jsx(Tooltip, {
|
|
517
|
-
content: t("neetoPayments.tooltipContent.platformShareUnavailable"),
|
|
518
|
-
position: "top",
|
|
519
|
-
children: /*#__PURE__*/jsx(Typography, {
|
|
520
|
-
style: "body2",
|
|
521
|
-
children: t("neetoPayments.common.notCalculated")
|
|
522
|
-
})
|
|
523
|
-
});
|
|
524
|
-
}
|
|
525
|
-
return formatAmount(amount);
|
|
526
|
-
};
|
|
527
|
-
var getDefaultColumns = function getDefaultColumns(setSelectedTransfer) {
|
|
528
|
-
return [{
|
|
529
|
-
title: t("neetoPayments.common.id"),
|
|
530
|
-
dataIndex: "rowId",
|
|
531
|
-
key: "rowId",
|
|
532
|
-
width: 85,
|
|
533
|
-
position: 0,
|
|
534
|
-
isHidable: false
|
|
535
|
-
}, {
|
|
536
|
-
title: t("neetoPayments.common.identifier"),
|
|
537
|
-
dataIndex: "identifier",
|
|
538
|
-
key: "identifier",
|
|
539
|
-
width: 300,
|
|
540
|
-
render: renderIdentifier(setSelectedTransfer),
|
|
541
|
-
position: 1,
|
|
542
|
-
isHidable: false
|
|
543
|
-
}, {
|
|
544
|
-
title: t("neetoPayments.common.status"),
|
|
545
|
-
dataIndex: "status",
|
|
546
|
-
key: "status",
|
|
547
|
-
width: 150,
|
|
548
|
-
render: renderStatus("splitTransfers"),
|
|
549
|
-
sorter: true,
|
|
550
|
-
position: 2,
|
|
551
|
-
isHidable: false
|
|
552
|
-
}, {
|
|
553
|
-
title: t("neetoPayments.common.amount"),
|
|
554
|
-
dataIndex: "amount",
|
|
555
|
-
key: "amount",
|
|
556
|
-
width: 150,
|
|
557
|
-
sorter: true,
|
|
558
|
-
render: formatAmount,
|
|
559
|
-
position: 3
|
|
560
|
-
}, {
|
|
561
|
-
title: t("neetoPayments.common.currency"),
|
|
562
|
-
dataIndex: "currency",
|
|
563
|
-
key: "currency",
|
|
564
|
-
width: 160,
|
|
565
|
-
sorter: true,
|
|
566
|
-
render: formatCurrency,
|
|
567
|
-
position: 3
|
|
568
|
-
}, {
|
|
569
|
-
title: t("neetoPayments.common.platformShare"),
|
|
570
|
-
dataIndex: "platformShare",
|
|
571
|
-
key: "platformShare",
|
|
572
|
-
width: 205,
|
|
573
|
-
render: renderPlatformShare,
|
|
574
|
-
sorter: true,
|
|
575
|
-
position: 3
|
|
576
|
-
}, {
|
|
577
|
-
title: t("neetoPayments.common.transferTime"),
|
|
578
|
-
dataIndex: "paymentAt",
|
|
579
|
-
key: "paymentAt",
|
|
580
|
-
width: 190,
|
|
581
|
-
render: renderDate,
|
|
582
|
-
sorter: true,
|
|
583
|
-
position: 10
|
|
584
|
-
}, {
|
|
585
|
-
title: t("neetoPayments.common.platformPayment"),
|
|
586
|
-
dataIndex: "sourcePayment",
|
|
587
|
-
key: "sourcePayment",
|
|
588
|
-
render: renderPlatformPaymentIdentifier,
|
|
589
|
-
width: 300,
|
|
590
|
-
position: 19
|
|
591
|
-
}, {
|
|
592
|
-
title: t("neetoPayments.common.accountIdentifier"),
|
|
593
|
-
dataIndex: "destinationAccount",
|
|
594
|
-
key: "destinationAccount",
|
|
595
|
-
render: renderDestinationAccountIdentifier,
|
|
596
|
-
width: 320,
|
|
597
|
-
position: 20
|
|
598
|
-
}];
|
|
599
|
-
};
|
|
600
|
-
|
|
601
|
-
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; }
|
|
602
|
-
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; }
|
|
603
|
-
var buildSearchProps = function buildSearchProps(searchProps, searchTerm) {
|
|
604
|
-
return mergeDeepWith(concat, SEARCH_PROPS, mergeLeft({
|
|
605
|
-
value: searchTerm.trim()
|
|
606
|
-
}, searchProps));
|
|
607
|
-
};
|
|
608
|
-
var buildFilterColumns = function buildFilterColumns() {
|
|
609
|
-
var payableEntityColumns = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
610
|
-
return reject(isNil, concat(FILTER_COLUMNS, map(prop("filterProps"), payableEntityColumns)));
|
|
611
|
-
};
|
|
612
|
-
var buildTableColumns = function buildTableColumns(_ref) {
|
|
613
|
-
var tab = _ref.tab,
|
|
614
|
-
_ref$payableEntityCol = _ref.payableEntityColumns,
|
|
615
|
-
payableEntityColumns = _ref$payableEntityCol === void 0 ? [] : _ref$payableEntityCol,
|
|
616
|
-
setSelectedTransfer = _ref.setSelectedTransfer;
|
|
617
|
-
var filteredColumns = sortBy(prop("position"), concat(getDefaultColumns(setSelectedTransfer), payableEntityColumns));
|
|
618
|
-
if (tab === SPLIT_TRANSFERS_DASHBOARD_TAB.all) return filteredColumns;
|
|
619
|
-
return removeBy({
|
|
620
|
-
key: "status"
|
|
621
|
-
}, filteredColumns);
|
|
622
|
-
};
|
|
623
|
-
var buildRowData = function buildRowData(_ref2) {
|
|
624
|
-
var splitTransfers = _ref2.splitTransfers,
|
|
625
|
-
_ref2$pageProperties = _ref2.pageProperties,
|
|
626
|
-
pageProperties = _ref2$pageProperties === void 0 ? {} : _ref2$pageProperties;
|
|
627
|
-
return splitTransfers === null || splitTransfers === void 0 ? void 0 : splitTransfers.map(function (element, index) {
|
|
628
|
-
return _objectSpread$1(_objectSpread$1({}, element), {}, {
|
|
629
|
-
rowId: isEmpty(pageProperties) ? index + 1 : pageProperties.pageSize * (pageProperties.page - 1) + index + 1
|
|
630
|
-
});
|
|
631
|
-
});
|
|
632
|
-
};
|
|
633
|
-
|
|
634
|
-
var List = function List(_ref) {
|
|
635
|
-
var isFetching = _ref.isFetching,
|
|
636
|
-
splitTransfers = _ref.splitTransfers,
|
|
637
|
-
selectedRows = _ref.selectedRows,
|
|
638
|
-
views = _ref.views,
|
|
639
|
-
payableEntityColumns = _ref.payableEntityColumns,
|
|
640
|
-
pageProperties = _ref.pageProperties,
|
|
641
|
-
onRowSelect = _ref.onRowSelect,
|
|
642
|
-
setSortProperties = _ref.setSortProperties,
|
|
643
|
-
handleTablePagination = _ref.handleTablePagination,
|
|
644
|
-
setHasBulkSelectedAllRows = _ref.setHasBulkSelectedAllRows;
|
|
645
|
-
var _useState = useState(INITIAL_TRANSFER_DETAILS),
|
|
646
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
647
|
-
selectedTransfer = _useState2[0],
|
|
648
|
-
setSelectedTransfer = _useState2[1];
|
|
649
|
-
var _useTranslation = useTranslation(),
|
|
650
|
-
t = _useTranslation.t;
|
|
651
|
-
var _getQueryParams = getQueryParams(),
|
|
652
|
-
_getQueryParams$tab = _getQueryParams.tab,
|
|
653
|
-
tab = _getQueryParams$tab === void 0 ? SPLIT_TRANSFERS_DASHBOARD_TAB.all : _getQueryParams$tab;
|
|
654
|
-
var splitTransfersCount = views[tab];
|
|
655
|
-
var getRowSelection = function getRowSelection() {
|
|
656
|
-
if (tab === SPLIT_TRANSFERS_DASHBOARD_TAB.successful) return false;
|
|
657
|
-
if (tab === SPLIT_TRANSFERS_DASHBOARD_TAB.all) {
|
|
658
|
-
return {
|
|
659
|
-
getCheckboxProps: function getCheckboxProps(record) {
|
|
660
|
-
return {
|
|
661
|
-
disabled: record.status === SPLIT_TRANSFERS_DASHBOARD_TAB.successful
|
|
662
|
-
};
|
|
663
|
-
}
|
|
664
|
-
};
|
|
665
|
-
}
|
|
666
|
-
return true;
|
|
667
|
-
};
|
|
668
|
-
var allColumns = buildTableColumns({
|
|
669
|
-
tab: tab,
|
|
670
|
-
payableEntityColumns: payableEntityColumns,
|
|
671
|
-
setSelectedTransfer: setSelectedTransfer
|
|
672
|
-
});
|
|
673
|
-
var _useTableConfiguratio = useTableConfigurations("".concat(TABLE_KEYS.SPLIT_TRANSFERS_TABLE, "-").concat(tab), allColumns),
|
|
674
|
-
isTableConfigurationLoading = _useTableConfiguratio.isTableConfigurationLoading,
|
|
675
|
-
customizedColumns = _useTableConfiguratio.customizedColumns,
|
|
676
|
-
hideColumn = _useTableConfiguratio.hideColumn;
|
|
677
|
-
var handleTableChange = function handleTableChange(_, __, sorter) {
|
|
678
|
-
setSortProperties(isPresent(sorter === null || sorter === void 0 ? void 0 : sorter.column) ? {
|
|
679
|
-
sortBy: camelToSnakeCase(processDataIndex(sorter.field)),
|
|
680
|
-
orderBy: sorter.order === "ascend" ? "ASC" : "DESC"
|
|
681
|
-
} : DEFAULT_SORT_PROPERTIES);
|
|
682
|
-
};
|
|
683
|
-
if (isNotPresent(splitTransfers)) {
|
|
684
|
-
return /*#__PURE__*/jsx("div", {
|
|
685
|
-
className: "flex h-full w-full items-center justify-center",
|
|
686
|
-
children: /*#__PURE__*/jsx(NoData, {
|
|
687
|
-
title: tab === SPLIT_TRANSFERS_DASHBOARD_TAB.all ? t("neetoPayments.emptyState.splitTransfers") : t("neetoPayments.emptyState.splitTransfersWithStatus", {
|
|
688
|
-
status: tab
|
|
689
|
-
})
|
|
690
|
-
})
|
|
691
|
-
});
|
|
692
|
-
}
|
|
693
|
-
return /*#__PURE__*/jsxs(Fragment, {
|
|
694
|
-
children: [/*#__PURE__*/jsx(TableWrapper, {
|
|
695
|
-
hasPagination: splitTransfersCount > (pageProperties === null || pageProperties === void 0 ? void 0 : pageProperties.pageSize),
|
|
696
|
-
children: /*#__PURE__*/jsx(Table, {
|
|
697
|
-
onRowSelect: onRowSelect,
|
|
698
|
-
fixedHeight: true,
|
|
699
|
-
allowRowClick: false,
|
|
700
|
-
columnData: customizedColumns,
|
|
701
|
-
currentPageNumber: pageProperties === null || pageProperties === void 0 ? void 0 : pageProperties.page,
|
|
702
|
-
handlePageChange: handleTablePagination,
|
|
703
|
-
loading: isFetching || isTableConfigurationLoading,
|
|
704
|
-
rowData: buildRowData({
|
|
705
|
-
splitTransfers: splitTransfers,
|
|
706
|
-
pageProperties: pageProperties,
|
|
707
|
-
tab: tab
|
|
708
|
-
}),
|
|
709
|
-
rowSelection: getRowSelection(),
|
|
710
|
-
selectedRowKeys: selectedRows,
|
|
711
|
-
sortDirections: SORT_DIRECTIONS,
|
|
712
|
-
totalCount: splitTransfersCount,
|
|
713
|
-
bulkSelectAllRowsProps: {
|
|
714
|
-
selectAllRowMessage: t("neetoPayments.splitTransferDetails.selectedSplitTransfers", {
|
|
715
|
-
count: selectedRows.length
|
|
716
|
-
}),
|
|
717
|
-
selectAllRowButtonLabel: t("neetoPayments.splitTransferDetails.selectAll", {
|
|
718
|
-
count: views[SPLIT_TRANSFERS_DASHBOARD_TAB.pending]
|
|
719
|
-
}),
|
|
720
|
-
setBulkSelectedAllRows: setHasBulkSelectedAllRows
|
|
721
|
-
},
|
|
722
|
-
paginationProps: {
|
|
723
|
-
showSizeChanger: true,
|
|
724
|
-
hideOnSinglePage: true,
|
|
725
|
-
pageSize: pageProperties === null || pageProperties === void 0 ? void 0 : pageProperties.pageSize,
|
|
726
|
-
total: splitTransfersCount
|
|
727
|
-
},
|
|
728
|
-
onChange: handleTableChange,
|
|
729
|
-
onColumnHide: function onColumnHide(_ref2) {
|
|
730
|
-
var key = _ref2.key;
|
|
731
|
-
return hideColumn(key);
|
|
732
|
-
}
|
|
733
|
-
})
|
|
734
|
-
}), /*#__PURE__*/jsx(Details, {
|
|
735
|
-
selectedTransfer: selectedTransfer,
|
|
736
|
-
setSelectedTransfer: setSelectedTransfer
|
|
737
|
-
})]
|
|
738
|
-
});
|
|
739
|
-
};
|
|
740
|
-
|
|
741
|
-
var ResumeModal = function ResumeModal(_ref) {
|
|
742
|
-
var isOpen = _ref.isOpen,
|
|
743
|
-
onClose = _ref.onClose,
|
|
744
|
-
handleSplitTransfersUpdate = _ref.handleSplitTransfersUpdate;
|
|
745
|
-
var _useTranslation = useTranslation(),
|
|
746
|
-
t = _useTranslation.t;
|
|
747
|
-
var handleSubmit = function handleSubmit(_ref2) {
|
|
748
|
-
var reason = _ref2.reason;
|
|
749
|
-
handleSplitTransfersUpdate("pending", reason);
|
|
750
|
-
};
|
|
751
|
-
return /*#__PURE__*/jsxs(Modal, {
|
|
752
|
-
isOpen: isOpen,
|
|
753
|
-
onClose: onClose,
|
|
754
|
-
size: "large",
|
|
755
|
-
children: [/*#__PURE__*/jsx(Modal.Header, {
|
|
756
|
-
children: /*#__PURE__*/jsx(Typography, {
|
|
757
|
-
style: "h2",
|
|
758
|
-
weight: "medium",
|
|
759
|
-
children: t("neetoPayments.resumeSplitTransfers.modal.title")
|
|
760
|
-
})
|
|
761
|
-
}), /*#__PURE__*/jsx(Form, {
|
|
762
|
-
formikProps: {
|
|
763
|
-
initialValues: {
|
|
764
|
-
reason: ""
|
|
765
|
-
},
|
|
766
|
-
validationSchema: VALIDATION_SCHEMA,
|
|
767
|
-
onSubmit: handleSubmit
|
|
768
|
-
},
|
|
769
|
-
children: /*#__PURE__*/jsxs(Fragment, {
|
|
770
|
-
children: [/*#__PURE__*/jsx(Modal.Body, {
|
|
771
|
-
children: /*#__PURE__*/jsx("div", {
|
|
772
|
-
className: "flex flex-col space-y-4",
|
|
773
|
-
children: /*#__PURE__*/jsx(Textarea, {
|
|
774
|
-
required: true,
|
|
775
|
-
label: t("neetoPayments.resumeSplitTransfers.modal.reason"),
|
|
776
|
-
name: "reason"
|
|
777
|
-
})
|
|
778
|
-
})
|
|
779
|
-
}), /*#__PURE__*/jsx(Modal.Footer, {
|
|
780
|
-
children: /*#__PURE__*/jsx(ActionBlock, {
|
|
781
|
-
position: "right",
|
|
782
|
-
cancelButtonProps: {
|
|
783
|
-
onClick: onClose,
|
|
784
|
-
style: "tertiary"
|
|
785
|
-
},
|
|
786
|
-
submitButtonProps: {
|
|
787
|
-
disabled: false,
|
|
788
|
-
label: t("neetoPayments.common.submit")
|
|
789
|
-
}
|
|
790
|
-
})
|
|
791
|
-
})]
|
|
792
|
-
})
|
|
793
|
-
})]
|
|
794
|
-
});
|
|
795
|
-
};
|
|
796
|
-
|
|
797
|
-
var Menu = Dropdown.Menu,
|
|
798
|
-
MenuItem = Dropdown.MenuItem;
|
|
799
|
-
var TopSection = function TopSection(_ref) {
|
|
800
|
-
var views = _ref.views,
|
|
801
|
-
filters = _ref.filters,
|
|
802
|
-
setIsCancelModalOpen = _ref.setIsCancelModalOpen,
|
|
803
|
-
setIsResumeModalOpen = _ref.setIsResumeModalOpen,
|
|
804
|
-
selectedRows = _ref.selectedRows,
|
|
805
|
-
selectedRowData = _ref.selectedRowData,
|
|
806
|
-
setFilters = _ref.setFilters,
|
|
807
|
-
hasBulkSelectedAllRows = _ref.hasBulkSelectedAllRows,
|
|
808
|
-
filterableColumns = _ref.filterableColumns,
|
|
809
|
-
searchKeywordProps = _ref.searchKeywordProps,
|
|
810
|
-
payableEntityColumns = _ref.payableEntityColumns,
|
|
811
|
-
setIsExportModalOpen = _ref.setIsExportModalOpen;
|
|
812
|
-
var _useState = useState(false),
|
|
813
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
814
|
-
isFilterPaneOpen = _useState2[0],
|
|
815
|
-
setIsFilterPaneOpen = _useState2[1];
|
|
816
|
-
var _useTranslation = useTranslation(),
|
|
817
|
-
t = _useTranslation.t;
|
|
818
|
-
var history = useHistory();
|
|
819
|
-
var _getQueryParams = getQueryParams(),
|
|
820
|
-
_getQueryParams$tab = _getQueryParams.tab,
|
|
821
|
-
tab = _getQueryParams$tab === void 0 ? SPLIT_TRANSFERS_DASHBOARD_TAB.all : _getQueryParams$tab;
|
|
822
|
-
var splitTransfersCount = views === null || views === void 0 ? void 0 : views[tab];
|
|
823
|
-
var splitTransfersCountVisible = splitTransfersCount > 0 || splitTransfersCount === 0 && isPresent(filters);
|
|
824
|
-
var isFilterButtonVisible = splitTransfersCount || isPresent(filters);
|
|
825
|
-
var isDropdownVisible = isNotEmpty(selectedRows);
|
|
826
|
-
var isCancelButtonDisabled = existsBy({
|
|
827
|
-
status: SPLIT_TRANSFERS_DASHBOARD_TAB.cancelled
|
|
828
|
-
}, selectedRowData);
|
|
829
|
-
var isResumeButtonDisabled = existsBy({
|
|
830
|
-
status: SPLIT_TRANSFERS_DASHBOARD_TAB.pending
|
|
831
|
-
}, selectedRowData);
|
|
832
|
-
var selectedRecordsCount = hasBulkSelectedAllRows ? splitTransfersCount : selectedRows.length;
|
|
833
|
-
var handleFiltersChange = function handleFiltersChange(filters) {
|
|
834
|
-
startTransition(function () {
|
|
835
|
-
setFilters(filters);
|
|
836
|
-
});
|
|
837
|
-
};
|
|
838
|
-
var handleTabChange = function handleTabChange(tab) {
|
|
839
|
-
var queryParams = getQueryParams({
|
|
840
|
-
toCamelCase: false
|
|
841
|
-
});
|
|
842
|
-
var newParams = {
|
|
843
|
-
tab: tab,
|
|
844
|
-
page: DEFAULT_PAGE_INDEX,
|
|
845
|
-
page_size: DEFAULT_PAGE_SIZE
|
|
846
|
-
};
|
|
847
|
-
history.push(buildUrl(window.location.pathname, mergeLeft(newParams, queryParams)));
|
|
848
|
-
};
|
|
849
|
-
return /*#__PURE__*/jsxs(Fragment, {
|
|
850
|
-
children: [/*#__PURE__*/jsx(Header, {
|
|
851
|
-
title: t("neetoPayments.title.splitTransfers"),
|
|
852
|
-
searchProps: isFilterButtonVisible && {
|
|
853
|
-
placeholder: searchKeywordProps.placeholder,
|
|
854
|
-
className: "w-96"
|
|
855
|
-
}
|
|
856
|
-
}), shouldTabsVisible(views) && /*#__PURE__*/jsx(Tab, {
|
|
857
|
-
children: Object.keys(SPLIT_TRANSFERS_DASHBOARD_TAB).map(function (item) {
|
|
858
|
-
return /*#__PURE__*/jsx(Tab.Item, {
|
|
859
|
-
active: tab === item,
|
|
860
|
-
onClick: function onClick() {
|
|
861
|
-
return handleTabChange(item);
|
|
862
|
-
},
|
|
863
|
-
children: t("neetoPayments.common.".concat(item))
|
|
864
|
-
}, item);
|
|
865
|
-
})
|
|
866
|
-
}), /*#__PURE__*/jsx(SubHeader, {
|
|
867
|
-
className: "my-4",
|
|
868
|
-
leftActionBlock: splitTransfersCountVisible && /*#__PURE__*/jsx("div", {
|
|
869
|
-
className: "w-100 flex items-center space-x-3",
|
|
870
|
-
children: isDropdownVisible ? /*#__PURE__*/jsxs(Fragment, {
|
|
871
|
-
children: [/*#__PURE__*/jsx(Typography, {
|
|
872
|
-
className: "neeto-ui-gray-800 me-2 font-semibold",
|
|
873
|
-
component: "h4",
|
|
874
|
-
children: /*#__PURE__*/jsx(Trans, {
|
|
875
|
-
count: selectedRecordsCount,
|
|
876
|
-
i18nKey: "neetoPayments.splitTransferDetails.recordWithCount",
|
|
877
|
-
components: {
|
|
878
|
-
span: /*#__PURE__*/jsx("span", {
|
|
879
|
-
className: "neeto-ui-text-gray-600"
|
|
880
|
-
})
|
|
881
|
-
},
|
|
882
|
-
values: {
|
|
883
|
-
count: selectedRecordsCount,
|
|
884
|
-
recordsCount: splitTransfersCount
|
|
885
|
-
}
|
|
886
|
-
})
|
|
887
|
-
}), /*#__PURE__*/jsxs(Dropdown, {
|
|
888
|
-
buttonStyle: "secondary",
|
|
889
|
-
label: t("neetoPayments.common.takeAction"),
|
|
890
|
-
children: [/*#__PURE__*/jsx(Menu, {
|
|
891
|
-
children: /*#__PURE__*/jsx(MenuItem.Button, {
|
|
892
|
-
isDisabled: isCancelButtonDisabled,
|
|
893
|
-
tooltipProps: isCancelButtonDisabled ? {
|
|
894
|
-
content: t("neetoPayments.tooltipContent.splitTransfers.cancelledRecordsSelected")
|
|
895
|
-
} : "",
|
|
896
|
-
onClick: function onClick() {
|
|
897
|
-
return setIsCancelModalOpen(true);
|
|
898
|
-
},
|
|
899
|
-
children: t("neetoPayments.common.cancel")
|
|
900
|
-
})
|
|
901
|
-
}), /*#__PURE__*/jsx(Menu, {
|
|
902
|
-
children: /*#__PURE__*/jsx(MenuItem.Button, {
|
|
903
|
-
isDisabled: isResumeButtonDisabled,
|
|
904
|
-
tooltipProps: isResumeButtonDisabled ? {
|
|
905
|
-
content: t("neetoPayments.tooltipContent.splitTransfers.pendingRecordsSelected")
|
|
906
|
-
} : "",
|
|
907
|
-
onClick: function onClick() {
|
|
908
|
-
return setIsResumeModalOpen(true);
|
|
909
|
-
},
|
|
910
|
-
children: t("neetoPayments.common.resume")
|
|
911
|
-
})
|
|
912
|
-
})]
|
|
913
|
-
})]
|
|
914
|
-
}) : /*#__PURE__*/jsx(Typography, {
|
|
915
|
-
className: "neeto-ui-gray-800 me-2 font-semibold",
|
|
916
|
-
component: "h4",
|
|
917
|
-
children: tab === SPLIT_TRANSFERS_DASHBOARD_TAB.all ? t("neetoPayments.countOf.splitTransfer", {
|
|
918
|
-
count: splitTransfersCount
|
|
919
|
-
}) : t("neetoPayments.countOf.splitTransferWithStatus", {
|
|
920
|
-
count: splitTransfersCount,
|
|
921
|
-
status: tab
|
|
922
|
-
})
|
|
923
|
-
})
|
|
924
|
-
}),
|
|
925
|
-
rightActionBlock: isFilterButtonVisible && /*#__PURE__*/jsx(SubHeader.RightBlock, {
|
|
926
|
-
columnsButtonProps: {
|
|
927
|
-
columnData: buildTableColumns({
|
|
928
|
-
tab: tab,
|
|
929
|
-
payableEntityColumns: payableEntityColumns,
|
|
930
|
-
setSelectedTransfer: function setSelectedTransfer() {}
|
|
931
|
-
}).map(modify("dataIndex", processDataIndex)),
|
|
932
|
-
fixedColumns: UN_HIDEABLE_COLUMNS,
|
|
933
|
-
tableKey: "".concat(TABLE_KEYS.SPLIT_TRANSFERS_TABLE, "-").concat(tab)
|
|
934
|
-
},
|
|
935
|
-
downloadButtonProps: {
|
|
936
|
-
onClick: function onClick() {
|
|
937
|
-
return setIsExportModalOpen(true);
|
|
938
|
-
}
|
|
939
|
-
},
|
|
940
|
-
filterProps: {
|
|
941
|
-
columns: filterableColumns,
|
|
942
|
-
isOpen: isFilterPaneOpen,
|
|
943
|
-
keyword: searchKeywordProps,
|
|
944
|
-
setIsOpen: setIsFilterPaneOpen,
|
|
945
|
-
onChange: handleFiltersChange
|
|
946
|
-
}
|
|
947
|
-
})
|
|
948
|
-
}), /*#__PURE__*/jsx(FiltersBar, {
|
|
949
|
-
columns: filterableColumns,
|
|
950
|
-
keyword: searchKeywordProps,
|
|
951
|
-
setIsPaneOpen: setIsFilterPaneOpen,
|
|
952
|
-
onChange: handleFiltersChange
|
|
953
|
-
})]
|
|
954
|
-
});
|
|
955
|
-
};
|
|
956
|
-
|
|
957
|
-
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; }
|
|
958
|
-
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; }
|
|
959
|
-
var SplitTransfersDashboard = function SplitTransfersDashboard(_ref) {
|
|
960
|
-
var searchProps = _ref.searchProps,
|
|
961
|
-
payableEntityColumns = _ref.payableEntityColumns;
|
|
962
|
-
var _getQueryParams = getQueryParams(),
|
|
963
|
-
_getQueryParams$searc = _getQueryParams.searchTerm,
|
|
964
|
-
searchTerm = _getQueryParams$searc === void 0 ? "" : _getQueryParams$searc;
|
|
965
|
-
var filterableColumns = buildFilterColumns(payableEntityColumns);
|
|
966
|
-
var searchKeywordProps = buildSearchProps(searchProps, searchTerm);
|
|
967
|
-
var _useState = useState([]),
|
|
968
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
969
|
-
selectedRows = _useState2[0],
|
|
970
|
-
setSelectedRows = _useState2[1];
|
|
971
|
-
var _useState3 = useState([]),
|
|
972
|
-
_useState4 = _slicedToArray(_useState3, 2),
|
|
973
|
-
selectedRowData = _useState4[0],
|
|
974
|
-
setSelectedRowData = _useState4[1];
|
|
975
|
-
var _useState5 = useState(false),
|
|
976
|
-
_useState6 = _slicedToArray(_useState5, 2),
|
|
977
|
-
isExportModalOpen = _useState6[0],
|
|
978
|
-
setIsExportModalOpen = _useState6[1];
|
|
979
|
-
var _useState7 = useState(false),
|
|
980
|
-
_useState8 = _slicedToArray(_useState7, 2),
|
|
981
|
-
isCancelModalOpen = _useState8[0],
|
|
982
|
-
setIsCancelModalOpen = _useState8[1];
|
|
983
|
-
var _useState9 = useState(false),
|
|
984
|
-
_useState10 = _slicedToArray(_useState9, 2),
|
|
985
|
-
isResumeModalOpen = _useState10[0],
|
|
986
|
-
setIsResumeModalOpen = _useState10[1];
|
|
987
|
-
var _useState11 = useState(false),
|
|
988
|
-
_useState12 = _slicedToArray(_useState11, 2),
|
|
989
|
-
hasBulkSelectedAllRows = _useState12[0],
|
|
990
|
-
setHasBulkSelectedAllRows = _useState12[1];
|
|
991
|
-
var _useState13 = useState(DEFAULT_SORT_PROPERTIES),
|
|
992
|
-
_useState14 = _slicedToArray(_useState13, 2),
|
|
993
|
-
sortProperties = _useState14[0],
|
|
994
|
-
setSortProperties = _useState14[1];
|
|
995
|
-
var _useState15 = useState(DEFAULT_PAGE_VALUES),
|
|
996
|
-
_useState16 = _slicedToArray(_useState15, 2),
|
|
997
|
-
pageProperties = _useState16[0],
|
|
998
|
-
setPageProperties = _useState16[1];
|
|
999
|
-
var _useState17 = useState(buildFiltersFromURL([].concat(_toConsumableArray(filterableColumns), [searchKeywordProps]))),
|
|
1000
|
-
_useState18 = _slicedToArray(_useState17, 2),
|
|
1001
|
-
filters = _useState18[0],
|
|
1002
|
-
setFilters = _useState18[1];
|
|
1003
|
-
var history = useHistory();
|
|
1004
|
-
var _getQueryParams2 = getQueryParams(),
|
|
1005
|
-
_getQueryParams2$tab = _getQueryParams2.tab,
|
|
1006
|
-
tab = _getQueryParams2$tab === void 0 ? SPLIT_TRANSFERS_DASHBOARD_TAB.all : _getQueryParams2$tab;
|
|
1007
|
-
var payload = _objectSpread(_objectSpread({
|
|
1008
|
-
tab: tab,
|
|
1009
|
-
filters: filters
|
|
1010
|
-
}, pageProperties), sortProperties);
|
|
1011
|
-
var _useFetchSplitTransfe = useFetchSplitTransfers(payload),
|
|
1012
|
-
_useFetchSplitTransfe2 = _useFetchSplitTransfe.data,
|
|
1013
|
-
_useFetchSplitTransfe3 = _useFetchSplitTransfe2 === void 0 ? {} : _useFetchSplitTransfe2,
|
|
1014
|
-
splitTransfers = _useFetchSplitTransfe3.splitTransfers,
|
|
1015
|
-
views = _useFetchSplitTransfe3.views,
|
|
1016
|
-
isFetching = _useFetchSplitTransfe.isFetching,
|
|
1017
|
-
isSplitTransfersLoading = _useFetchSplitTransfe.isPending;
|
|
1018
|
-
var _useBulkUpdateSplitTr = useBulkUpdateSplitTransfers({
|
|
1019
|
-
onSuccess: function onSuccess() {
|
|
1020
|
-
setSelectedRowData([]);
|
|
1021
|
-
setSelectedRows([]);
|
|
1022
|
-
}
|
|
1023
|
-
}),
|
|
1024
|
-
updateSplitTransfers = _useBulkUpdateSplitTr.mutate,
|
|
1025
|
-
isCancelling = _useBulkUpdateSplitTr.isPending;
|
|
1026
|
-
var handleSplitTransfersUpdate = function handleSplitTransfersUpdate(status, reason) {
|
|
1027
|
-
var ids = pluck("id", selectedRowData);
|
|
1028
|
-
updateSplitTransfers({
|
|
1029
|
-
ids: ids,
|
|
1030
|
-
status: status,
|
|
1031
|
-
reason: reason,
|
|
1032
|
-
isApplyChangesToAllRequired: hasBulkSelectedAllRows
|
|
1033
|
-
});
|
|
1034
|
-
setIsCancelModalOpen(false);
|
|
1035
|
-
setIsResumeModalOpen(false);
|
|
1036
|
-
};
|
|
1037
|
-
var handleTablePagination = function handleTablePagination(page, pageSize) {
|
|
1038
|
-
var queryParams = getQueryParams({
|
|
1039
|
-
toCamelCase: false
|
|
1040
|
-
});
|
|
1041
|
-
history.push(buildUrl(window.location.pathname, mergeLeft({
|
|
1042
|
-
page: page,
|
|
1043
|
-
page_size: pageSize
|
|
1044
|
-
}, queryParams)));
|
|
1045
|
-
setPageProperties({
|
|
1046
|
-
page: page,
|
|
1047
|
-
pageSize: pageSize
|
|
1048
|
-
});
|
|
1049
|
-
};
|
|
1050
|
-
var handleRowSelect = function handleRowSelect(keys, rowData) {
|
|
1051
|
-
setSelectedRows(keys);
|
|
1052
|
-
setSelectedRowData(rowData);
|
|
1053
|
-
};
|
|
1054
|
-
useEffect(function () {
|
|
1055
|
-
handleTablePagination(DEFAULT_PAGE_INDEX, DEFAULT_PAGE_SIZE);
|
|
1056
|
-
setSortProperties(DEFAULT_SORT_PROPERTIES);
|
|
1057
|
-
setSelectedRowData([]);
|
|
1058
|
-
setSelectedRows([]);
|
|
1059
|
-
}, [filters, tab]);
|
|
1060
|
-
if (isSplitTransfersLoading || isCancelling) {
|
|
1061
|
-
return /*#__PURE__*/jsx("div", {
|
|
1062
|
-
className: "flex h-full w-full items-center justify-center",
|
|
1063
|
-
children: /*#__PURE__*/jsx(Spinner, {})
|
|
1064
|
-
});
|
|
1065
|
-
}
|
|
1066
|
-
return /*#__PURE__*/jsxs(Fragment, {
|
|
1067
|
-
children: [/*#__PURE__*/jsx(TopSection, {
|
|
1068
|
-
filterableColumns: filterableColumns,
|
|
1069
|
-
filters: filters,
|
|
1070
|
-
hasBulkSelectedAllRows: hasBulkSelectedAllRows,
|
|
1071
|
-
pageProperties: pageProperties,
|
|
1072
|
-
payableEntityColumns: payableEntityColumns,
|
|
1073
|
-
searchKeywordProps: searchKeywordProps,
|
|
1074
|
-
selectedRowData: selectedRowData,
|
|
1075
|
-
selectedRows: selectedRows,
|
|
1076
|
-
setFilters: setFilters,
|
|
1077
|
-
setIsCancelModalOpen: setIsCancelModalOpen,
|
|
1078
|
-
setIsExportModalOpen: setIsExportModalOpen,
|
|
1079
|
-
setIsResumeModalOpen: setIsResumeModalOpen,
|
|
1080
|
-
setPageProperties: setPageProperties,
|
|
1081
|
-
setSortProperties: setSortProperties,
|
|
1082
|
-
views: views
|
|
1083
|
-
}), /*#__PURE__*/jsx(List, {
|
|
1084
|
-
handleTablePagination: handleTablePagination,
|
|
1085
|
-
isFetching: isFetching,
|
|
1086
|
-
pageProperties: pageProperties,
|
|
1087
|
-
payableEntityColumns: payableEntityColumns,
|
|
1088
|
-
selectedRows: selectedRows,
|
|
1089
|
-
setHasBulkSelectedAllRows: setHasBulkSelectedAllRows,
|
|
1090
|
-
setSelectedRows: setSelectedRows,
|
|
1091
|
-
setSortProperties: setSortProperties,
|
|
1092
|
-
splitTransfers: splitTransfers,
|
|
1093
|
-
views: views,
|
|
1094
|
-
onRowSelect: handleRowSelect
|
|
1095
|
-
}), /*#__PURE__*/jsx(ExportModal, {
|
|
1096
|
-
filters: filters,
|
|
1097
|
-
isExportModalOpen: isExportModalOpen,
|
|
1098
|
-
setIsExportModalOpen: setIsExportModalOpen,
|
|
1099
|
-
sortProperties: sortProperties,
|
|
1100
|
-
dashboardKind: DASHBOARD_KIND.splitTransfers
|
|
1101
|
-
}), /*#__PURE__*/jsx(CancelModal, {
|
|
1102
|
-
handleSplitTransfersUpdate: handleSplitTransfersUpdate,
|
|
1103
|
-
isOpen: isCancelModalOpen,
|
|
1104
|
-
onClose: function onClose() {
|
|
1105
|
-
return setIsCancelModalOpen(false);
|
|
1106
|
-
}
|
|
1107
|
-
}), /*#__PURE__*/jsx(ResumeModal, {
|
|
1108
|
-
handleSplitTransfersUpdate: handleSplitTransfersUpdate,
|
|
1109
|
-
isOpen: isResumeModalOpen,
|
|
1110
|
-
onClose: function onClose() {
|
|
1111
|
-
return setIsResumeModalOpen(false);
|
|
1112
|
-
}
|
|
1113
|
-
})]
|
|
1114
|
-
});
|
|
1115
|
-
};
|
|
1116
|
-
|
|
1117
|
-
export { SplitTransfersDashboard as default };
|
|
1118
|
-
//# sourceMappingURL=SplitTransfersDashboard.js.map
|