feat: more resources support importing

This commit is contained in:
Ahmed Bouhuolia
2024-04-05 02:00:12 +02:00
parent 3851d34ba4
commit dd9098bdc1
46 changed files with 1510 additions and 149 deletions

View File

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

View File

@@ -77,6 +77,11 @@ function EstimateActionsBar({
addSetting('salesEstimates', 'tableSize', size);
};
// Handle the import button click.
const handleImportBtnClick = () => {
history.push('/estimates/import');
}
return (
<DashboardActionsBar>
<NavbarGroup>
@@ -130,6 +135,7 @@ function EstimateActionsBar({
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 { useHistory } from 'react-router-dom';
import { DashboardInsider } from '@/components';
import { ImportView } from '@/containers/Import';
export default function InvoicesImport() {
const history = useHistory();
const handleCancelBtnClick = () => {
history.push('/invoices');
};
const handleImportSuccess = () => {
history.push('/invoices');
};
return (
<DashboardInsider name={'import-invoices'}>
<ImportView
resource={'sale_invoice'}
onCancelClick={handleCancelBtnClick}
onImportSuccess={handleImportSuccess}
/>
</DashboardInsider>
);
}

View File

@@ -74,6 +74,11 @@ function InvoiceActionsBar({
addSetting('salesInvoices', 'tableSize', size);
};
// Handle the import button click.
const handleImportBtnClick = () => {
history.push('/invoices/import');
};
return (
<DashboardActionsBar>
<NavbarGroup>
@@ -124,6 +129,7 @@ function InvoiceActionsBar({
className={Classes.MINIMAL}
icon={<Icon icon={'file-import-16'} />}
text={<T id={'import'} />}
onClick={handleImportBtnClick}
/>
<Button
className={Classes.MINIMAL}