From 505434f67b2fbae32cc8dd4ff5af734cb965d8cc Mon Sep 17 00:00:00 2001 From: Arnaud AMBROSELLI Date: Thu, 1 Feb 2024 15:58:13 +0100 Subject: [PATCH] =?UTF-8?q?fix:=20ne=20pas=20afficher=20les=20d=C3=A9tails?= =?UTF-8?q?=20quandon=20cr=C3=A9e=20un=20nouveau=20groupe=20alors=20que=20?= =?UTF-8?q?tout=20=C3=A9tait=20cach=C3=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../scenes/organisation/ActionCategoriesSettings.js | 1 + .../scenes/organisation/ConsultationsSettings.js | 1 + .../src/scenes/organisation/DragAndDropSettings.js | 13 ++++++++++++- .../src/scenes/organisation/MedicalFileSettings.js | 1 + .../src/scenes/organisation/ObservationsSettings.js | 1 + .../organisation/PersonCustomFieldsSettings.js | 1 + .../src/scenes/organisation/ServicesSettings.js | 1 + .../organisation/StructuresCategoriesSettings.js | 1 + 8 files changed, 19 insertions(+), 1 deletion(-) diff --git a/dashboard/src/scenes/organisation/ActionCategoriesSettings.js b/dashboard/src/scenes/organisation/ActionCategoriesSettings.js index f14e1197f9..6038de7857 100644 --- a/dashboard/src/scenes/organisation/ActionCategoriesSettings.js +++ b/dashboard/src/scenes/organisation/ActionCategoriesSettings.js @@ -100,6 +100,7 @@ const ActionCategoriesSettings = () => { title={

Catégories d'action

} data={dataFormatted} addButtonCaption="Ajouter un groupe" + sectionId='action-categories' onAddGroup={onAddGroup} onGroupTitleChange={onGroupTitleChange} dataItemKey={(cat) => cat} diff --git a/dashboard/src/scenes/organisation/ConsultationsSettings.js b/dashboard/src/scenes/organisation/ConsultationsSettings.js index 953215eeeb..0de8ba66db 100644 --- a/dashboard/src/scenes/organisation/ConsultationsSettings.js +++ b/dashboard/src/scenes/organisation/ConsultationsSettings.js @@ -125,6 +125,7 @@ const ConsultationsSettings = () => { Consultations} data={dataFormatted} + sectionId="consultations" addButtonCaption="Ajouter un type de consultations" onAddGroup={onAddConsultationType} onGroupTitleChange={onConsultationTypeChange} diff --git a/dashboard/src/scenes/organisation/DragAndDropSettings.js b/dashboard/src/scenes/organisation/DragAndDropSettings.js index db9b7b0a90..bab5209e4e 100644 --- a/dashboard/src/scenes/organisation/DragAndDropSettings.js +++ b/dashboard/src/scenes/organisation/DragAndDropSettings.js @@ -193,11 +193,22 @@ const Group = ({ setIsEditingGroupTitle(false); }; + const isOpened = useMemo(() => { + return window.sessionStorage.getItem(`drag-and-drop-setting-${sectionId}-${groupTitle}-open`) === 'true'; + }); + return ( <>
{ + if (e.target.open) { + window.sessionStorage.setItem(`drag-and-drop-setting-${sectionId}-${groupTitle}-open`, 'true'); + } else { + window.sessionStorage.removeItem(`drag-and-drop-setting-${sectionId}-${groupTitle}-open`); + } + }} key={groupTitle} id={groupTitle} data-group={groupTitle} diff --git a/dashboard/src/scenes/organisation/MedicalFileSettings.js b/dashboard/src/scenes/organisation/MedicalFileSettings.js index 489f6faab1..4e8ba17269 100644 --- a/dashboard/src/scenes/organisation/MedicalFileSettings.js +++ b/dashboard/src/scenes/organisation/MedicalFileSettings.js @@ -59,6 +59,7 @@ const MedicalFileSettings = () => { Dossier médical} data={dataFormatted} + sectionId='medical-file' dataItemKey={(cat) => cat.name} ItemComponent={MedicalFileCustomField} NewItemComponent={AddField} diff --git a/dashboard/src/scenes/organisation/ObservationsSettings.js b/dashboard/src/scenes/organisation/ObservationsSettings.js index 389d033eea..b32ca20b6d 100644 --- a/dashboard/src/scenes/organisation/ObservationsSettings.js +++ b/dashboard/src/scenes/organisation/ObservationsSettings.js @@ -57,6 +57,7 @@ const ObservationsSettings = () => { Observations de territoire} data={dataFormatted} + sectionId="customFieldsObs" dataItemKey={(cat) => cat.name} ItemComponent={ObservationCustomField} NewItemComponent={AddField} diff --git a/dashboard/src/scenes/organisation/PersonCustomFieldsSettings.js b/dashboard/src/scenes/organisation/PersonCustomFieldsSettings.js index 98c4dcd08a..288fcf5669 100644 --- a/dashboard/src/scenes/organisation/PersonCustomFieldsSettings.js +++ b/dashboard/src/scenes/organisation/PersonCustomFieldsSettings.js @@ -115,6 +115,7 @@ const PersonCustomFieldsSettings = () => { data={dataFormatted} addButtonCaption="Ajouter un groupe de champs personnalisés" onAddGroup={onAddGroup} + sectionId="customFieldsPersons" onGroupTitleChange={onGroupTitleChange} dataItemKey={(cat) => cat.name} ItemComponent={ConsultationCustomField} diff --git a/dashboard/src/scenes/organisation/ServicesSettings.js b/dashboard/src/scenes/organisation/ServicesSettings.js index 56c20fe206..7869300894 100644 --- a/dashboard/src/scenes/organisation/ServicesSettings.js +++ b/dashboard/src/scenes/organisation/ServicesSettings.js @@ -102,6 +102,7 @@ const ServicesSettings = () => { data={dataFormatted} addButtonCaption="Ajouter un groupe" onAddGroup={onAddGroup} + sectionId="services" onGroupTitleChange={onGroupTitleChange} dataItemKey={(cat) => cat} ItemComponent={Service} diff --git a/dashboard/src/scenes/organisation/StructuresCategoriesSettings.js b/dashboard/src/scenes/organisation/StructuresCategoriesSettings.js index 48d2018339..61f9a8ef6a 100644 --- a/dashboard/src/scenes/organisation/StructuresCategoriesSettings.js +++ b/dashboard/src/scenes/organisation/StructuresCategoriesSettings.js @@ -39,6 +39,7 @@ const StructuresCategoriesSettings = () => { cat} ItemComponent={Category} NewItemComponent={AddCategory}