ems-frontend
                                
                                
                                
                                    ems-frontend copied to clipboard
                            
                            
                            
                        feat/AB#74292 People picker
Description
This creates a dropdown with multiple selections, that allows to search for users
Useful links
Type of change
Please delete options that are not relevant.
- [x] Bug fix (non-breaking change which fixes an issue)
 - [x] Improvement (refactor or addition to existing functionality)
 
Screenshots
https://github.com/ReliefApplications/oort-frontend/assets/15035750/075d4877-2e80-402f-9c50-2f39e985b917
Checklist:
( * == Mandatory )
- [x] * I have set myself as assignee of the pull request
 - [x] * My code follows the style guidelines of this project
 - [x] * Linting does not generate new warnings
 - [x] * I have performed a self-review of my own code
 - [x] * I have put the ticket for review, adding the oort-frontend team to the list of reviewers
 - [ ] * I have commented my code, particularly in hard-to-understand areas
 - [ ] * I have put JSDoc comment in all required places
 - [x] * My changes generate no new warnings
 - [x] * I have included screenshots describing my changes if relevant
 - [ ] * I have selected labels in the Pull Request, according to the changes with code brings
 - [ ] I have made corresponding changes to the documentation ( if required )
 - [x] I have added tests that prove my fix is effective or that my feature works
 - [x] New and existing unit tests pass locally with my changes
 - [ ] Any dependent changes have been merged and published in downstream modules
 
@Matthis-M-ReliefApps
- Changed number of char for search to be 2
 - Is it wanted that no user is fetched until we start searching?
 
request to do for pagination:
query { users(limitItems: 25) { userid firstname lastname emailaddress } totalCount:users { aggregate_regionid_min aggregate_count } }
@MwanPygmay
putting as draft this one
A few things to change:
- it should be possible to use it as multi select or single select ( perhaps an input could do it )
 - in that case, when displaying in a grid, it should also be reflected ( I don't know if using the same type of question would allow it )
 - too many users are fetched at the same time!! We should use pagination. One thing we can do, front-end side, is NOT to use our API, but instead, build a query to CS directly from the front-end. Or, in a first time, edit our back-end so we can do pagination over users list
 - check if in export we have the same format than when displaying as a grid
 - check if other widgets support the question type
 
I'll assign you the ticket on devops
- New type of question: singlepeople, which is a single select
 - Behaviour adapted in grid, can be filtered
 - Fetching users ten by ten, with load on scroll.
 - corrected export.
 - Supported in summary cards and editor
 
@Matthis-M-ReliefApps @MwanPygmay
most of it is working as expected, but I still see one issue 😅
the charts are not working:
We should see similar data than the one we see in other widgets I'm putting back as draft the PR, and putting back in todo the ticket
Still to be done:
- Sorting in the aggregations (sorting in the layouts is already handled).
 - Bug: When filling out a form with the people picker and navigating directly to a grid displaying the people, the names do not appear immediately. The page needs to be reloaded to display the names.