-
Notifications
You must be signed in to change notification settings - Fork 60
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
Add frontend support for Manage Users pagination #8371
base: main
Are you sure you want to change the base?
Conversation
52233eb
to
31b2d0a
Compare
c3ecb82
to
3a6b61e
Compare
31b2d0a
to
b2174fb
Compare
3a6b61e
to
d3166f1
Compare
21a5f9b
to
86fc1ca
Compare
cc6a935
to
c7c7652
Compare
c7c7652
to
e6a3da8
Compare
boolean requestedPageOutOfBounds = startIndex > totalSearchResults; | ||
|
||
if (onlyOnePageOfResults || requestedPageOutOfBounds) { | ||
startIndex = 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Had to handle this edge case because I encountered an error when I was on page 7 of all results and entered a search query. The app requested page 7 of the search results and the backend calculated the start index as a higher index than the end index. This caused an illegal argument error when attempting to create the sublist
@khayeni-SL @kenieh I updated dev5 with the styling changes and fixed the bug @emyl3 found. The search is now handled with the url query parameter |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Left a couple nits and one thing I noticed based on our search implementation (Sorry I didn't notice this earlier when you introduced the implementation. 😓)
Looks like this search behaves slightly differently than our other ones.
search.functionality.mov
Let me know what you decide to do. Everything else looks good and works as expected for me.
@@ -29,7 +29,7 @@ const Settings = () => { | |||
path={"self-registration"} | |||
element={<ManageSelfRegistrationLinksContainer />} | |||
/> | |||
<Route path="/" element={<ManageUsersContainer />} /> | |||
<Route path="users/:pageNumber" element={<ManageUsersContainer />} /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I forgot we could also add something like the following:
<Route index element={<Navigate replace to="users/1"/>}/>
to default it to the users page like before if someone were to navigate to /settings
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good idea! I just added this redirect
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated the urls we have configured for the Lighthouse checks since adding this new redirect confused it
This is intended since we want the user search results to appear in that side nav panel @emyl3 |
Just to clarify, I was talking about searching for a user based on "Last Name, First Name" that works in our other searches but not this one. |
Oh whoops I thought the clip was about the dropdown section for selecting the filter! Good callout I'll check with product to confirm for supporting the other search format as well |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested in dev5 and everything is working as expected! I've left a few non-blocking nits. Thanks for your great work on this Mike!
I believe this is intentional so there is not left padding of white space on the first page, but tagging @kenieh to confirm |
@emyl3 I updated the search filtering so now it should handle more flexible search queries like the results page does, thanks for finding that! |
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have tested the changes in dev5. LGTM!
FRONTEND PULL REQUEST
Related Issue
Changes Proposed
settings/users/:pageNumber
so that the page number can be retrieved from the url paramsTesting
Access organization account
from the support admin dashboardBig Organization
, type in "test" for justification, and clickAccess data
Screenshots
Page 1 of results
![image](https://private-user-images.githubusercontent.com/23287037/410083560-53e837ab-e60c-4d69-9fa6-e5b02ef0b470.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkyMjg1MDIsIm5iZiI6MTczOTIyODIwMiwicGF0aCI6Ii8yMzI4NzAzNy80MTAwODM1NjAtNTNlODM3YWItZTYwYy00ZDY5LTlmYTYtZTViMDJlZjBiNDcwLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTAlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjEwVDIyNTY0MlomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWI0YjQwZmVhMjAxMDY2NmYwNjk2MDRhOTBmMmMzZWIxMDAyNWE5Y2MyMTI5ZGUzZjBkMTE2YTNhZGQ0ZWE2MjMmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.pKcS4SXBeanDrd83dGbimzSChtj0YILGirJdU1D-zHE)
Page 5 of results
![image](https://private-user-images.githubusercontent.com/23287037/410083486-c672270b-e953-4efc-996b-8eedac4ecfa0.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkyMjg1MDIsIm5iZiI6MTczOTIyODIwMiwicGF0aCI6Ii8yMzI4NzAzNy80MTAwODM0ODYtYzY3MjI3MGItZTk1My00ZWZjLTk5NmItOGVlZGFjNGVjZmEwLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTAlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjEwVDIyNTY0MlomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTdhMDc0YmM0NGI0NWIyZjhhMjdkMGYzNzk5YWE5OTFkMTJlMjViMDY1Njk5ZTBjMWY5ZmRjYWQ5YTc1ZWQxM2YmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.Yzfm6OkIGWl4jl5o1E4Rx2mZmgUgUc-INDFXN2qP1Mw)
Last page of results
![image](https://private-user-images.githubusercontent.com/23287037/410083635-b5ec8ce8-44a7-4ee8-8ea3-8e5859a8cf22.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkyMjg1MDIsIm5iZiI6MTczOTIyODIwMiwicGF0aCI6Ii8yMzI4NzAzNy80MTAwODM2MzUtYjVlYzhjZTgtNDRhNy00ZWU4LThlYTMtOGU1ODU5YThjZjIyLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTAlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjEwVDIyNTY0MlomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTA1MmYxZjFmNTRjMjM2N2NkNTNkMzFkNjA1ZjRkNmUwNDNhOGYwZTFjZWM2MjVjZmMwNGRmODdkMjg2YzViY2ImWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.0936GMf2n_UW0X4lbT3rOi6eyDnM_1vdv03FoMaScOY)
Search results with multiple pages
![image](https://private-user-images.githubusercontent.com/23287037/410083961-4c3606a6-55cb-4e4c-ba38-dbbf4813c54c.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkyMjg1MDIsIm5iZiI6MTczOTIyODIwMiwicGF0aCI6Ii8yMzI4NzAzNy80MTAwODM5NjEtNGMzNjA2YTYtNTVjYi00ZTRjLWJhMzgtZGJiZjQ4MTNjNTRjLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTAlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjEwVDIyNTY0MlomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTlkYjdhM2YxNDZhYzE1OGQ5M2QxY2Q2NzM4ZjcwYjdlZDAwN2U3YWYyMWFhNmE1NTkwMjU2MmY3ZjdmYjRlYTMmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0._5H1iVZ0rzC0FbftfdsFLmgrk3jB9DM1Jq_6rqy92QI)
Search results with single result page
![image](https://private-user-images.githubusercontent.com/23287037/410084203-dd0da0b1-d76a-46ba-8e5a-9e2dd3492143.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkyMjg1MDIsIm5iZiI6MTczOTIyODIwMiwicGF0aCI6Ii8yMzI4NzAzNy80MTAwODQyMDMtZGQwZGEwYjEtZDc2YS00NmJhLThlNWEtOWUyZGQzNDkyMTQzLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTAlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjEwVDIyNTY0MlomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPThhYzdjOTJjN2MzYTZlMmM0MTMzNzYwMDdmZWI4ZDIxNjM0YWM0YjU2OWJhY2E2MDA1NmNkNjc0Y2I2NzdmYTAmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.smgcC2KA-KcGWye6X2nOJR-g-7HGFptqjutWDlnds68)
No results found
![image](https://private-user-images.githubusercontent.com/23287037/407850949-012ccb86-f2e8-4a2f-b777-042cf2089e05.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkyMjg1MDIsIm5iZiI6MTczOTIyODIwMiwicGF0aCI6Ii8yMzI4NzAzNy80MDc4NTA5NDktMDEyY2NiODYtZjJlOC00YTJmLWI3NzctMDQyY2YyMDg5ZTA1LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTAlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjEwVDIyNTY0MlomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWNhYjBiMzM0NjFiY2RhZTViZjM1NGU1MGM5YzU1NTRmMTNlY2RiNzY3ZmU3NzAzODIzMTZlNDI1MDU2MzI1MjImWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.Pypk2l715Y1DedQKn3uolgB4gUu8mlumNepWF3vri00)