Skip to content

Commit

Permalink
add aria-sort to table column headers + remove space key bindings for…
Browse files Browse the repository at this point in the history
… links
  • Loading branch information
aalves08 committed Jan 6, 2025
1 parent 4a514ba commit f7a177e
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 3 deletions.
2 changes: 2 additions & 0 deletions shell/assets/translations/en-us.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
generic:
add: Add
all: All
ascending: ascending
and: ' and '
back: Back
cancel: Cancel
Expand All @@ -19,6 +20,7 @@ generic:
customize: Customize
dashboard: Dashboard
default: Default
descending: descending
disabled: Disabled
done: Done
enabled: Enabled
Expand Down
1 change: 1 addition & 0 deletions shell/components/BannerGraphic.vue
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ export default {
data-testid="graphic-banner-close"
tabindex="0"
:aria-label="t('generic.close')"
role="button"
@click="hide()"
@keyup.enter="hide()"
@keyup.space="hide()"
Expand Down
4 changes: 2 additions & 2 deletions shell/components/CommunityLinks.vue
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,6 @@ export default {
:to="link.value"
role="link"
:aria-label="link.label"
@keyup.space="$router.push(link.value)"
>
{{ link.label }}
</router-link>
Expand All @@ -134,9 +133,9 @@ export default {
class="link"
tabindex="0"
:aria-label="t('footer.wechat.title')"
role="link"
@click="show"
@keyup.enter="show"
@keyup.space="show"
>
{{ t('footer.wechat.title') }}
</a>
Expand All @@ -158,6 +157,7 @@ export default {
class="btn role-primary"
tabindex="0"
:aria-label="t('generic.close')"
role="button"
@click="close"
@keyup.enter="close"
@keyup.space="close"
Expand Down
9 changes: 9 additions & 0 deletions shell/components/SortableTable/THead.vue
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,14 @@ export default {
return col.name === this.sortBy;
},
ariaSort(col) {
if (this.isCurrent(col)) {
return this.descending ? this.t('generic.descending') : this.t('generic.ascending');
}
return this.t('generic.none');
},
tableColsOptionsClick(ev) {
// set menu position
const menu = document.querySelector('.table-options-container');
Expand Down Expand Up @@ -237,6 +245,7 @@ export default {
:class="{ sortable: col.sort, [col.breakpoint]: !!col.breakpoint}"
:tabindex="col.sort ? 0 : -1"
class="sortable-table-head-element"
:aria-sort="ariaSort(col)"
@click.prevent="changeSort($event, col)"
@keyup.enter="changeSort($event, col)"
@keyup.space="changeSort($event, col)"
Expand Down
1 change: 0 additions & 1 deletion shell/pages/home.vue
Original file line number Diff line number Diff line change
Expand Up @@ -512,7 +512,6 @@ export default defineComponent({
:aria-label="t('landing.whatsNewLink')"
@click.stop="showWhatsNew"
@keyup.stop.enter="showWhatsNew"
@keyup.stop.space="showWhatsNew"
><span v-clean-html="t('landing.whatsNewLink')" /></a>
</Banner>
</div>
Expand Down

0 comments on commit f7a177e

Please sign in to comment.