mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-18 22:00:31 +00:00
feat: Uncategorize bank transactions in bulk
This commit is contained in:
@@ -64,6 +64,7 @@ function AccountTransactionsActionsBar({
|
||||
uncategorizedTransationsIdsSelected,
|
||||
excludedTransactionsIdsSelected,
|
||||
openMatchingTransactionAside,
|
||||
categorizedTransactionsSelected,
|
||||
|
||||
// #withBankingActions
|
||||
enableMultipleCategorization,
|
||||
@@ -194,7 +195,7 @@ function AccountTransactionsActionsBar({
|
||||
// Handle multi select transactions for categorization or matching.
|
||||
const handleMultipleCategorizingSwitch = (event) => {
|
||||
enableMultipleCategorization(event.currentTarget.checked);
|
||||
}
|
||||
};
|
||||
// Handle resume bank feeds syncing.
|
||||
const handleResumeFeedsSyncing = () => {
|
||||
openAlert('resume-feeds-syncing-bank-accounnt', {
|
||||
@@ -208,6 +209,9 @@ function AccountTransactionsActionsBar({
|
||||
});
|
||||
};
|
||||
|
||||
// Handles uncategorize the categorized transactions in bulk.
|
||||
const handleUncategorizeCategorizedBulkBtnClick = () => {};
|
||||
|
||||
return (
|
||||
<DashboardActionsBar>
|
||||
<NavbarGroup>
|
||||
@@ -297,6 +301,14 @@ function AccountTransactionsActionsBar({
|
||||
disabled={isUnexcludingLoading}
|
||||
/>
|
||||
)}
|
||||
{!isEmpty(categorizedTransactionsSelected) && (
|
||||
<Button
|
||||
text={'Uncategorize'}
|
||||
onClick={handleUncategorizeCategorizedBulkBtnClick}
|
||||
intent={Intent.DANGER}
|
||||
minimal
|
||||
/>
|
||||
)}
|
||||
</NavbarGroup>
|
||||
|
||||
<NavbarGroup align={Alignment.RIGHT}>
|
||||
@@ -379,10 +391,12 @@ export default compose(
|
||||
uncategorizedTransationsIdsSelected,
|
||||
excludedTransactionsIdsSelected,
|
||||
openMatchingTransactionAside,
|
||||
categorizedTransactionsSelected,
|
||||
}) => ({
|
||||
uncategorizedTransationsIdsSelected,
|
||||
excludedTransactionsIdsSelected,
|
||||
openMatchingTransactionAside,
|
||||
categorizedTransactionsSelected,
|
||||
}),
|
||||
),
|
||||
withBankingActions,
|
||||
|
||||
@@ -22,10 +22,11 @@ import { useMemorizedColumnsWidths } from '@/hooks';
|
||||
import { useAccountTransactionsColumns, ActionsMenu } from './components';
|
||||
import { useAccountTransactionsAllContext } from './AccountTransactionsAllBoot';
|
||||
import { useUnmatchMatchedUncategorizedTransaction } from '@/hooks/query/bank-rules';
|
||||
import { useUncategorizeTransaction } from '@/hooks/query';
|
||||
import { handleCashFlowTransactionType } from './utils';
|
||||
|
||||
import { compose } from '@/utils';
|
||||
import { useUncategorizeTransaction } from '@/hooks/query';
|
||||
import { withBankingActions } from '../withBankingActions';
|
||||
|
||||
/**
|
||||
* Account transactions data table.
|
||||
@@ -39,6 +40,9 @@ function AccountTransactionsDataTable({
|
||||
|
||||
// #withDrawerActions
|
||||
openDrawer,
|
||||
|
||||
// #withBankingActions
|
||||
setCategorizedTransactionsSelected,
|
||||
}) {
|
||||
// Retrieve table columns.
|
||||
const columns = useAccountTransactionsColumns();
|
||||
@@ -97,6 +101,14 @@ function AccountTransactionsDataTable({
|
||||
});
|
||||
};
|
||||
|
||||
// Handle selected rows change.
|
||||
const handleSelectedRowsChange = (selected) => {
|
||||
const selectedIds = selected?.map(
|
||||
(row) => row.original.uncategorized_transaction_id,
|
||||
);
|
||||
setCategorizedTransactionsSelected(selectedIds);
|
||||
};
|
||||
|
||||
return (
|
||||
<CashflowTransactionsTable
|
||||
noInitialFetch={true}
|
||||
@@ -119,6 +131,8 @@ function AccountTransactionsDataTable({
|
||||
vListOverscanRowCount={0}
|
||||
initialColumnsWidths={initialColumnsWidths}
|
||||
onColumnResizing={handleColumnResizing}
|
||||
selectionColumn={true}
|
||||
onSelectedRowsChange={handleSelectedRowsChange}
|
||||
noResults={<T id={'cash_flow.account_transactions.no_results'} />}
|
||||
className="table-constrant"
|
||||
payload={{
|
||||
@@ -136,6 +150,7 @@ export default compose(
|
||||
})),
|
||||
withAlertsActions,
|
||||
withDrawerActions,
|
||||
withBankingActions,
|
||||
)(AccountTransactionsDataTable);
|
||||
|
||||
const DashboardConstrantTable = styled(DataTable)`
|
||||
|
||||
Reference in New Issue
Block a user