Prefer Link over plain anchors

Signed-off-by: Fredrik Adelöw <freben@gmail.com>
This commit is contained in:
Fredrik Adelöw
2023-02-14 10:21:48 +01:00
parent 49c710940f
commit 4bdd6bcb3c
4 changed files with 21 additions and 13 deletions
+7
View File
@@ -0,0 +1,7 @@
---
'@backstage/plugin-apache-airflow': patch
'@backstage/plugin-azure-sites': patch
'@backstage/plugin-lighthouse': patch
---
Prefer Link over plain anchors
@@ -15,6 +15,7 @@
*/
import {
Link,
Progress,
StatusError,
StatusOK,
@@ -144,13 +145,14 @@ export const DenseTable = ({ dags, rowClick }: DenseTableProps) => {
{
title: 'Link',
field: 'dagUrl',
render: (row: Partial<DagTableRow>) => (
<a href={row.dagUrl}>
<IconButton aria-label="details">
<OpenInBrowserIcon />
</IconButton>
</a>
),
render: (row: Partial<DagTableRow>) =>
!row.dagUrl ? null : (
<Link to={row.dagUrl}>
<IconButton aria-label="details">
<OpenInBrowserIcon />
</IconButton>
</Link>
),
width: '5%',
disableClick: true,
hidden: hiddenColumns.some(field => field === 'dagUrl'),
@@ -164,9 +164,8 @@ const ActionButtons = ({
</MenuItem>
)}
<MenuItem
component="a"
href={value.logstreamHref}
target="_blank"
component={Link}
to={value.logstreamHref}
key="logStream"
onClick={handleClose}
>
@@ -22,6 +22,7 @@ import LighthouseSupportButton from '../SupportButton';
import {
ContentHeader,
InfoCard,
Link,
MarkdownContent,
} from '@backstage/core-components';
@@ -108,10 +109,9 @@ function GettingStartedCard() {
<Grid container direction="row" justifyContent="flex-end">
<Grid item>
<Button
component="a"
href="https://github.com/spotify/lighthouse-audit-service"
component={Link}
to="https://github.com/spotify/lighthouse-audit-service"
size="small"
target="_blank"
>
Check out the README
</Button>