@bigbinary/neeto-payments-frontend 3.0.24 → 3.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (102) hide show
  1. package/app/javascript/src/translations/en.json +10 -1
  2. package/dist/AccountsDashboard.js +24 -26
  3. package/dist/AccountsDashboard.js.map +1 -1
  4. package/dist/CopyButtonWrapper-SoJkwX-d.js.map +1 -1
  5. package/dist/{ExportModal-C6-IwFlZ.js → ExportModal-BkWscSJE.js} +2 -2
  6. package/dist/{ExportModal-C6-IwFlZ.js.map → ExportModal-BkWscSJE.js.map} +1 -1
  7. package/dist/PaymentKindRestrictionAlert.js.map +1 -1
  8. package/dist/PaymentsDashboard.js +23 -25
  9. package/dist/PaymentsDashboard.js.map +1 -1
  10. package/dist/PayoutsDashboard.js +29 -31
  11. package/dist/PayoutsDashboard.js.map +1 -1
  12. package/dist/PayoutsPage.js +6 -6
  13. package/dist/PayoutsPage.js.map +1 -1
  14. package/dist/RazorpayPaymentButton.js +2 -2
  15. package/dist/RazorpayPaymentButton.js.map +1 -1
  16. package/dist/RefundsDashboard.js +23 -25
  17. package/dist/RefundsDashboard.js.map +1 -1
  18. package/dist/SplitTransfersDashboard.js +119 -44
  19. package/dist/SplitTransfersDashboard.js.map +1 -1
  20. package/dist/StripeConnect.js +2 -2
  21. package/dist/StripeConnect.js.map +1 -1
  22. package/dist/UpiConnect.js.map +1 -1
  23. package/dist/UpiMarkAsPaidButton.js +2 -2
  24. package/dist/UpiMarkAsPaidButton.js.map +1 -1
  25. package/dist/UpiPayment.js +4 -863
  26. package/dist/UpiPayment.js.map +1 -1
  27. package/dist/buildStripeTransactionLink.js +1 -1
  28. package/dist/cjs/AccountsDashboard.js +24 -26
  29. package/dist/cjs/AccountsDashboard.js.map +1 -1
  30. package/dist/cjs/CopyButtonWrapper-Ds1k64E0.js.map +1 -1
  31. package/dist/cjs/{ExportModal-DaLww9x0.js → ExportModal-BU5MzzaS.js} +2 -2
  32. package/dist/cjs/{ExportModal-DaLww9x0.js.map → ExportModal-BU5MzzaS.js.map} +1 -1
  33. package/dist/cjs/PaymentKindRestrictionAlert.js.map +1 -1
  34. package/dist/cjs/PaymentsDashboard.js +23 -25
  35. package/dist/cjs/PaymentsDashboard.js.map +1 -1
  36. package/dist/cjs/PayoutsDashboard.js +29 -31
  37. package/dist/cjs/PayoutsDashboard.js.map +1 -1
  38. package/dist/cjs/PayoutsPage.js +6 -6
  39. package/dist/cjs/PayoutsPage.js.map +1 -1
  40. package/dist/cjs/RazorpayPaymentButton.js +2 -2
  41. package/dist/cjs/RazorpayPaymentButton.js.map +1 -1
  42. package/dist/cjs/RefundsDashboard.js +23 -25
  43. package/dist/cjs/RefundsDashboard.js.map +1 -1
  44. package/dist/cjs/SplitTransfersDashboard.js +138 -44
  45. package/dist/cjs/SplitTransfersDashboard.js.map +1 -1
  46. package/dist/cjs/StripeConnect.js +2 -2
  47. package/dist/cjs/StripeConnect.js.map +1 -1
  48. package/dist/cjs/UpiConnect.js.map +1 -1
  49. package/dist/cjs/UpiMarkAsPaidButton.js +2 -2
  50. package/dist/cjs/UpiMarkAsPaidButton.js.map +1 -1
  51. package/dist/cjs/UpiPayment.js +4 -863
  52. package/dist/cjs/UpiPayment.js.map +1 -1
  53. package/dist/cjs/buildStripeTransactionLink.js +1 -1
  54. package/dist/cjs/constants.js +1 -1
  55. package/dist/cjs/{dashboard-BAIM4ZLC.js → dashboard-Bhh942b_.js} +2 -2
  56. package/dist/cjs/{dashboard-BAIM4ZLC.js.map → dashboard-Bhh942b_.js.map} +1 -1
  57. package/dist/cjs/exportChannel-BsZ3fusx.js.map +1 -1
  58. package/dist/cjs/{index-Br_ibfWm.js → index-DFhiGrTx.js} +5 -3
  59. package/dist/cjs/index-DFhiGrTx.js.map +1 -0
  60. package/dist/cjs/index.js +13 -11
  61. package/dist/cjs/index.js.map +1 -1
  62. package/dist/cjs/queryConstants-DjUfvjMz.js.map +1 -1
  63. package/dist/cjs/{renderFunctions-DW0frqfV.js → renderFunctions-C0wN6yD6.js} +2 -2
  64. package/dist/cjs/{renderFunctions-DW0frqfV.js.map → renderFunctions-C0wN6yD6.js.map} +1 -1
  65. package/dist/cjs/stripe.esm-CrNYjPcC.js.map +1 -1
  66. package/dist/cjs/{useConnectApi-C3EpIQ0I.js → useConnectApi-DdaKZh9v.js} +2 -2
  67. package/dist/cjs/{useConnectApi-C3EpIQ0I.js.map → useConnectApi-DdaKZh9v.js.map} +1 -1
  68. package/dist/cjs/{usePaymentApi-lZYye4u0.js → usePaymentApi-Ct4IyY6F.js} +2 -2
  69. package/dist/cjs/{usePaymentApi-lZYye4u0.js.map → usePaymentApi-Ct4IyY6F.js.map} +1 -1
  70. package/dist/cjs/{usePaymentsApi-CDy4nTGr.js → usePaymentsApi-CRiwy7_v.js} +2 -2
  71. package/dist/cjs/{usePaymentsApi-CDy4nTGr.js.map → usePaymentsApi-CRiwy7_v.js.map} +1 -1
  72. package/dist/cjs/{usePlatformApi-BajSo0Hl.js → usePlatformApi-CE2wL8Hb.js} +2 -2
  73. package/dist/cjs/{usePlatformApi-BajSo0Hl.js.map → usePlatformApi-CE2wL8Hb.js.map} +1 -1
  74. package/dist/cjs/useRazorpayPayment.js +2 -2
  75. package/dist/cjs/useRazorpayPayment.js.map +1 -1
  76. package/dist/cjs/useStripePromise.js.map +1 -1
  77. package/dist/constants.js +1 -1
  78. package/dist/{dashboard-CzHfj-E5.js → dashboard-BWze-7eb.js} +2 -2
  79. package/dist/{dashboard-CzHfj-E5.js.map → dashboard-BWze-7eb.js.map} +1 -1
  80. package/dist/exportChannel-CViICC6x.js.map +1 -1
  81. package/dist/{index-lD18ClWH.js → index-Cl511Juk.js} +5 -3
  82. package/dist/index-Cl511Juk.js.map +1 -0
  83. package/dist/index.js +13 -11
  84. package/dist/index.js.map +1 -1
  85. package/dist/queryConstants-BCx5cEmf.js.map +1 -1
  86. package/dist/{renderFunctions-TxCky_xI.js → renderFunctions-DlSa2Jxe.js} +2 -2
  87. package/dist/{renderFunctions-TxCky_xI.js.map → renderFunctions-DlSa2Jxe.js.map} +1 -1
  88. package/dist/stripe.esm-DuZ_gsAa.js.map +1 -1
  89. package/dist/{useConnectApi-DzvCFwAu.js → useConnectApi-xlrUWD9s.js} +2 -2
  90. package/dist/{useConnectApi-DzvCFwAu.js.map → useConnectApi-xlrUWD9s.js.map} +1 -1
  91. package/dist/{usePaymentApi-4b6Udgmj.js → usePaymentApi-DiWHWkBI.js} +2 -2
  92. package/dist/{usePaymentApi-4b6Udgmj.js.map → usePaymentApi-DiWHWkBI.js.map} +1 -1
  93. package/dist/{usePaymentsApi-CwVIUDRp.js → usePaymentsApi-1Lsm4d5C.js} +2 -2
  94. package/dist/{usePaymentsApi-CwVIUDRp.js.map → usePaymentsApi-1Lsm4d5C.js.map} +1 -1
  95. package/dist/{usePlatformApi-X-BDj5nS.js → usePlatformApi-D99hwX7m.js} +2 -2
  96. package/dist/{usePlatformApi-X-BDj5nS.js.map → usePlatformApi-D99hwX7m.js.map} +1 -1
  97. package/dist/useRazorpayPayment.js +2 -2
  98. package/dist/useRazorpayPayment.js.map +1 -1
  99. package/dist/useStripePromise.js.map +1 -1
  100. package/package.json +55 -52
  101. package/dist/cjs/index-Br_ibfWm.js.map +0 -1
  102. package/dist/index-lD18ClWH.js.map +0 -1
