diff --git a/core/modules/views_ui/src/ViewListBuilder.php b/core/modules/views_ui/src/ViewListBuilder.php index f1091d1937..be74a4ea68 100644 --- a/core/modules/views_ui/src/ViewListBuilder.php +++ b/core/modules/views_ui/src/ViewListBuilder.php @@ -215,12 +215,12 @@ public function render() { '#title' => $this->t('Filter'), '#title_display' => 'invisible', '#size' => 60, - '#placeholder' => $this->t('Filter by view name, machine name, description, or display path'), + '#placeholder' => $this->t('Filter by view name, machine name, description, tags, or display path'), '#attributes' => [ 'class' => ['views-filter-text'], 'data-table' => '.views-listing-table', 'autocomplete' => 'off', - 'title' => $this->t('Enter a part of the view name, machine name, description, or display path to filter by.'), + 'title' => $this->t('Enter a part of the view name, machine name, description, tags, or display path to filter by.'), ], ]; diff --git a/core/modules/views_ui/templates/views-ui-views-listing-table.html.twig b/core/modules/views_ui/templates/views-ui-views-listing-table.html.twig index 58ad23214d..5a1fef8d47 100644 --- a/core/modules/views_ui/templates/views-ui-views-listing-table.html.twig +++ b/core/modules/views_ui/templates/views-ui-views-listing-table.html.twig @@ -37,7 +37,7 @@ {{ row.data.description.data }} - + {{ row.data.tag.data }} diff --git a/core/modules/views_ui/tests/src/FunctionalJavascript/ViewsListingTest.php b/core/modules/views_ui/tests/src/FunctionalJavascript/ViewsListingTest.php index cab99bd7bc..7a1e640090 100644 --- a/core/modules/views_ui/tests/src/FunctionalJavascript/ViewsListingTest.php +++ b/core/modules/views_ui/tests/src/FunctionalJavascript/ViewsListingTest.php @@ -3,6 +3,7 @@ namespace Drupal\Tests\views_ui\FunctionalJavascript; use Drupal\FunctionalJavascriptTests\JavascriptTestBase; +use Drupal\views\Entity\View; /** * Tests the JavaScript filtering on the Views listing page. @@ -77,6 +78,27 @@ public function testFilterViewsListing() { $this->assertCount($content_views_count, $enabled_rows); $this->assertCount($disabled_views_count, $disabled_rows); + // Ensure that some View contains 'default' tag. + View::load('content')->set('tag', 'default')->save(); + // Ensure that some View contains not 'default' tag. + View::load('people')->set('tag', 'i am very specific')->save(); + + $this->drupalGet('admin/structure/views'); + + // Filter on a string that also appears in the tags. + $search_input->setValue('default'); + $rows = $page->findAll('css', 'tr[class^="views-ui-list-"]'); + $this->assertNotEmpty($this->filterVisibleElements($enabled_rows)); + foreach ($rows as $row) { + $tag = $row->find('css', 'td.views-ui-view-tags')->getText(); + if ($row->isVisible()) { + $this->assertContains('default', $tag); + } + else { + $this->assertNotContains('default', $tag); + } + } + // Reset the search string and check that we are back to the initial stage. $search_input->setValue(''); // Add a backspace to trigger the keyUp event. diff --git a/core/themes/stable/templates/admin/views-ui-views-listing-table.html.twig b/core/themes/stable/templates/admin/views-ui-views-listing-table.html.twig index ea12ca46d6..6799bb6d96 100644 --- a/core/themes/stable/templates/admin/views-ui-views-listing-table.html.twig +++ b/core/themes/stable/templates/admin/views-ui-views-listing-table.html.twig @@ -35,7 +35,7 @@ {{ row.data.description.data }} - + {{ row.data.tags.data }}