-
Notifications
You must be signed in to change notification settings - Fork 290
Add some more error handling and logging to the image upload #2176
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -159,6 +159,19 @@ | |
| this.initImageFields(); | ||
| } | ||
| }, | ||
| 'file.error'() { | ||
| // eslint-disable-next-line | ||
| console.error('The image could not be uploaded'); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This should probably be a snackbar instead of a console error. Something like "Upload failed. Please try again." |
||
| }, | ||
| 'file.progress'(progress) { | ||
| if (progress === 0) { | ||
| // eslint-disable-next-line | ||
| console.log('The image upload has started'); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Probably good to remove this later, but makes sense to have it in the short term. Ideally, there would be a progress bar somewhere to show uploading in progress |
||
| } else if (progress === 1) { | ||
| // eslint-disable-next-line | ||
| console.log('The image upload has finished'); | ||
| } | ||
| }, | ||
| 'file.file_on_disk'(src) { | ||
| if (src) { | ||
| this.insertImageToEditor({ src, alt: '' }); | ||
|
|
||
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.
Those two new watchers are related to a situation when a new file is dropped to the editor area (when uploading an image using the image upload menu, progress and errors will be displayed - I haven't checked yet but can see that implementation is 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.
Follow-up issue #2177