@@ -8,26 +8,31 @@ import { buildFiltersFromURL } from '@bigbinary/neeto-filters-frontend/utils';
8
8
  import Spinner from '@bigbinary/neetoui/Spinner';
9
9
  import { mergeLeft, curry, mergeDeepWith, concat, reject, isNil, map, prop, sortBy, isEmpty, modify, pluck } from 'ramda';
10
10
  import { useHistory } from 'react-router-dom';
11
- import { E as ExportModal } from './ExportModal-C6-IwFlZ.js';
11
+ import { E as ExportModal } from './ExportModal-BkWscSJE.js';
12
12
  import { useQuery } from '@tanstack/react-query';
13
13
  import { useMutationWithInvalidation } from '@bigbinary/neeto-commons-frontend/react-utils';
14
14
  import axios from 'axios';
15
- import { B as BASE_URL, k as preProcessStatus, l as getTagStyle, f as formatAmount, d as formatCurrency, m as PAYMENT_KIND, p as processDataIndex, S as SORT_DIRECTIONS, D as DEFAULT_SORT_PROPERTIES, s as shouldTabsVisible, U as UN_HIDEABLE_COLUMNS, h as DEFAULT_PAGE_VALUES, i as DASHBOARD_KIND } from './index-lD18ClWH.js';
15
+ import { B as BASE_URL, k as preProcessStatus, l as getTagStyle, f as formatAmount, d as formatCurrency, m as PAYMENT_KIND, p as processDataIndex, S as SORT_DIRECTIONS, D as DEFAULT_SORT_PROPERTIES, s as shouldTabsVisible, U as UN_HIDEABLE_COLUMNS, h as DEFAULT_PAGE_VALUES, i as DASHBOARD_KIND } from './index-Cl511Juk.js';
16
16
  import { Q as QUERY_KEYS } from './queryConstants-BCx5cEmf.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';
