Skip to content

Commit 647fe61

Browse files
authored
Merge pull request #19520 from mozilla/FXA-12475
feat(pocket): Remove Pocket front-end code
2 parents 4d7f4f9 + c84ebb2 commit 647fe61

38 files changed

Lines changed: 26 additions & 502 deletions

File tree

libs/shared/assets/src/images/pocket-text-logo.svg

Lines changed: 0 additions & 1 deletion
This file was deleted.

libs/shared/l10n/src/lib/branding.ftl

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@
4848
-product-mozilla-monitor-short = Monitor
4949
-product-firefox-relay = Firefox Relay
5050
-product-firefox-relay-short = Relay
51-
-product-pocket = Pocket
5251
5352
-brand-apple = Apple
5453
-brand-apple-pay = Apple Pay

packages/fxa-settings/src/components/CardHeader/index.stories.tsx

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,8 @@ export const WithSeparateSubheadingDefaultServiceName = storyWithProps(
7070
headingText: MOCK_HEADING,
7171
headingTextFtlId: MOCK_DEFAULT_HEADING_FTL_ID,
7272
subheadingWithDefaultServiceFtlId: MOCK_DEFAULT_HEADING_FTL_ID,
73-
subheadingWithLogoFtlId: MOCK_DEFAULT_HEADING_FTL_ID,
73+
subheadingWithCustomServiceFtlId: MOCK_CUSTOM_HEADING_FTL_ID,
74+
serviceName: MozServices.Default,
7475
},
7576
'Separate l10n for subheading, with default service'
7677
);
@@ -80,19 +81,8 @@ export const WithSeparateSubheadingCustomServiceName = storyWithProps(
8081
serviceName: MOCK_SERVICE_NAME,
8182
headingText: MOCK_HEADING,
8283
headingTextFtlId: MOCK_DEFAULT_HEADING_FTL_ID,
84+
subheadingWithDefaultServiceFtlId: MOCK_DEFAULT_HEADING_FTL_ID,
8385
subheadingWithCustomServiceFtlId: MOCK_CUSTOM_HEADING_FTL_ID,
84-
subheadingWithLogoFtlId: MOCK_CUSTOM_HEADING_FTL_ID,
8586
},
8687
'Separate l10n for subheading, with custom service name'
8788
);
88-
89-
export const WithSeparateSubheadingLogo = storyWithProps(
90-
{
91-
serviceName: MozServices.Pocket,
92-
headingText: MOCK_HEADING,
93-
headingTextFtlId: MOCK_DEFAULT_HEADING_FTL_ID,
94-
subheadingWithCustomServiceFtlId: MOCK_CUSTOM_HEADING_FTL_ID,
95-
subheadingWithLogoFtlId: MOCK_DEFAULT_HEADING_FTL_ID,
96-
},
97-
'Separate l10n for subheading, with logo'
98-
);

packages/fxa-settings/src/components/CardHeader/index.tsx

Lines changed: 8 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import React from 'react';
66
import { ReactElement } from 'react';
77
import { FtlMsg } from 'fxa-react/lib/utils';
88
import { MozServices } from '../../lib/types';
9-
import PocketTextLogo from '@fxa/shared/assets/images/pocket-text-logo.svg';
109

1110
// NOTE: this component is heavily tested in components that use it and has complete line
1211
// coverage. However, we may file an issue out of FXA-6589 to add more explicit coverage.
@@ -40,7 +39,6 @@ interface CardHeaderSeparateSubheadingProps extends CardHeaderRequiredProps {
4039
headingTextFtlId: string;
4140
subheadingWithDefaultServiceFtlId: string;
4241
subheadingWithCustomServiceFtlId: string;
43-
subheadingWithLogoFtlId?: string;
4442
serviceName: MozServices;
4543
}
4644

@@ -109,9 +107,7 @@ function isDefaultService(
109107
);
110108
}
111109

112-
function isCmsHeader(
113-
props: CardHeaderProps
114-
): props is CardHeaderCmsProps {
110+
function isCmsHeader(props: CardHeaderProps): props is CardHeaderCmsProps {
115111
return (
116112
(props as CardHeaderCmsProps).cmsLogoUrl !== undefined ||
117113
(props as CardHeaderCmsProps).cmsLogoAltText !== undefined ||
@@ -131,33 +127,6 @@ function isBasicWithCustomSubheading(
131127
);
132128
}
133129

134-
const serviceLogos: {
135-
[key in MozServices]?: ReactElement;
136-
} = {
137-
// This is not inlined because text inside of an SVG can have rendering problems
138-
[MozServices.Pocket]: (
139-
<img
140-
src={PocketTextLogo}
141-
alt={MozServices.Pocket}
142-
className="inline w-22 ps-0.5"
143-
/>
144-
),
145-
};
146-
147-
// TODO in FXA-8290: do we want to check against these unique client IDs instead
148-
// of serviceName? We have a service names enum, but in theory an RP could change their
149-
// service name and we'd have to update the enum, vs these that don't change.
150-
// export const POCKET_CLIENTIDS = [
151-
// '7377719276ad44ee', // pocket-mobile
152-
// '749818d3f2e7857f', // pocket-web
153-
// ];
154-
// This also applies to Monitor
155-
// export const MONITOR_CLIENTIDS = [
156-
// '802d56ef2a9af9fa', // Mozilla Monitor
157-
// '946bfd23df91404c', // Mozilla Monitor stage
158-
// 'edd29a80019d61a1', // Mozilla Monitor local dev
159-
// };
160-
161130
const CardHeader = (props: CardHeaderProps) => {
162131
const { headingText } = props;
163132

@@ -173,9 +142,7 @@ const CardHeader = (props: CardHeaderProps) => {
173142
/>
174143
)}
175144
<h1 className="card-header">{cmsHeadline}</h1>
176-
<p className="card-subheader">
177-
{cmsDescription}
178-
</p>
145+
<p className="card-subheader">{cmsDescription}</p>
179146
</>
180147
);
181148
}
@@ -221,25 +188,13 @@ const CardHeader = (props: CardHeaderProps) => {
221188
if (isSeparateSubheading(props)) {
222189
const { serviceName = MozServices.Default } = props;
223190
const isDefaultService = isDefaultServiceName(serviceName);
224-
const logo = serviceLogos[serviceName];
225-
const logoElem = <span>{logo}</span>;
226191

227192
const subheadingFtlMsgProps = {
228-
// If a logo corresponds to the service name and a logo FTL ID is provided, use that FTL ID.
229-
// Otherwise, if the service is the default service, use the default service FTL ID.
230-
// If non-default, use the custom service FTL ID.
231-
id:
232-
logo && props.subheadingWithLogoFtlId
233-
? props.subheadingWithLogoFtlId
234-
: isDefaultService
235-
? props.subheadingWithDefaultServiceFtlId
236-
: props.subheadingWithCustomServiceFtlId,
237-
// include `vars={{ serviceName }}` if non-default and no logo
238-
...(!isDefaultService && !logo && { vars: { serviceName } }),
239-
// include `elems={{ span: logo }}` if serviceName is given a logo in serviceLogos
240-
...(logo && {
241-
elems: { span: logo },
242-
}),
193+
id: isDefaultService
194+
? props.subheadingWithDefaultServiceFtlId
195+
: props.subheadingWithCustomServiceFtlId,
196+
// include `vars={{ serviceName }}` if non-default
197+
...(!isDefaultService && { vars: { serviceName } }),
243198
};
244199

245200
return (
@@ -248,9 +203,7 @@ const CardHeader = (props: CardHeaderProps) => {
248203
<FtlMsg id={props.headingTextFtlId}>{headingText}</FtlMsg>
249204
</h1>
250205
<FtlMsg {...subheadingFtlMsgProps}>
251-
<p className="card-subheader">
252-
Continue to {logo ? logoElem : serviceName}
253-
</p>
206+
<p className="card-subheader">Continue to {serviceName}</p>
254207
</FtlMsg>
255208
</>
256209
);

packages/fxa-settings/src/components/Settings/BentoMenu/en.ftl

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ bento-menu-tagline = More products from { -brand-mozilla } that protect your pri
55
66
bento-menu-vpn-2 = { -product-mozilla-vpn }
77
bento-menu-monitor-3 = { -product-mozilla-monitor }
8-
bento-menu-pocket-2 = { -product-pocket }
98
bento-menu-firefox-relay-2 = { -product-firefox-relay }
109
bento-menu-firefox-desktop = { -brand-firefox } Browser for Desktop
1110
bento-menu-firefox-mobile = { -brand-firefox } Browser for Mobile

packages/fxa-settings/src/components/Settings/BentoMenu/index.test.tsx

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ jest.mock('../../../lib/glean', () => ({
1919
bentoFirefoxDesktop: jest.fn(),
2020
bentoFirefoxMobile: jest.fn(),
2121
bentoMonitor: jest.fn(),
22-
bentoPocket: jest.fn(),
2322
bentoRelay: jest.fn(),
2423
bentoVpn: jest.fn(),
2524
},
@@ -83,10 +82,6 @@ describe('BentoMenu', () => {
8382
'href',
8483
'https://monitor.mozilla.org/?utm_source=moz-account&utm_medium=mozilla-websites&utm_term=bento&utm_content=monitor&utm_campaign=permanent'
8584
);
86-
expect(screen.getByRole('link', { name: /Pocket/ })).toHaveAttribute(
87-
'href',
88-
'https://app.adjust.com/hr2n0yz?redirect_macos=https%3A%2F%2Fgetpocket.com%2Fpocket-and-firefox&redirect_windows=https%3A%2F%2Fgetpocket.com%2Fpocket-and-firefox&engagement_type=fallback_click&fallback=https%3A%2F%2Fgetpocket.com%2Ffirefox_learnmore%3Fsrc%3Dff_bento&fallback_lp=https%3A%2F%2Fapps.apple.com%2Fapp%2Fpocket-save-read-grow%2Fid309601447'
89-
);
9085
expect(screen.getByRole('link', { name: /Firefox Relay/ })).toHaveAttribute(
9186
'href',
9287
'https://relay.firefox.com/?utm_source=moz-account&utm_medium=mozilla-websites&utm_term=bento&utm_content=relay&utm_campaign=permanent'
@@ -187,19 +182,6 @@ describe('BentoMenu', () => {
187182
});
188183
});
189184

190-
it('logs metrics event for Pocket link click', async () => {
191-
renderWithLocalizationProvider(<BentoMenu />);
192-
193-
userEvent.click(screen.getByRole('button', { name: /Mozilla products/ }));
194-
await waitFor(() => {
195-
expect(screen.getByRole('link', { name: /Pocket/ })).toBeVisible();
196-
});
197-
userEvent.click(screen.getByRole('link', { name: /Pocket/ }));
198-
await waitFor(() => {
199-
expect(GleanMetrics.accountPref.bentoPocket).toHaveBeenCalledTimes(1);
200-
});
201-
});
202-
203185
it('logs metrics event for Firefox Relay link click', async () => {
204186
renderWithLocalizationProvider(<BentoMenu />);
205187

packages/fxa-settings/src/components/Settings/BentoMenu/index.tsx

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ import LinkExternal from 'fxa-react/components/LinkExternal';
99
import { useEscKeydownEffect } from '../../../lib/hooks';
1010

1111
import monitorIcon from './monitor.svg';
12-
import pocketIcon from '@fxa/shared/assets/images/pocket.svg';
1312
import desktopIcon from './desktop.svg';
1413
import mobileIcon from './mobile.svg';
1514
import relayIcon from './relay.svg';
@@ -220,19 +219,6 @@ export const BentoMenu = () => {
220219
<FtlMsg id="bento-menu-vpn-2">Mozilla VPN</FtlMsg>
221220
</LinkExternal>
222221
</li>
223-
<li>
224-
<LinkExternal
225-
data-testid="pocket-link"
226-
href="https://app.adjust.com/hr2n0yz?redirect_macos=https%3A%2F%2Fgetpocket.com%2Fpocket-and-firefox&redirect_windows=https%3A%2F%2Fgetpocket.com%2Fpocket-and-firefox&engagement_type=fallback_click&fallback=https%3A%2F%2Fgetpocket.com%2Ffirefox_learnmore%3Fsrc%3Dff_bento&fallback_lp=https%3A%2F%2Fapps.apple.com%2Fapp%2Fpocket-save-read-grow%2Fid309601447"
227-
className="block p-2 ps-6 hover:bg-grey-100 focus-visible:rounded-sm focus-visible-default"
228-
onClick={() => GleanMetrics.accountPref.bentoPocket()}
229-
>
230-
<div className={iconClassNames}>
231-
<img src={pocketIcon} alt="" />
232-
</div>
233-
<FtlMsg id="bento-menu-pocket-2">Pocket</FtlMsg>
234-
</LinkExternal>
235-
</li>
236222
</ul>
237223
</div>
238224
<LinkExternal

packages/fxa-settings/src/components/Settings/ConnectedServices/index.test.tsx

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -132,13 +132,6 @@ describe('Connected Services', () => {
132132
expect(groupedByName['Mozilla Monitor'].length).toEqual(2);
133133
});
134134

135-
it('should show the pocket icon and link', async () => {
136-
await getIconAndServiceLink('Pocket', 'pocket-icon').then((result) => {
137-
expect(result.icon).toBeTruthy();
138-
expect(result.link).toHaveAttribute('href', 'https://getpocket.com/');
139-
});
140-
});
141-
142135
it('should show the monitor icon and link', async () => {
143136
await getIconAndServiceLink('Mozilla Monitor', 'monitor-icon').then(
144137
(result) => {

packages/fxa-settings/src/components/Settings/PageDeleteAccount/en.ftl

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,15 @@ delete-account-product-mozilla-account = { -product-mozilla-account }
1212
delete-account-product-mozilla-vpn = { -product-mozilla-vpn }
1313
delete-account-product-mdn-plus = { -product-mdn-plus }
1414
delete-account-product-mozilla-hubs = { -product-mozilla-hubs }
15-
delete-account-product-pocket = { -product-pocket }
1615
delete-account-product-mozilla-monitor = { -product-mozilla-monitor }
1716
delete-account-product-firefox-relay = { -product-firefox-relay }
1817
delete-account-product-firefox-sync = Syncing { -brand-firefox } data
1918
delete-account-product-firefox-addons = { -brand-firefox } Add-ons
2019
2120
delete-account-acknowledge = Please acknowledge that by deleting your account:
2221
23-
delete-account-chk-box-1-v3 =
24-
.label = Any paid subscriptions you have will be canceled (Except { -product-pocket })
22+
delete-account-chk-box-1-v4 =
23+
.label = Any paid subscriptions you have will be canceled
2524
delete-account-chk-box-2 =
2625
.label = You may lose saved information and features within { -brand-mozilla } products
2726
delete-account-chk-box-3 =
@@ -34,8 +33,6 @@ delete-account-continue-button = Continue
3433
3534
delete-account-password-input =
3635
.label = Enter password
37-
pocket-delete-notice = If you subscribe to Pocket Premium, please make sure that you <a>cancel your subscription</a> before deleting your account.
38-
pocket-delete-notice-marketing = To stop receiving marketing emails from Mozilla Corporation and Mozilla Foundation, you must <a>request deletion of your marketing data.</a>
3936
4037
delete-account-cancel-button = Cancel
4138
delete-account-delete-button-2 = Delete

packages/fxa-settings/src/components/Settings/PageDeleteAccount/index.test.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,6 @@ describe('PageDeleteAccount', () => {
100100
"Mozilla Monitor",
101101
"MDN Plus",
102102
"Mozilla Hubs",
103-
"Pocket",
104103
]
105104
`);
106105
});

0 commit comments

Comments
 (0)