YannickRe / spfx-msgraph-peoplesearch

Show and search users from your organization with an SPFx web part, through Microsoft Graph.
40 stars 33 forks source link

Edit search #6

Closed krzysztof-sz closed 3 years ago

krzysztof-sz commented 3 years ago

What and where do you need to add to search also for 'jobTitle' and 'officeLocation'?

YannickRe commented 3 years ago

I suggest you take a look at #5 where someone did exactly that! Good luck!

krzysztof-sz commented 3 years ago

I suggest you take a look at #5 where someone did exactly that! Good luck!

Ok, thanks.

Two more things:

  1. I would like the list to be empty when typing in the search engine (now the entire list is 1255 results when typing).
  2. How can I hide shared mailboxes?
YannickRe commented 3 years ago
  1. Comment this line: https://github.com/YannickRe/spfx-msgraph-peoplesearch/blob/e614c8990ad3ecf47a4317ee8834b1cca5e61bea/src/webparts/peoplesearch/components/PeopleSearchContainer/PeopleSearchContainer.tsx#L46
  2. Find or create a common attribute on those user accounts, and filter on it.
krzysztof-sz commented 3 years ago

Thanks!

  1. Can I add my own field to $ filter parameter value that I created in the Sharepoint user profile?
  2. Can I set that after searching for a user and clicking "x" the list was empty (currently showing all)?
YannickRe commented 3 years ago
  1. No, this web part works on fields available through Microsoft Graph and Azure AD profile, not on the SharePoint profile.
  2. Probably, but you'll need to dive into the code and make that change yourself
YannickRe commented 3 years ago

@krzysztof-sz Did the above information help you? Can I close this issue?

YannickRe commented 3 years ago

Closed due to inactivity.

TheMancs commented 1 year ago

What and where do you need to add to search also for 'jobTitle' and 'officeLocation'?

@krzysztof-sz hi, I was just wondering if you were able to work around this issue? I'm currently stuck on the issue where my query only does "stars with" searches when there are multiple query parameters described in this comment

I tried something like this: if (!isEmpty(this.searchParameter)) { const properties = ["displayname", "jobTitle", "mail", "department"]; let promises: PageCollection<ExtendedUser>; properties.forEach(property => promises += resultQuery.query({ $search:"${property}:${this.searchParameter}"}).get() ) return promises;

Which has no effect, still searching with "starts with". Best regards