Skip to content

Commit

Permalink
MDL-77941 blocks_overview: Remove duplicated strings for zero states
Browse files Browse the repository at this point in the history
  • Loading branch information
Amaia Anabitarte committed Apr 18, 2023
1 parent 7beda01 commit f4a172a
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 8 deletions.
6 changes: 3 additions & 3 deletions blocks/myoverview/classes/output/main.php
Expand Up @@ -555,21 +555,21 @@ public function export_for_zero_state_template(renderer_base $output) {
return $this->generate_zero_state_data(
$nocoursesimg,
array_reverse($buttons),
['title' => 'zero_default_title', 'intro' => 'zero_createcourses_intro']
['title' => 'zero_default_title', 'intro' => 'zero_default_intro']
);
}
return $this->generate_zero_state_data(
$nocoursesimg,
$buttons,
['title' => 'zero_default_title', 'intro' => 'zero_nomanagecourses_intro']
['title' => 'zero_default_title', 'intro' => 'zero_default_intro']
);
}
}

return $this->generate_zero_state_data(
$nocoursesimg,
[],
['title' => 'zero_default_title', 'intro' => 'zero_nopermission_intro']
['title' => 'zero_default_title', 'intro' => 'zero_default_intro']
);
}

Expand Down
4 changes: 1 addition & 3 deletions blocks/myoverview/lang/en/block_myoverview.php
Expand Up @@ -89,13 +89,11 @@
$string['privacy:request:preference:set'] = 'The value of the setting \'{$a->name}\' was \'{$a->value}\'';
$string['viewquickstart'] = 'View Quickstart guide';
$string['zero_default_title'] = 'You\'re not enrolled in any course';
$string['zero_nopermission_intro'] = 'Once you enrol in a course, it will appear here.';
$string['zero_default_intro'] = 'Once you enrol in a course, it will appear here.';
$string['zero_request_title'] = 'Request your first course';
$string['zero_request_intro'] = 'Need help getting started? Check out the <a href="{$a->dochref}" title="{$a->doctitle}" target="{$a->doctarget}">Moodle documentation</a> or take your first steps with our <a href="{$a->quickhref}" title="{$a->quicktitle}" target="{$a->quicktarget}">Quickstart guide</a>.';
$string['zero_nocourses_title'] = 'Create your first course';
$string['zero_nocourses_intro'] = 'Need help getting started? Check out the <a href="{$a->dochref}" title="{$a->doctitle}" target="{$a->doctarget}">Moodle documentation</a> or take your first steps with our Quickstart guide.';
$string['zero_createcourses_intro'] = 'Once you enrol in a course, it will appear here.';
$string['zero_nomanagecourses_intro'] = 'Once you enrol in a course, it will appear here.';

// Deprecated since Moodle 4.0.
$string['clearsearch'] = "Clear search";
Expand Down
Expand Up @@ -41,7 +41,7 @@ Feature: Zero state on my overview block
And I click on "Create course" "button"
And I should see "Add a new course"

Scenario: Users with permissions to create a course but is not enroled in any existing course
Scenario: Users with permissions to create a course but is not enrolled in any existing course
Given the following "course" exists:
| fullname | Course 1 |
| shortname | C1 |
Expand All @@ -56,7 +56,7 @@ Feature: Zero state on my overview block
And I click on "Manage courses" "button"
And I should see "Course 1"

Scenario: Users with permissions to create but not to manage courses and is not enroled in any existing course
Scenario: Users with permissions to create but not to manage courses and is not enrolled in any existing course
Given the following "permission overrides" exist:
| capability | permission | role | contextlevel | reference |
| moodle/category:manage | Prohibit | manager | System | |
Expand Down

0 comments on commit f4a172a

Please sign in to comment.