feat: configuring import services on more resources

This commit is contained in:
Ahmed Bouhuolia
2024-04-06 04:06:15 +02:00
parent dd9098bdc1
commit bbafdcd8bd
24 changed files with 805 additions and 106 deletions

View File

@@ -75,6 +75,11 @@ function VendorsCreditNoteActionsBar({
addSetting('vendorCredit', 'tableSize', size);
};
// Handle import button click.
const handleImportBtnClick = () => {
history.push('/vendor-credits/import')
}
return (
<DashboardActionsBar>
<NavbarGroup>
@@ -117,6 +122,7 @@ function VendorsCreditNoteActionsBar({
className={Classes.MINIMAL}
icon={<Icon icon={'file-import-16'} />}
text={<T id={'import'} />}
onClick={handleImportBtnClick}
/>
<Button
className={Classes.MINIMAL}

View File

@@ -0,0 +1,25 @@
// @ts-nocheck
import { DashboardInsider } from '@/components';
import { ImportView } from '@/containers/Import';
import { useHistory } from 'react-router-dom';
export default function VendorCreditsImport() {
const history = useHistory();
const handleCancelBtnClick = () => {
history.push('/vendor-credits');
};
const handleImportSuccess = () => {
history.push('/vendor-credits');
};
return (
<DashboardInsider name={'import-vendor-credit'}>
<ImportView
resource={'vendor_credit'}
onCancelClick={handleCancelBtnClick}
onImportSuccess={handleImportSuccess}
/>
</DashboardInsider>
);
}