This is an automated email from the ASF dual-hosted git repository. ppawar pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/atlas.git
The following commit(s) were added to refs/heads/master by this push: new be1fb8408 ATLAS-5037: [React UI] Entity detail page not retained after term deletion via sidebar (#361) be1fb8408 is described below commit be1fb84084c6f4a0cee01018904b0f14341b8bd6 Author: Brijesh Bhalala <32086209+brijesh...@users.noreply.github.com> 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) {