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

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.

@jorgefilipecosta jorgefilipecosta added [Type] Bug An existing feature does not function as intended [Feature] Media Anything that impacts the experience of managing media [Block] Image Affects the Image Block [Block] Gallery Affects the Gallery Block - used to display groups of images labels Dec 23, 2019
Copy link
Contributor

@mmtr mmtr left a comment

Choose a reason for hiding this comment

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

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

@jorgefilipecosta jorgefilipecosta merged commit d48ca1c into master Dec 23, 2019
@jorgefilipecosta jorgefilipecosta deleted the fix/only-show-available-image-sizes branch December 23, 2019 15:32
@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
Labels
[Block] Gallery Affects the Gallery Block - used to display groups of images [Block] Image Affects the Image Block [Feature] Media Anything that impacts the experience of managing media [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants