Disable Navigation block inserter support in all editors apart from the Site Editor#37291
Disable Navigation block inserter support in all editors apart from the Site Editor#37291
Conversation
|
Size Change: +541 B (0%) Total Size: 1.11 MB
ℹ️ View Unchanged
|
|
E2E test failures look legitimate. |
Yeah, the tests use the post editor. I've been updating the e2e tests for the block and getting them working again, so I'll take a look at it. Maybe in the long run we can make the tests run in the site editor, but I don't think that's going to be an easy switch over. For now I'll make it so that the tests set inserter support to |
The above comment left by @carolinan in #36286 (comment) is highly relevant. |
|
Another option is to show the Nav block by default, and then hide it in the Post Editor only if the current user doesn't have sufficient permission on the Navigation post type. |
|
Based on #37291 (comment) let's close this one out in favour of some UI notices. |
DO NOT MERGE
This requires more discussion prior to merging.
Description
As discussed in #36286 this PR experiments with hiding the Navigation block from the inserter in every editor apart from the Site Editor.
Why? Because the block is not currently well suited to usage by users with lower permissions. Whilst in the longer term we will seek to find better solutions, in the short term the most expedient solution is likely to be to hide the block in all editors except the Site Editor. This has the result of effectively meaning the lower permission users will never encounter the block.
Why not simply unregister the block for lower permission users? Well...as users may encounter Posts which contain the Navigation block (e.g. Posts created prior to the introduction of this change, or Reusable blocks created in the Site Editor) we cannot unregister the block entirely as this would cause errors. Better to simply hide it.
Note this may mean we need to implement some basic safe guards or UI to illustrate to users with insufficient permissions that the block is not suitable for them. This is being explored separately in #37286 and #37289.
This PR shamelessly builds on work by @adamziel in #37065 as well as my own work in f1d7144.
Fixes part of #36286
How has this been tested?
Screenshots
Post Editor
Site Editor
Types of changes
Checklist:
*.native.jsfiles for terms that need renaming or removal).