From e2db70c389786d384faf9eb1e462ef225e2c7cfc Mon Sep 17 00:00:00 2001 From: Harsh Vador <58542468+harsh-vador@users.noreply.github.com> Date: Tue, 30 Jan 2024 21:00:20 +0530 Subject: [PATCH] ui: handle tab navigation if no access token (#14952) * Handle navigation if no access token * remove dependency --- .../ui/src/components/Users/Users.component.tsx | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/openmetadata-ui/src/main/resources/ui/src/components/Users/Users.component.tsx b/openmetadata-ui/src/main/resources/ui/src/components/Users/Users.component.tsx index 27577c0c6e1..173d20dd421 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/Users/Users.component.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/components/Users/Users.component.tsx @@ -101,6 +101,19 @@ const Users = ({ userData, queryFilters, updateUserDetails }: Props) => { setPreviewAsset(asset); }, []); + const handleTabRedirection = useCallback(() => { + if (!isLoggedInUser && activeTab === UserPageTabs.ACCESS_TOKEN) { + history.push({ + pathname: getUserPath(decodedUsername, UserPageTabs.ACTIVITY), + search: location.search, + }); + } + }, [activeTab, decodedUsername, isLoggedInUser]); + + useEffect(() => { + handleTabRedirection(); + }, []); + const handlePersonaUpdate = useCallback( async (personas: EntityReference[]) => { await updateUserDetails({ ...userData, personas });