@mjhls/mjh-framework 1.0.1029 → 1.0.1030-disable-native-test
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/cjs/View.js +52 -8
- package/dist/esm/View.js +52 -8
- package/package.json +1 -1
package/dist/cjs/View.js
CHANGED
|
@@ -1087,19 +1087,19 @@ var Article = React__default["default"].memo(React.forwardRef(function (props, r
|
|
|
1087
1087
|
}
|
|
1088
1088
|
|
|
1089
1089
|
// If sponsored flag, disable contextual ads
|
|
1090
|
-
if (sponsoredFlag) {
|
|
1090
|
+
if (sponsoredFlag || article.disableNativeAds) {
|
|
1091
1091
|
article.contextualVideoAD = false;
|
|
1092
1092
|
article.contextualAD = false;
|
|
1093
|
-
showRelatedArticles = false;
|
|
1094
1093
|
}
|
|
1095
|
-
|
|
1094
|
+
|
|
1095
|
+
if (article.disableRelatedContent || sponsoredFlag) {
|
|
1096
1096
|
showRelatedArticles = false;
|
|
1097
1097
|
}
|
|
1098
1098
|
// This was being done in ArticleQueue2 which wasnt effecting articles excluded from infinite scroll, moved inside article component
|
|
1099
1099
|
if (!sponsoredFlag && Ads.getVideoContextualAD) {
|
|
1100
1100
|
article.contextualVideoAD = Ads.getVideoContextualAD(getTargeting.getTargeting(props, 'in-context_video'));
|
|
1101
1101
|
}
|
|
1102
|
-
if (!sponsoredFlag && Ads.getNativeContextualAD) {
|
|
1102
|
+
if (!sponsoredFlag && Ads.getNativeContextualAD && !article.disableNativeAds) {
|
|
1103
1103
|
article.contextualAD = Ads.getNativeContextualAD(getTargeting.getTargeting(props, 'native-ad'));
|
|
1104
1104
|
}
|
|
1105
1105
|
|
|
@@ -1751,7 +1751,8 @@ var Article = React__default["default"].memo(React.forwardRef(function (props, r
|
|
|
1751
1751
|
),
|
|
1752
1752
|
React__default["default"].createElement(
|
|
1753
1753
|
'div',
|
|
1754
|
-
{
|
|
1754
|
+
{
|
|
1755
|
+
className: 'mb-3 doc-group-container',
|
|
1755
1756
|
style: {
|
|
1756
1757
|
display: 'flex',
|
|
1757
1758
|
justifyContent: 'space-between',
|
|
@@ -2490,7 +2491,11 @@ var View = function View(props) {
|
|
|
2490
2491
|
),
|
|
2491
2492
|
metaDescriptionSanity ? React__default["default"].createElement('meta', { name: 'description', key: 'description', content: metaDescriptionSanity }) : meta_description && React__default["default"].createElement('meta', { name: 'description', key: 'description', content: meta_description }),
|
|
2492
2493
|
React__default["default"].createElement('meta', { name: 'keywords', content: getKeywords(article).join(','), key: 'keywords' }),
|
|
2493
|
-
|
|
2494
|
+
passwordLock && React__default["default"].createElement('meta', { name: 'robots', content: 'noindex, nofollow' }),
|
|
2495
|
+
!passwordLock && (article.applyNoIndexTag || article.applyNoFollowTag) && React__default["default"].createElement('meta', {
|
|
2496
|
+
name: 'robots',
|
|
2497
|
+
content: article.applyNoIndexTag && article.applyNoFollowTag ? 'noindex, nofollow' : article.applyNoIndexTag && !article.applyNoFollowTag ? 'noindex' : 'nofollow'
|
|
2498
|
+
}),
|
|
2494
2499
|
React__default["default"].createElement('meta', {
|
|
2495
2500
|
property: 'og:url',
|
|
2496
2501
|
content: seriesShareOptions && seriesShareOptions.seriesUrl ? shareOptions.shareUrl + seriesShareOptions.seriesUrl : shareOptions.shareUrl,
|
|
@@ -2533,7 +2538,16 @@ var View = function View(props) {
|
|
|
2533
2538
|
props.article.seriesDetail && props.article.seriesDetail.nextUrl && React__default["default"].createElement('link', { rel: 'next', href: props.article.seriesDetail.nextUrl })
|
|
2534
2539
|
)
|
|
2535
2540
|
),
|
|
2536
|
-
!needInfiniteScroll ? React__default["default"].createElement(Article, _extends._extends({
|
|
2541
|
+
!needInfiniteScroll ? React__default["default"].createElement(Article, _extends._extends({
|
|
2542
|
+
infiniteScroll: false,
|
|
2543
|
+
showRelatedArticles: showRelatedArticles,
|
|
2544
|
+
showDisqus: showDisqus,
|
|
2545
|
+
emailList: emailList,
|
|
2546
|
+
articleRecs: articleRecs
|
|
2547
|
+
}, props, {
|
|
2548
|
+
showIssueNameOnly: article.issueGroup && article.issueGroup.parent ? article.issueGroup.parent.showIssueNameOnly : null,
|
|
2549
|
+
showPageNumber: article.issueGroup && article.issueGroup.parent ? article.issueGroup.parent.showPageNumber : null
|
|
2550
|
+
})) : React__default["default"].createElement(ArticleQueue, _extends._extends({
|
|
2537
2551
|
infiniteScroll: true,
|
|
2538
2552
|
showRelatedArticles: showRelatedArticles,
|
|
2539
2553
|
canonicalTag: canonicalTag,
|
|
@@ -2647,6 +2661,9 @@ View.returnGetInitialProps = function () {
|
|
|
2647
2661
|
if (x.applyNoIndexTag) {
|
|
2648
2662
|
article.applyNoIndexTag = true;
|
|
2649
2663
|
}
|
|
2664
|
+
if (x.applyNoFollowTag) {
|
|
2665
|
+
article.applyNoFollowTag = true;
|
|
2666
|
+
}
|
|
2650
2667
|
});
|
|
2651
2668
|
}
|
|
2652
2669
|
// check for disableAds flag on content category
|
|
@@ -2676,6 +2693,33 @@ View.returnGetInitialProps = function () {
|
|
|
2676
2693
|
article.relatedArticle = _context.sent;
|
|
2677
2694
|
|
|
2678
2695
|
case 35:
|
|
2696
|
+
|
|
2697
|
+
//check documentGroup and documentGroupMapping for disableNativeAds:true
|
|
2698
|
+
if (article.documentGroup && article.documentGroup.length) {
|
|
2699
|
+
article.documentGroup.forEach(function (docGroup) {
|
|
2700
|
+
var node = docGroup.parent ? docGroup.parent : null;
|
|
2701
|
+
if (docGroup.disableNativeAds) {
|
|
2702
|
+
article.disableNativeAds = true;
|
|
2703
|
+
}
|
|
2704
|
+
while (node) {
|
|
2705
|
+
if (node.disableNativeAds) [article.disableNativeAds = true];
|
|
2706
|
+
node = node.parent || null;
|
|
2707
|
+
}
|
|
2708
|
+
});
|
|
2709
|
+
}
|
|
2710
|
+
if (article.documentGroupMapping && article.documentGroupMapping.length) {
|
|
2711
|
+
article.documentGroupMapping.forEach(function (docGroup) {
|
|
2712
|
+
var node = docGroup.parent ? docGroup.parent : null;
|
|
2713
|
+
if (docGroup.disableNativeAds) {
|
|
2714
|
+
article.disableNativeAds = true;
|
|
2715
|
+
}
|
|
2716
|
+
while (node) {
|
|
2717
|
+
if (node.disableNativeAds) [article.disableNativeAds = true];
|
|
2718
|
+
node = node.parent || null;
|
|
2719
|
+
}
|
|
2720
|
+
});
|
|
2721
|
+
}
|
|
2722
|
+
|
|
2679
2723
|
return _context.abrupt('return', {
|
|
2680
2724
|
url: url,
|
|
2681
2725
|
sao: sao,
|
|
@@ -2687,7 +2731,7 @@ View.returnGetInitialProps = function () {
|
|
|
2687
2731
|
sponsoredFlag: sponsoredFlag
|
|
2688
2732
|
});
|
|
2689
2733
|
|
|
2690
|
-
case
|
|
2734
|
+
case 38:
|
|
2691
2735
|
case 'end':
|
|
2692
2736
|
return _context.stop();
|
|
2693
2737
|
}
|
package/dist/esm/View.js
CHANGED
|
@@ -1077,19 +1077,19 @@ var Article = React__default.memo(forwardRef(function (props, ref) {
|
|
|
1077
1077
|
}
|
|
1078
1078
|
|
|
1079
1079
|
// If sponsored flag, disable contextual ads
|
|
1080
|
-
if (sponsoredFlag) {
|
|
1080
|
+
if (sponsoredFlag || article.disableNativeAds) {
|
|
1081
1081
|
article.contextualVideoAD = false;
|
|
1082
1082
|
article.contextualAD = false;
|
|
1083
|
-
showRelatedArticles = false;
|
|
1084
1083
|
}
|
|
1085
|
-
|
|
1084
|
+
|
|
1085
|
+
if (article.disableRelatedContent || sponsoredFlag) {
|
|
1086
1086
|
showRelatedArticles = false;
|
|
1087
1087
|
}
|
|
1088
1088
|
// This was being done in ArticleQueue2 which wasnt effecting articles excluded from infinite scroll, moved inside article component
|
|
1089
1089
|
if (!sponsoredFlag && Ads.getVideoContextualAD) {
|
|
1090
1090
|
article.contextualVideoAD = Ads.getVideoContextualAD(getTargeting(props, 'in-context_video'));
|
|
1091
1091
|
}
|
|
1092
|
-
if (!sponsoredFlag && Ads.getNativeContextualAD) {
|
|
1092
|
+
if (!sponsoredFlag && Ads.getNativeContextualAD && !article.disableNativeAds) {
|
|
1093
1093
|
article.contextualAD = Ads.getNativeContextualAD(getTargeting(props, 'native-ad'));
|
|
1094
1094
|
}
|
|
1095
1095
|
|
|
@@ -1741,7 +1741,8 @@ var Article = React__default.memo(forwardRef(function (props, ref) {
|
|
|
1741
1741
|
),
|
|
1742
1742
|
React__default.createElement(
|
|
1743
1743
|
'div',
|
|
1744
|
-
{
|
|
1744
|
+
{
|
|
1745
|
+
className: 'mb-3 doc-group-container',
|
|
1745
1746
|
style: {
|
|
1746
1747
|
display: 'flex',
|
|
1747
1748
|
justifyContent: 'space-between',
|
|
@@ -2480,7 +2481,11 @@ var View = function View(props) {
|
|
|
2480
2481
|
),
|
|
2481
2482
|
metaDescriptionSanity ? React__default.createElement('meta', { name: 'description', key: 'description', content: metaDescriptionSanity }) : meta_description && React__default.createElement('meta', { name: 'description', key: 'description', content: meta_description }),
|
|
2482
2483
|
React__default.createElement('meta', { name: 'keywords', content: getKeywords(article).join(','), key: 'keywords' }),
|
|
2483
|
-
|
|
2484
|
+
passwordLock && React__default.createElement('meta', { name: 'robots', content: 'noindex, nofollow' }),
|
|
2485
|
+
!passwordLock && (article.applyNoIndexTag || article.applyNoFollowTag) && React__default.createElement('meta', {
|
|
2486
|
+
name: 'robots',
|
|
2487
|
+
content: article.applyNoIndexTag && article.applyNoFollowTag ? 'noindex, nofollow' : article.applyNoIndexTag && !article.applyNoFollowTag ? 'noindex' : 'nofollow'
|
|
2488
|
+
}),
|
|
2484
2489
|
React__default.createElement('meta', {
|
|
2485
2490
|
property: 'og:url',
|
|
2486
2491
|
content: seriesShareOptions && seriesShareOptions.seriesUrl ? shareOptions.shareUrl + seriesShareOptions.seriesUrl : shareOptions.shareUrl,
|
|
@@ -2523,7 +2528,16 @@ var View = function View(props) {
|
|
|
2523
2528
|
props.article.seriesDetail && props.article.seriesDetail.nextUrl && React__default.createElement('link', { rel: 'next', href: props.article.seriesDetail.nextUrl })
|
|
2524
2529
|
)
|
|
2525
2530
|
),
|
|
2526
|
-
!needInfiniteScroll ? React__default.createElement(Article, _extends({
|
|
2531
|
+
!needInfiniteScroll ? React__default.createElement(Article, _extends({
|
|
2532
|
+
infiniteScroll: false,
|
|
2533
|
+
showRelatedArticles: showRelatedArticles,
|
|
2534
|
+
showDisqus: showDisqus,
|
|
2535
|
+
emailList: emailList,
|
|
2536
|
+
articleRecs: articleRecs
|
|
2537
|
+
}, props, {
|
|
2538
|
+
showIssueNameOnly: article.issueGroup && article.issueGroup.parent ? article.issueGroup.parent.showIssueNameOnly : null,
|
|
2539
|
+
showPageNumber: article.issueGroup && article.issueGroup.parent ? article.issueGroup.parent.showPageNumber : null
|
|
2540
|
+
})) : React__default.createElement(ArticleQueue, _extends({
|
|
2527
2541
|
infiniteScroll: true,
|
|
2528
2542
|
showRelatedArticles: showRelatedArticles,
|
|
2529
2543
|
canonicalTag: canonicalTag,
|
|
@@ -2637,6 +2651,9 @@ View.returnGetInitialProps = function () {
|
|
|
2637
2651
|
if (x.applyNoIndexTag) {
|
|
2638
2652
|
article.applyNoIndexTag = true;
|
|
2639
2653
|
}
|
|
2654
|
+
if (x.applyNoFollowTag) {
|
|
2655
|
+
article.applyNoFollowTag = true;
|
|
2656
|
+
}
|
|
2640
2657
|
});
|
|
2641
2658
|
}
|
|
2642
2659
|
// check for disableAds flag on content category
|
|
@@ -2666,6 +2683,33 @@ View.returnGetInitialProps = function () {
|
|
|
2666
2683
|
article.relatedArticle = _context.sent;
|
|
2667
2684
|
|
|
2668
2685
|
case 35:
|
|
2686
|
+
|
|
2687
|
+
//check documentGroup and documentGroupMapping for disableNativeAds:true
|
|
2688
|
+
if (article.documentGroup && article.documentGroup.length) {
|
|
2689
|
+
article.documentGroup.forEach(function (docGroup) {
|
|
2690
|
+
var node = docGroup.parent ? docGroup.parent : null;
|
|
2691
|
+
if (docGroup.disableNativeAds) {
|
|
2692
|
+
article.disableNativeAds = true;
|
|
2693
|
+
}
|
|
2694
|
+
while (node) {
|
|
2695
|
+
if (node.disableNativeAds) [article.disableNativeAds = true];
|
|
2696
|
+
node = node.parent || null;
|
|
2697
|
+
}
|
|
2698
|
+
});
|
|
2699
|
+
}
|
|
2700
|
+
if (article.documentGroupMapping && article.documentGroupMapping.length) {
|
|
2701
|
+
article.documentGroupMapping.forEach(function (docGroup) {
|
|
2702
|
+
var node = docGroup.parent ? docGroup.parent : null;
|
|
2703
|
+
if (docGroup.disableNativeAds) {
|
|
2704
|
+
article.disableNativeAds = true;
|
|
2705
|
+
}
|
|
2706
|
+
while (node) {
|
|
2707
|
+
if (node.disableNativeAds) [article.disableNativeAds = true];
|
|
2708
|
+
node = node.parent || null;
|
|
2709
|
+
}
|
|
2710
|
+
});
|
|
2711
|
+
}
|
|
2712
|
+
|
|
2669
2713
|
return _context.abrupt('return', {
|
|
2670
2714
|
url: url,
|
|
2671
2715
|
sao: sao,
|
|
@@ -2677,7 +2721,7 @@ View.returnGetInitialProps = function () {
|
|
|
2677
2721
|
sponsoredFlag: sponsoredFlag
|
|
2678
2722
|
});
|
|
2679
2723
|
|
|
2680
|
-
case
|
|
2724
|
+
case 38:
|
|
2681
2725
|
case 'end':
|
|
2682
2726
|
return _context.stop();
|
|
2683
2727
|
}
|