From 7e021730c77e5b0e4230df6103916ae67e329fdc Mon Sep 17 00:00:00 2001 From: Dipesh Singh Date: Mon, 29 Jan 2024 23:53:08 +0530 Subject: [PATCH] Show `displayName` of realm on welcome page (#26562) Closes #25897 Signed-off-by: dipeshsingh253 --- js/apps/admin-ui/src/dashboard/Dashboard.tsx | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/js/apps/admin-ui/src/dashboard/Dashboard.tsx b/js/apps/admin-ui/src/dashboard/Dashboard.tsx index d2be077150..5a6e0d7221 100644 --- a/js/apps/admin-ui/src/dashboard/Dashboard.tsx +++ b/js/apps/admin-ui/src/dashboard/Dashboard.tsx @@ -54,7 +54,10 @@ import helpUrls from "../help-urls"; const EmptyDashboard = () => { const { t } = useTranslation(); const { realm } = useRealm(); + const [realmInfo, setRealmInfo] = useState(); const brandImage = environment.logo ? environment.logo : "/icon.svg"; + useFetch(() => adminClient.realms.findOne({ realm }), setRealmInfo, []); + const realmDisplayInfo = realmInfo?.displayName || realm; return ( @@ -68,7 +71,7 @@ const EmptyDashboard = () => { {t("welcome")} - {realm} + {realmDisplayInfo} {t("introduction")} @@ -130,7 +133,7 @@ const Dashboard = () => { useFetch(() => adminClient.realms.findOne({ realm }), setRealmInfo, []); - const realmDisplayInfo = realmInfo?.displayName ?? realm; + const realmDisplayInfo = realmInfo?.displayName || realm; const welcomeTab = useTab("welcome"); const infoTab = useTab("info");