Skip to content

Commit

Permalink
fix(issues): Hide empty project series in team stats (#81547)
Browse files Browse the repository at this point in the history
  • Loading branch information
scttcper authored Dec 4, 2024
1 parent 2158e7c commit e085359
Showing 1 changed file with 15 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -135,16 +135,21 @@ function TeamIssuesBreakdown({
.map(([projectId, {total}]) => ({projectId, total}))
.sort((a, b) => b.total - a.total);

const allSeries = Object.keys(allReviewedByDay).map(
(projectId, idx): BarChartSeries => ({
seriesName: ProjectsStore.getById(projectId)?.slug ?? projectId,
data: sortSeriesByDay(convertDayValueObjectToSeries(allReviewedByDay[projectId])),
animationDuration: 500,
animationDelay: idx * 500,
silent: true,
barCategoryGap: '5%',
})
);
// There are projects with more than 0 results
const hasResults = sortedProjectIds.some(({total}) => total !== 0);
const allSeries = Object.keys(allReviewedByDay)
// Hide projects with no results when there are other projects with results
.filter(projectId => (hasResults ? projectTotals[projectId].total !== 0 : true))
.map(
(projectId, idx): BarChartSeries => ({
seriesName: ProjectsStore.getById(projectId)?.slug ?? projectId,
data: sortSeriesByDay(convertDayValueObjectToSeries(allReviewedByDay[projectId])),
animationDuration: 500,
animationDelay: idx * 500,
silent: true,
barCategoryGap: '5%',
})
);

if (isError) {
return <LoadingError onRetry={refetch} />;
Expand Down

0 comments on commit e085359

Please sign in to comment.