Fix metabox and sidebar elements order #21370
Merged
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.
Context
Summary
This PR can be summarized in the following changelog entry:
Relevant technical choices:
MetaboxFill
,SidebarFill
andElementorFill
has been removed and placed around the components inMetaboxSlot
, SidebarSlotand
ElementorSlot`. This because the components inside each fill are accessed and ordered in the corresponding slots, and because they are all enclosed in the error boundary are seen as a single giant component. Once Premium adds its 3 components to the metabox/sidebar, these 4 components are then ordered.Test instructions for the acceptance test before the PR gets merged
This PR can be acceptance tested by following these steps:
Testing the classic and block editor metabox error boundary
Copy the following snippet right after the imports in
assets/js/src/metabox.js
(Yoast SEO Premium)Find the
Fill
component withname="YoastMetabox"
and copy the following snippet after a</SidebarItem>
closing tag inside that component:<Bomb />
Re-build Premium Javascript packages by issuing
grunt build:js
in the command lineEdit a post and verify:
Refresh page
button refreshes the page (the error would stay)Testing the block editor sidebar error boundary
Testing the block editor sidebar
Now find the
Fill
component withname="YoastSidebar"
and add the same<Bomb />
snippet after a</SidebarItem>
closing tag inside that componentBuild again the javascript packages
Edit a post and verify:
Refresh page
button refreshes the page (the error would stay)Testing the Elementor sidebar error boundary
Copy the previous two snippets of code in
assets/js/src/elementor/initializers/initializeSidebar.js
</SidebarItem>
closing tag inside theFill
component withname="YoastElementor"
Build the javascript packages again
Edit a post and verify:
the
Refresh page
button refreshes the page (the error would stay)Verify the correct order of the elements
Preliminary step: remove all the code you have added in the previous test steps
Edit a post in the block editor and verify
Edit a post in the classic editor and verify the metabox looks as follows
Edit a post with Elementor and verify the sidebar looks as follows
Relevant test scenarios
Test instructions for QA when the code is in the RC
Impact check
This PR affects the following parts of the plugin, which may require extra testing:
UI changes
Other environments
[shopify-seo]
, added test instructions for Shopify and attached theShopify
label to this PR.Documentation
Quality assurance
Innovation
innovation
label.Fixes #1530