-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
[Gutenberg] Enable reusable block only in WP.com sites #16475
Conversation
You can trigger optional UI/connected tests for these changes by visiting CircleCI here. |
# Conflicts: # Podfile.lock
# Conflicts: # Podfile # Podfile.lock # WordPress/Classes/ViewRelated/Gutenberg/GutenbergViewController.swift
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @fluiddot thanks for these changes. I tested on WP.com sites ( including atomic) and the reusable block behavior worked as expected. Similarly to Android, While testing on self hosted sites, I can see that the block is unsupported. However, I got undefined for the block's name. Let me know if you are able to reproduce. I utilized the IPA here for testing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approved via WordPress/gutenberg#31744 (review)
# Conflicts: # Podfile # Podfile.lock
I created the Gutenberg Mobile tag |
gutenberg-mobile
PR: wordpress-mobile/gutenberg-mobile#3490guteberg
PR: WordPress/gutenberg#31744WordPress-Android
PR: wordpress-mobile/WordPress-Android#14623This PR enables the reusable block and adds a capability into the editor to limit the availability of this type of block to only WP.com sites.
Why reusable block is disabled in self-hosted sites
Related issue: wordpress-mobile/gutenberg-mobile#3457
The main reason for disabling this block in self-hosted sites is related to the case of having a reusable block that contains a self-reference (a reference to the same reusable block). While in WP.com sites this is working properly, in self-hosted sites, fetching data from the endpoint that holds the data for reusable blocks (
/wp-json/wp/v2/blocks
) in this case, the site returns a bad response so we don't have data for displaying them.NOTE: This is reproducible on self-hosted sites with and without Jetpack, although the error response is different.
Regression Notes
Potential unintended areas of impact
The Reusable block has been enabled so it could affect those posts/pages that contain this type of block.
What I did to test those areas of impact (or what existing automated tests I relied on)
General testing
The following tests have been performed to assure that the editor works as expected:
Present block content (preview mode)
PR: WordPress/gutenberg#25265
This was tested in the following 3 different scenarios:
WordPress.com site
Create a WordPress.com site or use an already created one.
Self-hosted site with Jetpack
Create a self-hosted site with Jetpack (I used https://jurassic.ninja/create/) or use an already created one.
Self-hosted site without Jetpack
Create a self-hosted site without Jetpack (I created a local one using this instructions) or use your own.
Additional improvements for rendering Reusable block
PR: WordPress/gutenberg#30966
NOTE: Reusable blocks can be managed by navigating to the "Reusable blocks page":
https://wordpress.com/types/wp_block/<YOUR_WPCOM_SITE_DOMAIN>
https://<YOUR_SELF_HOSTED_SITE_DOMAIN>/wp-admin/edit.php?post_type=wp_block
Here are the steps for creating reusable blocks in the web version:
Option 1:
Option 2:
Preview content
Deleted reusable block
Recursive block rendering
Add convert to regular blocks action to Reusable block
PR: WordPress/gutenberg#31012
Undo/redo
It's important that we verify that the undo/redo actions work as expected when converting to regular blocks.
Verify that the reusable block is only available in WP.com sites
WordPress.com site - Reusable block is enabled
Create a WordPress.com site or use an already created one.
WordPress.com site (Atomic) - Reusable block is enabled
Create an Atomic site via WordPress.com site or use an already created one.
Self-hosted site with Jetpack - Reusable block is disabled
Create a self-hosted site with Jetpack (I used https://jurassic.ninja/create/) or use an already created one.
Self-hosted site without Jetpack - Reusable block is disabled
Create a self-hosted site without Jetpack (I created a local one using this instructions) or use your own.
No automated tests have been added but I plan to add them in the future.
PR submission checklist:
RELEASE-NOTES.txt
if necessary.