diff --git a/packages/mgt-components/src/components/mgt-person/mgt-person.ts b/packages/mgt-components/src/components/mgt-person/mgt-person.ts index 2f294379a2..d149ce5a47 100644 --- a/packages/mgt-components/src/components/mgt-person/mgt-person.ts +++ b/packages/mgt-components/src/components/mgt-person/mgt-person.ts @@ -705,8 +705,15 @@ export class MgtPerson extends MgtTemplatedComponent { */ protected renderImage(personDetailsInternal: IDynamicPerson, imageSrc: string) { const altText = `${this.strings.photoFor} ${personDetailsInternal.displayName}`; - const hasImage = imageSrc && !this._isInvalidImageSrc && this._avatarType === 'photo'; - const imageTemplate = html`${altText} (this._isInvalidImageSrc = true)} />`; + const hasImage = imageSrc && !this._isInvalidImageSrc && this._avatarType === avatarType.photo; + const imageOnly = this.avatarType === avatarType.photo && this.view === ViewType.image; + const titleText = + (personDetailsInternal?.displayName || getEmailFromGraphEntity(personDetailsInternal)) ?? undefined; + const imageTemplate = html`${altText} (this._isInvalidImageSrc = true)} />`; const initials = personDetailsInternal ? this.getInitials(personDetailsInternal) : ''; const hasInitials = initials?.length; @@ -719,6 +726,7 @@ export class MgtPerson extends MgtTemplatedComponent { // this reduces the redundant announcement of the user's name. const textTemplate = html` diff --git a/packages/mgt-components/src/graph/graph.people.ts b/packages/mgt-components/src/graph/graph.people.ts index 5fa9844460..cf0041d78b 100644 --- a/packages/mgt-components/src/graph/graph.people.ts +++ b/packages/mgt-components/src/graph/graph.people.ts @@ -224,9 +224,9 @@ export const getPeople = async ( }; /** - * returns a promise that resolves after specified time + * Attempts to extract the email from the IDynamicPerson properties. * - * @param time in milliseconds + * @param {IDynamicperson} entity */ export const getEmailFromGraphEntity = (entity: IDynamicPerson): string => { const person = entity as Person;