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

Stats: rename 'Subscribers' to 'Newsletters' #97743

Open
wants to merge 3 commits into
base: trunk
Choose a base branch
from
Open
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
4 changes: 1 addition & 3 deletions client/blocks/stats-navigation/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,9 @@ const insights = {
paywall: true,
} as NavItem;

// TODO: Consider adding subscriber counts into this nav item in the future.
// See client/blocks/subscribers-count/index.jsx.
const subscribers = {
get label() {
return translate( 'Subscribers' );
return translate( 'Newsletter' );
},
path: '/stats/subscribers',
showIntervals: false,
Expand Down
2 changes: 1 addition & 1 deletion client/my-sites/stats/pages/shared/helpers.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ function getSiteFilters( siteId: number ): SiteFilterType[] {
id: 'stats-insights',
},
{
title: i18n.translate( 'Subscribers' ),
title: i18n.translate( 'Newsletter' ),
path: '/stats/subscribers/' + siteId,
id: 'stats-subscribers',
period: 'day', // default period for Subscribers
Expand Down
11 changes: 3 additions & 8 deletions client/my-sites/stats/stats-subscribers-chart-section/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -125,15 +125,10 @@ export default function SubscribersChartSection( {
const hasAddedPaidSubscriptionProduct = products && products.length > 0;
const chartData = transformData( data?.data || [], hasAddedPaidSubscriptionProduct );

const subscribers = {
label: 'Subscribers',
path: `/stats/subscribers/`,
};

const slugPath = slug ? `/${ slug }` : '';
const pathTemplate = `${ subscribers.path }{{ interval }}${ slugPath }`;
const pathTemplate = `/stats/subscribers/{{ interval }}${ slugPath }`;
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just simplifying the code here, subscribers.label was never used.


const subscribersUrl = isOdysseyStats
const manageSubscribersUrl = isOdysseyStats
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Renamign for better clarity.

? `https://cloud.jetpack.com/subscribers/${ slug }`
: `/subscribers/${ slug }`;

Expand All @@ -144,7 +139,7 @@ export default function SubscribersChartSection( {
<h1 className="highlight-cards-heading">
{ translate( 'Subscribers' ) }{ ' ' }
<small>
<a className="highlight-cards-heading-wrapper" href={ subscribersUrl }>
<a className="highlight-cards-heading-wrapper" href={ manageSubscribersUrl }>
{ translate( 'View all subscribers' ) }
</a>
</small>
Expand Down
2 changes: 1 addition & 1 deletion packages/calypso-e2e/src/lib/pages/stats-page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { envVariables } from '../..';
import { getCalypsoURL } from '../../data-helper';
import { clickNavTab } from '../../element-helper';

export type StatsTabs = 'Traffic' | 'Insights' | 'Subscribers' | 'Store';
export type StatsTabs = 'Traffic' | 'Insights' | 'Newsletter' | 'Store';
type TrafficActivityType = 'Views' | 'Visitors' | 'Likes' | 'Comments';
type StoreActivityType = 'Gross Sales' | 'Net sales' | 'Orders' | 'Avg. Order Value';
// Discriminated Union type.
Expand Down
6 changes: 3 additions & 3 deletions test/e2e/specs/stats/stats.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,9 +90,9 @@ describe( DataHelper.createSuiteTitle( 'Stats' ), function () {
} );
} );

describe( 'Subscribers', function () {
it( 'Click on Subscribers tab', async function () {
await statsPage.clickTab( 'Subscribers' );
describe( 'Newsletter', function () {
it( 'Click on Newsletter tab', async function () {
await statsPage.clickTab( 'Newsletter' );
} );
} );

Expand Down
Loading