Skip to content
This repository has been archived by the owner on Apr 1, 2020. It is now read-only.

Wip permutive trial #1426

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions bower.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
"n-ui-foundations": "^3.0.6",
"next-session-client": "^2.3.4",
"o-ads": "^12.1.0",
"o-permutive": "1.0.0-beta.2",
"o-errors": "^3.6.1",
"o-expander": "^4.4.4",
"o-footer": "^6.0.10",
Expand Down
4 changes: 2 additions & 2 deletions browser/bundles/o-errors/test/filter-error.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ describe('filter error', () => {
'undefined is not a function (evaluating \'Object.assign(window.FT.flags',
'The installing service worker became redundant.'
].map(err => it(`should filter "${err}"`, () => {
const result = filterError({ exception: buildExceptionObject(err) });
expect(result).to.equal(false);
const result = filterError({ exception: buildExceptionObject(err) });
expect(result).to.equal(false);
}));


Expand Down
1 change: 0 additions & 1 deletion browser/layout/wrapper.html
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,6 @@
};
</script>
{{/if}}

<div class="n-layout">
<div class="n-layout__row n-layout__row--header">
{{#outputBlock 'above-header'}}{{/outputBlock}}
Expand Down
21 changes: 19 additions & 2 deletions components/n-ui/ads/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import krux from './js/krux';
import Ads from 'o-ads';
import oPermutive from 'o-permutive';

//TODO move to central shared utils
import utils from './js/utils';
Expand Down Expand Up @@ -65,7 +66,23 @@ export default {
window.addEventListener('ftNextLoaded', function () {
nCounterAdBlocking.init(flags);
});

if (flags && flags.get('AdsPermutive')) {
let oPermConf = {
'appInfo' : {
'appName' : 'article',
'contentId' : '5cfae92e-6cc5-11e9-80c7-60ee53e6681d'
},
'publicApiKeys' : {
'id' : 'e1c3fd73-dd41-4abd-b80b-4278d52bf7aa',
'key' : 'b2b3b748-e1f6-4bd5-b2f2-26debc8075a3'
},
'adsApi' : {
'user' : 'https://ads-api.ft.com/v1/user',
'content' : 'https://ads-api.ft.com/v1/content/'
}
};
oPermutive.init(false, oPermConf);
}
const adOptions = typeof opts === 'object' ? opts : {};

return Promise.resolve()
Expand Down Expand Up @@ -93,6 +110,6 @@ export default {
});
}

});
});
}
};
2 changes: 1 addition & 1 deletion components/n-ui/ads/js/krux.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ function init (flags) {

// DoubleClick handles display advertising. This matches up the user ID formats so Krux can send segment populations to them.
if(flags.get('kruxGoogleIntegration')) {
frequencyCap('doubleclick', 2, () => { addPixel('https://usermatch.krxd.net/um/v2?partner=google'); });
frequencyCap('doubleclick', 2, () => { addPixel('https://usermatch.krxd.net/um/v2?partner=google'); });
}

// The following four scripts are user matching scripts for Kruxdata partners
Expand Down
2 changes: 1 addition & 1 deletion components/n-ui/ads/test/helpers/markup.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ function set (markup) {

function destroyContainer () {
if (container.parentNode) {
container.parentNode.removeChild(container);
container.parentNode.removeChild(container);
}
}

Expand Down
6 changes: 3 additions & 3 deletions components/n-ui/ads/test/oAdsConfig.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,10 +95,10 @@ describe('Config', () => {
sandbox.stub(utils, 'getMetaData').callsFake((param) => {
switch (param) {
case 'dfp_site':
return 'testDfpSite';
return 'testDfpSite';
break;
case 'dfp_zone':
return 'testDfpZone';
return 'testDfpZone';
break;
}
});
Expand All @@ -112,7 +112,7 @@ describe('Config', () => {

describe('lazyLoad viewportMargin', () => {

// tests for adOptimizeLazyLoad flag
// tests for adOptimizeLazyLoad flag
it('Should pass 0% when screen size is wider than 980px', () => {
sandbox.stub(utils, 'getScreenSize').callsFake(() => { return 980; });
const flags = { get: () => true };
Expand Down
2 changes: 1 addition & 1 deletion components/n-ui/tracking/ft/events/navigation-timing.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ const getMarks = performance =>
marks[mark.name] = Math.round(mark.startTime);
return marks;
}, {}) :
{};
{};

const getCustom = (window, performance) => {
const custom = {};
Expand Down
2 changes: 1 addition & 1 deletion components/n-ui/tracking/test/ft/utils/getDomPath.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,6 @@ describe('getDomPath', function () {
</section>`;
const path = getDomPath(document.getElementById('x1'), []);
expect(path).to.deep.equal(['b', 'c']);
expect(document.getElementById('x2').getAttribute('data-trackable')).to.equal('b');
expect(document.getElementById('x2').getAttribute('data-trackable')).to.equal('b');
});
});