-
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
Changes from 7 commits
f7d6075
a792c4b
7882003
3a698f0
812ad30
e6a3da8
9cb7122
0c83837
625bd39
1cb6838
485485f
e178422
ffe8864
1115978
75f3ee5
f95d192
a6ce8d3
9ad3181
31e1517
3c3ff4f
e47766c
3452eca
b5ee413
f23eb3c
c818e21
e44c7c0
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -194,6 +194,28 @@ void searchUsersAndStatusInCurrentOrgPaged_success() { | |
checkApiUserWithStatus(users.get(0), "[email protected]", "Bobberoo", UserStatus.ACTIVE); | ||
} | ||
|
||
@Test | ||
@WithSimpleReportOrgAdminUser | ||
void searchUsersAndStatusInCurrentOrgPaged_lastFirstPartial_success() { | ||
initSampleData(); | ||
ManageUsersPageWrapper usersPageWrapper = | ||
_service.getPagedUsersAndStatusInCurrentOrg(0, 10, "be, bo"); | ||
List<ApiUserWithStatus> users = usersPageWrapper.getPageContent().stream().toList(); | ||
assertEquals(1, users.size()); | ||
checkApiUserWithStatus(users.get(0), "[email protected]", "Bobberoo", UserStatus.ACTIVE); | ||
} | ||
|
||
@Test | ||
@WithSimpleReportOrgAdminUser | ||
void searchUsersAndStatusInCurrentOrgPaged_firstLastPartial_success() { | ||
initSampleData(); | ||
ManageUsersPageWrapper usersPageWrapper = | ||
_service.getPagedUsersAndStatusInCurrentOrg(0, 10, "ru re"); | ||
List<ApiUserWithStatus> users = usersPageWrapper.getPageContent().stream().toList(); | ||
assertEquals(1, users.size()); | ||
checkApiUserWithStatus(users.get(0), "[email protected]", "Reynolds", UserStatus.ACTIVE); | ||
} | ||
|
||
@Test | ||
@WithSimpleReportOrgAdminUser | ||
void searchUsersAndStatusInCurrentOrgPaged_pageNumberOutOfBounds_success() { | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,6 @@ | ||
import { Route, Routes } from "react-router-dom"; | ||
import { Navigate, Route, Routes } from "react-router-dom"; | ||
|
||
import { useSelectedFacility } from "../facilitySelect/useSelectedFacility"; | ||
|
||
import ManageOrganizationContainer from "./ManageOrganizationContainer"; | ||
import ManageFacilitiesContainer from "./Facility/ManageFacilitiesContainer"; | ||
|
@@ -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; | ||
|
||
return ( | ||
<div className="prime-home flex-1"> | ||
<div className="grid-container"> | ||
|
@@ -30,6 +36,7 @@ const Settings = () => { | |
element={<ManageSelfRegistrationLinksContainer />} | ||
/> | ||
<Route path="users/:pageNumber" element={<ManageUsersContainer />} /> | ||
<Route index element={<Navigate to={settingsIndexRedirect} />} /> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I forgot we could also add something like the following:
to default it to the users page like before if someone were to navigate to There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 commentThe 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 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ooo ok so I just tested this with an org with multiple facilities and it prompts the user to select the facility dropdown twice... 😓 I'll look in to seeing how we can get this to work for multiple facilities... Feel free to remove this redirect since everything else works as expected and I don't this was even required but a nice to have! My bad, Mike! There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I wonder if that's because we'd have to add the active facility id to the search params like we do in the ManageUsersContainer component. I can test that out and see if it works
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @emyl3 I'm redeploying to dev5 with a fix for this, although it will still prompt the user to select which facility but only once There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ooo wow ok! Thank you for that quick fix. That prompt happening once totally makes sense! |
||
</Routes> | ||
</div> | ||
</div> | ||
|
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!