@bigbinary/neeto-payments-frontend 3.3.8 → 3.3.10
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/app/javascript/src/translations/en.json +8 -0
- package/dist/AccountsDashboard.js +1 -1
- package/dist/AdminCancelRecurringPaymentButton.js +79 -0
- package/dist/AdminCancelRecurringPaymentButton.js.map +1 -0
- package/dist/CustomerCancelRecurringPaymentForm.js +111 -0
- package/dist/CustomerCancelRecurringPaymentForm.js.map +1 -0
- package/dist/PaymentsDashboard.js +1 -1
- package/dist/PayoutsDashboard.js +3 -3
- package/dist/PayoutsPage.js +3 -3
- package/dist/RecurringPaymentSettings.js +21 -21
- package/dist/RecurringPaymentSettings.js.map +1 -1
- package/dist/RefundsDashboard.js +1 -1
- package/dist/SplitTransfersDashboard.js +1 -1
- package/dist/StripeConnect.js +2 -2
- package/dist/TaxesDashboard.js +5 -2
- package/dist/TaxesDashboard.js.map +1 -1
- package/dist/UpiConnect.js +15 -12
- package/dist/UpiConnect.js.map +1 -1
- package/dist/cjs/AccountsDashboard.js +1 -1
- package/dist/cjs/AdminCancelRecurringPaymentButton.js +81 -0
- package/dist/cjs/AdminCancelRecurringPaymentButton.js.map +1 -0
- package/dist/cjs/CustomerCancelRecurringPaymentForm.js +113 -0
- package/dist/cjs/CustomerCancelRecurringPaymentForm.js.map +1 -0
- package/dist/cjs/PaymentsDashboard.js +1 -1
- package/dist/cjs/PayoutsDashboard.js +3 -3
- package/dist/cjs/PayoutsPage.js +3 -3
- package/dist/cjs/RecurringPaymentSettings.js +21 -21
- package/dist/cjs/RecurringPaymentSettings.js.map +1 -1
- package/dist/cjs/RefundsDashboard.js +1 -1
- package/dist/cjs/SplitTransfersDashboard.js +1 -1
- package/dist/cjs/StripeConnect.js +2 -2
- package/dist/cjs/TaxesDashboard.js +5 -2
- package/dist/cjs/TaxesDashboard.js.map +1 -1
- package/dist/cjs/UpiConnect.js +14 -11
- package/dist/cjs/UpiConnect.js.map +1 -1
- package/dist/cjs/index.js +9 -3
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/{queryConstants-DNzfbVD-.js → queryConstants-DGg4cX3r.js} +3 -2
- package/dist/cjs/queryConstants-DGg4cX3r.js.map +1 -0
- package/dist/cjs/{useConnectApi-CKqh8VKR.js → useConnectApi-CUkuzw0c.js} +2 -2
- package/dist/cjs/{useConnectApi-CKqh8VKR.js.map → useConnectApi-CUkuzw0c.js.map} +1 -1
- package/dist/cjs/{usePlatformApi-DTa_oyAT.js → usePlatformApi-CWdvdY23.js} +2 -2
- package/dist/cjs/{usePlatformApi-DTa_oyAT.js.map → usePlatformApi-CWdvdY23.js.map} +1 -1
- package/dist/index.js +7 -3
- package/dist/index.js.map +1 -1
- package/dist/{queryConstants-CqEabttJ.js → queryConstants-mgjK5Hgk.js} +3 -2
- package/dist/queryConstants-mgjK5Hgk.js.map +1 -0
- package/dist/{useConnectApi-BJyvgLXQ.js → useConnectApi-DLJNjz8A.js} +2 -2
- package/dist/{useConnectApi-BJyvgLXQ.js.map → useConnectApi-DLJNjz8A.js.map} +1 -1
- package/dist/{usePlatformApi-D-E9w189.js → usePlatformApi-BmTjLVDt.js} +2 -2
- package/dist/{usePlatformApi-D-E9w189.js.map → usePlatformApi-BmTjLVDt.js.map} +1 -1
- package/package.json +9 -9
- package/dist/cjs/queryConstants-DNzfbVD-.js.map +0 -1
- package/dist/queryConstants-CqEabttJ.js.map +0 -1
|
@@ -468,6 +468,14 @@
|
|
|
468
468
|
"max": "Must be less than 15"
|
|
469
469
|
}
|
|
470
470
|
},
|
|
471
|
+
"recurringPaymentCancel": {
|
|
472
|
+
"buttonLabel": "Cancel recurring payment",
|
|
473
|
+
"alertTitle": "Cancel recurring payment?",
|
|
474
|
+
"alertMessage": "You are cancelling the recurring payment for this submission. This can't be undone.",
|
|
475
|
+
"reasonLabel": "Reason for cancellation (optional)",
|
|
476
|
+
"reasonPlaceholder": "Type reason here...",
|
|
477
|
+
"message": "Recurring payment cancelled"
|
|
478
|
+
},
|
|
471
479
|
"taxesDashboard": {
|
|
472
480
|
"title": "Taxes",
|
|
473
481
|
"noData": "There are no taxes to show",
|
|
@@ -32,7 +32,7 @@ import NoData from '@bigbinary/neetoui/NoData';
|
|
|
32
32
|
import Spinner from '@bigbinary/neetoui/Spinner';
|
|
33
33
|
import { useQuery } from '@tanstack/react-query';
|
|
34
34
|
import axios from 'axios';
|
|
35
|
-
import { Q as QUERY_KEYS } from './queryConstants-
|
|
35
|
+
import { Q as QUERY_KEYS } from './queryConstants-mgjK5Hgk.js';
|
|
36
36
|
import '@tanstack/react-query-devtools';
|
|
37
37
|
import '@bigbinary/neeto-molecules/DateFormat';
|
|
38
38
|
import '@bigbinary/neetoui/Tag';
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
|
|
2
|
+
import { useState } from 'react';
|
|
3
|
+
import Button from '@bigbinary/neetoui/Button';
|
|
4
|
+
import Alert from '@bigbinary/neetoui/Alert';
|
|
5
|
+
import { useTranslation } from 'react-i18next';
|
|
6
|
+
import _toConsumableArray from '@babel/runtime/helpers/toConsumableArray';
|
|
7
|
+
import { useMutationWithInvalidation } from '@bigbinary/neeto-commons-frontend/react-utils';
|
|
8
|
+
import axios from 'axios';
|
|
9
|
+
import { B as BASE_URL } from './index-ER2sofJn.js';
|
|
10
|
+
import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
|
|
11
|
+
import 'i18next';
|
|
12
|
+
import '@bigbinary/neeto-commons-frontend/constants';
|
|
13
|
+
import '@bigbinary/neeto-cist';
|
|
14
|
+
import '@bigbinary/neeto-commons-frontend/utils';
|
|
15
|
+
import 'ramda';
|
|
16
|
+
|
|
17
|
+
var update = function update(_ref) {
|
|
18
|
+
var id = _ref.id,
|
|
19
|
+
payload = _ref.payload;
|
|
20
|
+
return axios.put("".concat(BASE_URL, "/api/v1/recurring_payments/").concat(id), {
|
|
21
|
+
recurring_payment: payload
|
|
22
|
+
});
|
|
23
|
+
};
|
|
24
|
+
var recurringPaymentsApi = {
|
|
25
|
+
update: update
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
var useUpdateRecurringPayments = function useUpdateRecurringPayments() {
|
|
29
|
+
var keysToInvalidate = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
30
|
+
return useMutationWithInvalidation(recurringPaymentsApi.update, {
|
|
31
|
+
keysToInvalidate: _toConsumableArray(keysToInvalidate)
|
|
32
|
+
});
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
var AdminCancelRecurringPaymentButton = function AdminCancelRecurringPaymentButton(_ref) {
|
|
36
|
+
var id = _ref.id,
|
|
37
|
+
_ref$style = _ref.style,
|
|
38
|
+
style = _ref$style === void 0 ? "primary" : _ref$style,
|
|
39
|
+
_ref$keysToInvalidate = _ref.keysToInvalidate,
|
|
40
|
+
keysToInvalidate = _ref$keysToInvalidate === void 0 ? [] : _ref$keysToInvalidate;
|
|
41
|
+
var _useState = useState(false),
|
|
42
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
43
|
+
isAlertOpen = _useState2[0],
|
|
44
|
+
setIsAlertOpen = _useState2[1];
|
|
45
|
+
var _useUpdateRecurringPa = useUpdateRecurringPayments(keysToInvalidate),
|
|
46
|
+
isPending = _useUpdateRecurringPa.isPending,
|
|
47
|
+
updateRecurringPayment = _useUpdateRecurringPa.mutate;
|
|
48
|
+
var _useTranslation = useTranslation(),
|
|
49
|
+
t = _useTranslation.t;
|
|
50
|
+
return /*#__PURE__*/jsxs(Fragment, {
|
|
51
|
+
children: [/*#__PURE__*/jsx(Button, {
|
|
52
|
+
style: style,
|
|
53
|
+
label: t("neetoPayments.recurringPaymentCancel.buttonLabel"),
|
|
54
|
+
onClick: function onClick() {
|
|
55
|
+
return setIsAlertOpen(true);
|
|
56
|
+
}
|
|
57
|
+
}), /*#__PURE__*/jsx(Alert, {
|
|
58
|
+
isOpen: isAlertOpen,
|
|
59
|
+
isSubmitting: isPending,
|
|
60
|
+
message: t("neetoPayments.recurringPaymentCancel.alertMessage"),
|
|
61
|
+
submitButtonLabel: t("neetoPayments.common.continue"),
|
|
62
|
+
title: t("neetoPayments.recurringPaymentCancel.alertTitle"),
|
|
63
|
+
onClose: function onClose() {
|
|
64
|
+
return setIsAlertOpen(false);
|
|
65
|
+
},
|
|
66
|
+
onSubmit: function onSubmit() {
|
|
67
|
+
return updateRecurringPayment({
|
|
68
|
+
id: id,
|
|
69
|
+
payload: {
|
|
70
|
+
status: "cancelled"
|
|
71
|
+
}
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
})]
|
|
75
|
+
});
|
|
76
|
+
};
|
|
77
|
+
|
|
78
|
+
export { AdminCancelRecurringPaymentButton as default };
|
|
79
|
+
//# sourceMappingURL=AdminCancelRecurringPaymentButton.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AdminCancelRecurringPaymentButton.js","sources":["../app/javascript/src/apis/recurring_payments.js","../app/javascript/src/hooks/reactQuery/useRecurringPaymentsApi.js","../app/javascript/src/components/AdminCancelRecurringPaymentButton/index.jsx"],"sourcesContent":["import axios from \"axios\";\n\nimport { BASE_URL } from \"src/constants\";\n\nconst update = ({ id, payload }) =>\n axios.put(`${BASE_URL}/api/v1/recurring_payments/${id}`, {\n recurring_payment: payload,\n });\n\nconst recurringPaymentsApi = { update };\n\nexport default recurringPaymentsApi;\n","import { useMutationWithInvalidation } from \"neetocommons/react-utils\";\n\nimport recurringPaymentsApi from \"apis/recurring_payments\";\n\nexport const useUpdateRecurringPayments = (keysToInvalidate = []) =>\n useMutationWithInvalidation(recurringPaymentsApi.update, {\n keysToInvalidate: [...keysToInvalidate],\n });\n","import { useState } from \"react\";\n\nimport { Button, Alert } from \"neetoui\";\nimport { useTranslation } from \"react-i18next\";\n\nimport { useUpdateRecurringPayments } from \"hooks/reactQuery/useRecurringPaymentsApi\";\n\nconst AdminCancelRecurringPaymentButton = ({\n id,\n style = \"primary\",\n keysToInvalidate = [],\n}) => {\n const [isAlertOpen, setIsAlertOpen] = useState(false);\n const { isPending, mutate: updateRecurringPayment } =\n useUpdateRecurringPayments(keysToInvalidate);\n\n const { t } = useTranslation();\n\n return (\n <>\n <Button\n {...{ style }}\n label={t(\"neetoPayments.recurringPaymentCancel.buttonLabel\")}\n onClick={() => setIsAlertOpen(true)}\n />\n <Alert\n isOpen={isAlertOpen}\n isSubmitting={isPending}\n message={t(\"neetoPayments.recurringPaymentCancel.alertMessage\")}\n submitButtonLabel={t(\"neetoPayments.common.continue\")}\n title={t(\"neetoPayments.recurringPaymentCancel.alertTitle\")}\n onClose={() => setIsAlertOpen(false)}\n onSubmit={() =>\n updateRecurringPayment({ id, payload: { status: \"cancelled\" } })\n }\n />\n </>\n );\n};\n\nexport default AdminCancelRecurringPaymentButton;\n"],"names":["update","_ref","id","payload","axios","put","concat","BASE_URL","recurring_payment","recurringPaymentsApi","useUpdateRecurringPayments","keysToInvalidate","arguments","length","undefined","useMutationWithInvalidation","_toConsumableArray","AdminCancelRecurringPaymentButton","_ref$style","style","_ref$keysToInvalidate","_useState","useState","_useState2","_slicedToArray","isAlertOpen","setIsAlertOpen","_useUpdateRecurringPa","isPending","updateRecurringPayment","mutate","_useTranslation","useTranslation","t","_jsxs","_Fragment","children","_jsx","Button","label","onClick","Alert","isOpen","isSubmitting","message","submitButtonLabel","title","onClose","onSubmit","status"],"mappings":";;;;;;;;;;;;;;;;AAIA,IAAMA,MAAM,GAAG,SAATA,MAAMA,CAAAC,IAAA,EAAA;AAAA,EAAA,IAAMC,EAAE,GAAAD,IAAA,CAAFC,EAAE;IAAEC,OAAO,GAAAF,IAAA,CAAPE,OAAO;EAAA,OAC3BC,KAAK,CAACC,GAAG,CAAAC,EAAAA,CAAAA,MAAA,CAAIC,QAAQ,EAAAD,6BAAAA,CAAAA,CAAAA,MAAA,CAA8BJ,EAAE,CAAI,EAAA;AACvDM,IAAAA,iBAAiB,EAAEL;AACrB,G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AF,eAAA,CAADE,CAAC;EAET,oBACEC,IAAA,CAAAC,QAAA,EAAA;IAAAC,QAAA,EAAA,cACEC,GAAA,CAACC,MAAM,EAAA;AACCnB,MAAAA,KAAK,EAALA,KAAK;AACXoB,MAAAA,KAAK,EAAEN,CAAC,CAAC,kDAAkD,CAAE;MAC7DO,OAAO,EAAE,SAATA,OAAOA,GAAA;QAAA,OAAQd,cAAc,CAAC,IAAI,CAAC;AAAA;AAAC,KACrC,CAAC,eACFW,GAAA,CAACI,KAAK,EAAA;AACJC,MAAAA,MAAM,EAAEjB,WAAY;AACpBkB,MAAAA,YAAY,EAAEf,SAAU;AACxBgB,MAAAA,OAAO,EAAEX,CAAC,CAAC,mDAAmD,CAAE;AAChEY,MAAAA,iBAAiB,EAAEZ,CAAC,CAAC,+BAA+B,CAAE;AACtDa,MAAAA,KAAK,EAAEb,CAAC,CAAC,iDAAiD,CAAE;MAC5Dc,OAAO,EAAE,SAATA,OAAOA,GAAA;QAAA,OAAQrB,cAAc,CAAC,KAAK,CAAC;OAAC;MACrCsB,QAAQ,EAAE,SAAVA,QAAQA,GAAA;AAAA,QAAA,OACNnB,sBAAsB,CAAC;AAAE3B,UAAAA,EAAE,EAAFA,EAAE;AAAEC,UAAAA,OAAO,EAAE;AAAE8C,YAAAA,MAAM,EAAE;AAAY;AAAE,SAAC,CAAC;AAAA;AACjE,KACF,CAAC;AAAA,GACF,CAAC;AAEP;;;;"}
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
import Typography from '@bigbinary/neetoui/Typography';
|
|
2
|
+
import Spinner from '@bigbinary/neetoui/Spinner';
|
|
3
|
+
import Form from '@bigbinary/neetoui/formik/Form';
|
|
4
|
+
import Textarea from '@bigbinary/neetoui/formik/Textarea';
|
|
5
|
+
import Button from '@bigbinary/neetoui/formik/Button';
|
|
6
|
+
import { useTranslation } from 'react-i18next';
|
|
7
|
+
import { useMutationWithInvalidation } from '@bigbinary/neeto-commons-frontend/react-utils';
|
|
8
|
+
import axios from 'axios';
|
|
9
|
+
import { B as BASE_URL } from './index-ER2sofJn.js';
|
|
10
|
+
import { useQuery } from '@tanstack/react-query';
|
|
11
|
+
import { isNotNil } from 'ramda';
|
|
12
|
+
import { Q as QUERY_KEYS } from './queryConstants-mgjK5Hgk.js';
|
|
13
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
14
|
+
import 'i18next';
|
|
15
|
+
import '@bigbinary/neeto-commons-frontend/constants';
|
|
16
|
+
import '@bigbinary/neeto-cist';
|
|
17
|
+
import '@bigbinary/neeto-commons-frontend/utils';
|
|
18
|
+
|
|
19
|
+
var show = function show(payableId) {
|
|
20
|
+
return axios.get("".concat(BASE_URL, "/api/v1/public/recurring_payments/").concat(payableId));
|
|
21
|
+
};
|
|
22
|
+
var update = function update(_ref) {
|
|
23
|
+
var payableId = _ref.payableId,
|
|
24
|
+
payload = _ref.payload;
|
|
25
|
+
return axios.put("".concat(BASE_URL, "/api/v1/public/recurring_payments/").concat(payableId), {
|
|
26
|
+
recurring_payment: payload
|
|
27
|
+
});
|
|
28
|
+
};
|
|
29
|
+
var recurringPaymentsApi = {
|
|
30
|
+
show: show,
|
|
31
|
+
update: update
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
var useFetchRecurringPayment = function useFetchRecurringPayment(payableId) {
|
|
35
|
+
return useQuery({
|
|
36
|
+
queryKey: [QUERY_KEYS.RECURRING_PAYMENT, payableId],
|
|
37
|
+
queryFn: function queryFn() {
|
|
38
|
+
return recurringPaymentsApi.show(payableId);
|
|
39
|
+
},
|
|
40
|
+
enabled: isNotNil(payableId)
|
|
41
|
+
});
|
|
42
|
+
};
|
|
43
|
+
var useUpdateRecurringPayments = function useUpdateRecurringPayments(payableId) {
|
|
44
|
+
return useMutationWithInvalidation(recurringPaymentsApi.update, {
|
|
45
|
+
keysToInvalidate: [QUERY_KEYS.RECURRING_PAYMENT, payableId]
|
|
46
|
+
});
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
var CustomerCancelRecurringPaymentForm = function CustomerCancelRecurringPaymentForm(_ref) {
|
|
50
|
+
var payableId = _ref.payableId;
|
|
51
|
+
var _useTranslation = useTranslation(),
|
|
52
|
+
t = _useTranslation.t;
|
|
53
|
+
var _useFetchRecurringPay = useFetchRecurringPayment(payableId),
|
|
54
|
+
isLoading = _useFetchRecurringPay.isLoading,
|
|
55
|
+
_useFetchRecurringPay2 = _useFetchRecurringPay.data,
|
|
56
|
+
_useFetchRecurringPay3 = _useFetchRecurringPay2 === void 0 ? {} : _useFetchRecurringPay2,
|
|
57
|
+
recurringPayment = _useFetchRecurringPay3.recurringPayment;
|
|
58
|
+
var _useUpdateRecurringPa = useUpdateRecurringPayments(payableId),
|
|
59
|
+
isPending = _useUpdateRecurringPa.isPending,
|
|
60
|
+
updateRecurringPayment = _useUpdateRecurringPa.mutate;
|
|
61
|
+
if (isLoading) {
|
|
62
|
+
return /*#__PURE__*/jsx("div", {
|
|
63
|
+
className: "flex h-full w-full items-center justify-center",
|
|
64
|
+
children: /*#__PURE__*/jsx(Spinner, {})
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
if ((recurringPayment === null || recurringPayment === void 0 ? void 0 : recurringPayment.status) === "cancelled") {
|
|
68
|
+
return /*#__PURE__*/jsx("div", {
|
|
69
|
+
className: "flex h-full w-full items-center justify-center",
|
|
70
|
+
children: /*#__PURE__*/jsx(Typography, {
|
|
71
|
+
children: t("neetoPayments.recurringPaymentCancel.message")
|
|
72
|
+
})
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
return /*#__PURE__*/jsx("div", {
|
|
76
|
+
className: "flex h-full w-full items-center justify-center",
|
|
77
|
+
children: /*#__PURE__*/jsxs(Form, {
|
|
78
|
+
className: "space-y-6",
|
|
79
|
+
formikProps: {
|
|
80
|
+
onSubmit: function onSubmit(_ref2) {
|
|
81
|
+
var cancelReason = _ref2.cancelReason;
|
|
82
|
+
return updateRecurringPayment({
|
|
83
|
+
payableId: payableId,
|
|
84
|
+
payload: {
|
|
85
|
+
status: "cancelled",
|
|
86
|
+
cancelReason: cancelReason
|
|
87
|
+
}
|
|
88
|
+
});
|
|
89
|
+
},
|
|
90
|
+
initialValues: {
|
|
91
|
+
cancelReason: ""
|
|
92
|
+
}
|
|
93
|
+
},
|
|
94
|
+
children: [/*#__PURE__*/jsx(Textarea, {
|
|
95
|
+
"data-cy": "cancel-meeting-input-textfield",
|
|
96
|
+
label: t("neetoPayments.recurringPaymentCancel.reasonLabel"),
|
|
97
|
+
name: "cancelReason",
|
|
98
|
+
placeholder: t("neetoPayments.recurringPaymentCancel.reasonPlaceholder")
|
|
99
|
+
}), /*#__PURE__*/jsx(Button, {
|
|
100
|
+
"data-cy": "cancel-meeting-submit-button",
|
|
101
|
+
disabled: isPending,
|
|
102
|
+
label: t("neetoPayments.recurringPaymentCancel.buttonLabel"),
|
|
103
|
+
loading: isPending,
|
|
104
|
+
style: "danger"
|
|
105
|
+
})]
|
|
106
|
+
})
|
|
107
|
+
});
|
|
108
|
+
};
|
|
109
|
+
|
|
110
|
+
export { CustomerCancelRecurringPaymentForm as default };
|
|
111
|
+
//# sourceMappingURL=CustomerCancelRecurringPaymentForm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CustomerCancelRecurringPaymentForm.js","sources":["../app/javascript/src/apis/public/recurring_payments.js","../app/javascript/src/hooks/reactQuery/public/useRecurringPaymentsApi.js","../app/javascript/src/components/CustomerCancelRecurringPaymentForm/index.jsx"],"sourcesContent":["import axios from \"axios\";\n\nimport { BASE_URL } from \"src/constants\";\n\nconst show = payableId =>\n axios.get(`${BASE_URL}/api/v1/public/recurring_payments/${payableId}`);\n\nconst update = ({ payableId, payload }) =>\n axios.put(`${BASE_URL}/api/v1/public/recurring_payments/${payableId}`, {\n recurring_payment: payload,\n });\n\nconst recurringPaymentsApi = { show, update };\n\nexport default recurringPaymentsApi;\n","import { useMutationWithInvalidation } from \"neetocommons/react-utils\";\n\nimport recurringPaymentsApi from \"apis/public/recurring_payments\";\n\nimport { useQuery } from \"@tanstack/react-query\";\nimport { isNotNil } from \"ramda\";\n\nimport { QUERY_KEYS } from \"src/common/queryConstants\";\n\nexport const useFetchRecurringPayment = payableId =>\n useQuery({\n queryKey: [QUERY_KEYS.RECURRING_PAYMENT, payableId],\n queryFn: () => recurringPaymentsApi.show(payableId),\n enabled: isNotNil(payableId),\n });\n\nexport const useUpdateRecurringPayments = payableId =>\n useMutationWithInvalidation(recurringPaymentsApi.update, {\n keysToInvalidate: [QUERY_KEYS.RECURRING_PAYMENT, payableId],\n });\n","import { Typography, Spinner } from \"neetoui\";\nimport { Form, Textarea, Button } from \"neetoui/formik\";\nimport { useTranslation } from \"react-i18next\";\n\nimport {\n useUpdateRecurringPayments,\n useFetchRecurringPayment,\n} from \"hooks/reactQuery/public/useRecurringPaymentsApi\";\n\nconst CustomerCancelRecurringPaymentForm = ({ payableId }) => {\n const { t } = useTranslation();\n\n const { isLoading, data: { recurringPayment } = {} } =\n useFetchRecurringPayment(payableId);\n\n const { isPending, mutate: updateRecurringPayment } =\n useUpdateRecurringPayments(payableId);\n\n if (isLoading) {\n return (\n <div className=\"flex h-full w-full items-center justify-center\">\n <Spinner />\n </div>\n );\n }\n\n if (recurringPayment?.status === \"cancelled\") {\n return (\n <div className=\"flex h-full w-full items-center justify-center\">\n <Typography>\n {t(\"neetoPayments.recurringPaymentCancel.message\")}\n </Typography>\n </div>\n );\n }\n\n return (\n <div className=\"flex h-full w-full items-center justify-center\">\n <Form\n className=\"space-y-6\"\n formikProps={{\n onSubmit: ({ cancelReason }) =>\n updateRecurringPayment({\n payableId,\n payload: { status: \"cancelled\", cancelReason },\n }),\n initialValues: { cancelReason: \"\" },\n }}\n >\n <Textarea\n data-cy=\"cancel-meeting-input-textfield\"\n label={t(\"neetoPayments.recurringPaymentCancel.reasonLabel\")}\n name=\"cancelReason\"\n placeholder={t(\n \"neetoPayments.recurringPaymentCancel.reasonPlaceholder\"\n )}\n />\n <Button\n data-cy=\"cancel-meeting-submit-button\"\n disabled={isPending}\n label={t(\"neetoPayments.recurringPaymentCancel.buttonLabel\")}\n loading={isPending}\n style=\"danger\"\n />\n </Form>\n </div>\n );\n};\n\nexport default CustomerCancelRecurringPaymentForm;\n"],"names":["show","payableId","axios","get","concat","BASE_URL","update","_ref","payload","put","recurring_payment","recurringPaymentsApi","useFetchRecurringPayment","useQuery","queryKey","QUERY_KEYS","RECURRING_PAYMENT","queryFn","enabled","isNotNil","useUpdateRecurringPayments","useMutationWithInvalidation","keysToInvalidate","CustomerCancelRecurringPaymentForm","_useTranslation","useTranslation","t","_useFetchRecurringPay","isLoading","_useFetchRecurringPay2","data","_useFetchRecurringPay3","recurringPayment","_useUpdateRecurringPa","isPending","updateRecurringPayment","mutate","_jsx","className","children","Spinner","status","Typography","_jsxs","Form","formikProps","onSubmit","_ref2","cancelReason","initialValues","Textarea","label","name","placeholder","Button","disabled","loading","style"],"mappings":";;;;;;;;;;;;;;;;;;AAIA,IAAMA,IAAI,GAAG,SAAPA,IAAIA,CAAGC,SAAS,EAAA;AAAA,EAAA,OACpBC,KAAK,CAACC,GAAG,CAAA,EAAA,CAAAC,MAAA,CAAIC,QAAQ,EAAA,oCAAA,CAAA,CAAAD,MAAA,CAAqCH,SAAS,CAAE,CAAC;AAAA,CAAA;AAExE,IAAMK,MAAM,GAAG,SAATA,MAAMA,CAAAC,IAAA,EAAA;AAAA,EAAA,IAAMN,SAAS,GAAAM,IAAA,CAATN,SAAS;IAAEO,OAAO,GAAAD,IAAA,CAAPC,OAAO;EAAA,OAClCN,KAAK,CAACO,GAAG,CAAAL,EAAAA,CAAAA,MAAA,CAAIC,QAAQ,EAAAD,oCAAAA,CAAAA,CAAAA,MAAA,CAAqCH,SAAS,CAAI,EAAA;AACrES,IAAAA,iBAAiB,EAAEF;AACrB,GAAC,CAAC;AAAA,CAAA;AAEJ,IAAMG,oBAAoB,GAAG;AAAEX,EAAAA,IAAI,EAAJA,IAAI;AAAEM,EAA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AAA,IAAI,EAAC,cAAc;QACnBC,WAAW,EAAE3B,CAAC,CACZ,wDACF;AAAE,OACH,CAAC,eACFW,GAAA,CAACiB,MAAM,EAAA;AACL,QAAA,SAAA,EAAQ,8BAA8B;AACtCC,QAAAA,QAAQ,EAAErB,SAAU;AACpBiB,QAAAA,KAAK,EAAEzB,CAAC,CAAC,kDAAkD,CAAE;AAC7D8B,QAAAA,OAAO,EAAEtB,SAAU;AACnBuB,QAAAA,KAAK,EAAC;AAAQ,OACf,CAAC;KACE;AAAC,GACJ,CAAC;AAEV;;;;"}
|
|
@@ -12,7 +12,7 @@ import { E as ExportModal } from './ExportModal-DCGDM_Fa.js';
|
|
|
12
12
|
import { useQuery } from '@tanstack/react-query';
|
|
13
13
|
import axios from 'axios';
|
|
14
14
|
import { B as BASE_URL, P as PAYMENT_PROVIDERS, c as DEFAULT_TAG_STYLE, f as formatAmount, d as formatCurrency, e as getUniquePaymentProviders, h as buildDefaultTableColumns, 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, j as DASHBOARD_KIND } from './index-ER2sofJn.js';
|
|
15
|
-
import { Q as QUERY_KEYS } from './queryConstants-
|
|
15
|
+
import { Q as QUERY_KEYS } from './queryConstants-mgjK5Hgk.js';
|
|
16
16
|
import { t } from 'i18next';
|
|
17
17
|
import { toLabelAndValue, snakeToCamelCase, humanize, isNotPresent, isPresent, camelToSnakeCase } from '@bigbinary/neeto-cist';
|
|
18
18
|
import { useHiddenColumns } from '@bigbinary/neeto-molecules/Columns';
|
package/dist/PayoutsDashboard.js
CHANGED
|
@@ -30,8 +30,8 @@ import TableWrapper from '@bigbinary/neeto-molecules/TableWrapper';
|
|
|
30
30
|
import Table from '@bigbinary/neetoui/Table';
|
|
31
31
|
import NoData from '@bigbinary/neetoui/NoData';
|
|
32
32
|
import Spinner from '@bigbinary/neetoui/Spinner';
|
|
33
|
-
import { u as useFetchStripePayouts } from './useConnectApi-
|
|
34
|
-
import { u as useFetchStripePlatformPayouts } from './usePlatformApi-
|
|
33
|
+
import { u as useFetchStripePayouts } from './useConnectApi-DLJNjz8A.js';
|
|
34
|
+
import { u as useFetchStripePlatformPayouts } from './usePlatformApi-BmTjLVDt.js';
|
|
35
35
|
import '@tanstack/react-query';
|
|
36
36
|
import '@tanstack/react-query-devtools';
|
|
37
37
|
import 'axios';
|
|
@@ -40,7 +40,7 @@ import '@bigbinary/neetoui/Tag';
|
|
|
40
40
|
import '@bigbinary/neetoui/Tooltip';
|
|
41
41
|
import '@bigbinary/neeto-molecules/CopyToClipboardButton';
|
|
42
42
|
import 'qs';
|
|
43
|
-
import './queryConstants-
|
|
43
|
+
import './queryConstants-mgjK5Hgk.js';
|
|
44
44
|
|
|
45
45
|
var TAB = {
|
|
46
46
|
all: "all",
|
package/dist/PayoutsPage.js
CHANGED
|
@@ -5,8 +5,8 @@ import Typography from '@bigbinary/neetoui/Typography';
|
|
|
5
5
|
import { useTranslation } from 'react-i18next';
|
|
6
6
|
import { useParams } from 'react-router-dom/cjs/react-router-dom';
|
|
7
7
|
import { r as renderStatus, c as renderDate } from './renderFunctions-COtuAmF9.js';
|
|
8
|
-
import { a as useShowStripePayout } from './useConnectApi-
|
|
9
|
-
import { a as useShowStripePlatformPayout } from './usePlatformApi-
|
|
8
|
+
import { a as useShowStripePayout } from './useConnectApi-DLJNjz8A.js';
|
|
9
|
+
import { a as useShowStripePlatformPayout } from './usePlatformApi-BmTjLVDt.js';
|
|
10
10
|
import Button from '@bigbinary/neetoui/Button';
|
|
11
11
|
import { C as CopyButtonWrapper } from './CopyButtonWrapper-SoJkwX-d.js';
|
|
12
12
|
import { k as buildStripePayoutLink } from './index-ER2sofJn.js';
|
|
@@ -21,7 +21,7 @@ import '@tanstack/react-query';
|
|
|
21
21
|
import '@bigbinary/neeto-commons-frontend/react-utils';
|
|
22
22
|
import 'axios';
|
|
23
23
|
import 'qs';
|
|
24
|
-
import './queryConstants-
|
|
24
|
+
import './queryConstants-mgjK5Hgk.js';
|
|
25
25
|
import '@bigbinary/neeto-molecules/CopyToClipboardButton';
|
|
26
26
|
import '@bigbinary/neeto-commons-frontend/constants';
|
|
27
27
|
import '@bigbinary/neeto-commons-frontend/utils';
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { isNotPresent } from '@bigbinary/neeto-cist';
|
|
2
|
+
import CardLayout from '@bigbinary/neeto-molecules/CardLayout';
|
|
2
3
|
import Container from '@bigbinary/neeto-molecules/Container';
|
|
3
4
|
import Header from '@bigbinary/neeto-molecules/Header';
|
|
4
5
|
import Typography from '@bigbinary/neetoui/Typography';
|
|
@@ -14,7 +15,7 @@ import { useQuery } from '@tanstack/react-query';
|
|
|
14
15
|
import { useMutationWithInvalidation } from '@bigbinary/neeto-commons-frontend/react-utils';
|
|
15
16
|
import axios from 'axios';
|
|
16
17
|
import { B as BASE_URL } from './index-ER2sofJn.js';
|
|
17
|
-
import { Q as QUERY_KEYS } from './queryConstants-
|
|
18
|
+
import { Q as QUERY_KEYS } from './queryConstants-mgjK5Hgk.js';
|
|
18
19
|
import { t } from 'i18next';
|
|
19
20
|
import * as yup from 'yup';
|
|
20
21
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
@@ -88,27 +89,26 @@ var RecurringPaymentSettings = function RecurringPaymentSettings(_ref) {
|
|
|
88
89
|
breadcrumbs: breadcrumbs,
|
|
89
90
|
title: t("neetoPayments.recurringPaymentSettings.title")
|
|
90
91
|
}), /*#__PURE__*/jsx("div", {
|
|
91
|
-
className: "
|
|
92
|
-
children: /*#__PURE__*/jsx(
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
}), /*#__PURE__*/jsx(ActionBlock, {
|
|
108
|
-
isSubmitting: isPending
|
|
109
|
-
})]
|
|
92
|
+
className: "w-full",
|
|
93
|
+
children: fee !== null && fee !== void 0 && fee.isRecurringPaymentEnabled ? /*#__PURE__*/jsx(Form, {
|
|
94
|
+
formikProps: {
|
|
95
|
+
enableReinitialize: true,
|
|
96
|
+
onSubmit: handleSubmit,
|
|
97
|
+
initialValues: mergeLeft(recurringSetting, INITIAL_VALUE),
|
|
98
|
+
validationSchema: VALIDATION_SCHEMA
|
|
99
|
+
},
|
|
100
|
+
children: /*#__PURE__*/jsx(CardLayout, {
|
|
101
|
+
actionBlock: /*#__PURE__*/jsx(ActionBlock, {
|
|
102
|
+
isSubmitting: isPending
|
|
103
|
+
}),
|
|
104
|
+
children: /*#__PURE__*/jsx(Input, {
|
|
105
|
+
required: true,
|
|
106
|
+
name: "attemptOffsetDays",
|
|
107
|
+
label: t("neetoPayments.recurringPaymentSettings.attemptOffsetDays.label")
|
|
110
108
|
})
|
|
111
|
-
})
|
|
109
|
+
})
|
|
110
|
+
}) : /*#__PURE__*/jsx(CardLayout, {
|
|
111
|
+
children: /*#__PURE__*/jsx(Typography, {
|
|
112
112
|
lineHeight: "normal",
|
|
113
113
|
style: "body1",
|
|
114
114
|
children: /*#__PURE__*/jsx(Trans, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RecurringPaymentSettings.js","sources":["../app/javascript/src/apis/recurring_settings.js","../app/javascript/src/hooks/reactQuery/useRecurringSettingsApi.js","../app/javascript/src/components/RecurringPaymentSettings/constants.js","../app/javascript/src/components/RecurringPaymentSettings/index.jsx"],"sourcesContent":["import axios from \"axios\";\n\nimport { BASE_URL } from \"src/constants\";\n\nconst show = feeId =>\n axios.get(`${BASE_URL}/api/v1/fees/${feeId}/recurring_setting`);\n\nconst update = (feeId, payload) =>\n axios.put(`${BASE_URL}/api/v1/fees/${feeId}/recurring_setting`, {\n recurringSetting: payload,\n });\n\nconst recurringSettingsApi = { show, update };\n\nexport default recurringSettingsApi;\n","import { useQuery } from \"@tanstack/react-query\";\nimport { useMutationWithInvalidation } from \"neetocommons/react-utils\";\nimport { isNotNil } from \"ramda\";\n\nimport recurringSettingsApi from \"apis/recurring_settings\";\nimport { QUERY_KEYS } from \"src/common/queryConstants\";\n\nexport const useFetchRecurringSettings = feeId =>\n useQuery({\n queryKey: [QUERY_KEYS.RECURRING_SETTINGS, feeId],\n queryFn: () => recurringSettingsApi.show(feeId),\n enabled: isNotNil(feeId),\n });\n\nexport const useUpdateRecurringSettings = (feeId, options) =>\n useMutationWithInvalidation(\n payload => recurringSettingsApi.update(feeId, payload),\n {\n keysToInvalidate: [QUERY_KEYS.RECURRING_SETTINGS, feeId],\n ...options,\n }\n );\n","import { t } from \"i18next\";\nimport * as yup from \"yup\";\n\nexport const INITIAL_VALUE = { attemptOffsetDays: 1 };\nexport const VALIDATION_SCHEMA = yup.object({\n attemptOffsetDays: yup\n .number()\n .max(15, t(\"neetoPayments.recurringPaymentSettings.attemptOffsetDays.max\"))\n .min(1, t(\"neetoPayments.recurringPaymentSettings.attemptOffsetDays.min\"))\n .required(\n t(\"neetoPayments.recurringPaymentSettings.attemptOffsetDays.isRequired\")\n ),\n});\n","import { isNotPresent } from \"neetocist\";\nimport Container from \"neetomolecules/Container\";\nimport Header from \"neetomolecules/Header\";\nimport { Typography, Button, Spinner } from \"neetoui\";\nimport { ActionBlock, Input, Form } from \"neetoui/formik\";\nimport { mergeLeft } from \"ramda\";\nimport { Trans, useTranslation } from \"react-i18next\";\n\nimport {\n useFetchRecurringSettings,\n useUpdateRecurringSettings,\n} from \"hooks/reactQuery/useRecurringSettingsApi\";\n\nimport { INITIAL_VALUE, VALIDATION_SCHEMA } from \"./constants\";\n\nconst RecurringPaymentSettings = ({\n fee,\n breadcrumbs,\n enableRecurringPaymentUrl,\n}) => {\n const { t } = useTranslation();\n\n const { isLoading, data: { recurringSetting } = {} } =\n useFetchRecurringSettings(fee?.id);\n\n const { mutate: updateRecurringSetting, isPending } =\n useUpdateRecurringSettings(fee?.id);\n\n const handleSubmit = values => {\n updateRecurringSetting(values);\n };\n\n if (isLoading || isNotPresent(fee)) {\n return (\n <div className=\"flex h-full w-full items-center justify-center\">\n <Spinner />\n </div>\n );\n }\n\n return (\n <Container>\n <Header\n {...{ breadcrumbs }}\n title={t(\"neetoPayments.recurringPaymentSettings.title\")}\n />\n <div className=\"
|
|
1
|
+
{"version":3,"file":"RecurringPaymentSettings.js","sources":["../app/javascript/src/apis/recurring_settings.js","../app/javascript/src/hooks/reactQuery/useRecurringSettingsApi.js","../app/javascript/src/components/RecurringPaymentSettings/constants.js","../app/javascript/src/components/RecurringPaymentSettings/index.jsx"],"sourcesContent":["import axios from \"axios\";\n\nimport { BASE_URL } from \"src/constants\";\n\nconst show = feeId =>\n axios.get(`${BASE_URL}/api/v1/fees/${feeId}/recurring_setting`);\n\nconst update = (feeId, payload) =>\n axios.put(`${BASE_URL}/api/v1/fees/${feeId}/recurring_setting`, {\n recurringSetting: payload,\n });\n\nconst recurringSettingsApi = { show, update };\n\nexport default recurringSettingsApi;\n","import { useQuery } from \"@tanstack/react-query\";\nimport { useMutationWithInvalidation } from \"neetocommons/react-utils\";\nimport { isNotNil } from \"ramda\";\n\nimport recurringSettingsApi from \"apis/recurring_settings\";\nimport { QUERY_KEYS } from \"src/common/queryConstants\";\n\nexport const useFetchRecurringSettings = feeId =>\n useQuery({\n queryKey: [QUERY_KEYS.RECURRING_SETTINGS, feeId],\n queryFn: () => recurringSettingsApi.show(feeId),\n enabled: isNotNil(feeId),\n });\n\nexport const useUpdateRecurringSettings = (feeId, options) =>\n useMutationWithInvalidation(\n payload => recurringSettingsApi.update(feeId, payload),\n {\n keysToInvalidate: [QUERY_KEYS.RECURRING_SETTINGS, feeId],\n ...options,\n }\n );\n","import { t } from \"i18next\";\nimport * as yup from \"yup\";\n\nexport const INITIAL_VALUE = { attemptOffsetDays: 1 };\nexport const VALIDATION_SCHEMA = yup.object({\n attemptOffsetDays: yup\n .number()\n .max(15, t(\"neetoPayments.recurringPaymentSettings.attemptOffsetDays.max\"))\n .min(1, t(\"neetoPayments.recurringPaymentSettings.attemptOffsetDays.min\"))\n .required(\n t(\"neetoPayments.recurringPaymentSettings.attemptOffsetDays.isRequired\")\n ),\n});\n","import { isNotPresent } from \"neetocist\";\nimport CardLayout from \"neetomolecules/CardLayout\";\nimport Container from \"neetomolecules/Container\";\nimport Header from \"neetomolecules/Header\";\nimport { Typography, Button, Spinner } from \"neetoui\";\nimport { ActionBlock, Input, Form } from \"neetoui/formik\";\nimport { mergeLeft } from \"ramda\";\nimport { Trans, useTranslation } from \"react-i18next\";\n\nimport {\n useFetchRecurringSettings,\n useUpdateRecurringSettings,\n} from \"hooks/reactQuery/useRecurringSettingsApi\";\n\nimport { INITIAL_VALUE, VALIDATION_SCHEMA } from \"./constants\";\n\nconst RecurringPaymentSettings = ({\n fee,\n breadcrumbs,\n enableRecurringPaymentUrl,\n}) => {\n const { t } = useTranslation();\n\n const { isLoading, data: { recurringSetting } = {} } =\n useFetchRecurringSettings(fee?.id);\n\n const { mutate: updateRecurringSetting, isPending } =\n useUpdateRecurringSettings(fee?.id);\n\n const handleSubmit = values => {\n updateRecurringSetting(values);\n };\n\n if (isLoading || isNotPresent(fee)) {\n return (\n <div className=\"flex h-full w-full items-center justify-center\">\n <Spinner />\n </div>\n );\n }\n\n return (\n <Container>\n <Header\n {...{ breadcrumbs }}\n title={t(\"neetoPayments.recurringPaymentSettings.title\")}\n />\n <div className=\"w-full\">\n {fee?.isRecurringPaymentEnabled ? (\n <Form\n formikProps={{\n enableReinitialize: true,\n onSubmit: handleSubmit,\n initialValues: mergeLeft(recurringSetting, INITIAL_VALUE),\n validationSchema: VALIDATION_SCHEMA,\n }}\n >\n <CardLayout actionBlock={<ActionBlock isSubmitting={isPending} />}>\n <Input\n required\n name=\"attemptOffsetDays\"\n label={t(\n \"neetoPayments.recurringPaymentSettings.attemptOffsetDays.label\"\n )}\n />\n </CardLayout>\n </Form>\n ) : (\n <CardLayout>\n <Typography lineHeight=\"normal\" style=\"body1\">\n <Trans\n i18nKey=\"neetoPayments.recurringPaymentSettings.enableRecurringPayment\"\n components={{\n button: (\n <Button\n data-cy=\"split-payment-connect-button\"\n size=\"large\"\n style=\"link\"\n to={enableRecurringPaymentUrl}\n />\n ),\n }}\n />\n </Typography>\n </CardLayout>\n )}\n </div>\n </Container>\n );\n};\n\nexport default RecurringPaymentSettings;\n"],"names":["show","feeId","axios","get","concat","BASE_URL","update","payload","put","recurringSetting","recurringSettingsApi","useFetchRecurringSettings","useQuery","queryKey","QUERY_KEYS","RECURRING_SETTINGS","queryFn","enabled","isNotNil","useUpdateRecurringSettings","options","useMutationWithInvalidation","_objectSpread","keysToInvalidate","INITIAL_VALUE","attemptOffsetDays","VALIDATION_SCHEMA","yup","object","number","max","t","min","required","RecurringPaymentSettings","_ref","fee","breadcrumbs","enableRecurringPaymentUrl","_useTranslation","useTranslation","_useFetchRecurringSet","id","isLoading","_useFetchRecurringSet2","data","_useFetchRecurringSet3","_useUpdateRecurringSe","updateRecurringSetting","mutate","isPending","handleSubmit","values","isNotPresent","_jsx","className","children","Spinner","_jsxs","Container","Header","title","isRecurringPaymentEnabled","Form","formikProps","enableReinitialize","onSubmit","initialValues","mergeLeft","validationSchema","CardLayout","actionBlock","ActionBlock","isSubmitting","Input","name","label","Typography","lineHeight","style","Trans","i18nKey","components","button","Button","size","to"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAIA,IAAMA,IAAI,GAAG,SAAPA,IAAIA,CAAGC,KAAK,EAAA;AAAA,EAAA,OAChBC,KAAK,CAACC,GAAG,CAAA,EAAA,CAAAC,MAAA,CAAIC,QAAQ,EAAA,eAAA,CAAA,CAAAD,MAAA,CAAgBH,KAAK,EAAA,oBAAA,CAAoB,CAAC;AAAA,CAAA;AAEjE,IAAMK,MAAM,GAAG,SAATA,MAAMA,CAAIL,KAAK,EAAEM,OAAO,EAAA;EAAA,OAC5BL,KAAK,CAACM,GAAG,CA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DAA+D;AACvEC,YAAAA,UAAU,EAAE;cACVC,MAAM,eACJ7B,GAAA,CAAC8B,MAAM,EAAA;AACL,gBAAA,SAAA,EAAQ,8BAA8B;AACtCC,gBAAAA,IAAI,EAAC,OAAO;AACZN,gBAAAA,KAAK,EAAC,MAAM;AACZO,gBAAAA,EAAE,EAAEhD;eACL;AAEL;WACD;SACS;OACF;AACb,KACE,CAAC;AAAA,GACG,CAAC;AAEhB;;;;"}
|
package/dist/RefundsDashboard.js
CHANGED
|
@@ -12,7 +12,7 @@ import { E as ExportModal } from './ExportModal-DCGDM_Fa.js';
|
|
|
12
12
|
import { useQuery } from '@tanstack/react-query';
|
|
13
13
|
import axios from 'axios';
|
|
14
14
|
import { B as BASE_URL, P as PAYMENT_PROVIDERS, c as DEFAULT_TAG_STYLE, f as formatAmount, d as formatCurrency, h as buildDefaultTableColumns, S as SORT_DIRECTIONS, p as processDataIndex, A as ASSOCIATED_TABLE_COLUMNS, D as DEFAULT_SORT_PROPERTIES, s as shouldTabsVisible, U as UN_HIDEABLE_COLUMNS, i as DEFAULT_PAGE_VALUES, j as DASHBOARD_KIND } from './index-ER2sofJn.js';
|
|
15
|
-
import { Q as QUERY_KEYS } from './queryConstants-
|
|
15
|
+
import { Q as QUERY_KEYS } from './queryConstants-mgjK5Hgk.js';
|
|
16
16
|
import { t } from 'i18next';
|
|
17
17
|
import { toLabelAndValue, snakeToCamelCase, humanize, isNotPresent, camelToSnakeCase, isPresent } from '@bigbinary/neeto-cist';
|
|
18
18
|
import { useHiddenColumns } from '@bigbinary/neeto-molecules/Columns';
|
|
@@ -13,7 +13,7 @@ import { useQuery } from '@tanstack/react-query';
|
|
|
13
13
|
import { useMutationWithInvalidation } from '@bigbinary/neeto-commons-frontend/react-utils';
|
|
14
14
|
import axios from 'axios';
|
|
15
15
|
import { B as BASE_URL, l as preProcessStatus, m as getTagStyle, f as formatAmount, d as formatCurrency, n as PAYMENT_KIND, p as processDataIndex, S as SORT_DIRECTIONS, D as DEFAULT_SORT_PROPERTIES, s as shouldTabsVisible, U as UN_HIDEABLE_COLUMNS, i as DEFAULT_PAGE_VALUES, j as DASHBOARD_KIND } from './index-ER2sofJn.js';
|
|
16
|
-
import { Q as QUERY_KEYS } from './queryConstants-
|
|
16
|
+
import { Q as QUERY_KEYS } from './queryConstants-mgjK5Hgk.js';
|
|
17
17
|
import Modal from '@bigbinary/neetoui/Modal';
|
|
18
18
|
import Typography from '@bigbinary/neetoui/Typography';
|
|
19
19
|
import Form from '@bigbinary/neetoui/formik/Form';
|
package/dist/StripeConnect.js
CHANGED
|
@@ -6,7 +6,7 @@ import { humanize, isPresent } from '@bigbinary/neeto-cist';
|
|
|
6
6
|
import { useQueryParams, withT, useStateWithDependency } from '@bigbinary/neeto-commons-frontend/react-utils';
|
|
7
7
|
import Demo from 'neetointegrations/Demo';
|
|
8
8
|
import IntegrationModal from 'neetointegrations/Modal';
|
|
9
|
-
import { b as useCreateStripeAccount, c as usePollingStripeAccountCreationStatus, d as useFetchConnectedStripeAccount, e as useDestroyStripeAccount, f as usePollingStripeAccount } from './useConnectApi-
|
|
9
|
+
import { b as useCreateStripeAccount, c as usePollingStripeAccountCreationStatus, d as useFetchConnectedStripeAccount, e as useDestroyStripeAccount, f as usePollingStripeAccount } from './useConnectApi-DLJNjz8A.js';
|
|
10
10
|
import Label from '@bigbinary/neetoui/Label';
|
|
11
11
|
import Typography from '@bigbinary/neetoui/Typography';
|
|
12
12
|
import { useTranslation, Trans } from 'react-i18next';
|
|
@@ -18,7 +18,7 @@ import { useHistory } from 'react-router-dom';
|
|
|
18
18
|
import { useQuery } from '@tanstack/react-query';
|
|
19
19
|
import axios from 'axios';
|
|
20
20
|
import { B as BASE_URL } from './index-ER2sofJn.js';
|
|
21
|
-
import { Q as QUERY_KEYS } from './queryConstants-
|
|
21
|
+
import { Q as QUERY_KEYS } from './queryConstants-mgjK5Hgk.js';
|
|
22
22
|
import { t } from 'i18next';
|
|
23
23
|
import * as yup from 'yup';
|
|
24
24
|
import 'ramda';
|
package/dist/TaxesDashboard.js
CHANGED
|
@@ -16,7 +16,7 @@ import { useQuery } from '@tanstack/react-query';
|
|
|
16
16
|
import { useMutationWithInvalidation } from '@bigbinary/neeto-commons-frontend/react-utils';
|
|
17
17
|
import axios from 'axios';
|
|
18
18
|
import { B as BASE_URL } from './index-ER2sofJn.js';
|
|
19
|
-
import { Q as QUERY_KEYS } from './queryConstants-
|
|
19
|
+
import { Q as QUERY_KEYS } from './queryConstants-mgjK5Hgk.js';
|
|
20
20
|
import Label from '@bigbinary/neetoui/Label';
|
|
21
21
|
import Typography from '@bigbinary/neetoui/Typography';
|
|
22
22
|
import Pane from '@bigbinary/neetoui/Pane';
|
|
@@ -266,7 +266,9 @@ var TaxesDashboard = function TaxesDashboard(_ref) {
|
|
|
266
266
|
_ref$onTaxesChange = _ref.onTaxesChange,
|
|
267
267
|
onTaxesChange = _ref$onTaxesChange === void 0 ? noop : _ref$onTaxesChange,
|
|
268
268
|
_ref$paymentUrl = _ref.paymentUrl,
|
|
269
|
-
paymentUrl = _ref$paymentUrl === void 0 ? "" : _ref$paymentUrl
|
|
269
|
+
paymentUrl = _ref$paymentUrl === void 0 ? "" : _ref$paymentUrl,
|
|
270
|
+
_ref$headerSize = _ref.headerSize,
|
|
271
|
+
headerSize = _ref$headerSize === void 0 ? "small" : _ref$headerSize;
|
|
270
272
|
var _useState = useState(false),
|
|
271
273
|
_useState2 = _slicedToArray(_useState, 2),
|
|
272
274
|
isFormPaneOpen = _useState2[0],
|
|
@@ -310,6 +312,7 @@ var TaxesDashboard = function TaxesDashboard(_ref) {
|
|
|
310
312
|
return /*#__PURE__*/jsxs(Container, {
|
|
311
313
|
children: [/*#__PURE__*/jsx(Header$1, {
|
|
312
314
|
breadcrumbs: breadcrumbs,
|
|
315
|
+
size: headerSize,
|
|
313
316
|
title: t("neetoPayments.taxesDashboard.title")
|
|
314
317
|
}), /*#__PURE__*/jsx("div", {
|
|
315
318
|
className: "flex h-full w-full items-center justify-center",
|