@mjhls/mjh-framework 1.0.959-gridcontent-nojs-fix-v3 → 1.0.959-ris-update-v2
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/GridContent.js +1 -11
- package/dist/cjs/View.js +72 -34
- package/dist/cjs/getQuery.js +3 -3
- package/dist/esm/GridContent.js +1 -11
- package/dist/esm/View.js +72 -34
- package/dist/esm/getQuery.js +3 -3
- package/package.json +1 -1
package/dist/cjs/GridContent.js
CHANGED
|
@@ -87,8 +87,7 @@ var GridContent = function (_React$Component) {
|
|
|
87
87
|
lgInfeedAd: _this.props.lgInfeedAd ? _this.props.lgInfeedAd : false,
|
|
88
88
|
showCategory: _this.props.showCategory ? _this.props.showCategory : false,
|
|
89
89
|
contentCategoryMapping: _this.props.contentCategoryMapping ? contentCategoryMapping : [],
|
|
90
|
-
lastDataSize: _this.data ? _this.data.length : 0
|
|
91
|
-
dataRemapped: !_this.props.showBI || !_this.props.brandInsight
|
|
90
|
+
lastDataSize: _this.data ? _this.data.length : 0
|
|
92
91
|
}, _this.loadMore = debounce.debounce_1(function () {
|
|
93
92
|
_this.setState(function (state) {
|
|
94
93
|
var page = state.page,
|
|
@@ -116,10 +115,6 @@ var GridContent = function (_React$Component) {
|
|
|
116
115
|
if (pageview && currentPath !== prevPath) {
|
|
117
116
|
pageview(currentPath);
|
|
118
117
|
}
|
|
119
|
-
// set dataRemap to true as there are no infeed or BI ads or window width is less than limit
|
|
120
|
-
if (typeof window !== 'undefined' && (!_this.props.lgInfeedAd || !_this.props.brandInsight || window.innerWidth < 1400) && !_this.state.dataRemapped) {
|
|
121
|
-
!_this.state.dataRemapped && _this.setState({ dataRemapped: true });
|
|
122
|
-
}
|
|
123
118
|
}, _this.loadData = function () {
|
|
124
119
|
var _this$state = _this.state,
|
|
125
120
|
from = _this$state.from,
|
|
@@ -434,7 +429,6 @@ var GridContent = function (_React$Component) {
|
|
|
434
429
|
});
|
|
435
430
|
|
|
436
431
|
posts = lodash.lodash.flatten(chunks);
|
|
437
|
-
!this.state.dataRemapped && this.setState({ dataRemapped: true }); // To detect if appending of insights ads are completed
|
|
438
432
|
}
|
|
439
433
|
|
|
440
434
|
if (showBI) {
|
|
@@ -500,10 +494,6 @@ var GridContent = function (_React$Component) {
|
|
|
500
494
|
var itemsPerPage = this.props.params && this.props.params.itemsPerPage ? this.props.params.itemsPerPage : 10;
|
|
501
495
|
var heroContent = this.props.heroContent ? this.props.heroContent : 0;
|
|
502
496
|
var featureCount = 0;
|
|
503
|
-
if (!this.state.dataRemapped) {
|
|
504
|
-
//For Javascript Disabled Cases. data is not remapped if JS is disabled.
|
|
505
|
-
posts = this.state.data;
|
|
506
|
-
}
|
|
507
497
|
return React__default['default'].createElement(
|
|
508
498
|
'div',
|
|
509
499
|
{ className: 'grid-container' },
|
package/dist/cjs/View.js
CHANGED
|
@@ -1081,6 +1081,13 @@ var Article = React__default['default'].memo(React.forwardRef(function (props, r
|
|
|
1081
1081
|
}, client.config()));
|
|
1082
1082
|
}
|
|
1083
1083
|
};
|
|
1084
|
+
var getAbstract = function getAbstract() {
|
|
1085
|
+
return article.abstract && article.abstract.map(function (block) {
|
|
1086
|
+
if (block.children) return block.children.map(function (child) {
|
|
1087
|
+
if (child._type === 'span') return child.text;
|
|
1088
|
+
});
|
|
1089
|
+
}).join(' ');
|
|
1090
|
+
};
|
|
1084
1091
|
var renderIsiContent = function renderIsiContent(article) {
|
|
1085
1092
|
var url = article.url.current;
|
|
1086
1093
|
|
|
@@ -1100,7 +1107,7 @@ var Article = React__default['default'].memo(React.forwardRef(function (props, r
|
|
|
1100
1107
|
}
|
|
1101
1108
|
if (authorDetails && authorDetails.length) {
|
|
1102
1109
|
authorDetails.map(function (authorDetail, index) {
|
|
1103
|
-
return fileContent += 'AU - ' + authorDetail.displayName + '\n';
|
|
1110
|
+
return fileContent += 'AU - ' + (authorDetail.firstName && authorDetail.lastName ? authorDetail.lastName + ', ' + authorDetail.firstName : '' + authorDetail.displayName) + '\n';
|
|
1104
1111
|
} //Author
|
|
1105
1112
|
);
|
|
1106
1113
|
}
|
|
@@ -1108,9 +1115,13 @@ var Article = React__default['default'].memo(React.forwardRef(function (props, r
|
|
|
1108
1115
|
fileContent += 'T2 - ' + issue.publication.name + '\n'; //Secondary Title - T2
|
|
1109
1116
|
fileContent += 'JF - ' + issue.publication.name + '\n'; //Journal Name - JF
|
|
1110
1117
|
}
|
|
1118
|
+
if (issue.name) {
|
|
1119
|
+
fileContent += 'T3 - ' + issue.name + '\n'; //Issue Name - T3
|
|
1120
|
+
}
|
|
1111
1121
|
if (issue.abbreviatedJournal) {
|
|
1112
1122
|
fileContent += 'JO - ' + issue.abbreviatedJournal + '\n'; //Journal Name - JO
|
|
1113
1123
|
}
|
|
1124
|
+
if (article.abstract) fileContent += 'AB - ' + getAbstract() + '\n'; //Abstract - AB
|
|
1114
1125
|
if (article.fieldAbstract) fileContent += 'N2 - ' + article.fieldAbstract + '\n'; //Abstract - N2
|
|
1115
1126
|
if (issue.issueNumber) fileContent += 'IS - ' + issue.issueNumber + '\n'; //Issue Number - IS
|
|
1116
1127
|
fileContent += 'PB - MJH Life Sciences\n'; //Publisher - PB
|
|
@@ -1139,6 +1150,16 @@ var Article = React__default['default'].memo(React.forwardRef(function (props, r
|
|
|
1139
1150
|
fileContent += 'ER -\n'; //End of Record
|
|
1140
1151
|
return fileContent;
|
|
1141
1152
|
};
|
|
1153
|
+
var getAuthorList = function getAuthorList() {
|
|
1154
|
+
var authorList = '';
|
|
1155
|
+
if (authorDetails && authorDetails.length > 0) {
|
|
1156
|
+
authorDetails.map(function (author) {
|
|
1157
|
+
if (author.lastName && author.firstName) authorList += author.lastName + ',' + author.firstName + ';';else if (author.displayName) authorList += author.displayName + ';';
|
|
1158
|
+
});
|
|
1159
|
+
}
|
|
1160
|
+
return authorList;
|
|
1161
|
+
};
|
|
1162
|
+
|
|
1142
1163
|
var downloadRIS = function downloadRIS() {
|
|
1143
1164
|
var fileContent = generateRIS();
|
|
1144
1165
|
var file = new File([fileContent], 'citation-' + url + '.ris', { type: 'application/x-research-info-systems;charset=utf-8' });
|
|
@@ -1212,7 +1233,14 @@ var Article = React__default['default'].memo(React.forwardRef(function (props, r
|
|
|
1212
1233
|
return React__default['default'].createElement(
|
|
1213
1234
|
'div',
|
|
1214
1235
|
null,
|
|
1215
|
-
useSegmentRecommendedArticles ? React__default['default'].createElement(Recommended, {
|
|
1236
|
+
useSegmentRecommendedArticles ? React__default['default'].createElement(Recommended, {
|
|
1237
|
+
client: client,
|
|
1238
|
+
article: article,
|
|
1239
|
+
index: props.index,
|
|
1240
|
+
Settings: props.Settings,
|
|
1241
|
+
showRelatedArticleFallbackImage: props.showRelatedArticleFallbackImage,
|
|
1242
|
+
cpModificationRequired: cpModificationRequired
|
|
1243
|
+
}) : React__default['default'].createElement(
|
|
1216
1244
|
'section',
|
|
1217
1245
|
{ id: 'related-content-section', className: 'my-1' },
|
|
1218
1246
|
(article.relatedArticle || RelevantTopics()) && React__default['default'].createElement(
|
|
@@ -1324,9 +1352,7 @@ var Article = React__default['default'].memo(React.forwardRef(function (props, r
|
|
|
1324
1352
|
React__default['default'].createElement(
|
|
1325
1353
|
'div',
|
|
1326
1354
|
{ id: 'contextual-native-ad-' + payload._id, className: 'contextual-native-ad' },
|
|
1327
|
-
React__default['default'].createElement(AdSlot, _extends._extends({}, payload.contextualAD, {
|
|
1328
|
-
refreshFlag: refreshFlag
|
|
1329
|
-
}))
|
|
1355
|
+
React__default['default'].createElement(AdSlot, _extends._extends({}, payload.contextualAD, { refreshFlag: refreshFlag }))
|
|
1330
1356
|
),
|
|
1331
1357
|
React__default['default'].createElement(
|
|
1332
1358
|
'style',
|
|
@@ -1380,9 +1406,7 @@ var Article = React__default['default'].memo(React.forwardRef(function (props, r
|
|
|
1380
1406
|
React__default['default'].createElement(
|
|
1381
1407
|
'div',
|
|
1382
1408
|
{ id: 'contextual-native-ad-' + payload._id, className: 'contextual-native-ad' },
|
|
1383
|
-
React__default['default'].createElement(AdSlot, _extends._extends({}, payload.contextualAD, {
|
|
1384
|
-
refreshFlag: refreshFlag
|
|
1385
|
-
}))
|
|
1409
|
+
React__default['default'].createElement(AdSlot, _extends._extends({}, payload.contextualAD, { refreshFlag: refreshFlag }))
|
|
1386
1410
|
),
|
|
1387
1411
|
React__default['default'].createElement(
|
|
1388
1412
|
'style',
|
|
@@ -1566,7 +1590,6 @@ var Article = React__default['default'].memo(React.forwardRef(function (props, r
|
|
|
1566
1590
|
partialVisibility: true,
|
|
1567
1591
|
offset: { bottom: triggerOffset, top: containerHeight && containerHeight },
|
|
1568
1592
|
onChange: function onChange(isVisible) {
|
|
1569
|
-
|
|
1570
1593
|
if (isVisible && !isFirstArticle) {
|
|
1571
1594
|
var pageviewProperties = _extends._extends({}, targeting, {
|
|
1572
1595
|
category: article && article.category ? article.category.name : ''
|
|
@@ -1586,6 +1609,17 @@ var Article = React__default['default'].memo(React.forwardRef(function (props, r
|
|
|
1586
1609
|
React__default['default'].createElement(
|
|
1587
1610
|
'div',
|
|
1588
1611
|
{ className: 'video-detail', style: { marginBottom: isCutomPage(props.article) || showIsi && Array.isArray(isi) && isi.length > 0 ? '15rem' : 0 } },
|
|
1612
|
+
issue && React__default['default'].createElement(
|
|
1613
|
+
Head__default['default'],
|
|
1614
|
+
null,
|
|
1615
|
+
article.title && React__default['default'].createElement('meta', { name: 'citation_title', content: article.title }),
|
|
1616
|
+
published && React__default['default'].createElement('meta', { name: 'citation_date', content: moment.moment(published).format('LL') }),
|
|
1617
|
+
issue.year && React__default['default'].createElement('meta', { name: 'citation_year', content: issue.year }),
|
|
1618
|
+
issue.isbn_issn && React__default['default'].createElement('meta', { name: 'citation_isbn', content: issue.isbn_issn }),
|
|
1619
|
+
article.abstract && React__default['default'].createElement('meta', { name: 'citation_abstract', content: getAbstract() }),
|
|
1620
|
+
React__default['default'].createElement('meta', { name: 'citation_author', content: getAuthorList() }),
|
|
1621
|
+
issue.pdf && React__default['default'].createElement('meta', { name: 'citation_pdf_url', content: urlForFile.urlForFile({ asset: issue.pdf }) })
|
|
1622
|
+
),
|
|
1589
1623
|
isVideoSeries && renderBlockContent(article, meta, authorImgHeight),
|
|
1590
1624
|
!isVideoSeries && React__default['default'].createElement(
|
|
1591
1625
|
'div',
|
|
@@ -1607,7 +1641,7 @@ var Article = React__default['default'].memo(React.forwardRef(function (props, r
|
|
|
1607
1641
|
React__default['default'].createElement(
|
|
1608
1642
|
'style',
|
|
1609
1643
|
{ jsx: 'true' },
|
|
1610
|
-
'\n @media screen and (max-width: 468px) {\n .video-detail .doc-group-container {\n flex-direction: column;\n align-items: flex-start !important;\n }\n .video-detail .doc-group {\n margin-top: 2rem;\n width: calc(100vw - 45px);\n align-items: center;\n }\n .video-detail .doc-group img,\n .doc-group p {\n max-width: calc(100vw - 45px) !important;\n }\n }\n .author-details-img {\n margin-right: 10px;\n max-height: 250px;\n min-height: 150px;\n max-width: 250px;\n min-width: 150px;\n width: 100%;\n height: 100%;\n object-fit: contain;\n }\n .author-details-img-container {\n text-align: center;\n }\n .author-details-col {\n padding-left: 25px;\n }\n '
|
|
1644
|
+
'\n .social-ris-container {\n display: flex;\n justify-content: space-between;\n }\n @media screen and (max-width: 468px) {\n .video-detail .doc-group-container {\n flex-direction: column;\n align-items: flex-start !important;\n }\n .video-detail .doc-group {\n margin-top: 2rem;\n width: calc(100vw - 45px);\n align-items: center;\n }\n .video-detail .doc-group img,\n .doc-group p {\n max-width: calc(100vw - 45px) !important;\n }\n .social-ris-container {\n flex-direction: column;\n }\n }\n .author-details-img {\n margin-right: 10px;\n max-height: 250px;\n min-height: 150px;\n max-width: 250px;\n min-width: 150px;\n width: 100%;\n height: 100%;\n object-fit: contain;\n }\n .author-details-img-container {\n text-align: center;\n }\n .author-details-col {\n padding-left: 25px;\n }\n .left-wrap {\n width: 100%;\n }\n '
|
|
1611
1645
|
),
|
|
1612
1646
|
React__default['default'].createElement(
|
|
1613
1647
|
'div',
|
|
@@ -1691,23 +1725,34 @@ var Article = React__default['default'].memo(React.forwardRef(function (props, r
|
|
|
1691
1725
|
'Pages: ' + pageNumber
|
|
1692
1726
|
)
|
|
1693
1727
|
),
|
|
1694
|
-
|
|
1695
|
-
'
|
|
1696
|
-
|
|
1697
|
-
React__default['default'].createElement(
|
|
1698
|
-
|
|
1699
|
-
|
|
1700
|
-
|
|
1701
|
-
|
|
1702
|
-
|
|
1703
|
-
|
|
1704
|
-
|
|
1705
|
-
|
|
1706
|
-
|
|
1707
|
-
|
|
1708
|
-
|
|
1709
|
-
|
|
1710
|
-
|
|
1728
|
+
React__default['default'].createElement(
|
|
1729
|
+
'div',
|
|
1730
|
+
{ className: 'social-ris-container' },
|
|
1731
|
+
!isVideoSeries && showSocialShare && React__default['default'].createElement(
|
|
1732
|
+
'p',
|
|
1733
|
+
null,
|
|
1734
|
+
React__default['default'].createElement(SocialShare, {
|
|
1735
|
+
shareUrl: shareUrl,
|
|
1736
|
+
shareTitle: shareTitle,
|
|
1737
|
+
shareVia: shareVia,
|
|
1738
|
+
shareSummary: shareSummary,
|
|
1739
|
+
shareSubject: shareSubject,
|
|
1740
|
+
shareImage: shareImage,
|
|
1741
|
+
size: 32,
|
|
1742
|
+
siteName: siteName,
|
|
1743
|
+
twitterSiteName: twitterSiteName,
|
|
1744
|
+
disableMeta: true,
|
|
1745
|
+
hidePinterest: hidePinterestShare,
|
|
1746
|
+
hideFacebook: hideFBShare
|
|
1747
|
+
})
|
|
1748
|
+
),
|
|
1749
|
+
issue && downloadCitation && (!issue.hasOwnProperty('show_download_ris_button') || issue.show_download_ris_button !== false) && (!issue.publication || !issue.publication.hasOwnProperty('show_download_ris_button') || issue.publication.show_download_ris_button !== false) && React__default['default'].createElement(
|
|
1750
|
+
Button__default['default'],
|
|
1751
|
+
{ className: 'ris-download-button', onClick: function onClick() {
|
|
1752
|
+
return downloadRIS();
|
|
1753
|
+
} },
|
|
1754
|
+
'Download RIS'
|
|
1755
|
+
)
|
|
1711
1756
|
)
|
|
1712
1757
|
),
|
|
1713
1758
|
React__default['default'].createElement(
|
|
@@ -1775,13 +1820,6 @@ var Article = React__default['default'].memo(React.forwardRef(function (props, r
|
|
|
1775
1820
|
React__default['default'].createElement(
|
|
1776
1821
|
'div',
|
|
1777
1822
|
{ className: 'downloads-container' },
|
|
1778
|
-
issue && downloadCitation && (!issue.hasOwnProperty('show_download_ris_button') || issue.show_download_ris_button !== false) && (!issue.publication || !issue.publication.hasOwnProperty('show_download_ris_button') || issue.publication.show_download_ris_button !== false) && React__default['default'].createElement(
|
|
1779
|
-
Button__default['default'],
|
|
1780
|
-
{ className: 'ris-download-button', onClick: function onClick() {
|
|
1781
|
-
return downloadRIS();
|
|
1782
|
-
} },
|
|
1783
|
-
'Download RIS'
|
|
1784
|
-
),
|
|
1785
1823
|
issue && issue.pdf && React__default['default'].createElement(
|
|
1786
1824
|
'a',
|
|
1787
1825
|
{ rel: 'noopener', href: urlForFile.urlForFile({ asset: issue.pdf }), target: '_blank', title: 'Download issue' },
|
package/dist/cjs/getQuery.js
CHANGED
|
@@ -9,11 +9,11 @@ var getQuery = function getQuery(type) {
|
|
|
9
9
|
//Site level conditions should start with && (logical AND), and site level params should end with , (comma) in order to execute query
|
|
10
10
|
|
|
11
11
|
switch (type) {
|
|
12
|
-
// quiz video series and slideshow
|
|
12
|
+
// quiz video series and slideshow
|
|
13
13
|
case 'related':
|
|
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 },\n documentGroup-> {\n name,\n thumbnail,\n parent->{...,parent->},\n isShow,\n showSocialShare,\n \'path\': identifier.current,\n adTargetingURL,\n hideSeriesSlider\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 },\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 }';
|
|
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 abstract,\n ...,\n passwordLock,\n password,\n "authorDetails": authorMapping[]->{ displayName, firstName, lastName, 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 },\n documentGroup-> {\n name,\n thumbnail,\n parent->{...,parent->},\n isShow,\n showSocialShare,\n \'path\': identifier.current,\n adTargetingURL,\n hideSeriesSlider\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 },\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 },\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 },\n documentGroupMapping[]-> {\n _id,\n name,\n thumbnail,\n parent->{...,parent->},\n isShow,\n showSocialShare,\n excludeRelatedContents,\n \'path\': identifier.current,\n hideSeriesSlider\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 }';
|
|
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 abstract,\n ...,\n passwordLock,\n password,\n issueGroup-> { _id, name, identifier, parent-> },\n "authorDetails": authorMapping[]->{ displayName, firstName, lastName, 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, firstName, lastName, 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 },\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 },\n documentGroupMapping[]-> {\n _id,\n name,\n thumbnail,\n parent->{...,parent->},\n isShow,\n showSocialShare,\n excludeRelatedContents,\n \'path\': identifier.current,\n hideSeriesSlider\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/GridContent.js
CHANGED
|
@@ -77,8 +77,7 @@ var GridContent = function (_React$Component) {
|
|
|
77
77
|
lgInfeedAd: _this.props.lgInfeedAd ? _this.props.lgInfeedAd : false,
|
|
78
78
|
showCategory: _this.props.showCategory ? _this.props.showCategory : false,
|
|
79
79
|
contentCategoryMapping: _this.props.contentCategoryMapping ? contentCategoryMapping : [],
|
|
80
|
-
lastDataSize: _this.data ? _this.data.length : 0
|
|
81
|
-
dataRemapped: !_this.props.showBI || !_this.props.brandInsight
|
|
80
|
+
lastDataSize: _this.data ? _this.data.length : 0
|
|
82
81
|
}, _this.loadMore = debounce_1(function () {
|
|
83
82
|
_this.setState(function (state) {
|
|
84
83
|
var page = state.page,
|
|
@@ -106,10 +105,6 @@ var GridContent = function (_React$Component) {
|
|
|
106
105
|
if (pageview && currentPath !== prevPath) {
|
|
107
106
|
pageview(currentPath);
|
|
108
107
|
}
|
|
109
|
-
// set dataRemap to true as there are no infeed or BI ads or window width is less than limit
|
|
110
|
-
if (typeof window !== 'undefined' && (!_this.props.lgInfeedAd || !_this.props.brandInsight || window.innerWidth < 1400) && !_this.state.dataRemapped) {
|
|
111
|
-
!_this.state.dataRemapped && _this.setState({ dataRemapped: true });
|
|
112
|
-
}
|
|
113
108
|
}, _this.loadData = function () {
|
|
114
109
|
var _this$state = _this.state,
|
|
115
110
|
from = _this$state.from,
|
|
@@ -424,7 +419,6 @@ var GridContent = function (_React$Component) {
|
|
|
424
419
|
});
|
|
425
420
|
|
|
426
421
|
posts = lodash.flatten(chunks);
|
|
427
|
-
!this.state.dataRemapped && this.setState({ dataRemapped: true }); // To detect if appending of insights ads are completed
|
|
428
422
|
}
|
|
429
423
|
|
|
430
424
|
if (showBI) {
|
|
@@ -490,10 +484,6 @@ var GridContent = function (_React$Component) {
|
|
|
490
484
|
var itemsPerPage = this.props.params && this.props.params.itemsPerPage ? this.props.params.itemsPerPage : 10;
|
|
491
485
|
var heroContent = this.props.heroContent ? this.props.heroContent : 0;
|
|
492
486
|
var featureCount = 0;
|
|
493
|
-
if (!this.state.dataRemapped) {
|
|
494
|
-
//For Javascript Disabled Cases. data is not remapped if JS is disabled.
|
|
495
|
-
posts = this.state.data;
|
|
496
|
-
}
|
|
497
487
|
return React__default.createElement(
|
|
498
488
|
'div',
|
|
499
489
|
{ className: 'grid-container' },
|
package/dist/esm/View.js
CHANGED
|
@@ -1071,6 +1071,13 @@ var Article = React__default.memo(forwardRef(function (props, ref) {
|
|
|
1071
1071
|
}, client.config()));
|
|
1072
1072
|
}
|
|
1073
1073
|
};
|
|
1074
|
+
var getAbstract = function getAbstract() {
|
|
1075
|
+
return article.abstract && article.abstract.map(function (block) {
|
|
1076
|
+
if (block.children) return block.children.map(function (child) {
|
|
1077
|
+
if (child._type === 'span') return child.text;
|
|
1078
|
+
});
|
|
1079
|
+
}).join(' ');
|
|
1080
|
+
};
|
|
1074
1081
|
var renderIsiContent = function renderIsiContent(article) {
|
|
1075
1082
|
var url = article.url.current;
|
|
1076
1083
|
|
|
@@ -1090,7 +1097,7 @@ var Article = React__default.memo(forwardRef(function (props, ref) {
|
|
|
1090
1097
|
}
|
|
1091
1098
|
if (authorDetails && authorDetails.length) {
|
|
1092
1099
|
authorDetails.map(function (authorDetail, index) {
|
|
1093
|
-
return fileContent += 'AU - ' + authorDetail.displayName + '\n';
|
|
1100
|
+
return fileContent += 'AU - ' + (authorDetail.firstName && authorDetail.lastName ? authorDetail.lastName + ', ' + authorDetail.firstName : '' + authorDetail.displayName) + '\n';
|
|
1094
1101
|
} //Author
|
|
1095
1102
|
);
|
|
1096
1103
|
}
|
|
@@ -1098,9 +1105,13 @@ var Article = React__default.memo(forwardRef(function (props, ref) {
|
|
|
1098
1105
|
fileContent += 'T2 - ' + issue.publication.name + '\n'; //Secondary Title - T2
|
|
1099
1106
|
fileContent += 'JF - ' + issue.publication.name + '\n'; //Journal Name - JF
|
|
1100
1107
|
}
|
|
1108
|
+
if (issue.name) {
|
|
1109
|
+
fileContent += 'T3 - ' + issue.name + '\n'; //Issue Name - T3
|
|
1110
|
+
}
|
|
1101
1111
|
if (issue.abbreviatedJournal) {
|
|
1102
1112
|
fileContent += 'JO - ' + issue.abbreviatedJournal + '\n'; //Journal Name - JO
|
|
1103
1113
|
}
|
|
1114
|
+
if (article.abstract) fileContent += 'AB - ' + getAbstract() + '\n'; //Abstract - AB
|
|
1104
1115
|
if (article.fieldAbstract) fileContent += 'N2 - ' + article.fieldAbstract + '\n'; //Abstract - N2
|
|
1105
1116
|
if (issue.issueNumber) fileContent += 'IS - ' + issue.issueNumber + '\n'; //Issue Number - IS
|
|
1106
1117
|
fileContent += 'PB - MJH Life Sciences\n'; //Publisher - PB
|
|
@@ -1129,6 +1140,16 @@ var Article = React__default.memo(forwardRef(function (props, ref) {
|
|
|
1129
1140
|
fileContent += 'ER -\n'; //End of Record
|
|
1130
1141
|
return fileContent;
|
|
1131
1142
|
};
|
|
1143
|
+
var getAuthorList = function getAuthorList() {
|
|
1144
|
+
var authorList = '';
|
|
1145
|
+
if (authorDetails && authorDetails.length > 0) {
|
|
1146
|
+
authorDetails.map(function (author) {
|
|
1147
|
+
if (author.lastName && author.firstName) authorList += author.lastName + ',' + author.firstName + ';';else if (author.displayName) authorList += author.displayName + ';';
|
|
1148
|
+
});
|
|
1149
|
+
}
|
|
1150
|
+
return authorList;
|
|
1151
|
+
};
|
|
1152
|
+
|
|
1132
1153
|
var downloadRIS = function downloadRIS() {
|
|
1133
1154
|
var fileContent = generateRIS();
|
|
1134
1155
|
var file = new File([fileContent], 'citation-' + url + '.ris', { type: 'application/x-research-info-systems;charset=utf-8' });
|
|
@@ -1202,7 +1223,14 @@ var Article = React__default.memo(forwardRef(function (props, ref) {
|
|
|
1202
1223
|
return React__default.createElement(
|
|
1203
1224
|
'div',
|
|
1204
1225
|
null,
|
|
1205
|
-
useSegmentRecommendedArticles ? React__default.createElement(Recommended, {
|
|
1226
|
+
useSegmentRecommendedArticles ? React__default.createElement(Recommended, {
|
|
1227
|
+
client: client,
|
|
1228
|
+
article: article,
|
|
1229
|
+
index: props.index,
|
|
1230
|
+
Settings: props.Settings,
|
|
1231
|
+
showRelatedArticleFallbackImage: props.showRelatedArticleFallbackImage,
|
|
1232
|
+
cpModificationRequired: cpModificationRequired
|
|
1233
|
+
}) : React__default.createElement(
|
|
1206
1234
|
'section',
|
|
1207
1235
|
{ id: 'related-content-section', className: 'my-1' },
|
|
1208
1236
|
(article.relatedArticle || RelevantTopics()) && React__default.createElement(
|
|
@@ -1314,9 +1342,7 @@ var Article = React__default.memo(forwardRef(function (props, ref) {
|
|
|
1314
1342
|
React__default.createElement(
|
|
1315
1343
|
'div',
|
|
1316
1344
|
{ id: 'contextual-native-ad-' + payload._id, className: 'contextual-native-ad' },
|
|
1317
|
-
React__default.createElement(DFPAdSlot, _extends({}, payload.contextualAD, {
|
|
1318
|
-
refreshFlag: refreshFlag
|
|
1319
|
-
}))
|
|
1345
|
+
React__default.createElement(DFPAdSlot, _extends({}, payload.contextualAD, { refreshFlag: refreshFlag }))
|
|
1320
1346
|
),
|
|
1321
1347
|
React__default.createElement(
|
|
1322
1348
|
'style',
|
|
@@ -1370,9 +1396,7 @@ var Article = React__default.memo(forwardRef(function (props, ref) {
|
|
|
1370
1396
|
React__default.createElement(
|
|
1371
1397
|
'div',
|
|
1372
1398
|
{ id: 'contextual-native-ad-' + payload._id, className: 'contextual-native-ad' },
|
|
1373
|
-
React__default.createElement(DFPAdSlot, _extends({}, payload.contextualAD, {
|
|
1374
|
-
refreshFlag: refreshFlag
|
|
1375
|
-
}))
|
|
1399
|
+
React__default.createElement(DFPAdSlot, _extends({}, payload.contextualAD, { refreshFlag: refreshFlag }))
|
|
1376
1400
|
),
|
|
1377
1401
|
React__default.createElement(
|
|
1378
1402
|
'style',
|
|
@@ -1556,7 +1580,6 @@ var Article = React__default.memo(forwardRef(function (props, ref) {
|
|
|
1556
1580
|
partialVisibility: true,
|
|
1557
1581
|
offset: { bottom: triggerOffset, top: containerHeight && containerHeight },
|
|
1558
1582
|
onChange: function onChange(isVisible) {
|
|
1559
|
-
|
|
1560
1583
|
if (isVisible && !isFirstArticle) {
|
|
1561
1584
|
var pageviewProperties = _extends({}, targeting, {
|
|
1562
1585
|
category: article && article.category ? article.category.name : ''
|
|
@@ -1576,6 +1599,17 @@ var Article = React__default.memo(forwardRef(function (props, ref) {
|
|
|
1576
1599
|
React__default.createElement(
|
|
1577
1600
|
'div',
|
|
1578
1601
|
{ className: 'video-detail', style: { marginBottom: isCutomPage(props.article) || showIsi && Array.isArray(isi) && isi.length > 0 ? '15rem' : 0 } },
|
|
1602
|
+
issue && React__default.createElement(
|
|
1603
|
+
Head,
|
|
1604
|
+
null,
|
|
1605
|
+
article.title && React__default.createElement('meta', { name: 'citation_title', content: article.title }),
|
|
1606
|
+
published && React__default.createElement('meta', { name: 'citation_date', content: moment(published).format('LL') }),
|
|
1607
|
+
issue.year && React__default.createElement('meta', { name: 'citation_year', content: issue.year }),
|
|
1608
|
+
issue.isbn_issn && React__default.createElement('meta', { name: 'citation_isbn', content: issue.isbn_issn }),
|
|
1609
|
+
article.abstract && React__default.createElement('meta', { name: 'citation_abstract', content: getAbstract() }),
|
|
1610
|
+
React__default.createElement('meta', { name: 'citation_author', content: getAuthorList() }),
|
|
1611
|
+
issue.pdf && React__default.createElement('meta', { name: 'citation_pdf_url', content: urlForFile({ asset: issue.pdf }) })
|
|
1612
|
+
),
|
|
1579
1613
|
isVideoSeries && renderBlockContent(article, meta, authorImgHeight),
|
|
1580
1614
|
!isVideoSeries && React__default.createElement(
|
|
1581
1615
|
'div',
|
|
@@ -1597,7 +1631,7 @@ var Article = React__default.memo(forwardRef(function (props, ref) {
|
|
|
1597
1631
|
React__default.createElement(
|
|
1598
1632
|
'style',
|
|
1599
1633
|
{ jsx: 'true' },
|
|
1600
|
-
'\n @media screen and (max-width: 468px) {\n .video-detail .doc-group-container {\n flex-direction: column;\n align-items: flex-start !important;\n }\n .video-detail .doc-group {\n margin-top: 2rem;\n width: calc(100vw - 45px);\n align-items: center;\n }\n .video-detail .doc-group img,\n .doc-group p {\n max-width: calc(100vw - 45px) !important;\n }\n }\n .author-details-img {\n margin-right: 10px;\n max-height: 250px;\n min-height: 150px;\n max-width: 250px;\n min-width: 150px;\n width: 100%;\n height: 100%;\n object-fit: contain;\n }\n .author-details-img-container {\n text-align: center;\n }\n .author-details-col {\n padding-left: 25px;\n }\n '
|
|
1634
|
+
'\n .social-ris-container {\n display: flex;\n justify-content: space-between;\n }\n @media screen and (max-width: 468px) {\n .video-detail .doc-group-container {\n flex-direction: column;\n align-items: flex-start !important;\n }\n .video-detail .doc-group {\n margin-top: 2rem;\n width: calc(100vw - 45px);\n align-items: center;\n }\n .video-detail .doc-group img,\n .doc-group p {\n max-width: calc(100vw - 45px) !important;\n }\n .social-ris-container {\n flex-direction: column;\n }\n }\n .author-details-img {\n margin-right: 10px;\n max-height: 250px;\n min-height: 150px;\n max-width: 250px;\n min-width: 150px;\n width: 100%;\n height: 100%;\n object-fit: contain;\n }\n .author-details-img-container {\n text-align: center;\n }\n .author-details-col {\n padding-left: 25px;\n }\n .left-wrap {\n width: 100%;\n }\n '
|
|
1601
1635
|
),
|
|
1602
1636
|
React__default.createElement(
|
|
1603
1637
|
'div',
|
|
@@ -1681,23 +1715,34 @@ var Article = React__default.memo(forwardRef(function (props, ref) {
|
|
|
1681
1715
|
'Pages: ' + pageNumber
|
|
1682
1716
|
)
|
|
1683
1717
|
),
|
|
1684
|
-
|
|
1685
|
-
'
|
|
1686
|
-
|
|
1687
|
-
React__default.createElement(
|
|
1688
|
-
|
|
1689
|
-
|
|
1690
|
-
|
|
1691
|
-
|
|
1692
|
-
|
|
1693
|
-
|
|
1694
|
-
|
|
1695
|
-
|
|
1696
|
-
|
|
1697
|
-
|
|
1698
|
-
|
|
1699
|
-
|
|
1700
|
-
|
|
1718
|
+
React__default.createElement(
|
|
1719
|
+
'div',
|
|
1720
|
+
{ className: 'social-ris-container' },
|
|
1721
|
+
!isVideoSeries && showSocialShare && React__default.createElement(
|
|
1722
|
+
'p',
|
|
1723
|
+
null,
|
|
1724
|
+
React__default.createElement(SocialShare, {
|
|
1725
|
+
shareUrl: shareUrl,
|
|
1726
|
+
shareTitle: shareTitle,
|
|
1727
|
+
shareVia: shareVia,
|
|
1728
|
+
shareSummary: shareSummary,
|
|
1729
|
+
shareSubject: shareSubject,
|
|
1730
|
+
shareImage: shareImage,
|
|
1731
|
+
size: 32,
|
|
1732
|
+
siteName: siteName,
|
|
1733
|
+
twitterSiteName: twitterSiteName,
|
|
1734
|
+
disableMeta: true,
|
|
1735
|
+
hidePinterest: hidePinterestShare,
|
|
1736
|
+
hideFacebook: hideFBShare
|
|
1737
|
+
})
|
|
1738
|
+
),
|
|
1739
|
+
issue && downloadCitation && (!issue.hasOwnProperty('show_download_ris_button') || issue.show_download_ris_button !== false) && (!issue.publication || !issue.publication.hasOwnProperty('show_download_ris_button') || issue.publication.show_download_ris_button !== false) && React__default.createElement(
|
|
1740
|
+
Button,
|
|
1741
|
+
{ className: 'ris-download-button', onClick: function onClick() {
|
|
1742
|
+
return downloadRIS();
|
|
1743
|
+
} },
|
|
1744
|
+
'Download RIS'
|
|
1745
|
+
)
|
|
1701
1746
|
)
|
|
1702
1747
|
),
|
|
1703
1748
|
React__default.createElement(
|
|
@@ -1765,13 +1810,6 @@ var Article = React__default.memo(forwardRef(function (props, ref) {
|
|
|
1765
1810
|
React__default.createElement(
|
|
1766
1811
|
'div',
|
|
1767
1812
|
{ className: 'downloads-container' },
|
|
1768
|
-
issue && downloadCitation && (!issue.hasOwnProperty('show_download_ris_button') || issue.show_download_ris_button !== false) && (!issue.publication || !issue.publication.hasOwnProperty('show_download_ris_button') || issue.publication.show_download_ris_button !== false) && React__default.createElement(
|
|
1769
|
-
Button,
|
|
1770
|
-
{ className: 'ris-download-button', onClick: function onClick() {
|
|
1771
|
-
return downloadRIS();
|
|
1772
|
-
} },
|
|
1773
|
-
'Download RIS'
|
|
1774
|
-
),
|
|
1775
1813
|
issue && issue.pdf && React__default.createElement(
|
|
1776
1814
|
'a',
|
|
1777
1815
|
{ rel: 'noopener', href: urlForFile({ asset: issue.pdf }), target: '_blank', title: 'Download issue' },
|
package/dist/esm/getQuery.js
CHANGED
|
@@ -7,11 +7,11 @@ var getQuery = function getQuery(type) {
|
|
|
7
7
|
//Site level conditions should start with && (logical AND), and site level params should end with , (comma) in order to execute query
|
|
8
8
|
|
|
9
9
|
switch (type) {
|
|
10
|
-
// quiz video series and slideshow
|
|
10
|
+
// quiz video series and slideshow
|
|
11
11
|
case 'related':
|
|
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 },\n documentGroup-> {\n name,\n thumbnail,\n parent->{...,parent->},\n isShow,\n showSocialShare,\n \'path\': identifier.current,\n adTargetingURL,\n hideSeriesSlider\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 },\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 }';
|
|
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 abstract,\n ...,\n passwordLock,\n password,\n "authorDetails": authorMapping[]->{ displayName, firstName, lastName, 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 },\n documentGroup-> {\n name,\n thumbnail,\n parent->{...,parent->},\n isShow,\n showSocialShare,\n \'path\': identifier.current,\n adTargetingURL,\n hideSeriesSlider\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 },\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 },\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 },\n documentGroupMapping[]-> {\n _id,\n name,\n thumbnail,\n parent->{...,parent->},\n isShow,\n showSocialShare,\n excludeRelatedContents,\n \'path\': identifier.current,\n hideSeriesSlider\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 }';
|
|
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 abstract,\n ...,\n passwordLock,\n password,\n issueGroup-> { _id, name, identifier, parent-> },\n "authorDetails": authorMapping[]->{ displayName, firstName, lastName, 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, firstName, lastName, 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 },\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 },\n documentGroupMapping[]-> {\n _id,\n name,\n thumbnail,\n parent->{...,parent->},\n isShow,\n showSocialShare,\n excludeRelatedContents,\n \'path\': identifier.current,\n hideSeriesSlider\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':
|