This is an automated email from the ASF dual-hosted git repository.
ppawar pushed a commit to branch atlas-2.5
in repository https://gitbox.apache.org/repos/asf/atlas.git
The following commit(s) were added to refs/heads/atlas-2.5 by this push:
new 2bd61c3cf ATLAS-5037: [React UI] Entity detail page not retained after
term deletion via sidebar (#361)
2bd61c3cf is described below
commit 2bd61c3cf55b875083591b84ed5905f2d3577544
Author: Brijesh Bhalala <[email protected]>
AuthorDate: Thu May 29 11:34:43 2025 +0530
ATLAS-5037: [React UI] Entity detail page not retained after term deletion
via sidebar (#361)
---
dashboard/src/views/Glossary/DeleteGlossary.tsx | 27 ++++++++++++++++---------
1 file changed, 17 insertions(+), 10 deletions(-)
diff --git a/dashboard/src/views/Glossary/DeleteGlossary.tsx
b/dashboard/src/views/Glossary/DeleteGlossary.tsx
index c1e077a83..4f04c8a90 100644
--- a/dashboard/src/views/Glossary/DeleteGlossary.tsx
+++ b/dashboard/src/views/Glossary/DeleteGlossary.tsx
@@ -24,9 +24,9 @@ import { useAppDispatch } from "@hooks/reducerHook";
import ErrorRoundedIcon from "@mui/icons-material/ErrorRounded";
import { Typography } from "@mui/material";
import { fetchGlossaryData } from "@redux/slice/glossarySlice";
-import { serverError } from "@utils/Utils";
+import { isEmpty, serverError } from "@utils/Utils";
import { useRef } from "react";
-import { useNavigate } from "react-router-dom";
+import { useLocation, useNavigate, useParams } from "react-router-dom";
import { toast } from "react-toastify";
const DeleteGlossary = (props: {
@@ -37,9 +37,14 @@ const DeleteGlossary = (props: {
updatedData: any;
}) => {
const { open, onClose, setExpandNode, node, updatedData } = props;
- const { id, guid, cGuid, type } = node;
+ const { id, guid, cGuid, types } = node;
const gtype: string | undefined | null =
- type != "parents" ? "term" : "glossary";
+ types != "parent" ? "term" : "glossary";
+ const location = useLocation();
+ const searchParams = new URLSearchParams(location.search);
+ const glossaryType = searchParams.get("gtype");
+ const { guid: glossaryGuid } = useParams();
+
const navigate = useNavigate();
const dispatchApi = useAppDispatch();
const toastId: any = useRef(null);
@@ -60,12 +65,14 @@ const DeleteGlossary = (props: {
gtype == "term" ? "Term" : "Glossary"
} ${id} was deleted successfully`
);
- navigate(
- {
- pathname: "/"
- },
- { replace: true }
- );
+ if (!isEmpty(glossaryGuid) || !isEmpty(glossaryType)) {
+ navigate(
+ {
+ pathname: "/"
+ },
+ { replace: true }
+ );
+ }
onClose();
setExpandNode(null);
} catch (error) {