17
23
  import { t } from 'i18next';
24
+ import * as yup from 'yup';
25
+ import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
18
26
  import { isNotPresent, isPresent, removeBy, camelToSnakeCase, isNotEmpty } from '@bigbinary/neeto-cist';
19
27
  import { useHiddenColumns } from '@bigbinary/neeto-molecules/Columns';
20
28
  import TableWrapper from '@bigbinary/neeto-molecules/TableWrapper';
21
29
  import Table from '@bigbinary/neetoui/Table';
22
30
  import NoData from '@bigbinary/neetoui/NoData';
23
- import { useTranslation, Trans } from 'react-i18next';
24
31
  import HelpPopover from '@bigbinary/neeto-molecules/HelpPopover';
25
32
  import Pane from '@bigbinary/neetoui/Pane';
26
- import Typography from '@bigbinary/neetoui/Typography';
27
33
  import Button from '@bigbinary/neetoui/Button';
28
34
  import Tag from '@bigbinary/neetoui/Tag';
29
35
  import Tooltip from '@bigbinary/neetoui/Tooltip';
30
- import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
31
36
  import DateFormat from '@bigbinary/neeto-molecules/DateFormat';
32
37
  import { C as CopyButtonWrapper } from './CopyButtonWrapper-SoJkwX-d.js';
