diff --git a/dashboard/src/components/DocumentsOrganizer.tsx b/dashboard/src/components/DocumentsOrganizer.tsx index 561be4bcc..9304f8cab 100644 --- a/dashboard/src/components/DocumentsOrganizer.tsx +++ b/dashboard/src/components/DocumentsOrganizer.tsx @@ -99,6 +99,8 @@ export default function DocumentsOrganizer({ if (!items.length) return null; + console.log({ documentsTree }); + return (
@@ -346,8 +348,8 @@ function DocumentRow({ document, level, parentIsOpen, position, parentId, color, } function Informations({ item }: { item: Item | FolderForTree | RootForTree }) { - if (item.type === 'folder' && ['Dossier Racine', '👪 Documents familiaux'].includes(item.name)) { - return null; + if (item.type === 'folder') { + if (['root', 'treatment', 'consultation'].includes(item._id)) return null; } return (
diff --git a/dashboard/src/scenes/person/components/PersonDocumentsMedical.tsx b/dashboard/src/scenes/person/components/PersonDocumentsMedical.tsx index e43a46fb1..2966aa58d 100644 --- a/dashboard/src/scenes/person/components/PersonDocumentsMedical.tsx +++ b/dashboard/src/scenes/person/components/PersonDocumentsMedical.tsx @@ -49,7 +49,7 @@ const PersonDocumentsMedical = ({ person }: PersonDocumentsProps) => { { _id: 'treatment', name: 'Traitements', - position: 0, + position: 1, parentId: 'root', type: 'folder', linkedItem: { @@ -80,7 +80,7 @@ const PersonDocumentsMedical = ({ person }: PersonDocumentsProps) => { { _id: 'consultation', name: 'Consultations', - position: 1, + position: 0, parentId: 'root', type: 'folder', linkedItem: { @@ -316,6 +316,7 @@ const PersonDocumentsMedical = ({ person }: PersonDocumentsProps) => { }} onSaveNewOrder={async (nextDocuments) => { try { + await new Promise((resolve) => setTimeout(resolve, 100)); // if not, the UX is jumpy and shit const groupedById: any = { treatment: {}, consultation: {},