From a0174ab770b265caec0351b5d110ff898ef12afc Mon Sep 17 00:00:00 2001 From: Lucas C Date: Fri, 23 Feb 2024 14:44:31 +0100 Subject: [PATCH] XWIKI-21776: Admin section: make the Notifications section pass webstandard tests (#2801) * Added a fallback for null value of `$divData` * Added a label for the `id="since"` input at the end of the form * Added a missing space between attributes in email preferences * Replaced the comment with an actual test for Notifications * Replaced other uses of Divdata to account for the fact that it might be null --- .../Notifications/Code/LegacyNotificationAdministration.xml | 1 + .../Code/NotificationsApplicationsPreferencesMacro.xml | 2 +- .../Notifications/Code/NotificationsEmailPreferencesMacro.xml | 2 +- .../Code/NotificationsSystemFiltersPreferencesMacro.xml | 2 +- .../xwiki-platform-distribution-flavor-test/pom.xml | 3 +-- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/xwiki-platform-core/xwiki-platform-legacy/xwiki-platform-legacy-events-hibernate/xwiki-platform-legacy-events-hibernate-ui/src/main/resources/XWiki/Notifications/Code/LegacyNotificationAdministration.xml b/xwiki-platform-core/xwiki-platform-legacy/xwiki-platform-legacy-events-hibernate/xwiki-platform-legacy-events-hibernate-ui/src/main/resources/XWiki/Notifications/Code/LegacyNotificationAdministration.xml index ef87b9c42da2..d02daaf6e0e1 100644 --- a/xwiki-platform-core/xwiki-platform-legacy/xwiki-platform-legacy-events-hibernate/xwiki-platform-legacy-events-hibernate-ui/src/main/resources/XWiki/Notifications/Code/LegacyNotificationAdministration.xml +++ b/xwiki-platform-core/xwiki-platform-legacy/xwiki-platform-legacy-events-hibernate/xwiki-platform-legacy-events-hibernate-ui/src/main/resources/XWiki/Notifications/Code/LegacyNotificationAdministration.xml @@ -67,6 +67,7 @@ $services.localization.use('document', 'XWiki.Notifications.Code.LegacyNotificat <div> <input type="radio" id="mode_since" name="mode" value="since"#if($request.mode == 'since')checked#end/> <label for="mode_since">$escapetool.html($services.localization.render('legacy.event.migration.since'))</label> + <label for="since" class="sr-only">$escapetool.html($services.localization.render('legacy.event.migration.since.picker.label'))</label> <input type="date" id="since" name="since"#if($request.since) value="$escapetool.xml($request.since)"#end max="$datetool.format('yyyy-MM-dd', $datetool.date)"/> </div> <div class="buttons"><span class="buttonwrapper"><input type="submit" value="$escapetool.xml($services.localization.render('legacy.event.migration.start'))" name="migrate" class="button"/></span></div> diff --git a/xwiki-platform-core/xwiki-platform-notifications/xwiki-platform-notifications-ui/src/main/resources/XWiki/Notifications/Code/NotificationsApplicationsPreferencesMacro.xml b/xwiki-platform-core/xwiki-platform-notifications/xwiki-platform-notifications-ui/src/main/resources/XWiki/Notifications/Code/NotificationsApplicationsPreferencesMacro.xml index eef3e0dc934d..f03241cfaa08 100644 --- a/xwiki-platform-core/xwiki-platform-notifications/xwiki-platform-notifications-ui/src/main/resources/XWiki/Notifications/Code/NotificationsApplicationsPreferencesMacro.xml +++ b/xwiki-platform-core/xwiki-platform-notifications/xwiki-platform-notifications-ui/src/main/resources/XWiki/Notifications/Code/NotificationsApplicationsPreferencesMacro.xml @@ -991,7 +991,7 @@ require(['jquery', 'xwiki-meta', 'ApplicationWidget', 'xwiki-bootstrap-switch', {{html clean="false"}} <div class="xform"> <p class="xHint">$escapetool.xml($services.localization.render('notifications.settings.applications.hint'))</p> -<table class="notifPreferences" data-target="$escapetool.xml($wikimacro.parameters.target)" $divData> +<table class="notifPreferences" data-target="$escapetool.xml($wikimacro.parameters.target)" $!divData> <thead> <tr> <th scope="col">$escapetool.xml($services.localization.render('notifications.settings.applications.appName'))</th> diff --git a/xwiki-platform-core/xwiki-platform-notifications/xwiki-platform-notifications-ui/src/main/resources/XWiki/Notifications/Code/NotificationsEmailPreferencesMacro.xml b/xwiki-platform-core/xwiki-platform-notifications/xwiki-platform-notifications-ui/src/main/resources/XWiki/Notifications/Code/NotificationsEmailPreferencesMacro.xml index 11415a380bb6..c316c1727119 100644 --- a/xwiki-platform-core/xwiki-platform-notifications/xwiki-platform-notifications-ui/src/main/resources/XWiki/Notifications/Code/NotificationsEmailPreferencesMacro.xml +++ b/xwiki-platform-core/xwiki-platform-notifications/xwiki-platform-notifications-ui/src/main/resources/XWiki/Notifications/Code/NotificationsEmailPreferencesMacro.xml @@ -442,7 +442,7 @@ <div class="xform"> <dl> <dt><label for='preference_notification_email_frequency'>$escapetool.xml($services.localization.render('notifications.settings.email.frequency'))</label> - <p id='preference_notification_email_frequency_hint'class="xHint">$escapetool.xml($services.localization.render('notifications.settings.email.frequency.hint'))</p> + <p id='preference_notification_email_frequency_hint' class="xHint">$escapetool.xml($services.localization.render('notifications.settings.email.frequency.hint'))</p> </dt> <dd> #if ($wikimacro.parameters.target == 'user') diff --git a/xwiki-platform-core/xwiki-platform-notifications/xwiki-platform-notifications-ui/src/main/resources/XWiki/Notifications/Code/NotificationsSystemFiltersPreferencesMacro.xml b/xwiki-platform-core/xwiki-platform-notifications/xwiki-platform-notifications-ui/src/main/resources/XWiki/Notifications/Code/NotificationsSystemFiltersPreferencesMacro.xml index 385e34cc9004..ffa6700d774a 100644 --- a/xwiki-platform-core/xwiki-platform-notifications/xwiki-platform-notifications-ui/src/main/resources/XWiki/Notifications/Code/NotificationsSystemFiltersPreferencesMacro.xml +++ b/xwiki-platform-core/xwiki-platform-notifications/xwiki-platform-notifications-ui/src/main/resources/XWiki/Notifications/Code/NotificationsSystemFiltersPreferencesMacro.xml @@ -590,7 +590,7 @@ path=$services.webjars.url('org.xwiki.platform:xwiki-platform-notifications-webj ### MACRO CONTENT ###################################################### {{html clean="false"}} -<div class="systemFilterPreferences xform" data-target="$escapetool.xml($wikimacro.parameters.target)" $divData> +<div class="systemFilterPreferences xform" data-target="$escapetool.xml($wikimacro.parameters.target)" $!divData> <div class="row"> <p class="xHint col-xs-12 col-sm-9 col-md-8 col-lg-9"> $escapetool.xml($services.localization.render('notifications.settings.filters.preferences.system.hint')) diff --git a/xwiki-platform-distribution/xwiki-platform-distribution-flavor/xwiki-platform-distribution-flavor-test/pom.xml b/xwiki-platform-distribution/xwiki-platform-distribution-flavor/xwiki-platform-distribution-flavor-test/pom.xml index 15908218e482..529768913ced 100644 --- a/xwiki-platform-distribution/xwiki-platform-distribution-flavor/xwiki-platform-distribution-flavor-test/pom.xml +++ b/xwiki-platform-distribution/xwiki-platform-distribution-flavor/xwiki-platform-distribution-flavor-test/pom.xml @@ -298,8 +298,7 @@ /xwiki/bin/admin/XWiki/XWikiPreferences?editor=globaladmin&section=Likes /xwiki/bin/admin/XWiki/XWikiPreferences?editor=globaladmin&section=Mentions /xwiki/bin/admin/XWiki/XWikiPreferences?editor=globaladmin&section=MessageStream - + /xwiki/bin/admin/XWiki/XWikiPreferences?editor=globaladmin&section=Notifications /xwiki/bin/admin/XWiki/XWikiPreferences?editor=globaladmin&section=wikis.descriptor /xwiki/bin/admin/XWiki/XWikiPreferences?editor=globaladmin&section=wikis.templates