-
Notifications
You must be signed in to change notification settings - Fork 4
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
Frontend File Validation #2690
Frontend File Validation #2690
Conversation
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## develop #2690 +/- ##
===========================================
- Coverage 92.99% 92.59% -0.40%
===========================================
Files 219 239 +20
Lines 4482 5307 +825
Branches 385 469 +84
===========================================
+ Hits 4168 4914 +746
- Misses 242 300 +58
- Partials 72 93 +21
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report in Codecov by Sentry.
|
…2664-ext-msg-2
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 mostly good from my perspective but I did have one note. When a file of mismatched extension is dropped in or selected, the message is displayed and the file is immediately cleared out of the upload box. This is fine but maybe slightly better would be to leave the selected file in the upload box but disable the submission, so the user can compare the extension to the allowed extensions.
@reitermb i'm curious to get your thoughts so I requested your review
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 mostly good from my perspective but I did have one note. When a file of mismatched extension is dropped in or selected, the message is displayed and the file is immediately cleared out of the upload box. This is fine but maybe slightly better would be to leave the selected file in the upload box but disable the submission, so the user can compare the extension to the allowed extensions.
@reitermb i'm curious to get your thoughts so I requested your review
I like that as an enhancement—though I think we should make sure we're keeping behavior consistent in allowing subsets of sections to be submitted. e.g. this scenario:
Keeping the error, keeping the file the user attempted to attach visible, but allowing any passable files that were attached to submit.
If we go down this road it would also actually make things more consistent with the current (slightly bugged) screenreader experience on these file pickers (this relates to #1107). Current behavior is that when this extension error occurs the screenreader still reads the file name even though it's no longer visibly attached.
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.
Only small change but the rest looks good to me 👍
@reitermb, This would be what the frontend looks like if we didnt remove the file from the selector. How do you feel about this? |
It's good with me! If it's easy to add one style override in there we could also make the background of the file picker our light red error color (#f4e3db) to give it a slightly more cohesive error state but definitely just a nice to have here vs an a11y or usability need. I wouldn't add any scope for that tweak. |
@jtimpe @reitermb , We could also do something like the screenshot below. Remove the file, but use it's name in the error message so the user can see the incorrect/missing extension. This also side steps the weird render issue with the icon in the file drop box when we leave the file present in the error state. Let me know your thoughts. |
I'd lean keeping the file name in the normal spot rather than in the error message so that we're not mixing expectations for where to look for it inside the component. It would also make a small a11y issue (file picker errors are only read by screenreaders when they occur rather than anytime the input gets focus) that exists currently slightly higher severity. Re: the icon are there any lightweight options to provide one for the "if else" non-accepted extension case? If so we could throw an error icon of some flavor in there to emphasize the issue even more. |
@elipe17 is this ready for qasp again? |
@ADPennington it is not ready yet. I am hoping to work with Mo today to see if we can figure out why it doesnt work when running in docker. I will ping you to let you know when it is ready again. |
@ADPennington This is what it looks like when the file is removed from the input. |
…2664-ext-msg-2
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.
approving this because it passes a11y review and there is a meaningful message to alert the user that the file uploaded does not have a proper extension. @elipe17 @reitermb @ttran-hub @Smithh-Co
Below are screenshots of different file types being uploaded and results.
non-txt or tdrs filename (unexpected)
Summary of Changes
Pull request closes As a user who submits data files, I want to know if my file upload has the incorrect file extension #2664
How to Test
Deliverables
More details on how deliverables herein are assessed included here.
Deliverable 1: Accepted Features
Checklist of ACs:
lfrohlich
and/oradpennington
confirmed that ACs are met.Deliverable 2: Tested Code
CodeCov Report
comment in PR)CodeCov Report
comment in PR)Deliverable 3: Properly Styled Code
Deliverable 4: Accessible
iamjolly
andttran-hub
using Accessibility Insights reveal any errors introduced in this PR?passes accessibility but image not rendering for unrecognized file types (which is reasonable for this ticket) but also not rendering for recognized but unexpected file types, so needs a follow-on ticket.
Deliverable 5: Deployed
Deliverable 6: Documented
Deliverable 7: Secure
Deliverable 8: User Research
Research product(s) clearly articulate(s):