-
Notifications
You must be signed in to change notification settings - Fork 0
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
feat: frontend expiring certification warnings and sign-in prevention #205
Conversation
f2d8c5e
to
614450e
Compare
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.
There was some talk about whether we should warn on someone not having any certifications in the database. I don't remember the resolution of that discussion. Should anything like that be incorporated into this feature?
@@ -216,4 +227,42 @@ describe("Attestation", () => { | |||
expect(onComplete).not.toHaveBeenCalled(); | |||
jest.useRealTimers(); | |||
}); | |||
|
|||
describe("expiry", () => { |
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.
attestation.test.tsx
now has a test for the expired case. But does it need a test that it shows the about to expire warning? I see that the details of that situation are asserted in expiry.test.tsx
, but I'm thinking about a test that proves that CertificationBoxes
is called.
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.
The assertion on 243
expect(view.getByText("Expired card")).toBeInTheDocument();
is checking text that only appears in a certificate box, so it's guaranteeing it implicitly 👍
return ( | ||
<WarningParagraph | ||
className={className([ | ||
"border-0 light:bg-opacity-40 dark:bg-opacity-30 dark:text-white", |
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.
refactoring suggestion: This is the only use of WarningParagraph
, and these styles don't need to be controlled dynamically, so should they be part of WarningParagraph
instead of passed in as an argument?
And should the background color be controlled by passing in "warning"
or "error"
instead of by giving an extraClassName?
Or, alternatively, WarningParagraph is just 2 divs and some styles, and it's not used anywhere else, so maybe it should be inlined here instead of abstracted?
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.
Inlined 👍 yeah, I honestly don't know why I made this separate in glides (which I copypastaed over here!)
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.
A couple comments, but no re-review needed after.
"mb-4 mt-2 flex flex-row rounded border-0 px-3 py-2", | ||
mode === "warning" && "bg-[#FFDE9E]", | ||
mode === "error" && "bg-[#FF919A]", |
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.
A previous version (when there was the WarningParagraph component) had some extra classes. light:bg-opacity-40 dark:bg-opacity-30 dark:text-white
. Did you mean to remove those in f54a721 ? (Also, I don't think border-0
is needed anymore, since no border should be the default.)
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.
Indeed, all intentional 👍 we don't have light/dark mode and the colors are exact. thanks for catching border-0!
# expires: "2025-01-24" | ||
# } | ||
# ] | ||
# }) |
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.
Left some dead code / test data in here.
This reverts commit 53d4ba4.
Asana Task: 📐 Implement Warnings for Expiring Certifications
Checklist
(x)
Has tests( )
Doesn't need tests( )
Tests deferred (with justification)(x)
Okayed the plan for the feature (e.g. the design files, or the Asana task)( )
Reviewed the feature as implemented (e.g. on dev-green, or saw screenshots)( )
No review needed