Skip to content

Commit 5d89ac0

Browse files
Added some aria labels and focus
1 parent e10e265 commit 5d89ac0

3 files changed

Lines changed: 10 additions & 0 deletions

File tree

shell/pages/c/_cluster/explorer/workload-dashboard/ByStateSection.vue

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,19 +36,22 @@ function toCardRows(rows: typeof props.layout.cards[0]['rows']) {
3636
data-testid="workload-dashboard-state-card"
3737
:class="'state-card--' + card.color"
3838
:rows="toCardRows(card.rows)"
39+
:aria-label="card.color + ' workloads'"
3940
/>
4041
<WorkloadCard
4142
v-if="layout.subHero"
4243
class="state-card bento-sub-hero"
4344
:class="'state-card--' + layout.subHero.color"
4445
:rows="toCardRows(layout.subHero.rows)"
46+
:aria-label="layout.subHero.color + ' workloads'"
4547
/>
4648
<WorkloadCard
4749
v-if="layout.hero"
4850
class="state-card bento-hero"
4951
:class="['state-card--' + layout.hero.color, 'bento-hero--' + layout.heroMode]"
5052
:body-columns="layout.heroMode === 'full' ? 3 : layout.heroMode === 'wide' ? 2 : undefined"
5153
:rows="toCardRows(layout.hero.rows)"
54+
:aria-label="layout.hero.color + ' workloads'"
5255
/>
5356
</div>
5457
</template>

shell/pages/c/_cluster/explorer/workload-dashboard/WorkloadCard.vue

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ export interface WorkloadCardRow {
1414
const { bodyColumns } = defineProps<{
1515
bodyColumns?: number;
1616
rows: WorkloadCardRow[];
17+
ariaLabel?: string;
1718
}>();
1819
1920
const gridColumns = computed(() => bodyColumns ? `repeat(${ bodyColumns }, 1fr)` : 'none');
@@ -23,6 +24,7 @@ const gridColumns = computed(() => bodyColumns ? `repeat(${ bodyColumns }, 1fr)`
2324
<div
2425
class="workload-card"
2526
role="group"
27+
:aria-label="ariaLabel"
2628
>
2729
<ul
2830
class="body"

shell/pages/c/_cluster/explorer/workload-dashboard/WorkloadTypeCard.vue

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,11 @@ function handleClick(e: MouseEvent | KeyboardEvent): void {
119119
border-color: var(--primary);
120120
}
121121
122+
&:focus-visible {
123+
outline: 2px solid var(--primary);
124+
outline-offset: -2px;
125+
}
126+
122127
.heading {
123128
font-size: 18px;
124129
font-weight: 600;

0 commit comments

Comments
 (0)