mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-19 06:10:31 +00:00
fix: import resource imporements
This commit is contained in:
26
packages/webapp/src/containers/Vendors/VendorsImport.tsx
Normal file
26
packages/webapp/src/containers/Vendors/VendorsImport.tsx
Normal file
@@ -0,0 +1,26 @@
|
||||
// @ts-nocheck
|
||||
import { useHistory } from 'react-router-dom';
|
||||
import { DashboardInsider } from '@/components';
|
||||
import { ImportView } from '../Import/ImportView';
|
||||
|
||||
export default function VendorsImport() {
|
||||
const history = useHistory();
|
||||
|
||||
const handleImportSuccess = () => {
|
||||
history.push('/vendors');
|
||||
};
|
||||
const handleImportBtnClick = () => {
|
||||
history.push('/vendors');
|
||||
};
|
||||
|
||||
return (
|
||||
<DashboardInsider name={'import-vendors'}>
|
||||
<ImportView
|
||||
resource={'vendors'}
|
||||
onImportSuccess={handleImportSuccess}
|
||||
onCancelClick={handleImportBtnClick}
|
||||
exampleTitle='Vendors Example'
|
||||
/>
|
||||
</DashboardInsider>
|
||||
);
|
||||
}
|
||||
@@ -83,6 +83,10 @@ function VendorActionsBar({
|
||||
const handleTableRowSizeChange = (size) => {
|
||||
addSetting('vendors', 'tableSize', size);
|
||||
};
|
||||
// Handle import button success.
|
||||
const handleImportBtnSuccess = () => {
|
||||
history.push('/vendors/import');
|
||||
};
|
||||
return (
|
||||
<DashboardActionsBar>
|
||||
<NavbarGroup>
|
||||
@@ -128,6 +132,7 @@ function VendorActionsBar({
|
||||
className={Classes.MINIMAL}
|
||||
icon={<Icon icon="file-import-16" iconSize={16} />}
|
||||
text={<T id={'import'} />}
|
||||
onClick={handleImportBtnSuccess}
|
||||
/>
|
||||
<Button
|
||||
className={Classes.MINIMAL}
|
||||
|
||||
Reference in New Issue
Block a user