Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow editing description from filter edition dialogs #591

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading