From 7e2779dbf476610a080652fda1e25f905fd27851 Mon Sep 17 00:00:00 2001 From: Shailesh Parmar Date: Mon, 9 May 2022 13:52:48 +0530 Subject: [PATCH] Fix issue related to teams joining and leaving, name is not getting dispalyed (#4792) --- openmetadata-ui/src/main/resources/ui/src/AppState.ts | 1 + .../src/main/resources/ui/src/components/app-bar/Appbar.tsx | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/openmetadata-ui/src/main/resources/ui/src/AppState.ts b/openmetadata-ui/src/main/resources/ui/src/AppState.ts index 3b32179ea21..733bd4eafc4 100644 --- a/openmetadata-ui/src/main/resources/ui/src/AppState.ts +++ b/openmetadata-ui/src/main/resources/ui/src/AppState.ts @@ -78,6 +78,7 @@ class AppState { } updateUserDetails(data: User) { this.userDetails = data; + this.nonSecureUserDetails = data; } updateNewUser(data: NewUser) { this.newUser = data; diff --git a/openmetadata-ui/src/main/resources/ui/src/components/app-bar/Appbar.tsx b/openmetadata-ui/src/main/resources/ui/src/components/app-bar/Appbar.tsx index 9140faec033..d2fe63546a6 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/app-bar/Appbar.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/components/app-bar/Appbar.tsx @@ -143,7 +143,7 @@ const Appbar: React.FC = (): JSX.Element => { const getUserName = () => { const currentUser = isAuthDisabled - ? appState.users[0] + ? appState.nonSecureUserDetails : appState.userDetails; return currentUser?.displayName || currentUser?.name || TERM_USER; @@ -151,7 +151,7 @@ const Appbar: React.FC = (): JSX.Element => { const getUserData = () => { const currentUser = isAuthDisabled - ? appState.users[0] + ? appState.nonSecureUserDetails : appState.userDetails; const name = currentUser?.displayName || currentUser?.name || TERM_USER; @@ -199,7 +199,7 @@ const Appbar: React.FC = (): JSX.Element => { {teams.map((t, i) => (

- {t.displayName} + {t.displayName || t.name}

))}