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 21966 add rejected admin int #14694

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

Conversation

KonstanceH
Copy link
Contributor

@KonstanceH KonstanceH commented Jan 30, 2025

B-21966

Summary

This PR adds the Rejected Office users view on the admin page.
This also adds rejected_on and deleted_on columns to the office users table.

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. 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.
  7. Go to "Rejected Users" tab and confirm that you see these fields:
    “email, first name, last name, Transportation Office, status, reason for rejection, rejected date, roles requested”
  8. Confirm that you can sort by the header's columns

*Can use RejectedOfficeUser and RequestedOfficeUser testharness to make needed users

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

Database

Any new migrations/schema changes:

  • Follows our guidelines for Zero-Downtime Deploys.
  • Have been communicated to #g-database.
  • Secure migrations have been tested following the instructions in our docs.

Screenshots

Rejected users Page with partial columns

Screenshot 2025-01-30 at 12 54 58 AM

Rejected users Page with remaining columns

Screenshot 2025-01-30 at 12 55 07 AM

@KonstanceH KonstanceH self-assigned this Jan 30, 2025
@KonstanceH KonstanceH added ByteSize M&Ms Team ByteSized M&Ms INTEGRATION Slated for Integration Testing labels Jan 30, 2025
@robot-mymove
Copy link

robot-mymove commented Jan 30, 2025

Warnings
⚠️

Files located in legacy directories (src/shared or src/scenes) have
been edited. Are you sure you don’t want to also relocate them to the new file structure?

View the frontend file org ADR for more information

Generated by 🚫 dangerJS against 88a3faf

@KonstanceH KonstanceH marked this pull request as ready for review January 30, 2025 14:26
@KonstanceH KonstanceH requested review from a team as code owners January 30, 2025 14:26
Copy link
Contributor

@danieljordan-caci danieljordan-caci left a comment

Choose a reason for hiding this comment

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

So I just finished some work for the requested office users and searching by transpo office (which is a requirement for this feature as well I see) and ran into searching nested object values through FetchMany not being possible. Had to refactor.

Could you look at this PR and see how I did the list function and copy that over (except for change the status from REQUESTED to REJECTED)? I just don't want the next dev to have to refactor it when it could be tackled in this one.

Also, I don't think you need the deleted_on column. We are hard deleting users, not soft.

Thoughts? Def welcome to hear them!

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.

testing: success
code: looks good, but have comments

Makefile Outdated Show resolved Hide resolved
.circleci/config.yml Outdated Show resolved Hide resolved
.gitlab-ci.yml Outdated Show resolved Hide resolved
@KonstanceH
Copy link
Contributor Author

So I just finished some work for the requested office users and searching by transpo office (which is a requirement for this feature as well I see) and ran into searching nested object values through FetchMany not being possible. Had to refactor.

Could you look at this PR and see how I did the list function and copy that over (except for change the status from REQUESTED to REJECTED)? I just don't want the next dev to have to refactor it when it could be tackled in this one.

Also, I don't think you need the deleted_on column. We are hard deleting users, not soft.

Thoughts? Def welcome to hear them!

Ahh okay I'll get rid of the deleted_on column. But for the transportationOffice search we took that off the feature AC because Paul was gonna add it to a new feature(E-06352) to be handled. I want to say I can just add your changes to my PR here but we had a whole meeting about it so before I say yes let me just get some guidance from my scrum master. I think we can either add a new story to handle it on this feature or just add it on to this story's AC.

@danieljordan-caci
Copy link
Contributor

So I just finished some work for the requested office users and searching by transpo office (which is a requirement for this feature as well I see) and ran into searching nested object values through FetchMany not being possible. Had to refactor.
Could you look at this PR and see how I did the list function and copy that over (except for change the status from REQUESTED to REJECTED)? I just don't want the next dev to have to refactor it when it could be tackled in this one.
Also, I don't think you need the deleted_on column. We are hard deleting users, not soft.
Thoughts? Def welcome to hear them!

Ahh okay I'll get rid of the deleted_on column. But for the transportationOffice search we took that off the feature AC because Paul was gonna add it to a new feature(E-06352) to be handled. I want to say I can just add your changes to my PR here but we had a whole meeting about it so before I say yes let me just get some guidance from my scrum master. I think we can either add a new story to handle it on this feature or just add it on to this story's AC.

Hm. Okay. Well still, if that work is coming you can still roll forward with the refactor, just forego all the stuff needed for the transpo office. If that makes sense? Let me know if you're still confused haha

@KonstanceH
Copy link
Contributor Author

So I just finished some work for the requested office users and searching by transpo office (which is a requirement for this feature as well I see) and ran into searching nested object values through FetchMany not being possible. Had to refactor.
Could you look at this PR and see how I did the list function and copy that over (except for change the status from REQUESTED to REJECTED)? I just don't want the next dev to have to refactor it when it could be tackled in this one.
Also, I don't think you need the deleted_on column. We are hard deleting users, not soft.
Thoughts? Def welcome to hear them!

