Merge branch 'MDL-69145-master-3' of git://github.com/junpataleta/moodle

This commit is contained in:
Jake Dallimore
2020-12-09 11:00:22 +08:00
8 changed files with 18 additions and 13 deletions
+1 -1
View File
@@ -41,7 +41,7 @@ use Iterator;
*/
class filter implements Countable, Iterator, JsonSerializable {
/** @var in The default filter type (ANY) */
/** @var int The default filter type (ANY) */
const JOINTYPE_DEFAULT = 1;
/** @var int None of the following match */
+6 -3
View File
@@ -40,8 +40,8 @@ use moodle_exception;
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
abstract class filterset implements JsonSerializable {
/** @var in The default filter type (ANY) */
const JOINTYPE_DEFAULT = 1;
/** @var int The default filter type (ALL) */
const JOINTYPE_DEFAULT = 2;
/** @var int None of the following match */
const JOINTYPE_NONE = 0;
@@ -53,7 +53,7 @@ abstract class filterset implements JsonSerializable {
const JOINTYPE_ALL = 2;
/** @var int The join type currently in use */
protected $jointype = self::JOINTYPE_DEFAULT;
protected $jointype = null;
/** @var array The list of combined filter types */
protected $filtertypes = null;
@@ -90,6 +90,9 @@ abstract class filterset implements JsonSerializable {
* @return int
*/
public function get_join_type(): int {
if ($this->jointype === null) {
$this->jointype = self::JOINTYPE_DEFAULT;
}
return $this->jointype;
}
+2
View File
@@ -12,6 +12,8 @@ information provided here is intended especially for developers.
location in config.php if required. To get the best possible security for this feature, we
recommend enabling the Sodium PHP extension.
* Behat timeout constants behat_base::TIMEOUT, EXTENDED_TIMEOUT, and REDUCED_TIMEOUT, which were deprecated in 3.7, have been removed.
* \core_table\local\filter\filterset::JOINTYPE_DEFAULT is being changed from 1 (ANY) to 2 (ALL). Filterset implementations
can override the default filterset join type by overriding \core_table\local\filter\filterset::get_join_type() instead.
=== 3.10 ===
* PHPUnit has been upgraded to 8.5. That comes with a few changes:
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+2 -2
View File
@@ -337,8 +337,8 @@ export const init = participantsRegionId => {
if (filters.length === 1) {
filterSet.querySelector(Selectors.filterset.regions.filtermatch).classList.add('hidden');
filterSet.querySelector(Selectors.filterset.fields.join).value = 1;
filterSet.dataset.filterverb = 1;
filterSet.querySelector(Selectors.filterset.fields.join).value = 2;
filterSet.dataset.filterverb = 2;
} else {
filterSet.querySelector(Selectors.filterset.regions.filtermatch).classList.remove('hidden');
}
+3 -3
View File
@@ -40,7 +40,7 @@
}
}}
<div id="core_user-participantsfilter-{{uniqid}}" class="filter-group my-2 p-2 bg-light border-radius border" data-table-region="{{tableregionid}}" data-table-course-id="{{courseid}}" data-filterverb="1">
<div id="core_user-participantsfilter-{{uniqid}}" class="filter-group my-2 p-2 bg-light border-radius border" data-table-region="{{tableregionid}}" data-table-course-id="{{courseid}}" data-filterverb="2">
<div data-filterregion="filtermatch" class="hidden">
<label for="core_user-local-participantsfilter-jointype-{{uniqid}}" class="my-0" aria-hidden="true">
{{#str}}match, core_user{{/str}}
@@ -48,8 +48,8 @@
<select class="custom-select" data-filterfield="join" id="core_user-local-participantsfilter-jointype-{{uniqid}}"
aria-label="{{#str}}filtersetmatchdescription, core_user{{/str}}">
<option value="0">{{#str}}none{{/str}}</option>
<option selected=selected value="1">{{#str}}any{{/str}}</option>
<option value="2">{{#str}}all{{/str}}</option>
<option value="1">{{#str}}any{{/str}}</option>
<option value="2" selected>{{#str}}all{{/str}}</option>
</select>
<span aria-hidden="true">{{#str}}matchofthefollowing, core_user{{/str}}</span>
</div>
+2 -2
View File
@@ -707,7 +707,7 @@ Feature: Course participants can be filtered
And I should not see "Student 4" in the "participants" "table"
And I should not see "Teacher 1" in the "participants" "table"
And I click on "Add condition" "button"
# Re-add a second filter and ensure the default (any) filterset match type is set.
# Re-add a second filter and ensure the default (All) filterset match type is set.
And I set the field "Match" in the "Filter 2" "fieldset" to "All"
And I set the field "type" in the "Filter 2" "fieldset" to "Role"
And I click on ".form-autocomplete-downarrow" "css_element" in the "Filter 2" "fieldset"
@@ -716,7 +716,7 @@ Feature: Course participants can be filtered
And I should see "Student 1" in the "participants" "table"
And I should see "Student 2" in the "participants" "table"
And I should see "Student 3" in the "participants" "table"
And I should see "Student 4" in the "participants" "table"
And I should not see "Student 4" in the "participants" "table"
And I should not see "Teacher 1" in the "participants" "table"
@javascript