From d9a96404cba4ae988e0cc17321a96edb84a4d7bf 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 aa0831ab..c3fa2e53 100644 --- a/frontend/src/app/Results/ResultsPageSyncReleaseRuns.tsx +++ b/frontend/src/app/Results/ResultsPageSyncReleaseRuns.tsx @@ -50,6 +50,7 @@ interface SyncReleaseRun { issue_id: number | null; branch_name: string | null; release: string | null; + downstream_pr_project: string | null; } const fetchSyncRelease = (url: string) => @@ -113,6 +114,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(); @@ -253,6 +271,10 @@ const ResultsPageSyncReleaseRuns: React.FC = ({ link={data.downstream_pr_url} /> + Package + + {getLinkToPackage()} + Submitted Time