From b7030c76c621bde0170c6d067b59fa457d00f462 Mon Sep 17 00:00:00 2001 From: Carlos Castillo Date: Thu, 2 May 2024 13:56:47 +0200 Subject: [PATCH] MDL-81764 reportbuilder: Include full name filter to Users system report --- .../local/systemreports/users.php | 1 + admin/tests/behat/filter_users.feature | 21 +++++++++++++++++++ 2 files changed, 22 insertions(+) diff --git a/admin/classes/reportbuilder/local/systemreports/users.php b/admin/classes/reportbuilder/local/systemreports/users.php index f1dba3de83e..cbf9868f145 100644 --- a/admin/classes/reportbuilder/local/systemreports/users.php +++ b/admin/classes/reportbuilder/local/systemreports/users.php @@ -184,6 +184,7 @@ class users extends system_report { $entityuseralias = $entityuser->get_table_alias('user'); $filters = [ + 'user:fullname', 'user:firstname', 'user:lastname', 'user:username', diff --git a/admin/tests/behat/filter_users.feature b/admin/tests/behat/filter_users.feature index cb9bbf35250..1b60d4edbbd 100644 --- a/admin/tests/behat/filter_users.feature +++ b/admin/tests/behat/filter_users.feature @@ -159,3 +159,24 @@ Feature: An administrator can filter user accounts by role, cohort and other pro And I should not see "User One" in the "reportbuilder-table" "table" And I should not see "User Three" in the "reportbuilder-table" "table" And I should not see "User Four" in the "reportbuilder-table" "table" + + @javascript + Scenario: Filter users by full name + When I click on "Filters" "button" + And I set the following fields in the "Full name" "core_reportbuilder > Filter" to these values: + | Full name operator | Is equal to | + | Full name value | User One | + And I click on "Apply" "button" in the "[data-region='report-filters']" "css_element" + Then I should see "User One" in the "reportbuilder-table" "table" + And I should not see "User Two" in the "reportbuilder-table" "table" + And I should not see "User Three" in the "reportbuilder-table" "table" + And I should not see "User Four" in the "reportbuilder-table" "table" + And I click on "Reset all" "button" in the "[data-region='report-filters']" "css_element" + And I set the following fields in the "Full name" "core_reportbuilder > Filter" to these values: + | Full name operator | Is equal to | + | Full name value | User Two | + And I click on "Apply" "button" in the "[data-region='report-filters']" "css_element" + And I should see "User Two" in the "reportbuilder-table" "table" + And I should not see "User One" in the "reportbuilder-table" "table" + And I should not see "User Three" in the "reportbuilder-table" "table" + And I should not see "User Four" in the "reportbuilder-table" "table"