Skip to content

Commit

Permalink
Merge branch 'MDL-73113-master' of https://github.com/aanabit/moodle
Browse files Browse the repository at this point in the history
  • Loading branch information
junpataleta committed Dec 2, 2021
2 parents e660029 + 21eec08 commit 9c87d07
Show file tree
Hide file tree
Showing 9 changed files with 131 additions and 131 deletions.
2 changes: 1 addition & 1 deletion blocks/myoverview/amd/build/view.min.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions blocks/myoverview/amd/src/view.js
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ const hideCourse = (root, courseId) => {
setCourseHiddenState(courseId, true);

// Remove the course from this view as it is now hidden and thus not covered by this view anymore.
// Do only if we are not in "All" view mode where really all courses are shown.
// Do only if we are not in "All (including archived)" view mode where really all courses are shown.
if (filters.grouping !== GROUPINGS.GROUPING_ALLINCLUDINGHIDDEN) {
hideElement(root, courseId);
}
Expand All @@ -321,7 +321,7 @@ const showCourse = (root, courseId) => {
setCourseHiddenState(courseId, null);

// Remove the course from this view as it is now shown again and thus not covered by this view anymore.
// Do only if we are not in "All" view mode where really all courses are shown.
// Do only if we are not in "All (including archived)" view mode where really all courses are shown.
if (filters.grouping !== GROUPINGS.GROUPING_ALLINCLUDINGHIDDEN) {
hideElement(root, courseId);
}
Expand Down
16 changes: 8 additions & 8 deletions blocks/myoverview/lang/en/block_myoverview.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/

$string['allincludinghidden'] = 'All';
$string['all'] = 'All (except removed from view)';
$string['allincludinghidden'] = 'All (including archived)';
$string['all'] = 'All';
$string['addtofavourites'] = 'Star this course';
$string['aria:addtofavourites'] = 'Star for';
$string['aria:allcoursesincludinghidden'] = 'Show all courses';
$string['aria:allcourses'] = 'Show all courses except courses removed from view';
$string['aria:allcourses'] = 'Show all courses except archived courses';
$string['aria:card'] = 'Switch to card view';
$string['aria:controls'] = 'Course overview controls';
$string['aria:courseactions'] = 'Actions for current course';
Expand Down Expand Up @@ -81,11 +81,11 @@
$string['title'] = 'Course name';
$string['aria:hidecourse'] = 'Remove {$a} from view';
$string['aria:showcourse'] = 'Restore {$a} to view';
$string['aria:hiddencourses'] = 'Show courses removed from view';
$string['hidden'] = 'Courses removed from view';
$string['hidecourse'] = 'Remove from view';
$string['hiddencourses'] = 'Removed from view';
$string['show'] = 'Restore to view';
$string['aria:hiddencourses'] = 'Show archived courses';
$string['hidden'] = 'Archived courses';
$string['hidecourse'] = 'Archive';
$string['hiddencourses'] = 'Archived';
$string['show'] = 'Unarchive';
$string['privacy:request:preference:set'] = 'The value of the setting \'{$a->name}\' was \'{$a->value}\'';

// Deprecated since Moodle 3.7.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,48 +26,47 @@ Feature: The my overview block allows admins to easily configure the students' c
| student1 | C4 | student |
| student1 | C5 | student |

Scenario: Enable 'All' course filter option
Scenario: Enable 'All (including archived)' course filter option
Given I log in as "admin"
And I navigate to "Plugins > Blocks > Course overview" in site administration
And I set the field "All" to "1"
And I set the field "All (including archived)" to "1"
And I press "Save"
And I log out
Then I am on the "My courses" page logged in as "student1"
And I click on "All (except removed from view)" "button" in the "Course overview" "block"
# We have to check for the data attribute instead of the list element text as we would get false positives from the "All (except removed from view)" element otherwise
Then "[data-value='allincludinghidden']" "css_element" should exist in the ".block_myoverview .dropdown-menu" "css_element"
And I click on "All" "button" in the "Course overview" "block"
# We have to check for the data attribute instead of the list element text as we would get false positives from the "All" element otherwise
Then "All (including archived)" "list_item" should exist in the ".block_myoverview .dropdown-menu" "css_element"

Scenario: Disable 'All' course filter option
Scenario: Disable 'All (including archived)' course filter option
Given I log in as "admin"
And I navigate to "Plugins > Blocks > Course overview" in site administration
And I set the field "All" to "0"
And I set the field "All (including archived)" to "0"
And I press "Save"
And I log out
Then I am on the "My courses" page logged in as "student1"
And I click on "All (except removed from view)" "button" in the "Course overview" "block"
# We have to check for the data attribute instead of the list element text as we would get false negatives "All (except removed from view)" element otherwise
Then "[data-value='allincludinghidden']" "css_element" should not exist in the ".block_myoverview .dropdown-menu" "css_element"
And I click on "All" "button" in the "Course overview" "block"
Then "All (including archived)" "list_item" should not exist in the ".block_myoverview .dropdown-menu" "css_element"

Scenario: Enable 'All (except removed from view)' course filter option
Scenario: Enable 'All' course filter option
Given I log in as "admin"
And I navigate to "Plugins > Blocks > Course overview" in site administration
And I set the field "All (except removed from view)" to "1"
And I set the field "All" in the "//*[@id=\"admin-displaygroupingall\"]" "xpath_element" to "1"
And I press "Save"
And I log out
Then I am on the "My courses" page logged in as "student1"
And I click on "All (except removed from view)" "button" in the "Course overview" "block"
Then "All (except removed from view)" "list_item" should exist in the ".block_myoverview .dropdown-menu" "css_element"
And I click on "All" "button" in the "Course overview" "block"
Then "[data-value='all']" "css_element" should exist in the ".block_myoverview .dropdown-menu" "css_element"

Scenario: Disable 'All (except removed from view)' course filter option
Scenario: Disable 'All' course filter option
Given I log in as "admin"
And I navigate to "Plugins > Blocks > Course overview" in site administration
And I set the field "All (except removed from view)" to "0"
And I set the field "All" in the "//*[@id=\"admin-displaygroupingall\"]" "xpath_element" to "0"
And I press "Save"
And I log out
Then I am on the "My courses" page logged in as "student1"
# 'All (except removed from view)' option has been disabled, so the button is falling back to the 'In progress' option which is the next enabled option.
# 'All' option has been disabled, so the button is falling back to the 'In progress' option which is the next enabled option.
And I click on "In progress" "button" in the "Course overview" "block"
Then "All (except removed from view)" "list_item" should not exist in the ".block_myoverview .dropdown-menu" "css_element"
Then "[data-value='all']" "css_element" should not exist in the ".block_myoverview .dropdown-menu" "css_element"

Scenario: Enable 'In progress' course filter option
Given I log in as "admin"
Expand All @@ -76,7 +75,8 @@ Feature: The my overview block allows admins to easily configure the students' c
And I press "Save"
And I log out
Then I am on the "My courses" page logged in as "student1"
And I click on "All (except removed from view)" "button" in the "Course overview" "block"
And I click on "All" "button" in the "Course overview" "block"
# We have to check for the data attribute instead of the list element text as we would get false negatives "All (including archived)" element otherwise
Then "In progress" "list_item" should exist in the ".block_myoverview .dropdown-menu" "css_element"

Scenario: Disable 'In progress' course filter option
Expand All @@ -86,7 +86,7 @@ Feature: The my overview block allows admins to easily configure the students' c
And I press "Save"
And I log out
Then I am on the "My courses" page logged in as "student1"
And I click on "All (except removed from view)" "button" in the "Course overview" "block"
And I click on "All" "button" in the "Course overview" "block"
Then "In progress" "list_item" should not exist in the ".block_myoverview .dropdown-menu" "css_element"

Scenario: Enable 'Future' course filter option
Expand All @@ -96,7 +96,7 @@ Feature: The my overview block allows admins to easily configure the students' c
And I press "Save"
And I log out
Then I am on the "My courses" page logged in as "student1"
And I click on "All (except removed from view)" "button" in the "Course overview" "block"
And I click on "All" "button" in the "Course overview" "block"
Then "Future" "list_item" should exist in the ".block_myoverview .dropdown-menu" "css_element"

Scenario: Disable 'Future' course filter option
Expand All @@ -106,7 +106,7 @@ Feature: The my overview block allows admins to easily configure the students' c
And I press "Save"
And I log out
Then I am on the "My courses" page logged in as "student1"
And I click on "All (except removed from view)" "button" in the "Course overview" "block"
And I click on "All" "button" in the "Course overview" "block"
Then "Future" "list_item" should not exist in the ".block_myoverview .dropdown-menu" "css_element"

Scenario: Enable 'Past' course filter option
Expand All @@ -116,7 +116,7 @@ Feature: The my overview block allows admins to easily configure the students' c
And I press "Save"
And I log out
Then I am on the "My courses" page logged in as "student1"
And I click on "All (except removed from view)" "button" in the "Course overview" "block"
And I click on "All" "button" in the "Course overview" "block"
Then "Past" "list_item" should exist in the ".block_myoverview .dropdown-menu" "css_element"

Scenario: Disable 'Past' course filter option
Expand All @@ -126,7 +126,7 @@ Feature: The my overview block allows admins to easily configure the students' c
And I press "Save"
And I log out
Then I am on the "My courses" page logged in as "student1"
And I click on "All (except removed from view)" "button" in the "Course overview" "block"
And I click on "All" "button" in the "Course overview" "block"
Then "Past" "list_item" should not exist in the ".block_myoverview .dropdown-menu" "css_element"

Scenario: Enable 'Starred' course filter option
Expand All @@ -136,7 +136,7 @@ Feature: The my overview block allows admins to easily configure the students' c
And I press "Save"
And I log out
Then I am on the "My courses" page logged in as "student1"
And I click on "All (except removed from view)" "button" in the "Course overview" "block"
And I click on "All" "button" in the "Course overview" "block"
Then "Starred" "list_item" should exist in the ".block_myoverview .dropdown-menu" "css_element"

Scenario: Disable 'Starred' course filter option
Expand All @@ -146,39 +146,39 @@ Feature: The my overview block allows admins to easily configure the students' c
And I press "Save"
And I log out
Then I am on the "My courses" page logged in as "student1"
And I click on "All (except removed from view)" "button" in the "Course overview" "block"
And I click on "All" "button" in the "Course overview" "block"
Then "Starred" "list_item" should not exist in the ".block_myoverview .dropdown-menu" "css_element"

Scenario: Enable 'Removed courses' course filter option
Given I log in as "admin"
And I navigate to "Plugins > Blocks > Course overview" in site administration
And I set the field "Removed from view" to "1"
And I set the field "Archived" to "1"
And I press "Save"
And I log out
Then I am on the "My courses" page logged in as "student1"
And I click on "All (except removed from view)" "button" in the "Course overview" "block"
Then "Removed from view" "list_item" should exist in the ".block_myoverview .dropdown-menu" "css_element"
And I click on "All" "button" in the "Course overview" "block"
Then "Archived" "list_item" should exist in the ".block_myoverview .dropdown-menu" "css_element"

Scenario: Disable 'Removed courses' course filter option
Given I log in as "admin"
And I navigate to "Plugins > Blocks > Course overview" in site administration
And I set the field "Removed from view" to "0"
And I set the field "Archived" to "0"
And I press "Save"
And I log out
Then I am on the "My courses" page logged in as "student1"
And I click on "All (except removed from view)" "button" in the "Course overview" "block"
Then "Removed from view" "list_item" should not exist in the ".block_myoverview .dropdown-menu" "css_element"
And I click on "All" "button" in the "Course overview" "block"
Then "Archived" "list_item" should not exist in the ".block_myoverview .dropdown-menu" "css_element"

Scenario: Disable all course filter options
Given I log in as "admin"
And I navigate to "Plugins > Blocks > Course overview" in site administration
And I set the field "All" to "0"
And I set the field "All (except removed from view)" to "0"
And I set the field "All (including archived)" to "0"
And I set the field "All" in the "//*[@id=\"admin-displaygroupingall\"]" "xpath_element" to "0"
And I set the field "In progress" to "0"
And I set the field "Future" to "0"
And I set the field "Past" to "0"
And I set the field "Starred" to "0"
And I set the field "Removed from view" to "0"
And I set the field "Archived" to "0"
And I press "Save"
And I log out
And I am on the "My courses" page logged in as "student1"
Expand All @@ -192,13 +192,13 @@ Feature: The my overview block allows admins to easily configure the students' c
Scenario: Disable all but one course filter option
Given I log in as "admin"
And I navigate to "Plugins > Blocks > Course overview" in site administration
And I set the field "All" to "0"
And I set the field "All (except removed from view)" to "0"
And I set the field "All (including archived)" to "0"
And I set the field "All" in the "//*[@id=\"admin-displaygroupingall\"]" "xpath_element" to "0"
And I set the field "In progress" to "1"
And I set the field "Future" to "0"
And I set the field "Past" to "0"
And I set the field "Starred" to "0"
And I set the field "Removed from view" to "0"
And I set the field "Archived" to "0"
And I press "Save"
And I log out
And I am on the "My courses" page logged in as "student1"
Expand Down
Loading

0 comments on commit 9c87d07

Please sign in to comment.