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 gallery size labels #11124

Conversation

mkevins
Copy link
Contributor

@mkevins mkevins commented Jan 22, 2020

Related PRs

gutenberg: WordPress/gutenberg#19800
gutenberg-mobile: wordpress-mobile/gutenberg-mobile#1798
WordPress-iOS: wordpress-mobile/WordPress-iOS#13257

Description

This PR fixes the image size option labels in the gallery block settings. The image size options were added for web, but on mobile, the labels were undefined. This resulted in "blank" buttons.

How has this been tested?

Tested on Android via WordPress-Android, and iOS via WordPress-iOS:

Steps:

  • Create a gallery block with some images
  • Tap the gallery
  • Tap the gallery settings icon (the gear)
  • Tap "Images size"

Expected result:

  • The app should not crash
  • The image size options should be visible in the menu

Steps:

  • Tap one of the image size options (e.g. thumbnail)

Expected result:

The image resolution should change (to a lower quality with thumbnail, higher quality with large or full).

Types of changes

On mobile, the name property in imageSizes is undefined, but label is already set. So this PR defaults to using the label if it is truthy, and falls back to using the name if not.

PR submission checklist:

  • I have considered adding unit tests where possible.
  • I have considered if this change warrants user-facing release notes and have added them to RELEASE-NOTES.txt if necessary.

@peril-wordpress-mobile
Copy link

Warnings
⚠️ PR is missing at least one label.
⚠️ PR is not assigned to a milestone.

Generated by 🚫 dangerJS

@peril-wordpress-mobile
Copy link

You can test the changes on this Pull Request by downloading the APK here.

@mkevins
Copy link
Contributor Author

mkevins commented Jan 23, 2020

Closing this: the label fix will target develop on gutenberg-mobile, and not a release branch.

@mkevins mkevins closed this Jan 23, 2020
@mkevins mkevins deleted the gutenberg/fix-gallery-size-labels branch January 23, 2020 01:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant