-
Notifications
You must be signed in to change notification settings - Fork 15
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
Fix: Advanced payments file upload errors #4171
Conversation
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.
Fix: Update file upload modal description
Fix: Update file upload error message
38d38c4
to
8874caf
Compare
@@ -40,7 +44,7 @@ const MSG = defineMessages({ | |||
}, | |||
fileMinDimensionsError: { | |||
id: `${displayName}.fileMinDimensionsError`, | |||
defaultMessage: 'Image dimensions should be at least 120x120px', | |||
defaultMessage: 'Image dimensions should be at least {fileDimension}', |
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.
Took the change to refactor this message to be more dynamical based on the provisioned fileDimension
prop
Hey @iamsamgibbs thanks for your review. Unfortunately had to rebase, so your review got dismissed :( |
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.
Really nice @mmioana, super clean changes and fixes.
CSV message and errors are correct:
And it still accepts a correct input:
I also checked the user avatar error just to be sure, and all good there:
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.
Description
structure
andtoo-large-content
(aka too many rows) errors when uploading a file for theAdvanced Payment
action, by adding a brand new errorDropzoneErrors.CONTENT_TOO_LARGE
. Too make the message more dynamical, thefileOptions
values can now be used in the error message descriptors.react-dropzone
will not consider a file upload failed if the options provided will be fulfilled, but the file upload handler will set an error, so the filename will not be available for display in the error component. Thus, I have added afallbackFileName
property to theFileUploadProps
.Testing
TODO: Let's test the changes are working as expected.
Step 1. Open the
Advanced Payment
actionStep 2. Click the

Upload CSV
button underneath the tableStep 3. Check the modal description has been updated to

Bulk upload up to 400 recipients using a CSV. Use the template to ensure the correct structure, be sure to remove the sample data.
Step 4. Now upload this file content-too-large.csv and make sure you get this error

Step 5. Upload this other file wrong-structure.csv and make sure you get this error

Step 6. Now try this file correct-structure.csv and you should not get any error in the modal, but should see the rows filled in the payment table
Screen.Recording.2025-01-27.at.09.56.54.mov
Important
Some user addresses will not be of known users, but you can change that before uploading the
.csv
, however it is not mandatory.If you have any other testing scenarios coming to mind, please try them out 🎉
Diffs
New stuff ✨
CONTENT_TOO_LARGE
toDropzoneErrors
fallbackFileName
toFileUploadProps
Changes 🏗
isAvatarUploaded
toisFileUploaded
inFileUploadProps
Resolves #3715