From a637333419695e875fd14699f65eade0d568679d Mon Sep 17 00:00:00 2001 From: Jun Pataleta Date: Fri, 7 Nov 2025 18:58:08 +0800 Subject: [PATCH] MDL-86998 message: Fix accessibility issues in notification preferences * Fix missing column heading for the preference column * Fix incorrect label for the toggle controls * Make the preference name a table heading with a row scope so that the toggle controls will be programmatically associated to it. * Apply a col scope for the processor column headings to programmatically associate the toggle controls to their respective columns. --- lang/en/message.php | 1 + message/templates/notification_preferences.mustache | 8 +++++--- ...tification_preferences_component_notification.mustache | 6 +++--- .../templates/notification_preferences_processor.mustache | 2 +- .../behat/message_manage_notification_preferences.feature | 2 ++ 5 files changed, 12 insertions(+), 7 deletions(-) diff --git a/lang/en/message.php b/lang/en/message.php index 6c08d384116..9320a61ea8f 100644 --- a/lang/en/message.php +++ b/lang/en/message.php @@ -151,6 +151,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/message/templates/notification_preferences.mustache b/message/templates/notification_preferences.mustache index 58ad3bfde1a..5fd0ceb3d06 100644 --- a/message/templates/notification_preferences.mustache +++ b/message/templates/notification_preferences.mustache @@ -69,7 +69,7 @@ } }}
-

{{#str}} notificationpreferences, message {{/str}}

+

{{#str}} notificationpreferences, message {{/str}}

core/loading }}
- +
- + {{#processors}} {{> message/notification_preferences_processor }} {{/processors}} diff --git a/message/templates/notification_preferences_component_notification.mustache b/message/templates/notification_preferences_component_notification.mustache index 8acca681619..9b86b079094 100644 --- a/message/templates/notification_preferences_component_notification.mustache +++ b/message/templates/notification_preferences_component_notification.mustache @@ -47,7 +47,7 @@ } }} - + {{#processors}}
{{{displayname}}} + {{#str}}preference, message{{/str}} +
{{{displayname}}}{{{displayname}}} {{#locked}} @@ -64,8 +64,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: