Skip to content

Feat: Render non-editable preview of navigation block when user does not have capability to edit navigation.#69806

Closed
coder-rancho wants to merge 2 commits intoWordPress:trunkfrom
coder-rancho:feat/add-view-only-mode-to-navigation-block
Closed

Feat: Render non-editable preview of navigation block when user does not have capability to edit navigation.#69806
coder-rancho wants to merge 2 commits intoWordPress:trunkfrom
coder-rancho:feat/add-view-only-mode-to-navigation-block

Conversation

@coder-rancho
Copy link
Copy Markdown

@coder-rancho coder-rancho commented Apr 3, 2025

Devnote

⚠️ #69794 should be merged before merging this PR as it is built on top of it and include commits from that branch.

What?

Part of #60809. Built on top of #69794.

Adds a new non-editable mode to the Navigation block that renders the block list as disabled and non-editable.

Why?

This mode will be needed to render a preview of a template part for users that can view a template but not edit it.

How?

Adding a user capability check before rendering the editable Navigation block preview and for users that cannot edit it rendering an alternative locked down mode.

Testing Instructions

  1. Login as admin role.
  2. Insert Navigation block.
  3. Logout and login as editor role.
  4. go to the post, take over.
  5. You'll see that you can see the block but can't select or edit it.

@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 3, 2025

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: coder-rancho <vyasnaman@git.wordpress.org>
Co-authored-by: Mamaduka <mamaduka@git.wordpress.org>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 3, 2025

👋 Thanks for your first Pull Request and for helping build the future of Gutenberg and WordPress, @coder-rancho! In case you missed it, we'd love to have you join us in our Slack community.

If you want to learn more about WordPress development in general, check out the Core Handbook full of helpful information.

@github-actions github-actions bot added the First-time Contributor Pull request opened by a first-time contributor to Gutenberg repository label Apr 3, 2025
@Mamaduka Mamaduka added [Type] Enhancement A suggestion for improvement. [Block] Navigation Affects the Navigation Block labels Apr 3, 2025
@Mamaduka
Copy link
Copy Markdown
Member

Mamaduka commented Apr 3, 2025

In this case, I think it would be easier to test this enhancement if PRs are combined.

@coder-rancho
Copy link
Copy Markdown
Author

Created separate PRs after reading this #58301 (comment)

@coder-rancho
Copy link
Copy Markdown
Author

Changes related to this PR has been merged into #69855.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Block] Navigation Affects the Navigation Block First-time Contributor Pull request opened by a first-time contributor to Gutenberg repository [Type] Enhancement A suggestion for improvement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants