MDL-62983 core_user: Hold multiple filters when clicking any link

This commit is contained in:
Jonathon Fowler 2018-07-25 12:53:06 +02:00 committed by Sara Arjona
parent 6e8235c7d3
commit 89e27d9999
2 changed files with 21 additions and 4 deletions

View File

@ -225,8 +225,8 @@ echo $renderer->unified_filter($course, $context, $filtersapplied, $baseurl);
echo '<div class="userlist">';
// Add filters to the baseurl after creating unified_filter to avoid losing them.
foreach ($filtersapplied as $filter) {
$baseurl->param('unified-filters[]', $filter);
foreach (array_unique($filtersapplied) as $filterix => $filter) {
$baseurl->param('unified-filters[' . $filterix . ']', $filter);
}
$participanttable = new \core_user\participants_table($course->id, $groupid, $lastaccess, $roleid, $enrolid, $status,
$searchkeywords, $bulkoperations, $selectall);

View File

@ -39,7 +39,7 @@ Feature: Course participants can be filtered to display all the users
And the following "course enrolments" exist:
| user | course | role | status | timeend |
| student1 | C1 | student | 0 | |
| student2 | C1 | student | 1 | |
| student2 | C1 | student | 0 | |
| student3 | C1 | student | 0 | |
| student4 | C1 | student | 0 | |
| student5 | C1 | student | 0 | |
@ -61,7 +61,7 @@ Feature: Course participants can be filtered to display all the users
| student21 | C1 | student | 0 | |
| student22 | C1 | student | 0 | |
| student23 | C1 | student | 0 | |
| student24 | C1 | student | 0 | |
| student24 | C1 | student | 1 | |
| student1 | C2 | student | 0 | |
| student2 | C2 | student | 0 | |
| student3 | C2 | student | 0 | |
@ -88,3 +88,20 @@ Feature: Course participants can be filtered to display all the users
Then I should see "Role: Student"
And I should see "Number of participants: 24" in the "//div[@class='userlist']" "xpath_element"
And I should see "Show 20 per page"
@javascript
Scenario: Apply more than one filter and show all users
Given I log in as "teacher1"
And I am on "Course 1" course homepage
And I navigate to course participants
When I open the autocomplete suggestions list
And I click on "Role: Student" item in the autocomplete list
And I open the autocomplete suggestions list
And I click on "Status: Active" item in the autocomplete list
And I click on "Show all 23" "link"
Then I should see "Role: Student"
And I should see "Status: Active"
And I should see "Number of participants: 23" in the "//div[@class='userlist']" "xpath_element"
And I should see "Student 1"
And I should not see "Student 24"
And I should see "Show 20 per page"