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

B 22559 add filtering to rejected tab int #14938

Open
wants to merge 20 commits into
base: integrationTesting
Choose a base branch
from

Conversation

KonstanceH
Copy link
Contributor

@KonstanceH KonstanceH commented Mar 4, 2025

B-22559

Summary

This PR adds a filter button/functionality to the rejected users tab on the admin page.

Verification Steps for Reviewers

These are to be checked by a reviewer.

  • Has the branch been pulled in and checked out?
  • Have the BL acceptance criteria been met for this change?
  • Was the CircleCI build successful?
  • Has the code been reviewed from a standards and best practices point of view?

How to test

  1. Create rejected user accounts with different information.
  2. Enter in search information in the main search box
  3. Click the "Add Filters" button to add a filter to that search
  4. Enter any related search information in the new added search boxes
  5. Confirm that the listed information filters based off of the filtered searches.

How to reject office user requests

  1. Go to Office Users login page.
  2. Click "Request Account" fill out necessary info and click submit.
  3. Go to Admins Page http://adminlocal:3000/system.
  4. Create new admin user if none available.
  5. Find requested account.
  6. Give it a rejection reason and reject.

Frontend

  • There are no aXe warnings for UI.
  • This works in Supported Browsers and their phone views (Chrome, Firefox, Edge).
  • There are no new console errors in the browser devtools.
  • There are no new console errors in the test output.
  • If this PR adds a new component to Storybook, it ensures the component is fully responsive, OR if it is intentionally not, a wrapping div using the officeApp class or custom min-width styling is used to hide any states the would not be visible to the user.
  • This change meets the standards for Section 508 compliance.

Backend

Screenshots

Original Search
Screenshot 2025-03-04 at 8 49 39 AM

With filter
Screenshot 2025-03-04 at 8 51 26 AM

@KonstanceH KonstanceH self-assigned this Mar 4, 2025
@KonstanceH KonstanceH added ByteSize M&Ms Team ByteSized M&Ms INTEGRATION Slated for Integration Testing labels Mar 4, 2025
@KonstanceH KonstanceH marked this pull request as ready for review March 4, 2025 15:44
@KonstanceH KonstanceH requested review from a team as code owners March 4, 2025 15:44
Comment on lines +72 to +114
query.Where("office_users.first_name ILIKE ? AND office_users.status = 'REJECTED' OR office_users.last_name ILIKE ? AND office_users.status = 'REJECTED' OR office_users.email ILIKE ? AND office_users.status = 'REJECTED'", nameSearch, nameSearch, nameSearch)
}
},
"emails": func(content string) func(*pop.Query) {
return func(query *pop.Query) {
nameSearch := fmt.Sprintf("%%%s%%", content)
query.Where("office_users.email ILIKE ? AND office_users.status = 'REJECTED'", nameSearch)
}
},
"firstName": func(content string) func(*pop.Query) {
return func(query *pop.Query) {
nameSearch := fmt.Sprintf("%%%s%%", content)
query.Where("office_users.first_name ILIKE ? AND office_users.status = 'REJECTED'", nameSearch)
}
},
"lastName": func(content string) func(*pop.Query) {
return func(query *pop.Query) {
nameSearch := fmt.Sprintf("%%%s%%", content)
query.Where("office_users.last_name ILIKE ? AND office_users.status = 'REJECTED'", nameSearch)
}
},
"offices": func(content string) func(*pop.Query) {
return func(query *pop.Query) {
nameSearch := fmt.Sprintf("%%%s%%", content)
query.Where("transportation_offices.name ILIKE ? AND office_users.status = 'REJECTED'", nameSearch)
}
},
"rejectionReason": func(content string) func(*pop.Query) {
return func(query *pop.Query) {
nameSearch := fmt.Sprintf("%%%s%%", content)
query.Where("office_users.rejection_reason ILIKE ? AND office_users.status = 'REJECTED'", nameSearch)
}
},
"rejectedOn": func(content string) func(*pop.Query) {
return func(query *pop.Query) {
nameSearch := fmt.Sprintf("%%%s%%", content)
query.Where("office_users.rejected_on ILIKE ? AND office_users.status = 'REJECTED'", nameSearch)
}
},
"roles": func(content string) func(*pop.Query) {
return func(query *pop.Query) {
nameSearch := fmt.Sprintf("%%%s%%", content)
query.Where("roles.role_name ILIKE ? AND office_users.status = 'REJECTED'", nameSearch)
Copy link
Contributor

@cameroncaci cameroncaci Mar 4, 2025

Choose a reason for hiding this comment

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

Could you add backend test coverage for explicit checks on these cases?

@JamesHawks224
Copy link
Contributor

Testing:
After an office user has been requested and rejected, if another office user is requested, the rejected office user list becomes empty.

@JamesHawks224
Copy link
Contributor

Testing:
Rejected list has 1 rejected office user. Add filter "first name". Enter a name that is not in the list. Below the results, there's the text: "There are no results for this access code".
This seems strange.

Copy link
Contributor

@JamesHawks224 JamesHawks224 left a comment

Choose a reason for hiding this comment

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

code: looks good.
testing: failed, had some odd behavior. see comments.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ByteSize M&Ms Team ByteSized M&Ms INTEGRATION Slated for Integration Testing
Development

Successfully merging this pull request may close these issues.

5 participants