A11Y: Add labels to some search fields, category notification selector (#14430)

This commit is contained in:
Penar Musaraj 2021-09-23 14:52:34 -04:00 committed by GitHub
parent 8a250a1eac
commit 8cef6dabb5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 14 additions and 3 deletions

View File

@ -4,6 +4,7 @@
placeholder=placeholder placeholder=placeholder
value=(readonly value) value=(readonly value)
input=(action "onChangeDate") input=(action "onChangeDate")
id=inputId
}} }}
{{#unless useGlobalPickerContainer}} {{#unless useGlobalPickerContainer}}

View File

@ -168,7 +168,7 @@
{{date-input {{date-input
date=searchedTerms.time.days date=searchedTerms.time.days
onChange=(action "onChangeWhenDate") onChange=(action "onChangeWhenDate")
id="search-post-date" inputId="search-post-date"
}} }}
</div> </div>
</div> </div>
@ -191,6 +191,7 @@
id="search-min-post-count" id="search-min-post-count"
input=(action "onChangeSearchTermMinPostCount" value="target.value") input=(action "onChangeSearchTermMinPostCount" value="target.value")
placeholder=(i18n "search.advanced.post.min.placeholder") placeholder=(i18n "search.advanced.post.min.placeholder")
aria-label=(i18n "search.advanced.post.min.aria_label")
}} }}
{{d-icon "arrows-alt-h"}} {{d-icon "arrows-alt-h"}}
{{input {{input
@ -200,6 +201,7 @@
id="search-max-post-count" id="search-max-post-count"
input=(action "onChangeSearchTermMaxPostCount" value="target.value") input=(action "onChangeSearchTermMaxPostCount" value="target.value")
placeholder=(i18n "search.advanced.post.max.placeholder") placeholder=(i18n "search.advanced.post.max.placeholder")
aria-label=(i18n "search.advanced.post.max.aria_label")
}} }}
</div> </div>
</div> </div>
@ -215,6 +217,7 @@
id="search-min-views" id="search-min-views"
input=(action "onChangeSearchTermMinViews" value="target.value") input=(action "onChangeSearchTermMinViews" value="target.value")
placeholder=(i18n "search.advanced.min_views.placeholder") placeholder=(i18n "search.advanced.min_views.placeholder")
aria-label=(i18n "search.advanced.post.min_views.aria_label")
}} }}
{{d-icon "arrows-alt-h"}} {{d-icon "arrows-alt-h"}}
{{input {{input
@ -224,6 +227,7 @@
id="search-max-views" id="search-max-views"
input=(action "onChangeSearchTermMaxViews" value="target.value") input=(action "onChangeSearchTermMaxViews" value="target.value")
placeholder=(i18n "search.advanced.max_views.placeholder") placeholder=(i18n "search.advanced.max_views.placeholder")
aria-label=(i18n "search.advanced.post.max_views.aria_label")
}} }}
</div> </div>
</div> </div>

View File

@ -93,7 +93,6 @@
castInteger=true castInteger=true
onChange=(action (mut sortOrder)) onChange=(action (mut sortOrder))
id="search-sort-by" id="search-sort-by"
ariaLabel="Some label"
}} }}
</div> </div>
</div> </div>

View File

@ -395,7 +395,7 @@ acceptance("Search - Full Page", function (needs) {
await visit("/search"); await visit("/search");
await fillIn(".search-query", "none"); await fillIn(".search-query", "none");
await selectDate("#search-post-date .date-picker", "2016-10-05"); await selectDate(".date-picker#search-post-date", "2016-10-05");
const postTimeSelector = selectKit( const postTimeSelector = selectKit(
".search-advanced-options .select-kit#postTime" ".search-advanced-options .select-kit#postTime"

View File

@ -1,5 +1,6 @@
import NotificationOptionsComponent from "select-kit/components/notifications-button"; import NotificationOptionsComponent from "select-kit/components/notifications-button";
import { or } from "@ember/object/computed"; import { or } from "@ember/object/computed";
import I18n from "I18n";
export default NotificationOptionsComponent.extend({ export default NotificationOptionsComponent.extend({
pluginApiIdentifiers: ["category-notifications-button"], pluginApiIdentifiers: ["category-notifications-button"],
@ -9,5 +10,6 @@ export default NotificationOptionsComponent.extend({
selectKitOptions: { selectKitOptions: {
i18nPrefix: "category.notifications", i18nPrefix: "category.notifications",
showFullTitle: false, showFullTitle: false,
headerAriaLabel: I18n.t("category.notifications.title"),
}, },
}); });

View File

@ -2416,8 +2416,10 @@ en:
label: Posts label: Posts
min: min:
placeholder: minimum placeholder: minimum
aria_label: filter by minimum number of posts
max: max:
placeholder: maximum placeholder: maximum
aria_label: filter by maximum number of posts
time: time:
label: Posted label: Posted
aria_label: Filter by posted date aria_label: Filter by posted date
@ -2427,8 +2429,10 @@ en:
label: Views label: Views
min_views: min_views:
placeholder: minimum placeholder: minimum
aria_label: filter by minimum views
max_views: max_views:
placeholder: maximum placeholder: maximum
aria_label: filter by maximum views
additional_options: additional_options:
label: "Filter by post count and topic views" label: "Filter by post count and topic views"
@ -3324,6 +3328,7 @@ en:
num_auto_bump_daily: "Number of open topics to automatically bump daily:" num_auto_bump_daily: "Number of open topics to automatically bump daily:"
navigate_to_first_post_after_read: "Navigate to first post after topics are read" navigate_to_first_post_after_read: "Navigate to first post after topics are read"
notifications: notifications:
title: "change notification level for this category"
watching: watching:
title: "Watching" title: "Watching"
description: "You will automatically watch all topics in this category. You will be notified of every new post in every topic, and a count of new replies will be shown." description: "You will automatically watch all topics in this category. You will be notified of every new post in every topic, and a count of new replies will be shown."