Skip to content
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

Closed
harshdamaniahd opened this issue Jul 14, 2018 · 33 comments

Comments

@harshdamaniahd
Copy link

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
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
Copy link
Author

@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
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
Copy link
Author

@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
Copy link
Author

@AsishP so any thoughts ?

@AsishP
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
Copy link
Author

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

@harshdamaniahd
Copy link
Author

any timelines on this :-)

@AsishP
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
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
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
Copy link

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
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
Copy link

@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
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
Copy link

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
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
Copy link

@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
Copy link

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

@AsishP
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
Copy link

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

@AsishP
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.

@ghost
Copy link

ghost 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
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
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
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
Copy link

@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!

@ravick4u
Copy link

@estruyf Is this fixed?

@sympmarc
Copy link

@ravick4u I was involved above and I believe it’s been fixed for a long time. Are you having issues?

@ravick4u
Copy link

ravick4u commented Nov 9, 2019

@sympmarc Last when I tried didn't work for me. I also saw this issue open so I thought of checking on this.

@AJIXuMuK
Copy link
Collaborator

Hi @ravick4u,

Could you please re-check if it still doesn't work for you?

@ghost
Copy link

ghost commented Jun 20, 2020

This issue has been automatically marked as stale because it has marked as requiring author feedback but has not had any activity for 7 days. It will be closed if no further activity occurs within next 7 days of this comment. Thank you for your contributions to SharePoint Developer activities.

@ghost ghost added the no-recent-activity label Jun 20, 2020
@ghost ghost closed this as completed Jun 27, 2020
@ghost
Copy link

ghost commented Jun 27, 2020

Closing issue due no response from original author. If this issue is still occurring, please open a new issue with additional details. Notice that if you have included another related issue as additional comment on this, please open that also as separate issue, so that we can track it independently.

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

8 participants