feat: linking relation with id in importing

This commit is contained in:
Ahmed Bouhuolia
2024-04-01 01:13:31 +02:00
parent 22a016b56e
commit 74da28b464
21 changed files with 394 additions and 84 deletions

View File

@@ -94,6 +94,10 @@ function ItemsActionsBar({
const handleTableRowSizeChange = (size) => {
addSetting('items', 'tableSize', size);
};
// Handles the import button click.
const handleImportBtnClick = () => {
history.push('/items/import');
};
return (
<DashboardActionsBar>
@@ -143,6 +147,7 @@ function ItemsActionsBar({
<Button
className={Classes.MINIMAL}
icon={<Icon icon="file-import-16" iconSize={16} />}
onClick={handleImportBtnClick}
text={<T id={'import'} />}
/>
<Button

View File

@@ -0,0 +1,25 @@
// @ts-nocheck
import { DashboardInsider } from '@/components';
import { ImportView } from '../Import/ImportView';
import { useHistory } from 'react-router-dom';
export default function ItemsImportpage() {
const history = useHistory();
const handleImportSuccess = () => {
history.push('/items');
};
const handleCancelBtnClick = () => {
history.push('/items');
};
return (
<DashboardInsider name={'import-items'}>
<ImportView
resource={'items'}
onImportSuccess={handleImportSuccess}
onCancelClick={handleCancelBtnClick}
exampleTitle="Items Example"
/>
</DashboardInsider>
);
}