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

[Mobile] Pass the Gallery v2 Flag over from the editor #33314

Conversation

chipsnyder
Copy link
Contributor

@chipsnyder chipsnyder commented Jul 8, 2021

Related PRs
gutenberg-mobile: wordpress-mobile/gutenberg-mobile#3713
WordPress-iOS: wordpress-mobile/WordPress-iOS#16832
WordPressKit-iOS: wordpress-mobile/WordPressKit-iOS#417

Description

This passes the value of the editor setting __unstableGalleryWithImageBlocks from the Native Apps to the editor at initialization and after a settings update. __unstableGalleryWithImageBlocks is fetched via the /wp-block-editor/v1/settings API by the mobile apps alongside theme settings. The associated PRs attached here handle the iOS side of the changes.

📓 The Android side of this still needs to be handled.

How has this been tested?

Testing this can be a bit involved:

Setup

  1. A site running Gutenberg generated from this build. You can use wp-env start or generate a new bundle.
  2. The build from the associated iOS PR: Pass the Gallery v2 Flag over from the editor wordpress-mobile/WordPress-iOS#16832
  3. On your site enable the Gallery Refactor by going to Gutenberg > Experminents > Check "Gallery Refactor"

To Test

  1. Open the editor.
  2. Add a Gallery Block
    • Expect the image to be an image block (i.e. the gallery is the refactored version). This will indicate that the Gallery is using the v2 version.
  3. Navigate away from the editor
  4. Take the device offline
  5. Revalidate that the Gallery is using v2 version
  6. Navigate away from the editor
  7. Take the device online again
  8. Toggle the flag back to false
  9. Return to the editor and add a Gallery block again
    • Expect the image to not be in a nested image block. This will indicate we've reverted back to use the v1 setting.

Screenshots

Types of changes

New feature

Checklist:

  • My code is tested.
  • My code follows the WordPress code style.
  • My code follows the accessibility standards.
  • I've tested my changes with keyboard and screen readers.
  • 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 (please manually search all *.native.js files for terms that need renaming or removal).

Glen Davies and others added 30 commits April 12, 2021 11:25
…ocks at the point that the block validation is run
… innerBlocks at the point that the block validation is run"

This reverts commit 4d95e95.
… gallery - with the idea that we will improve the innerblocks drag and drop in a later PR
This reverts commit 9b0abcc.
…existing gallery - with the idea that we will improve the innerblocks drag and drop in a later PR"

This reverts commit cc05d60.
…transform when dragging multiple images onto the gallery
… is async so need to keep circling through the innerblocks updates until we have all the data we need
…27087)

* Add loading spinner for image size options
Co-authored-by: Glen Davies <[email protected]>
@antonis antonis removed the request for review from tellthemachines August 3, 2021 10:46
@chipsnyder
Copy link
Contributor Author

Yeah, I had to pull trunk into this in order to get the Mobile Apps to build.

Glen Davies and others added 2 commits August 4, 2021 09:57
Base automatically changed from refactor/gallery-to-nested-image-blocks to trunk August 19, 2021 23:39
@antonis antonis self-assigned this Aug 30, 2021
Copy link
Contributor

@mkevins mkevins left a comment

Choose a reason for hiding this comment

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

Tested via: wordpress-mobile/WordPress-iOS#16832 (review) and everything is working as expected. Thanks! 👍

@antonis antonis merged commit 4fc1b6f into trunk Sep 2, 2021
@antonis antonis deleted the rnmobile/refactor/gallery-as-nested-image-blocks-editor-settings_v2 branch September 2, 2021 09:35
@github-actions github-actions bot added this to the Gutenberg 11.5 milestone Sep 2, 2021
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 Mobile App - i.e. Android or iOS Native mobile impl of the block editor. (Note: used in scripts, ping mobile folks to change)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants