MDL-72092 core: Re-arrange the default dashboard

This commit is contained in:
Mathew May
2022-02-25 15:12:50 +08:00
committed by Peter Dias
parent e94167174a
commit f0cedb93e8
8 changed files with 15 additions and 15 deletions
+2 -2
View File
@@ -142,8 +142,8 @@ function xmldb_block_myoverview_upgrade($oldversion) {
)->id;
// See if this block already somehow exists, it should not but who knows.
if (!$DB->get_record('block_instances', ['blockname' => 'myoverview',
'pagetypepattern' => 'my-index', 'subpagepattern' => $subpagepattern])) {
if (!$DB->record_exists('block_instances', ['blockname' => 'myoverview',
'pagetypepattern' => 'my-index', 'subpagepattern' => $subpagepattern])) {
$page = new moodle_page();
$systemcontext = context_system::instance();
$page->set_context($systemcontext);
@@ -8,6 +8,9 @@ Feature: The private files block allows users to store files privately in moodle
Given the following "users" exist:
| username | firstname | lastname | email |
| teacher1 | Teacher | 1 | teacher1@example.com |
And the following "blocks" exist:
| blockname | contextlevel | reference | pagetypepattern | defaultregion |
| private_files | System | 1 | my-index | side-post |
And I log in as "teacher1"
And "Private files" "block" should exist
And I should see "No files available" in the "Private files" "block"
@@ -22,8 +22,6 @@ Feature: The recently accessed items block allows users to easily access their m
| idnumber | Test forum name |
| name | Test forum name |
And I log in as "student1"
And I turn editing mode on
And I add the "Recently accessed items" block
Scenario: User has not accessed any item
Then I should see "No recent items" in the "Recently accessed items" "block"
@@ -51,7 +51,7 @@ Feature: Add and configure blocks throughout the site
Scenario: Blocks on the dashboard page can have roles assigned to them
Given I log in as "manager1"
When I turn editing mode on
Then I should see "Assign roles in Private files block"
Then I should see "Assign roles in Recently accessed items block"
Scenario: Blocks on courses can have roles assigned to them
Given I log in as "teacher1"
+1 -2
View File
@@ -2686,8 +2686,7 @@ function blocks_add_default_system_blocks() {
$page->blocks->add_blocks([
BLOCK_POS_RIGHT => [
'private_files',
'badges',
'recentlyaccesseditems',
],
'content' => [
'timeline',
+1 -1
View File
@@ -23,6 +23,6 @@ Feature: Add blocks to dashboard page
And I add the "Latest announcements" block
And I turn editing mode off
Then I should see "Latest announcements" in the "Latest announcements" "block"
And I should see "Latest badges" in the "Latest badges" "block"
And I should see "Timeline" in the "Timeline" "block"
And I should see "Calendar" in the "Calendar" "block"
And I should not see "Upcoming events"
+6 -6
View File
@@ -45,8 +45,8 @@ Feature: Reset all personalised pages to default
And I navigate to "Appearance > Default Dashboard page" in site administration
And I turn editing mode on
And I add the "Latest announcements" block
And I open the "Latest badges" blocks action menu
And I follow "Delete Latest badges block"
And I open the "Timeline" blocks action menu
And I follow "Delete Timeline block"
And I press "Yes"
And I turn editing mode off
And I log out
@@ -54,13 +54,13 @@ Feature: Reset all personalised pages to default
And I log in as "student1"
And I follow "Dashboard"
And I should not see "Latest announcements"
And I should see "Latest badges"
And I should see "Timeline"
And I log out
And I log in as "student3"
And I follow "Dashboard"
And I should not see "Latest announcements"
And I should see "Latest badges"
And I should see "Timeline"
And I log out
And I log in as "admin"
@@ -73,13 +73,13 @@ Feature: Reset all personalised pages to default
And I follow "Dashboard"
Then I should see "Latest announcements"
And I should not see "Comments"
And I should not see "Latest badges"
And I should not see "Timeline"
And I log out
And I log in as "student3"
And I follow "Dashboard"
And I should see "Latest announcements"
And I should not see "Latest badges"
And I should not see "Timeline"
And I log out
# Check that this did not affect the customised profiles.
+1 -1
View File
@@ -24,7 +24,7 @@ Feature: Reset dashboard page to default
And I add the "Comments" block
And I press "Reset page to default"
Then I should not see "Latest announcements"
And I should see "Latest badges"
And I should see "Timeline"
And I should see "Calendar"
And I should not see "Upcoming events"
And I should not see "Comments"