Ahh okay I'll get rid of the deleted_on column. But for the transportationOffice search we took that off the feature AC because Paul was gonna add it to a new feature(E-06352) to be handled. I want to say I can just add your changes to my PR here but we had a whole meeting about it so before I say yes let me just get some guidance from my scrum master. I think we can either add a new story to handle it on this feature or just add it on to this story's AC.

Hm. Okay. Well still, if that work is coming you can still roll forward with the refactor, just forego all the stuff needed for the transpo office. If that makes sense? Let me know if you're still confused haha

Yea I can do that! Sorry I'm in this agile training and I'm terrible at multitasking(trying to understand multiple things at once lol). Once this is over if I have any questions I'll message you in slack.

@danieljordan-caci
Copy link
Contributor

Ahh okay I'll get rid of the deleted_on column. But for the transportationOffice search we took that off the feature AC because Paul was gonna add it to a new feature(E-06352) to be handled. I want to say I can just add your changes to my PR here but we had a whole meeting about it so before I say yes let me just get some guidance from my scrum master. I think we can either add a new story to handle it on this feature or just add it on to this story's AC.

Hm. Okay. Well still, if that work is coming you can still roll forward with the refactor, just forego all the stuff needed for the transpo office. If that makes sense? Let me know if you're still confused haha

Yea I can do that! Sorry I'm in this agile training and I'm terrible at multitasking(trying to understand multiple things at once lol). Once this is over if I have any questions I'll message you in slack.

Sounds good! Yeah I'm in here too.. Not the most entertaining material haha

JamesHawks224
JamesHawks224 previously approved these changes Jan 30, 2025
@danieljordan-caci danieljordan-caci self-requested a review January 31, 2025 17:45
@danieljordan-caci
Copy link
Contributor

So I just finished some work for the requested office users and searching by transpo office (which is a requirement for this feature as well I see) and ran into searching nested object values through FetchMany not being possible. Had to refactor.
Could you look at this PR and see how I did the list function and copy that over (except for change the status from REQUESTED to REJECTED)? I just don't want the next dev to have to refactor it when it could be tackled in this one.
Also, I don't think you need the deleted_on column. We are hard deleting users, not soft.
Thoughts? Def welcome to hear them!

Ahh okay I'll get rid of the deleted_on column. But for the transportationOffice search we took that off the feature AC because Paul was gonna add it to a new feature(E-06352) to be handled. I want to say I can just add your changes to my PR here but we had a whole meeting about it so before I say yes let me just get some guidance from my scrum master. I think we can either add a new story to handle it on this feature or just add it on to this story's AC.

Hm. Okay. Well still, if that work is coming you can still roll forward with the refactor, just forego all the stuff needed for the transpo office. If that makes sense? Let me know if you're still confused haha

Yea I can do that! Sorry I'm in this agile training and I'm terrible at multitasking(trying to understand multiple things at once lol). Once this is over if I have any questions I'll message you in slack.

Hey disregard these comments - lot of this work was done in B-21961 and I'm just going to have that roll forward and close my PR. Turns out when it comes to sorting AND filtering nested objects, Pop/Buffalo is not a very flexible choice because we need the DISTINCT keyword which it doesn't support natively. Just FYI - re-requesting review and I'll take a look at this as-is.

@KonstanceH
Copy link
Contributor Author

So I just finished some work for the requested office users and searching by transpo office (which is a requirement for this feature as well I see) and ran into searching nested object values through FetchMany not being possible. Had to refactor.
Could you look at this PR and see how I did the list function and copy that over (except for change the status from REQUESTED to REJECTED)? I just don't want the next dev to have to refactor it when it could be tackled in this one.
Also, I don't think you need the deleted_on column. We are hard deleting users, not soft.
Thoughts? Def welcome to hear them!

Ahh okay I'll get rid of the deleted_on column. But for the transportationOffice search we took that off the feature AC because Paul was gonna add it to a new feature(E-06352) to be handled. I want to say I can just add your changes to my PR here but we had a whole meeting about it so before I say yes let me just get some guidance from my scrum master. I think we can either add a new story to handle it on this feature or just add it on to this story's AC.

Hm. Okay. Well still, if that work is coming you can still roll forward with the refactor, just forego all the stuff needed for the transpo office. If that makes sense? Let me know if you're still confused haha

Yea I can do that! Sorry I'm in this agile training and I'm terrible at multitasking(trying to understand multiple things at once lol). Once this is over if I have any questions I'll message you in slack.

Hey disregard these comments - lot of this work was done in B-21961 and I'm just going to have that roll forward and close my PR. Turns out when it comes to sorting AND filtering nested objects, Pop/Buffalo is not a very flexible choice because we need the DISTINCT keyword which it doesn't support natively. Just FYI - re-requesting review and I'll take a look at this as-is.

oh okay. I'll still pull out that delete column in this next push and then request a rereview.

brooklyn-welsh
brooklyn-welsh previously approved these changes Feb 3, 2025
Copy link
Contributor

@brooklyn-welsh brooklyn-welsh left a comment

Choose a reason for hiding this comment

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

Code LGTM. Been testing the changes alone and while working on dependent stories and haven't been able to run into any errors ✅

Copy link
Contributor

@danieljordan-caci danieljordan-caci left a comment

Choose a reason for hiding this comment

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

Couple of things:

  • the font styling is different for the roles column, this is likely due to you using <p> which has styling overrides in the app, I would try and copy what the requested office user page is doing with react-admin's ArrayField component to match styling

  • I think this SHOULD be fixed once you make the above change, but I'd like to try and get rid of the side scrolling behavior if possible. It seems the font being bigger/different is causing some sizing differences when it should be similar to the other office user pages

Screen.Recording.2025-02-04.at.9.46.45.AM.mov

Let me know if any of that doesn't make sense. Re-request when you got it all fixed up! Thanks!

Comment on lines +25 to +30
// RejectedOfficeUserFetcherPop is the exported interface for fetching a single office user
//
//go:generate mockery --name RejectedOfficeUserFetcherPop
type RejectedOfficeUserFetcherPop interface {
FetchRejectedOfficeUserByID(appCtx appcontext.AppContext, id uuid.UUID) (models.OfficeUser, error)
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this being used? I don't see it being used anywhere in your code - I remember I removed some unused funcs from the requested side so if this is copied from that then I'm 99% sure this function isn't being used.

Comment on lines +24 to +58
// FetchRejectedOfficeUser fetches an office user given a slice of filters
func (o *rejectedOfficeUserFetcher) FetchRejectedOfficeUser(appCtx appcontext.AppContext, filters []services.QueryFilter) (models.OfficeUser, error) {
var rejectedOfficeUser models.OfficeUser
err := o.builder.FetchOne(appCtx, &rejectedOfficeUser, filters)
return rejectedOfficeUser, err
}

// NewAdminUserFetcher return an implementation of the AdminUserFetcher interface
func NewRejectedOfficeUserFetcher(builder rejectedOfficeUserQueryBuilder) services.RejectedOfficeUserFetcher {
return &rejectedOfficeUserFetcher{builder}
}

type rejectedOfficeUserFetcherPop struct {
}

// FetchOfficeUserByID fetches an office user given an ID
func (o *rejectedOfficeUserFetcherPop) FetchRejectedOfficeUserByID(appCtx appcontext.AppContext, id uuid.UUID) (models.OfficeUser, error) {
var officeUser models.OfficeUser
err := appCtx.DB().Eager("TransportationOffice").Find(&officeUser, id)
if err != nil {
switch err {
case sql.ErrNoRows:
return models.OfficeUser{}, apperror.NewNotFoundError(id, "looking for OfficeUser")
default:
return models.OfficeUser{}, apperror.NewQueryError("OfficeUser", err, "")
}
}

return officeUser, err
}

// NewOfficeUserFetcherPop return an implementation of the OfficeUserFetcherPop interface
func NewRejectedOfficeUserFetcherPop() services.RejectedOfficeUserFetcherPop {
return &rejectedOfficeUserFetcherPop{}
}
Copy link
Contributor

Choose a reason for hiding this comment

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

If this isn't being used anywhere, then I'd remove

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm using this for the testharness piece but before I remove all of that would it make sense to keep it in case the users ever want to search one rejected/requested user?

Copy link
Contributor

Choose a reason for hiding this comment

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

I think if it isn't being used in the code for business logic, then it's just tech debt to me. But.. That's just my opinion.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yea that's definitely fair I'll pull it out

@KonstanceH
Copy link
Contributor Author

Couple of things:

  • the font styling is different for the roles column, this is likely due to you using <p> which has styling overrides in the app, I would try and copy what the requested office user page is doing with react-admin's ArrayField component to match styling
  • I think this SHOULD be fixed once you make the above change, but I'd like to try and get rid of the side scrolling behavior if possible. It seems the font being bigger/different is causing some sizing differences when it should be similar to the other office user pages

Screen.Recording.2025-02-04.at.9.46.45.AM.mov
Let me know if any of that doesn't make sense. Re-request when you got it all fixed up! Thanks!

I'm working on getting the font the same. But there's 2 added columns in the rejected table vs the requested so I think that's why it's scrolling.

@danieljordan-caci
Copy link
Contributor

Couple of things:

  • the font styling is different for the roles column, this is likely due to you using <p> which has styling overrides in the app, I would try and copy what the requested office user page is doing with react-admin's ArrayField component to match styling
  • I think this SHOULD be fixed once you make the above change, but I'd like to try and get rid of the side scrolling behavior if possible. It seems the font being bigger/different is causing some sizing differences when it should be similar to the other office user pages

Screen.Recording.2025-02-04.at.9.46.45.AM.mov
Let me know if any of that doesn't make sense. Re-request when you got it all fixed up! Thanks!

I'm working on getting the font the same. But there's 2 added columns in the rejected table vs the requested so I think that's why it's scrolling.

That's fair! I'm hoping that it'll fix when you adjust that font because I believe it should condense it down a lot. But... We'll see.

@KonstanceH KonstanceH force-pushed the B-21966-Add-Rejected-Admin-INT branch 2 times, most recently from 03f822b to dfc6a9a Compare February 5, 2025 20:22
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