diff --git a/eslint.config.js b/eslint.config.js index 0a9a3b12df..5cb5b702c1 100644 --- a/eslint.config.js +++ b/eslint.config.js @@ -58,7 +58,7 @@ module.exports = defineConfig([ 'react-hooks': pluginReactHooks, 'react-redux': pluginReactRedux, import: pluginImport, - jsxA11y: pluginJsxA11y, + 'jsx-a11y': pluginJsxA11y, prettier: pluginPrettier, }, rules: { @@ -67,6 +67,7 @@ module.exports = defineConfig([ ...pluginReact.configs.flat.recommended.rules, ...pluginReactHooks.configs.recommended.rules, ...pluginReactRedux.configs.recommended.rules, + ...pluginJsxA11y.configs.recommended.rules, ...fecConfig.rules, 'import/order': ['error', { groups: ['builtin', 'external', 'internal', 'sibling', 'parent', 'index'], @@ -132,7 +133,6 @@ module.exports = defineConfig([ varsIgnorePattern: '^_', }, ], - 'jsx-a11y/no-autofocus': 'off', 'react-hooks/set-state-in-effect': 'warn', // TODO address issues and enable the rule 'prettier/prettier': ['error', { semi: true, diff --git a/src/Components/ImagesTable/ImagesTable.tsx b/src/Components/ImagesTable/ImagesTable.tsx index 6c87300b24..3d5674c01e 100644 --- a/src/Components/ImagesTable/ImagesTable.tsx +++ b/src/Components/ImagesTable/ImagesTable.tsx @@ -710,7 +710,7 @@ const defaultActions = ( ) => { const name = `request-${compose.id}.json`; - const handleDownload = (e: React.MouseEvent) => { + const handleDownload = (e: React.MouseEvent) => { e.preventDefault(); const data = JSON.stringify(compose.request, null, 2); @@ -740,11 +740,8 @@ const defaultActions = ( const actions = [ { - title: ( - - Download compose request (.json) - - ), + title: 'Download compose request (.json)', + onClick: handleDownload, }, ]; @@ -753,23 +750,14 @@ const defaultActions = ( const fileBrowserHref = '/files#/?path=' + encodeURIComponent(parsedPath.dir); - const handleOpenInFileBrowser = ( - e: React.MouseEvent, - ) => { + const handleOpenInFileBrowser = (e: React.MouseEvent) => { e.preventDefault(); cockpit.jump(fileBrowserHref, cockpit.transport.host); }; actions.push({ - title: ( - - Open in file browser - - ), + title: 'Open in file browser', + onClick: handleOpenInFileBrowser, }); } diff --git a/src/test/Components/ImagesTable/ImagesTable.test.tsx b/src/test/Components/ImagesTable/ImagesTable.test.tsx index d647b9d9b7..597fc97181 100644 --- a/src/test/Components/ImagesTable/ImagesTable.test.tsx +++ b/src/test/Components/ImagesTable/ImagesTable.test.tsx @@ -199,10 +199,8 @@ describe('Images Table', () => { }); try { - // Click the download link - const downloadLink: HTMLAnchorElement = - await within(downloadButton).findByRole('link'); - await user.click(downloadLink); + // Click the download menu item + await user.click(downloadButton); // Verify the download was triggered correctly await waitFor(() => {