@@ -13,7 +13,7 @@ import {
1313 customElementHelper ,
1414 mgtHtml
1515} from '@microsoft/mgt-element' ;
16- import { Contact , Presence } from '@microsoft/microsoft-graph-types' ;
16+ import { Presence } from '@microsoft/microsoft-graph-types' ;
1717import { html , TemplateResult , nothing } from 'lit' ;
1818import { property , state } from 'lit/decorators.js' ;
1919import { classMap } from 'lit/directives/class-map.js' ;
@@ -32,14 +32,15 @@ import { PersonCardInteraction } from './../PersonCardInteraction';
3232import { styles } from './mgt-person-css' ;
3333import { MgtPersonConfig , PersonViewType , avatarType } from './mgt-person-types' ;
3434import { strings } from './strings' ;
35+ import { isUser , isContact } from '../../graph/entityType' ;
3536import { ifDefined } from 'lit/directives/if-defined.js' ;
3637
3738export { PersonCardInteraction } from '../PersonCardInteraction' ;
3839
3940/**
4041 * Person properties part of original set provided by graph by default
4142 */
42- const defaultPersonProperties = [
43+ export const defaultPersonProperties = [
4344 'businessPhones' ,
4445 'displayName' ,
4546 'givenName' ,
@@ -51,7 +52,8 @@ const defaultPersonProperties = [
5152 'preferredLanguage' ,
5253 'surname' ,
5354 'userPrincipalName' ,
54- 'id'
55+ 'id' ,
56+ 'userType'
5557] ;
5658
5759/**
@@ -1205,15 +1207,13 @@ export class MgtPerson extends MgtTemplatedComponent {
12051207 person = this . personDetailsInternal ;
12061208 }
12071209
1208- if ( ( person as Contact ) . initials ) {
1209- return ( person as Contact ) . initials ;
1210+ if ( isContact ( person ) ) {
1211+ return person . initials ;
12101212 }
12111213
12121214 let initials = '' ;
1213- if ( person . givenName ) {
1215+ if ( isUser ( person ) ) {
12141216 initials += person . givenName [ 0 ] . toUpperCase ( ) ;
1215- }
1216- if ( person . surname ) {
12171217 initials += person . surname [ 0 ] . toUpperCase ( ) ;
12181218 }
12191219
0 commit comments