Skip to content

Commit 08eb2ef

Browse files
authored
Remove fxa to mza notifications (#12784)
* remove yellow banner from user profile edit page * remove fxa to mza datetime req
1 parent bdc17e7 commit 08eb2ef

File tree

4 files changed

+6
-153
lines changed

4 files changed

+6
-153
lines changed

src/amo/pages/UserProfileEdit/index.js

Lines changed: 6 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@ import type {
5353
ReactRouterMatchType,
5454
} from 'amo/types/router';
5555
import { setViewContext } from 'amo/actions/viewContext';
56-
import { isMzaBranding } from 'amo/utils/fxa';
5756

5857
import './styles.scss';
5958

@@ -542,35 +541,9 @@ export class UserProfileEditBase extends React.Component<InternalProps, State> {
542541
const userProfileURL = `/user/${userId}/`;
543542
const overlayClassName = 'UserProfileEdit-deletion-modal';
544543

545-
const title = isMzaBranding()
546-
? i18n.gettext(
547-
'Firefox Accounts was renamed to Mozilla accounts on Nov 1',
548-
)
549-
: i18n.gettext(
550-
'Firefox Accounts will be renamed to Mozilla accounts on Nov 1',
551-
);
552-
553544
return (
554545
<Page>
555-
{alternateOutput || [
556-
<div
557-
className="UserProfileEdit-notice-wrapper"
558-
key="UserProfileEdit-notice-wrapper"
559-
>
560-
<Notice
561-
actionHref="https://support.mozilla.org/kb/firefox-accounts-renamed-mozilla-accounts"
562-
actionTarget="_blank"
563-
actionText={i18n.gettext('Learn more')}
564-
className="UserProfileEdit-fxa-notice"
565-
type="warning"
566-
>
567-
<strong>{title}</strong>
568-
<br />
569-
{i18n.gettext(`You will still sign in with the same username and
570-
password, and there are no other changes to the products that
571-
you use.`)}
572-
</Notice>
573-
</div>,
546+
{alternateOutput || (
574547
<div className="UserProfileEdit" key="UserProfileEdit">
575548
{user && (
576549
<Helmet>
@@ -639,11 +612,8 @@ export class UserProfileEditBase extends React.Component<InternalProps, State> {
639612
// eslint-disable-next-line react/no-danger
640613
dangerouslySetInnerHTML={sanitizeHTML(
641614
i18n.sprintf(
642-
isMzaBranding()
643-
? i18n.gettext(`You can change your email address on
644-
Mozilla accounts. %(startLink)sNeed help?%(endLink)s`)
645-
: i18n.gettext(`You can change your email address on
646-
Firefox Accounts. %(startLink)sNeed help?%(endLink)s`),
615+
i18n.gettext(`You can change your email address on
616+
Mozilla accounts. %(startLink)sNeed help?%(endLink)s`),
647617
{
648618
startLink:
649619
'<a href="https://support.mozilla.org/kb/change-primary-email-address-firefox-accounts">',
@@ -661,9 +631,7 @@ export class UserProfileEditBase extends React.Component<InternalProps, State> {
661631
href={user.fxa_edit_email_url}
662632
className="UserProfileEdit-manage-account-link"
663633
>
664-
{isMzaBranding()
665-
? i18n.gettext('Manage Mozilla accounts…')
666-
: i18n.gettext('Manage Firefox Accounts…')}
634+
{i18n.gettext('Manage Mozilla accounts…')}
667635
</a>
668636
)}
669637
</div>
@@ -933,8 +901,8 @@ export class UserProfileEditBase extends React.Component<InternalProps, State> {
933901
</div>
934902
</OverlayCard>
935903
)}
936-
</div>,
937-
]}
904+
</div>
905+
)}
938906
</Page>
939907
);
940908
}

src/amo/pages/UserProfileEdit/styles.scss

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,6 @@
22

33
$font-size-aside: $font-size-xs;
44

5-
.UserProfileEdit-notice-wrapper {
6-
@include page-padding;
7-
8-
@include respond-to(large) {
9-
margin-bottom: -$padding-page;
10-
}
11-
}
12-
135
.UserProfileEdit {
146
@include page-padding;
157

src/amo/utils/fxa.js

Lines changed: 0 additions & 6 deletions
This file was deleted.

tests/unit/amo/pages/TestUserProfileEdit.js

Lines changed: 0 additions & 101 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import { createMemoryHistory } from 'history';
33
import userEvent from '@testing-library/user-event';
44
import { createEvent, fireEvent, waitFor } from '@testing-library/react';
55

6-
import * as MzAUtils from 'amo/utils/fxa';
76
import { setViewContext } from 'amo/actions/viewContext';
87
import { createApiError } from 'amo/api/index';
98
import { extractId } from 'amo/pages/UserProfileEdit';
@@ -54,7 +53,6 @@ describe(__filename, () => {
5453
const defaultUserId = fakeAuthors[0].id;
5554
let history;
5655
let store;
57-
let isMzaBrandingMock;
5856

5957
const savedLocation = window.location;
6058

@@ -65,14 +63,10 @@ describe(__filename, () => {
6563
assign: jest.fn(),
6664
});
6765
window.scroll = jest.fn();
68-
isMzaBrandingMock = jest
69-
.spyOn(MzAUtils, 'isMzaBranding')
70-
.mockReturnValue(true);
7166
});
7267

7368
afterEach(() => {
7469
window.location = savedLocation;
75-
isMzaBrandingMock.mockRestore();
7670
});
7771

7872
function defaultUserProps(props = {}) {
@@ -1413,99 +1407,4 @@ describe(__filename, () => {
14131407
).not.toHaveClass('UserProfileEditPicture-file--has-focus');
14141408
});
14151409
});
1416-
1417-
describe('Tests for accounts branding', () => {
1418-
it('renders the Mozilla accounts Branding', () => {
1419-
isMzaBrandingMock.mockReturnValue(true);
1420-
renderForCurrentUser();
1421-
1422-
expect(
1423-
screen.getByRole('link', {
1424-
name: 'Manage Mozilla accounts…',
1425-
}),
1426-
).toBeInTheDocument();
1427-
expect(
1428-
screen.getByTextAcrossTags(
1429-
'You can change your email address on Mozilla accounts. Need help?',
1430-
),
1431-
).toBeInTheDocument();
1432-
1433-
const bannerElement = screen.getByClassName('UserProfileEdit-fxa-notice');
1434-
expect(bannerElement).toBeInTheDocument();
1435-
expect(bannerElement).toHaveTextContent(
1436-
'Firefox Accounts was renamed to Mozilla accounts on Nov 1',
1437-
);
1438-
});
1439-
1440-
it('renders the Firefox Accounts Branding', () => {
1441-
isMzaBrandingMock.mockReturnValue(false);
1442-
renderForCurrentUser();
1443-
1444-
expect(
1445-
screen.getByRole('link', {
1446-
name: 'Manage Firefox Accounts…',
1447-
}),
1448-
).toBeInTheDocument();
1449-
expect(
1450-
screen.getByTextAcrossTags(
1451-
'You can change your email address on Firefox Accounts. Need help?',
1452-
),
1453-
).toBeInTheDocument();
1454-
1455-
const bannerElement = screen.getByClassName('UserProfileEdit-fxa-notice');
1456-
expect(bannerElement).toBeInTheDocument();
1457-
expect(bannerElement).toHaveTextContent(
1458-
'Firefox Accounts will be renamed to Mozilla accounts on Nov 1',
1459-
);
1460-
});
1461-
});
1462-
1463-
describe('isMzaBranding datetime switch', () => {
1464-
let dateMock;
1465-
1466-
beforeEach(() => {
1467-
isMzaBrandingMock.mockRestore();
1468-
});
1469-
1470-
afterEach(() => {
1471-
dateMock?.mockRestore();
1472-
});
1473-
1474-
it('returns false if the date is earlier than MZA_LAUNCH_DATETIME', () => {
1475-
const before = new Date();
1476-
before.setTime(MzAUtils.MZA_LAUNCH_DATETIME.getTime() - 1000);
1477-
dateMock = jest.spyOn(global, 'Date').mockImplementation(() => before);
1478-
expect(MzAUtils.isMzaBranding()).toBe(false);
1479-
});
1480-
1481-
it('returns true if the date is earlier than MZA_LAUNCH_DATETIME', () => {
1482-
const after = new Date();
1483-
after.setTime(MzAUtils.MZA_LAUNCH_DATETIME.getTime() + 1000);
1484-
dateMock = jest.spyOn(global, 'Date').mockImplementation(() => after);
1485-
expect(MzAUtils.isMzaBranding()).toBe(true);
1486-
});
1487-
});
1488-
1489-
describe('fxa banner tests', () => {
1490-
it('renders the banner on the page', () => {
1491-
renderForCurrentUser();
1492-
1493-
const bannerElement = screen.getByClassName('UserProfileEdit-fxa-notice');
1494-
expect(bannerElement).toBeInTheDocument();
1495-
1496-
expect(bannerElement).toHaveTextContent(
1497-
'Firefox Accounts was renamed to Mozilla accounts on Nov 1',
1498-
);
1499-
expect(bannerElement).toHaveTextContent(
1500-
'You will still sign in with the same username and password, and there are no other changes to the products that you use.',
1501-
);
1502-
1503-
const infoLink = screen.getByClassName('Notice-button');
1504-
expect(infoLink).toBeInTheDocument();
1505-
expect(infoLink).toHaveAttribute(
1506-
'href',
1507-
'https://support.mozilla.org/kb/firefox-accounts-renamed-mozilla-accounts',
1508-
);
1509-
});
1510-
});
15111410
});

0 commit comments

Comments
 (0)