Remove Announcements from the admin menu once it's on the dashboard

Created on 18 November 2024, about 1 month ago

Problem/Motivation

Announcements gets added to the admin nav by default, which sort of makes sense because there is nowhere else yo feature it. Drupal CMS has a dashboard where we can add a block to show Announcements instead, so we should remove it from the navigation since it's way to prominent there.

Proposed resolution

Remove the menu link once the Announcements block is added to the dashboard.

📌 Task
Status

Active

Component

Base Recipe

Created by

🇦🇺Australia pameeela

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

Merge Requests

Comments & Activities

  • Issue created by @pameeela
  • 🇪🇸Spain penyaskito Seville 💃, Spain 🇪🇸, UTC+2 🇪🇺
  • 🇺🇸United States phenaproxima Massachusetts

    Can...can we just do this as part of 📌 Add announcements block to the welcome dashboard Active and close this as a duplicate?

  • 🇺🇸United States phenaproxima Massachusetts
  • First commit to issue fork.
  • Pipeline finished with Canceled
    25 days ago
    Total: 117s
    #351137
  • 🇳🇮Nicaragua dinarcon

    Second attempt at contributing to Drupal CMS... :-)

    I was not expecting to use a config action for this. Some of the thought process I went through...

    1. The menu link is content not configuration.
    2. This link is provided by the Announcements module. The menu UI does not allow to change it. But it can be disabled.
    3. Let's implement hook_menu_links_discovered_alter. But where?
    4. Unless I am missing something, there is no custom modules in Drupal CMS.
    5. drupal_cms_installer seems like a place where hooks are implemented. After looking at the code, drupal_cms_installer_uninstall_myself uninstalls the installer. :)
    6. By disabling the menu link via the UI, I noticed there is a core.menu.static_menu_link_overrides.yml configuration file is created.
    7. Tried to place the configuration file in recipes/drupal_cms_dashboard/config/core.menu.static_menu_link_overrides.yml, but that did not work.
    8. Mostly by chance, I stumbled upon an example overriding a menu link in web/core/recipes/feedback_contact_form/recipe.yml
    9. Added a simpleConfigUpdate to recipes/drupal_cms_dashboard/recipe.yml
    10. Is... this... the right approach?

    Developing for Drupal CMS is indeed different than doing it for Core. Looking forward to learn more and for more opportunities to contribute.

  • Pipeline finished with Failed
    25 days ago
    Total: 1299s
    #351140
  • 🇳🇮Nicaragua dinarcon

    Forgot to change to NR.

    Just noticed this is filed under the Base Recipe component. I made my change in drupal_cms_dashboard recipe which I guess would map to the Track: Dasboard component. I might be overthinking things, but wanted to make sure I applied the code change in the right place.

  • 🇺🇸United States phenaproxima Massachusetts

    Looks fine to me, but...

    The drupal_cms_dashboard recipe is on the cusp of being removed (see 📌 Merge drupal_cms_dashboard into the starter recipe Active ), so this needs to go into a different recipe. Probably drupal_cms_starter is a reasonable place for it.

    Other than that, this is okay by me if tests pass (you'll probably need to rerun the failed jobs at least once; we are plagued by random failures) and @pameeela approves it.

  • Pipeline finished with Success
    25 days ago
    #351141
  • First commit to issue fork.
  • Pipeline finished with Canceled
    25 days ago
    Total: 399s
    #351230
  • Pipeline finished with Failed
    25 days ago
    Total: 402s
    #351229
  • Pipeline finished with Success
    25 days ago
    Total: 1399s
    #351234
  • Pipeline finished with Failed
    25 days ago
    Total: 1407s
    #351233
  • 🇳🇮Nicaragua baltowen

    Moved config action to drupal_cms_starter recipe. Rebased after 📌 Merge drupal_cms_dashboard into the starter recipe Active was merged. Tests are passing. Please review.

    I noticed the following in CODEOWNERS file:

    [dashboard track] @penyaskito @mtift @plopesc
    /recipes/drupal_cms_dashboard/

    Now that the recipe has been removed, should those lines be removed from CODEOWNERS too?

  • 🇦🇺Australia pameeela

    WOW thank you for doing this :) I was not sure we would be able to disable a menu link with config actions but I am so glad we can!

  • 🇺🇸United States phenaproxima Massachusetts
  • Pipeline finished with Skipped
    25 days ago
    #351353
  • 🇺🇸United States phenaproxima Massachusetts

    Code looks good and it's Pam-approved. That's fine enough for me! Merged into 0.x.

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

Production build 0.71.5 2024