Skip to content

Commit 3620a60

Browse files
authored
fix(persons): restore csv import function deleted from UI
1 parent 5bc38e6 commit 3620a60

File tree

3 files changed

+22
-146
lines changed

3 files changed

+22
-146
lines changed

src/features/persons/export_persons/index.tsx

Lines changed: 0 additions & 22 deletions
This file was deleted.

src/features/persons/export_persons/useExportPersons.tsx

Lines changed: 0 additions & 121 deletions
This file was deleted.

src/pages/persons/all_persons/index.tsx

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import { Box, Slide } from '@mui/material';
22
import { Button, PageTitle } from '@components/index';
33
import {
44
IconAddPerson,
5+
IconImportExport,
56
IconPanelClose,
67
IconPanelOpen,
78
} from '@components/icons';
@@ -11,11 +12,12 @@ import {
1112
useCurrentUser,
1213
} from '@hooks/index';
1314
import useAllPersons from './useAllPersons';
14-
import ExportPersons from '@features/persons/export_persons';
15+
1516
import PersonsList from '@features/persons/list';
1617
import PersonsFilter from '@features/persons/filter';
1718
import PersonsSearch from '@features/persons/search';
1819
import NavBarButton from '@components/nav_bar_button';
20+
import ImportExport from '@features/persons/import_export';
1921

2022
const PersonsAll = () => {
2123
const { t } = useAppTranslation();
@@ -24,7 +26,14 @@ const PersonsAll = () => {
2426

2527
const { isPersonEditor } = useCurrentUser();
2628

27-
const { handlePersonAdd, isPanelOpen, setIsPanelOpen } = useAllPersons();
29+
const {
30+
handlePersonAdd,
31+
isPanelOpen,
32+
setIsPanelOpen,
33+
handleOpenExchange,
34+
isDataExchangeOpen,
35+
handleCloseExchange,
36+
} = useAllPersons();
2837

2938
return (
3039
<Box
@@ -40,7 +49,12 @@ const PersonsAll = () => {
4049
buttons={
4150
isPersonEditor && (
4251
<>
43-
<ExportPersons />
52+
<NavBarButton
53+
text={t('tr_importExport')}
54+
main={false}
55+
icon={<IconImportExport />}
56+
onClick={handleOpenExchange}
57+
></NavBarButton>
4458
<NavBarButton
4559
text={t('tr_btnAdd')}
4660
main
@@ -52,6 +66,11 @@ const PersonsAll = () => {
5266
}
5367
/>
5468

69+
<ImportExport
70+
key={isDataExchangeOpen ? 'open' : 'closed'}
71+
open={isDataExchangeOpen}
72+
onClose={handleCloseExchange}
73+
/>
5574
<Box
5675
sx={{
5776
display: 'flex',

0 commit comments

Comments
 (0)