Skip to content

Commit

Permalink
add ARIA labels to input fields (#2562)
Browse files Browse the repository at this point in the history
* add aria labels to input fields

Signed-off-by: Michael Robinson <merobi@gmail.com>

* remove unnecessary spaces and standardize font for consistent spacing

Signed-off-by: Michael Robinson <merobi@gmail.com>

---------

Signed-off-by: Michael Robinson <merobi@gmail.com>
  • Loading branch information
merobi-hub authored Aug 4, 2023
1 parent 59f4552 commit 58ad3e3
Showing 4 changed files with 25 additions and 8 deletions.
2 changes: 1 addition & 1 deletion web/src/components/datasets/DatasetInfo.tsx
Original file line number Diff line number Diff line change
@@ -103,7 +103,7 @@ const DatasetInfo: FunctionComponent<DatasetInfoProps> = props => {
<Box mb={1}>
<MqText subheading>{i18next.t('dataset_info.facets_subhead')}</MqText>
</Box>
<MqJsonView data={facets} searchable={true} placeholder='Search' />
<MqJsonView data={facets} searchable={true} aria-label={i18next.t('dataset_info.facets_subhead_aria')} aria-required='True' placeholder='Search' />
</Box>
)}
{run && (
8 changes: 7 additions & 1 deletion web/src/components/jobs/RunInfo.tsx
Original file line number Diff line number Diff line change
@@ -64,7 +64,13 @@ const RunInfo: FunctionComponent<RunInfoProps> = props => {
<Box mb={1}>
<MqText subheading>{i18next.t('jobs.runinfo_subhead')}</MqText>
</Box>
<MqJsonView data={run.facets} searchable={true} placeholder={i18next.t('jobs.search')} />
<MqJsonView
data={run.facets}
searchable={true}
aria-label={i18next.t('jobs.facets_subhead_aria')}
aria-required='true'
placeholder={i18next.t('jobs.search')}
/>
</Box>
)}
</Box>
11 changes: 5 additions & 6 deletions web/src/components/search/SearchPlaceholder.tsx
Original file line number Diff line number Diff line change
@@ -30,18 +30,17 @@ const SearchPlaceholder: React.FC<WithStyles<typeof styles>> = ({ classes }) =>
return (
<Box className={classes.root}>
<Box display={'inline'}>
<MqText disabled inline>
{' '}
<MqText disabled inline font={'mono'} aria-label={i18next.t('search.search_aria')} aria-required='true'>
{i18next.t('search.search')}
</MqText>{' '}
</MqText>
<MqText bold inline font={'mono'} color={theme.palette.common.white}>
{' '}
{i18next.t('search.jobs')}
</MqText>{' '}
<MqText disabled inline>
</MqText>
<MqText disabled inline font={'mono'}>
{' '}
{i18next.t('search.and')}
</MqText>{' '}
</MqText>
<MqText bold inline font={'mono'} color={theme.palette.common.white}>
{' '}
{i18next.t('search.datasets')}
12 changes: 12 additions & 0 deletions web/src/i18n/config.ts
Original file line number Diff line number Diff line change
@@ -33,6 +33,7 @@ i18next
empty_title: 'No Run Information Available',
empty_body: 'Try adding some runs for this job.',
runinfo_subhead: 'FACETS',
facets_subhead_aria: 'Search',
runs_subhead: 'FACETS',
dialog_delete: 'DELETE',
dialog_confirmation_title: 'Are you sure?'
@@ -48,6 +49,7 @@ i18next
status: 'Searching...',
none: 'No Results',
search: 'Search',
search_aria: 'Search jobs and datasets',
jobs: 'Jobs',
and: 'and',
datasets: 'Datasets'
@@ -69,6 +71,7 @@ i18next
empty_title: 'No Fields',
empty_body: 'Try adding dataset fields.',
facets_subhead: 'FACETS',
facets_subhead_aria: 'Search',
run_subhead: 'Created by Run',
duration: 'Duration'
},
@@ -155,6 +158,7 @@ i18next
empty_body: "Essayez d'ajouter quelques exécutions pour ce travail.",
runinfo_subhead: 'FACETTES',
runs_subhead: 'FACETTES',
facets_subhead_aria: 'Recherche',
dialog_delete: 'EFFACER',
dialog_confirmation_title: 'Êtes-vous sûr?'
},
@@ -169,6 +173,7 @@ i18next
status: 'Recherche...',
none: 'Aucun Résultat',
search: 'Recherche',
search_aria: 'Recherchez des emplois et des ensembles de données',
jobs: "d'Emplois",
and: 'et',
datasets: 'Jeux de Données'
@@ -190,6 +195,7 @@ i18next
empty_title: 'Aucun jeu de données trouvé',
empty_body: "Essayez d'ajouter des champs de jeu de données.",
facets_subhead: 'FACETTES',
facets_subhead_aria: 'Recherche',
run_subhead: 'Créé par Run',
duration: 'Durée'
},
@@ -279,6 +285,7 @@ i18next
empty_body: 'Intente agregar algunas ejecuciones para este trabajo.',
runinfo_subhead: 'FACETAS',
runs_subhead: 'FACETAS',
facets_subhead_aria: 'Buscar',
dialog_delete: 'ELIMINAR',
dialog_confirmation_title: 'Estás seguro?'
},
@@ -293,6 +300,7 @@ i18next
status: 'Buscando...',
none: 'No Hay Resultados',
search: 'Buscar',
search_aria: 'Buscar trabajos y conjuntos de datos',
jobs: 'Trabajos',
and: 'y',
datasets: 'Conjuntos de Datos'
@@ -314,6 +322,7 @@ i18next
empty_title: 'No se encontraron conjuntos de datos',
empty_body: 'Intente agregar campos de conjuntos de datos.',
facets_subhead: 'FACETAS',
facets_subhead_aria: 'Buscar',
run_subhead: 'Creado por Ejecutar',
duration: 'Duración'
},
@@ -403,6 +412,7 @@ i18next
empty_body: 'Spróbuj dodać kilka przebiegów dla tego zadania.',
runinfo_subhead: 'ASPECTY',
runs_subhead: 'ASPECTY',
facets_subhead_aria: 'Wyszukiwanie',
dialog_delete: 'USUNĄĆ',
dialog_confirmation_title: 'Jesteś pewny?'
},
@@ -417,6 +427,7 @@ i18next
status: 'Badawczy...',
none: 'Brak Wyników',
search: 'Wyszukiwanie',
search_aria: 'Wyszukiwanie zadań i zbiorów danych',
jobs: 'Zadania',
and: 'i',
datasets: 'Zbiory Danych'
@@ -438,6 +449,7 @@ i18next
empty_title: 'Nie znaleziono zbiorów danych',
empty_body: 'Spróbuj dodać pola zbiory danych.',
facets_subhead: 'ASPECTY',
facets_subhead_aria: 'Wyszukiwanie',
run_subhead: 'Stworzony przez Run',
duration: 'Czas trwania'
},

0 comments on commit 58ad3e3

Please sign in to comment.