diff --git a/dashboard/src/components/StatusChart/StatusCharts.tsx b/dashboard/src/components/StatusChart/StatusCharts.tsx index a46bad35..e8290ac7 100644 --- a/dashboard/src/components/StatusChart/StatusCharts.tsx +++ b/dashboard/src/components/StatusChart/StatusCharts.tsx @@ -154,7 +154,7 @@ const ChartLegend = ({ chartValues, onClick }: IChartLegend): JSX.Element => { onClick?.(status)} key={chartValue?.color} - className="flex flex-row" + className="flex flex-row text-left" > {chartValue && (
diff --git a/dashboard/src/pages/TreeDetails/Tabs/Build/BuildTab.tsx b/dashboard/src/pages/TreeDetails/Tabs/Build/BuildTab.tsx index 2b135e64..2b1675b7 100644 --- a/dashboard/src/pages/TreeDetails/Tabs/Build/BuildTab.tsx +++ b/dashboard/src/pages/TreeDetails/Tabs/Build/BuildTab.tsx @@ -72,7 +72,7 @@ const StatusCard = ({ }, { value: treeDetailsData?.buildsSummary.null ?? 0, - label: 'treeDetails.unknown', + label: 'global.inconclusive', color: Colors.Gray, }, ]} diff --git a/dashboard/src/pages/TreeDetails/Tabs/TestCards.tsx b/dashboard/src/pages/TreeDetails/Tabs/TestCards.tsx index 59f4d43d..d9074c60 100644 --- a/dashboard/src/pages/TreeDetails/Tabs/TestCards.tsx +++ b/dashboard/src/pages/TreeDetails/Tabs/TestCards.tsx @@ -13,6 +13,7 @@ import StatusChartMemoized, { Colors, StatusChartValues, } from '@/components/StatusChart/StatusCharts'; +import { groupStatus } from '@/utils/status'; interface IConfigList extends Pick { title: IBaseCard['title']; @@ -177,37 +178,31 @@ interface IStatusChart extends Pick { } const StatusChart = ({ statusCounts, title }: IStatusChart): JSX.Element => { + const groupedStatusCounts = groupStatus({ + doneCount: statusCounts.DONE ?? 0, + errorCount: statusCounts.ERROR ?? 0, + failCount: statusCounts.FAIL ?? 0, + missCount: statusCounts.MISS ?? 0, + passCount: statusCounts.PASS ?? 0, + skipCount: statusCounts.SKIP ?? 0, + }); + const chartElements = [ { label: 'bootsTab.success', - value: statusCounts['PASS'] ?? 0, + value: groupedStatusCounts.successCount, color: Colors.Green, }, { label: 'global.failed', - value: statusCounts['FAIL'] ?? 0, - color: Colors.Yellow, - }, - { - label: 'bootsTab.skip', - value: statusCounts['SKIP'] ?? 0, - color: Colors.DimGray, + value: groupedStatusCounts.failedCount, + color: Colors.Red, }, { - label: 'global.missed', - value: statusCounts['MISS'] ?? 0, + label: 'global.inconclusive', + value: groupedStatusCounts.inconclusiveCount ?? 0, color: Colors.Gray, }, - { - label: 'global.done', - value: statusCounts['DONE'] ?? 0, - color: Colors.Blue, - }, - { - label: 'bootsTab.error', - value: statusCounts['ERROR'] ?? 0, - color: Colors.Red, - }, ] satisfies StatusChartValues[]; const filteredChartElements = chartElements.filter(chartElement => {