-
Notifications
You must be signed in to change notification settings - Fork 35
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
base: integrationTesting
Are you sure you want to change the base?
Conversation
…arness and add ui.
|
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.
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!
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.
testing: success
code: looks good, but have comments
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 |
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 |
oh okay. I'll still pull out that delete column in this next push and then request a rereview. |
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.
Code LGTM. Been testing the changes alone and while working on dependent stories and haven't been able to run into any errors ✅
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.
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 withreact-admin
'sArrayField
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!
// 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) | ||
} |
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.
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.
// 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{} | ||
} |
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.
If this isn't being used anywhere, then I'd remove
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'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?
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 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.
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.
yea that's definitely fair I'll pull it out
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. |
03f822b
to
dfc6a9a
Compare
B-21966
Summary
This PR adds the Rejected Office users view on the admin page.
This also adds
rejected_on
anddeleted_on
columns to the office users table.Verification Steps for Reviewers
These are to be checked by a reviewer.
How to test
http://adminlocal:3000/system
.“email, first name, last name, Transportation Office, status, reason for rejection, rejected date, roles requested”
*Can use
RejectedOfficeUser
andRequestedOfficeUser
testharness to make needed usersFrontend
officeApp
class or custommin-width
styling is used to hide any states the would not be visible to the user.Backend
Database
Any new migrations/schema changes:
Screenshots
Rejected users Page with partial columns
Rejected users Page with remaining columns