1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-01-20 00:08:02 +01:00

fix: Health tooltip when all projects should show % (#6809)

What it says on the tin

Closes #
[1-2274](https://linear.app/unleash/issue/1-2274/health-tooltip-when-all-projects-should-show-percent-values)
<img width="945" alt="Screenshot 2024-04-09 at 16 09 34"
src="https://github.com/Unleash/unleash/assets/104830839/5c8fc8d3-bee6-4bf2-976d-de6f3e3013ca">

Signed-off-by: andreas-unleash <andreas@getunleash.ai>
This commit is contained in:
andreas-unleash 2024-04-09 16:20:32 +03:00 committed by GitHub
parent 2b3516dff1
commit 48b8df8f4e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -62,16 +62,19 @@ export const ProjectHealthChart: VFC<IProjectHealthChartProps> = ({
);
})
.sort((a, b) => (a.week > b.week ? 1 : -1));
return {
datasets: [
{
label: 'Health',
data: weeks.map((item) => ({
health: item.total
? ((item.total - item.stale) / item.total) * 100
? (
((item.total - item.stale) / item.total) *
100
).toFixed(2)
: undefined,
date: item.date,
total: item.total,
})),
borderColor: theme.palette.primary.light,
backgroundColor: fillGradientPrimary,
@ -93,7 +96,7 @@ export const ProjectHealthChart: VFC<IProjectHealthChartProps> = ({
<LineChart
key={isAggregate ? 'aggregate' : 'project'}
data={data}
TooltipComponent={isAggregate ? undefined : HealthTooltip}
TooltipComponent={HealthTooltip}
overrideOptions={
notEnoughData
? {}