Display content moderation state in the Navigation Top Bar

Created on 22 January 2025, 4 months ago

Problem/Motivation

📌 [PP1] Show entity information on the Top Bar Postponed added information about publishing status to the Navigation Top Bar. When content moderation is in use, we could display the user more specific information about the workflow state that the content is in (i.e. in review, draft, etc)

Proposed resolution

Remaining tasks

User interface changes

Introduced terminology

API changes

Data model changes

Release notes snippet

Feature request
Status

Active

Version

11.1 🔥

Component

navigation.module

Created by

🇫🇮Finland lauriii Finland

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

Merge Requests

Comments & Activities

  • Issue created by @lauriii
  • First commit to issue fork.
  • Pipeline finished with Canceled
    4 months ago
    Total: 67s
    #403215
  • Pipeline finished with Failed
    4 months ago
    Total: 86s
    #403216
  • 🇨🇭Switzerland berdir Switzerland

    Created a merge request that supports showing the workflow state as well as a pending draft message. no additional colors or anything, I think it might make sense if the pending draft part would be a separate badge or something that you can click, then we could hide the latest version on the more actions as well.

    didn't think about responsive or anything, just laying the groundwork so people who know about frontend can pick it up from this.

  • Pipeline finished with Success
    4 months ago
    Total: 608s
    #403217
  • 🇬🇧United Kingdom scott_euser

    Adding similar thing from within Gin to related issues.

  • 🇪🇸Spain plopesc Valladolid

    It looks great as an initial approach, suggested improvements could be discussed with the UX team.

    Would be great to have some test coverage for this one too.

  • 🇪🇸Spain plopesc Valladolid

    Created a Content Moderation specific test class as part of 🐛 Navigation Top Bar should Edit button as the primary action when viewing a forward revision Active that could be useful to define the tests in this issue.

  • First commit to issue fork.
  • 🇬🇧United Kingdom oily Greater London

    Added @var docblock to code.

  • Pipeline finished with Success
    4 months ago
    Total: 442s
    #404832
  • 🇬🇧United Kingdom oily Greater London
  • 🇨🇭Switzerland berdir Switzerland

    We have the test class now.

  • Pipeline finished with Success
    3 months ago
    Total: 319s
    #417306
  • 🇨🇭Switzerland berdir Switzerland

    Added basic tests for this and removed the incorrect @var, ready for review again.

    I also brought this up a bit in slack here: https://drupal.slack.com/archives/C7AB68LJV/p1738147489939009.

    As mentioned there, I don't have any strong feelings on color, the current ones work for me, I as mentioned, I'd rather suggest to use warning/yellow to highlight content that is not yet published than for a pending draft, that seems like a more complex change that needs design review and isn't in scope for this.

    I do think it would be neat to somehow make this link to the Latest version, but that can be explored later as well and the latest version link is fairly close.

    To me this seems like a useful intermediate step forward as it is.

  • Pipeline finished with Success
    3 months ago
    Total: 313s
    #417323
  • 🇪🇸Spain plopesc Valladolid

    Checked the code and looks good to me. Added a couple of comments in the MR that might help to clean it up a bit.

    Agree that a possible 3rd color for this new status might be a good addition, but we could use this MR as an intermediate step while the UX and design teams come up with a final solution.

    Thank you!

  • 🇨🇭Switzerland berdir Switzerland

    Cleaned up DI. Note that $entityTypeManager is already unused in HEAD and was replaced with $entityRouteHelper, I'm just adding an additional load for the latest revision.

  • Pipeline finished with Failed
    3 months ago
    Total: 149s
    #418758
  • 🇪🇸Spain plopesc Valladolid

    Thank you for the clean up and taking care of the unused dependency. That was my fault, I think.

    From my perspective, it can be marked as RTBC.

  • 🇬🇧United Kingdom catch

    Do we definitely have tests for this code path with and without content moderation enabled?

  • 🇨🇭Switzerland berdir Switzerland

    Yes, \Drupal\Tests\navigation\Functional\NavigationTopBarPageContextTest is a very similar test that doesn't have content_moderation enabled.

  • First commit to issue fork.
  • 🇨🇦Canada m4olivei Grimsby, ON

    Fleshing out the issue summary to reflec the current state.

  • Pipeline finished with Success
    2 months ago
    Total: 7131s
    #437225
  • 🇨🇦Canada m4olivei Grimsby, ON

    This looks good to me!

    My only hesitation would be that there isn't any design/product input here. I don't see any consideration for workflow / content moderation in the Figma designs I have seen for experience builder or otherwise. I'm not sure how much that matters. I would guess maybe some of that happened offline given @lauriii filed the issue.

  • 🇪🇸Spain ckrina Barcelona

    Confirming that we reviewed the designs of this in the Top Bar in with Lauri and the XB design team, so this is good to go. Thanks for checking Matt :)

  • 🇨🇦Canada m4olivei Grimsby, ON

    Yay! RTBC +1. Thanks @ckrina.

    • nod_ committed 428c9c20 on 11.x
      Issue #3501332 by berdir, m4olivei, oily, plopesc, lauriii, ckrina,...
  • 🇫🇷France nod_ Lille

    Committed 428c9c2 and pushed to 11.x. Thanks!

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

Production build 0.71.5 2024