Skip to content

Commit 260a09f

Browse files
authored
Remove the release notes card in the detail page (#13835)
1 parent a5f4ff4 commit 260a09f

File tree

2 files changed

+0
-127
lines changed

2 files changed

+0
-127
lines changed

src/amo/pages/Addon/index.js

Lines changed: 0 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -344,38 +344,6 @@ export class AddonBase extends React.Component {
344344
) : null;
345345
}
346346

347-
renderVersionReleaseNotes() {
348-
const { addon, i18n, currentVersion } = this.props;
349-
if (!addon) {
350-
return null;
351-
}
352-
353-
if (!currentVersion || !currentVersion.releaseNotes) {
354-
return null;
355-
}
356-
357-
const header = i18n.sprintf(
358-
i18n.gettext('Release notes for %(addonVersion)s'),
359-
{ addonVersion: currentVersion.version },
360-
);
361-
const releaseNotes = sanitizeUserHTML(currentVersion.releaseNotes);
362-
363-
const showMoreCardNotesName = 'AddonDescription-version-notes';
364-
365-
/* eslint-disable react/no-danger */
366-
return (
367-
<ShowMoreCard
368-
contentId={addon.id}
369-
className={showMoreCardNotesName}
370-
id={showMoreCardNotesName}
371-
header={header}
372-
>
373-
<div dangerouslySetInnerHTML={releaseNotes} />
374-
</ShowMoreCard>
375-
);
376-
/* eslint-enable react/no-danger */
377-
}
378-
379347
renderCategorySuggestions(requiredVariant) {
380348
const { addon, clientApp, variant } = this.props;
381349

@@ -521,8 +489,6 @@ export class AddonBase extends React.Component {
521489
<div>
522490
<ContributeCard addon={addon} />
523491

524-
{this.renderVersionReleaseNotes()}
525-
526492
{this.renderRecommendations()}
527493
</div>
528494
</div>

tests/unit/amo/pages/TestAddon.js

Lines changed: 0 additions & 93 deletions
Original file line numberDiff line numberDiff line change
@@ -1264,99 +1264,6 @@ describe(__filename, () => {
12641264
});
12651265
});
12661266

1267-
describe('version release notes', () => {
1268-
const renderWithVersion = (props = {}) => {
1269-
addon.current_version = { ...fakeVersion, ...props };
1270-
renderWithAddon();
1271-
};
1272-
1273-
it('is hidden when an add-on has not loaded yet', () => {
1274-
render();
1275-
1276-
expect(
1277-
screen.queryByClassName('AddonDescription-version-notes'),
1278-
).not.toBeInTheDocument();
1279-
});
1280-
1281-
it('is hidden when the add-on does not have a current version', () => {
1282-
addon.current_version = null;
1283-
renderWithAddon();
1284-
1285-
expect(
1286-
screen.queryByClassName('AddonDescription-version-notes'),
1287-
).not.toBeInTheDocument();
1288-
});
1289-
1290-
it('is hidden when the current version does not have release notes', () => {
1291-
renderWithVersion({ release_notes: null });
1292-
1293-
expect(
1294-
screen.queryByClassName('AddonDescription-version-notes'),
1295-
).not.toBeInTheDocument();
1296-
});
1297-
1298-
it('passes the expected contentId to ShowMoreCard', async () => {
1299-
expect(
1300-
await testContentId({
1301-
addonProp: 'id',
1302-
addonPropValue: addon.id + 1,
1303-
cardClassName: 'AddonDescription-version-notes',
1304-
}),
1305-
).toBeTruthy();
1306-
});
1307-
1308-
it('shows the version string', () => {
1309-
const version = 'v1.4.5';
1310-
renderWithVersion({ version });
1311-
1312-
expect(screen.getByText('Release notes for v1.4.5')).toBeInTheDocument();
1313-
});
1314-
1315-
it('shows the release notes', () => {
1316-
const releaseNotes = 'Fixed some stuff';
1317-
renderWithVersion({
1318-
release_notes: createLocalizedString(releaseNotes),
1319-
});
1320-
1321-
expect(screen.getByText(releaseNotes)).toBeInTheDocument();
1322-
});
1323-
1324-
it('allows some HTML tags', () => {
1325-
const releaseNotes = '<b>lots</b> <i>of</i> <blink>bug fixes</blink>';
1326-
renderWithVersion({
1327-
release_notes: createLocalizedString(releaseNotes),
1328-
});
1329-
1330-
const notesCard = screen.getByClassName('AddonDescription-version-notes');
1331-
1332-
expect(
1333-
screen.getByTextAcrossTags('lots of bug fixes'),
1334-
).toBeInTheDocument();
1335-
expect(within(notesCard).getByTagName('b')).toHaveTextContent('lots');
1336-
expect(within(notesCard).getByTagName('i')).toHaveTextContent('of');
1337-
});
1338-
1339-
it('allows some ul-li tags', () => {
1340-
const releaseNotes = '<b>The List</b><ul><li>one</li><li>two</li></ul>';
1341-
renderWithVersion({
1342-
release_notes: createLocalizedString(releaseNotes),
1343-
});
1344-
1345-
const notesCard = screen.getByClassName('AddonDescription-version-notes');
1346-
1347-
expect(
1348-
within(notesCard).getByTextAcrossTags('The Listonetwo'),
1349-
).toBeInTheDocument();
1350-
expect(within(notesCard).getByRole('list')).toBeInTheDocument();
1351-
expect(within(notesCard).getAllByRole('listitem')[0]).toHaveTextContent(
1352-
'one',
1353-
);
1354-
expect(within(notesCard).getAllByRole('listitem')[1]).toHaveTextContent(
1355-
'two',
1356-
);
1357-
});
1358-
});
1359-
13601267
it('renders the site identifier as a data attribute', () => {
13611268
renderWithAddon();
13621269

0 commit comments

Comments
 (0)