Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions workspaces/quickstart/.changeset/legal-times-remain.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
'@red-hat-developer-hub/backstage-plugin-quickstart': patch
---

Fixed WCAG 2.1 AA accessibility violations:

- Added accessible name to progress bar
- Fixed invalid list structure (ul containing div elements)
- Resolved nested interactive controls issue
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ export const quickstartTranslationRef: TranslationRef<
readonly 'footer.progress': string;
readonly 'footer.hide': string;
readonly 'footer.notStarted': string;
readonly 'footer.progressBarLabel': string;
readonly 'header.title': string;
readonly 'header.subtitle': string;
readonly 'content.emptyState.title': string;
Expand Down
1 change: 1 addition & 0 deletions workspaces/quickstart/plugins/quickstart/report.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ export const quickstartTranslationRef: TranslationRef<
readonly 'footer.progress': string;
readonly 'footer.hide': string;
readonly 'footer.notStarted': string;
readonly 'footer.progressBarLabel': string;
readonly 'header.title': string;
readonly 'header.subtitle': string;
readonly 'content.emptyState.title': string;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ describe('Quickstart', () => {

// Complete first admin item
const expandButtons = screen.getAllByRole('button', {
name: /expand item/i,
name: /expand.*details/i,
});
fireEvent.click(expandButtons[0]);

Expand Down Expand Up @@ -131,7 +131,7 @@ describe('Quickstart', () => {

// Complete first developer item
const expandButtons = screen.getAllByRole('button', {
name: /expand item/i,
name: /expand.*details/i,
});
fireEvent.click(expandButtons[0]);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,10 +117,10 @@ describe('QuickstartContent', () => {
);

const expandIcon1 = screen.getAllByRole('button', {
name: /expand item/i,
name: /expand.*details/i,
})[0];
const expandIcon2 = screen.getAllByRole('button', {
name: /expand item/i,
name: /expand.*details/i,
})[1];

fireEvent.click(expandIcon1);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,10 +77,10 @@ describe('QuickstartItem)', () => {
).toBeInTheDocument();
});

it('calls handleOpen when expand/collapse icon is clicked', async () => {
it('calls handleOpen when expand/collapse item is clicked', async () => {
await renderItem(false);
const toggleBtn = screen.getByRole('button', {
name: /expand item/i,
name: /expand.*details/i,
});
fireEvent.click(toggleBtn);
expect(mockHandleOpen).toHaveBeenCalled();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,10 @@ export const QuickstartItem = ({
}, [stepCompleted, setProgress]);

return (
<Box sx={{ marginBottom: theme => `${theme.spacing(0.2)}` }}>
<Box
component="li"
sx={{ marginBottom: theme => `${theme.spacing(0.2)}`, listStyle: 'none' }}
>
<ListItem
key={itemKey}
onClick={handleOpen}
Expand Down Expand Up @@ -122,11 +125,8 @@ export const QuickstartItem = ({
}}
/>
<IconButton
aria-label={
open
? t('item.collapseButtonAriaLabel')
: t('item.expandButtonAriaLabel')
}
aria-hidden="true"
tabIndex={-1}
sx={{
...(open
? { color: theme => theme.palette.text.primary }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,11 @@ export const QuickstartFooter = ({

return (
<Box>
<LinearProgress variant="determinate" value={progress} />
<LinearProgress
variant="determinate"
value={progress}
aria-label={t('footer.progressBarLabel')}
/>
<Box
sx={{
display: 'flex',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ const quickstartTranslationDe = createTranslationMessages({
'footer.progress': '{{progress}}% Fortschritt',
'footer.notStarted': 'Nicht begonnen',
'footer.hide': 'Ausblenden',
'footer.progressBarLabel': 'Schnellstart-Fortschritt',
'content.emptyState.title':
'Schnellstart-Inhalte sind für Ihre Rolle nicht verfügbar.',
'item.expandAriaLabel': '{{title}} Details erweitern',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ const quickstartTranslationEs = createTranslationMessages({
'footer.progress': '{{progress}}% de progreso',
'footer.notStarted': 'No iniciado',
'footer.hide': 'Ocultar',
'footer.progressBarLabel': 'Progreso de inicio rápido',
'content.emptyState.title':
'El contenido de inicio rápido no está disponible para tu rol.',
'item.expandAriaLabel': 'Expandir detalles de {{title}}',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ const quickstartTranslationFr = createTranslationMessages({
'footer.progress': '{{progress}}% de progrès',
'footer.notStarted': 'Non démarré',
'footer.hide': 'Cacher',
'footer.progressBarLabel': 'Progression du démarrage rapide',
'content.emptyState.title':
"Le contenu de démarrage rapide n'est pas disponible pour votre rôle.",
'item.expandAriaLabel': 'Développer les détails de {{title}}',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ const quickstartTranslationIt = createTranslationMessages({
'footer.progress': '{{progress}}% di avanzamento',
'footer.notStarted': 'Non iniziato',
'footer.hide': 'Nascondi',
'footer.progressBarLabel': "Avanzamento dell'avvio rapido",
'content.emptyState.title':
'Contenuto di avvio rapido non disponibile per il ruolo utente.',
'item.expandAriaLabel': 'Espandi i dettagli di {{title}}',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ const quickstartTranslationJa = createTranslationMessages({
'footer.progress': '進捗 {{progress}}%',
'footer.notStarted': '開始されていません',
'footer.hide': '非表示',
'footer.progressBarLabel': 'クイックスタートの進捗',
'content.emptyState.title':
'現在のロールではクイックスタートコンテンツを利用できません。',
'item.expandAriaLabel': '{{title}} の詳細を展開',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ export const quickstartMessages = {
progress: '{{progress}}% progress',
notStarted: 'Not started',
hide: 'Hide',
progressBarLabel: 'Quickstart progress',
},
content: {
emptyState: {
Expand Down