Problem/Motivation

In #2968500: Change inline blocks workflow in Layout Builder to match mocks, the link to allow to create inline blocks in Layout Builder was introduced to make easier the process to add new inline blocks to LB.

However, that logic cannot be disabled, forcing to have that link in every Layout Builder's ChooseBlockController instance.

Since Navigation is using Layout Builder and we don't want to allow Site Administrators to add new inline blocks to the Navigation bar, would be great to make this feature optional

Steps to reproduce

  • Install a Standard Profile Drupal Site
  • Enable Navigation
  • Go to the Navigation Blocks config page (/admin/config/user-interface/navigation-block)
  • Try to add a new block to the Navigation
  • Confirm that unwanted link is there

Proposed resolution

Add an extra optional parameter to SectionStorage Annotation/Attribute that would allow to opt out this feature.
By default, the link should be visible to avoid UI regressions.

Remaining tasks

  • Define Patch
  • Implement Patch
  • Write Tests
  • Write Change Record

User interface changes

Create Inline block will be removed for those Layout Builder Section Storage that will opt out that feature.

Introduced terminology

API changes

New parameter in SectionStorage Annotation/Attribute

Data model changes

Release notes snippet

Issue fork drupal-3485435

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

plopesc created an issue. See original summary.

plopesc’s picture

Assigned: Unassigned » plopesc

Working on it.

plopesc’s picture

Title: Layout Builder Create Inline blocks logic should be optional » Make Layout Builder Create Inline blocks logic optional
Category: Bug report » Feature request
Issue summary: View changes

This is not an actual bug, but a feature request.

plopesc’s picture

Status: Active » Needs review

MR created including test coverage and CR draft created.

plopesc’s picture

Assigned: plopesc » Unassigned
plopesc’s picture

m4olivei’s picture

Status: Needs review » Reviewed & tested by the community
Issue tags: +Navigation stable blocker
StatusFileSize
new1.31 MB

Thanks for reporting this @plopesc and doing all the work to get to a resolution.

The need makes sense. We don't want users to be able to add inline blocks to the navigation, it's not designed for that. Blocks for navigation should be very intentional and opt into placement there. I like that we're restricting inline blocks. We were discussing on Drupal Slack whether this is a Navigaton stable blocker. I'm of the opinion that it is, for the reasons just mentioned. I'm marking it as such.

I've tested the resolution and reviewed the code. It all makes sense to me and the tests look good too. I've taken it for a spin on my local, and all looks good. Marking RTBC.

Navigation block UI showing no Create block link

danielveza’s picture

Status: Reviewed & tested by the community » Needs work

Done a review & there is still a couple of older unresolved threads

plopesc’s picture

Status: Needs work » Needs review

Thank you for your review!

I would like to hear the opinions from other folks regarding the open threads, so let's keep it as Needs Review until we have more consensus about the given feedback.

m4olivei’s picture

On further conversation in Slack, we'll drop the Navigation stable blocker label, but keep it as a really important nice to have.

smustgrave’s picture

Status: Needs review » Reviewed & tested by the community
Issue tags: +Needs Review Queue Initiative
StatusFileSize
new78.7 KB
new74.87 KB

Before

before

After

after

Probably duplicate screenshots but seems to be a few changes so thought I'd re-upload.

After the MR can see that the Create content block link is no longer there.

Opened up a follow up about refactoring core/modules/layout_builder/tests/src/FunctionalJavascript/InlineBlockTest.php. Believe the rest of this is good, and going to go out on a limb.

catch’s picture

Status: Reviewed & tested by the community » Needs work

Needs a rebase.

plopesc’s picture

Status: Needs work » Needs review

Rebased and made some adjustments. I think it needs a new round of reviews to ensure there are no regressions.

smustgrave’s picture

Status: Needs review » Reviewed & tested by the community

Rebase seems fine

needs-review-queue-bot’s picture

Status: Reviewed & tested by the community » Needs work
StatusFileSize
new91 bytes

The Needs Review Queue Bot tested this issue. It no longer applies to Drupal core. Therefore, this issue status is now "Needs work".

This does not mean that the patch necessarily needs to be re-rolled or the MR rebased. Read the Issue Summary, the issue tags and the latest discussion here to determine what needs to be done.

Consult the Drupal Contributor Guide to find step-by-step guides for working with issues.

plopesc’s picture

Status: Needs work » Reviewed & tested by the community

Back to RTBC after rebase.

needs-review-queue-bot’s picture

Status: Reviewed & tested by the community » Needs work
StatusFileSize
new91 bytes

The Needs Review Queue Bot tested this issue. It no longer applies to Drupal core. Therefore, this issue status is now "Needs work".

This does not mean that the patch necessarily needs to be re-rolled or the MR rebased. Read the Issue Summary, the issue tags and the latest discussion here to determine what needs to be done.

Consult the Drupal Contributor Guide to find step-by-step guides for working with issues.

plopesc’s picture

Status: Needs work » Reviewed & tested by the community

Back to RTBC after rebase.

catch’s picture

Status: Reviewed & tested by the community » Fixed

Committed/pushed to 11.x, thanks!

catch’s picture

  • catch committed 156028c8 on 11.x
    Issue #3485435 by plopesc, m4olivei, danielveza: Make Layout Builder...
quietone’s picture

There has been no review of the change record for this issue.

penyaskito’s picture

I've rewritten some parts, hope it's more clear now. Also updated version to 11.2.0, and catch has published it.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.