33
38
  import FiltersBar from '@bigbinary/neeto-filters-frontend/Bar';
@@ -36,7 +41,6 @@ import SubHeader from '@bigbinary/neeto-molecules/SubHeader';
36
41
  import Tab from '@bigbinary/neetoui/Tab';
37
42
  import Dropdown from '@bigbinary/neetoui/Dropdown';
38
43
  import '@bigbinary/neeto-icons/Download';
39
- import '@bigbinary/neetoui/Modal';
40
44
  import './exportChannel-CViICC6x.js';
41
45
  import '@bigbinary/neeto-molecules/CopyToClipboardButton';
42
46
 
@@ -112,6 +116,65 @@ var INITIAL_TRANSFER_DETAILS = {
112
116
  id: null,
113
117
  isPaneOpen: false
114
118
  };
119
+ var VALIDATION_SCHEMA = yup.object().shape({
120
+ cancellationReason: yup.string().required(t("neetoPayments.cancelSplitTransfers.cancellationReasonRequired"))
121
+ });
122
+
123
+ var CancelModal = function CancelModal(_ref) {
124
+ var isOpen = _ref.isOpen,
125
+ onClose = _ref.onClose,
126
+ handleSplitTransfersCancellation = _ref.handleSplitTransfersCancellation;
127
+ var _useTranslation = useTranslation(),
128
+ t = _useTranslation.t;
129
+ var handleSubmit = function handleSubmit(_ref2) {
130
+ var cancellationReason = _ref2.cancellationReason;
131
+ handleSplitTransfersCancellation(cancellationReason);
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
+ cancellationReason: ""
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
+ name: "cancellationReason",
158
+ label: t("neetoPayments.cancelSplitTransfers.modal.cancelReason")
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
+ };
115
178
 
116
179
  var Status = function Status(_ref) {
117
180
  var type = _ref.type,
@@ -685,7 +748,7 @@ var Menu = Dropdown.Menu,
685
748
  var TopSection = function TopSection(_ref) {
686
749
  var views = _ref.views,
687
750
  filters = _ref.filters,
688
- handleSplitTransfersCancellation = _ref.handleSplitTransfersCancellation,
751
+ setIsCancelModalOpen = _ref.setIsCancelModalOpen,
689
752
  selectedRows = _ref.selectedRows,
690
753
  setFilters = _ref.setFilters,
691
754
  hasBulkSelectedAllRows = _ref.hasBulkSelectedAllRows,
@@ -742,7 +805,7 @@ var TopSection = function TopSection(_ref) {
742
805
  }, item);
743
806
  })
744
807
  }), /*#__PURE__*/jsx(SubHeader, {
745
- className: "mt-4",
808
+ className: "my-4",
746
809
  leftActionBlock: splitTransfersCountVisible && /*#__PURE__*/jsx("div", {
747
810
  className: "w-100 flex items-center space-x-3",
748
811
  children: isDropdownVisible ? /*#__PURE__*/jsxs(Fragment, {
@@ -767,7 +830,9 @@ var TopSection = function TopSection(_ref) {
767
830
  label: t("neetoPayments.common.takeAction"),
768
831
  children: /*#__PURE__*/jsx(Menu, {
769
832
  children: /*#__PURE__*/jsx(MenuItem.Button, {
770
- onClick: handleSplitTransfersCancellation,
833
+ onClick: function onClick() {
834
+ return setIsCancelModalOpen(true);
835
+ },
771
836
  children: t("neetoPayments.common.cancel")
772
837
  })
773
838
  })
@@ -783,32 +848,30 @@ var TopSection = function TopSection(_ref) {
783
848
  })
784
849
  })
785
850
  }),
786
- rightActionBlock: /*#__PURE__*/jsxs(Fragment, {
787
- children: [/*#__PURE__*/jsx(FiltersBar, {
851
+ rightActionBlock: isFilterButtonVisible && /*#__PURE__*/jsx(SubHeader.RightBlock, {
852
+ columnsButtonProps: {
853
+ columnData: concat(getDefaultColumns(), payableEntityColumns).map(modify("dataIndex", processDataIndex)),
854
+ fixedColumns: UN_HIDEABLE_COLUMNS,
855
+ localStorageKey: COLUMNS_STORAGE_KEY
856
+ },
857
+ downloadButtonProps: {
858
+ onClick: function onClick() {
859
+ return setIsExportModalOpen(true);
860
+ }
861
+ },
862
+ filterProps: {
788
863
  columns: filterableColumns,
864
+ isOpen: isFilterPaneOpen,
789
865
  keyword: searchKeywordProps,
790
- setIsPaneOpen: setIsFilterPaneOpen,
866
+ setIsOpen: setIsFilterPaneOpen,
791
867
  onChange: handleFiltersChange
792
- }), isFilterButtonVisible && /*#__PURE__*/jsx(SubHeader.RightBlock, {
793
- columnsButtonProps: {
794
- columnData: concat(getDefaultColumns(), payableEntityColumns).map(modify("dataIndex", processDataIndex)),
795
- fixedColumns: UN_HIDEABLE_COLUMNS,
796
- localStorageKey: COLUMNS_STORAGE_KEY
797
- },
798
- downloadButtonProps: {
799
- onClick: function onClick() {
800
- return setIsExportModalOpen(true);
801
- }
802
- },
803
- filterProps: {
804
- columns: filterableColumns,
805
- isOpen: isFilterPaneOpen,
806
- keyword: searchKeywordProps,
807
- setIsOpen: setIsFilterPaneOpen,
808
- onChange: handleFiltersChange
809
- }
810
- })]
868
+ }
811
869
  })
870
+ }), /*#__PURE__*/jsx(FiltersBar, {
871
+ columns: filterableColumns,
872
+ keyword: searchKeywordProps,
873
+ setIsPaneOpen: setIsFilterPaneOpen,
874
+ onChange: handleFiltersChange
812
875
  })]
813
876
  });
814
877
  };
