From 6b25d957bf8802697c121321598ccc671cdb5e87 Mon Sep 17 00:00:00 2001 From: Peter Dias Date: Wed, 30 Mar 2022 10:33:11 +0800 Subject: [PATCH] MDL-74298 core: Render complete links when searching for a setting. --- admin/search.php | 5 ++++- theme/boost/tests/behat/settingstabs.feature | 16 +++++++++++++--- 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/admin/search.php b/admin/search.php index 8ddbd2b592b..c225d72cb69 100644 --- a/admin/search.php +++ b/admin/search.php @@ -11,7 +11,10 @@ $query = trim(optional_param('query', '', PARAM_NOTAGS)); // Search string $context = context_system::instance(); $PAGE->set_context($context); -$PAGE->set_secondary_navigation(true, true); + +// If we are performing a search we need to display the secondary navigation with links as opposed to just anchors. +// NOTE: hassecondarynavigation will be overridden in classic. +$PAGE->set_secondary_navigation(true, !$query); $hassiteconfig = has_capability('moodle/site:config', $context); diff --git a/theme/boost/tests/behat/settingstabs.feature b/theme/boost/tests/behat/settingstabs.feature index 39b29ee813f..f9a9c116a67 100644 --- a/theme/boost/tests/behat/settingstabs.feature +++ b/theme/boost/tests/behat/settingstabs.feature @@ -1,8 +1,7 @@ @javascript @theme_boost -Feature: Administration nav tabs back - When returning to the Administration page I want to see my last opened tab +Feature: Administration nav tabs - Scenario: See last opened tab in site admin + Scenario: See last opened tab in site admin when returning to the page Given I log in as "admin" And I am on site homepage And I click on "Site administration" "link" @@ -11,3 +10,14 @@ Feature: Administration nav tabs back And I should see "New filter" When I press the "back" button in the browser Then I should see "Cohorts" + + Scenario: Navigate back to specific tab after search + Given I log in as "admin" + And I am on site homepage + And I click on "Site administration" "link" + And I set the field "Search" to "assignment" + And I press "Search" + # I should be redirected to the site admin tab with the complete list under it. + # Testing the existence of at least one of the options in the node is sufficient. + When I select "Users" from secondary navigation + Then I should see "Browse list of users"