Skip to content

Commit

Permalink
Merge pull request #8983 from google/bug/8763-audience-tile-data-vali…
Browse files Browse the repository at this point in the history
…dity

Correct metrics and metric formatting on Audience Tiles.
  • Loading branch information
eugene-manuilov committed Jul 8, 2024
2 parents 9489c18 + d1bb3f7 commit c32a34d
Show file tree
Hide file tree
Showing 33 changed files with 9 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,8 @@ export default function AudienceTileCitiesMetric( {
</div>
<div className="googlesitekit-audience-segmentation-tile-metric__cities-metric-value">
{ numFmt(
topCities?.metricValues[ index ]?.value,
topCities?.metricValues[ index ]
?.value / topCities?.total,
{
style: 'percent',
maximumFractionDigits: 1,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ export default function AudienceTileMetric( {
title,
metricValue,
Badge,
metricValueFormat,
} ) {
return (
<div className="googlesitekit-audience-segmentation-tile-metric">
Expand All @@ -39,7 +40,7 @@ export default function AudienceTileMetric( {
</div>
<div className="googlesitekit-audience-segmentation-tile-metric__container">
<div className="googlesitekit-audience-segmentation-tile-metric__value">
{ numFmt( metricValue ) }
{ numFmt( metricValue, metricValueFormat ) }
</div>
<div className="googlesitekit-audience-segmentation-tile-metric__title">
{ title }
Expand All @@ -57,4 +58,5 @@ AudienceTileMetric.propTypes = {
title: PropTypes.string.isRequired,
metricValue: PropTypes.number.isRequired,
Badge: PropTypes.elementType.isRequired,
metricValueFormat: PropTypes.object,
};
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,10 @@ export default function AudienceTile( {
currentValue={ pagesPerVisit.currentValue }
/>
) }
metricValueFormat={ {
style: 'decimal',
maximumFractionDigits: 2,
} }
/>

<AudienceTileMetric
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit c32a34d

Please sign in to comment.