New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Unruly ad network #14828
Add Unruly ad network #14828
Conversation
Hi, is there anything else required from our side for approval? Thanks. |
I've added a couple of reviewers and restarted your CI checks. |
Hi, any update on this PR? Thanks. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for contributing! A few small things.
ads/unruly.js
Outdated
@@ -0,0 +1,28 @@ | |||
/* | |||
Copyright 2015 The AMP HTML Authors. All Rights Reserved. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: 2018
ads/unruly.md
Outdated
@@ -0,0 +1,26 @@ | |||
<!--- | |||
Copyright 2015 The AMP HTML Authors. All Rights Reserved. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
2018
ads/unruly.md
Outdated
```html | ||
<amp-ad width="620" height="349" | ||
type="unruly" | ||
date-siteId="xxx"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this a mandatory attribute? If so could you document it as so?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typo? date-siteId
or data-siteId
nit: prefer data-site-id
for consistency.
examples/ads.amp.html
Outdated
@@ -1140,7 +1141,7 @@ <h2>Monetizer101</h2> | |||
type="monetizer101" | |||
data-widget="price-comparison" | |||
data-config='{"shopId": 1, "priceMin": 500, "nameKeywords": "iphone"}'> | |||
</amp-ad> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍🙂
ads/unruly.js
Outdated
|
||
export function unruly(global, data, scriptLoader = loadScript) { | ||
global.unruly = global.unruly || {}; | ||
global.unruly.native = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You may want to validate the input here. We have this function to help:
Lines 213 to 227 in d86f11f
/** | |
* Validates given data. Throws an exception if the data does not | |
* contains a mandatory field. If called with the optional param | |
* opt_optionalFields, it also validates that the data contains no fields other | |
* than mandatory and optional fields. | |
* | |
* Mandatory fields also accept a string Array as an item. All items in that | |
* array are considered as alternatives to each other. So the validation checks | |
* that the data contains exactly one of those alternatives. | |
* | |
* @param {!Object} data | |
* @param {!Array<string|!Array<string>>} mandatoryFields | |
* @param {Array<string>=} opt_optionalFields | |
*/ | |
export function validateData(data, mandatoryFields, opt_optionalFields) { |
Hi @calebcordry, thanks for your review, we've made the suggested changes and pushed. |
test/functional/ads/test-unruly.js
Outdated
const mockGlobal = {}; | ||
let expectedGlobal; | ||
let expectedUrl; | ||
const scriptLoader = (...args) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this spread may fail lint (we sometimes have frustrating lint rules) Travis is very backed up today due to some new changes, so let's let it finish and see what happens.
edit: rest, not spread, but same idea
Looking good, you will also need to rebase due to merge conflicts. Let me know if you need help with the process. |
Travis appears to have borked here. When you rebase it should restart it anyway. |
Have fixed the conflicts and pushed. |
@calebcordry, its failing on the Percy tests, do you know how I can check these? I don't have permission when I select the details link. |
Have got access to Percy and can see the diff was on the amp-video.amp.html page which isn't affected by this PR. Please can you go ahead with the merge? Thanks. |
Looks good. Thanks! |
Executed all the test as per instructions page and performed the linting and type checks. We have also implemented renderStart as per the advice in the pull request guide.
This is a re-raised PR so the following can be closed:
#14724
This PR has the correct verified author and squashed commits.