From 7e44881e57e8102da810dea8a9f8e98f12259b53 Mon Sep 17 00:00:00 2001 From: Laura Barcziova Date: Mon, 26 Feb 2024 15:23:10 +0100 Subject: [PATCH] Link package in relese sync results Partially fixes #358 (for failed syncs, the info is still missing). --- .../Results/ResultsPageSyncReleaseRuns.tsx | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/frontend/src/app/Results/ResultsPageSyncReleaseRuns.tsx b/frontend/src/app/Results/ResultsPageSyncReleaseRuns.tsx index 799a7944..74b7a4dd 100644 --- a/frontend/src/app/Results/ResultsPageSyncReleaseRuns.tsx +++ b/frontend/src/app/Results/ResultsPageSyncReleaseRuns.tsx @@ -53,6 +53,7 @@ interface SyncReleaseRun { issue_id: number | null; branch_name: string | null; release: string | null; + downstream_pr_project: string | null; } const fetchSyncRelease = (url: string) => @@ -116,6 +117,23 @@ const ResultsPageSyncReleaseRuns: React.FC = ({ <>Link will be available after successful downstream PR submission. ); + const getLinkToPackage = () => { + if (!data.downstream_pr_project) return <>Link not available.; + + const lastSlashIndex = data.downstream_pr_project.lastIndexOf("/"); + const packageName = + lastSlashIndex !== -1 + ? data.downstream_pr_project.substring(lastSlashIndex + 1) + : ""; + return packageName ? ( + + {packageName} + + ) : ( + <>Link not available. + ); + }; + const FooterButton = () => { const handleClick = () => { if (logViewerRef.current) logViewerRef.current.scrollToBottom(); @@ -256,6 +274,10 @@ const ResultsPageSyncReleaseRuns: React.FC = ({ link={data.downstream_pr_url} /> + Package + + {getLinkToPackage()} + Submitted Time