Skip to content

Commit 6abfc54

Browse files
elisenyangnmetulevbeth-panx
authored
update people picker search and index.html permission scopes (#742)
* update people picker search and index.html permission scopes * Remove comments Co-authored-by: Nikola Metulev <[email protected]> * prettier formatting Co-authored-by: Nikola Metulev <[email protected]> Co-authored-by: Beth Pan <[email protected]> Co-authored-by: Nikola Metulev <[email protected]>
1 parent c3995b6 commit 6abfc54

File tree

4 files changed

+7
-15
lines changed

4 files changed

+7
-15
lines changed

index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525

2626
<mgt-msal-provider
2727
client-id="a974dfa0-9f57-49b9-95db-90f04ce2111a"
28-
scopes="user.read,people.read,user.readbasic.all,contacts.read,calendars.read"
28+
scopes="user.read,people.read,user.readbasic.all,contacts.read,calendars.read,presence.read.all,tasks.readwrite,presence.read,user.read.all,group.read.all,tasks.read"
2929
redirect-uri="http://localhost:3000"
3030
depends-on="mgt-teams-provider"
3131
></mgt-msal-provider>

packages/mgt-react/src/generated/react.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ export type AgendaProps = {
1212
events?: MicrosoftGraph.Event[];
1313
showMax?: number;
1414
groupByDay?: boolean;
15+
preferredTimezone?: string;
1516
templateConverters?: MgtElement.TemplateContext;
1617
templateContext?: MgtElement.TemplateContext;
1718
direction?: string;

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

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -707,17 +707,6 @@ export class MgtPeoplePicker extends MgtTemplatedComponent {
707707
}
708708
}
709709

710-
if (people) {
711-
people = people.filter((user: User) => {
712-
return (
713-
user.displayName.toLowerCase().indexOf(input) !== -1 ||
714-
(!!user.givenName && user.givenName.toLowerCase().indexOf(input) !== -1) ||
715-
(!!user.surname && user.surname.toLowerCase().indexOf(input) !== -1) ||
716-
(!!user.mail && user.mail.toLowerCase().indexOf(input) !== -1)
717-
);
718-
});
719-
}
720-
721710
this._foundPeople = this.filterPeople(people);
722711
}
723712

@@ -844,6 +833,8 @@ export class MgtPeoplePicker extends MgtTemplatedComponent {
844833
highlight = displayName.slice(highlightLocation, highlightLocation + userInputLength);
845834
last = displayName.slice(highlightLocation + userInputLength, displayName.length);
846835
}
836+
} else {
837+
first = person.displayName;
847838
}
848839

849840
return html`

packages/mgt/src/graph/graph.user.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -406,9 +406,9 @@ export async function findUsers(graph: IGraph, query: string, top: number = 10):
406406
try {
407407
graphResult = await graph
408408
.api('users')
409-
.filter(
410-
`startswith(displayName,'${query}') or startswith(givenName,'${query}') or startswith(surname,'${query}') or startswith(mail,'${query}') or startswith(userPrincipalName,'${query}')`
411-
)
409+
.header('ConsistencyLevel', 'eventual')
410+
.count(true)
411+
.search(`"displayName:${query}"`)
412412
.top(top)
413413
.middlewareOptions(prepScopes(scopes))
414414
.get();

0 commit comments

Comments
 (0)