Skip to content

Commit

Permalink
Allow Editing description from filter dialogs
Browse files Browse the repository at this point in the history
  • Loading branch information
basseche committed Jan 2, 2025
1 parent c057c95 commit 119d4d5
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/components/directory-content-dialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,7 @@ function DirectoryContentDialog(
setActiveElement(event.data);
setOpenDescModificationDialog(true);
} else if (childrenMetadata[event.data.elementUuid] !== undefined) {
setActiveElement(event.data);
setElementName(childrenMetadata[event.data.elementUuid].elementName);
const subtype = childrenMetadata[event.data.elementUuid].specificMetadata.type as unknown as string;
/** set active directory on the store because it will be used while editing the contingency name */
Expand Down Expand Up @@ -283,7 +284,7 @@ function DirectoryContentDialog(
/>
);
}
if (currentExplicitNamingFilterId !== undefined) {
if (currentExplicitNamingFilterId !== undefined && activeElement) {
return (
<ExplicitNamingFilterEditionDialog
id={currentExplicitNamingFilterId}
Expand All @@ -298,10 +299,12 @@ function DirectoryContentDialog(
activeDirectory={activeDirectory}
elementExists={elementExists}
language={languageLocal}
description={activeElement.description}
elementUuid={activeElement.elementUuid}
/>
);
}
if (currentExpertFilterId !== undefined) {
if (currentExpertFilterId !== undefined && activeElement) {
return (
<ExpertFilterEditionDialog
id={currentExpertFilterId}
Expand All @@ -316,6 +319,8 @@ function DirectoryContentDialog(
activeDirectory={activeDirectory}
elementExists={elementExists}
language={languageLocal}
description={activeElement.description}
elementUuid={activeElement.elementUuid}
/>
);
}
Expand Down

0 comments on commit 119d4d5

Please sign in to comment.