mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-17 13:20:31 +00:00
feat: wip bank transaction matching
This commit is contained in:
@@ -3,7 +3,6 @@ import { Button, Classes, NavbarGroup } from '@blueprintjs/core';
|
||||
import * as R from 'ramda';
|
||||
import { Can, DashboardActionsBar, Icon } from '@/components';
|
||||
import { AbilitySubject, BankRuleAction } from '@/constants/abilityOption';
|
||||
import withAlertActions from '@/containers/Alert/withAlertActions';
|
||||
import withDialogActions from '@/containers/Dialog/withDialogActions';
|
||||
import { DialogsName } from '@/constants/dialogs';
|
||||
|
||||
@@ -31,7 +30,6 @@ function RulesListActionsBarRoot({
|
||||
);
|
||||
}
|
||||
|
||||
export const RulesListActionsBar = R.compose(
|
||||
withDialogActions,
|
||||
withAlertActions,
|
||||
)(RulesListActionsBarRoot);
|
||||
export const RulesListActionsBar = R.compose(withDialogActions)(
|
||||
RulesListActionsBarRoot,
|
||||
);
|
||||
|
||||
@@ -8,9 +8,7 @@ import {
|
||||
} from '@/components';
|
||||
|
||||
import withAlertsActions from '@/containers/Alert/withAlertActions';
|
||||
import withDrawerActions from '@/containers/Drawer/withDrawerActions';
|
||||
import withDialogActions from '@/containers/Dialog/withDialogActions';
|
||||
import withDashboardActions from '@/containers/Dashboard/withDashboardActions';
|
||||
|
||||
import { useBankRulesTableColumns } from './hooks';
|
||||
import { BankRulesTableActionsMenu } from './_components';
|
||||
@@ -25,9 +23,6 @@ function RulesTable({
|
||||
// #withAlertsActions
|
||||
openAlert,
|
||||
|
||||
// #withDrawerActions
|
||||
openDrawer,
|
||||
|
||||
// #withDialogAction
|
||||
openDialog,
|
||||
}) {
|
||||
@@ -81,8 +76,6 @@ function RulesTable({
|
||||
}
|
||||
|
||||
export const BankRulesTable = R.compose(
|
||||
withDashboardActions,
|
||||
withAlertsActions,
|
||||
withDrawerActions,
|
||||
withDialogActions,
|
||||
)(RulesTable);
|
||||
|
||||
@@ -15,7 +15,7 @@ import {
|
||||
import { AccountTransactionsDetailsBar } from './AccountTransactionsDetailsBar';
|
||||
import { AccountTransactionsProgressBar } from './components';
|
||||
import { AccountTransactionsFilterTabs } from './AccountTransactionsFilterTabs';
|
||||
import { AppShell } from '@/components/AppShell/AppShell';
|
||||
import { AppContentShell } from '@/components/AppShell';
|
||||
import { CategorizeTransactionAside } from '../CategorizeTransactionAside/CategorizeTransactionAside';
|
||||
import { withBanking } from '../withBanking';
|
||||
|
||||
@@ -28,8 +28,8 @@ function AccountTransactionsListRoot({
|
||||
}) {
|
||||
return (
|
||||
<AccountTransactionsProvider>
|
||||
<AppShell hideAside={!openMatchingTransactionAside}>
|
||||
<AppShell.Main>
|
||||
<AppContentShell hideAside={!openMatchingTransactionAside}>
|
||||
<AppContentShell.Main>
|
||||
<AccountTransactionsActionsBar />
|
||||
<AccountTransactionsDetailsBar />
|
||||
<AccountTransactionsProgressBar />
|
||||
@@ -41,12 +41,12 @@ function AccountTransactionsListRoot({
|
||||
<AccountTransactionsContent />
|
||||
</Suspense>
|
||||
</DashboardPageContent>
|
||||
</AppShell.Main>
|
||||
</AppContentShell.Main>
|
||||
|
||||
<AppShell.Aside>
|
||||
<AppContentShell.Aside>
|
||||
<CategorizeTransactionAside />
|
||||
</AppShell.Aside>
|
||||
</AppShell>
|
||||
</AppContentShell.Aside>
|
||||
</AppContentShell>
|
||||
</AccountTransactionsProvider>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// @ts-nocheck
|
||||
import React from 'react';
|
||||
import styled from 'styled-components';
|
||||
|
||||
import { Intent } from '@blueprintjs/core';
|
||||
import {
|
||||
DataTable,
|
||||
TableFastCell,
|
||||
@@ -14,7 +14,6 @@ import {
|
||||
import { TABLES } from '@/constants/tables';
|
||||
|
||||
import withSettings from '@/containers/Settings/withSettings';
|
||||
import withDrawerActions from '@/containers/Drawer/withDrawerActions';
|
||||
import { withBankingActions } from '../withBankingActions';
|
||||
|
||||
import { useMemorizedColumnsWidths } from '@/hooks';
|
||||
@@ -26,7 +25,6 @@ import { useAccountUncategorizedTransactionsContext } from './AllTransactionsUnc
|
||||
|
||||
import { compose } from '@/utils';
|
||||
import { useExcludeUncategorizedTransaction } from '@/hooks/query/bank-rules';
|
||||
import { Intent } from '@blueprintjs/core';
|
||||
|
||||
/**
|
||||
* Account transactions data table.
|
||||
@@ -37,9 +35,6 @@ function AccountTransactionsDataTable({
|
||||
|
||||
// #withBankingActions
|
||||
setUncategorizedTransactionIdForMatching,
|
||||
|
||||
// #withDrawerActions
|
||||
openDrawer,
|
||||
}) {
|
||||
// Retrieve table columns.
|
||||
const columns = useAccountUncategorizedTransactionsColumns();
|
||||
@@ -102,7 +97,9 @@ function AccountTransactionsDataTable({
|
||||
vListOverscanRowCount={0}
|
||||
initialColumnsWidths={initialColumnsWidths}
|
||||
onColumnResizing={handleColumnResizing}
|
||||
noResults={'There is no uncategorized transactions in the current account.'}
|
||||
noResults={
|
||||
'There is no uncategorized transactions in the current account.'
|
||||
}
|
||||
className="table-constrant"
|
||||
payload={{
|
||||
onExclude: handleExcludeTransaction,
|
||||
@@ -116,7 +113,6 @@ export default compose(
|
||||
withSettings(({ cashflowTransactionsSettings }) => ({
|
||||
cashflowTansactionsTableSize: cashflowTransactionsSettings?.tableSize,
|
||||
})),
|
||||
withDrawerActions,
|
||||
withBankingActions,
|
||||
)(AccountTransactionsDataTable);
|
||||
|
||||
|
||||
@@ -1,37 +0,0 @@
|
||||
import React from 'react';
|
||||
|
||||
interface UncategorizedTransactionsFilterValue {}
|
||||
|
||||
const UncategorizedTransactionsFilterContext =
|
||||
React.createContext<UncategorizedTransactionsFilterValue>(
|
||||
{} as UncategorizedTransactionsFilterValue,
|
||||
);
|
||||
|
||||
interface UncategorizedTransactionsFilterProviderProps {
|
||||
children: React.ReactNode;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
function UncategorizedTransactionsFilterProvider({
|
||||
...props
|
||||
}: UncategorizedTransactionsFilterProviderProps) {
|
||||
// Provider payload.
|
||||
const provider = {};
|
||||
|
||||
return (
|
||||
<UncategorizedTransactionsFilterContext.Provider
|
||||
value={provider}
|
||||
{...props}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
const useUncategorizedTransactionsFilter = () =>
|
||||
React.useContext(UncategorizedTransactionsFilterContext);
|
||||
|
||||
export {
|
||||
UncategorizedTransactionsFilterProvider,
|
||||
useUncategorizedTransactionsFilter,
|
||||
};
|
||||
@@ -6,7 +6,6 @@ import * as R from 'ramda';
|
||||
import '@/style/pages/CashFlow/AccountTransactions/List.scss';
|
||||
|
||||
import { AccountTransactionsUncategorizeFilter } from './AccountTransactionsUncategorizeFilter';
|
||||
import { UncategorizedTransactionsFilterProvider } from './AccountUncategorizedTransactionsFilterProvider';
|
||||
import {
|
||||
WithBankingActionsProps,
|
||||
withBankingActions,
|
||||
@@ -23,6 +22,7 @@ function AllTransactionsUncategorizedRoot({
|
||||
// #withBankingActions
|
||||
closeMatchingTransactionAside,
|
||||
}: AllTransactionsUncategorizedProps) {
|
||||
// Close the match aside once leaving the page.
|
||||
useEffect(
|
||||
() => () => {
|
||||
closeMatchingTransactionAside();
|
||||
@@ -31,12 +31,10 @@ function AllTransactionsUncategorizedRoot({
|
||||
);
|
||||
|
||||
return (
|
||||
<UncategorizedTransactionsFilterProvider>
|
||||
<Box>
|
||||
<AccountTransactionsUncategorizeFilter />
|
||||
<AccountTransactionsSwitcher />
|
||||
</Box>
|
||||
</UncategorizedTransactionsFilterProvider>
|
||||
<Box>
|
||||
<AccountTransactionsUncategorizeFilter />
|
||||
<AccountTransactionsSwitcher />
|
||||
</Box>
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -14,7 +14,6 @@ import {
|
||||
} from '@/components';
|
||||
import { TABLES } from '@/constants/tables';
|
||||
|
||||
import withSettings from '@/containers/Settings/withSettings';
|
||||
import withAlertsActions from '@/containers/Alert/withAlertActions';
|
||||
import withDrawerActions from '@/containers/Drawer/withDrawerActions';
|
||||
|
||||
|
||||
Reference in New Issue
Block a user