Skip to content

Commit

Permalink
MDL-78587 course: use tertiary nav selector on participant pages.
Browse files Browse the repository at this point in the history
  • Loading branch information
paulholden committed Jul 12, 2023
1 parent 826553d commit 1125af7
Show file tree
Hide file tree
Showing 27 changed files with 72 additions and 103 deletions.
4 changes: 2 additions & 2 deletions admin/tests/behat/assign.feature
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ Feature: Staff can assign user roles
Scenario: Enrol at activity level using custom field search
When I am on the "page1" "Activity" page logged in as "admin"
And I navigate to "Permissions" in current page administration
And I select "Locally assigned roles" from the "jump" singleselect
And I set the field "Participants tertiary navigation" to "Locally assigned roles"
And I follow "Teacher"
And I set the field "addselect_searchtext" to "Kermit"
# The Behat 'I should see' step doesn't work for optgroup labels.
Expand All @@ -72,7 +72,7 @@ Feature: Staff can assign user roles
| user1 | editingteacher | Activity module | page1 |
When I am on the "page1" "Activity" page logged in as "admin"
And I navigate to "Permissions" in current page administration
And I select "Locally assigned roles" from the "jump" singleselect
And I set the field "Participants tertiary navigation" to "Locally assigned roles"
And I follow "Teacher"
And I set the field "removeselect_searchtext" to "Kermit"
# The Behat 'I should see' step doesn't work for optgroup labels.
Expand Down
4 changes: 2 additions & 2 deletions admin/tests/behat/check.feature
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ Feature: Staff can check user permissions
@javascript
Scenario: Search for a user (enrolled on the course) by custom field and select them to see permissions
When I am on the "C1" "permissions" page logged in as "admin"
And I select "Check permissions" from the "jump" singleselect
And I set the field "Participants tertiary navigation" to "Check permissions"
And I set the field "Search" to "Kermit"
# The Behat 'I should see' step doesn't work for optgroup labels.
Then "optgroup[label='Matching enrolled users (1)']" "css_element" should exist
Expand All @@ -42,7 +42,7 @@ Feature: Staff can check user permissions
@javascript
Scenario: Search for a user (not enrolled on the course) by custom field and select them to see permissions
When I am on the "C1" "permissions" page logged in as "admin"
And I select "Check permissions" from the "jump" singleselect
And I set the field "Participants tertiary navigation" to "Check permissions"
And I set the field "Search" to "Kermit"
# The Behat 'I should see' step doesn't work for optgroup labels.
Then "optgroup[label*='Potential users matching'][label*=' (1)']" "css_element" should exist
Expand Down
2 changes: 1 addition & 1 deletion admin/tool/behat/tests/behat/data_generators.feature
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ Feature: Set up contextual data for tests
And I am on the "Course 1" "groups" page
Then I should see "Group 1"
And I should see "Group 2"
And I select "Groupings" from the "jump" singleselect
And I set the field "Participants tertiary navigation" to "Groupings"
And I should see "Grouping 1"
And I should see "Grouping 2"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,7 @@ Feature: Basic recycle bin functionality
And I wait to be redirected
And I go to the courses management page
And I should see "Course 2" in the "#course-listing" "css_element"
And I am on the "Course 2" "groups" page
And I select "Overview" from the "jump" singleselect
And I am on the "Course 2" "groups overview" page
And "Student 1" "text" should exist in the "Group A" "table_row"
And "Student 2" "text" should exist in the "Group A" "table_row"
And "Student 2" "text" should exist in the "Group B" "table_row"
Expand Down
4 changes: 2 additions & 2 deletions admin/tool/uploaduser/tests/behat/upload_users.feature
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ Feature: Upload users
And I am on site homepage
And I navigate to "Courses > Manage courses and categories" in site administration
And I click on "permissions" action for "MGMT" in management category listing
And I select "Assign roles" from the "jump" singleselect
And I set the field "Participants tertiary navigation" to "Assign roles"
And I should see "Manager"
And I should see "Tom Jones"
And I should see "Trent Reznor"
Expand All @@ -249,7 +249,7 @@ Feature: Upload users
And I am on site homepage
And I navigate to "Courses > Manage courses and categories" in site administration
And I click on "permissions" action for "Film" in management category listing
And I select "Assign roles" from the "jump" singleselect
And I set the field "Participants tertiary navigation" to "Assign roles"
And I should see "Course creator"
And I should see "Federico Fellini"

Expand Down
4 changes: 2 additions & 2 deletions backup/util/ui/tests/behat/import_groups.feature
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ Feature: Option to include groups and groupings when importing a course to anoth
When I am on the "Course 2" "groups" page
Then I should see "Group 1"
And I should see "Group 2"
And I select "Groupings" from the "jump" singleselect
And I am on the "Course 2" "groupings" page
And I should see "Grouping 1"
And I should see "Grouping 2"

