From f905853ad6b0a61b3780cfe7f3fe45392ce3c09b Mon Sep 17 00:00:00 2001 From: Dmitry Lobanov Date: Sat, 8 Oct 2022 10:22:58 +0000 Subject: [PATCH] refactor: replace @material-ui Link Signed-off-by: Dmitry Lobanov --- .changeset/two-yaks-wave.md | 20 ++++++++++++++++++ packages/app/src/components/Root/Root.tsx | 12 +++-------- .../HeaderIconLinkRow/IconLinkVertical.tsx | 12 +++-------- .../src/components/Link/Link.tsx | 1 + .../src/layout/Page/Page.stories.tsx | 7 ++++--- .../src/layout/Sidebar/Intro.tsx | 11 +++------- .../packages/app/src/components/Root/Root.tsx | 12 +++-------- .../src/components/Root/Root.tsx | 5 ++--- .../AzureSitesOverviewTable.tsx | 9 ++------ .../components/AboutCard/AboutCard.test.tsx | 11 ++++++---- .../BuildWithStepsPage/BuildWithStepsPage.tsx | 15 ++++--------- .../WorkflowRunDetails/WorkflowRunDetails.tsx | 5 ++--- .../WorkflowRunsTable/WorkflowRunsTable.tsx | 11 +++------- .../Problems/ProblemsTable/ProblemsTable.tsx | 4 ++-- .../components/CalendarCard/CalendarEvent.tsx | 6 +++--- .../CalendarEventPopoverContent.tsx | 11 +++++----- .../WorkflowRunDetails/WorkflowRunDetails.tsx | 5 ++--- .../WorkflowRunsTable/WorkflowRunsTable.tsx | 8 +++++-- .../GithubIssues/IssueCard/IssueCard.tsx | 15 ++++--------- .../components/ClusterPage/ClusterPage.tsx | 9 ++------ .../ProfileCatalog/ProfileCatalog.tsx | 7 +++---- .../BuildWithStepsPage/BuildWithStepsPage.tsx | 21 +++++++++++-------- .../ConsumerGroupOffsets.tsx | 10 +++------ .../components/Incident/IncidentListItem.tsx | 10 ++------- .../RollbarTopItemsTable.tsx | 10 +++------ .../components/TemplateCard/TemplateCard.tsx | 4 ++-- .../TemplateCard/CardLink.tsx | 5 +++-- 27 files changed, 109 insertions(+), 147 deletions(-) create mode 100644 .changeset/two-yaks-wave.md diff --git a/.changeset/two-yaks-wave.md b/.changeset/two-yaks-wave.md new file mode 100644 index 0000000000..97c2908928 --- /dev/null +++ b/.changeset/two-yaks-wave.md @@ -0,0 +1,20 @@ +--- +'@backstage/core-components': patch +'@backstage/create-app': patch +'@backstage/plugin-azure-sites': patch +'@backstage/plugin-catalog': patch +'@backstage/plugin-circleci': patch +'@backstage/plugin-cloudbuild': patch +'@backstage/plugin-dynatrace': patch +'@backstage/plugin-gcalendar': patch +'@backstage/plugin-github-actions': patch +'@backstage/plugin-github-issues': patch +'@backstage/plugin-gitops-profiles': patch +'@backstage/plugin-jenkins': patch +'@backstage/plugin-kafka': patch +'@backstage/plugin-pagerduty': patch +'@backstage/plugin-rollbar': patch +'@backstage/plugin-scaffolder': patch +--- + +Prefer using `Link` from `@backstage/core-components` rather than material-UI. diff --git a/packages/app/src/components/Root/Root.tsx b/packages/app/src/components/Root/Root.tsx index 0c142bafbd..41e5b15db9 100644 --- a/packages/app/src/components/Root/Root.tsx +++ b/packages/app/src/components/Root/Root.tsx @@ -15,7 +15,7 @@ */ import React, { PropsWithChildren } from 'react'; -import { Link, makeStyles } from '@material-ui/core'; +import { makeStyles } from '@material-ui/core'; import HomeIcon from '@material-ui/icons/Home'; import ExtensionIcon from '@material-ui/icons/Extension'; import RuleIcon from '@material-ui/icons/AssignmentTurnedIn'; @@ -29,7 +29,6 @@ import MenuIcon from '@material-ui/icons/Menu'; import MoneyIcon from '@material-ui/icons/MonetizationOn'; import LogoFull from './LogoFull'; import LogoIcon from './LogoIcon'; -import { NavLink } from 'react-router-dom'; import { GraphiQLIcon } from '@backstage/plugin-graphiql'; import { Settings as SidebarSettings, @@ -46,6 +45,7 @@ import { SidebarPage, SidebarScrollWrapper, SidebarSpace, + Link, useSidebarOpenState, } from '@backstage/core-components'; import { MyGroupsSidebarItem } from '@backstage/plugin-org'; @@ -74,13 +74,7 @@ const SidebarLogo = () => { return (
- + {isOpen ? : }
diff --git a/packages/core-components/src/components/HeaderIconLinkRow/IconLinkVertical.tsx b/packages/core-components/src/components/HeaderIconLinkRow/IconLinkVertical.tsx index dda2782c45..f128455549 100644 --- a/packages/core-components/src/components/HeaderIconLinkRow/IconLinkVertical.tsx +++ b/packages/core-components/src/components/HeaderIconLinkRow/IconLinkVertical.tsx @@ -16,9 +16,8 @@ import React from 'react'; import classnames from 'classnames'; import { makeStyles } from '@material-ui/core/styles'; -import Link from '@material-ui/core/Link'; import LinkIcon from '@material-ui/icons/Link'; -import { Link as RouterLink } from '../Link'; +import { Link } from '../Link'; export type IconLinkVerticalProps = { color?: 'primary' | 'secondary'; @@ -80,14 +79,10 @@ export function IconLinkVertical({ if (disabled) { return ( - +
{icon} {label} - +
); } @@ -96,7 +91,6 @@ export function IconLinkVertical({ title={title} className={classnames(classes.link, classes[color])} to={href} - component={RouterLink} onClick={onClick} > {icon} diff --git a/packages/core-components/src/components/Link/Link.tsx b/packages/core-components/src/components/Link/Link.tsx index 07bf8fd78f..66b7453abd 100644 --- a/packages/core-components/src/components/Link/Link.tsx +++ b/packages/core-components/src/components/Link/Link.tsx @@ -16,6 +16,7 @@ import { configApiRef, useAnalytics, useApi } from '@backstage/core-plugin-api'; import classnames from 'classnames'; +// eslint-disable-next-line no-restricted-imports import MaterialLink, { LinkProps as MaterialLinkProps, } from '@material-ui/core/Link'; diff --git a/packages/core-components/src/layout/Page/Page.stories.tsx b/packages/core-components/src/layout/Page/Page.stories.tsx index 289f0a6c0d..e8fdeea17b 100644 --- a/packages/core-components/src/layout/Page/Page.stories.tsx +++ b/packages/core-components/src/layout/Page/Page.stories.tsx @@ -18,7 +18,6 @@ import { wrapInTestApp } from '@backstage/test-utils'; import Box from '@material-ui/core/Box'; import Chip from '@material-ui/core/Chip'; import Grid from '@material-ui/core/Grid'; -import Link from '@material-ui/core/Link'; import Typography from '@material-ui/core/Typography'; import React, { useState } from 'react'; import { @@ -28,6 +27,7 @@ import { Table, TableColumn, TrendLine, + Link, } from '../../components'; import { Content } from '../Content'; import { ContentHeader } from '../ContentHeader'; @@ -75,7 +75,7 @@ const columns: TableColumn[] = [ highlight: true, render: (row: Partial) => ( <> - {row.branch} + {row.branch} {row.hash} ), @@ -169,7 +169,8 @@ const DataGrid = () => ( able to function. - Contact #cost-awareness for information and support. + Contact #cost-awareness for + information and support. diff --git a/packages/core-components/src/layout/Sidebar/Intro.tsx b/packages/core-components/src/layout/Sidebar/Intro.tsx index 05d580c960..91e188b203 100644 --- a/packages/core-components/src/layout/Sidebar/Intro.tsx +++ b/packages/core-components/src/layout/Sidebar/Intro.tsx @@ -16,8 +16,8 @@ import { BackstageTheme } from '@backstage/theme'; import Collapse from '@material-ui/core/Collapse'; -import Link from '@material-ui/core/Link'; import { makeStyles } from '@material-ui/core/styles'; +import IconButton from '@material-ui/core/IconButton'; import Typography from '@material-ui/core/Typography'; import CloseIcon from '@material-ui/icons/Close'; import React, { useContext, useState } from 'react'; @@ -106,17 +106,12 @@ export function IntroCard(props: IntroCardProps) {
{text}
- + Dismiss - +
); diff --git a/packages/create-app/templates/default-app/packages/app/src/components/Root/Root.tsx b/packages/create-app/templates/default-app/packages/app/src/components/Root/Root.tsx index 5400421e25..6768b48dad 100644 --- a/packages/create-app/templates/default-app/packages/app/src/components/Root/Root.tsx +++ b/packages/create-app/templates/default-app/packages/app/src/components/Root/Root.tsx @@ -1,5 +1,5 @@ import React, { PropsWithChildren } from 'react'; -import { Link, makeStyles } from '@material-ui/core'; +import { makeStyles } from '@material-ui/core'; import HomeIcon from '@material-ui/icons/Home'; import ExtensionIcon from '@material-ui/icons/Extension'; import MapIcon from '@material-ui/icons/MyLocation'; @@ -7,7 +7,6 @@ import LibraryBooks from '@material-ui/icons/LibraryBooks'; import CreateComponentIcon from '@material-ui/icons/AddCircleOutline'; import LogoFull from './LogoFull'; import LogoIcon from './LogoIcon'; -import { NavLink } from 'react-router-dom'; import { Settings as SidebarSettings, UserSettingsSignInAvatar, @@ -23,6 +22,7 @@ import { SidebarScrollWrapper, SidebarSpace, useSidebarOpenState, + Link, } from '@backstage/core-components'; import MenuIcon from '@material-ui/icons/Menu'; import SearchIcon from '@material-ui/icons/Search'; @@ -48,13 +48,7 @@ const SidebarLogo = () => { return (
- + {isOpen ? : }
diff --git a/packages/techdocs-cli-embedded-app/src/components/Root/Root.tsx b/packages/techdocs-cli-embedded-app/src/components/Root/Root.tsx index cd8b5d35ed..81e3d12d9d 100644 --- a/packages/techdocs-cli-embedded-app/src/components/Root/Root.tsx +++ b/packages/techdocs-cli-embedded-app/src/components/Root/Root.tsx @@ -16,7 +16,7 @@ import React, { PropsWithChildren } from 'react'; -import { Link, makeStyles } from '@material-ui/core'; +import { makeStyles } from '@material-ui/core'; import LibraryBooks from '@material-ui/icons/LibraryBooks'; import LogoFull from './LogoFull'; import LogoIcon from './LogoIcon'; @@ -28,8 +28,8 @@ import { sidebarConfig, SidebarDivider, useSidebarOpenState, + Link, } from '@backstage/core-components'; -import { NavLink } from 'react-router-dom'; const useSidebarLogoStyles = makeStyles({ root: { @@ -53,7 +53,6 @@ const SidebarLogo = () => { return (
{ field: 'name', highlight: true, render: (func: AzureSite) => { - return ( - - {func.name} - - ); + return {func.name}; }, }, { diff --git a/plugins/catalog/src/components/AboutCard/AboutCard.test.tsx b/plugins/catalog/src/components/AboutCard/AboutCard.test.tsx index f2fee7d9f4..c77787f717 100644 --- a/plugins/catalog/src/components/AboutCard/AboutCard.test.tsx +++ b/plugins/catalog/src/components/AboutCard/AboutCard.test.tsx @@ -216,7 +216,7 @@ describe('', () => { ); }); - it('renders without "view source" link', async () => { + it('renders disabled "view source" link', async () => { const entity = { apiVersion: 'v1', kind: 'Component', @@ -250,7 +250,8 @@ describe('', () => { }, }, ); - expect(getByText('View Source').closest('a')).not.toHaveAttribute('href'); + expect(getByText('View Source')).toBeVisible(); + expect(getByText('View Source').closest('a')).toBeNull(); }); it.each([ @@ -445,7 +446,8 @@ describe('', () => { }, ); - expect(getByText('View TechDocs').closest('a')).not.toHaveAttribute('href'); + expect(getByText('View TechDocs')).toBeVisible(); + expect(getByText('View TechDocs').closest('a')).toBeNull(); }); it('renders disabled techdocs link when route is not bound', async () => { @@ -497,6 +499,7 @@ describe('', () => { }, ); - expect(getByText('View TechDocs').closest('a')).not.toHaveAttribute('href'); + expect(getByText('View TechDocs')).toBeVisible(); + expect(getByText('View TechDocs').closest('a')).toBeNull(); }); }); diff --git a/plugins/circleci/src/components/BuildWithStepsPage/BuildWithStepsPage.tsx b/plugins/circleci/src/components/BuildWithStepsPage/BuildWithStepsPage.tsx index 137833ee0b..8d48be915e 100644 --- a/plugins/circleci/src/components/BuildWithStepsPage/BuildWithStepsPage.tsx +++ b/plugins/circleci/src/components/BuildWithStepsPage/BuildWithStepsPage.tsx @@ -17,32 +17,25 @@ import React, { useEffect } from 'react'; import { useParams } from 'react-router-dom'; import { BuildWithSteps, BuildStepAction } from '../../api'; -import { - Grid, - Box, - IconButton, - Typography, - Link as MaterialLink, -} from '@material-ui/core'; +import { Grid, Box, Typography } from '@material-ui/core'; import { makeStyles } from '@material-ui/core/styles'; import { ActionOutput } from './lib/ActionOutput/ActionOutput'; import LaunchIcon from '@material-ui/icons/Launch'; import { useBuildWithSteps } from '../../state/useBuildWithSteps'; import { Breadcrumbs, + Button, InfoCard, Progress, Link, } from '@backstage/core-components'; -const IconLink = IconButton as any as typeof MaterialLink; - const BuildName = ({ build }: { build?: BuildWithSteps }) => ( #{build?.build_num} - {build?.subject} - + ); diff --git a/plugins/cloudbuild/src/components/WorkflowRunDetails/WorkflowRunDetails.tsx b/plugins/cloudbuild/src/components/WorkflowRunDetails/WorkflowRunDetails.tsx index 0e532178e1..aacb437e7b 100644 --- a/plugins/cloudbuild/src/components/WorkflowRunDetails/WorkflowRunDetails.tsx +++ b/plugins/cloudbuild/src/components/WorkflowRunDetails/WorkflowRunDetails.tsx @@ -17,7 +17,6 @@ import { Entity } from '@backstage/catalog-model'; import { Box, LinearProgress, - Link as MaterialLink, makeStyles, Paper, Table, @@ -135,10 +134,10 @@ export const WorkflowRunDetails = (props: { entity: Entity }) => { {details.value?.logUrl && ( - + Workflow runs on Google{' '} - + )} diff --git a/plugins/cloudbuild/src/components/WorkflowRunsTable/WorkflowRunsTable.tsx b/plugins/cloudbuild/src/components/WorkflowRunsTable/WorkflowRunsTable.tsx index a8e2a12ea8..736e641dbd 100644 --- a/plugins/cloudbuild/src/components/WorkflowRunsTable/WorkflowRunsTable.tsx +++ b/plugins/cloudbuild/src/components/WorkflowRunsTable/WorkflowRunsTable.tsx @@ -14,10 +14,9 @@ * limitations under the License. */ import React from 'react'; -import { Link, Typography, Box, IconButton, Tooltip } from '@material-ui/core'; +import { Typography, Box, IconButton, Tooltip } from '@material-ui/core'; import RetryIcon from '@material-ui/icons/Replay'; import GoogleIcon from '@material-ui/icons/CloudCircle'; -import { Link as RouterLink } from 'react-router-dom'; import { useWorkflowRuns, WorkflowRun } from '../useWorkflowRuns'; import { WorkflowRunStatus } from '../WorkflowRunStatus'; import SyncIcon from '@material-ui/icons/Sync'; @@ -25,7 +24,7 @@ import { useProjectName } from '../useProjectName'; import { Entity } from '@backstage/catalog-model'; import { buildRouteRef } from '../../routes'; import { DateTime } from 'luxon'; -import { Table, TableColumn } from '@backstage/core-components'; +import { Table, TableColumn, Link } from '@backstage/core-components'; import { useRouteRef } from '@backstage/core-plugin-api'; const generatedColumns: TableColumn[] = [ @@ -59,11 +58,7 @@ const generatedColumns: TableColumn[] = [ const LinkWrapper = () => { const routeLink = useRouteRef(buildRouteRef); return ( - + {row.message} ); diff --git a/plugins/dynatrace/src/components/Problems/ProblemsTable/ProblemsTable.tsx b/plugins/dynatrace/src/components/Problems/ProblemsTable/ProblemsTable.tsx index 78d26e3fe2..12570be6ef 100644 --- a/plugins/dynatrace/src/components/Problems/ProblemsTable/ProblemsTable.tsx +++ b/plugins/dynatrace/src/components/Problems/ProblemsTable/ProblemsTable.tsx @@ -17,7 +17,7 @@ import React from 'react'; import { Table, TableColumn } from '@backstage/core-components'; import { DynatraceProblem } from '../../../api/DynatraceApi'; import { ProblemStatus } from '../ProblemStatus'; -import { Link } from '@material-ui/core'; +import { Link } from '@backstage/core-components'; type ProblemsTableProps = { problems: DynatraceProblem[]; @@ -36,7 +36,7 @@ export const ProblemsTable = (props: ProblemsTableProps) => { field: 'title', render: (row: Partial) => ( {row.title} diff --git a/plugins/gcalendar/src/components/CalendarCard/CalendarEvent.tsx b/plugins/gcalendar/src/components/CalendarCard/CalendarEvent.tsx index 89705a5a7b..5ea538df86 100644 --- a/plugins/gcalendar/src/components/CalendarCard/CalendarEvent.tsx +++ b/plugins/gcalendar/src/components/CalendarCard/CalendarEvent.tsx @@ -22,10 +22,10 @@ import { import React, { useState } from 'react'; import { useAnalytics } from '@backstage/core-plugin-api'; +import { Link } from '@backstage/core-components'; import { Box, - Link, Paper, Popover, Tooltip, @@ -133,12 +133,12 @@ export const CalendarEvent = ({ event }: { event: GCalendarEvent }) => { { e.stopPropagation(); analytics.captureEvent('click', 'zoom link'); }} + noTrack > Zoom link diff --git a/plugins/gcalendar/src/components/CalendarCard/CalendarEventPopoverContent.tsx b/plugins/gcalendar/src/components/CalendarCard/CalendarEventPopoverContent.tsx index 4af33171d4..45e793470b 100644 --- a/plugins/gcalendar/src/components/CalendarCard/CalendarEventPopoverContent.tsx +++ b/plugins/gcalendar/src/components/CalendarCard/CalendarEventPopoverContent.tsx @@ -18,12 +18,11 @@ import React from 'react'; import DOMPurify from 'dompurify'; import { useAnalytics } from '@backstage/core-plugin-api'; - +import { Link } from '@backstage/core-components'; import { Box, Divider, IconButton, - Link, Tooltip, Typography, makeStyles, @@ -77,11 +76,11 @@ export const CalendarEventPopoverContent = ({ analytics.captureEvent('click', 'open in calendar') } + noTrack > @@ -92,9 +91,9 @@ export const CalendarEventPopoverContent = ({ {zoomLink && ( analytics.captureEvent('click', 'zoom link')} + noTrack > Join Zoom Meeting diff --git a/plugins/github-actions/src/components/WorkflowRunDetails/WorkflowRunDetails.tsx b/plugins/github-actions/src/components/WorkflowRunDetails/WorkflowRunDetails.tsx index cda0b9c219..f05ea692f5 100644 --- a/plugins/github-actions/src/components/WorkflowRunDetails/WorkflowRunDetails.tsx +++ b/plugins/github-actions/src/components/WorkflowRunDetails/WorkflowRunDetails.tsx @@ -22,7 +22,6 @@ import { Box, CircularProgress, LinearProgress, - Link as MaterialLink, ListItemText, makeStyles, Paper, @@ -246,10 +245,10 @@ export const WorkflowRunDetails = ({ entity }: { entity: Entity }) => { {details.value?.html_url && ( - + Workflow runs on GitHub{' '} - + )} diff --git a/plugins/github-actions/src/components/WorkflowRunsTable/WorkflowRunsTable.tsx b/plugins/github-actions/src/components/WorkflowRunsTable/WorkflowRunsTable.tsx index fb80376354..88f8567b90 100644 --- a/plugins/github-actions/src/components/WorkflowRunsTable/WorkflowRunsTable.tsx +++ b/plugins/github-actions/src/components/WorkflowRunsTable/WorkflowRunsTable.tsx @@ -15,7 +15,6 @@ */ import React from 'react'; import { - Link, Typography, Box, IconButton, @@ -33,7 +32,12 @@ import { getProjectNameFromEntity } from '../getProjectNameFromEntity'; import { Entity } from '@backstage/catalog-model'; import { readGithubIntegrationConfigs } from '@backstage/integration'; -import { EmptyState, Table, TableColumn } from '@backstage/core-components'; +import { + EmptyState, + Table, + TableColumn, + Link, +} from '@backstage/core-components'; import { configApiRef, useApi, useRouteRef } from '@backstage/core-plugin-api'; const generatedColumns: TableColumn[] = [ diff --git a/plugins/github-issues/src/components/GithubIssues/IssueCard/IssueCard.tsx b/plugins/github-issues/src/components/GithubIssues/IssueCard/IssueCard.tsx index 1094bc561f..bbc4995796 100644 --- a/plugins/github-issues/src/components/GithubIssues/IssueCard/IssueCard.tsx +++ b/plugins/github-issues/src/components/GithubIssues/IssueCard/IssueCard.tsx @@ -16,13 +16,9 @@ import React from 'react'; import { DateTime } from 'luxon'; -import { - Box, - Paper, - Typography, - CardActionArea, - Link, -} from '@material-ui/core'; + +import { Box, Paper, Typography, CardActionArea } from '@material-ui/core'; +import { Link } from '@backstage/core-components'; import { Assignees } from './Assignees'; import { CommentsCount } from './CommentsCount'; import Divider from '@material-ui/core/Divider'; @@ -63,10 +59,7 @@ export const IssueCard = (props: IssueCardProps) => { - + {repositoryName} diff --git a/plugins/gitops-profiles/src/components/ClusterPage/ClusterPage.tsx b/plugins/gitops-profiles/src/components/ClusterPage/ClusterPage.tsx index 117159cc56..fbc2d06ce0 100644 --- a/plugins/gitops-profiles/src/components/ClusterPage/ClusterPage.tsx +++ b/plugins/gitops-profiles/src/components/ClusterPage/ClusterPage.tsx @@ -15,7 +15,6 @@ */ import React, { useEffect, useState } from 'react'; -import { Link } from '@material-ui/core'; import { useParams } from 'react-router-dom'; import { gitOpsApiRef, Status } from '../../api'; import { transformRunStatus } from '../ProfileCatalog'; @@ -27,6 +26,7 @@ import { Table, Progress, HeaderLabel, + Link, } from '@backstage/core-components'; import { useApi, githubAuthApiRef } from '@backstage/core-plugin-api'; @@ -94,12 +94,7 @@ const ClusterPage = () => { data={transformRunStatus(runStatus)} columns={columns} /> - + Details diff --git a/plugins/gitops-profiles/src/components/ProfileCatalog/ProfileCatalog.tsx b/plugins/gitops-profiles/src/components/ProfileCatalog/ProfileCatalog.tsx index caab33217d..e5cef084b5 100644 --- a/plugins/gitops-profiles/src/components/ProfileCatalog/ProfileCatalog.tsx +++ b/plugins/gitops-profiles/src/components/ProfileCatalog/ProfileCatalog.tsx @@ -15,7 +15,7 @@ */ import React, { useEffect, useState } from 'react'; -import { TextField, List, ListItem, Link } from '@material-ui/core'; +import { TextField, List, ListItem } from '@material-ui/core'; import ClusterTemplateCardList from '../ClusterTemplateCardList'; import ProfileCardList from '../ProfileCardList'; @@ -32,6 +32,7 @@ import { SimpleStepper, SimpleStepperStep, InfoCard, + Link, Progress, Table, StatusWarning, @@ -340,9 +341,7 @@ const ProfileCatalog = () => { /> Details diff --git a/plugins/jenkins/src/components/BuildWithStepsPage/BuildWithStepsPage.tsx b/plugins/jenkins/src/components/BuildWithStepsPage/BuildWithStepsPage.tsx index e06332f8f0..3b52c65930 100644 --- a/plugins/jenkins/src/components/BuildWithStepsPage/BuildWithStepsPage.tsx +++ b/plugins/jenkins/src/components/BuildWithStepsPage/BuildWithStepsPage.tsx @@ -15,7 +15,6 @@ */ import { Box, - Link as MaterialLink, Paper, Table, TableBody, @@ -102,10 +101,12 @@ const BuildWithStepsView = () => { Jenkins - - View on Jenkins{' '} - - + {value?.url && ( + + View on Jenkins{' '} + + + )} @@ -114,10 +115,12 @@ const BuildWithStepsView = () => { GitHub - - View on GitHub{' '} - - + {value?.source?.url && ( + + View on GitHub{' '} + + + )} diff --git a/plugins/kafka/src/components/ConsumerGroupOffsets/ConsumerGroupOffsets.tsx b/plugins/kafka/src/components/ConsumerGroupOffsets/ConsumerGroupOffsets.tsx index 17f7af3740..d166195cf9 100644 --- a/plugins/kafka/src/components/ConsumerGroupOffsets/ConsumerGroupOffsets.tsx +++ b/plugins/kafka/src/components/ConsumerGroupOffsets/ConsumerGroupOffsets.tsx @@ -14,11 +14,11 @@ * limitations under the License. */ -import { Box, Grid, Typography, Link } from '@material-ui/core'; +import { Box, Grid, Typography } from '@material-ui/core'; import RetryIcon from '@material-ui/icons/Replay'; import React from 'react'; import { useConsumerGroupsOffsetsForEntity } from './useConsumerGroupsOffsetsForEntity'; -import { Table, TableColumn } from '@backstage/core-components'; +import { Table, TableColumn, Link } from '@backstage/core-components'; export type TopicPartitionInfo = { topic: string; @@ -103,11 +103,7 @@ export const ConsumerGroupOffsets = ({ Consumed Topics for {consumerGroup} ( - {(dashboardUrl && ( - - {clusterId} - - )) || + {(dashboardUrl && {clusterId}) || clusterId} ) diff --git a/plugins/pagerduty/src/components/Incident/IncidentListItem.tsx b/plugins/pagerduty/src/components/Incident/IncidentListItem.tsx index 5945c45e83..b23fcb8490 100644 --- a/plugins/pagerduty/src/components/Incident/IncidentListItem.tsx +++ b/plugins/pagerduty/src/components/Incident/IncidentListItem.tsx @@ -22,7 +22,6 @@ import { ListItemText, makeStyles, IconButton, - Link, Typography, Chip, } from '@material-ui/core'; @@ -32,6 +31,7 @@ import { DateTime, Duration } from 'luxon'; import { PagerDutyIncident } from '../types'; import OpenInBrowserIcon from '@material-ui/icons/OpenInBrowser'; import { BackstageTheme } from '@backstage/theme'; +import { Link } from '@backstage/core-components'; const useStyles = makeStyles(theme => ({ denseListIcon: { @@ -100,13 +100,7 @@ export const IncidentListItem = ({ incident }: Props) => { secondary={ Created {createdAt} and assigned to{' '} - - {user?.summary ?? 'nobody'} - + {user?.summary ?? 'nobody'} } /> diff --git a/plugins/rollbar/src/components/RollbarTopItemsTable/RollbarTopItemsTable.tsx b/plugins/rollbar/src/components/RollbarTopItemsTable/RollbarTopItemsTable.tsx index 45d1ab8e4f..89fa7596b0 100644 --- a/plugins/rollbar/src/components/RollbarTopItemsTable/RollbarTopItemsTable.tsx +++ b/plugins/rollbar/src/components/RollbarTopItemsTable/RollbarTopItemsTable.tsx @@ -14,7 +14,7 @@ * limitations under the License. */ -import { Box, Link, Typography } from '@material-ui/core'; +import { Box, Typography } from '@material-ui/core'; import { Alert } from '@material-ui/lab'; import React from 'react'; import { @@ -24,7 +24,7 @@ import { } from '../../api/types'; import { buildItemUrl } from '../../utils'; import { TrendGraph } from '../TrendGraph/TrendGraph'; -import { Table, TableColumn } from '@backstage/core-components'; +import { Table, TableColumn, Link } from '@backstage/core-components'; const columns: TableColumn[] = [ { @@ -34,11 +34,7 @@ const columns: TableColumn[] = [ align: 'left', width: '70px', render: (data: any) => ( - + {data.item.counter} ), diff --git a/plugins/scaffolder/src/components/TemplateCard/TemplateCard.tsx b/plugins/scaffolder/src/components/TemplateCard/TemplateCard.tsx index 9d1509e7a6..984e51f3b5 100644 --- a/plugins/scaffolder/src/components/TemplateCard/TemplateCard.tsx +++ b/plugins/scaffolder/src/components/TemplateCard/TemplateCard.tsx @@ -24,6 +24,7 @@ import { import { Button, ItemCardHeader, + Link, MarkdownContent, } from '@backstage/core-components'; import { @@ -52,7 +53,6 @@ import { CardMedia, Chip, IconButton, - Link, makeStyles, Tooltip, Typography, @@ -162,7 +162,7 @@ const DeprecationWarning = () => {
diff --git a/plugins/scaffolder/src/next/TemplateListPage/TemplateCard/CardLink.tsx b/plugins/scaffolder/src/next/TemplateListPage/TemplateCard/CardLink.tsx index 3ec31673db..9bdb3cf7fb 100644 --- a/plugins/scaffolder/src/next/TemplateListPage/TemplateCard/CardLink.tsx +++ b/plugins/scaffolder/src/next/TemplateListPage/TemplateCard/CardLink.tsx @@ -15,7 +15,8 @@ */ import { IconComponent } from '@backstage/core-plugin-api'; import { BackstageTheme } from '@backstage/theme'; -import { Link, makeStyles } from '@material-ui/core'; +import { Link } from '@backstage/core-components'; +import { makeStyles } from '@material-ui/core'; import React from 'react'; interface CardLinkProps { @@ -37,7 +38,7 @@ export const CardLink = ({ icon: Icon, text, url }: CardLinkProps) => { return (
- + {text || url}