From ac49075905314e9931ea8de7fbe16632f2ac9aea Mon Sep 17 00:00:00 2001 From: k88hudson Date: Tue, 6 Nov 2018 15:43:41 +0000 Subject: [PATCH] Bug 1504864 - Add fix for pocket double-adding spocs, remove Amazon CFR metadata to Activity Stream r=andreio Differential Revision: https://phabricator.services.mozilla.com/D10976 --HG-- extra : moz-landing-system : lando --- browser/components/newtab/common/Reducers.jsm | 5 +- .../ASRouterAdmin/ASRouterAdmin.jsx | 3 +- .../data/content/activity-stream.bundle.js | 8 +- .../content/activity-stream.bundle.js.map | 2 +- .../content/assets/cfr_amazon_assistant.png | Bin 1591 -> 0 bytes .../docs/v2-system-addon/data_events.md | 8 +- browser/components/newtab/lib/ASRouter.jsm | 2 +- .../newtab/lib/CFRMessageProvider.jsm | 110 ------------------ browser/components/newtab/package-lock.json | 9 +- browser/components/newtab/package.json | 4 + .../unit/asrouter/CFRMessageProvider.test.js | 17 +-- .../newtab/test/unit/common/Reducers.test.js | 7 +- browser/components/newtab/yamscripts.yml | 6 + 13 files changed, 40 insertions(+), 141 deletions(-) delete mode 100644 browser/components/newtab/data/content/assets/cfr_amazon_assistant.png diff --git a/browser/components/newtab/common/Reducers.jsm b/browser/components/newtab/common/Reducers.jsm index ad7a13f611b7..2b585bab1e60 100644 --- a/browser/components/newtab/common/Reducers.jsm +++ b/browser/components/newtab/common/Reducers.jsm @@ -271,7 +271,10 @@ function Sections(prevState = INITIAL_STATE.Sections, action) { const rows = Array.from(action.data.rows); section.rows.forEach((card, index) => { if (card.pinned) { - rows.splice(index, 0, card); + // Only add it if it's not already there. + if (rows[index].guid !== card.guid) { + rows.splice(index, 0, card); + } } }); return Object.assign({}, section, initialized, Object.assign({}, action.data, {rows})); diff --git a/browser/components/newtab/content-src/components/ASRouterAdmin/ASRouterAdmin.jsx b/browser/components/newtab/content-src/components/ASRouterAdmin/ASRouterAdmin.jsx index b95ad1ac1b87..a5f0fd3a4339 100644 --- a/browser/components/newtab/content-src/components/ASRouterAdmin/ASRouterAdmin.jsx +++ b/browser/components/newtab/content-src/components/ASRouterAdmin/ASRouterAdmin.jsx @@ -239,13 +239,14 @@ export class ASRouterAdmin extends React.PureComponent { renderTargetingParameters() { // There was no error and the result is truthy const success = this.state.evaluationStatus.success && !!this.state.evaluationStatus.result; + const result = JSON.stringify(this.state.evaluationStatus.result, null, 2) || "(Empty result)"; return (

Evaluate JEXL expression