From 51c6913cffe2f8d4aca4423317938f74f81e95f1 Mon Sep 17 00:00:00 2001 From: Pablo Date: Tue, 20 Aug 2024 05:37:40 -0300 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20New=20feature=20(I2I:=20Sending=20d?= =?UTF-8?q?ata-json=20to=20premiumads=20API=20for=20amp-auto-ads=20#40041?= =?UTF-8?q?=20)=20(#40042)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * 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 --- extensions/amp-auto-ads/0.1/attributes.js | 1 + extensions/amp-auto-ads/0.1/premiumads-network-config.js | 8 ++++++-- .../0.1/test/test-premiumads-network-config.js | 2 +- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/extensions/amp-auto-ads/0.1/attributes.js b/extensions/amp-auto-ads/0.1/attributes.js index 9727c7cbd656..377a00c271d2 100644 --- a/extensions/amp-auto-ads/0.1/attributes.js +++ b/extensions/amp-auto-ads/0.1/attributes.js @@ -15,6 +15,7 @@ const NON_DATA_ATTRIBUTE_ALLOWLIST = { 'height': true, 'width': true, 'sticky': true, + 'json': true, }; /** diff --git a/extensions/amp-auto-ads/0.1/premiumads-network-config.js b/extensions/amp-auto-ads/0.1/premiumads-network-config.js index a352da4a54d1..0cbae33d1b2a 100644 --- a/extensions/amp-auto-ads/0.1/premiumads-network-config.js +++ b/extensions/amp-auto-ads/0.1/premiumads-network-config.js @@ -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 */ @@ -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;', }; } diff --git a/extensions/amp-auto-ads/0.1/test/test-premiumads-network-config.js b/extensions/amp-auto-ads/0.1/test/test-premiumads-network-config.js index c4901074e39a..eaeb8a5908a6 100644 --- a/extensions/amp-auto-ads/0.1/test/test-premiumads-network-config.js +++ b/extensions/amp-auto-ads/0.1/test/test-premiumads-network-config.js @@ -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;', }); });