From 42caa8abf435534c6e01592cca44b64fd008dda2 Mon Sep 17 00:00:00 2001 From: Sachin Chaurasiya Date: Fri, 12 Nov 2021 15:38:48 +0530 Subject: [PATCH] Fix : As admin, setting myself as owner of a table does not update the table view. (#1166) --- .../common/error-with-placeholder/ErrorPlaceHolderES.tsx | 4 ++-- .../src/main/resources/ui/src/pages/teams/index.tsx | 2 +- .../src/main/resources/ui/src/utils/TableUtils.tsx | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/catalog-rest-service/src/main/resources/ui/src/components/common/error-with-placeholder/ErrorPlaceHolderES.tsx b/catalog-rest-service/src/main/resources/ui/src/components/common/error-with-placeholder/ErrorPlaceHolderES.tsx index 96948ffb63d..bf4188ec0c8 100644 --- a/catalog-rest-service/src/main/resources/ui/src/components/common/error-with-placeholder/ErrorPlaceHolderES.tsx +++ b/catalog-rest-service/src/main/resources/ui/src/components/common/error-with-placeholder/ErrorPlaceHolderES.tsx @@ -45,9 +45,9 @@ const ErrorPlaceHolderES = ({ type, errorMessage, query = '' }: Props) => { const getUserDisplayName = () => { return isAuthDisabled ? AppState.users?.length > 0 - ? AppState.users[0].displayName + ? AppState.users[0].displayName || AppState.users[0].name : 'User' - : AppState.userDetails.displayName; + : AppState.userDetails.displayName || AppState.userDetails.name; }; const noRecordForES = () => { return ( diff --git a/catalog-rest-service/src/main/resources/ui/src/pages/teams/index.tsx b/catalog-rest-service/src/main/resources/ui/src/pages/teams/index.tsx index 4db5ab1ca8e..9e767f9d51d 100644 --- a/catalog-rest-service/src/main/resources/ui/src/pages/teams/index.tsx +++ b/catalog-rest-service/src/main/resources/ui/src/pages/teams/index.tsx @@ -216,7 +216,7 @@ const TeamsPage = () => { data-testid="user-card-container"> {currentTeam?.users?.map((user, index) => { const User = { - description: user.description || '', + description: user.displayName || '', name: user.name || '', id: user.id, }; diff --git a/catalog-rest-service/src/main/resources/ui/src/utils/TableUtils.tsx b/catalog-rest-service/src/main/resources/ui/src/utils/TableUtils.tsx index bd3011ae3ec..977ad2da0c4 100644 --- a/catalog-rest-service/src/main/resources/ui/src/utils/TableUtils.tsx +++ b/catalog-rest-service/src/main/resources/ui/src/utils/TableUtils.tsx @@ -93,7 +93,7 @@ export const getOwnerFromId = ( const user = AppState.users.find((item) => item.id === id); if (user) { retVal = { - name: user.displayName, + name: user.displayName || user.name, id: user.id, type: 'user', };