-
Notifications
You must be signed in to change notification settings - Fork 195
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
Don't start uploading image until user clicks submit #1306
Comments
yes. And we need to be careful on the way we deal with the URI. |
Can you clarify? "be careful" is crucial for many things that we do around public user data. |
so currently.
It's indeed an issue for the cruft it creates on the server. If we change the way we do it by just staging in the form and sending the image to the server, we can't have anymore the URI computed on the server side and added to the form. What we could do though, either compute the URI on the JS side (so it is visible in the markdown textarea) and send this by the form, but it could be abused I guess. Not comfortable with this solution. Or maybe we could show a placeholder for the image in the textarea without putting the full URI, I even wonder if we could actually put a thumbnail of the image in this textarea. Then the user presses submit it really generates the real URI on the server side and the right markdown format. |
Another way:
|
Good thoughts. I was just thinking something simple like:
We could also just append the URI to bug description body after form submission (on the server side), there's no real point in adding the markdown on the client I think. We already show a spinner, so there will be visual feedback while the upload is happening. But I like your "Another way" option too. |
@miketaylr thanks. I'm also assigned to #1571, should I assume that this issue (#1306) should be completed before I start making changes on #1571? |
This makes things a bit more functional, using callbacks rather than awkard doFooAndBar methods with so many side effects. This changeset also recurses image downsampling until it's small enough.
(doing a little refactoring while i fix this, the upload stuff is particularly gross -- would be much nicer with Promises, but I don't wanna pull in a polyfill) |
Need to fix failing tests, and see what new tests I can write. |
This makes things a bit more functional, using callbacks rather than awkard doFooAndBar methods with so many side effects. This changeset also recurses image downsampling until it's small enough.
also update after #1306 fix: #1571; add handler for multiple drag and drop events; update some styling fix: #1571; update to use this.hasImage from #1603 fix: #1571; clean up addImageURL(); add _.bind() wrapper in maybeUploadImage() to fix error for this.addImageURL() call fix: #1571; clean up code added for #1574 fix: #1571; remove obsolete handler, handleImageDrop(); for some reason after #1603 this breaks the intended functionality
also update after #1306 fix: #1571; add handler for multiple drag and drop events; update some styling fix: #1571; update to use this.hasImage from #1603 fix: #1571; clean up addImageURL(); add _.bind() wrapper in maybeUploadImage() to fix error for this.addImageURL() call fix: #1571; clean up code added for #1574 fix: #1571; remove obsolete handler, handleImageDrop(); for some reason after #1603 this breaks the intended functionality cleanup: #1571; remove old logic to update text area doc: #1571; update comment for dnd fix
Right now we auto-upload, the motivation being your upload is done while you're filling out details.
We should probably wait until the user hits submit before uploading to a) prevent a ton of unneeded images (people just clicking the button, checking it out) and b) not upload unneeded images if you decide to change it.
The text was updated successfully, but these errors were encountered: