Provide a NavigationLinkBlock Plugin and use Help as an usage example

Created on 8 May 2024, 2 months ago
Updated 18 July 2024, about 11 hours ago

Problem/Motivation

Providing a Single Link Navigation Block type could be useful for situations where a single item needs to be added to navigation and creating a new menu just for this purpose would be overkill and complex for editors.

A good example of this is the Help link in the current navigation. This is a single link and it was hardcoded in the NavigationUserBlock to avoid creating an extra menu.

If we add this new item, we could migrate Help link to be an usage of this block type and significantly simplify logic in NavigationUserBlock.

Related issues where complexity could be reduced:

๐Ÿ“Œ Investigate using the core "User account menu" in favor of custom Navigation Block for same Active
โœจ Add the user image to the user menu when available Active

Steps to reproduce

Current process to add a single link to page Foo in navigation:

  1. Go to Add Menu Page and create and arbitrary menu called Bar
  2. Edit the Bar menu and add menu item to Foo and its title
  3. Go to Navigation Layout page and add a new Bar Menu block
  4. Configure the Bar Menu Block to use 1st level and depth of 1
  5. Link to Foo is added to Navigation

Proposed resolution

Create a new Block plugin for use in the navigation, which allows for configuring a navigation block with a single link, rather than having to place a single link with the overhead of creating a menu, setting a link within it, then setting up a navigation block. This would alleviate the present hardcoding of the Help link as noted above, simplifying NavigationUserBlock, and potentially other user cases, also noted above.

Due to UX concerns with this approach, e.g. the potential proliferation of many single link blocks, this new block type will not be available to be added via UI. But created to make the work on the related issues smoother.

Remaining tasks


User interface changes

None. While we added a new Link block here, it is presently hidden from the general Block layout page as well as the Navigation layout page.

API changes

A new block with machine name navigation_link was added.

Data model changes

None.

๐Ÿ“Œ Task
Status

Needs work

Version

11.0 ๐Ÿ”ฅ

Component
Navigationย  โ†’

Last updated about 10 hours ago

No maintainer
Created by

๐Ÿ‡ช๐Ÿ‡ธSpain plopesc Valladolid

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

  • Issue created by @plopesc
  • Status changed to Postponed 2 months ago
  • ๐Ÿ‡ช๐Ÿ‡ธSpain plopesc Valladolid

    Postponing due to necessary implementation discussion.

  • ๐Ÿ‡ช๐Ÿ‡ธSpain plopesc Valladolid
  • Assigned to plopesc
  • Status changed to Active 2 months ago
  • ๐Ÿ‡ช๐Ÿ‡ธSpain plopesc Valladolid

    Working on it!

  • Pipeline finished with Failed
    2 months ago
    Total: 177s
    #169147
  • Pipeline finished with Failed
    2 months ago
    Total: 184s
    #169152
  • Pipeline finished with Failed
    2 months ago
    #169166
  • Pipeline finished with Failed
    2 months ago
    Total: 691s
    #169269
  • Pipeline finished with Success
    2 months ago
    Total: 604s
    #169273
  • Status changed to Needs review 2 months ago
  • ๐Ÿ‡ช๐Ÿ‡ธSpain plopesc Valladolid

    As discussed with @ckrina in Portland, this new block will be hidden by now, but used for the Help Navigation item for testing purposes and simplify the footer logic.

    Added functional tests to ensure link access rules are preserved.

    Attaching screenshot to ensure that there are no visual regressions.

  • ๐Ÿ‡จ๐Ÿ‡ฆCanada m4olivei Grimsby, ON
  • Issue was unassigned.
  • ๐Ÿ‡ช๐Ÿ‡ธSpain plopesc Valladolid
  • Status changed to Needs work 2 months ago
  • ๐Ÿ‡จ๐Ÿ‡ฆCanada m4olivei Grimsby, ON

    Love the thought here. One thing I noticed is that the spacing in the footer has some regressions.

    Will also go through a static review shortly.

  • ๐Ÿ‡จ๐Ÿ‡ฆCanada SKAUGHT
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia Gauravvv Delhi, India

    Gauravvvv โ†’ made their first commit to this issueโ€™s fork.

  • Status changed to Needs review 2 months ago
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia Gauravvv Delhi, India
  • Pipeline finished with Success
    2 months ago
    Total: 664s
    #173934
  • Pipeline finished with Success
    2 months ago
    Total: 578s
    #174040
  • Status changed to RTBC about 2 months ago
  • ๐Ÿ‡จ๐Ÿ‡ฆCanada m4olivei Grimsby, ON

    This is looking great. RTBC for me.

  • Status changed to Needs work about 2 months ago
  • ๐Ÿ‡ฌ๐Ÿ‡งUnited Kingdom catch

    I think this needs an issue summary update and a change record.

  • ๐Ÿ‡จ๐Ÿ‡ฆCanada m4olivei Grimsby, ON
  • ๐Ÿ‡จ๐Ÿ‡ฆCanada m4olivei Grimsby, ON

    I'll take a crack at writing a change record here.

  • Status changed to Needs review about 2 months ago
  • ๐Ÿ‡จ๐Ÿ‡ฆCanada m4olivei Grimsby, ON

    Updated the issue summary as well as drafted a change record. First time drafting a change record, so let me know if I missed the mark in any way.

  • ๐Ÿ‡จ๐Ÿ‡ฆCanada m4olivei Grimsby, ON

    I'm also unclear if I could have put it back to RTBC in this instance? Would be curious to learn process there too. Thanks!

  • Status changed to RTBC about 2 months ago
  • ๐Ÿ‡ฌ๐Ÿ‡งUnited Kingdom catch

    Yes fine to put it back to RTBC if you added a change record or similarly fixed issue metadata.

    The last question I have is whether the icon class in config is consistent with the current plans for icons?

  • ๐Ÿ‡ช๐Ÿ‡ธSpain plopesc Valladolid

    Icon config is consistent with the current icon approach.

    There's no clear direction for final icons yet.

  • ๐Ÿ‡ท๐Ÿ‡ธSerbia finnsky

    I think that CSS can be simplified. But i don't want to block this feature.

  • ๐Ÿ‡ท๐Ÿ‡ธSerbia finnsky

    Let's fix CSS here:

    https://www.drupal.org/project/drupal/issues/3450103 โœจ .admin-toolbar__footer CSS fix. [follow up] Active

  • Status changed to Needs work about 2 months ago
  • ๐Ÿ‡ฆ๐Ÿ‡บAustralia larowlan ๐Ÿ‡ฆ๐Ÿ‡บ๐Ÿ.au GMT+10

    Left some comments/questions on the MR

    There's also some existing open threads that I'm not sure have been addressed.

    Love this, much cleaner than how we were doing ๐Ÿ™Œ

  • Pipeline finished with Success
    about 2 months ago
    Total: 510s
    #184711
  • Pipeline finished with Success
    about 2 months ago
    Total: 586s
    #184832
  • Status changed to Needs review about 2 months ago
  • ๐Ÿ‡ช๐Ÿ‡ธSpain plopesc Valladolid

    Thank you for your comments in the MR.

    Worked on them and I think this is ready for another round of reviews.

    Adding reference to follow-up created: ๐Ÿ“Œ Add a generic trait for logic to convert references into Urls in LinkWidget Active

  • ๐Ÿ‡ช๐Ÿ‡ธSpain plopesc Valladolid

    @larowlan After searching through the issue queue, I have seen that ๐Ÿ“Œ Fix Block config entity type config schema violations: weight, property Postponed already exists and is the key to unlock validation in blocks. There would be no need to create a new issue.

  • Pipeline finished with Failed
    about 1 month ago
    Total: 514s
    #198698
  • Pipeline finished with Success
    about 1 month ago
    Total: 578s
    #198737
  • ๐Ÿ‡ช๐Ÿ‡ธSpain plopesc Valladolid

    All the MR comments have been addressed, follow up issue for validation referenced, code updated to latest 11.x and conflicts solved.

    This is ready for a final round of reviews.

  • Status changed to RTBC about 1 month ago
  • ๐Ÿ‡จ๐Ÿ‡ฆCanada m4olivei Grimsby, ON

    Can confirm that all comments have been addressed. Everything is working well from a functional perspective.

    • Installing the module from fresh sets the expected block config for the footer navigation region.
    • No visual regressions on the Help link placement or otherwise.
  • Status changed to Needs work 14 days ago
  • ๐Ÿ‡ณ๐Ÿ‡ฟNew Zealand quietone New Zealand

    I read the issue summary, comments and the MR (not a code review). I didn't spot unanswered questions.

    @m4olivei, thanks for updating the issue summary, creating the change record and confirming the change is working as expected. Very nice. Just two things need to be updated.

    The proposed resolution should state what is being added in this issue. Currently, it lists steps to create this new block type from the UI but then says that the UI is not being added. This should be updated to explain what is being done in this issue onlly. Refer to https://www.drupal.org/docs/develop/issues/fields-and-other-parts-of-an-... โ†’

    I also read the CR which is clear and easy to read, so that is good. I do think it needs work to explain to developers how and why they would use this.

    Also, In a comment it was stated that "this new block will be hidden by now, but used for the Help Navigation item for testing purposes and simplify the footer logic". Is that testing added in this issue? Is that in a followup? Apologies if I missed the answer to these questions.

    Tagging and setting to needs work for the above and a question in the MR.

  • ๐Ÿ‡จ๐Ÿ‡ฆCanada m4olivei Grimsby, ON
  • Status changed to RTBC 13 days ago
  • ๐Ÿ‡จ๐Ÿ‡ฆCanada m4olivei Grimsby, ON

    Thanks @quietone. I've updated the change recode and issue summery per your suggestions.

    Back to RTBC๐Ÿคž.

  • Status changed to Needs work 12 days ago
  • 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.

  • Pipeline finished with Success
    11 days ago
    Total: 537s
    #218939
  • Status changed to RTBC 11 days ago
  • ๐Ÿ‡ช๐Ÿ‡ธSpain plopesc Valladolid

    Back to RTBC once the suggestions in #28 were addressed and MR is ready to be merged.

  • Status changed to Needs work about 11 hours ago
  • The Needs Review Queue Bot โ†’ tested this issue. It fails the Drupal core commit checks. 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.

Production build 0.69.0 2024