From f201645b16dc9c4f3cfa9eab16ab85caadcdc5e2 Mon Sep 17 00:00:00 2001 From: Atte Moisio Date: Fri, 5 Apr 2024 11:19:02 +0300 Subject: [PATCH] Show admin's first name instead of internal authentication ID --- src/components/ContextProvider.tsx | 2 ++ src/components/Header.tsx | 5 +++-- src/index.tsx | 5 +++++ src/models/Admin.ts | 3 +++ 4 files changed, 13 insertions(+), 2 deletions(-) diff --git a/src/components/ContextProvider.tsx b/src/components/ContextProvider.tsx index 7d9604b..3f66954 100644 --- a/src/components/ContextProvider.tsx +++ b/src/components/ContextProvider.tsx @@ -13,6 +13,7 @@ export interface ContextProviderProps extends React.Props { showCircEventsDownload?: boolean; settingUp?: boolean; email?: string; + givenName?: string; roles?: { role: string; library?: string; @@ -36,6 +37,7 @@ export default class ContextProvider extends React.Component< this.admin = new Admin( props.roles || [], props.email || null, + props.givenName || null, props.authType || null ); this.pathFor = (collectionUrl: string, bookUrl: string, tab?: string) => { diff --git a/src/components/Header.tsx b/src/components/Header.tsx index f06f9e9..86f4d43 100644 --- a/src/components/Header.tsx +++ b/src/components/Header.tsx @@ -225,7 +225,7 @@ export class Header extends React.Component { {sitewideLinkItems.map((item) => this.renderLinkItem(item, currentPathname) )} - {this.context.admin.email && ( + {(this.context.admin.email || this.context.admin.givenName) && (