Merged
Conversation
# Conflicts: # client/modules/IDE/components/FileUploader.jsx
raclim
approved these changes
Jun 22, 2023
Collaborator
|
Thanks so much for working on this! I'm not too sure what might've been happening with the hidden inputs either, but I also think it should be fine without it? I'll merge in #2245 right after as well, and then do the next release :) |
This was referenced Jul 19, 2023
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changes:
FileUploaderto a function component..destroy()method when the component unmounts.This prevents the form HTML from getting added to the page multiple times when the modal is closed and re-opened.The duplicated HTML is no longer an issue after Fix: upload modal closes when clicking inside #2245. Still seems like a good idea to cleanup.acceptandsendingcallbacks don't involve Redux at all so I think it's weird todispatchthem (though it does work just fine). I'm calling them as plain functions instead.ifcondition into a utility functionisS3Upload.localInterceptfunction which usesFileReader. We can use.text()method on thefileobject which is the newer approach.acceptfunction syntax fromPromise.thentoasync/await.ifcondition from the error branch with the magic of the optional chaining?.attachments[]field on the form. I can't see why we would need this and it works without it. The Dropzone already includes the binary data in the form under thefileproperty. Pinging @catarak - maybe she knows why it's there. It's possible that it used to be necessary but isn't anymore.I have verified that this pull request:
npm run lint)npm run test)developbranch.Fixes #123