зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1579949
- Add text-promo designs, after-login triplets and bug fixes to New Tab Page r=dmose
Differential Revision: https://phabricator.services.mozilla.com/D45225 --HG-- extra : moz-landing-system : lando
This commit is contained in:
Родитель
2d2e31c626
Коммит
a38c7e2387
|
@ -17,7 +17,6 @@ module.exports = {
|
|||
"jsx-a11y", // require("eslint-plugin-jsx-a11y")
|
||||
// Temporarily disabled since they aren't vendored into in mozilla central yet
|
||||
// "react-hooks", // require("react-hooks")
|
||||
"fetch-options", // require("eslint-plugin-fetch-options")
|
||||
],
|
||||
"settings": {
|
||||
"react": {
|
||||
|
@ -27,7 +26,7 @@ module.exports = {
|
|||
"extends": [
|
||||
"eslint:recommended",
|
||||
"plugin:jsx-a11y/recommended", // require("eslint-plugin-jsx-a11y")
|
||||
"plugin:mozilla/recommended", // require("eslint-plugin-mozilla")
|
||||
"plugin:mozilla/recommended", // require("eslint-plugin-mozilla") require("eslint-plugin-fetch-options") require("eslint-plugin-html") require("eslint-plugin-no-unsanitized")
|
||||
"plugin:mozilla/browser-test",
|
||||
"plugin:mozilla/mochitest-test",
|
||||
"plugin:mozilla/xpcshell-test",
|
||||
|
|
|
@ -19,6 +19,11 @@
|
|||
"type": "string",
|
||||
"description": "Attribute used for different groups of messages from the same provider"
|
||||
},
|
||||
"layout": {
|
||||
"type": "string",
|
||||
"description": "Attribute used for different groups of messages from the same provider",
|
||||
"enum": ["message_and_animation", "icon_and_message", "addon_recommendation"]
|
||||
},
|
||||
"bucket_id": {
|
||||
"type": "string",
|
||||
"description": "A bucket identifier for the addon. This is used in order to anonymize telemetry for history-sensitive targeting."
|
||||
|
@ -102,6 +107,13 @@
|
|||
}
|
||||
]
|
||||
},
|
||||
"icon": {
|
||||
"description": "The icon displayed in the pop-over. Should be 64x64px and png/svg.",
|
||||
"allOf": [
|
||||
{"$ref": "#/definitions/linkUrl"},
|
||||
{"description": "Icon associated with the message"}
|
||||
]
|
||||
},
|
||||
"addon": {
|
||||
"description": "Addon information including AMO URL.",
|
||||
"type": "object",
|
||||
|
|
|
@ -163,6 +163,7 @@ export class _DiscoveryStreamBase extends React.PureComponent {
|
|||
}}
|
||||
dispatch={this.props.dispatch}
|
||||
shouldSendImpressionStats={true}
|
||||
extraClasses={`ds-dismiss-ds-text-promo`}
|
||||
>
|
||||
<DSTextPromo
|
||||
dispatch={this.props.dispatch}
|
||||
|
|
|
@ -56,10 +56,10 @@ export class DSDismiss extends React.PureComponent {
|
|||
}
|
||||
|
||||
render() {
|
||||
let className = "ds-dismiss";
|
||||
if (this.state.hovering) {
|
||||
className += " hovering";
|
||||
}
|
||||
let className = `ds-dismiss
|
||||
${this.state.hovering ? ` hovering` : ``}
|
||||
${this.props.extraClasses ? ` ${this.props.extraClasses}` : ``}`;
|
||||
|
||||
return (
|
||||
<div className={className}>
|
||||
{this.props.children}
|
||||
|
|
|
@ -1,19 +1,27 @@
|
|||
.ds-dismiss-ds-text-promo {
|
||||
width: 744px;
|
||||
margin: auto;
|
||||
|
||||
.ds-dismiss-button {
|
||||
margin: 16px;
|
||||
}
|
||||
}
|
||||
|
||||
.ds-text-promo {
|
||||
display: flex;
|
||||
max-width: 744px;
|
||||
margin: 16px auto;
|
||||
max-width: 640px;
|
||||
margin: 18px 24px;
|
||||
|
||||
picture {
|
||||
.ds-image {
|
||||
width: 40px;
|
||||
height: 40px;
|
||||
margin: 0 12px 0 0;
|
||||
margin: 4px 12px 0 0;
|
||||
border-radius: 4px;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.text {
|
||||
line-height: 24px;
|
||||
margin: -4.5px 0 0;
|
||||
}
|
||||
|
||||
h3 {
|
||||
|
|
|
@ -3024,19 +3024,24 @@ main {
|
|||
to {
|
||||
transform: rotate(360deg); } }
|
||||
|
||||
.ds-dismiss-ds-text-promo {
|
||||
width: 744px;
|
||||
margin: auto; }
|
||||
.ds-dismiss-ds-text-promo .ds-dismiss-button {
|
||||
margin: 16px; }
|
||||
|
||||
.ds-text-promo {
|
||||
display: flex;
|
||||
max-width: 744px;
|
||||
margin: 16px auto; }
|
||||
.ds-text-promo picture {
|
||||
max-width: 640px;
|
||||
margin: 18px 24px; }
|
||||
.ds-text-promo .ds-image {
|
||||
width: 40px;
|
||||
height: 40px;
|
||||
margin: 0 12px 0 0;
|
||||
margin: 4px 12px 0 0;
|
||||
border-radius: 4px;
|
||||
flex-shrink: 0; }
|
||||
.ds-text-promo .text {
|
||||
line-height: 24px;
|
||||
margin: -4.5px 0 0; }
|
||||
line-height: 24px; }
|
||||
.ds-text-promo h3 {
|
||||
margin: 0;
|
||||
font-weight: 600;
|
||||
|
|
|
@ -3027,19 +3027,24 @@ main {
|
|||
to {
|
||||
transform: rotate(360deg); } }
|
||||
|
||||
.ds-dismiss-ds-text-promo {
|
||||
width: 744px;
|
||||
margin: auto; }
|
||||
.ds-dismiss-ds-text-promo .ds-dismiss-button {
|
||||
margin: 16px; }
|
||||
|
||||
.ds-text-promo {
|
||||
display: flex;
|
||||
max-width: 744px;
|
||||
margin: 16px auto; }
|
||||
.ds-text-promo picture {
|
||||
max-width: 640px;
|
||||
margin: 18px 24px; }
|
||||
.ds-text-promo .ds-image {
|
||||
width: 40px;
|
||||
height: 40px;
|
||||
margin: 0 12px 0 0;
|
||||
margin: 4px 12px 0 0;
|
||||
border-radius: 4px;
|
||||
flex-shrink: 0; }
|
||||
.ds-text-promo .text {
|
||||
line-height: 24px;
|
||||
margin: -4.5px 0 0; }
|
||||
line-height: 24px; }
|
||||
.ds-text-promo h3 {
|
||||
margin: 0;
|
||||
font-weight: 600;
|
||||
|
|
|
@ -3024,19 +3024,24 @@ main {
|
|||
to {
|
||||
transform: rotate(360deg); } }
|
||||
|
||||
.ds-dismiss-ds-text-promo {
|
||||
width: 744px;
|
||||
margin: auto; }
|
||||
.ds-dismiss-ds-text-promo .ds-dismiss-button {
|
||||
margin: 16px; }
|
||||
|
||||
.ds-text-promo {
|
||||
display: flex;
|
||||
max-width: 744px;
|
||||
margin: 16px auto; }
|
||||
.ds-text-promo picture {
|
||||
max-width: 640px;
|
||||
margin: 18px 24px; }
|
||||
.ds-text-promo .ds-image {
|
||||
width: 40px;
|
||||
height: 40px;
|
||||
margin: 0 12px 0 0;
|
||||
margin: 4px 12px 0 0;
|
||||
border-radius: 4px;
|
||||
flex-shrink: 0; }
|
||||
.ds-text-promo .text {
|
||||
line-height: 24px;
|
||||
margin: -4.5px 0 0; }
|
||||
line-height: 24px; }
|
||||
.ds-text-promo h3 {
|
||||
margin: 0;
|
||||
font-weight: 600;
|
||||
|
|
|
@ -8824,12 +8824,9 @@ class DSDismiss_DSDismiss extends external_React_default.a.PureComponent {
|
|||
}
|
||||
|
||||
render() {
|
||||
let className = "ds-dismiss";
|
||||
|
||||
if (this.state.hovering) {
|
||||
className += " hovering";
|
||||
}
|
||||
|
||||
let className = `ds-dismiss
|
||||
${this.state.hovering ? ` hovering` : ``}
|
||||
${this.props.extraClasses ? ` ${this.props.extraClasses}` : ``}`;
|
||||
return external_React_default.a.createElement("div", {
|
||||
className: className
|
||||
}, this.props.children, external_React_default.a.createElement("button", {
|
||||
|
@ -9916,7 +9913,8 @@ class DiscoveryStreamBase_DiscoveryStreamBase extends external_React_default.a.P
|
|||
shim: spoc.shim
|
||||
},
|
||||
dispatch: this.props.dispatch,
|
||||
shouldSendImpressionStats: true
|
||||
shouldSendImpressionStats: true,
|
||||
extraClasses: `ds-dismiss-ds-text-promo`
|
||||
}, external_React_default.a.createElement(DSTextPromo_DSTextPromo, {
|
||||
dispatch: this.props.dispatch,
|
||||
image: image_src,
|
||||
|
|
|
@ -514,11 +514,13 @@ class _ASRouter {
|
|||
if (TARGETING_PREFERENCES.includes(prefName)) {
|
||||
// Notify all tabs of messages that have become invalid after pref change
|
||||
const invalidMessages = [];
|
||||
const context = this._getMessagesContext();
|
||||
|
||||
for (const msg of this._getUnblockedMessages()) {
|
||||
if (!msg.targeting) {
|
||||
continue;
|
||||
}
|
||||
const isMatch = await ASRouterTargeting.isMatch(msg.targeting);
|
||||
const isMatch = await ASRouterTargeting.isMatch(msg.targeting, context);
|
||||
if (!isMatch) {
|
||||
invalidMessages.push(msg.id);
|
||||
}
|
||||
|
|
|
@ -681,9 +681,9 @@
|
|||
"dev": true
|
||||
},
|
||||
"acorn-jsx": {
|
||||
"version": "5.0.1",
|
||||
"resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.0.1.tgz",
|
||||
"integrity": "sha512-HJ7CfNHrfJLlNTzIEUTj43LNWGkqpRLxm3YjAlcD0ACydk9XynzYsCBHxut+iqt+1aBXkx9UP/w/ZqMr13XIzg==",
|
||||
"version": "5.0.2",
|
||||
"resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.0.2.tgz",
|
||||
"integrity": "sha512-tiNTrP1MP0QrChmD2DdupCr6HWSFeKVw5d/dHTu4Y7rkAkRhU/Dt7dphAfIUyxtHpl/eBVip5uTNSpQJHylpAw==",
|
||||
"dev": true
|
||||
},
|
||||
"after": {
|
||||
|
@ -1120,17 +1120,28 @@
|
|||
}
|
||||
},
|
||||
"babel-eslint": {
|
||||
"version": "10.0.1",
|
||||
"resolved": "https://registry.npmjs.org/babel-eslint/-/babel-eslint-10.0.1.tgz",
|
||||
"integrity": "sha512-z7OT1iNV+TjOwHNLLyJk+HN+YVWX+CLE6fPD2SymJZOZQBs+QIexFjhm4keGTm8MW9xr4EC9Q0PbaLB24V5GoQ==",
|
||||
"version": "10.0.3",
|
||||
"resolved": "https://registry.npmjs.org/babel-eslint/-/babel-eslint-10.0.3.tgz",
|
||||
"integrity": "sha512-z3U7eMY6r/3f3/JB9mTsLjyxrv0Yb1zb8PCWCLpguxfCzBIZUwy23R1t/XKewP+8mEN2Ck8Dtr4q20z6ce6SoA==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"@babel/code-frame": "^7.0.0",
|
||||
"@babel/parser": "^7.0.0",
|
||||
"@babel/traverse": "^7.0.0",
|
||||
"@babel/types": "^7.0.0",
|
||||
"eslint-scope": "3.7.1",
|
||||
"eslint-visitor-keys": "^1.0.0"
|
||||
"eslint-visitor-keys": "^1.0.0",
|
||||
"resolve": "^1.12.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"resolve": {
|
||||
"version": "1.12.0",
|
||||
"resolved": "https://registry.npmjs.org/resolve/-/resolve-1.12.0.tgz",
|
||||
"integrity": "sha512-B/dOmuoAik5bKcD6s6nXDCjzUKnaDvdkRyAk6rsmsKLipWj4797iothd7jmmUhWTfinVMU+wc56rYKsit2Qy4w==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"path-parse": "^1.0.6"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"babel-generator": {
|
||||
|
@ -2943,58 +2954,100 @@
|
|||
}
|
||||
},
|
||||
"eslint": {
|
||||
"version": "5.16.0",
|
||||
"resolved": "https://registry.npmjs.org/eslint/-/eslint-5.16.0.tgz",
|
||||
"integrity": "sha512-S3Rz11i7c8AA5JPv7xAH+dOyq/Cu/VXHiHXBPOU1k/JAM5dXqQPt3qcrhpHSorXmrpu2g0gkIBVXAqCpzfoZIg==",
|
||||
"version": "6.2.2",
|
||||
"resolved": "https://registry.npmjs.org/eslint/-/eslint-6.2.2.tgz",
|
||||
"integrity": "sha512-mf0elOkxHbdyGX1IJEUsNBzCDdyoUgljF3rRlgfyYh0pwGnreLc0jjD6ZuleOibjmnUWZLY2eXwSooeOgGJ2jw==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"@babel/code-frame": "^7.0.0",
|
||||
"ajv": "^6.9.1",
|
||||
"ajv": "^6.10.0",
|
||||
"chalk": "^2.1.0",
|
||||
"cross-spawn": "^6.0.5",
|
||||
"debug": "^4.0.1",
|
||||
"doctrine": "^3.0.0",
|
||||
"eslint-scope": "^4.0.3",
|
||||
"eslint-utils": "^1.3.1",
|
||||
"eslint-visitor-keys": "^1.0.0",
|
||||
"espree": "^5.0.1",
|
||||
"eslint-scope": "^5.0.0",
|
||||
"eslint-utils": "^1.4.2",
|
||||
"eslint-visitor-keys": "^1.1.0",
|
||||
"espree": "^6.1.1",
|
||||
"esquery": "^1.0.1",
|
||||
"esutils": "^2.0.2",
|
||||
"file-entry-cache": "^5.0.1",
|
||||
"functional-red-black-tree": "^1.0.1",
|
||||
"glob": "^7.1.2",
|
||||
"glob-parent": "^5.0.0",
|
||||
"globals": "^11.7.0",
|
||||
"ignore": "^4.0.6",
|
||||
"import-fresh": "^3.0.0",
|
||||
"imurmurhash": "^0.1.4",
|
||||
"inquirer": "^6.2.2",
|
||||
"js-yaml": "^3.13.0",
|
||||
"inquirer": "^6.4.1",
|
||||
"is-glob": "^4.0.0",
|
||||
"js-yaml": "^3.13.1",
|
||||
"json-stable-stringify-without-jsonify": "^1.0.1",
|
||||
"levn": "^0.3.0",
|
||||
"lodash": "^4.17.11",
|
||||
"lodash": "^4.17.14",
|
||||
"minimatch": "^3.0.4",
|
||||
"mkdirp": "^0.5.1",
|
||||
"natural-compare": "^1.4.0",
|
||||
"optionator": "^0.8.2",
|
||||
"path-is-inside": "^1.0.2",
|
||||
"progress": "^2.0.0",
|
||||
"regexpp": "^2.0.1",
|
||||
"semver": "^5.5.1",
|
||||
"strip-ansi": "^4.0.0",
|
||||
"strip-json-comments": "^2.0.1",
|
||||
"semver": "^6.1.2",
|
||||
"strip-ansi": "^5.2.0",
|
||||
"strip-json-comments": "^3.0.1",
|
||||
"table": "^5.2.3",
|
||||
"text-table": "^0.2.0"
|
||||
"text-table": "^0.2.0",
|
||||
"v8-compile-cache": "^2.0.3"
|
||||
},
|
||||
"dependencies": {
|
||||
"eslint-scope": {
|
||||
"version": "4.0.3",
|
||||
"resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-4.0.3.tgz",
|
||||
"integrity": "sha512-p7VutNr1O/QrxysMo3E45FjYDTeXBy0iTltPFNSqKAIfjDSXC+4dj+qfyuD8bfAXrW/y6lW3O76VaYNPKfpKrg==",
|
||||
"ansi-regex": {
|
||||
"version": "4.1.0",
|
||||
"resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz",
|
||||
"integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==",
|
||||
"dev": true
|
||||
},
|
||||
"glob-parent": {
|
||||
"version": "5.0.0",
|
||||
"resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.0.0.tgz",
|
||||
"integrity": "sha512-Z2RwiujPRGluePM6j699ktJYxmPpJKCfpGA13jz2hmFZC7gKetzrWvg5KN3+OsIFmydGyZ1AVwERCq1w/ZZwRg==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"esrecurse": "^4.1.0",
|
||||
"estraverse": "^4.1.1"
|
||||
"is-glob": "^4.0.1"
|
||||
}
|
||||
},
|
||||
"is-extglob": {
|
||||
"version": "2.1.1",
|
||||
"resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz",
|
||||
"integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=",
|
||||
"dev": true
|
||||
},
|
||||
"is-glob": {
|
||||
"version": "4.0.1",
|
||||
"resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.1.tgz",
|
||||
"integrity": "sha512-5G0tKtBTFImOqDnLB2hG6Bp2qcKEFduo4tZu9MT/H6NQv/ghhy30o55ufafxJ/LdH79LLs2Kfrn85TLKyA7BUg==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"is-extglob": "^2.1.1"
|
||||
}
|
||||
},
|
||||
"semver": {
|
||||
"version": "6.3.0",
|
||||
"resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz",
|
||||
"integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==",
|
||||
"dev": true
|
||||
},
|
||||
"strip-ansi": {
|
||||
"version": "5.2.0",
|
||||
"resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz",
|
||||
"integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"ansi-regex": "^4.1.0"
|
||||
}
|
||||
},
|
||||
"strip-json-comments": {
|
||||
"version": "3.0.1",
|
||||
"resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.0.1.tgz",
|
||||
"integrity": "sha512-VTyMAUfdm047mwKl+u79WIdrZxtFtn+nBxHeb844XBQ9uMNTuTHdx2hc5RiAJYqwTj3wc/xe5HLSdJSkJ+WfZw==",
|
||||
"dev": true
|
||||
}
|
||||
}
|
||||
},
|
||||
|
@ -3119,6 +3172,15 @@
|
|||
"integrity": "sha512-ZMxrccsOAZ7uMQ4nMvPJLqLg6oyLF96YOEwTKWAIbDHpwWUp1raXALZom8ikKucaEnhqWSRuBWI8jBXveFwkJg==",
|
||||
"dev": true
|
||||
},
|
||||
"eslint-plugin-html": {
|
||||
"version": "6.0.0",
|
||||
"resolved": "https://registry.npmjs.org/eslint-plugin-html/-/eslint-plugin-html-6.0.0.tgz",
|
||||
"integrity": "sha512-PQcGippOHS+HTbQCStmH5MY1BF2MaU8qW/+Mvo/8xTa/ioeMXdSP+IiaBw2+nh0KEMfYQKuTz1Zo+vHynjwhbg==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"htmlparser2": "^3.10.1"
|
||||
}
|
||||
},
|
||||
"eslint-plugin-import": {
|
||||
"version": "2.17.3",
|
||||
"resolved": "https://registry.npmjs.org/eslint-plugin-import/-/eslint-plugin-import-2.17.3.tgz",
|
||||
|
@ -3191,9 +3253,9 @@
|
|||
}
|
||||
},
|
||||
"eslint-plugin-mozilla": {
|
||||
"version": "1.3.0",
|
||||
"resolved": "https://registry.npmjs.org/eslint-plugin-mozilla/-/eslint-plugin-mozilla-1.3.0.tgz",
|
||||
"integrity": "sha512-sCwDShn7zajPVUYc3SEd02ZjUpMiSojl2WmJjLPk6mlErZ400DuGidPPpB/M5lpb8FEHtxP/EiOQCAzsGY7KBA==",
|
||||
"version": "2.1.0",
|
||||
"resolved": "https://registry.npmjs.org/eslint-plugin-mozilla/-/eslint-plugin-mozilla-2.1.0.tgz",
|
||||
"integrity": "sha512-Fsu2kq3FZKgreXTew0UjArmnbGWnEnkgn21sojpuJ0GwUwI6T0Ee9MrMIeXiC0LhX6AkBtK+QkqQViw4sEgBZw==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"htmlparser2": "3.10.1",
|
||||
|
@ -3267,9 +3329,9 @@
|
|||
"dev": true
|
||||
},
|
||||
"eslint-scope": {
|
||||
"version": "3.7.1",
|
||||
"resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-3.7.1.tgz",
|
||||
"integrity": "sha1-PWPD7f2gLgbgGkUq2IyqzHzctug=",
|
||||
"version": "5.0.0",
|
||||
"resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.0.0.tgz",
|
||||
"integrity": "sha512-oYrhJW7S0bxAFDvWqzvMPRm6pcgcnWc4QnofCAqRTRfQC0JcwenzGglTtsLyIuuWFfkqDG9vz67cnttSd53djw==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"esrecurse": "^4.1.0",
|
||||
|
@ -3277,26 +3339,37 @@
|
|||
}
|
||||
},
|
||||
"eslint-utils": {
|
||||
"version": "1.3.1",
|
||||
"resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-1.3.1.tgz",
|
||||
"integrity": "sha512-Z7YjnIldX+2XMcjr7ZkgEsOj/bREONV60qYeB/bjMAqqqZ4zxKyWX+BOUkdmRmA9riiIPVvo5x86m5elviOk0Q==",
|
||||
"dev": true
|
||||
"version": "1.4.2",
|
||||
"resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-1.4.2.tgz",
|
||||
"integrity": "sha512-eAZS2sEUMlIeCjBeubdj45dmBHQwPHWyBcT1VSYB7o9x9WRRqKxyUoiXlRjyAwzN7YEzHJlYg0NmzDRWx6GP4Q==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"eslint-visitor-keys": "^1.0.0"
|
||||
}
|
||||
},
|
||||
"eslint-visitor-keys": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.0.0.tgz",
|
||||
"integrity": "sha512-qzm/XxIbxm/FHyH341ZrbnMUpe+5Bocte9xkmFMzPMjRaZMcXww+MpBptFvtU+79L362nqiLhekCxCxDPaUMBQ==",
|
||||
"version": "1.1.0",
|
||||
"resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.1.0.tgz",
|
||||
"integrity": "sha512-8y9YjtM1JBJU/A9Kc+SbaOV4y29sSWckBwMHa+FGtVj5gN/sbnKDf6xJUl+8g7FAij9LVaP8C24DUiH/f/2Z9A==",
|
||||
"dev": true
|
||||
},
|
||||
"espree": {
|
||||
"version": "5.0.1",
|
||||
"resolved": "https://registry.npmjs.org/espree/-/espree-5.0.1.tgz",
|
||||
"integrity": "sha512-qWAZcWh4XE/RwzLJejfcofscgMc9CamR6Tn1+XRXNzrvUSSbiAjGOI/fggztjIi7y9VLPqnICMIPiGyr8JaZ0A==",
|
||||
"version": "6.1.1",
|
||||
"resolved": "https://registry.npmjs.org/espree/-/espree-6.1.1.tgz",
|
||||
"integrity": "sha512-EYbr8XZUhWbYCqQRW0duU5LxzL5bETN6AjKBGy1302qqzPaCH10QbRg3Wvco79Z8x9WbiE8HYB4e75xl6qUYvQ==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"acorn": "^6.0.7",
|
||||
"acorn-jsx": "^5.0.0",
|
||||
"eslint-visitor-keys": "^1.0.0"
|
||||
"acorn": "^7.0.0",
|
||||
"acorn-jsx": "^5.0.2",
|
||||
"eslint-visitor-keys": "^1.1.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"acorn": {
|
||||
"version": "7.0.0",
|
||||
"resolved": "https://registry.npmjs.org/acorn/-/acorn-7.0.0.tgz",
|
||||
"integrity": "sha512-PaF/MduxijYYt7unVGRuds1vBC9bFxbNf+VWqhOClfdgy7RlVkQqt610ig1/yxTgsDIfW1cWDel5EBbOy3jdtQ==",
|
||||
"dev": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"esprima": {
|
||||
|
@ -3443,9 +3516,9 @@
|
|||
}
|
||||
},
|
||||
"external-editor": {
|
||||
"version": "3.0.3",
|
||||
"resolved": "https://registry.npmjs.org/external-editor/-/external-editor-3.0.3.tgz",
|
||||
"integrity": "sha512-bn71H9+qWoOQKyZDo25mOMVpSmXROAsTJVVVYzrrtol3d4y+AsKjf4Iwl2Q+IuT0kFSQ1qo166UuIwqYq7mGnA==",
|
||||
"version": "3.1.0",
|
||||
"resolved": "https://registry.npmjs.org/external-editor/-/external-editor-3.1.0.tgz",
|
||||
"integrity": "sha512-hMQ4CX1p1izmuLYyZqLMO/qGNw10wSv9QDCPfzXfyFrOaCSSoRfqE1Kf1s5an66J5JZC62NewG+mK49jOCtQew==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"chardet": "^0.7.0",
|
||||
|
@ -5316,9 +5389,9 @@
|
|||
"dev": true
|
||||
},
|
||||
"import-fresh": {
|
||||
"version": "3.0.0",
|
||||
"resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.0.0.tgz",
|
||||
"integrity": "sha512-pOnA9tfM3Uwics+SaBLCNyZZZbK+4PTu0OPZtLlMIrv17EdBoC15S9Kn8ckJ9TZTyKb3ywNE5y1yeDxxGA7nTQ==",
|
||||
"version": "3.1.0",
|
||||
"resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.1.0.tgz",
|
||||
"integrity": "sha512-PpuksHKGt8rXfWEr9m9EHIpgyyaltBy8+eF6GJM0QCAxMgxCfucMF3mjecK2QsJr0amJW7gTqh5/wht0z2UhEQ==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"parent-module": "^1.0.0",
|
||||
|
@ -5391,9 +5464,9 @@
|
|||
"dev": true
|
||||
},
|
||||
"inquirer": {
|
||||
"version": "6.3.1",
|
||||
"resolved": "https://registry.npmjs.org/inquirer/-/inquirer-6.3.1.tgz",
|
||||
"integrity": "sha512-MmL624rfkFt4TG9y/Jvmt8vdmOo836U7Y0Hxr2aFk3RelZEGX4Igk0KabWrcaaZaTv9uzglOqWh1Vly+FAWAXA==",
|
||||
"version": "6.5.2",
|
||||
"resolved": "https://registry.npmjs.org/inquirer/-/inquirer-6.5.2.tgz",
|
||||
"integrity": "sha512-cntlB5ghuB0iuO65Ovoi8ogLHiWGs/5yNrtUcKjFhSSiVeAIVpD7koaSU9RM8mpXw5YDi9RdYXGQMaOURB7ycQ==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"ansi-escapes": "^3.2.0",
|
||||
|
@ -5402,7 +5475,7 @@
|
|||
"cli-width": "^2.0.0",
|
||||
"external-editor": "^3.0.3",
|
||||
"figures": "^2.0.0",
|
||||
"lodash": "^4.17.11",
|
||||
"lodash": "^4.17.12",
|
||||
"mute-stream": "0.0.7",
|
||||
"run-async": "^2.2.0",
|
||||
"rxjs": "^6.4.0",
|
||||
|
@ -9367,9 +9440,9 @@
|
|||
"dev": true
|
||||
},
|
||||
"rxjs": {
|
||||
"version": "6.5.1",
|
||||
"resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.5.1.tgz",
|
||||
"integrity": "sha512-y0j31WJc83wPu31vS1VlAFW5JGrnGC+j+TtGAa1fRQphy48+fDYiDmX8tjGloToEsMkxnouOg/1IzXGKkJnZMg==",
|
||||
"version": "6.5.2",
|
||||
"resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.5.2.tgz",
|
||||
"integrity": "sha512-HUb7j3kvb7p7eCUHE3FqjoDsC1xfZQ4AHFWfTKSpZ+sAhhz5X1WX0ZuUqWbzB2QhSLp3DoLUG+hMdEDKqWo2Zg==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"tslib": "^1.9.0"
|
||||
|
@ -11149,17 +11222,29 @@
|
|||
"integrity": "sha512-e900nM8RRtGhlV36KGEU9k65K3mPb1WV70OdjfxlG2EAuM1noi/E/BaW/uMhL7bPEssK8QV57vN3esixjUvcXQ=="
|
||||
},
|
||||
"table": {
|
||||
"version": "5.2.3",
|
||||
"resolved": "https://registry.npmjs.org/table/-/table-5.2.3.tgz",
|
||||
"integrity": "sha512-N2RsDAMvDLvYwFcwbPyF3VmVSSkuF+G1e+8inhBLtHpvwXGw4QRPEZhihQNeEN0i1up6/f6ObCJXNdlRG3YVyQ==",
|
||||
"version": "5.4.6",
|
||||
"resolved": "https://registry.npmjs.org/table/-/table-5.4.6.tgz",
|
||||
"integrity": "sha512-wmEc8m4fjnob4gt5riFRtTu/6+4rSe12TpAELNSqHMfF3IqnA+CH37USM6/YR3qRZv7e56kAEAtd6nKZaxe0Ug==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"ajv": "^6.9.1",
|
||||
"lodash": "^4.17.11",
|
||||
"ajv": "^6.10.2",
|
||||
"lodash": "^4.17.14",
|
||||
"slice-ansi": "^2.1.0",
|
||||
"string-width": "^3.0.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"ajv": {
|
||||
"version": "6.10.2",
|
||||
"resolved": "https://registry.npmjs.org/ajv/-/ajv-6.10.2.tgz",
|
||||
"integrity": "sha512-TXtUUEYHuaTEbLZWIKUr5pmBuhDLy+8KYtPYdcV8qC+pOZL+NKqYwvWSRrVXHn+ZmRRAu8vJTAznH7Oag6RVRw==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"fast-deep-equal": "^2.0.1",
|
||||
"fast-json-stable-stringify": "^2.0.0",
|
||||
"json-schema-traverse": "^0.4.1",
|
||||
"uri-js": "^4.2.2"
|
||||
}
|
||||
},
|
||||
"ansi-regex": {
|
||||
"version": "4.1.0",
|
||||
"resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz",
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
"@babel/plugin-proposal-async-generator-functions": "7.2.0",
|
||||
"@babel/preset-react": "7.0.0",
|
||||
"acorn": "6.1.1",
|
||||
"babel-eslint": "10.0.1",
|
||||
"babel-eslint": "10.0.3",
|
||||
"babel-loader": "8.0.6",
|
||||
"babel-plugin-jsm-to-commonjs": "0.5.0",
|
||||
"babel-plugin-jsm-to-esmodules": "0.6.0",
|
||||
|
@ -30,12 +30,13 @@
|
|||
"cpx": "1.5.0",
|
||||
"enzyme": "3.9.0",
|
||||
"enzyme-adapter-react-16": "1.13.2",
|
||||
"eslint": "5.16.0",
|
||||
"eslint": "6.2.2",
|
||||
"eslint-config-prettier": "4.2.0",
|
||||
"eslint-plugin-fetch-options": "0.0.5",
|
||||
"eslint-plugin-html": "6.0.0",
|
||||
"eslint-plugin-import": "2.17.3",
|
||||
"eslint-plugin-jsx-a11y": "6.2.1",
|
||||
"eslint-plugin-mozilla": "1.3.0",
|
||||
"eslint-plugin-mozilla": "2.1.0",
|
||||
"eslint-plugin-no-unsanitized": "3.0.2",
|
||||
"eslint-plugin-prettier": "3.0.1",
|
||||
"eslint-plugin-react": "7.13.0",
|
||||
|
@ -134,7 +135,7 @@
|
|||
"tddmc": "karma start karma.mc.config.js --tdd",
|
||||
"debugcoverage": "open logs/coverage/index.html",
|
||||
"lint": "npm-run-all lint:*",
|
||||
"lint:eslint-check": "eslint --cache --print-config . | eslint-config-prettier-check",
|
||||
"lint:eslint-check": "eslint --cache --print-config AboutNewTabService.jsm | eslint-config-prettier-check",
|
||||
"lint:eslint": "eslint --cache --ext=.js,.jsm,.jsx .",
|
||||
"lint:sasslint": "sass-lint -v -q",
|
||||
"test": "npm run testmc",
|
||||
|
|
|
@ -11,8 +11,8 @@ const REGULAR_IDS = [
|
|||
];
|
||||
|
||||
describe("CFRMessageProvider", () => {
|
||||
it("should have a total of 4 messages", () => {
|
||||
assert.lengthOf(messages, 4);
|
||||
it("should have a total of 5 messages", () => {
|
||||
assert.lengthOf(messages, 5);
|
||||
});
|
||||
it("should have one message each for the three regular addons", () => {
|
||||
for (const id of REGULAR_IDS) {
|
||||
|
@ -31,13 +31,13 @@ describe("CFRMessageProvider", () => {
|
|||
// Ensure that the CFR messages that are recommending an addon have this targeting.
|
||||
// In the future when we can do targeting based on category, this test will change.
|
||||
// See bug 1494778 and 1497653
|
||||
if (message.id !== "PIN_TAB") {
|
||||
if (!message.content.layout) {
|
||||
assert.include(message.targeting, `(xpinstallEnabled == true)`);
|
||||
}
|
||||
}
|
||||
});
|
||||
it("should restrict all messages to `en` locale for now (PIN TAB is handled separately)", () => {
|
||||
for (const message of messages.filter(m => m.id !== "PIN_TAB")) {
|
||||
for (const message of messages.filter(m => !m.content.layout)) {
|
||||
assert.include(message.targeting, `localeLanguageCode == "en"`);
|
||||
}
|
||||
});
|
||||
|
|
|
@ -699,13 +699,13 @@ describe("CFRPageActions", () => {
|
|||
);
|
||||
});
|
||||
it("should show the bullet list details", async () => {
|
||||
delete fakeRecommendation.content.addon;
|
||||
fakeRecommendation.content.layout = "message_and_animation";
|
||||
await pageAction._showPopupOnClick();
|
||||
|
||||
assert.calledOnce(translateElementsStub);
|
||||
});
|
||||
it("should set the data-l10n-id on the list element", async () => {
|
||||
delete fakeRecommendation.content.addon;
|
||||
fakeRecommendation.content.layout = "message_and_animation";
|
||||
await pageAction._showPopupOnClick();
|
||||
|
||||
assert.calledOnce(setAttributesStub);
|
||||
|
@ -716,18 +716,18 @@ describe("CFRPageActions", () => {
|
|||
);
|
||||
});
|
||||
it("should set the correct data-notification-category", async () => {
|
||||
delete fakeRecommendation.content.addon;
|
||||
fakeRecommendation.content.layout = "message_and_animation";
|
||||
await pageAction._showPopupOnClick();
|
||||
|
||||
assert.equal(
|
||||
elements["contextual-feature-recommendation-notification"].dataset
|
||||
.notificationCategory,
|
||||
fakeRecommendation.content.category
|
||||
fakeRecommendation.content.layout
|
||||
);
|
||||
});
|
||||
it("should send PIN event on primary action click", async () => {
|
||||
fakeRecommendation.content.layout = "message_and_animation";
|
||||
sandbox.stub(pageAction, "_sendTelemetry");
|
||||
delete fakeRecommendation.content.addon;
|
||||
await pageAction._showPopupOnClick();
|
||||
|
||||
const [
|
||||
|
|
|
@ -65,7 +65,7 @@ scripts:
|
|||
|
||||
# lint: Run eslint and sass-lint
|
||||
lint:
|
||||
eslint-check: eslint --cache --print-config . | eslint-config-prettier-check
|
||||
eslint-check: eslint --cache --print-config AboutNewTabService.jsm | eslint-config-prettier-check
|
||||
eslint: eslint --cache --ext=.js,.jsm,.jsx .
|
||||
sasslint: sass-lint -v -q
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче