mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Accessibility: Enable rule jsx-a11y/no-noninteractive-element-interactions (#58077)
* fixes for no-noninteractive-element-interactions * remaining fixes * add type="button" * fix unit tests
This commit is contained in:
@@ -53,7 +53,7 @@ export const LinkSettingsList: React.FC<LinkSettingsListProps> = ({ dashboard, o
|
||||
|
||||
return (
|
||||
<>
|
||||
<table className="filter-table filter-table--hover">
|
||||
<table role="grid" className="filter-table filter-table--hover">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Type</th>
|
||||
@@ -64,28 +64,28 @@ export const LinkSettingsList: React.FC<LinkSettingsListProps> = ({ dashboard, o
|
||||
<tbody>
|
||||
{links.map((link, idx) => (
|
||||
<tr key={`${link.title}-${idx}`}>
|
||||
<td className="pointer" onClick={() => onEdit(idx)}>
|
||||
<td role="gridcell" className="pointer" onClick={() => onEdit(idx)}>
|
||||
<Icon name="external-link-alt" /> {link.type}
|
||||
</td>
|
||||
<td>
|
||||
<td role="gridcell">
|
||||
<HorizontalGroup>
|
||||
{link.title && <span>{link.title}</span>}
|
||||
{link.type === 'link' && <span>{link.url}</span>}
|
||||
{link.type === 'dashboards' && <TagList tags={link.tags ?? []} />}
|
||||
</HorizontalGroup>
|
||||
</td>
|
||||
<td style={{ width: '1%' }}>
|
||||
<td style={{ width: '1%' }} role="gridcell">
|
||||
{idx !== 0 && <IconButton name="arrow-up" aria-label="arrow-up" onClick={() => moveLink(idx, -1)} />}
|
||||
</td>
|
||||
<td style={{ width: '1%' }}>
|
||||
<td style={{ width: '1%' }} role="gridcell">
|
||||
{links.length > 1 && idx !== links.length - 1 ? (
|
||||
<IconButton name="arrow-down" aria-label="arrow-down" onClick={() => moveLink(idx, 1)} />
|
||||
) : null}
|
||||
</td>
|
||||
<td style={{ width: '1%' }}>
|
||||
<td style={{ width: '1%' }} role="gridcell">
|
||||
<IconButton aria-label="copy" name="copy" onClick={() => duplicateLink(link, idx)} />
|
||||
</td>
|
||||
<td style={{ width: '1%' }}>
|
||||
<td style={{ width: '1%' }} role="gridcell">
|
||||
<DeleteButton
|
||||
aria-label={`Delete link with title "${link.title}"`}
|
||||
size="sm"
|
||||
|
||||
Reference in New Issue
Block a user