-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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 inserter / block directory issues #17517
Merged
Merged
Conversation
This file contains 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
talldan
added
[Type] Bug
An existing feature does not function as intended
[Feature] Inserter
The main way to insert blocks using the + button in the editing interface
[Feature] Block Directory
Related to the Block Directory, a repository of block plugins
labels
Sep 23, 2019
talldan
added
the
Good First Review
A PR that's suitable for someone looking to contribute for the first time by reviewing code
label
Sep 23, 2019
gziolo
added
the
Backport to WP 6.7 Beta/RC
Pull request that needs to be backported to the WordPress major release that's currently in beta
label
Sep 25, 2019
noisysocks
approved these changes
Sep 26, 2019
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.
Fixes the issues as described—thanks for following up on this! 👍
De Morgan'd, whatever that is Co-Authored-By: Robert Anderson <robert@noisysocks.com>
youknowriad
pushed a commit
that referenced
this pull request
Sep 30, 2019
* Fix flipped `hasItems` value * Only show help panel when blocks are available * Only render the block directory when a search term has been entered * Make boolean logic more readable De Morgan'd, whatever that is Co-Authored-By: Robert Anderson <robert@noisysocks.com>
youknowriad
pushed a commit
that referenced
this pull request
Sep 30, 2019
* Fix flipped `hasItems` value * Only show help panel when blocks are available * Only render the block directory when a search term has been entered * Make boolean logic more readable De Morgan'd, whatever that is Co-Authored-By: Robert Anderson <robert@noisysocks.com>
jorgefilipecosta
removed
the
Backport to WP 6.7 Beta/RC
Pull request that needs to be backported to the WordPress major release that's currently in beta
label
Feb 4, 2020
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
[Feature] Block Directory
Related to the Block Directory, a repository of block plugins
[Feature] Inserter
The main way to insert blocks using the + button in the editing interface
Good First Review
A PR that's suitable for someone looking to contribute for the first time by reviewing code
[Type] Bug
An existing feature does not function as intended
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.
Description
I started this PR to fix one issue, but noticed a few related to the same piece of code, so it now fixes three 😄
The fixes are as follows:
Code quality - fix incorrect value for
hasItems
variableA late change in #17431 was to rename
isMenuEmpty
tohasItems
, but we forgot to also flip the value of the variable to match the new meaning.fcb5f74 fixes this by flipping the logic and updating usage of the variable.
Inserter help panel was being displayed when no available blocks in the inserter menu
To reproduce this:
ef0ea34 fixes this by not rendering the help panel when no blocks are available for insert.
Block directory showing a loading spinner when no block available and no search term entered
To reproduce this:
ae562e1 fixes this by not rendering the block directory unless there is a search term. There still seems to be a separate issue that the block directory doesn't respect template locking, and I've added this to the list on #17440.
How has this been tested?
Screenshots
Types of changes
Bug fix (non-breaking change which fixes an issue)
Checklist: