-
Notifications
You must be signed in to change notification settings - Fork 61
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
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!
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.
LGTM! Left a comment about the redirect fix I initially proposed 😓 Everything else works as expected!! Thank you for all your work on this.
f23eb3c
@@ -10,6 +12,10 @@ import { ManageSelfRegistrationLinksContainer } from "./ManageSelfRegistrationLi | |||
import "./Settings.scss"; | |||
|
|||
const Settings = () => { | |||
const [facility] = useSelectedFacility(); | |||
const activeFacilityId = facility?.id || ""; | |||
const settingsIndexRedirect = "/settings/users/1?" + activeFacilityId; |
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.
Don't we need the "/settings/users/1?facility=" + activeFacilityId here? (specifically adding facility=
?
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.
😬 face palm yes we definitely should need that here! Somehow the redirect still worked but that's probably why it's still hitting that other facility select screen. Thank you for catching this!
|
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.
checked that change locally! and retested the other functionality on dev5 -- LGTM!!! Thank you, Mike!!! 🤩
Design final approval from @kenieh on Slack linked here ✅ |
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.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk0NjU0NTEsIm5iZiI6MTczOTQ2NTE1MSwicGF0aCI6Ii8yMzI4NzAzNy80MTAwODM1NjAtNTNlODM3YWItZTYwYy00ZDY5LTlmYTYtZTViMDJlZjBiNDcwLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTMlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjEzVDE2NDU1MVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWI2YjgxY2U3NzliMGM4MmY1ZmNmMjBlZWNmMTYwMDdjMmRjMmUxNWZkZjE4NDc0N2ZjZDJhNDYwZjdkMzFhMDImWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.5PvWuys_uvGuC5rmLpt6coLEJhdGXjWW14cU0Ie7kHA)
Page 5 of results
![image](https://private-user-images.githubusercontent.com/23287037/410083486-c672270b-e953-4efc-996b-8eedac4ecfa0.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk0NjU0NTEsIm5iZiI6MTczOTQ2NTE1MSwicGF0aCI6Ii8yMzI4NzAzNy80MTAwODM0ODYtYzY3MjI3MGItZTk1My00ZWZjLTk5NmItOGVlZGFjNGVjZmEwLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTMlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjEzVDE2NDU1MVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTFjYTljNGQ0Zjk2ZTdhMWM5MDBjMjIzZjhkMDY0ZjU5NjY1NzlmNTgwZjhiOTRkYTM4YmJiOGEwYmQxYWM1NWQmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.9wwOb_3nMNXbhaPsk8_bcLEfp-S1K_a6fjNRSXGqP6E)
Last page of results
![image](https://private-user-images.githubusercontent.com/23287037/410083635-b5ec8ce8-44a7-4ee8-8ea3-8e5859a8cf22.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk0NjU0NTEsIm5iZiI6MTczOTQ2NTE1MSwicGF0aCI6Ii8yMzI4NzAzNy80MTAwODM2MzUtYjVlYzhjZTgtNDRhNy00ZWU4LThlYTMtOGU1ODU5YThjZjIyLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTMlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjEzVDE2NDU1MVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTZmYzdmODE1NWVkMjFmYmQzODllMGU2M2IxYzA2YzdlZWI1MDU5NzU2NDZiN2I1MDhjZWMzNjBkNjEyNzNjYTMmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.goqE3B0DwBL5LN925SKHrN-o1nK5o04CLoFxC5PUtN8)
Search results with multiple pages
![image](https://private-user-images.githubusercontent.com/23287037/410083961-4c3606a6-55cb-4e4c-ba38-dbbf4813c54c.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk0NjU0NTEsIm5iZiI6MTczOTQ2NTE1MSwicGF0aCI6Ii8yMzI4NzAzNy80MTAwODM5NjEtNGMzNjA2YTYtNTVjYi00ZTRjLWJhMzgtZGJiZjQ4MTNjNTRjLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTMlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjEzVDE2NDU1MVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTJjODlhYTM1ZjRlYjk2MGU0M2IxNjlmYjJiNTc3NDBhMDc3NmZhNTEwMDkxYWU5ZWFjMTcxZmIxMGEwNGUyMjcmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.tKCySAmc2cBeWOXSLquHExRS0LIc-ZC6xyZ0i_VsVo8)
Search results with single result page
![image](https://private-user-images.githubusercontent.com/23287037/410084203-dd0da0b1-d76a-46ba-8e5a-9e2dd3492143.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk0NjU0NTEsIm5iZiI6MTczOTQ2NTE1MSwicGF0aCI6Ii8yMzI4NzAzNy80MTAwODQyMDMtZGQwZGEwYjEtZDc2YS00NmJhLThlNWEtOWUyZGQzNDkyMTQzLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTMlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjEzVDE2NDU1MVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWU5ZTBlYzdiNDg1MjVhYzUyNWRlNTJlNWY5YmMyZWU0NjU2Y2I0MGI0N2VhOTc4YjJkYzhiYzczZTZhZTg0OWImWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.lLnCHKF-qIke_iO6Zkeds9K0GWx9QdOnmC2EfM9zm64)
No results found
![image](https://private-user-images.githubusercontent.com/23287037/407850949-012ccb86-f2e8-4a2f-b777-042cf2089e05.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk0NjU0NTEsIm5iZiI6MTczOTQ2NTE1MSwicGF0aCI6Ii8yMzI4NzAzNy80MDc4NTA5NDktMDEyY2NiODYtZjJlOC00YTJmLWI3NzctMDQyY2YyMDg5ZTA1LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTMlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjEzVDE2NDU1MVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTA5NzFlNzM3ODMwMTRlMTdlOTYzZDdhODYwODFkNWE4Y2RhNzJkM2Y3OGM5MmU2M2Y5NDhiMmZkMjY3ODJhNzkmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.XRq2Ht9TIP2tcE_dwkytIC1QkPG-G7nNOjG9U0egUGM)