diff --git a/plugins/newrelic-dashboard/src/components/NewRelicDashboard/DashboardSnapshotList/DashboardSnapshot.tsx b/plugins/newrelic-dashboard/src/components/NewRelicDashboard/DashboardSnapshotList/DashboardSnapshot.tsx index 3f72981b97..932bdf2dbf 100644 --- a/plugins/newrelic-dashboard/src/components/NewRelicDashboard/DashboardSnapshotList/DashboardSnapshot.tsx +++ b/plugins/newrelic-dashboard/src/components/NewRelicDashboard/DashboardSnapshotList/DashboardSnapshot.tsx @@ -17,7 +17,12 @@ import React from 'react'; import { Box, Grid } from '@material-ui/core'; import { useApi } from '@backstage/core-plugin-api'; import { useAsync } from 'react-use'; -import { InfoCard, Progress, ErrorPanel } from '@backstage/core-components'; +import { + InfoCard, + Progress, + ErrorPanel, + Link, +} from '@backstage/core-components'; import { newRelicDashboardApiRef } from '../../../api'; import { DashboardSnapshotSummary } from './../../../api/NewRelicDashboardApi'; @@ -48,21 +53,27 @@ export const DashboardSnapshot = ({ if (error) { return ; } + const url = + value?.getDashboardSnapshot?.data?.dashboardCreateSnapshotUrl?.replace( + /PDF$/, + 'png', + ); return ( - - {`${name} - + + {url ? ( + {`${name} + ) : ( + 'Dashboard loading... , click here to open if it didnt render correctly' + )} +