-
Notifications
You must be signed in to change notification settings - Fork 25
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
Tbolt/3298 affiliation expiration #3360
Conversation
Codecov Report
@@ Coverage Diff @@
## development #3360 +/- ##
===============================================
- Coverage 88.96% 88.67% -0.30%
===============================================
Files 282 282
Lines 5583 5589 +6
Branches 1071 1071
===============================================
- Hits 4967 4956 -11
- Misses 563 580 +17
Partials 53 53
Continue to review full report at Codecov.
|
This deploy was cleaned up. |
api/routes/affiliations/patch.js
Outdated
const audit = auditor(statusToAction(status), request); | ||
|
||
|
||
// Lookup role name and set expiration date accordingly |
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.
@thetif @knollfear I thought this would work but there's a problem with my approach here: We pass in -1
as the roleId
when we are revoking or denying a role. So ill come up with a better way to handle that case. open to ideas
Also do we want to not set an expiration date when roles are denied/revoked?
Edit: Also, is there a way I can add tests for this? We don't return anything in the response, so either I would have to check the database or do another GET, both seem like weird patterns though.
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.
In my opinion if the role is revoked we can leave the expiration alone. If they are later reinstated, we should be sure not to (I think) extend their expiration date.
As for testing this, you could mock the DB calls and then assert that they had in fact been called. However, I think we are moving to a "live" test DB so mocking it for a week or 2 might be unnecessary.
when I logged in as stateadmin I got this screen, when I clicked ok, it went through to the Alaska dashboard, but we shouldn't be seeing this at all if they only have 1 affiliation Actually the user does have two states to choose between, but they aren't showing up. Then when I try to go to the Alaska Dashboard, all of tabs are empty because the get requests fail. |
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.
looks good.
api/routes/affiliations/patch.js
Outdated
const audit = auditor(statusToAction(status), request); | ||
|
||
|
||
// Lookup role name and set expiration date accordingly |
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.
In my opinion if the role is revoked we can leave the expiration alone. If they are later reinstated, we should be sure not to (I think) extend their expiration date.
As for testing this, you could mock the DB calls and then assert that they had in fact been called. However, I think we are moving to a "live" test DB so mocking it for a week or 2 might be unnecessary.
…lt/3298-affiliation-expiration � Conflicts: � CHANGELOG.md � api/routes/affiliations/patch.js � api/seeds/shared/set-up-users.js
…ons.js Co-authored-by: Michael Knoll <42681520+knollfear@users.noreply.github.com>
Tested by:
|
@thetif Please re-test. Those issues are resolved now |
Tested by:
|
@tbolt this doesn't have to be approved by Jerome so once we have confirmed what the expiration date will be, you can merge it. |
Resolves #3298
Description-
expires_at
columnexpires_at
dates based on acceptance criteriaAcceptance criteria
Steps to manually verify this change...
I believe the only way to verify this change would be to have a build running locally and inspect the database after approving new affiliations
June 30th 2022
in the databaseThis pull request is ready to review when...
This pull request can be merged when…