A11Y: Fix several minor issues (#14436)

A11Y: Fix several minor issues (#14436)

diff --git a/app/assets/javascripts/discourse/app/helpers/topic-link.js b/app/assets/javascripts/discourse/app/helpers/topic-link.js
index 6dbcb1c..24aa876 100644
--- a/app/assets/javascripts/discourse/app/helpers/topic-link.js
+++ b/app/assets/javascripts/discourse/app/helpers/topic-link.js
@@ -17,7 +17,7 @@ registerUnbound("topic-link", (topic, args) => {
   return htmlSafe(
     `<a href='${url}'
         role='heading'
-        level='2'
+        aria-level='2'
         class='${classes.join(" ")}'
         data-topic-id='${topic.id}'>${title}</a>`
   );
diff --git a/app/assets/javascripts/discourse/app/raw-views/topic-list-header-column.js b/app/assets/javascripts/discourse/app/raw-views/topic-list-header-column.js
index 379799f..d3d3203 100644
--- a/app/assets/javascripts/discourse/app/raw-views/topic-list-header-column.js
+++ b/app/assets/javascripts/discourse/app/raw-views/topic-list-header-column.js
@@ -55,7 +55,7 @@ export default EmberObject.extend({
     if (this.isSorting) {
       return this.parent.ascending ? "ascending" : "descending";
     } else {
-      return "none";
+      return false;
     }
   },
 });
diff --git a/app/assets/javascripts/discourse/app/templates/components/search-result-entry.hbs b/app/assets/javascripts/discourse/app/templates/components/search-result-entry.hbs
index 488948b..fda4ae0 100644
--- a/app/assets/javascripts/discourse/app/templates/components/search-result-entry.hbs
+++ b/app/assets/javascripts/discourse/app/templates/components/search-result-entry.hbs
@@ -10,7 +10,7 @@
       {{track-selected selectedList=selected selectedId=post.topic class="bulk-select"}}
     {{/if}}
 
-    <a href={{post.url}} {{action "logClick" post.topic_id}} class="search-link" role="heading">
+    <a href={{post.url}} {{action "logClick" post.topic_id}} class="search-link" role="heading" aria-level="2">
       {{raw "topic-status" topic=post.topic showPrivateMessageIcon=true}}
       <span class="topic-title">
         {{#if post.useTopicTitleHeadline}}
diff --git a/app/assets/javascripts/discourse/app/widgets/header-contents.js b/app/assets/javascripts/discourse/app/widgets/header-contents.js
index e0ce80e..5ce69e3 100644
--- a/app/assets/javascripts/discourse/app/widgets/header-contents.js
+++ b/app/assets/javascripts/discourse/app/widgets/header-contents.js
@@ -8,6 +8,6 @@ createWidget("header-contents", {
     {{#if attrs.topic}}
       {{header-topic-info attrs=attrs}}
     {{/if}}
-    <div class="panel clearfix">{{yield}}</div>
+    <div class="panel clearfix" role="navigation">{{yield}}</div>
   `,
 });
diff --git a/app/assets/javascripts/discourse/app/widgets/header.js b/app/assets/javascripts/discourse/app/widgets/header.js
index bca43e1..afe4821 100644
--- a/app/assets/javascripts/discourse/app/widgets/header.js
+++ b/app/assets/javascripts/discourse/app/widgets/header.js
@@ -213,10 +213,6 @@ createWidget(
 createWidget("header-icons", {
   tagName: "ul.icons.d-header-icons",
 
-  buildAttributes() {
-    return { role: "navigation" };
-  },
-
   html(attrs) {
     if (this.siteSettings.login_required && !this.currentUser) {
       return [];
diff --git a/app/assets/javascripts/select-kit/addon/components/period-chooser.js b/app/assets/javascripts/select-kit/addon/components/period-chooser.js
index c09c870..a9e792a 100644
--- a/app/assets/javascripts/select-kit/addon/components/period-chooser.js
+++ b/app/assets/javascripts/select-kit/addon/components/period-chooser.js
@@ -1,5 +1,6 @@
 import { oneWay, readOnly } from "@ember/object/computed";
 import DropdownSelectBoxComponent from "select-kit/components/dropdown-select-box";
+import I18n from "I18n";
 
 export default DropdownSelectBoxComponent.extend({
   classNames: ["period-chooser"],
@@ -20,6 +21,7 @@ export default DropdownSelectBoxComponent.extend({
     fullDay: "fullDay",
     customStyle: true,
     headerComponent: "period-chooser/period-chooser-header",
+    headerAriaLabel: I18n.t("period_chooser.aria_label"),
   },
 
   actions: {
diff --git a/app/assets/javascripts/select-kit/addon/components/select-kit/select-kit-header.js b/app/assets/javascripts/select-kit/addon/components/select-kit/select-kit-header.js
index effe394..8b62948 100644
--- a/app/assets/javascripts/select-kit/addon/components/select-kit/select-kit-header.js
+++ b/app/assets/javascripts/select-kit/addon/components/select-kit/select-kit-header.js
@@ -9,7 +9,6 @@ export default Component.extend(UtilsMixin, {
   attributeBindings: [
     "role",
     "tabindex",
-    "ariaLevel:aria-level",
     "selectedValue:data-value",
     "selectedNames:data-name",
     "buttonTitle:title",
@@ -20,8 +19,6 @@ export default Component.extend(UtilsMixin, {
 
   role: "listbox",
 
-  ariaLevel: 1,
-
   tabindex: 0,
 
   selectedValue: computed("value", function () {
diff --git a/app/assets/javascripts/select-kit/addon/templates/components/period-chooser/period-chooser-header.hbs b/app/assets/javascripts/select-kit/addon/templates/components/period-chooser/period-chooser-header.hbs
index ae393d6..67afe56 100644
--- a/app/assets/javascripts/select-kit/addon/templates/components/period-chooser/period-chooser-header.hbs
+++ b/app/assets/javascripts/select-kit/addon/templates/components/period-chooser/period-chooser-header.hbs
@@ -1,4 +1,4 @@
-<h2 class="selected-name" title={{title}}>
+<h2 class="selected-name" title={{title}} role="option">
   {{period-title value
     showDateRange=true
     fullDay=selectKit.options.fullDay
diff --git a/app/assets/javascripts/select-kit/addon/templates/components/selected-name.hbs b/app/assets/javascripts/select-kit/addon/templates/components/selected-name.hbs
index ec8683f..ef6c820 100644
--- a/app/assets/javascripts/select-kit/addon/templates/components/selected-name.hbs
+++ b/app/assets/javascripts/select-kit/addon/templates/components/selected-name.hbs
@@ -1,5 +1,5 @@
 {{#if selectKit.options.showFullTitle}}
-  <div lang={{lang}} title={{title}} data-value={{value}} data-name={{name}} class="select-kit-selected-name selected-name choice">
+  <div lang={{lang}} title={{title}} data-value={{value}} data-name={{name}} role="option" class="select-kit-selected-name selected-name choice">
     {{#if item.icon}}
       {{d-icon item.icon}}
     {{/if}}
@@ -20,7 +20,7 @@
   </div>
 {{else}}
   {{#if item.icon}}
-    <div role="textbox" lang={{lang}} class="select-kit-selected-name selected-name choice">
+    <div role="option" lang={{lang}} class="select-kit-selected-name selected-name choice">
       {{d-icon item.icon}}
     </div>
   {{/if}}
diff --git a/config/locales/client.en.yml b/config/locales/client.en.yml
index 877d3b0..ce34966 100644
--- a/config/locales/client.en.yml
+++ b/config/locales/client.en.yml
@@ -267,6 +267,8 @@ en:
     character_count:
       one: "%{count} character"
       other: "%{count} characters"
+    period_chooser:
+      aria_label: "Filter by period"
 
     related_messages:
       title: "Related Messages"

GitHub sha: 9235e2ad5d4e606736f9d436982f2333fdcb69e4

This commit appears in #14436 which was approved by eviltrout. It was merged by pmusaraj.