Expand All @@ -43,6 +43,6 @@ Feature: Option to include groups and groupings when importing a course to anoth
When I am on the "Course 2" "groups" page
Then I should not see "Group 1"
And I should not see "Group 2"
And I select "Groupings" from the "jump" singleselect
And I am on the "Course 2" "groupings" page
And I should not see "Grouping 1"
And I should not see "Grouping 2"
31 changes: 15 additions & 16 deletions course/templates/participants_actionbar.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,9 @@
Example context (json):
{
"urlselect" : {
"formid": "url_select_f61834256d7754158",
"classes": "urlselect",
"label": "",
"disabled": false,
"title":null,
"id":"url_select61834256d7754159",
"sesskey":"LWILINyZMH",
"action":"http:\/\/localhost\/stable_master\/course\/jumpto.php",
"showbutton":null,
"navigation" : {
"baseid": "select-menuf61834256d7754158",
"label": "Participant navigation",
"options": [
{
"name":"Enrolments",
Expand Down Expand Up @@ -92,20 +85,26 @@
]
}
],
"labelattributes":[],
"helpicon":false,
"attributes":[]
"selectedoption":"Enrolled users",
"name":"participantsnavigation",
"value":"\/user\/index.php?id=4",
"labelattributes":[
{
"name":"class",
"value":"sr-only"
}
]
},
"renderedcontent":"<div data-region=\"wrapper\" data-table-uniqueid=\"user-index-participants-4\"><\/div>"
}
}}
<div class="container-fluid tertiary-navigation" id="action_bar">
<div class="row">
{{#urlselect}}
{{#navigation}}
<div class="navitem">
{{> core/url_select }}
{{> core/tertiary_navigation_selector}}
</div>
{{/urlselect}}
{{/navigation}}
{{#renderedcontent}}
<div class="navitem">
{{{renderedcontent}}}
Expand Down
3 changes: 2 additions & 1 deletion course/tests/behat/category_management.feature
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,7 @@ Feature: Test category management actions
And "Move into" "select" should not be visible
And I press "Cancel"

@javascript
Scenario: Test I can assign roles for a category through the management interface.
Given the following "categories" exist:
| name | category | idnumber |
Expand All @@ -246,7 +247,7 @@ Feature: Test category management actions
And I go to the courses management page
And I should see the "Course categories and courses" management page
And I click on "permissions" action for "Cat 1" in management category listing
And I select "Assign roles" from the "jump" singleselect
And I set the field "Participants tertiary navigation" to "Assign roles"
# Redirect
And I should see "Assign roles in Category: Cat 1"
And I should see "Please choose a role to assign"
Expand Down
4 changes: 2 additions & 2 deletions course/tests/behat/course_category_breadcrumbs.feature
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ Feature: Course category breadcrumbs navigation
And I navigate to "Courses > Manage courses and categories" in site administration
And I follow "Cat 1"
And I navigate to "Permissions" in current page administration
When I select "Assign roles" from the "jump" singleselect
And I set the field "Participants tertiary navigation" to "Assign roles"
Then I should see "Courses" in the ".breadcrumb" "css_element"
And I should see "Cat 1" in the ".breadcrumb" "css_element"
And I should see "Assign roles" in the ".breadcrumb" "css_element"
Expand All @@ -147,7 +147,7 @@ Feature: Course category breadcrumbs navigation
And I navigate to "Courses > Manage courses and categories" in site administration
And I follow "Cat 1"
And I navigate to "Permissions" in current page administration
When I select "Check permissions" from the "jump" singleselect
When I set the field "Participants tertiary navigation" to "Check permissions"
Then I should see "Courses" in the ".breadcrumb" "css_element"
And I should see "Cat 1" in the ".breadcrumb" "css_element"
And I should see "Check permissions" in the ".breadcrumb" "css_element"
Expand Down
4 changes: 2 additions & 2 deletions enrol/cohort/tests/behat/enrolcohorts.feature
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ Feature: Cohort enrolment management
| Cohort | A1 |
| customint2 | -1 |
Then I should see "Cohort sync (Alpha1 - Student)"
And I select "Groups" from the "jump" singleselect
And I set the field "Participants tertiary navigation" to "Groups"
# Confirm that group was created and corresponding group members are present
And I set the field "groups[]" to "Alpha1 cohort (2)"
And the "members" select box should contain "Sandra Cole (s1@example.com)"
Expand Down Expand Up @@ -106,7 +106,7 @@ Feature: Cohort enrolment management
And I click on "Edit" "link" in the "Beta2" "table_row"
And I set the field "Add to group" to "Create new group"
And I click on "Save changes" "button"
And I select "Groups" from the "jump" singleselect
And I set the field "Participants tertiary navigation" to "Groups"
And I set the field "groups[]" to "Beta2 cohort (2)"
Then the "members" select box should contain "Bianca McAfee (s3@example.com)"
And the "members" select box should contain "Abigail Wyatt (s5@example.com)"
1 change: 0 additions & 1 deletion enrol/instances.php
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,6 @@

echo $OUTPUT->header();
echo $OUTPUT->render_participants_tertiary_nav($course);
echo $OUTPUT->heading(get_string('enrolmentinstances', 'enrol'));

echo $OUTPUT->box_start('generalbox boxaligncenter boxwidthnormal');

Expand Down
1 change: 0 additions & 1 deletion enrol/renameroles.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@

echo $OUTPUT->header();
echo $OUTPUT->render_participants_tertiary_nav($course);
echo $OUTPUT->heading(get_string('rolerenaming'));

echo $OUTPUT->paragraph(get_string('rolerenaming_help'));

Expand Down
3 changes: 1 addition & 2 deletions group/groupings.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,9 @@
$PAGE->set_title($strgroupings);
$PAGE->set_heading($course->fullname);
$PAGE->set_pagelayout('standard');
echo $OUTPUT->header();

echo $OUTPUT->header();
echo $OUTPUT->render_participants_tertiary_nav($course);
echo $OUTPUT->heading($strgroupings);

$data = array();
if ($groupings = $DB->get_records('groupings', array('courseid'=>$course->id), 'name')) {
Expand Down
1 change: 0 additions & 1 deletion group/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,6 @@
echo $OUTPUT->header();

echo $OUTPUT->render_participants_tertiary_nav($course);
echo $OUTPUT->heading(format_string($course->shortname, true, array('context' => $context)) .' '.$strgroups, 3);

$groups = groups_get_all_groups($courseid);
$selectedname = null;
Expand Down
4 changes: 1 addition & 3 deletions group/overview.php
Original file line number Diff line number Diff line change
Expand Up @@ -273,11 +273,9 @@ function($record, $supportshtml) use ($extrafields) {
$PAGE->set_title($strgroups);
$PAGE->set_heading($course->fullname);
$PAGE->set_pagelayout('standard');
echo $OUTPUT->header();

echo $OUTPUT->header();
echo $OUTPUT->render_participants_tertiary_nav($course);
/// Print overview
echo $OUTPUT->heading(format_string($course->shortname, true, array('context' => $context)) .' '.$stroverview, 3);

echo $strfiltergroups;

Expand Down
2 changes: 1 addition & 1 deletion group/tests/behat/auto_creation.feature
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ Feature: Automatic creation of groups
And I should see "No" in the "Group messaging" "select"
And I press "Cancel"
# Check groupings.
And I select "Groupings" from the "jump" singleselect
And I set the field "Participants tertiary navigation" to "Groupings"
And I should see "Grouping name"
And I click on "Show groups in grouping" "link" in the "Grouping name" "table_row"
And the "removeselect" select box should contain "Group A"
Expand Down
18 changes: 5 additions & 13 deletions group/tests/behat/bulk_messaging.feature
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,11 @@ Feature: Bulk update group messaging status
And the following "course enrolments" exist:
| user | course | role |
| teacher1 | C1 | editingteacher |
And I log in as "teacher1"
And I am on the "Course 1" "groups" page
And I press "Create group"
And I set the following fields to these values:
| Group name | Group-A-Test |
| Group ID number | Group-A-Test |
And I press "Save changes"
And I press "Create group"
And I set the following fields to these values:
| Group name | Group-B-Test |
| Group ID number | Group-B-Test |
And I press "Save changes"
And I select "Groups" from the "jump" singleselect
And the following "groups" exist:
| course | name | idnumber |
| C1 | Group-A-Test | GA |
| C1 | Group-B-Test | GB |
And I am on the "Course 1" "groups" page logged in as "teacher1"

@javascript
Scenario: Bulk enable messaging in groups
Expand Down
2 changes: 1 addition & 1 deletion group/tests/behat/create_groups.feature
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ Feature: Organize students into groups
| Group name | The greatest group that never existed |
And I press "Save changes"
And I should see "The greatest group that never existed"
And I select "Groupings" from the "jump" singleselect
And I am on the "Course 1" "groupings" page
And I press "Create grouping"
And the "idnumber" "field" should be readonly
And I set the following fields to these values:
Expand Down
4 changes: 2 additions & 2 deletions group/tests/behat/custom_fields.feature
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,12 @@ Feature: Custom profile fields in groups
And I am on the "Course 1" "groups" page

# Check the Overview page.
And I select "Overview" from the "jump" singleselect
And I set the field "Participants tertiary navigation" to "Overview"
And "Robin Hood (user1, fox)" "text" should exist in the "Canines" "table_row"
And "Little John (user2, bear)" "text" should exist in the "No group" "table_row"

# Check the groups page.
And I select "Groups" from the "jump" singleselect
And I set the field "Participants tertiary navigation" to "Groups"
And I set the field "groups" to "Canines"
And I should see "Robin Hood (user1, fox)"
And I should not see "Little John (user2, bear)"
Expand Down
34 changes: 11 additions & 23 deletions group/tests/behat/delete_groups.feature
Original file line number Diff line number Diff line change
Expand Up @@ -14,28 +14,16 @@ Feature: Automatic deletion of groups and groupings
And the following "course enrolments" exist:
| user | course | role |
| teacher1 | C1 | editingteacher |
And the following "groups" exist:
| course | name | idnumber |
| C1 | Group (without ID) | |
| C1 | Group (with ID) | An ID |
And the following "groupings" exist:
| course | name | idnumber |
| C1 | Grouping (without ID) | |
| C1 | Grouping (with ID) | An ID |
And I log in as "teacher1"
And I am on the "Course 1" "groups" page
And I press "Create group"
And I set the following fields to these values:
| Group name | Group (without ID) |
And I press "Save changes"
And I press "Create group"
And I set the following fields to these values:
| Group name | Group (with ID) |
| Group ID number | An ID |
And I press "Save changes"
And I select "Groupings" from the "jump" singleselect
And I press "Create grouping"
And I set the following fields to these values:
| Grouping name | Grouping (without ID) |
And I press "Save changes"
And I press "Create grouping"
And I set the following fields to these values:
| Grouping name | Grouping (with ID) |
| Grouping ID number | An ID |
And I press "Save changes"
And I select "Groups" from the "jump" singleselect
And I am on the "Course 1" "groups" page logged in as "teacher1"

@javascript
Scenario: Delete groups and groupings with and without ID numbers
Expand All @@ -47,7 +35,7 @@ Feature: Automatic deletion of groups and groupings
And I press "Delete"
And I press "Yes"
And the "groups" select box should not contain "Group (with ID) (0)"
And I select "Groupings" from the "jump" singleselect
And I set the field "Participants tertiary navigation" to "Groupings"
And I click on "Delete" "link" in the "Grouping (without ID)" "table_row"
And I press "Yes"
And I should not see "Grouping (without ID)"
Expand All @@ -67,7 +55,7 @@ Feature: Automatic deletion of groups and groupings
And I press "Delete"
And I press "Yes"
And I should not see "Group (without ID)"
And I select "Groupings" from the "jump" singleselect
And I set the field "Participants tertiary navigation" to "Groupings"
And "Delete" "link" should not exist in the "Grouping (with ID)" "table_row"
And I click on "Delete" "link" in the "Grouping (without ID)" "table_row"
And I press "Yes"
Expand Down
2 changes: 1 addition & 1 deletion group/tests/behat/groups_import.feature
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ Feature: Importing of groups and groupings
And I should see "No" in the "Group messaging" "select"
And I press "Cancel"
# Check groupings
And I select "Groupings" from the "jump" singleselect
And I set the field "Participants tertiary navigation" to "Groupings"
And I should see "Grouping-1"
And I should see "Grouping-2"
And I should see "Grouping-3"
Expand Down
7 changes: 3 additions & 4 deletions group/tests/behat/id_uniqueness.feature
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,10 @@ Feature: Uniqueness of Group ID number
And the following "course enrolments" exist:
| user | course | role |
| teacher1 | C1 | editingteacher |
And I log in as "teacher1"
And I am on the "Course 1" "groups" page

Scenario: Group ID number uniqueness
Given I press "Create group"
Given I am on the "Course 1" "groups" page logged in as "teacher1"
And I press "Create group"
And I set the following fields to these values:
| Group name | Group 1 |
| Group ID number | G1 |
Expand All @@ -41,7 +40,7 @@ Feature: Uniqueness of Group ID number
And I press "Cancel"

Scenario: Grouping ID number uniqueness
Given I select "Groupings" from the "jump" singleselect
Given I am on the "Course 1" "groupings" page logged in as "teacher1"
And I press "Create grouping"
And I set the following fields to these values:
| Grouping name | Grouping 1 |
Expand Down
Loading

0 comments on commit 1125af7

Please sign in to comment.