Skip to content

Commit

Permalink
Merge branch 'MDL-73917-master' of https://github.com/sarjona/moodle
Browse files Browse the repository at this point in the history
  • Loading branch information
stronk7 committed Feb 27, 2022
2 parents 6e6037d + d4ebb39 commit dd24a77
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 8 deletions.
7 changes: 4 additions & 3 deletions lang/en/message.php
Expand Up @@ -62,7 +62,7 @@
$string['deleteselectedmessagesconfirmselfconversation'] = 'Are you sure you would like to delete the selected personal messages?';
$string['disableall'] = 'Disable notifications';
$string['disabled'] = 'Messaging is disabled on this site';
$string['disallowed'] = 'Disallowed';
$string['disallowed'] = 'Locked off';
$string['editmessages'] = 'Edit messages';
$string['emailtagline'] = 'This is a copy of a message sent to you at "{$a->sitename}". Go to {$a->url} to reply.';
$string['enabled'] = 'Enabled';
Expand All @@ -81,6 +81,7 @@
$string['eventmessageviewed'] = 'Message viewed';
$string['eventmessagesent'] = 'Message sent';
$string['forced'] = 'Locked';
$string['forcedmessage'] = 'Locked on';
$string['guestnoeditmessage'] = 'Guest user can not edit messaging options';
$string['guestnoeditmessageother'] = 'Guest user can not edit other user messaging options';
$string['groupinfo'] = 'Group info';
Expand Down Expand Up @@ -209,8 +210,8 @@
$string['privacy:export:conversationprefix'] = 'Conversation: ';
$string['processorsettings'] = 'Processor settings';
$string['providerenabled'] = 'Sending "{$a}" enabled status';
$string['providerprocesorislocked'] = '"{$a->provider}" on "{$a->processor}" is locked';
$string['providerprocesorisdisallowed'] = '"{$a->provider}" on "{$a->processor}" is disallowed';
$string['providerprocesorislocked'] = '"{$a->provider}" on "{$a->processor}" is locked on';
$string['providerprocesorisdisallowed'] = '"{$a->provider}" on "{$a->processor}" is locked off';
$string['removecontact'] = 'Remove contact';
$string['removecontactconfirm'] = 'Are you sure you want to remove {$a} from your contacts?';
$string['removecoursefilter'] = 'Remove filter for course {$a}';
Expand Down
Expand Up @@ -157,7 +157,7 @@ public function export_for_template(\renderer_base $output) {
// If settings are disallowed or forced, just display the corresponding message, if not use user settings.
if ($context['locked']) {
if ($context['enabled']) {
$context['lockedmessage'] = get_string('forced', 'message');
$context['lockedmessage'] = get_string('forcedmessage', 'message');
$context['lockedlabel'] = get_string('providerprocesorislocked', 'message', $labelparams);
} else {
$context['lockedmessage'] = get_string('disallowed', 'message');
Expand Down
Expand Up @@ -64,8 +64,7 @@
{{#enabled}}checked{{/enabled}}
>
<label for="{{{preferencekey}}}_{{{name}}}" class="custom-control-label"
title="{{enabledlabel}}">
{{#str}} enabled, core_message {{/str}}
title="{{enabledlabel}}" >
</label>
</div>
</div>
Expand Down
Expand Up @@ -75,6 +75,19 @@ Feature: Manage notification preferences - Email
And I click on "Notification preferences" "link" in the "#page-content" "css_element"
And I should not see "Assignment notifications"

Scenario: User can disable email notifications for Assignment notifications
Given I log in as "admin"
And I navigate to "Messaging > Notification settings" in site administration
And I set the field "email" to "1"
And I press "Save changes"
And I follow "Preferences" in the user menu
And I click on "Notification preferences" "link" in the "#page-content" "css_element"
And I should not see "Enabled" in the "Assignment notifications" "table_row"
When I set the field "message_provider_mod_assign_assign_notification_email" to "0"
And I reload the page
Then the field "message_provider_mod_assign_assign_notification_email" matches value "0"
And I should not see "Enabled" in the "Assignment notifications" "table_row"

Scenario: Lock email notifications for Forum providers
Given I log in as "admin"
When I navigate to "Messaging > Notification settings" in site administration
Expand All @@ -92,8 +105,8 @@ Feature: Manage notification preferences - Email
And the field "mod_forum_digests_locked[email]" matches value "1"
And I follow "Preferences" in the user menu
And I click on "Notification preferences" "link" in the "#page-content" "css_element"
And I should see "Locked" in the "[data-preference-key=message_provider_mod_forum_posts]" "css_element"
And I should see "Disallowed" in the "[data-preference-key=message_provider_mod_forum_digests]" "css_element"
And I should see "Locked on" in the "[data-preference-key=message_provider_mod_forum_posts]" "css_element"
And I should see "Locked off" in the "[data-preference-key=message_provider_mod_forum_digests]" "css_element"

Scenario: User can disable notification preferences
Given the following "courses" exist:
Expand Down
1 change: 1 addition & 0 deletions message/tests/behat/message_preferences.feature
Expand Up @@ -21,6 +21,7 @@ Feature: To be able to see and save user message preferences as admin
And I click on "Student 1" "link" in the "Student 1" "table_row"
And I click on "Preferences" "link" in the "#region-main-box" "css_element"
And I click on "Message preferences" "link" in the "#region-main-box" "css_element"
And I should not see "Enabled" in the "Email" "table_row"
And I click on "//div[@class='preference-state']" "xpath_element"
And I log out
And I log in as "student1"
Expand Down

0 comments on commit dd24a77

Please sign in to comment.