Skip to content
Draft
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
4 changes: 2 additions & 2 deletions eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ module.exports = defineConfig([
'react-hooks': pluginReactHooks,
'react-redux': pluginReactRedux,
import: pluginImport,
jsxA11y: pluginJsxA11y,
'jsx-a11y': pluginJsxA11y,
prettier: pluginPrettier,
},
rules: {
Expand All @@ -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'],
Expand Down Expand Up @@ -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,
Expand Down
24 changes: 6 additions & 18 deletions src/Components/ImagesTable/ImagesTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -710,7 +710,7 @@ const defaultActions = (
) => {
const name = `request-${compose.id}.json`;

const handleDownload = (e: React.MouseEvent<HTMLAnchorElement>) => {
const handleDownload = (e: React.MouseEvent) => {
e.preventDefault();

const data = JSON.stringify(compose.request, null, 2);
Expand Down Expand Up @@ -740,11 +740,8 @@ const defaultActions = (

const actions = [
{
title: (
<a className='ib-subdued-link' href='#' onClick={handleDownload}>
Download compose request (.json)
</a>
),
title: 'Download compose request (.json)',
onClick: handleDownload,
},
];

Expand All @@ -753,23 +750,14 @@ const defaultActions = (
const fileBrowserHref =
'/files#/?path=' + encodeURIComponent(parsedPath.dir);

const handleOpenInFileBrowser = (
e: React.MouseEvent<HTMLAnchorElement>,
) => {
const handleOpenInFileBrowser = (e: React.MouseEvent) => {
e.preventDefault();
cockpit.jump(fileBrowserHref, cockpit.transport.host);
};

actions.push({
title: (
<a
className='ib-subdued-link'
href='#'
onClick={handleOpenInFileBrowser}
>
Open in file browser
</a>
),
title: 'Open in file browser',
onClick: handleOpenInFileBrowser,
});
}

Expand Down
6 changes: 2 additions & 4 deletions src/test/Components/ImagesTable/ImagesTable.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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(() => {
Expand Down
Loading