[Glitch] Change `percent` to `rate` in retention metrics API

Port a63495230a to glitch-soc

Signed-off-by: Claire <claire.github-309c@sitedethib.com>
rebase/4.0.0rc2
Claire 2022-01-23 16:01:25 +01:00
parent 4dd4fc2e5e
commit 9483d0c6b2
1 changed files with 3 additions and 3 deletions

View File

@ -88,7 +88,7 @@ export default class Retention extends React.PureComponent {
</td> </td>
{data[0].data.slice(1).map((retention, i) => { {data[0].data.slice(1).map((retention, i) => {
const average = data.reduce((sum, cohort, k) => cohort.data[i + 1] ? sum + (cohort.data[i + 1].percent - sum)/(k + 1) : sum, 0); const average = data.reduce((sum, cohort, k) => cohort.data[i + 1] ? sum + (cohort.data[i + 1].rate - sum)/(k + 1) : sum, 0);
return ( return (
<td key={retention.date}> <td key={retention.date}>
@ -118,8 +118,8 @@ export default class Retention extends React.PureComponent {
{cohort.data.slice(1).map(retention => ( {cohort.data.slice(1).map(retention => (
<td key={retention.date}> <td key={retention.date}>
<div className={classNames('retention__table__box', `retention__table__box--${roundTo10(retention.percent * 100)}`)}> <div className={classNames('retention__table__box', `retention__table__box--${roundTo10(retention.rate * 100)}`)}>
<FormattedNumber value={retention.percent} style='percent' /> <FormattedNumber value={retention.rate} style='percent' />
</div> </div>
</td> </td>
))} ))}