Multiple use block validation logic improvement#39813
Closed
delowardev wants to merge 448 commits into
Closed
Conversation
getdave
reviewed
Apr 6, 2022
getdave
left a comment
Contributor
There was a problem hiding this comment.
Thank you for raising this PR 👏
I tested it and it works well for the simple case you have described. However I think I may have uncovered some more complex use cases:
- Using within a Query Loop in the Site Editor, if I duplicate the loop then the editor shows an error. Presumably it's valid to use the
Moreblock twice when it's part of a template so we're going to have to make the validation logic more flexible:
In addition:
- I tried with the
core/read-moreblock and it seems to supportmultiple. I wonder if that's a mistake? - It would be good if we could add an e2e test to validate this functionality for both nested and non-nested blocks. Probably in
https://github.com/WordPress/gutenberg/tree/trunk/packages/e2e-tests/specs/editor/plugins
Lastly, just a small note that we try to avoid merge commits and instead rebase against upstream trunk. You should do that if you have any conflicts with the upstream Gutenberg trunk. Update your trunk branch from the upstream main Gutenberg repo and then whilst you have your branch checked out run git rebase trunk to rebase.
* Add `edit` context to patterns REST controllers * remove extra check
- @wordpress/block-directory@3.4.1 - @wordpress/block-editor@8.5.1 - @wordpress/block-library@7.3.1 - @wordpress/blocks@11.5.1 - @wordpress/core-data@4.4.1 - @wordpress/customize-widgets@3.3.1 - @wordpress/e2e-tests@4.0.1 - @wordpress/edit-post@6.3.1 - @wordpress/edit-site@4.3.1 - @wordpress/edit-widgets@4.3.1 - @wordpress/editor@12.5.1 - @wordpress/format-library@3.4.1 - @wordpress/reusable-blocks@3.4.1 - @wordpress/server-side-render@3.4.1 - @wordpress/widgets@2.4.1
…and Stack variations (WordPress#40212) * Cover: Always allow transform from Group block, add handling for Row and Stack variations * Move background color or gradient settings to parent, preserve Group block for all variations
* Add ported version of site editor document settings test * Delete old puppeteer test * Fix test title, not a template part being tested * Use the spec suffix * Rename test description * Remove the EditorTitle utility class * Remove unnecessary deletion of templates and template parts * Improve selectors * use toHaveText * Select the iframe using its title
* File block * Table block. * Image block. * Image block native. * Gallery block. * Audio block. * Media & text * Media & text native * Video * Video native * Spacer * Archives * Categories. * Latest comments. * RSS * Tag Cloud * Post excerpt. * Author * Login
…dPress#40027) * Add documentation for `ancestor` property Adds documentation for the new API added in WordPress#39894 * Update docs/reference-guides/block-api/block-metadata.md Co-authored-by: Greg Ziółkowski <grzegorz@gziolo.pl> * Add ancestors example in innerblocks tutorial Co-authored-by: Greg Ziółkowski <grzegorz@gziolo.pl> Co-authored-by: Luis Herranz <luisherranz@gmail.com>
…rdPress#39726) This PR seeks to make the block inserter more visible in the "default view" of the editor. For the purposes of this PR, "default view" has been interpreted as the view of the editor when no blocks (including the editor's title) are selected.
* [Multi-selection]: Copy/cut partial selected blocks * handle `copy` button in block actions * merge blocks on cut * partial copy from block actions only when is mergeable * update selector * revert partial selection copy in block actions menu item * add jsdoc for mapRichTextSettings util * update tests * add new e2e tests + pressKeyTimes playwright util
* Mobile - Update Quote block to support V2 * Mobile - React Native editor tests - Update to pick the first main block list wrapper * Mobile - Add Quote block V2 experimental flag * Mobile - React native editor test - Revert block list change, this will be needed once the quote block v2 is enabled by default * Mobile - Block library - registerCoreBlocks - Make param optional * Mobile - Edit post test - Update beforeAll call * Mobile - BlockQuotation - Restore removed code
…#40296) * Conditionally set secondary sidebar landmark region labels * Don't mutate the object
Co-authored-by: André <583546+oandregal@users.noreply.github.com>
* Test async mode * Catch missed updates always synchronously in effect * Rerun mapSelect when registry changes
Co-authored-by: Glen Davies <glen.davies@a8c.com>
…Press#37728) * Add styles to the footer before the block is rendered * Update PHPDoc * Fix php unit test - length of id was changed by this PR * Fix linting errors and elements unit tests * add removed code * consolidate code from rebase * Try adding a unit test * fix test * Do not short-circuit block rendering * Rename for clarity * Do not output styles if skipSerialization is true * Remove unnecessary test Co-authored-by: Glen Davies <glen.davies@a8c.com> Co-authored-by: André <583546+oandregal@users.noreply.github.com>
…eld (WordPress#40195) * Posts: Make sure to focus title after welcome dialog close if empty. * Use a ref to control focus on welcome close. * Add E2E test coverage. * Code optimizing. Try to fix E2E tests. * Reviewer feedback. * Move isCleanNewPost to edit-post useEffect. * Only pull initial value of isCleanNewPost.
* Fix comments no results placeholder not appearing * Revert changes and apply fix recommended * Add e2e test for no results * Comment cleaning
…s#37770) This updates border block support to utilise the new `BorderBoxControl` component and offer support for individual side border configuration. Co-authored-by: Ramon <ramonjd@users.noreply.github.com> Co-authored-by: André <583546+oandregal@users.noreply.github.com>
Contributor
Author
|
Sorry for the inconvenience, my local git history got messed-up |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


What?
Fixes: #38502
Why?
Any block that doesn't support the
multiplefeature, doesn't display the Multiple blocks validation warning when it's inside group blocks.How?
Include
innerBlocksin the validation process.Testing Instructions
The "Read more" should display the validation warning.
Screenshots or screencast
Before:
before.mov
After:
after.mov