Skip to content

Commit fa5734f

Browse files
committed
Merge branch 'stats-accessibility' of Arnei/opencast-admin-interface into r/17.x
Pull request #1334 Fixes #1222 Accessibility concerns in events stats
2 parents f6eb444 + a1131f7 commit fa5734f

3 files changed

Lines changed: 24 additions & 16 deletions

File tree

src/components/shared/Stats.tsx

Lines changed: 21 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import { loadEventsIntoTable } from "../../thunks/tableThunks";
1313
import { useAppDispatch, useAppSelector } from "../../store";
1414
import { fetchEvents } from "../../slices/eventSlice";
1515
import { ParseKeys } from "i18next";
16+
import { Tooltip } from "./Tooltip";
1617

1718
/**
1819
* This component renders the status bar of the event view and filters depending on these
@@ -66,20 +67,26 @@ const Stats = () => {
6667
{/* Show one counter for each status */}
6768
{stats.map((st, key) => (
6869
<div className="col" key={key}>
69-
<button className="stat" onClick={() => showStatsFilter(st)}>
70-
<h1>{st.count}</h1>
71-
{/* Show the description of the status, if defined,
72-
else show name of filter and its value*/}
73-
{!!st.description ? (
74-
<span>{t(st.description as ParseKeys)}</span>
75-
) : (
76-
st.filters.map((filter, key) => (
77-
<span key={key}>
78-
{t(filter.filter as ParseKeys)}: {t(filter.value as ParseKeys)}
79-
</span>
80-
))
81-
)}
82-
</button>
70+
<Tooltip title={t("DASHBOARD.BUTTON_TOOLTIP", { filterName: t(st.description as ParseKeys)})}>
71+
<button
72+
className="stat"
73+
aria-label={t("DASHBOARD.BUTTON_TOOLTIP", { filterName: t(st.description as ParseKeys)})}
74+
onClick={() => showStatsFilter(st)}
75+
>
76+
<div>{st.count}</div>
77+
{/* Show the description of the status, if defined,
78+
else show name of filter and its value*/}
79+
{!!st.description ? (
80+
<span>{t(st.description as ParseKeys)}</span>
81+
) : (
82+
st.filters.map((filter, key) => (
83+
<span key={key}>
84+
{t(filter.filter as ParseKeys)}: {t(filter.value as ParseKeys)}
85+
</span>
86+
))
87+
)}
88+
</button>
89+
</Tooltip>
8390
</div>
8491
))}
8592
</div>

src/i18n/org/opencastproject/adminui/languages/lang-en_US.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1992,7 +1992,8 @@
19921992
"FAILED": "Failed",
19931993
"FINISHED_WITH_COMMENTS": "Todo",
19941994
"SCHEDULED": "Scheduled",
1995-
"RECORDING": "Recording"
1995+
"RECORDING": "Recording",
1996+
"BUTTON_TOOLTIP": "Apply filter {{filterName}} to the table"
19961997
},
19971998
"HOTKEYS": {
19981999
"CHEAT_SHEET": {

src/styles/components/_stats.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@
5858
outline: variables.$stats-color solid thin;
5959
}
6060

61-
h1 {
61+
div {
6262
font-weight: 100;
6363
font-size: 24px;
6464
margin: 0 0 5px 0;

0 commit comments

Comments
 (0)