Skip to content

Commit d0de874

Browse files
committed
scope of personTypeString conversion, fixing input vs no input for groups selection initial state
1 parent 5a24d14 commit d0de874

File tree

2 files changed

+8
-9
lines changed

2 files changed

+8
-9
lines changed

src/components/mgt-people-picker/mgt-people-picker.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -661,7 +661,7 @@ export class MgtPeoplePicker extends MgtTemplatedComponent {
661661
} else if (this.type === PersonType.person || this.type === PersonType.any) {
662662
people = await getPeople(graph);
663663
} else if (this.type === PersonType.group) {
664-
const groups = (await findGroups(graph, input, this.showMax, this.groupType)) || [];
664+
const groups = (await findGroups(graph, '', this.showMax, this.groupType)) || [];
665665
people = groups;
666666
}
667667
this.defaultPeople = people;
@@ -705,7 +705,7 @@ export class MgtPeoplePicker extends MgtTemplatedComponent {
705705
if ((this.type === PersonType.group || this.type === PersonType.any) && people.length < this.showMax) {
706706
people = [];
707707
try {
708-
const groups = (await findGroups(graph, '', this.showMax, this.groupType)) || [];
708+
const groups = (await findGroups(graph, input, this.showMax, this.groupType)) || [];
709709
people = people.concat(groups);
710710
} catch (e) {
711711
// nop

src/graph/graph.people.ts

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -51,14 +51,13 @@ export async function findPeople(
5151

5252
let filterQuery = '';
5353

54-
// converts personType to capitalized case
55-
const personTypeString =
56-
personType
57-
.toString()
58-
.charAt(0)
59-
.toUpperCase() + personType.toString().slice(1);
60-
6154
if (personType !== PersonType.any) {
55+
// converts personType to capitalized case
56+
const personTypeString =
57+
personType
58+
.toString()
59+
.charAt(0)
60+
.toUpperCase() + personType.toString().slice(1);
6261
filterQuery = `personType/class eq '${personTypeString}'`;
6362
}
6463

0 commit comments

Comments
 (0)