fix: import resource imporements

This commit is contained in:
Ahmed Bouhuolia
2024-03-27 04:01:01 +02:00
parent 973d1832bd
commit ad4e51d81d
59 changed files with 1508 additions and 211 deletions

View 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>
);
}

View File

@@ -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}