Skip to content

Commit c169c8a

Browse files
27 September homepage content update (#6373)
1 parent adb2ad0 commit c169c8a

File tree

3 files changed

+73
-30
lines changed

3 files changed

+73
-30
lines changed

src/amo/components/HomeHeroBanner/index.js

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -236,6 +236,47 @@ export class HomeHeroBannerBase extends React.Component<InternalProps> {
236236
),
237237
url: '/addon/copy-plaintext/',
238238
},
239+
{
240+
title: i18n.gettext('Official Media Bias Fact Check Icon'),
241+
description: i18n.gettext(
242+
'Indicates the political bias of news sites with a tidy icon',
243+
),
244+
url: '/addon/media-bias-fact-check-icon/',
245+
},
246+
{
247+
title: i18n.gettext('Vertical Tabs Reloaded'),
248+
description: i18n.gettext('Arrange tabs in a vertical fashion'),
249+
url: '/addon/vertical-tabs-reloaded/',
250+
},
251+
{
252+
title: i18n.gettext('Search Site'),
253+
description: i18n.gettext(
254+
'Search within just the domain you’re visiting',
255+
),
256+
url: '/addon/search-site-we/',
257+
},
258+
{
259+
title: i18n.gettext('Push to Kindle'),
260+
description: i18n.gettext('Send any Web page to your Kindle device'),
261+
url: '/addon/kindle-it/',
262+
},
263+
{
264+
title: i18n.gettext('New Tab Homepage'),
265+
description: i18n.gettext(
266+
'Designate a custom home page for your new tabs',
267+
),
268+
url: '/addon/new-tab-homepage/',
269+
},
270+
{
271+
title: i18n.gettext('OneNote Web Clipper'),
272+
description: i18n.gettext('Save, annotate & organize web content'),
273+
url: '/addon/onenote-clipper/',
274+
},
275+
{
276+
title: i18n.gettext('FoxyGestures'),
277+
description: i18n.gettext('Customized mouse gestures'),
278+
url: '/addon/foxy-gestures/',
279+
},
239280
];
240281
}
241282

src/amo/pages/Home/index.js

Lines changed: 10 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,8 @@ import Icon from 'ui/components/Icon';
2727
import './styles.scss';
2828

2929
export const FEATURED_COLLECTIONS = [
30+
{ slug: 'translation-tools', username: 'mozilla' },
3031
{ slug: 'privacy-matters', username: 'mozilla' },
31-
{ slug: 'fall-themes', username: 'mozilla' },
32-
{ slug: 'youtube-boosters', username: 'mozilla' },
3332
];
3433

3534
export const isFeaturedCollection = (
@@ -47,22 +46,16 @@ export const isFeaturedCollection = (
4746
export const getFeaturedCollectionsMetadata = (i18n) => {
4847
return [
4948
{
50-
footerText: i18n.gettext('See more privacy & security extensions'),
51-
header: i18n.gettext('Privacy & security'),
49+
footerText: i18n.gettext('See more translation tools'),
50+
header: i18n.gettext('Translation tools'),
5251
isTheme: false,
5352
...FEATURED_COLLECTIONS[0],
5453
},
5554
{
56-
footerText: i18n.gettext('See more fall themes'),
57-
header: i18n.gettext('Fall themes'),
58-
isTheme: true,
59-
...FEATURED_COLLECTIONS[1],
60-
},
61-
{
62-
footerText: i18n.gettext('See more YouTube extensions'),
63-
header: i18n.gettext('YouTube boosters'),
55+
footerText: i18n.gettext('See more privacy & security extensions'),
56+
header: i18n.gettext('Privacy & security'),
6457
isTheme: false,
65-
...FEATURED_COLLECTIONS[2],
58+
...FEATURED_COLLECTIONS[1],
6659
},
6760
];
6861
};
@@ -83,7 +76,7 @@ export class HomeBase extends React.Component {
8376

8477
static defaultProps = {
8578
_config: config,
86-
includeFeaturedThemes: false,
79+
includeFeaturedThemes: true,
8780
};
8881

8982
constructor(props) {
@@ -296,15 +289,6 @@ export class HomeBase extends React.Component {
296289
/>
297290
)}
298291

299-
{(loading || collections[1]) && (
300-
<FeaturedCollectionCard
301-
addons={collections[1]}
302-
className="Home-FeaturedCollection"
303-
loading={loading}
304-
{...featuredCollectionsMetadata[1]}
305-
/>
306-
)}
307-
308292
<LandingAddonsCard
309293
addonInstallSource={INSTALL_SOURCE_FEATURED}
310294
addons={trendingExtensions}
@@ -321,12 +305,12 @@ export class HomeBase extends React.Component {
321305
loading={loading}
322306
/>
323307

324-
{(loading || collections[2]) && (
308+
{(loading || collections[1]) && (
325309
<FeaturedCollectionCard
326-
addons={collections[2]}
310+
addons={collections[1]}
327311
className="Home-FeaturedCollection"
328312
loading={loading}
329-
{...featuredCollectionsMetadata[2]}
313+
{...featuredCollectionsMetadata[1]}
330314
/>
331315
)}
332316

tests/unit/amo/pages/TestHome.js

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ describe(__filename, () => {
6565
expect(root.find(HomeHeroBanner)).toHaveLength(1);
6666
});
6767

68-
it.each([0, 1, 2])(
68+
it.each([0, 1])(
6969
`renders a featured collection shelf at position %s`,
7070
(index) => {
7171
const collectionMetadata = getFeaturedCollectionsMetadata(fakeI18n())[
@@ -225,12 +225,30 @@ describe(__filename, () => {
225225
});
226226

227227
it('dispatches an action to fetch the add-ons to display', () => {
228+
const includeFeaturedThemes = false;
229+
const errorHandler = createStubErrorHandler();
230+
const { store } = dispatchClientMetadata();
231+
232+
const fakeDispatch = sinon.stub(store, 'dispatch');
233+
render({ errorHandler, includeFeaturedThemes, store });
234+
235+
sinon.assert.callCount(fakeDispatch, 2);
236+
sinon.assert.calledWith(fakeDispatch, setViewContext(VIEW_CONTEXT_HOME));
237+
sinon.assert.calledWith(
238+
fakeDispatch,
239+
fetchHomeAddons({
240+
errorHandlerId: errorHandler.id,
241+
collectionsToFetch: FEATURED_COLLECTIONS,
242+
includeFeaturedThemes,
243+
}),
244+
);
245+
});
246+
247+
it('includes featured themes by default', () => {
228248
const errorHandler = createStubErrorHandler();
229249
const { store } = dispatchClientMetadata();
230250

231251
const fakeDispatch = sinon.stub(store, 'dispatch');
232-
// Note that we do not pass a value for includeFeaturedThemes so we can
233-
// assert that the default value will be `false`.
234252
render({ errorHandler, store });
235253

236254
sinon.assert.callCount(fakeDispatch, 2);
@@ -240,7 +258,7 @@ describe(__filename, () => {
240258
fetchHomeAddons({
241259
errorHandlerId: errorHandler.id,
242260
collectionsToFetch: FEATURED_COLLECTIONS,
243-
includeFeaturedThemes: false,
261+
includeFeaturedThemes: true,
244262
}),
245263
);
246264
});

0 commit comments

Comments
 (0)