Skip to content
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

Fix errors for manage users Okta pagination #8432

Merged
merged 4 commits into from
Jan 28, 2025

Conversation

mpbrown
Copy link
Collaborator

@mpbrown mpbrown commented Jan 24, 2025

BACKEND PULL REQUEST

Related Issue

Changes Proposed

  • Fixes error caused from Okta's pagination cursor in their list group API

Testing

  • The pagination endpoint is not being used in the app yet, but you can test the GraphQL endpoint directly via Postman with dev5.
  1. Access an organization like "Big Organization" and check the Manage Users page to see their current users. The UI doesn't use the new functionality yet so this should still show the current behavior.
  2. Find your current access token from Application -> Local Storage
  3. In Postman, create a new GraphQL query, select Bearer Token for the Authorization type, and paste in your access token.
  4. Use the following query to test receiving different page numbers and results from search query strings.

pageContent.content is the list of search results itself.

pageContent.totalElements refers to the total number of search results for that specific query. If the search query is empty, this will be the same as the totalUsersInOrg

totalUsersInOrg is needed to distinguish between when we have zero search results for that particular query (totalElements = 0) and when the organization actually has no users configured (rarely seen by support admins but still need to handle that case)

query UsersWithStatusPage {
    usersWithStatusPage(pageNumber: 0, searchQuery: "") {
        pageContent {
            totalElements
            content {
                id
                firstName
                middleName
                lastName
                suffix
                email
                status
            }
        }
        totalUsersInOrg
    }
}

@mpbrown mpbrown marked this pull request as ready for review January 24, 2025 19:00
@mpbrown
Copy link
Collaborator Author

mpbrown commented Jan 27, 2025

Updating this with the GraphQL changes and instructions for testing the endpoint via Postman

@@ -164,28 +164,29 @@ void getPagedUsersAndStatusInCurrentOrg_success() {

checkApiUserWithStatus(users.get(0), "admin@example.com", "Andrews", UserStatus.ACTIVE);
checkApiUserWithStatus(users.get(1), "bobbity@example.com", "Bobberoo", UserStatus.ACTIVE);
checkApiUserWithStatus(
users.get(2), "allfacilities@example.com", "Williams", UserStatus.ACTIVE);
checkApiUserWithStatus(users.get(2), "invalid@example.com", "Irwin", UserStatus.ACTIVE);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did the result of the test change because the user list is now returning in alphabetical order? 🤔

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes! It now relies on the same alphabetical ordering that the current non-paginated endpoint uses

Copy link
Collaborator

@emyl3 emyl3 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left one question about the tests! worked as expected on dev5! Nice fix, Mike!

Copy link
Collaborator

@bobbywells52 bobbywells52 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

EP working as expected for me -- great work on this Mike!

@mpbrown mpbrown added this pull request to the merge queue Jan 28, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Jan 28, 2025
@mpbrown mpbrown added this pull request to the merge queue Jan 28, 2025
Merged via the queue into main with commit d5a8678 Jan 28, 2025
43 checks passed
@mpbrown mpbrown deleted the mike/8103-manage-users-pagination-backend branch January 28, 2025 21:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants