Skip to content

Commit

Permalink
MDL-76143 gradebook: Add search into graderreport
Browse files Browse the repository at this point in the history
  • Loading branch information
Chocolate-lightning committed Mar 30, 2023
1 parent f7a8df2 commit d80fb6c
Show file tree
Hide file tree
Showing 29 changed files with 1,628 additions and 7 deletions.
2 changes: 1 addition & 1 deletion grade/amd/build/searchwidget/initials.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion grade/amd/build/searchwidget/initials.min.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion grade/amd/src/searchwidget/initials.js
Expand Up @@ -117,7 +117,7 @@ const registerListenerEvents = (callingLink) => {
}

// Handle form submissions.
if (e.target.type === selectors.formItems.type) {
if (e.target.closest(`${selectors.formDropdown}`) && e.target.type === selectors.formItems.type) {
if (e.target.dataset.action === selectors.formItems.save) {
// Ensure we strip out the value (All) as it messes with the PHP side of the initials bar.
// Then we will redirect the user back onto the page with new filters applied.
Expand Down
9 changes: 8 additions & 1 deletion grade/classes/output/gradebook_dropdown.php
Expand Up @@ -56,6 +56,9 @@ class gradebook_dropdown implements renderable, templatable {
/** @var null|string $buttonheader If the button item in the tertiary nav needs an extra top header for context. */
protected $buttonheader;

/** @var boolean $usesbutton Whether to provide a A11y button. */
protected $usesbutton;

/**
* The class constructor.
*
Expand All @@ -66,6 +69,7 @@ class gradebook_dropdown implements renderable, templatable {
* @param ?string $buttonclasses Any special classes that may be needed.
* @param ?string $dropdownclasses Any special classes that may be needed.
* @param ?string $buttonheader If the button item in the tertiary nav needs an extra top header for context.
* @param bool $usebutton If we want the mustache to add the button roles for us or do we have another aria role node?
* @throws moodle_exception If the implementor incorrectly call this module.
*/
public function __construct(
Expand All @@ -75,7 +79,8 @@ public function __construct(
?string $parentclasses = null,
?string $buttonclasses = null,
?string $dropdownclasses = null,
?string $buttonheader = null
?string $buttonheader = null,
?bool $usebutton = true
) {
// Ensure implementors cant request to render the content now and not provide us any to show.
if (!$renderlater && empty($dropdowncontent)) {
Expand All @@ -94,6 +99,7 @@ public function __construct(
$this->buttonclasses = $buttonclasses;
$this->dropdownclasses = $dropdownclasses;
$this->buttonheader = $buttonheader;
$this->usesbutton = $usebutton;
}

/**
Expand All @@ -112,6 +118,7 @@ public function export_for_template(renderer_base $output): array {
'buttonclasses' => $this->buttonclasses,
'dropdownclasses' => $this->dropdownclasses,
'buttonheader' => $this->buttonheader,
'usebutton' => $this->usesbutton,
];
}

Expand Down
3 changes: 3 additions & 0 deletions grade/report/grader/amd/build/search.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit d80fb6c

Please sign in to comment.