diff --git a/public/lang/en/message.php b/public/lang/en/message.php index 869db5c3a55..121eda2d973 100644 --- a/public/lang/en/message.php +++ b/public/lang/en/message.php @@ -69,6 +69,7 @@ $string['disallowed'] = 'Locked off'; $string['editmessages'] = 'Edit messages'; $string['emailtagline'] = 'This is a copy of a message sent to you on the site {$a->sitename}. Go to {$a->url} to reply.'; $string['enabled'] = 'Enabled'; +$string['enablenotificationplugin'] = 'Enable notification plugin: {$a}'; $string['errorcallingprocessor'] = 'Error calling defined output'; $string['errorconversationdoesnotexist'] = 'Conversation does not exist'; $string['errormessagetoolong'] = 'The message is longer than the maximum allowed.'; @@ -155,6 +156,7 @@ $string['page-message-x'] = 'Any message pages'; $string['participants'] = 'Participants'; $string['pendingcontactrequests'] = 'There are {$a} pending contact requests'; $string['permitted'] = 'Permitted'; +$string['preference'] = 'Preference'; $string['privacy'] = 'Privacy'; $string['privacy_desc'] = 'You can restrict who can message you'; $string['privacy:metadata:core_favourites'] = 'The conversations starred by the user'; diff --git a/public/message/renderer.php b/public/message/renderer.php index d6e6f646620..94b881a0555 100644 --- a/public/message/renderer.php +++ b/public/message/renderer.php @@ -75,6 +75,8 @@ class core_message_renderer extends plugin_renderer_base { public function manage_messageoutputs($processors) { // Display the current workflows $table = new html_table(); + $table->caption = get_string('messageoutputs', 'message'); + $table->captionhide = true; $table->attributes['class'] = 'admintable table generaltable table-hover'; $table->data = array(); $table->head = array( @@ -90,7 +92,11 @@ class core_message_renderer extends plugin_renderer_base { $row = new html_table_row(); $row->attributes['class'] = 'messageoutputs'; - $name = new html_table_cell(get_string('pluginname', 'message_'.$processor->name)); + $pluginname = get_string('pluginname', 'message_' . $processor->name); + $name = new html_table_cell($pluginname); + $name->header = true; + $name->attributes['class'] = 'fw-normal'; + $name->attributes['scope'] = 'row'; $enable = new html_table_cell(); if (!$processor->available) { $enable->text = html_writer::nonempty_tag('span', get_string('outputnotavailable', 'message'), @@ -98,7 +104,10 @@ class core_message_renderer extends plugin_renderer_base { ); } else { $enable->text = html_writer::checkbox($processor->name, $processor->id, $processor->enabled, '', - array('id' => $processor->name) + [ + 'id' => $processor->name, + 'aria-label' => get_string('enablenotificationplugin', 'message', $pluginname), + ] ); } // Settings diff --git a/public/message/templates/default_notification_preferences.mustache b/public/message/templates/default_notification_preferences.mustache index 3d2c47ede0c..417a9dc2fcd 100644 --- a/public/message/templates/default_notification_preferences.mustache +++ b/public/message/templates/default_notification_preferences.mustache @@ -70,13 +70,15 @@ } }}
-

{{#str}} managemessageoutputs, message {{/str}}

+

{{#str}} managemessageoutputs, message {{/str}}

- +
- + {{#processors}} @@ -98,8 +100,7 @@ class="form-check-input provider_enabled" {{#enabled}}checked{{/enabled}} > -
+ {{#str}}preference, message{{/str}} + {{#str}} enabled, core_message {{/str}}{{{displayname}}}
+
- + {{#processors}} {{> message/notification_preferences_processor }} {{/processors}} diff --git a/public/message/templates/notification_preferences_component_notification.mustache b/public/message/templates/notification_preferences_component_notification.mustache index 2577f3f4849..d33c2bdb1af 100644 --- a/public/message/templates/notification_preferences_component_notification.mustache +++ b/public/message/templates/notification_preferences_component_notification.mustache @@ -48,7 +48,7 @@ } }} - + {{#processors}}
{{{displayname}}} + {{#str}}preference, message{{/str}} +
{{{displayname}}}{{{displayname}}} {{#supportsprocessor}} @@ -66,8 +66,8 @@ {{#disableall}} disabled="true" {{/disableall}} {{#enabled}}checked{{/enabled}} > - + {{#hassettings}} Notification settings" in site administration @@ -109,6 +110,7 @@ Feature: Manage notification preferences - Email And I click on "Notification preferences" "link" in the "#page-content" "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" + And the page should meet accessibility standards with "best-practice" extra tests Scenario: User can disable notification preferences Given the following "courses" exist: diff --git a/public/message/tests/behat/message_preferences.feature b/public/message/tests/behat/message_preferences.feature index 3493b982746..35efcfe2c57 100644 --- a/public/message/tests/behat/message_preferences.feature +++ b/public/message/tests/behat/message_preferences.feature @@ -40,7 +40,7 @@ Feature: To be able to see and save user message preferences as admin And "[data-processor-name='email']" "css_element" should not exist And "[data-processor-name='airnotifier']" "css_element" should exist - @javascript + @javascript @accessibility Scenario: An admin can set the default notification preferences Given I log in as "admin" And I navigate to "Messaging > Notification settings" in site administration @@ -54,6 +54,7 @@ Feature: To be able to see and save user message preferences as admin | mod_feedback_submission_enabled[email] | 1 | | mod_feedback_submission_locked[email] | 1 | | mod_feedback_message_disable | 0 | + And the "region-main" "region" should meet accessibility standards with "best-practice" extra tests And I log in as "student1" And I follow "Preferences" in the user menu When I click on "Notification preferences" "link" in the "#page-content" "css_element"