From 6fb02f9869b1a54f2de462b208b13549864cc2b6 Mon Sep 17 00:00:00 2001 From: Ahmed Bouhuolia Date: Thu, 18 Jul 2024 19:41:23 +0200 Subject: [PATCH] feat: bulk categorize and match bank transactions --- .../AccountTransactionsActionsBar.tsx | 27 +++- ...TransactionsUncategorizedTable.module.scss | 15 ++ .../AccountTransactionsUncategorizedTable.tsx | 23 ++- .../AccountUncategorizedTransactionsAll.tsx | 2 +- .../UncategorizedTransactions/hooks.tsx | 143 ++++++++++++++++++ .../AccountTransactions/components.tsx | 124 --------------- .../src/containers/CashFlow/withBanking.ts | 1 + .../containers/CashFlow/withBankingActions.ts | 6 + packages/webapp/src/hooks/state/banking.ts | 12 ++ .../src/store/banking/banking.reducer.ts | 17 +++ .../style/components/DataTable/DataTable.scss | 2 +- 11 files changed, 238 insertions(+), 134 deletions(-) create mode 100644 packages/webapp/src/containers/CashFlow/AccountTransactions/UncategorizedTransactions/AccountTransactionsUncategorizedTable.module.scss rename packages/webapp/src/containers/CashFlow/AccountTransactions/{ => UncategorizedTransactions}/AccountTransactionsUncategorizedTable.tsx (85%) create mode 100644 packages/webapp/src/containers/CashFlow/AccountTransactions/UncategorizedTransactions/hooks.tsx diff --git a/packages/webapp/src/containers/CashFlow/AccountTransactions/AccountTransactionsActionsBar.tsx b/packages/webapp/src/containers/CashFlow/AccountTransactions/AccountTransactionsActionsBar.tsx index 7ca9abc37..d94b67544 100644 --- a/packages/webapp/src/containers/CashFlow/AccountTransactions/AccountTransactionsActionsBar.tsx +++ b/packages/webapp/src/containers/CashFlow/AccountTransactions/AccountTransactionsActionsBar.tsx @@ -12,6 +12,8 @@ import { PopoverInteractionKind, Position, Intent, + Switch, + Tooltip, } from '@blueprintjs/core'; import { useHistory } from 'react-router-dom'; import { @@ -39,9 +41,9 @@ import { withBanking } from '../withBanking'; import { isEmpty } from 'lodash'; import { useExcludeUncategorizedTransactions, - useUnexcludeUncategorizedTransaction, useUnexcludeUncategorizedTransactions, } from '@/hooks/query/bank-rules'; +import { withBankingActions } from '../withBankingActions'; function AccountTransactionsActionsBar({ // #withDialogActions @@ -56,6 +58,9 @@ function AccountTransactionsActionsBar({ // #withBanking uncategorizedTransationsIdsSelected, excludedTransactionsIdsSelected, + + // #withBankingActions + enableMultipleCategorization, }) { const history = useHistory(); const { accountId } = useAccountTransactionsContext(); @@ -148,6 +153,10 @@ function AccountTransactionsActionsBar({ }); }; + const handleMultipleCategorizingSwitch = (event) => { + enableMultipleCategorization(event.currentTarget.checked); + }; + return ( @@ -201,7 +210,6 @@ function AccountTransactionsActionsBar({ disable={isExcludingLoading} /> )} - {!isEmpty(excludedTransactionsIdsSelected) && (