@@ -837,20 +900,24 @@ var SplitTransfersDashboard = function SplitTransfersDashboard(_ref) {
837
900
  setIsExportModalOpen = _useState6[1];
838
901
  var _useState7 = useState(false),
839
902
  _useState8 = _slicedToArray(_useState7, 2),
840
- hasBulkSelectedAllRows = _useState8[0],
841
- setHasBulkSelectedAllRows = _useState8[1];
842
- var _useState9 = useState(DEFAULT_SORT_PROPERTIES),
903
+ isCancelModalOpen = _useState8[0],
904
+ setIsCancelModalOpen = _useState8[1];
905
+ var _useState9 = useState(false),
843
906
  _useState10 = _slicedToArray(_useState9, 2),
844
- sortProperties = _useState10[0],
845
- setSortProperties = _useState10[1];
846
- var _useState11 = useState(DEFAULT_PAGE_VALUES),
907
+ hasBulkSelectedAllRows = _useState10[0],
908
+ setHasBulkSelectedAllRows = _useState10[1];
909
+ var _useState11 = useState(DEFAULT_SORT_PROPERTIES),
847
910
  _useState12 = _slicedToArray(_useState11, 2),
848
- pageProperties = _useState12[0],
849
- setPageProperties = _useState12[1];
850
- var _useState13 = useState(buildFiltersFromURL([].concat(_toConsumableArray(filterableColumns), [searchKeywordProps]))),
911
+ sortProperties = _useState12[0],
912
+ setSortProperties = _useState12[1];
913
+ var _useState13 = useState(DEFAULT_PAGE_VALUES),
851
914
  _useState14 = _slicedToArray(_useState13, 2),
852
- filters = _useState14[0],
853
- setFilters = _useState14[1];
915
+ pageProperties = _useState14[0],
916
+ setPageProperties = _useState14[1];
917
+ var _useState15 = useState(buildFiltersFromURL([].concat(_toConsumableArray(filterableColumns), [searchKeywordProps]))),
918
+ _useState16 = _slicedToArray(_useState15, 2),
919
+ filters = _useState16[0],
920
+ setFilters = _useState16[1];
854
921
  var history = useHistory();
855
922
  var _getQueryParams2 = getQueryParams(),
856
923
  _getQueryParams2$tab = _getQueryParams2.tab,
@@ -874,12 +941,14 @@ var SplitTransfersDashboard = function SplitTransfersDashboard(_ref) {
874
941
  }),
875
942
  cancelSplitTransfers = _useBulkCancellationS.mutate,
876
943
  isCancelling = _useBulkCancellationS.isPending;
877
- var handleSplitTransfersCancellation = function handleSplitTransfersCancellation() {
944
+ var handleSplitTransfersCancellation = function handleSplitTransfersCancellation(cancellationReason) {
878
945
  var ids = pluck("id", selectedRowData);
879
946
  cancelSplitTransfers({
880
947
  ids: ids,
948
+ cancellationReason: cancellationReason,
881
949
  isApplyChangesToAllRequired: hasBulkSelectedAllRows
882
950
  });
951
+ setIsCancelModalOpen(false);
883
952
  };
884
953
  var handleTablePagination = function handleTablePagination(page, pageSize) {
885
954
  var queryParams = getQueryParams({
@@ -912,13 +981,13 @@ var SplitTransfersDashboard = function SplitTransfersDashboard(_ref) {
912
981
  children: [/*#__PURE__*/jsx(TopSection, {
913
982
  filterableColumns: filterableColumns,
914
983
  filters: filters,
915
- handleSplitTransfersCancellation: handleSplitTransfersCancellation,
916
984
  hasBulkSelectedAllRows: hasBulkSelectedAllRows,
917
985
  pageProperties: pageProperties,
918
986
  payableEntityColumns: payableEntityColumns,
919
987
  searchKeywordProps: searchKeywordProps,
920
988
  selectedRows: selectedRows,
921
989
  setFilters: setFilters,
990
+ setIsCancelModalOpen: setIsCancelModalOpen,
922
991
  setIsExportModalOpen: setIsExportModalOpen,
923
992
  setPageProperties: setPageProperties,
924
993
  setSortProperties: setSortProperties,
@@ -941,6 +1010,12 @@ var SplitTransfersDashboard = function SplitTransfersDashboard(_ref) {
941
1010
  setIsExportModalOpen: setIsExportModalOpen,
942
1011
  sortProperties: sortProperties,
943
1012
  dashboardKind: DASHBOARD_KIND.splitTransfers
1013
+ }), /*#__PURE__*/jsx(CancelModal, {
1014
+ handleSplitTransfersCancellation: handleSplitTransfersCancellation,
1015
+ isOpen: isCancelModalOpen,
1016
+ onClose: function onClose() {
1017
+ return setIsCancelModalOpen(false);
1018
+ }
944
1019
  })]
945
1020
  });
946
1021
  };