[File uploader] Single upload reruns only once#2122
Merged
karriebear merged 2 commits intostreamlit:feature/file-uploaderfrom Oct 8, 2020
Merged
[File uploader] Single upload reruns only once#2122karriebear merged 2 commits intostreamlit:feature/file-uploaderfrom
karriebear merged 2 commits intostreamlit:feature/file-uploaderfrom
Conversation
26fefe7 to
517c8ba
Compare
517c8ba to
b7df4fa
Compare
akrolsmir
approved these changes
Oct 8, 2020
| self.send_error(400, reason=str(e)) | ||
| return | ||
|
|
||
| LOGGER.debug(f"{len(files)} file(s) received for session {session_id} widget {widget_id}") |
Contributor
There was a problem hiding this comment.
Is this something we want permanently, or will we remove this after debugging the issue Adrien encountered? (If the latter, it'd be nice to add a TODO here and below)
| @@ -111,7 +111,7 @@ class FileUploader extends React.PureComponent<Props, State> { | |||
|
|
|||
| if (!multipleFiles && this.state.files.length) { | |||
| // Only one file is allowed. Delete existing file. | |||
Contributor
There was a problem hiding this comment.
Is this comment no longer accurate? What is the difference between "delete" and "removeFile" anyways?
Contributor
Author
There was a problem hiding this comment.
It's kind of accurate. delete will make the delete HTTP request and removeFile just removes it from the screen.
| @@ -37,11 +37,13 @@ export class FileUploadClient extends HttpClient { | |||
| widgetId: string, | |||
Contributor
There was a problem hiding this comment.
nit: extra space in line 35, also add "replace" to the docstring?
karriebear
added a commit
that referenced
this pull request
Oct 8, 2020
* File Uploader (#2013) * Copying over * Linting * Missed copy - Hashing + Media support * Sidebar UX cleanup * Testing cleanup * linting + cleanup * E2E * linting * Fix unit tests * Get snapshots * Styling cleanup * File sizing + state updating cleanup * File sizing + state updating cleanup * button cleanup + file deletion * Separate dropzone instructions into a new file * Separate dropzone instructions into a new file * Linting * Small/Error text styled componenting * a11y uploaded files * Spacing var * Whoops + button updates * Multile file uploader should return [] when empty * Visual design updates * linting/cleanup * Revert rejectFiles change * Fix tests * Address PR comments * Fix test * addressing quick pr comments * Whoops * fix tests * Readable tests * setState with function * [File Uploader] Update deprecation (#2123) * Update deprecation * Update test for deprecation * Fix docstrings (#2121) * [File Uploader] Missed visual tweaks (#2124) * Quick visual tweaks * linting * [File uploader] Single upload reruns only once (#2122) * Single file uploader replaces in 1 request * Update comments
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.
Single file uploader should not cause 2 reruns. Previously updating on delete and on add. Now when replacing a file, delete and add is one action
Contribution License Agreement
By submitting this pull request you agree that all contributions to this project are made under the Apache 2.0 license.