Skip to content
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

Remove all references to the navigation areas #41205

Merged
merged 3 commits into from
May 24, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion lib/blocks.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@ function gutenberg_reregister_core_block_types() {
'latest-posts.php' => 'core/latest-posts',
'loginout.php' => 'core/loginout',
'navigation.php' => 'core/navigation',
'navigation-area.php' => 'core/navigation-area',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh man how did we miss this 🤦

'navigation-link.php' => 'core/navigation-link',
'navigation-submenu.php' => 'core/navigation-submenu',
'page-list.php' => 'core/page-list',
Expand Down
16 changes: 6 additions & 10 deletions packages/e2e-tests/specs/editor/blocks/navigation.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -1346,11 +1346,9 @@ describe( 'Navigation', () => {
`//*[contains(@class, 'components-snackbar__content')][ text()="You do not have permission to edit this Menu. Any changes made will not be saved." ]`
);

// Expect a console 403 for request to Navigation Areas for lower permission users.
// This is because reading requires the `edit_theme_options` capability
// which the Contributor level user does not have.
// See: https://github.com/WordPress/gutenberg/blob/4cedaf0c4abb0aeac4bfd4289d63e9889efe9733/lib/class-wp-rest-block-navigation-areas-controller.php#L81-L91.
// Todo: removed once Nav Areas are removed from the Gutenberg Plugin.
// Expect a console 403 for requests to:
// * /wp/v2/settings?_locale=user
// * /wp/v2/templates?context=edit&post_type=post&per_page=100&_locale=user
expect( console ).toHaveErrored();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🥳

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, we can't remove it as there are still quite a few 403 errors in the console:

CleanShot 2022-05-24 at 11 50 26

I'll just update the comment and leave the expect() in

} );

Expand All @@ -1369,11 +1367,9 @@ describe( 'Navigation', () => {
`//*[contains(@class, 'components-snackbar__content')][ text()="${ noticeText }" ]`
);

// Expect a console 403 for request to Navigation Areas for lower permission users.
// This is because reading requires the `edit_theme_options` capability
// which the Contributor level user does not have.
// See: https://github.com/WordPress/gutenberg/blob/4cedaf0c4abb0aeac4bfd4289d63e9889efe9733/lib/class-wp-rest-block-navigation-areas-controller.php#L81-L91.
// Todo: removed once Nav Areas are removed from the Gutenberg Plugin.
// Expect a console 403 for requests to:
// * /wp/v2/settings?_locale=user
// * /wp/v2/templates?context=edit&post_type=post&per_page=100&_locale=user
expect( console ).toHaveErrored();
} );
} );
Expand Down