Skip to content

Commit

Permalink
MDL-69863 tool_brickfield: Ensuring navigation is correct.
Browse files Browse the repository at this point in the history
  • Loading branch information
mchurchward authored and stronk7 committed May 4, 2021
1 parent 11dcd41 commit b8c7cf9
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
8 changes: 7 additions & 1 deletion admin/tool/brickfield/index.php
Expand Up @@ -35,6 +35,7 @@
use tool_brickfield\task\process_analysis_requests;

require('../../../config.php');
require_once($CFG->libdir.'/adminlib.php');

// If this feature has been disabled, do nothing.
accessibility::require_accessibility_enabled();
Expand Down Expand Up @@ -110,7 +111,12 @@

$tool->set_filter(new filter($courseid, $categoryid, $tab, $page, $perpage, $url, $target));

$PAGE->navigation->override_active_url($navurl);
// Course and site require different navigation setups.
if ($courseid > SITEID) {
$PAGE->navigation->override_active_url($navurl);
} else {
admin_externalpage_setup('tool_brickfield_reports', '', null, '', ['pagelayout' => 'report']);
}
$PAGE->set_context($context);
$PAGE->set_url($url);
$PAGE->set_pagelayout($layout);
Expand Down
2 changes: 1 addition & 1 deletion admin/tool/brickfield/lang/en/tool_brickfield.php
Expand Up @@ -83,7 +83,7 @@
$string['eventreport_downloadeddesc'] = 'Accessibility summary was downloaded for course id {$a}.';
$string['failed'] = 'Failed';
$string['failedcount'] = 'Failed: {$a}';
$string['tools'] = 'Go to reports';
$string['tools'] = 'Reports';
$string['formcorrectlysubmitted'] = 'Check Process successfully added';
$string['formdescription'] = 'This will add a new check process record which will run as a scheduled task';
$string['formtitle'] = 'Add Check Process';
Expand Down
6 changes: 3 additions & 3 deletions admin/tool/brickfield/tests/behat/accessresults.feature
Expand Up @@ -11,14 +11,14 @@ Feature: Brickfield activityresults
| label | Label two | <a href="modle.org">Click here</a> | C1 | id002 |

@javascript
Scenario: Test the Brickfield accessibility reports plugin
Scenario: Test the Brickfield accessibility tool plugin
Given I log in as "admin"
And I navigate to "Plugins > Admin tools > Accessibility > Brickfield registration" in site administration
And I set the field "id_key" to "123456789012345678901234567890ab"
And I set the field "id_hash" to "ab123456789012345678901234567890"
And I press "Activate"
Then I should see "Your accessibility toolkit is still being validated."
And I navigate to "Plugins > Admin tools > Accessibility > Go to reports" in site administration
And I navigate to "Plugins > Admin tools > Accessibility > Reports" in site administration
And I press "Submit for analysis"
Then I should see "The global (course independent) content has been scheduled for analysis."
And I am on "Course 1" course homepage
Expand All @@ -39,7 +39,7 @@ Feature: Brickfield activityresults
And I set the field "id_key" to "123456789012345678901234567890ab"
And I set the field "id_hash" to "ab123456789012345678901234567890"
And I press "Activate"
And I navigate to "Plugins > Admin tools > Accessibility > Go to reports" in site administration
And I navigate to "Plugins > Admin tools > Accessibility > Reports" in site administration
And I should see "Error details: All reviewed courses (2 courses)"
And I follow "Activity breakdown"
Then I should see "Results per activity: All reviewed courses (2 courses)"
Expand Down

0 comments on commit b8c7cf9

Please sign in to comment.