-
Notifications
You must be signed in to change notification settings - Fork 3
Download digital credential dialog #2830
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
base: main
Are you sure you want to change the base?
Conversation
|
Setting to draft for now as awaiting mitodl/mitxonline#3156 to be released and the @mitodl/mitxonline-api-axios API client to be published. |
gumaerc
left a comment
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 was able to build the API library locally and get this working. The dialog appeared as expected and everything seems to work okay, but I noticed some issues with the styling:
| } from "@mitodl/mitxonline-api-axios/v2" | ||
| import { PartialFactory } from "ol-test-utilities" | ||
|
|
||
| /** |
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 find it odd that there isn't a standard maintained Typescript library we can import for this, but it seems like what most people do is just implement their own type like this.
| "0 3px 8px 0 rgba(37, 38, 43, 0.12), 0 2px 4px 0 rgba(37, 38, 43, 0.10)", | ||
| })) | ||
|
|
||
| const Info = styled.dl({ |
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 there's an issue with overflow with this container. I had AI generate my test data for my credentials to randomize it a bit, and it inserted some longer strings for issued to and criteria. You can see in this screenshot how they overflow outside the right bounds of the container. An overflow: "auto" here will add a scrollbar, but we might want to be more explicit about width to have the text properly wrap.
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.
It's unlikely an awardee name or word in the description/criteria would be long enough to cause the overflow. I've pushed a change to force long words to break, just in case.
| verifiableCredential | ||
| const { identifier, achievement } = credentialSubject | ||
| return ( | ||
| <Dialog |
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 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.
Good catch. I set the document body as the dialog scroll container. I actually think this is the better option for all dialogs.
With default scroll "paper" - The dialog shrinks to preserve the bottom margin. The dialog content becomes y-scrollable (or overflow must be otherwise handled). With MacOS default hidden scrollbars, it may not be obvious that there is more content:
With scroll: "body" - The dialog does not shrink. When content is taller than the window, the body is scrollable to reach the dialog buttons (full height window aligned scroll). This feels more natural and allows touch scroll anywhere on the page.
Screen.Recording.2025-12-22.at.15.52.34.mov
Dialog props: https://mui.com/material-ui/api/dialog/#props
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 actually think this is the better option for all dialogs.
After brief chat with @ChristopherChudzicki and @steven-hatch ... above not true for all dialogs. I'm of the view that we should not need to design for overflow behavior inside dialogs that are generally fixed height and not expected to overflow even small window sizes, ie. the user sizing their window very small is an edge case and we can then just defer to the body scroll. I would use dialog paper scroll where we have list content, or content that is expected to overflow the page. Chris makes the valid point that it is beneficial to see the dialog confirm and cancel buttons always.
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.
Thanks for the changes, it looks good now.
I tried a bit to brainstorm a better UX than "download the JSON file and manually upload it to VerifierPlus." They have a JSON API, but it returns a JSON response and you can't just redirect to their results page. We would have to display the result in our own UI, but that's a discussion for another day.
P.S. Remember to update the API version here once the MITx Online release needed is complete.

What are the relevant tickets?
Description (What does it do?)
Adds the "Download Digital Credential" button and dialog to the certificate page.
In Figma:
MVP:
Screenshots (if appropriate):
How can this be tested?
You'll need mitxonline running locally and to be set up to test certificates:
Create a VerifiableCredential and set it on your certificate (replace
<certificate_uuid>):Additional Context