New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

People Picker is searching users only from current site and not entire active directory #97

Open
harshdamaniahd opened this Issue Jul 14, 2018 · 27 comments

Comments

Projects
None yet
7 participants
@harshdamaniahd
Copy link

harshdamaniahd commented Jul 14, 2018

I have noticed that people picker is searching users present in current site only . It should fetch all users in active directory
```
<PeoplePicker
context={this.props.pageContext}
titleText="People Picker"
personSelectionLimit={1}
groupName={''}// Leave this blank in case you want to filter from all users
showtooltip={true}
isRequired={false}
tooltipMessage={"Search for people"}
selectedItems={this._getPeoplePickerItems}
/>

@AsishP

This comment has been minimized.

Copy link
Contributor

AsishP commented Jul 16, 2018

@harshdamaniahd , I suppose we could add another property or option for groupName to allow search all Active Directory users (or SharePoint User Profiles or Graph to simplify it).

Currently the scope of the people picker is set to use the site users and not Global user profiles. The idea of doing that is that the control fetches validated users of the site. Is there a particular scenario for using AD or User Profiles? Would love to know the reason of the usage before coming up with a technical plan.

@harshdamaniahd

This comment has been minimized.

Copy link

harshdamaniahd commented Jul 16, 2018

@AsishP
For now there are two use cases,

  1. There is an intranet landing page, which has an option to search user. So it's great to use this control as when you type you can see the user.Once selected you can click on search icon , which redirects to delve page giving information about the user selected.
    2.There is custom form which basically has columns like approvers ( here we require this control).

At least for now

@AsishP

This comment has been minimized.

Copy link
Contributor

AsishP commented Jul 16, 2018

@harshdamaniahd , I suppose scenario 2 is a perfect fit for this control where approvers will be users of the site mostly I think. Please let me know otherwise.

However, in my opinion, the control was not build to handle scenario 1. We are working on a similar scope in #23 (New Search Control) but haven't made much progress on it recently. I could add People search to the existing scope of the search control. Will that work?

@harshdamaniahd

This comment has been minimized.

Copy link

harshdamaniahd commented Jul 16, 2018

@AsishP Thanks.
Actually it took me some time to think and I have some questions (My understanding)
In case we are using people picker and permission is managed via Office 365 groups, then in that case the user will never be shown up in results.So i guess the scope of PeoplePicker becomes very limited.Generally a people picker searches all users .

Talking about Search Control , so search will take place only for users and no other content just like people picker right ?
Yeh..this seems okay as well

But then its better to segregate content search and people search.
This is what I feel.But definitely you guys may have a better understanding.

My only requirement is that user can enter name and it will return result just like people picker :-)

@harshdamaniahd

This comment has been minimized.

Copy link

harshdamaniahd commented Jul 18, 2018

@AsishP so any thoughts ?

@AsishP

This comment has been minimized.

Copy link
Contributor

AsishP commented Jul 19, 2018

@harshdamaniahd, sorry have been busy lately. Yeah, I agree with your points.

Agreed that people picker should search within Office 365 Unified groups. The implemementation will use Graph so have to plan for it. Will update on it as soon as have got some progress.

Regarding Search, yes the search box will have option on it or properties pane, haven't gave it much thought yet. Also, the results will differ as people results will have more profile information. Will keep you posted on progress and get feedback on the same.

@harshdamaniahd

This comment has been minimized.

Copy link

harshdamaniahd commented Jul 20, 2018

Thanks for the update @AsishP
Great , looking forward for this functionality to come 👍

@harshdamaniahd

This comment has been minimized.

Copy link

harshdamaniahd commented Aug 7, 2018

any timelines on this :-)

@AsishP

This comment has been minimized.

Copy link
Contributor

AsishP commented Aug 9, 2018

@harshdamaniahd, sorry have been caught up with some project work recently. Will try to get onto this as soon as possible. The Unified Group might be quicker. The Search part is going to take some time. Will let you know as soon as get some progress.

@spdavid

This comment has been minimized.

Copy link
Contributor

spdavid commented Aug 27, 2018

When 1.6 of SPFx comes out I would like to see this search users from the microsoft graph using the MSGraphClient.
Should be any day now.

@exnerr

This comment has been minimized.

Copy link

exnerr commented Nov 2, 2018

Any update on this?

We're dealing with the same situation where we need to search a different site.

@sympmarc

This comment has been minimized.

Copy link

sympmarc commented Nov 16, 2018

If we're calling this a PeoplePicker, it seems to me it should work as much like an out of the box PeoplePicker as possible, returning ALL users and groups which match what's been typed.

@AsishP

This comment has been minimized.

Copy link
Contributor

AsishP commented Nov 18, 2018

@sympmarc, yeah the control was initially created to act as a form control in forms such as list edit forms which scopes to SharePoint site only (don’t know if this has changed in Modern now). But many are looking for this extension so might add a choice to search across all tenant users along with site users. Thinking of a property like serachscope with choice of site and tenant. Thoughts?

@sympmarc

This comment has been minimized.

Copy link

sympmarc commented Nov 18, 2018

@AsishP I can't recall a time when it's ever been scoped to only the site in modern. PeoplePickers have always scoped to the universe of people unless you set it differently in the list column settings. Since it's the same settings page as we get with classic, it's worked this way consistently for years, unless I'm missing something.

image

@AsishP

This comment has been minimized.

Copy link
Contributor

AsishP commented Nov 19, 2018

@sympmarc, my bad, I see it, bet I never paid attention to it. Yeah then, the control should extended to include all Tenant users as the OOB control setting is.

@sympmarc

This comment has been minimized.

Copy link

sympmarc commented Nov 19, 2018

Then we agree! I tried using this control, and it doesn't really make the cut right now. I'll be stuck until it does.

@AsishP

This comment has been minimized.

Copy link
Contributor

AsishP commented Nov 19, 2018

Yeah agree on the implementation, however don’t have a endpoint in mind yet. Currently using siteusers rest api endpoint, might have to switch to a userprofile endpoint or graph endpoint (for graph might need some additional settings). So will take some time.

For a workaround, haven’t tested this yet and if it is feasible, could you please try adding everyone to visitors group and see if that works.

@sympmarc

This comment has been minimized.

Copy link

sympmarc commented Nov 19, 2018

@AsishP - I added Everyone but external users to the Site visitors group, but no joy. Nice thought, though.

It seems like this probably has been thought out before. Let me see if I can dig up ideas on the right endpoint.

@sympmarc

This comment has been minimized.

Copy link

sympmarc commented Nov 19, 2018

Take a look at ngOfficeUIFabric. We've used that in the past, and it works great.

@AsishP

This comment has been minimized.

Copy link
Contributor

AsishP commented Nov 19, 2018

Thanks @sympmarc for trying the workaround, was a long shot anyways, thought will get lucky in fooling SP :)
Also, thanks for the reference to ngOfficeUIFabric, seems like it is using people search, which could work too but then will have to change the people binding from initial load method, to refresh at key change or state change which could then pull the latest and bind it. Might have to work on the flow for this and might some time equally. Will keep you posted on this. Sorry for any delay.

@sympmarc

This comment has been minimized.

Copy link

sympmarc commented Nov 20, 2018

Also, the PropertyFieldPeoplePicker control must be basically identical in intent? Seems like building them separately doesn't make much sense.

@AsishP

This comment has been minimized.

Copy link
Contributor

AsishP commented Nov 21, 2018

@sympmarc, agreed, will look into that part too, might have to take guidance from @estruyf on property people picker. Actually, the peoplepicker control didin't exactly start with the same code base as property pane peoplepicker has but saying that, completely agree that they should have the same identical behaviours and logic. Will work on it.

@ManiKum

This comment has been minimized.

Copy link

ManiKum commented Dec 7, 2018

@AsishP, just wondering if we're going to have the change (to search all users) completed in next 10-15 days? I ask because it impacts the code changes at my end.

@AsishP

This comment has been minimized.

Copy link
Contributor

AsishP commented Dec 9, 2018

@ManiKum, yeah it should be ready in PR soon. Ironing some final functionality implementation with default users and resolving some final bugs. After that as soon as it is merged it will be ready for use.

@AsishP

This comment has been minimized.

Copy link
Contributor

AsishP commented Dec 9, 2018

@sympmarc , @ManiKum , this is now in PR. Please test the control when it is ready in beta after @estruyf merges the changes.

@AsishP

This comment has been minimized.

Copy link
Contributor

AsishP commented Dec 9, 2018

@sympmarc , @ManiKum @harshdamaniahd, forgot to add few key points as below.

  1. The Site users are prepopulated by default, so the users could still choose from them
  2. If not, search will pull more data after entering 3 characters of the user name similar to OOB People picker control.
  3. Have added a delay of 1 sec to allow the search results to return when resolving suggestions. I am trying to find a way to show a spinner for this wait but not ready yet (will submit another PR later if already merged)

@tsekityam, @Arknev , could you please test this on your tenancy with large user sets to pull users which are not site users. If the resolve suggestions doesn't happen within the default 1 sec delay Please use resolveDelay (in millisecs) to add more delay if needed.

@tnooytens

This comment has been minimized.

Copy link

tnooytens commented Dec 13, 2018

@AsishP I just stumbled upon this issue since I was facing the same problem. I've updated to the latest version of the control and can confirm that it seems to correctly pull users across the tenant now. Thanks a lot for the update!

estruyf added a commit that referenced this issue Dec 17, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment