@mjhls/mjh-framework 1.0.977-docgroup-test-v3 → 1.0.977
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 +25 -92
- package/dist/cjs/getQuery.js +1 -1
- package/dist/esm/View.js +25 -92
- package/dist/esm/getQuery.js +1 -1
- package/package.json +1 -1
package/dist/cjs/View.js
CHANGED
|
@@ -160,30 +160,16 @@ var DocumentGroup = function DocumentGroup(_ref) {
|
|
|
160
160
|
var article = _ref.article,
|
|
161
161
|
client = _ref.client;
|
|
162
162
|
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
if (article.documentGroup && article.documentGroup.isShow !== false && article.documentGroup.isSeries !== true) {
|
|
166
|
-
mediaSeriesGroup = article.documentGroup;
|
|
167
|
-
}
|
|
168
|
-
if (!article.documentGroup && article.documentGroupMapping) {
|
|
169
|
-
for (var i = 0; i < documentGroupMapping.length; i++) {
|
|
170
|
-
if (article.documentGroupMapping[i].isShow !== false && article.documentGroupMapping[i].isSeries !== true) {
|
|
171
|
-
mediaSeriesGroup = article.documentGroupMapping[i];
|
|
172
|
-
break;
|
|
173
|
-
}
|
|
174
|
-
}
|
|
175
|
-
}
|
|
176
|
-
|
|
177
|
-
if (!mediaSeriesGroup) {
|
|
163
|
+
if (!article.documentGroup || article.documentGroup.isShow === false || article.documentGroup.isSeries) {
|
|
178
164
|
return null;
|
|
179
165
|
}
|
|
180
166
|
|
|
181
|
-
var name = getDocumentGroupName(
|
|
182
|
-
var url = getDocumentGroupUrl(
|
|
167
|
+
var name = getDocumentGroupName(article.documentGroup);
|
|
168
|
+
var url = getDocumentGroupUrl(article.documentGroup);
|
|
183
169
|
var thumbnailUrl = false;
|
|
184
170
|
|
|
185
|
-
if (
|
|
186
|
-
thumbnailUrl = urlFor({ client: client, source:
|
|
171
|
+
if (article.documentGroup.thumbnail) {
|
|
172
|
+
thumbnailUrl = urlFor({ client: client, source: article.documentGroup.thumbnail });
|
|
187
173
|
}
|
|
188
174
|
|
|
189
175
|
return React__default['default'].createElement(
|
|
@@ -858,17 +844,6 @@ var RelevantTopics = function RelevantTopics(props) {
|
|
|
858
844
|
return null;
|
|
859
845
|
};
|
|
860
846
|
|
|
861
|
-
var checkDocGroupMappingForSeries = function checkDocGroupMappingForSeries(docGroupArray) {
|
|
862
|
-
|
|
863
|
-
for (var i = 0; i < docGroupArray.length; i++) {
|
|
864
|
-
if (docGroupArray[i].isSeries) {
|
|
865
|
-
return docGroupArray[i];
|
|
866
|
-
}
|
|
867
|
-
}
|
|
868
|
-
|
|
869
|
-
return false;
|
|
870
|
-
};
|
|
871
|
-
|
|
872
847
|
var Article = React__default['default'].memo(React.forwardRef(function (props, ref) {
|
|
873
848
|
var onVote = function () {
|
|
874
849
|
var _ref = asyncToGenerator._asyncToGenerator( /*#__PURE__*/asyncToGenerator.regenerator.mark(function _callee(nodeKey, selectedChoice) {
|
|
@@ -998,7 +973,6 @@ var Article = React__default['default'].memo(React.forwardRef(function (props, r
|
|
|
998
973
|
if (article && article.documentGroup && article.documentGroup.hideSeriesSlider === true) {
|
|
999
974
|
sliderData = null;
|
|
1000
975
|
}
|
|
1001
|
-
|
|
1002
976
|
//next video url
|
|
1003
977
|
if (sliderData) {
|
|
1004
978
|
var nextArticle = void 0;
|
|
@@ -1316,13 +1290,7 @@ var Article = React__default['default'].memo(React.forwardRef(function (props, r
|
|
|
1316
1290
|
|
|
1317
1291
|
var indexes = findIndex(body);
|
|
1318
1292
|
var seriesInfo = checkIfMediaSeriesHasVideo(article);
|
|
1319
|
-
var isMediaSeries = false;
|
|
1320
|
-
if (article.documentGroup && article.documentGroup.isSeries) {
|
|
1321
|
-
isMediaSeries = true;
|
|
1322
|
-
} else if (!article.documentGroup && article.documentGroupMapping && checkDocGroupMappingForSeries(article.documentGroupMapping)) {
|
|
1323
|
-
isMediaSeries = true;
|
|
1324
|
-
}
|
|
1325
|
-
|
|
1293
|
+
var isMediaSeries = article.documentGroup && article.documentGroup.isSeries ? true : false;
|
|
1326
1294
|
if (indexes.length >= 2 && body.length > 3 && payload.contextualAD && payload.contextualVideoAD) {
|
|
1327
1295
|
payload = _extends._extends({}, payload, {
|
|
1328
1296
|
contextualAD: _extends._extends({}, payload.contextualAD, {
|
|
@@ -1357,7 +1325,7 @@ var Article = React__default['default'].memo(React.forwardRef(function (props, r
|
|
|
1357
1325
|
imageOptions: { w: 320, h: 240, fit: 'max' }
|
|
1358
1326
|
}, client.config())),
|
|
1359
1327
|
React__default['default'].createElement('span', { className: 'clearfix' }),
|
|
1360
|
-
|
|
1328
|
+
article.documentGroup && article.documentGroup.isSeries && sliderData && seriesInfo.hasVideo && React__default['default'].createElement(SeriesSlider.SeriesSlider, { dataset: sliderData, client: client, nowPlaying: article.title, displayEpisodeNumber: logicforDisplayingEpisodeNumber }),
|
|
1361
1329
|
React__default['default'].createElement(
|
|
1362
1330
|
'div',
|
|
1363
1331
|
{ id: 'contextual-native-ad-' + payload._id, className: 'contextual-native-ad' },
|
|
@@ -1408,7 +1376,7 @@ var Article = React__default['default'].memo(React.forwardRef(function (props, r
|
|
|
1408
1376
|
imageOptions: { w: 320, h: 240, fit: 'max' }
|
|
1409
1377
|
}, client.config())),
|
|
1410
1378
|
contextualADFlag && React__default['default'].createElement('span', { className: 'clearfix' }),
|
|
1411
|
-
|
|
1379
|
+
article.documentGroup && article.documentGroup.isSeries && sliderData && seriesInfo.hasVideo && React__default['default'].createElement(SeriesSlider.SeriesSlider, { dataset: sliderData, client: client, nowPlaying: article.title, displayEpisodeNumber: logicforDisplayingEpisodeNumber }),
|
|
1412
1380
|
(visibleFlag || queueData && queueData.length === 1 || !props.infiniteScroll) && React__default['default'].createElement(
|
|
1413
1381
|
React__default['default'].Fragment,
|
|
1414
1382
|
null,
|
|
@@ -1463,7 +1431,7 @@ var Article = React__default['default'].memo(React.forwardRef(function (props, r
|
|
|
1463
1431
|
imageOptions: { w: 320, h: 240, fit: 'max' }
|
|
1464
1432
|
}, client.config())),
|
|
1465
1433
|
React__default['default'].createElement('span', { className: 'clearfix' }),
|
|
1466
|
-
|
|
1434
|
+
article.documentGroup && article.documentGroup.isSeries && sliderData && seriesInfo.hasVideo && React__default['default'].createElement(SeriesSlider.SeriesSlider, { dataset: sliderData, client: client, nowPlaying: article.title, displayEpisodeNumber: logicforDisplayingEpisodeNumber }),
|
|
1467
1435
|
React__default['default'].createElement(
|
|
1468
1436
|
'div',
|
|
1469
1437
|
{ id: 'contextual-video-ad-' + payload._id, className: 'contextual-video-ad' },
|
|
@@ -1489,7 +1457,7 @@ var Article = React__default['default'].memo(React.forwardRef(function (props, r
|
|
|
1489
1457
|
blocks: article.documentGroup && article.documentGroup.isSeries ? [].concat(toConsumableArray._toConsumableArray(articleBody.slice(0, _selectedIndex3))) : articleBody,
|
|
1490
1458
|
imageOptions: { w: 320, h: 240, fit: 'max' }
|
|
1491
1459
|
}, client.config())),
|
|
1492
|
-
|
|
1460
|
+
article.documentGroup && article.documentGroup.isSeries && sliderData && seriesInfo.hasVideo && React__default['default'].createElement(SeriesSlider.SeriesSlider, { dataset: sliderData, client: client, nowPlaying: article.title, displayEpisodeNumber: logicforDisplayingEpisodeNumber }),
|
|
1493
1461
|
article.documentGroup && article.documentGroup.isSeries && React__default['default'].createElement(BlockContent.BlockContent, _extends._extends({
|
|
1494
1462
|
serializers: getSerializers.getSerializers(client, pageview, videoAccountIDs, onVote, true, drupalLeadSettings, currentPage, isMediaSeries, null, null, article.Ads, targeting, article, meta, authorPrefix, authorImgHeight, audioAutoplay),
|
|
1495
1463
|
blocks: [].concat(toConsumableArray._toConsumableArray(articleBody.slice(_selectedIndex3))),
|
|
@@ -1586,20 +1554,10 @@ var Article = React__default['default'].memo(React.forwardRef(function (props, r
|
|
|
1586
1554
|
var triggerOffset = 20;
|
|
1587
1555
|
var isVideoSeries = checkIfVideoSeries(article);
|
|
1588
1556
|
var episodeNumber = fetchCurrentEpisode(sliderData, props.article);
|
|
1589
|
-
var isMediaSeries = false;
|
|
1590
|
-
var mediaSeriesName = '';
|
|
1557
|
+
var isMediaSeries = article.documentGroup && article.documentGroup.isSeries ? true : false;
|
|
1591
1558
|
var seriesInfo = checkIfMediaSeriesHasVideo(article);
|
|
1592
1559
|
var isFormAssembly = checkIfFormAssembly(article);
|
|
1593
1560
|
|
|
1594
|
-
if (article.documentGroup && article.documentGroup.isSeries) {
|
|
1595
|
-
isMediaSeries = true;
|
|
1596
|
-
mediaSeriesName = article.documentGroup.name;
|
|
1597
|
-
}
|
|
1598
|
-
if (!article.documentGroup && article.documentGroupMapping && checkDocGroupMappingForSeries(article.documentGroupMapping)) {
|
|
1599
|
-
isMediaSeries = true;
|
|
1600
|
-
mediaSeriesName = checkDocGroupMappingForSeries(article.documentGroupMapping).name;
|
|
1601
|
-
}
|
|
1602
|
-
|
|
1603
1561
|
return React__default['default'].createElement(
|
|
1604
1562
|
React__default['default'].Fragment,
|
|
1605
1563
|
null,
|
|
@@ -1633,10 +1591,10 @@ var Article = React__default['default'].memo(React.forwardRef(function (props, r
|
|
|
1633
1591
|
!isVideoSeries && React__default['default'].createElement(
|
|
1634
1592
|
'div',
|
|
1635
1593
|
null,
|
|
1636
|
-
isMediaSeries && React__default['default'].createElement(
|
|
1594
|
+
isMediaSeries && article.documentGroup && article.documentGroup.name && React__default['default'].createElement(
|
|
1637
1595
|
'p',
|
|
1638
1596
|
{ style: { fontSize: '14px' } },
|
|
1639
|
-
disableEpisodeNumber ? '' +
|
|
1597
|
+
disableEpisodeNumber ? '' + article.documentGroup.name : article.documentGroup.name + ' - Episode ' + episodeNumber
|
|
1640
1598
|
),
|
|
1641
1599
|
React__default['default'].createElement(
|
|
1642
1600
|
'h1',
|
|
@@ -2286,21 +2244,12 @@ var View = function View(props) {
|
|
|
2286
2244
|
return false;
|
|
2287
2245
|
};
|
|
2288
2246
|
|
|
2289
|
-
var isMediaSeries = false;
|
|
2290
|
-
|
|
2291
|
-
if (article.documentGroup && article.documentGroup.isSeries) {
|
|
2292
|
-
isMediaSeries = true;
|
|
2293
|
-
}
|
|
2294
|
-
if (!article.documentGroup && article.documentGroupMapping && checkDocGroupMappingForSeries(article.documentGroupMapping)) {
|
|
2295
|
-
isMediaSeries = true;
|
|
2296
|
-
}
|
|
2297
|
-
|
|
2298
2247
|
var disableInfiniteScroll = checkBodyForDisableInfiniteScroll(props.article);
|
|
2299
2248
|
var commentsEnabledInTaxonomy = Array.isArray(content_placement) && content_placement.some(function (t) {
|
|
2300
2249
|
return t.showComments === true;
|
|
2301
2250
|
});
|
|
2302
2251
|
var showDisqus = commentsEnabledInTaxonomy || hideComments === false;
|
|
2303
|
-
var needInfiniteScroll = ['Articles', 'Videos', 'Podcasts'].includes(article.category.name) && article.taxonomyMapping && article.passwordLock !== true && !disableInfiniteScroll && !article.ExcludeFromInfiniteScroll && !sponsoredFlag && infiniteScrollFlag && !article.showIsi && !
|
|
2252
|
+
var needInfiniteScroll = ['Articles', 'Videos', 'Podcasts'].includes(article.category.name) && article.taxonomyMapping && article.passwordLock !== true && !disableInfiniteScroll && !article.ExcludeFromInfiniteScroll && !sponsoredFlag && infiniteScrollFlag && !article.showIsi && (!article.documentGroup || !article.documentGroup.isSeries) && !showDisqus;
|
|
2304
2253
|
|
|
2305
2254
|
if (['Articles', 'Videos', 'Podcasts'].includes(article.category.name)) {
|
|
2306
2255
|
title = null;
|
|
@@ -2419,7 +2368,7 @@ View.returnGetInitialProps = function () {
|
|
|
2419
2368
|
var _ref = asyncToGenerator._asyncToGenerator( /*#__PURE__*/asyncToGenerator.regenerator.mark(function _callee(url, prevUrl, seriesVid, client, sao) {
|
|
2420
2369
|
var context = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : null;
|
|
2421
2370
|
|
|
2422
|
-
var article, relatedArticleQuery, sliderData, statusCode, sliderArticles,
|
|
2371
|
+
var article, relatedArticleQuery, sliderData, statusCode, sliderArticles, _context$query$series, seriesArticle, sponsoredFlag;
|
|
2423
2372
|
|
|
2424
2373
|
return asyncToGenerator.regenerator.wrap(function _callee$(_context) {
|
|
2425
2374
|
while (1) {
|
|
@@ -2441,7 +2390,7 @@ View.returnGetInitialProps = function () {
|
|
|
2441
2390
|
}
|
|
2442
2391
|
|
|
2443
2392
|
if (!(article.documentGroup && article.documentGroup.isSeries)) {
|
|
2444
|
-
_context.next =
|
|
2393
|
+
_context.next = 13;
|
|
2445
2394
|
break;
|
|
2446
2395
|
}
|
|
2447
2396
|
|
|
@@ -2452,24 +2401,8 @@ View.returnGetInitialProps = function () {
|
|
|
2452
2401
|
sliderArticles = _context.sent;
|
|
2453
2402
|
|
|
2454
2403
|
sliderData = sliderArticles;
|
|
2455
|
-
_context.next = 20;
|
|
2456
|
-
break;
|
|
2457
|
-
|
|
2458
|
-
case 15:
|
|
2459
|
-
if (!(article.documentGroupMapping && article.documentGroupMapping[0] && article.documentGroupMapping[0].isSeries)) {
|
|
2460
|
-
_context.next = 20;
|
|
2461
|
-
break;
|
|
2462
|
-
}
|
|
2463
|
-
|
|
2464
|
-
_context.next = 18;
|
|
2465
|
-
return client.fetch('*[!(_id in path("drafts.**")) \n && _type == "article"\n && defined(title)\n && references(\'' + article.documentGroupMapping[0]._id + '\')\n && is_visible == true\n && defined(published)\n && dateTime(published) <= dateTime(now())\n ] | order(published asc) {\n title,\n thumbnail,\n url,\n published\n }');
|
|
2466
|
-
|
|
2467
|
-
case 18:
|
|
2468
|
-
_sliderArticles = _context.sent;
|
|
2469
|
-
|
|
2470
|
-
sliderData = _sliderArticles;
|
|
2471
2404
|
|
|
2472
|
-
case
|
|
2405
|
+
case 13:
|
|
2473
2406
|
_context$query$series = context.query.seriesArticle, seriesArticle = _context$query$series === undefined ? false : _context$query$series;
|
|
2474
2407
|
|
|
2475
2408
|
if ((seriesArticle || seriesVid) && article.body) {
|
|
@@ -2518,27 +2451,27 @@ View.returnGetInitialProps = function () {
|
|
|
2518
2451
|
}
|
|
2519
2452
|
|
|
2520
2453
|
if (!article.disableRelatedContent) {
|
|
2521
|
-
_context.next =
|
|
2454
|
+
_context.next = 23;
|
|
2522
2455
|
break;
|
|
2523
2456
|
}
|
|
2524
2457
|
|
|
2525
2458
|
article.relatedArticle = null;
|
|
2526
|
-
_context.next =
|
|
2459
|
+
_context.next = 27;
|
|
2527
2460
|
break;
|
|
2528
2461
|
|
|
2529
|
-
case
|
|
2462
|
+
case 23:
|
|
2530
2463
|
if (!article) {
|
|
2531
|
-
_context.next =
|
|
2464
|
+
_context.next = 27;
|
|
2532
2465
|
break;
|
|
2533
2466
|
}
|
|
2534
2467
|
|
|
2535
|
-
_context.next =
|
|
2468
|
+
_context.next = 26;
|
|
2536
2469
|
return getRelatedArticle(context, client, article, prevUrl, '0..2');
|
|
2537
2470
|
|
|
2538
|
-
case
|
|
2471
|
+
case 26:
|
|
2539
2472
|
article.relatedArticle = _context.sent;
|
|
2540
2473
|
|
|
2541
|
-
case
|
|
2474
|
+
case 27:
|
|
2542
2475
|
return _context.abrupt('return', {
|
|
2543
2476
|
url: url,
|
|
2544
2477
|
sao: sao,
|
|
@@ -2550,7 +2483,7 @@ View.returnGetInitialProps = function () {
|
|
|
2550
2483
|
sponsoredFlag: sponsoredFlag
|
|
2551
2484
|
});
|
|
2552
2485
|
|
|
2553
|
-
case
|
|
2486
|
+
case 28:
|
|
2554
2487
|
case 'end':
|
|
2555
2488
|
return _context.stop();
|
|
2556
2489
|
}
|
package/dist/cjs/getQuery.js
CHANGED
|
@@ -13,7 +13,7 @@ var getQuery = function getQuery(type) {
|
|
|
13
13
|
case 'related':
|
|
14
14
|
return '*[\n _type == "article"\n && defined(title)\n && defined(url)\n && !(_id in path("drafts.**"))\n && is_visible == true\n && defined(published) \n && dateTime(published) <= dateTime(now())\n && passwordLock!=true\n && isHealthcareProfessional != true\n && taxonomyMapping[]._ref in $taxonomy\n && taxonomyMapping[].disableAds != \'true\'\n && contentCategory->.name != \'Poll\'\n && contentCategory->.name != \'Slideshows\'\n && contentCategory->.disableAds != \'true\'\n && ExcludeFromInfiniteScroll !=true\n && url.current != $url\n && !defined(body[].videos)\n && !defined(body[].quizzes)\n && !defined(body[].slides)\n && !defined(body[].articles)\n ' + conditions + '\n ]| order(published desc)[' + (articleCount ? articleCount : '$index') + ']{\n ' + params + '\n title,\n published,\n summary,\n thumbnail,\n fieldAbstract,\n ...,\n passwordLock,\n password,\n "authorDetails": authorMapping[]->{ displayName, url, profileImage, biography, showSocialShare },\n body[] {\n ...,\n asset->,\n images[]{\n ...,\n asset->\n },\n content[]{\n ...,\n asset->\n },\n videos[]{\n ...,\n thumbnail{\n _type,\n asset->\n }\n },\n response[]{\n ...,\n asset->\n },\n quizzes[]{\n ...,\n answer[]{\n ...,\n asset->\n },\n question[]{\n ...,\n asset->\n }\n },\n poster {\n _type,\n asset->\n },\n slides[]{\n ...,\n slideshowImage{\n ...,\n asset->\n }\n },\n upload_doc {\n _type,\n asset->\n },\n uploadAudio {\n _type,\n asset->\n }\n },\n \'category\':contentCategory->{\n name,\n disableAds\n },\n \'content_placement\': taxonomyMapping[]-> {\n _id,\n \'ancestor\': parent->parent->identifier,\n \'parent\': parent->identifier,\n \'name\': name,\n \'path\': identifier,\n disableAds,\n showSocialShare,\n pixelTrackingCode->\n },\n documentGroup-> {\n name,\n thumbnail,\n parent->{...,parent->},\n isShow,\n showSocialShare,\n \'path\': identifier.current,\n adTargetingURL,\n hideSeriesSlider,\n pixelTrackingCode->\n },\n documentGroupMapping[]-> {\n _id,\n name,\n thumbnail,\n parent->{...,parent->},\n isShow,\n showSocialShare,\n \'path\': identifier.current,\n adTargetingURL,\n hideSeriesSlider,\n pixelTrackingCode->\n },\n \'issue\' : *[_type == \'publication\' && !(_id in path("drafts.**")) && is_visible == true && _id == ^.issueGroup._ref][0] {\n name,\n \'path\': identifier.current,\n show_download_ris_button,\n \'publication\' : *[_type == \'publication\' && !(_id in path("drafts.**")) && is_visible == true && _id == ^.parent._ref][0] {\n name,\n \'path\': identifier.current,\n show_download_ris_button,\n },\n \'url\' : pdf.asset-> url,\n \'pdf\': pdf.asset->,\n isbn_issn,\n abbreviatedJournal,\n }\n }';
|
|
15
15
|
case 'article':
|
|
16
|
-
return '*[\n _type == "article"\n && !(_id in path("drafts.**"))\n && defined(title)\n && defined(url)\n && is_visible != false\n && url.current == $url\n ' + conditions + '\n ][0]{\n ' + params + '\n title,\n published,\n summary,\n thumbnail,\n fieldAbstract,\n ...,\n passwordLock,\n password,\n issueGroup-> { _id, name, identifier, parent-> },\n "authorDetails": authorMapping[]->{ displayName, url, profileImage, biography, showSocialShare },\n body[] {\n ...,\n asset->,\n images[]{\n ...,\n asset->\n },\n content[]{\n ...,\n asset->\n },\n videos[]{\n ...,\n thumbnail{\n _type,\n asset->\n }\n },\n response[]{\n ...,\n asset->\n },\n quizzes[]{\n ...,\n answer[]{\n ...,\n asset->\n },\n question[]{\n ...,\n asset->\n }\n },\n poster {\n _type,\n asset->\n },\n slides[]{\n ...,\n slideshowImage{\n ...,\n asset->\n }\n },\n upload_doc {\n _type,\n asset->\n },\n uploadAudio {\n _type,\n asset->\n },\n medias[]{\n ...,\n upload_doc {\n _type,\n asset-> \n },\n poster {\n _type,\n asset-> \n }\n },\n articles[]{\n ...,\n thumbnail{\n ...,\n asset-> \n },\n "authorDetails": authorMapping[]->{ displayName, url, profileImage, biography, showSocialShare },\n text[]{\n ...,\n upload_doc {\n _type,\n asset->\n },\n uploadAudio {\n _type,\n asset->\n },\n }\n }\n },\n \'content_placement\': taxonomyMapping[]-> {\n ...,\n \'ancestor\': parent->parent->identifier,\n \'parent\': parent->identifier,\n \'name\': name,\n \'path\': identifier,\n showSocialShare,\n pixelTrackingCode->\n },\n documentGroup-> {\n _id,\n name,\n thumbnail,\n parent->{...,parent->},\n isShow,\n isSeries,\n disableEpisodeNumber,\n excludeRelatedContents,\n showSocialShare,\n \'path\': identifier.current,\n adTargetingURL,\n hideSeriesSlider,\n pixelTrackingCode->\n },\n documentGroupMapping[]-> {\n _id,\n name,\n thumbnail,\n
|
|
16
|
+
return '*[\n _type == "article"\n && !(_id in path("drafts.**"))\n && defined(title)\n && defined(url)\n && is_visible != false\n && url.current == $url\n ' + conditions + '\n ][0]{\n ' + params + '\n title,\n published,\n summary,\n thumbnail,\n fieldAbstract,\n ...,\n passwordLock,\n password,\n issueGroup-> { _id, name, identifier, parent-> },\n "authorDetails": authorMapping[]->{ displayName, url, profileImage, biography, showSocialShare },\n body[] {\n ...,\n asset->,\n images[]{\n ...,\n asset->\n },\n content[]{\n ...,\n asset->\n },\n videos[]{\n ...,\n thumbnail{\n _type,\n asset->\n }\n },\n response[]{\n ...,\n asset->\n },\n quizzes[]{\n ...,\n answer[]{\n ...,\n asset->\n },\n question[]{\n ...,\n asset->\n }\n },\n poster {\n _type,\n asset->\n },\n slides[]{\n ...,\n slideshowImage{\n ...,\n asset->\n }\n },\n upload_doc {\n _type,\n asset->\n },\n uploadAudio {\n _type,\n asset->\n },\n medias[]{\n ...,\n upload_doc {\n _type,\n asset-> \n },\n poster {\n _type,\n asset-> \n }\n },\n articles[]{\n ...,\n thumbnail{\n ...,\n asset-> \n },\n "authorDetails": authorMapping[]->{ displayName, url, profileImage, biography, showSocialShare },\n text[]{\n ...,\n upload_doc {\n _type,\n asset->\n },\n uploadAudio {\n _type,\n asset->\n },\n }\n }\n },\n \'content_placement\': taxonomyMapping[]-> {\n ...,\n \'ancestor\': parent->parent->identifier,\n \'parent\': parent->identifier,\n \'name\': name,\n \'path\': identifier,\n showSocialShare,\n pixelTrackingCode->\n },\n documentGroup-> {\n _id,\n name,\n thumbnail,\n parent->{...,parent->},\n isShow,\n isSeries,\n disableEpisodeNumber,\n excludeRelatedContents,\n showSocialShare,\n \'path\': identifier.current,\n adTargetingURL,\n hideSeriesSlider,\n pixelTrackingCode->\n },\n documentGroupMapping[]-> {\n _id,\n name,\n thumbnail,\n parent->{...,parent->},\n isShow,\n showSocialShare,\n excludeRelatedContents,\n \'path\': identifier.current,\n hideSeriesSlider,\n pixelTrackingCode->\n },\n \'category\':contentCategory->{\n name,\n disableAds\n },\n \'issue\' : *[_type == \'publication\' && !(_id in path("drafts.**")) && is_visible == true && _id == ^.issueGroup._ref][0] {\n name,\n volume,\n year,\n \'issueNumber\': number,\n \'articleSource\': source,\n \'path\': identifier.current,\n show_download_ris_button,\n \'publication\' : *[_type == \'publication\' && !(_id in path("drafts.**")) && is_visible == true && _id == ^.parent._ref][0] {\n name,\n \'path\': identifier.current,\n show_download_ris_button,\n },\n \'url\' : pdf.asset-> url,\n \'pdf\': pdf.asset->,\n isbn_issn,\n abbreviatedJournal,\n }\n\n }';
|
|
17
17
|
case 'publication':
|
|
18
18
|
return '*[_type == \'publication\'\n && identifier.current == $publication\n ' + conditions + '][0] {\n ' + params + '\n ...,\n \'issues\': *[_type == \'publication\'\n && is_visible\n && references(^._id)\n && defined(identifier)] {\n ...,\n thumbnail{ ..., asset-> },\n taxonomyMapping[]->,\n pdf{asset->},\n } | order(year desc, month desc)\n }';
|
|
19
19
|
case 'issue':
|
package/dist/esm/View.js
CHANGED
|
@@ -149,30 +149,16 @@ var DocumentGroup = function DocumentGroup(_ref) {
|
|
|
149
149
|
var article = _ref.article,
|
|
150
150
|
client = _ref.client;
|
|
151
151
|
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
if (article.documentGroup && article.documentGroup.isShow !== false && article.documentGroup.isSeries !== true) {
|
|
155
|
-
mediaSeriesGroup = article.documentGroup;
|
|
156
|
-
}
|
|
157
|
-
if (!article.documentGroup && article.documentGroupMapping) {
|
|
158
|
-
for (var i = 0; i < documentGroupMapping.length; i++) {
|
|
159
|
-
if (article.documentGroupMapping[i].isShow !== false && article.documentGroupMapping[i].isSeries !== true) {
|
|
160
|
-
mediaSeriesGroup = article.documentGroupMapping[i];
|
|
161
|
-
break;
|
|
162
|
-
}
|
|
163
|
-
}
|
|
164
|
-
}
|
|
165
|
-
|
|
166
|
-
if (!mediaSeriesGroup) {
|
|
152
|
+
if (!article.documentGroup || article.documentGroup.isShow === false || article.documentGroup.isSeries) {
|
|
167
153
|
return null;
|
|
168
154
|
}
|
|
169
155
|
|
|
170
|
-
var name = getDocumentGroupName(
|
|
171
|
-
var url = getDocumentGroupUrl(
|
|
156
|
+
var name = getDocumentGroupName(article.documentGroup);
|
|
157
|
+
var url = getDocumentGroupUrl(article.documentGroup);
|
|
172
158
|
var thumbnailUrl = false;
|
|
173
159
|
|
|
174
|
-
if (
|
|
175
|
-
thumbnailUrl = urlFor({ client: client, source:
|
|
160
|
+
if (article.documentGroup.thumbnail) {
|
|
161
|
+
thumbnailUrl = urlFor({ client: client, source: article.documentGroup.thumbnail });
|
|
176
162
|
}
|
|
177
163
|
|
|
178
164
|
return React__default.createElement(
|
|
@@ -847,17 +833,6 @@ var RelevantTopics = function RelevantTopics(props) {
|
|
|
847
833
|
return null;
|
|
848
834
|
};
|
|
849
835
|
|
|
850
|
-
var checkDocGroupMappingForSeries = function checkDocGroupMappingForSeries(docGroupArray) {
|
|
851
|
-
|
|
852
|
-
for (var i = 0; i < docGroupArray.length; i++) {
|
|
853
|
-
if (docGroupArray[i].isSeries) {
|
|
854
|
-
return docGroupArray[i];
|
|
855
|
-
}
|
|
856
|
-
}
|
|
857
|
-
|
|
858
|
-
return false;
|
|
859
|
-
};
|
|
860
|
-
|
|
861
836
|
var Article = React__default.memo(forwardRef(function (props, ref) {
|
|
862
837
|
var onVote = function () {
|
|
863
838
|
var _ref = _asyncToGenerator( /*#__PURE__*/regenerator.mark(function _callee(nodeKey, selectedChoice) {
|
|
@@ -987,7 +962,6 @@ var Article = React__default.memo(forwardRef(function (props, ref) {
|
|
|
987
962
|
if (article && article.documentGroup && article.documentGroup.hideSeriesSlider === true) {
|
|
988
963
|
sliderData = null;
|
|
989
964
|
}
|
|
990
|
-
|
|
991
965
|
//next video url
|
|
992
966
|
if (sliderData) {
|
|
993
967
|
var nextArticle = void 0;
|
|
@@ -1305,13 +1279,7 @@ var Article = React__default.memo(forwardRef(function (props, ref) {
|
|
|
1305
1279
|
|
|
1306
1280
|
var indexes = findIndex(body);
|
|
1307
1281
|
var seriesInfo = checkIfMediaSeriesHasVideo(article);
|
|
1308
|
-
var isMediaSeries = false;
|
|
1309
|
-
if (article.documentGroup && article.documentGroup.isSeries) {
|
|
1310
|
-
isMediaSeries = true;
|
|
1311
|
-
} else if (!article.documentGroup && article.documentGroupMapping && checkDocGroupMappingForSeries(article.documentGroupMapping)) {
|
|
1312
|
-
isMediaSeries = true;
|
|
1313
|
-
}
|
|
1314
|
-
|
|
1282
|
+
var isMediaSeries = article.documentGroup && article.documentGroup.isSeries ? true : false;
|
|
1315
1283
|
if (indexes.length >= 2 && body.length > 3 && payload.contextualAD && payload.contextualVideoAD) {
|
|
1316
1284
|
payload = _extends({}, payload, {
|
|
1317
1285
|
contextualAD: _extends({}, payload.contextualAD, {
|
|
@@ -1346,7 +1314,7 @@ var Article = React__default.memo(forwardRef(function (props, ref) {
|
|
|
1346
1314
|
imageOptions: { w: 320, h: 240, fit: 'max' }
|
|
1347
1315
|
}, client.config())),
|
|
1348
1316
|
React__default.createElement('span', { className: 'clearfix' }),
|
|
1349
|
-
|
|
1317
|
+
article.documentGroup && article.documentGroup.isSeries && sliderData && seriesInfo.hasVideo && React__default.createElement(SeriesSlider, { dataset: sliderData, client: client, nowPlaying: article.title, displayEpisodeNumber: logicforDisplayingEpisodeNumber }),
|
|
1350
1318
|
React__default.createElement(
|
|
1351
1319
|
'div',
|
|
1352
1320
|
{ id: 'contextual-native-ad-' + payload._id, className: 'contextual-native-ad' },
|
|
@@ -1397,7 +1365,7 @@ var Article = React__default.memo(forwardRef(function (props, ref) {
|
|
|
1397
1365
|
imageOptions: { w: 320, h: 240, fit: 'max' }
|
|
1398
1366
|
}, client.config())),
|
|
1399
1367
|
contextualADFlag && React__default.createElement('span', { className: 'clearfix' }),
|
|
1400
|
-
|
|
1368
|
+
article.documentGroup && article.documentGroup.isSeries && sliderData && seriesInfo.hasVideo && React__default.createElement(SeriesSlider, { dataset: sliderData, client: client, nowPlaying: article.title, displayEpisodeNumber: logicforDisplayingEpisodeNumber }),
|
|
1401
1369
|
(visibleFlag || queueData && queueData.length === 1 || !props.infiniteScroll) && React__default.createElement(
|
|
1402
1370
|
React__default.Fragment,
|
|
1403
1371
|
null,
|
|
@@ -1452,7 +1420,7 @@ var Article = React__default.memo(forwardRef(function (props, ref) {
|
|
|
1452
1420
|
imageOptions: { w: 320, h: 240, fit: 'max' }
|
|
1453
1421
|
}, client.config())),
|
|
1454
1422
|
React__default.createElement('span', { className: 'clearfix' }),
|
|
1455
|
-
|
|
1423
|
+
article.documentGroup && article.documentGroup.isSeries && sliderData && seriesInfo.hasVideo && React__default.createElement(SeriesSlider, { dataset: sliderData, client: client, nowPlaying: article.title, displayEpisodeNumber: logicforDisplayingEpisodeNumber }),
|
|
1456
1424
|
React__default.createElement(
|
|
1457
1425
|
'div',
|
|
1458
1426
|
{ id: 'contextual-video-ad-' + payload._id, className: 'contextual-video-ad' },
|
|
@@ -1478,7 +1446,7 @@ var Article = React__default.memo(forwardRef(function (props, ref) {
|
|
|
1478
1446
|
blocks: article.documentGroup && article.documentGroup.isSeries ? [].concat(_toConsumableArray(articleBody.slice(0, _selectedIndex3))) : articleBody,
|
|
1479
1447
|
imageOptions: { w: 320, h: 240, fit: 'max' }
|
|
1480
1448
|
}, client.config())),
|
|
1481
|
-
|
|
1449
|
+
article.documentGroup && article.documentGroup.isSeries && sliderData && seriesInfo.hasVideo && React__default.createElement(SeriesSlider, { dataset: sliderData, client: client, nowPlaying: article.title, displayEpisodeNumber: logicforDisplayingEpisodeNumber }),
|
|
1482
1450
|
article.documentGroup && article.documentGroup.isSeries && React__default.createElement(BlockContent, _extends({
|
|
1483
1451
|
serializers: getSerializers(client, pageview, videoAccountIDs, onVote, true, drupalLeadSettings, currentPage, isMediaSeries, null, null, article.Ads, targeting, article, meta, authorPrefix, authorImgHeight, audioAutoplay),
|
|
1484
1452
|
blocks: [].concat(_toConsumableArray(articleBody.slice(_selectedIndex3))),
|
|
@@ -1575,20 +1543,10 @@ var Article = React__default.memo(forwardRef(function (props, ref) {
|
|
|
1575
1543
|
var triggerOffset = 20;
|
|
1576
1544
|
var isVideoSeries = checkIfVideoSeries(article);
|
|
1577
1545
|
var episodeNumber = fetchCurrentEpisode(sliderData, props.article);
|
|
1578
|
-
var isMediaSeries = false;
|
|
1579
|
-
var mediaSeriesName = '';
|
|
1546
|
+
var isMediaSeries = article.documentGroup && article.documentGroup.isSeries ? true : false;
|
|
1580
1547
|
var seriesInfo = checkIfMediaSeriesHasVideo(article);
|
|
1581
1548
|
var isFormAssembly = checkIfFormAssembly(article);
|
|
1582
1549
|
|
|
1583
|
-
if (article.documentGroup && article.documentGroup.isSeries) {
|
|
1584
|
-
isMediaSeries = true;
|
|
1585
|
-
mediaSeriesName = article.documentGroup.name;
|
|
1586
|
-
}
|
|
1587
|
-
if (!article.documentGroup && article.documentGroupMapping && checkDocGroupMappingForSeries(article.documentGroupMapping)) {
|
|
1588
|
-
isMediaSeries = true;
|
|
1589
|
-
mediaSeriesName = checkDocGroupMappingForSeries(article.documentGroupMapping).name;
|
|
1590
|
-
}
|
|
1591
|
-
|
|
1592
1550
|
return React__default.createElement(
|
|
1593
1551
|
React__default.Fragment,
|
|
1594
1552
|
null,
|
|
@@ -1622,10 +1580,10 @@ var Article = React__default.memo(forwardRef(function (props, ref) {
|
|
|
1622
1580
|
!isVideoSeries && React__default.createElement(
|
|
1623
1581
|
'div',
|
|
1624
1582
|
null,
|
|
1625
|
-
isMediaSeries && React__default.createElement(
|
|
1583
|
+
isMediaSeries && article.documentGroup && article.documentGroup.name && React__default.createElement(
|
|
1626
1584
|
'p',
|
|
1627
1585
|
{ style: { fontSize: '14px' } },
|
|
1628
|
-
disableEpisodeNumber ? '' +
|
|
1586
|
+
disableEpisodeNumber ? '' + article.documentGroup.name : article.documentGroup.name + ' - Episode ' + episodeNumber
|
|
1629
1587
|
),
|
|
1630
1588
|
React__default.createElement(
|
|
1631
1589
|
'h1',
|
|
@@ -2275,21 +2233,12 @@ var View = function View(props) {
|
|
|
2275
2233
|
return false;
|
|
2276
2234
|
};
|
|
2277
2235
|
|
|
2278
|
-
var isMediaSeries = false;
|
|
2279
|
-
|
|
2280
|
-
if (article.documentGroup && article.documentGroup.isSeries) {
|
|
2281
|
-
isMediaSeries = true;
|
|
2282
|
-
}
|
|
2283
|
-
if (!article.documentGroup && article.documentGroupMapping && checkDocGroupMappingForSeries(article.documentGroupMapping)) {
|
|
2284
|
-
isMediaSeries = true;
|
|
2285
|
-
}
|
|
2286
|
-
|
|
2287
2236
|
var disableInfiniteScroll = checkBodyForDisableInfiniteScroll(props.article);
|
|
2288
2237
|
var commentsEnabledInTaxonomy = Array.isArray(content_placement) && content_placement.some(function (t) {
|
|
2289
2238
|
return t.showComments === true;
|
|
2290
2239
|
});
|
|
2291
2240
|
var showDisqus = commentsEnabledInTaxonomy || hideComments === false;
|
|
2292
|
-
var needInfiniteScroll = ['Articles', 'Videos', 'Podcasts'].includes(article.category.name) && article.taxonomyMapping && article.passwordLock !== true && !disableInfiniteScroll && !article.ExcludeFromInfiniteScroll && !sponsoredFlag && infiniteScrollFlag && !article.showIsi && !
|
|
2241
|
+
var needInfiniteScroll = ['Articles', 'Videos', 'Podcasts'].includes(article.category.name) && article.taxonomyMapping && article.passwordLock !== true && !disableInfiniteScroll && !article.ExcludeFromInfiniteScroll && !sponsoredFlag && infiniteScrollFlag && !article.showIsi && (!article.documentGroup || !article.documentGroup.isSeries) && !showDisqus;
|
|
2293
2242
|
|
|
2294
2243
|
if (['Articles', 'Videos', 'Podcasts'].includes(article.category.name)) {
|
|
2295
2244
|
title = null;
|
|
@@ -2408,7 +2357,7 @@ View.returnGetInitialProps = function () {
|
|
|
2408
2357
|
var _ref = _asyncToGenerator( /*#__PURE__*/regenerator.mark(function _callee(url, prevUrl, seriesVid, client, sao) {
|
|
2409
2358
|
var context = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : null;
|
|
2410
2359
|
|
|
2411
|
-
var article, relatedArticleQuery, sliderData, statusCode, sliderArticles,
|
|
2360
|
+
var article, relatedArticleQuery, sliderData, statusCode, sliderArticles, _context$query$series, seriesArticle, sponsoredFlag;
|
|
2412
2361
|
|
|
2413
2362
|
return regenerator.wrap(function _callee$(_context) {
|
|
2414
2363
|
while (1) {
|
|
@@ -2430,7 +2379,7 @@ View.returnGetInitialProps = function () {
|
|
|
2430
2379
|
}
|
|
2431
2380
|
|
|
2432
2381
|
if (!(article.documentGroup && article.documentGroup.isSeries)) {
|
|
2433
|
-
_context.next =
|
|
2382
|
+
_context.next = 13;
|
|
2434
2383
|
break;
|
|
2435
2384
|
}
|
|
2436
2385
|
|
|
@@ -2441,24 +2390,8 @@ View.returnGetInitialProps = function () {
|
|
|
2441
2390
|
sliderArticles = _context.sent;
|
|
2442
2391
|
|
|
2443
2392
|
sliderData = sliderArticles;
|
|
2444
|
-
_context.next = 20;
|
|
2445
|
-
break;
|
|
2446
|
-
|
|
2447
|
-
case 15:
|
|
2448
|
-
if (!(article.documentGroupMapping && article.documentGroupMapping[0] && article.documentGroupMapping[0].isSeries)) {
|
|
2449
|
-
_context.next = 20;
|
|
2450
|
-
break;
|
|
2451
|
-
}
|
|
2452
|
-
|
|
2453
|
-
_context.next = 18;
|
|
2454
|
-
return client.fetch('*[!(_id in path("drafts.**")) \n && _type == "article"\n && defined(title)\n && references(\'' + article.documentGroupMapping[0]._id + '\')\n && is_visible == true\n && defined(published)\n && dateTime(published) <= dateTime(now())\n ] | order(published asc) {\n title,\n thumbnail,\n url,\n published\n }');
|
|
2455
|
-
|
|
2456
|
-
case 18:
|
|
2457
|
-
_sliderArticles = _context.sent;
|
|
2458
|
-
|
|
2459
|
-
sliderData = _sliderArticles;
|
|
2460
2393
|
|
|
2461
|
-
case
|
|
2394
|
+
case 13:
|
|
2462
2395
|
_context$query$series = context.query.seriesArticle, seriesArticle = _context$query$series === undefined ? false : _context$query$series;
|
|
2463
2396
|
|
|
2464
2397
|
if ((seriesArticle || seriesVid) && article.body) {
|
|
@@ -2507,27 +2440,27 @@ View.returnGetInitialProps = function () {
|
|
|
2507
2440
|
}
|
|
2508
2441
|
|
|
2509
2442
|
if (!article.disableRelatedContent) {
|
|
2510
|
-
_context.next =
|
|
2443
|
+
_context.next = 23;
|
|
2511
2444
|
break;
|
|
2512
2445
|
}
|
|
2513
2446
|
|
|
2514
2447
|
article.relatedArticle = null;
|
|
2515
|
-
_context.next =
|
|
2448
|
+
_context.next = 27;
|
|
2516
2449
|
break;
|
|
2517
2450
|
|
|
2518
|
-
case
|
|
2451
|
+
case 23:
|
|
2519
2452
|
if (!article) {
|
|
2520
|
-
_context.next =
|
|
2453
|
+
_context.next = 27;
|
|
2521
2454
|
break;
|
|
2522
2455
|
}
|
|
2523
2456
|
|
|
2524
|
-
_context.next =
|
|
2457
|
+
_context.next = 26;
|
|
2525
2458
|
return getRelatedArticle(context, client, article, prevUrl, '0..2');
|
|
2526
2459
|
|
|
2527
|
-
case
|
|
2460
|
+
case 26:
|
|
2528
2461
|
article.relatedArticle = _context.sent;
|
|
2529
2462
|
|
|
2530
|
-
case
|
|
2463
|
+
case 27:
|
|
2531
2464
|
return _context.abrupt('return', {
|
|
2532
2465
|
url: url,
|
|
2533
2466
|
sao: sao,
|
|
@@ -2539,7 +2472,7 @@ View.returnGetInitialProps = function () {
|
|
|
2539
2472
|
sponsoredFlag: sponsoredFlag
|
|
2540
2473
|
});
|
|
2541
2474
|
|
|
2542
|
-
case
|
|
2475
|
+
case 28:
|
|
2543
2476
|
case 'end':
|
|
2544
2477
|
return _context.stop();
|
|
2545
2478
|
}
|
package/dist/esm/getQuery.js
CHANGED
|
@@ -11,7 +11,7 @@ var getQuery = function getQuery(type) {
|
|
|
11
11
|
case 'related':
|
|
12
12
|
return '*[\n _type == "article"\n && defined(title)\n && defined(url)\n && !(_id in path("drafts.**"))\n && is_visible == true\n && defined(published) \n && dateTime(published) <= dateTime(now())\n && passwordLock!=true\n && isHealthcareProfessional != true\n && taxonomyMapping[]._ref in $taxonomy\n && taxonomyMapping[].disableAds != \'true\'\n && contentCategory->.name != \'Poll\'\n && contentCategory->.name != \'Slideshows\'\n && contentCategory->.disableAds != \'true\'\n && ExcludeFromInfiniteScroll !=true\n && url.current != $url\n && !defined(body[].videos)\n && !defined(body[].quizzes)\n && !defined(body[].slides)\n && !defined(body[].articles)\n ' + conditions + '\n ]| order(published desc)[' + (articleCount ? articleCount : '$index') + ']{\n ' + params + '\n title,\n published,\n summary,\n thumbnail,\n fieldAbstract,\n ...,\n passwordLock,\n password,\n "authorDetails": authorMapping[]->{ displayName, url, profileImage, biography, showSocialShare },\n body[] {\n ...,\n asset->,\n images[]{\n ...,\n asset->\n },\n content[]{\n ...,\n asset->\n },\n videos[]{\n ...,\n thumbnail{\n _type,\n asset->\n }\n },\n response[]{\n ...,\n asset->\n },\n quizzes[]{\n ...,\n answer[]{\n ...,\n asset->\n },\n question[]{\n ...,\n asset->\n }\n },\n poster {\n _type,\n asset->\n },\n slides[]{\n ...,\n slideshowImage{\n ...,\n asset->\n }\n },\n upload_doc {\n _type,\n asset->\n },\n uploadAudio {\n _type,\n asset->\n }\n },\n \'category\':contentCategory->{\n name,\n disableAds\n },\n \'content_placement\': taxonomyMapping[]-> {\n _id,\n \'ancestor\': parent->parent->identifier,\n \'parent\': parent->identifier,\n \'name\': name,\n \'path\': identifier,\n disableAds,\n showSocialShare,\n pixelTrackingCode->\n },\n documentGroup-> {\n name,\n thumbnail,\n parent->{...,parent->},\n isShow,\n showSocialShare,\n \'path\': identifier.current,\n adTargetingURL,\n hideSeriesSlider,\n pixelTrackingCode->\n },\n documentGroupMapping[]-> {\n _id,\n name,\n thumbnail,\n parent->{...,parent->},\n isShow,\n showSocialShare,\n \'path\': identifier.current,\n adTargetingURL,\n hideSeriesSlider,\n pixelTrackingCode->\n },\n \'issue\' : *[_type == \'publication\' && !(_id in path("drafts.**")) && is_visible == true && _id == ^.issueGroup._ref][0] {\n name,\n \'path\': identifier.current,\n show_download_ris_button,\n \'publication\' : *[_type == \'publication\' && !(_id in path("drafts.**")) && is_visible == true && _id == ^.parent._ref][0] {\n name,\n \'path\': identifier.current,\n show_download_ris_button,\n },\n \'url\' : pdf.asset-> url,\n \'pdf\': pdf.asset->,\n isbn_issn,\n abbreviatedJournal,\n }\n }';
|
|
13
13
|
case 'article':
|
|
14
|
-
return '*[\n _type == "article"\n && !(_id in path("drafts.**"))\n && defined(title)\n && defined(url)\n && is_visible != false\n && url.current == $url\n ' + conditions + '\n ][0]{\n ' + params + '\n title,\n published,\n summary,\n thumbnail,\n fieldAbstract,\n ...,\n passwordLock,\n password,\n issueGroup-> { _id, name, identifier, parent-> },\n "authorDetails": authorMapping[]->{ displayName, url, profileImage, biography, showSocialShare },\n body[] {\n ...,\n asset->,\n images[]{\n ...,\n asset->\n },\n content[]{\n ...,\n asset->\n },\n videos[]{\n ...,\n thumbnail{\n _type,\n asset->\n }\n },\n response[]{\n ...,\n asset->\n },\n quizzes[]{\n ...,\n answer[]{\n ...,\n asset->\n },\n question[]{\n ...,\n asset->\n }\n },\n poster {\n _type,\n asset->\n },\n slides[]{\n ...,\n slideshowImage{\n ...,\n asset->\n }\n },\n upload_doc {\n _type,\n asset->\n },\n uploadAudio {\n _type,\n asset->\n },\n medias[]{\n ...,\n upload_doc {\n _type,\n asset-> \n },\n poster {\n _type,\n asset-> \n }\n },\n articles[]{\n ...,\n thumbnail{\n ...,\n asset-> \n },\n "authorDetails": authorMapping[]->{ displayName, url, profileImage, biography, showSocialShare },\n text[]{\n ...,\n upload_doc {\n _type,\n asset->\n },\n uploadAudio {\n _type,\n asset->\n },\n }\n }\n },\n \'content_placement\': taxonomyMapping[]-> {\n ...,\n \'ancestor\': parent->parent->identifier,\n \'parent\': parent->identifier,\n \'name\': name,\n \'path\': identifier,\n showSocialShare,\n pixelTrackingCode->\n },\n documentGroup-> {\n _id,\n name,\n thumbnail,\n parent->{...,parent->},\n isShow,\n isSeries,\n disableEpisodeNumber,\n excludeRelatedContents,\n showSocialShare,\n \'path\': identifier.current,\n adTargetingURL,\n hideSeriesSlider,\n pixelTrackingCode->\n },\n documentGroupMapping[]-> {\n _id,\n name,\n thumbnail,\n
|
|
14
|
+
return '*[\n _type == "article"\n && !(_id in path("drafts.**"))\n && defined(title)\n && defined(url)\n && is_visible != false\n && url.current == $url\n ' + conditions + '\n ][0]{\n ' + params + '\n title,\n published,\n summary,\n thumbnail,\n fieldAbstract,\n ...,\n passwordLock,\n password,\n issueGroup-> { _id, name, identifier, parent-> },\n "authorDetails": authorMapping[]->{ displayName, url, profileImage, biography, showSocialShare },\n body[] {\n ...,\n asset->,\n images[]{\n ...,\n asset->\n },\n content[]{\n ...,\n asset->\n },\n videos[]{\n ...,\n thumbnail{\n _type,\n asset->\n }\n },\n response[]{\n ...,\n asset->\n },\n quizzes[]{\n ...,\n answer[]{\n ...,\n asset->\n },\n question[]{\n ...,\n asset->\n }\n },\n poster {\n _type,\n asset->\n },\n slides[]{\n ...,\n slideshowImage{\n ...,\n asset->\n }\n },\n upload_doc {\n _type,\n asset->\n },\n uploadAudio {\n _type,\n asset->\n },\n medias[]{\n ...,\n upload_doc {\n _type,\n asset-> \n },\n poster {\n _type,\n asset-> \n }\n },\n articles[]{\n ...,\n thumbnail{\n ...,\n asset-> \n },\n "authorDetails": authorMapping[]->{ displayName, url, profileImage, biography, showSocialShare },\n text[]{\n ...,\n upload_doc {\n _type,\n asset->\n },\n uploadAudio {\n _type,\n asset->\n },\n }\n }\n },\n \'content_placement\': taxonomyMapping[]-> {\n ...,\n \'ancestor\': parent->parent->identifier,\n \'parent\': parent->identifier,\n \'name\': name,\n \'path\': identifier,\n showSocialShare,\n pixelTrackingCode->\n },\n documentGroup-> {\n _id,\n name,\n thumbnail,\n parent->{...,parent->},\n isShow,\n isSeries,\n disableEpisodeNumber,\n excludeRelatedContents,\n showSocialShare,\n \'path\': identifier.current,\n adTargetingURL,\n hideSeriesSlider,\n pixelTrackingCode->\n },\n documentGroupMapping[]-> {\n _id,\n name,\n thumbnail,\n parent->{...,parent->},\n isShow,\n showSocialShare,\n excludeRelatedContents,\n \'path\': identifier.current,\n hideSeriesSlider,\n pixelTrackingCode->\n },\n \'category\':contentCategory->{\n name,\n disableAds\n },\n \'issue\' : *[_type == \'publication\' && !(_id in path("drafts.**")) && is_visible == true && _id == ^.issueGroup._ref][0] {\n name,\n volume,\n year,\n \'issueNumber\': number,\n \'articleSource\': source,\n \'path\': identifier.current,\n show_download_ris_button,\n \'publication\' : *[_type == \'publication\' && !(_id in path("drafts.**")) && is_visible == true && _id == ^.parent._ref][0] {\n name,\n \'path\': identifier.current,\n show_download_ris_button,\n },\n \'url\' : pdf.asset-> url,\n \'pdf\': pdf.asset->,\n isbn_issn,\n abbreviatedJournal,\n }\n\n }';
|
|
15
15
|
case 'publication':
|
|
16
16
|
return '*[_type == \'publication\'\n && identifier.current == $publication\n ' + conditions + '][0] {\n ' + params + '\n ...,\n \'issues\': *[_type == \'publication\'\n && is_visible\n && references(^._id)\n && defined(identifier)] {\n ...,\n thumbnail{ ..., asset-> },\n taxonomyMapping[]->,\n pdf{asset->},\n } | order(year desc, month desc)\n }';
|
|
17
17
|
case 'issue':
|