Skip to content

Commit

Permalink
✨ New feature (I2I: Sending data-json to premiumads API for amp-auto-…
Browse files Browse the repository at this point in the history
…ads #40041 ) (#40042)

* LOND-3031 sendind data-json to api

* LOND-3031 fixing pr-check lint

* LOND-3031 removing unnecessary vertical margin

* LOND-3031 fixing test

* LOND-3031 testing

* LOND-3031 removing comment
  • Loading branch information
rochapablo authored Aug 20, 2024
1 parent 40487a9 commit 51c6913
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
1 change: 1 addition & 0 deletions extensions/amp-auto-ads/0.1/attributes.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ const NON_DATA_ATTRIBUTE_ALLOWLIST = {
'height': true,
'width': true,
'sticky': true,
'json': true,
};

/**
Expand Down
8 changes: 6 additions & 2 deletions extensions/amp-auto-ads/0.1/premiumads-network-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,11 @@ export class PremiumadsNetworkConfig {
getConfigUrl() {
const data = this.autoAmpAdsElement_.dataset;
const host = data.host || 'https://tags.premiumads.com.br';
return buildUrl(`${host}/autoads/${data.publisher}`, {}, 4096);
return buildUrl(
`${host}/autoads/${data.publisher}`,
data.json ? {'json': data.json} : {},
4096
);
}

/** @override */
Expand All @@ -49,7 +53,7 @@ export class PremiumadsNetworkConfig {
'layout': data.layout || Layout_Enum.FIXED,
'style':
data['style'] ||
'margin: 15px auto; position: relative !important; display: block !important;',
'margin: 0 auto; position: relative !important; display: block !important;',
};
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ describes.realWin(
'json': '',
'layout': Layout_Enum.FIXED,
'style':
'margin: 15px auto; position: relative !important; display: block !important;',
'margin: 0 auto; position: relative !important; display: block !important;',
});
});

Expand Down

0 comments on commit 51c6913

Please sign in to comment.