-
Notifications
You must be signed in to change notification settings - Fork 380
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 should have ability just to display inactive users name (ideally the value fetched from 'Author/Title') #768
Comments
Thank you for reporting this issue. We will be triaging your incoming issue as soon as possible. |
Can this be triaged quickly? This is a basic requirement and without this the control cannot be used for Edit forms. It's pretty much limited to New Forms. Also, it appears many people are looking for this implementation. Appreciate your response soonest. |
@sankarkumar23 - Understand that this is an open source effort and everyone here volunteers their time to create these resources. You're also asking right in the middle of a time of year when many people are taking time off to spend the holidays with their families. The team here will take a look at this when they can. If your request seems as if it will benefit the larger community, they may implement it. Reminder: open source means you can contribute the fix/change, too. |
I made the fix and created a pull request. Please review and accept if fix makes sense. example: |
Thank you @sankarkumar23 for reporting this one and creating a PR. |
|
@AJIXuMuK - I have enhanced the fix as previous fix forces to verify the user is active or inactive before hand. With this new code if user is not found, ideally inactive user, the appended title will be shown. Appreciate your review. Also please see if this change can be pushed with 2.4.0 Still got a punch because of pnp/pnpjs#778. EMail is not available (in expand) for userfield with multi-select. Either you get email from sp.web.getUserById(id#) or just settle with Title field (user image will be missed). If userfield is not multi-select there is no need to call sp.web.getUserById since "expand" itself provides both Title and EMail (can be blank for inactive users). defaultSelectedUsers={["test@test.com/usertitle"]} //email can be active or inactive user's. |
Hi @sankarkumar23, I've merged your latest update. |
Thank you @AJIXuMuK. |
Enhancement.
People Picker should have the ability to assign the person (IPersonaProps) directly. This is useful just to display the inactive users when you have people picker in Edit form.. Just like how SharePoint lists users in Person column even the users' accounts are no longer valid.
Currently I am forced to show blank when you Edit the form this is very confusing to the end users.
We can fetch username from user field though the user is inactive.. for ex: (_api/web/lists('listid here')/items(1)?$select=ID,Author%2FTitle&expand=Author). This 'Title' would be displayed in OOB people picker box though the user is not active. Similarly we should also be able to assign the value to the PnP's people picker control.
Otherwise again we need to depend on NormalPeoplePicker to achieve this behavior.
This is somewhat related to the below issue
#SharePoint/sp-dev-docs#5970
We all know SharePoint does not resolve the inactive users.. its SharePoint behavior.. nothing we can do there..
The issue can be resolved if we can provide the ability to display the username in the picker's textbox.
Here is my thought for fix.
Change the defaultSelectedUsers property from string or IPersonaProps
Ideally inactive users email would be null in OOB SharePoint... When email is null/empty just display the given 'initials' and 'text'.. if email has value just continue the current functionality. Basically apply filter to 'selectedPersons' and play around.
Of course.. need to update the document...on how to bind inactive users?
The text was updated successfully, but these errors were encountered: