mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-18 05:40:31 +00:00
fix: import resource imporements
This commit is contained in:
@@ -7,6 +7,7 @@ import {
|
||||
NavbarDivider,
|
||||
Alignment,
|
||||
} from '@blueprintjs/core';
|
||||
import { useHistory } from 'react-router-dom';
|
||||
import {
|
||||
Icon,
|
||||
DashboardActionsBar,
|
||||
@@ -48,6 +49,8 @@ function AccountTransactionsActionsBar({
|
||||
const addMoneyInOptions = useMemo(() => getAddMoneyInOptions(), []);
|
||||
const addMoneyOutOptions = useMemo(() => getAddMoneyOutOptions(), []);
|
||||
|
||||
const history = useHistory();
|
||||
|
||||
// Handle money in form
|
||||
const handleMoneyInFormTransaction = (account) => {
|
||||
openDialog('money-in', {
|
||||
@@ -64,6 +67,11 @@ function AccountTransactionsActionsBar({
|
||||
account_name: account.name,
|
||||
});
|
||||
};
|
||||
// Handle import button click.
|
||||
const handleImportBtnClick = () => {
|
||||
history.push(`/cashflow-accounts/${accountId}/import`);
|
||||
};
|
||||
|
||||
// Refresh cashflow infinity transactions hook.
|
||||
const { refresh } = useRefreshCashflowTransactionsInfinity();
|
||||
|
||||
@@ -106,6 +114,7 @@ function AccountTransactionsActionsBar({
|
||||
className={Classes.MINIMAL}
|
||||
icon={<Icon icon="file-import-16" iconSize={16} />}
|
||||
text={<T id={'import'} />}
|
||||
onClick={handleImportBtnClick}
|
||||
/>
|
||||
<NavbarDivider />
|
||||
<DashboardRowsHeightButton
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
// @ts-nocheck
|
||||
import { DashboardInsider } from '@/components';
|
||||
import { ImportView } from '@/containers/Import/ImportView';
|
||||
import { useHistory, useParams } from 'react-router-dom';
|
||||
|
||||
export default function ImportUncategorizedTransactions() {
|
||||
const history = useHistory();
|
||||
const params = useParams();
|
||||
|
||||
const handleImportSuccess = () => {
|
||||
history.push(
|
||||
`/cashflow-accounts/${params.id}/transactions?filter=uncategorized`,
|
||||
);
|
||||
};
|
||||
const handleCnacelBtnClick = () => {
|
||||
history.push(
|
||||
`/cashflow-accounts/${params.id}/transactions?filter=uncategorized`,
|
||||
);
|
||||
};
|
||||
|
||||
return (
|
||||
<DashboardInsider name={'import-uncategorized-bank-transactions'}>
|
||||
<ImportView
|
||||
resource={'uncategorized_cashflow_transaction'}
|
||||
params={{ accountId: params.id }}
|
||||
onImportSuccess={handleImportSuccess}
|
||||
onCancelClick={handleCnacelBtnClick}
|
||||
sampleFileName={'sample_bank_transactions'}
|
||||
/>
|
||||
</DashboardInsider>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user