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

Fix: Only show available image sizes #19301

Merged
merged 1 commit into from Dec 23, 2019

Conversation

@jorgefilipecosta
Copy link
Member

jorgefilipecosta commented Dec 23, 2019

Description

Currently, we are always showing the image size picker with all available sizes on the gallery and image block even if a size (or no size at all) is available. This means that on images inserted by URL, where it is not possible to choose a size we were still showing a size picker even though it does nothing.

This PR updates the computation of the available sizes to take into account what sizes are in fact available for the image, or available for some image on the image block.

How has this been tested?

I inserted an image by URL.
I verified the option to choose an image size was not available.
I inserted an image using the media library. I verified the option to choose an image size was available.
I transformed the image inserted by URL into a gallery.
I verified the option to choose an image size was not available in the gallery.
I converted the gallery block back to an image. I multi-selected both image blocks (the one inserted by URL and the one inserted from the media library) and transformed the blocks into a gallery.
I verified the option to choose an image size was available in the gallery.

@mmtr
mmtr approved these changes Dec 23, 2019
Copy link
Contributor

mmtr left a comment

Great follow up 👍. Works as expected on my end.

@jorgefilipecosta jorgefilipecosta merged commit d48ca1c into master Dec 23, 2019
2 checks passed
2 checks passed
pull-request-automation
Details
Travis CI - Pull Request Build Passed
Details
@jorgefilipecosta jorgefilipecosta deleted the fix/only-show-available-image-sizes branch Dec 23, 2019
@youknowriad youknowriad added this to the Gutenberg 7.2 milestone Jan 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.