Verified Commit 1af5bc1f authored by godotislate's avatar godotislate
Browse files

task: #3578196 Remove media and user links from the Content menu

By: pameeela
By: emma horrell
By: smustgrave
By: phenaproxima
By: godotislate
By: benjifisher
parent 4851e091
Loading
Loading
Loading
Loading
Loading
+1 −10
Changes for core/modules/navigation/src/NavigationContentLinks.php: 1 added line, 10 removed lines.
Original line number Diff line number Diff line
@@ -81,17 +81,8 @@ public function addMenuLinks(array &$links): void {
      $this->addLink($link_name, $link, $links);
    }

    // Add supported add links under the Create button.
    // Add supported node add links under the Create button.
    $this->addCreateEntityLinks('node_type', 'entity.node.add_form', $links);
    $this->addCreateEntityLinks('media_type', 'entity.media.add_form', $links, ['document', 'image']);

    // Finally, add the bundleless User link and pin it to the bottom.
    $this->addLink('navigation.create.user', [
      'route_name' => 'user.admin_create',
      'title' => $this->t('User'),
      'parent' => 'navigation.create',
      'weight' => 100,
    ], $links);
  }

  /**
+2 −29
Changes for core/modules/navigation/tests/src/Kernel/NavigationContentLinksTest.php: 2 added lines, 29 removed lines.
Original line number Diff line number Diff line
@@ -5,9 +5,7 @@
namespace Drupal\Tests\navigation\Kernel;

use Drupal\KernelTests\KernelTestBase;
use Drupal\Tests\media\Traits\MediaTypeCreationTrait;
use Drupal\Tests\node\Traits\ContentTypeCreationTrait;
use Drupal\Tests\user\Traits\UserCreationTrait;
use PHPUnit\Framework\Attributes\Group;
use PHPUnit\Framework\Attributes\RunTestsInSeparateProcesses;

@@ -21,8 +19,6 @@
class NavigationContentLinksTest extends KernelTestBase {

  use ContentTypeCreationTrait;
  use MediaTypeCreationTrait;
  use UserCreationTrait;

  /**
   * {@inheritdoc}
@@ -35,11 +31,11 @@ class NavigationContentLinksTest extends KernelTestBase {
    'layout_builder',
    'system',
    'views',
    'user',
    'field',
    'media_test_source',
    'image',
    'text',
    'user',
  ];

  /**
@@ -48,16 +44,11 @@ class NavigationContentLinksTest extends KernelTestBase {
  protected function setUp(): void {
    parent::setUp();
    $this->installEntitySchema('node');
    $this->installConfig(['node', 'file']);
    $this->installConfig(['node', 'file', 'media']);

    $this->createContentType(['type' => 'article']);
    $this->createContentType(['type' => 'blog']);
    $this->createContentType(['type' => 'landing_page']);

    $this->installEntitySchema('media');
    $this->createMediaType('test', ['id' => 'document', 'label' => 'Document']);
    $this->createMediaType('test', ['id' => 'image', 'label' => 'Image']);
    $this->createMediaType('test', ['id' => 'special', 'label' => 'Special']);
  }

  /**
@@ -93,24 +84,6 @@ public function testNavigationContentLinks(): void {
    $this->assertEquals('entity.node.add_form', $links['navigation.content.node_type.landing_page']['route_name']);
    $this->assertEquals('landing_page', $links['navigation.content.node_type.landing_page']['title']);

    // Assert that the "Create User" submenu link is added to the menu.
    $this->assertArrayHasKey('navigation.create.user', $links);
    $this->assertEquals('user.admin_create', $links['navigation.create.user']['route_name']);
    $this->assertEquals('User', $links['navigation.create.user']['title']);

    // Assert that the "Document" media type link is added to the menu.
    $this->assertArrayHasKey('navigation.content.media_type.document', $links);
    $this->assertEquals('entity.media.add_form', $links['navigation.content.media_type.document']['route_name']);
    $this->assertEquals('Document', $links['navigation.content.media_type.document']['title']);

    // Assert that the "Image" media type link is added to the menu.
    $this->assertArrayHasKey('navigation.content.media_type.image', $links);
    $this->assertEquals('entity.media.add_form', $links['navigation.content.media_type.image']['route_name']);
    $this->assertEquals('Image', $links['navigation.content.media_type.image']['title']);

    // Assert that the "Special" media type link is not added to the menu.
    $this->assertArrayNotHasKey('navigation.content.media_type.special', $links);

    // Assert that the "Media" link is added.
    $this->assertArrayHasKey('navigation.media', $links);
    $this->assertEquals('entity.media.collection', $links['navigation.media']['route_name']);
+1 −1
Changes for core/profiles/demo_umami/tests/src/FunctionalJavascript/OpenTelemetryAuthenticatedPerformanceTest.php: 1 added line, 1 removed line.
Original line number Diff line number Diff line
@@ -126,7 +126,7 @@ protected function doTestNodePageAdministrator(): void {
    }, 'administratorNodePage');

    $expected = [
      'QueryCount' => 284,
      'QueryCount' => 283,
      'CacheGetCount' => 269,
      'CacheGetCountByBin' => [
        'config' => 64,