This commit is contained in:
Jake Dallimore
2025-11-04 14:08:40 +08:00
6 changed files with 39 additions and 16 deletions
@@ -0,0 +1,11 @@
issueNumber: MDL-86855
notes:
qbank_columnsortorder:
- message: >-
The Behat selector `column move handle` for the `qbank_columnsortorder` plugin has been removed.
When interacting with the column's move handle, please use the move handle's accessible name and type.
For example:
- `And I drag "Move Created by" "button" and I drop it in "Move T" "button"`
type: removed
@@ -71,6 +71,7 @@ class column_sort_ui implements renderable, templatable {
]);
$params['names'][] = [
'name' => $name,
'movetitle' => get_string('movecontent', 'core', $name),
'colname' => $colname,
'class' => $column->class,
'width' => $columnsizes[$column->id] ?? null,
@@ -36,6 +36,7 @@
* minwidth - The minimum value for the width field.
* width - The current value for the width field.
* actionmenu - The context for core/action_menu, a list of actions for the column.
* movetitle - The move handle button's accessible name. This is used by the core/drag_handle template.
* columnsdisabled - Are the any columns defined by disabled plugins?
* disabled - A list of disabled column names.
* disabledname - The disabled column's name.
@@ -73,7 +74,8 @@
"escapedid": "qbank_example__col_name_A-col_name_A",
"widthlabel": "Width of Column A",
"minwidth": "10",
"width": ""
"width": "",
"movetitle": "Move Column A"
},
{
"name": "Column B",
@@ -81,7 +83,8 @@
"columnid": "qbank_example\\col_name_B-col_name_B",
"escapedid": "qbank_example__col_name_B-col_name_B",
"minwidth": "10",
"width": "200"
"width": "200",
"movetitle": "Move Column B"
}
],
"columnsdisabled": true,
@@ -122,7 +125,9 @@
<table class="generaltable table table-fixed">
<thead>
<tr>
<th scope="col"></th>
<th scope="col">
<span class="visually-hidden">{{#str}}move{{/str}}</span>
</th>
<th scope="col">{{#str}}name{{/str}}</th>
<th scope="col">{{#str}}plugin{{/str}}</th>
<th scope="col" class="w-25">{{#str}}columnwidth, qbank_columnsortorder{{/str}}</th>
@@ -161,14 +166,17 @@
</form>
<div>
{{#columnsdisabled}}
{{#str}}qbankcolumnsdisabled, qbank_columnsortorder{{/str}}
<br>
<p>
{{#str}}qbankcolumnsdisabled, qbank_columnsortorder{{/str}}
</p>
<ul>
{{#disabled}}
<li>
{{disabledname}}
</li>
{{/disabled}}
</ul>
{{/columnsdisabled}}
{{#disabled}}
<div class="list-group-item disabled">
{{disabledname}}
</div>
{{/disabled}}
</div>
<div>
{{{urltomanageqbanks}}}
@@ -8,7 +8,7 @@ Feature: Set default question bank column order and size
Given I change the window size to "large"
And I log in as "admin"
When I navigate to "Plugins > Question bank plugins > Column sort order" in site administration
And I drag "Created by" "qbank_columnsortorder > column move handle" and I drop it in "T" "qbank_columnsortorder > column move handle"
And I drag "Move Created by" "button" and I drop it in "Move T" "button"
Then "Created by" "table_row" should appear before "T" "table_row"
And I reload the page
And "Created by" "table_row" should appear before "T" "table_row"
@@ -79,7 +79,7 @@ Feature: Set default question bank column order and size
And I should see "checkboxcustomcolumn"
And I navigate to "Plugins > Question bank plugins > Column sort order" in site administration
And "checkboxcustomcolumn" "table_row" should appear after "Comments" "table_row"
When I drag "checkboxcustomcolumn" "qbank_columnsortorder > column move handle" and I drop it in "Comments" "qbank_columnsortorder > column move handle"
When I drag "Move checkboxcustomcolumn" "button" and I drop it in "Move Comments" "button"
And I set the field "Width of 'checkboxcustomcolumn' in pixels" to "200"
And I follow "Preview"
And "checkboxcustomcolumn" "qbank_columnsortorder > column header" should appear before "Comments" "qbank_columnsortorder > column header"
@@ -146,3 +146,9 @@ Feature: Set default question bank column order and size
And I should not see "Category for test" in the "#customfield_catlist" "css_element"
And I navigate to "Plugins > Question bank plugins > Column sort order" in site administration
And I should see "Column sort order"
@accessibility
Scenario: The plugin administration page meets accessibility standards
Given I log in as "admin"
When I navigate to "Plugins > Question bank plugins > Column sort order" in site administration
Then the "region-main" "region" should meet accessibility standards with "best-practice" extra tests
@@ -32,9 +32,6 @@ class behat_qbank_columnsortorder extends behat_base {
new behat_component_named_selector('column header', [
"//th[contains(@data-name, %locator%)]",
]),
new behat_component_named_selector('column move handle', [
"//*[self::th or self::tr][contains(@data-name, %locator%)]//span[contains(@data-drag-type, 'move')]",
]),
new behat_component_named_selector('column resize handle', [
"//th[contains(@data-name, %locator%)]//span[contains(@data-action, 'resize')]",
]),
@@ -123,7 +123,7 @@ Feature: Set question bank column order and size
And I apply question bank filter "Category" with value "Question category 1"
And "Comments" "qbank_columnsortorder > column header" should appear before "Question" "qbank_columnsortorder > column header"
When I hover "Comments" "qbank_columnsortorder > column header"
And I drag "Comments" "qbank_columnsortorder > column move handle" and I drop it in "Status" "qbank_columnsortorder > column header"
And I drag "Move column 'Comments'" "button" and I drop it in "Status" "qbank_columnsortorder > column header"
Then "Comments" "qbank_columnsortorder > column header" should appear after "Question" "qbank_columnsortorder > column header"
And I reload the page
And "Comments" "qbank_columnsortorder > column header" should appear after "Question" "qbank_columnsortorder > column header"