Skip to content
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

Image Block: properly show errors on drag n drop #25004

Merged

Conversation

cpapazoglou
Copy link
Contributor

@cpapazoglou cpapazoglou commented Sep 2, 2020

Description

Fixes: #21559
On error while dragging an image to the editor canvas set the src, id, url attributes to undefined so that the placeholder which contains the errors is shown. It follows the same pattern as with audio block which works already

setAttributes( { src: undefined, id: undefined } );

It kind of replicates #24398

How has this been tested?

Manually tested uploading an image that exceeds the size limit (eg > 2MB) and then uploading an image under the limit.

Screenshots

Before After
SS 2020-09-02 at 12 51 25 SS 2020-09-02 at 12 52 02

Types of changes

Bug fix (non-breaking change which fixes an issue)

Checklist:

  • My code is tested.
  • My code follows the WordPress code style.
  • My code follows the accessibility standards.
  • My code has proper inline documentation.
  • I've included developer documentation if appropriate.
  • I've updated all React Native files affected by any refactorings/renamings in this PR.

Copy link
Contributor

@ntsekouras ntsekouras left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! Thank you @cpapazoglou 💯

@ntsekouras ntsekouras merged commit 6a190cd into WordPress:master Sep 3, 2020
@github-actions github-actions bot added the First-time Contributor Pull request opened by a first-time contributor to Gutenberg repository label Sep 3, 2020
@github-actions
Copy link

github-actions bot commented Sep 3, 2020

Congratulations on your first merged pull request, @cpapazoglou! We'd like to credit you for your contribution in the post announcing the next WordPress release, but we can't find a WordPress.org profile associated with your GitHub account. When you have a moment, visit the following URL and click "link your GitHub account" under "GitHub Username" to link your accounts:

https://profiles.wordpress.org/me/profile/edit/

And if you don't have a WordPress.org account, you can create one on this page:

https://login.wordpress.org/register

Kudos!

@github-actions github-actions bot added this to the Gutenberg 9.0 milestone Sep 3, 2020
@cpapazoglou cpapazoglou deleted the update/image-block-show-errors branch September 14, 2020 12:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Image Affects the Image Block First-time Contributor Pull request opened by a first-time contributor to Gutenberg repository
Projects
None yet
Development

Successfully merging this pull request may close these issues.

No error for exceeding maximum upload size
3 participants