Skip to content

Commit

Permalink
Merge pull request #962 from a1exymoroz/feat/#958-PEOPLE-PICKER-DEFAU…
Browse files Browse the repository at this point in the history
…LT-SELECTED-ITEMS

feat/#958 Add selected items for groups
  • Loading branch information
AJIXuMuK authored Aug 6, 2021
2 parents 2dafd95 + 5bdf0ad commit 53d6b8b
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/services/PeopleSearchService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ export default class SPPeopleSearchService {
switch (element.EntityType) {
case 'User':
const accountName: string = element.Description || "";
const email: string = element.EntityData.Email || element.Description;
const email: string = element.EntityData?.Email || element.Description;
return {
id: element.Key,
loginName: element.LoginName ? element.LoginName : element.Key,
Expand All @@ -240,12 +240,13 @@ export default class SPPeopleSearchService {
optionalText: "" // anything
} as IPeoplePickerUserItem;
case 'SecGroup':
const secondaryText = element.EntityData?.Email || element.ProviderName
return {
id: element.Key,
loginName: element.LoginName ? element.LoginName : element.Key,
imageInitials: this.getFullNameInitials(element.DisplayText),
text: element.DisplayText,
secondaryText: element.ProviderName
secondaryText,
} as IPeoplePickerUserItem;
case 'FormsRole':
return {
Expand Down

0 comments on commit 53d6b8b

Please sign in to comment.