mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-21 23:30:32 +00:00
feat: more resources support importing
This commit is contained in:
25
packages/webapp/src/containers/Expenses/ExpensesImport.tsx
Normal file
25
packages/webapp/src/containers/Expenses/ExpensesImport.tsx
Normal file
@@ -0,0 +1,25 @@
|
||||
// @ts-nocheck
|
||||
import { useHistory } from 'react-router-dom';
|
||||
import { DashboardInsider } from '@/components';
|
||||
import { ImportView } from '../Import/ImportView';
|
||||
|
||||
export default function ExpensesImport() {
|
||||
const history = useHistory();
|
||||
|
||||
const handleCancelBtnClick = () => {
|
||||
history.push('/expenses');
|
||||
};
|
||||
const handleImportSuccess = () => {
|
||||
history.push('/expenses');
|
||||
};
|
||||
|
||||
return (
|
||||
<DashboardInsider name={'import-expenses'}>
|
||||
<ImportView
|
||||
resource={'expenses'}
|
||||
onCancelClick={handleCancelBtnClick}
|
||||
onImportSuccess={handleImportSuccess}
|
||||
/>
|
||||
</DashboardInsider>
|
||||
);
|
||||
}
|
||||
@@ -79,6 +79,11 @@ function ExpensesActionsBar({
|
||||
refresh();
|
||||
};
|
||||
|
||||
// Handle the import button click.
|
||||
const handleImportBtnClick = () => {
|
||||
history.push('/expenses/import');
|
||||
}
|
||||
|
||||
// Handle table row size change.
|
||||
const handleTableRowSizeChange = (size) => {
|
||||
addSetting('expenses', 'tableSize', size);
|
||||
@@ -135,6 +140,7 @@ function ExpensesActionsBar({
|
||||
className={Classes.MINIMAL}
|
||||
icon={<Icon icon="file-import-16" iconSize={16} />}
|
||||
text={<T id={'import'} />}
|
||||
onClick={handleImportBtnClick}
|
||||
/>
|
||||
<Button
|
||||
className={Classes.MINIMAL}
|
||||
|
||||
Reference in New Issue
Block a user