-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Add Latest Pages - Query block variation #26025
Conversation
Regenaration task uses `spaces` instead of tabs
Size Change: +92 B (0%) Total Size: 1.19 MB
ℹ️ View Unchanged
|
Things I encountered:
I personally would prefer: |
Hey @mariohamann - thanks for looking at this! I actually your
That's out of the scope of this PR, but great suggestion.
I've explored recently such change to the inspector control's block description/icon etc, but seems it's a rather complex problem and the value provided is not so much worth it. If a block is in need to explicitly show that information, maybe it would be better to be a standalone block(?).
In any block variation the settings should not be different. The purpose is to preset some of the attributes only. Having said that I'll close this PR and create a new one to augment the Blocks API to support defaults in object properties. |
Description
This PR adds the first block variation in the
Query
block, which is theLatest Pages
. Related section about block variations in the tracking issue: #24762.In order to do this, I added some missing functionality in
createBlock
(Blocks API) to respect the default values of a property of typeobject
. Previously it would overwrite the whole object, ignoring the rest default values. For example if we had inblock.json
an attribute like this:and created a block with a single object's property set like this:
createBlock( 'test/block', { query: { perPage:10 } })
, it would result in keeping only the passed attributes, which in this case isperPage
. Thepages
attribute would not be defined.A final but not relevant thing this PR changes is some whitespaces differences that occurred during the regeneration of
fixtures
. The regeneration tool usesspaces
and there were some handwritten withtabs
.How has this been tested?
Screenshots
Types of changes
Checklist: