From 8aceacffb87384ad6127c79f17c2e347a5162017 Mon Sep 17 00:00:00 2001 From: Mohamed Khelif Date: Wed, 1 Nov 2023 10:49:05 -0400 Subject: [PATCH] DEVPROD-949 Only surface build variant for current task on task history page (#2129) --- src/constants/routes.ts | 10 +++++++--- src/pages/task/ActionButtons.tsx | 2 ++ src/pages/task/taskTabs/testsTable/LogsColumn.tsx | 3 ++- 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/src/constants/routes.ts b/src/constants/routes.ts index 92643e9044..777442bc65 100644 --- a/src/constants/routes.ts +++ b/src/constants/routes.ts @@ -257,7 +257,8 @@ const getHistoryRoute = ( failingTests?: string[]; passingTests?: string[]; }, - selectedCommit?: number + selectedCommit?: number, + visibleColumns?: string[] ) => { if (filters || selectedCommit) { const failingTests = toArray(filters?.failingTests); @@ -267,6 +268,7 @@ const getHistoryRoute = ( [TestStatus.Failed]: failingTests, [TestStatus.Passed]: passingTests, [HistoryQueryParams.SelectedCommit]: selectedCommit, + [HistoryQueryParams.VisibleColumns]: visibleColumns, }); return `${basePath}?${queryParams}`; } @@ -302,14 +304,16 @@ export const getTaskHistoryRoute = ( passingTests?: string[]; }; selectedCommit?: number; + visibleColumns?: string[]; } ) => { - const { filters, selectedCommit } = options || {}; + const { filters, selectedCommit, visibleColumns } = options || {}; return getHistoryRoute( `${paths.taskHistory}/${encodeURIComponent(projectIdentifier)}/${taskName}`, filters, - selectedCommit + selectedCommit, + visibleColumns ); }; diff --git a/src/pages/task/ActionButtons.tsx b/src/pages/task/ActionButtons.tsx index 4c657b6970..313ec245d2 100644 --- a/src/pages/task/ActionButtons.tsx +++ b/src/pages/task/ActionButtons.tsx @@ -55,6 +55,7 @@ export const ActionButtons: React.FC = ({ task, }) => { const { + buildVariant, canAbort, canDisable, canOverrideDependencies, @@ -178,6 +179,7 @@ export const ActionButtons: React.FC = ({ const HistoryLink = useLGButtonRouterLink( getTaskHistoryRoute(projectIdentifier, displayName, { selectedCommit: !isPatch && order, + visibleColumns: [buildVariant], }) ); diff --git a/src/pages/task/taskTabs/testsTable/LogsColumn.tsx b/src/pages/task/taskTabs/testsTable/LogsColumn.tsx index 6a13a8bf04..b6ed30979a 100644 --- a/src/pages/task/taskTabs/testsTable/LogsColumn.tsx +++ b/src/pages/task/taskTabs/testsTable/LogsColumn.tsx @@ -22,7 +22,7 @@ export const LogsColumn: React.FC = ({ task, testResult }) => { urlParsley, urlRaw, } = testResult.logs ?? {}; - const { displayName, displayTask, order, project } = task ?? {}; + const { buildVariant, displayName, displayTask, order, project } = task ?? {}; const { sendEvent } = useTaskAnalytics(); const filters = status === TestStatus.Fail @@ -114,6 +114,7 @@ export const LogsColumn: React.FC = ({ task, testResult }) => { to={getTaskHistoryRoute(project?.identifier, displayName, { filters, selectedCommit: order, + visibleColumns: [buildVariant], })} /> )}