@times-components/ssr 2.59.38-1df44fce0d0b994222cc6cd8c9b4c65025928c1d.1 → 2.59.38-8c13d97039c1ee721b5b9dbe12709bb98cd93d3d.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/article.react.bundle.js +4 -12
- package/dist/article.react.bundle.js.map +1 -1
- package/dist/author-profile.react.bundle.js +1 -1
- package/dist/author-profile.react.bundle.js.map +1 -1
- package/dist/common.react.bundle.js +9 -9
- package/dist/common.react.bundle.js.map +1 -1
- package/package.json +2 -2
- package/src/lib/affiliate-links-validation.js +6 -10
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@times-components/ssr",
|
|
3
3
|
"main": "src",
|
|
4
|
-
"version": "2.59.38-
|
|
4
|
+
"version": "2.59.38-8c13d97039c1ee721b5b9dbe12709bb98cd93d3d.2+8c13d97039",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"bundle:dev": "yarn cleanup-dist && webpack --config=webpack.config.js",
|
|
7
7
|
"bundle:prod": "yarn cleanup-dist && NODE_ENV=production webpack --config=webpack.config.js -p",
|
|
@@ -80,5 +80,5 @@
|
|
|
80
80
|
"publishConfig": {
|
|
81
81
|
"access": "public"
|
|
82
82
|
},
|
|
83
|
-
"gitHead": "
|
|
83
|
+
"gitHead": "8c13d97039c1ee721b5b9dbe12709bb98cd93d3d"
|
|
84
84
|
}
|
|
@@ -3,12 +3,11 @@ const {
|
|
|
3
3
|
travelSiteCode,
|
|
4
4
|
trackonomicsRegex
|
|
5
5
|
} = require("../constants/affiliate-links-validation");
|
|
6
|
-
const { wrapSkimlinks } = require("./skimlinks-wrapping");
|
|
6
|
+
/* const { wrapSkimlinks } = require("./skimlinks-wrapping"); */
|
|
7
7
|
|
|
8
8
|
const isAffiliateLink = url => trackonomicsRegex.test(url);
|
|
9
9
|
|
|
10
|
-
|
|
11
|
-
const wrapAffiliateLink = (affiliateLink, contentPageUrl) => {
|
|
10
|
+
const wrapAffiliateLink = (affiliateUrl, contentPageUrl) => {
|
|
12
11
|
const wrapTrackonomics = trackonomicsUrl => {
|
|
13
12
|
if (!isAffiliateLink(trackonomicsUrl)) {
|
|
14
13
|
return trackonomicsUrl;
|
|
@@ -26,8 +25,8 @@ const wrapAffiliateLink = (affiliateLink, contentPageUrl) => {
|
|
|
26
25
|
return affiliateWrapper;
|
|
27
26
|
};
|
|
28
27
|
|
|
29
|
-
const skimlinksUrl = wrapSkimlinks(affiliateLink, contentPageUrl);
|
|
30
|
-
return wrapTrackonomics(
|
|
28
|
+
/* const skimlinksUrl = wrapSkimlinks(affiliateLink, contentPageUrl); */
|
|
29
|
+
return wrapTrackonomics(affiliateUrl);
|
|
31
30
|
};
|
|
32
31
|
|
|
33
32
|
module.exports.affiliateLinksValidation = (children, articleDataFromRender) => {
|
|
@@ -35,9 +34,6 @@ module.exports.affiliateLinksValidation = (children, articleDataFromRender) => {
|
|
|
35
34
|
const { canonicalUrl, hostName } = articleDataFromRender;
|
|
36
35
|
const contentPageUrl = `${hostName}${canonicalUrl}`;
|
|
37
36
|
|
|
38
|
-
// eslint-disable-next-line no-console
|
|
39
|
-
console.log("contentPageUrl: ", contentPageUrl);
|
|
40
|
-
|
|
41
37
|
const checkAndSetLinkTarget = elements =>
|
|
42
38
|
elements.map(el => {
|
|
43
39
|
let newElement = { ...el };
|
|
@@ -70,7 +66,7 @@ module.exports.affiliateLinksValidation = (children, articleDataFromRender) => {
|
|
|
70
66
|
attributes: {
|
|
71
67
|
...attributes,
|
|
72
68
|
target: "_blank",
|
|
73
|
-
url:
|
|
69
|
+
url: wrapAffiliateLink(href, contentPageUrl)
|
|
74
70
|
}
|
|
75
71
|
};
|
|
76
72
|
} else {
|
|
@@ -79,7 +75,7 @@ module.exports.affiliateLinksValidation = (children, articleDataFromRender) => {
|
|
|
79
75
|
attributes: {
|
|
80
76
|
...attributes,
|
|
81
77
|
target: "_blank",
|
|
82
|
-
href:
|
|
78
|
+
href: wrapAffiliateLink(href, contentPageUrl)
|
|
83
79
|
}
|
|
84
80
|
};
|
|
85
81
|
}
|