Merge branch 'MDL-77685-402' of https://github.com/paulholden/moodle into MOODLE_402_STABLE

This commit is contained in:
Ilya Tregubov
2024-05-31 09:09:05 +08:00
4 changed files with 9 additions and 28 deletions
+2 -10
View File
@@ -835,16 +835,8 @@ class grade_edit_tree_column_name extends grade_edit_tree_column {
$itemicon = \html_writer::div($params['icon'], 'mr-1');
$itemtype = \html_writer::span($params['type'], 'd-block text-uppercase small dimmed_text');
// Generate the content for a cell that represents a grade item.
// If a behat test site is running avoid outputting the information about the type of the grade item.
// This additional information causes issues in behat particularly with the existing xpath used to
// interact with table elements.
if (!defined('BEHAT_SITE_RUNNING')) {
$content = \html_writer::div($itemtype . $params['name']);
} else {
$content = \html_writer::div($params['name']);
}
$itemtitle = html_writer::div($params['name'], 'rowtitle');
$content = \html_writer::div($itemtype . $itemtitle);
$moveaction = isset($params['moveaction']) ? $params['moveaction'] : '';
@@ -190,14 +190,9 @@ class user extends tablelike implements selectable_items {
$itemicon = html_writer::div($this->format_icon($item), 'mr-1');
$itemtype = \html_writer::span($this->structure->get_element_type_string($gradetreeitem),
'd-block text-uppercase small dimmed_text');
// If a behat test site is running avoid outputting the information about the type of the grade item.
// This additional information currently causes issues in behat particularly with the existing xpath used to
// interact with table elements.
if (!defined('BEHAT_SITE_RUNNING')) {
$itemcontent = html_writer::div($itemtype . $itemname);
} else {
$itemcontent = html_writer::div($itemname);
}
$itemtitle = html_writer::div($itemname, 'rowtitle');
$itemcontent = html_writer::div($itemtype . $itemtitle);
$line = [
html_writer::div($itemicon . $itemcontent . $lockicon, "{$type} d-flex align-items-center"),
+2 -8
View File
@@ -551,14 +551,8 @@ class user extends grade_report {
}
// Generate the content for a cell that represents a grade item.
// If a behat test site is running avoid outputting the information about the type of the grade item.
// This additional information causes issues in behat particularly with the existing xpath used to
// interact with table elements.
if (!defined('BEHAT_SITE_RUNNING')) {
$content = \html_writer::div($itemtype . $fullname);
} else {
$content = \html_writer::div($fullname);
}
$itemtitle = \html_writer::div($fullname, 'rowtitle');
$content = \html_writer::div($itemtype . $itemtitle);
// Name.
$data['itemname']['content'] = \html_writer::div($itemicon . $content, "{$type} d-flex align-items-center");
+2 -2
View File
@@ -1456,8 +1456,8 @@ EOF;
// Check if value exists in specific row/column.
// Get row xpath.
// GoutteDriver uses DomCrawler\Crawler and it is making XPath relative to the current context, so use descendant.
$rowxpath = $tablexpath."/tbody/tr[descendant::th[normalize-space(.)=" . $rowliteral .
"] | descendant::td[normalize-space(.)=" . $rowliteral . "]]";
$rowxpath = $tablexpath . "/tbody/tr[descendant::*[@class='rowtitle'][normalize-space(.)=" . $rowliteral . "] | " . "
descendant::th[normalize-space(.)=" . $rowliteral . "] | descendant::td[normalize-space(.)=" . $rowliteral . "]]";
$columnvaluexpath = $rowxpath . $columnpositionxpath . "[contains(normalize-space(.)," . $valueliteral . ")]";