From c48cd2b7644e1aee62d7cf66fc54299ad7e8f390 Mon Sep 17 00:00:00 2001 From: Martin Wittlinger Date: Mon, 8 Jan 2024 00:20:05 +0100 Subject: [PATCH] feat: make project URL clickable (#1429) --- frontend/src/pages/LiveFeedPage.tsx | 33 ++++++++++++++++++++++++++++- 1 file changed, 32 insertions(+), 1 deletion(-) diff --git a/frontend/src/pages/LiveFeedPage.tsx b/frontend/src/pages/LiveFeedPage.tsx index c8ab3cab8..829a4a3d9 100644 --- a/frontend/src/pages/LiveFeedPage.tsx +++ b/frontend/src/pages/LiveFeedPage.tsx @@ -2,6 +2,7 @@ import PageLayout from './PageLayout'; import { Box, LinearProgress, + Link, Table, TableBody, TableCell, @@ -14,6 +15,7 @@ import { Error } from '@mui/icons-material'; import React from 'react'; import AppBreadcrumbs from '../component/StyledBreadCrumb'; import { DateTimeFormatter, LocalDateTime } from '@js-joda/core'; +import { useNavigate } from 'react-router-dom'; const breadcrumbItems = [{ text: 'Home', href: '/home' }, { text: 'LiveFeed' }]; @@ -85,7 +87,7 @@ export function LiveFeedPage() { )} > {run?.projectName} - {run?.projectUrl} + {ClickableTableCell(run!.projectUrl!)} {stripCommitHash(run?.commitHash)} {run?.analyzerName} {run?.numberOfIssues} @@ -110,3 +112,32 @@ const formatTimestamp = (timestamp: string): string => { const dateTime = LocalDateTime.parse(timestamp); return dateTime.format(DateTimeFormatter.ofPattern(' d/M/yyyy HH:mm')); }; + +function ClickableTableCell(url: string) { + const navigate = useNavigate(); + + return ( + + + { + event.preventDefault(); + navigate(url); + }} + > + {url} + + + + ); +}