Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Email stats: use "opens" label instead of "views" for open stats #97741

Merged
merged 1 commit into from
Dec 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions client/my-sites/stats/geochart/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,12 @@ class StatsGeochart extends Component {
postId: PropTypes.number,
skipQuery: PropTypes.bool,
isLoading: PropTypes.bool,
numberLabel: PropTypes.string,
};

static defaultProps = {
kind: 'site',
numberLabel: '',
};

state = {
Expand Down Expand Up @@ -101,7 +103,7 @@ class StatsGeochart extends Component {
};

drawData = () => {
const { currentUserCountryCode, data, translate } = this.props;
const { currentUserCountryCode, data, translate, numberLabel } = this.props;
if ( ! data || ! data.length ) {
return;
}
Expand All @@ -118,7 +120,7 @@ class StatsGeochart extends Component {

const chartData = new window.google.visualization.DataTable();
chartData.addColumn( 'string', translate( 'Country' ).toString() );
chartData.addColumn( 'number', translate( 'Views' ).toString() );
chartData.addColumn( 'number', numberLabel || translate( 'Views' ).toString() );
chartData.addRows( mapData );

// Note that using raw hex values here is an exception due to
Expand Down
3 changes: 2 additions & 1 deletion client/my-sites/stats/stats-email-module/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class StatsEmailModule extends Component {
const moduleStrings = statsStrings()[ path ];
// TODO: Support error state in redux store
const hasError = false;
const metricLabel = statType === 'clicks' ? translate( 'Clicks' ) : null;
const metricLabel = statType === 'clicks' ? translate( 'Clicks' ) : translate( 'Opens' );

return (
<>
Expand All @@ -59,6 +59,7 @@ class StatsEmailModule extends Component {
postId={ postId }
query={ query }
isLoading={ isLoading }
numberLabel={ metricLabel }
/>
)
}
Expand Down
Loading