From e361bb9514cad7c187bbe0fcc77b233b18c34d3c Mon Sep 17 00:00:00 2001 From: RumovZ Date: Mon, 17 Apr 2023 08:16:10 +0200 Subject: [PATCH] Add emojis for graphs in hourly breakdown tooltip (#2464) --- ftl/core/statistics.ftl | 4 ++++ ts/graphs/hours.ts | 8 ++++---- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/ftl/core/statistics.ftl b/ftl/core/statistics.ftl index ad445f437..1f4623066 100644 --- a/ftl/core/statistics.ftl +++ b/ftl/core/statistics.ftl @@ -149,6 +149,10 @@ statistics-intervals-day-single = # hour range, eg "From 14:00-15:00" statistics-hours-range = From { $hourStart }:00~{ $hourEnd }:00 statistics-hours-correct = { $correct }/{ $total } correct ({ $percent }%) +# the emoji depicts the graph displaying this number +statistics-hours-reviews = 📊 { $reviews } reviews +# the emoji depicts the graph displaying this number +statistics-hours-correct-reviews = 📈 { $percent }% correct ({ $reviews }) statistics-hours-title = Hourly Breakdown statistics-hours-subtitle = Review success rate for each hour of the day. # shown when graph is empty diff --git a/ts/graphs/hours.ts b/ts/graphs/hours.ts index 972b18008..2da461a7c 100644 --- a/ts/graphs/hours.ts +++ b/ts/graphs/hours.ts @@ -170,12 +170,12 @@ export function renderHours( hourStart: d.hour, hourEnd: d.hour + 1, }); - const correct = tr.statisticsHoursCorrect({ - correct: d.correctCount, - total: d.totalCount, + const reviews = tr.statisticsHoursReviews({ reviews: d.totalCount }); + const correct = tr.statisticsHoursCorrectReviews({ percent: d.totalCount ? (d.correctCount / d.totalCount) * 100 : 0, + reviews: d.correctCount, }); - return `${hour}
${correct}`; + return `${hour}
${reviews}
${correct}`; } // hover/tooltip