From d4ebb3988ab3557ac08a8189388cfe5e8ba65d2a Mon Sep 17 00:00:00 2001 From: Sara Arjona Date: Wed, 23 Feb 2022 17:02:45 +0100 Subject: [PATCH] MDL-73917 message: Remove labels from notification preferences In MDL-67853, the "Enabled" label was added to all the toggle switches in the user notification preferences page. This string is confusing, so this issue is to remove it (and leave it as it was in 3.11). Apart from that, following Helen's suggestion, I've renamed "Disallowed" to "Locked off" and "Locked" to "Locked on", in order to help users to understand better their meaning. --- lang/en/message.php | 7 ++++--- .../preferences/notification_list_processor.php | 2 +- ..._preferences_component_notification.mustache | 3 +-- ...sage_manage_notification_preferences.feature | 17 +++++++++++++++-- message/tests/behat/message_preferences.feature | 1 + 5 files changed, 22 insertions(+), 8 deletions(-) diff --git a/lang/en/message.php b/lang/en/message.php index 760d904c2a7..24bccaacd14 100644 --- a/lang/en/message.php +++ b/lang/en/message.php @@ -62,7 +62,7 @@ $string['deleteselectedmessagesconfirm'] = 'Are you sure you would like to delet $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'; @@ -81,6 +81,7 @@ $string['eventmessageuserunblocked'] = 'User unblocked'; $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'; @@ -209,8 +210,8 @@ $string['privacy:request:preference:set'] = 'The value of the setting \'{$a->nam $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}'; diff --git a/message/classes/output/preferences/notification_list_processor.php b/message/classes/output/preferences/notification_list_processor.php index 0464fb05ba9..544966d64a7 100644 --- a/message/classes/output/preferences/notification_list_processor.php +++ b/message/classes/output/preferences/notification_list_processor.php @@ -157,7 +157,7 @@ class notification_list_processor implements templatable, renderable { // 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'); diff --git a/message/templates/notification_preferences_component_notification.mustache b/message/templates/notification_preferences_component_notification.mustache index b81380c6283..1863fbb6b97 100644 --- a/message/templates/notification_preferences_component_notification.mustache +++ b/message/templates/notification_preferences_component_notification.mustache @@ -64,8 +64,7 @@ {{#enabled}}checked{{/enabled}} > diff --git a/message/tests/behat/message_manage_notification_preferences.feature b/message/tests/behat/message_manage_notification_preferences.feature index b66050b81a2..4c562f8e9cd 100644 --- a/message/tests/behat/message_manage_notification_preferences.feature +++ b/message/tests/behat/message_manage_notification_preferences.feature @@ -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 @@ -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: diff --git a/message/tests/behat/message_preferences.feature b/message/tests/behat/message_preferences.feature index a8e530340e8..7bd77330bc3 100644 --- a/message/tests/behat/message_preferences.feature +++ b/message/tests/behat/message_preferences.feature @@ -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"