@mjhls/mjh-framework 1.0.910 → 1.0.912

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/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # mjh-framework v. 1.0.910
1
+ # mjh-framework v. 1.0.912
2
2
 
3
3
  [![NPM](https://img.shields.io/npm/v/mjh-framework.svg)](https://www.npmjs.com/package/mjh-framework) [![JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://standardjs.com)
4
4
 
package/dist/cjs/View.js CHANGED
@@ -29,6 +29,7 @@ var styleInject_es = require('./style-inject.es-dcee06b6.js');
29
29
  require('./index-eadd5035.js');
30
30
  var disqusReact = require('disqus-react');
31
31
  var Schema = require('./Schema.js');
32
+ var FileSaver = require('file-saver');
32
33
  var keys = require('./keys-e982b3fa.js');
33
34
  var index_es = require('./index.es-f3e47207.js');
34
35
  var index = require('./index-fc2f1ca2.js');
@@ -81,6 +82,7 @@ var Head__default = /*#__PURE__*/_interopDefaultLegacy(Head);
81
82
  var Form__default = /*#__PURE__*/_interopDefaultLegacy(Form);
82
83
  var FormControl__default = /*#__PURE__*/_interopDefaultLegacy(FormControl);
83
84
  var Button__default = /*#__PURE__*/_interopDefaultLegacy(Button);
85
+ var FileSaver__default = /*#__PURE__*/_interopDefaultLegacy(FileSaver);
84
86
 
85
87
  var getArticleSummary = function getArticleSummary(article) {
86
88
  if (article.summary && article.summary.length > 0) {
@@ -557,7 +559,9 @@ var Article = React.forwardRef(function (props, ref) {
557
559
  _props$refreshFlag = props.refreshFlag,
558
560
  refreshFlag = _props$refreshFlag === undefined ? false : _props$refreshFlag,
559
561
  disqusConfig = props.disqusConfig,
560
- showDisqus = props.showDisqus;
562
+ showDisqus = props.showDisqus,
563
+ _props$downloadCitati = props.downloadCitation,
564
+ downloadCitation = _props$downloadCitati === undefined ? false : _props$downloadCitati;
561
565
 
562
566
 
563
567
  var targeting = getTargeting.getTargeting(props);
@@ -666,6 +670,53 @@ var Article = React.forwardRef(function (props, ref) {
666
670
  }
667
671
  return null;
668
672
  };
673
+ var generateRIS = function generateRIS() {
674
+ var fileContent = 'TY - JOUR\n';
675
+ if (issue) {
676
+ if (article.title) {
677
+ fileContent += 'TI - ' + article.title + '\n'; //Title - TI
678
+ fileContent += 'T1 - ' + article.title + '\n'; //Title - T1
679
+ }
680
+ if (issue.publication && issue.publication.name) {
681
+ fileContent += 'T2 - ' + issue.publication.name + '\n'; //Secondary Title - T2
682
+ fileContent += 'JF - ' + issue.publication.name + '\n'; //Journal Name - JF
683
+ }
684
+ if (issue.abbreviatedJournal) {
685
+ fileContent += 'JO - ' + issue.abbreviatedJournal + '\n'; //Journal Name - JO
686
+ }
687
+ if (article.fieldAbstract) fileContent += 'N2 - ' + article.fieldAbstract + '\n'; //Abstract - N2
688
+ if (issue.issueNumber) fileContent += 'IS - ' + issue.issueNumber + '\n'; //Issue Number - IS
689
+ fileContent += 'PB - MJH Life Sciences\n'; //Publisher - PB
690
+ if (issue.year) fileContent += 'PY - ' + issue.year + '\n'; //Published Year - PY
691
+ if (issue.volume) fileContent += 'VL - ' + issue.volume + '\n'; //Volume - VL
692
+ if (issue.url) fileContent += 'L1 - ' + issue.url + '\n'; //Link to PDF - L1
693
+ if (shareOptions && shareOptions.shareBaseUrl) {
694
+ fileContent += 'L2 - ' + (shareOptions.shareBaseUrl + url) + '\n'; //Link to Full-text - L2
695
+ fileContent += 'UR - ' + (shareOptions.shareBaseUrl + url) + '\n'; //Doc URL - UR
696
+ }
697
+ if (props.Website) fileContent += 'LK - https://' + props.Website.liveDomain + '\n'; //Website Link - LK
698
+ if (issue.isbn_issn) {
699
+ fileContent += 'SN - ' + issue.isbn_issn + '\n'; //ISSN/ISBN - TI
700
+ }
701
+ if (pageNumber) {
702
+ if (pageNumber.includes('-')) {
703
+ fileContent += 'SP - ' + pageNumber.split('-')[0] + '\n'; //Start Page - SP
704
+ fileContent += 'EP - ' + pageNumber.split('-')[1] + '\n'; //End Page - EP
705
+ } else {
706
+ fileContent += 'SP - ' + pageNumber + '\n';
707
+ }
708
+ }
709
+ if (article.published) fileContent += 'Y1 - ' + moment.moment(published).format('DD-MMMM-YYYY') + '\n'; //Primary Date - Y1
710
+ fileContent += 'Y2 - ' + moment.moment().format('DD-MMMM-YYYY') + '\n'; //Access Date - Y2
711
+ }
712
+ fileContent += 'ER -\n'; //End of Record
713
+ return fileContent;
714
+ };
715
+ var downloadRIS = function downloadRIS() {
716
+ var fileContent = generateRIS();
717
+ var file = new File([fileContent], 'citation-' + url + '.ris', { type: 'application/x-research-info-systems;charset=utf-8' });
718
+ FileSaver__default['default'].saveAs(file, 'citation-' + url + '.ris');
719
+ };
669
720
 
670
721
  var RelevantTopics = function RelevantTopics() {
671
722
  if (content_placement && content_placement.length > 0 || documentGroupMapping && documentGroupMapping.length > 0) {
@@ -980,6 +1031,19 @@ var Article = React.forwardRef(function (props, ref) {
980
1031
 
981
1032
  return false;
982
1033
  };
1034
+ var checkIfFormAssembly = function checkIfFormAssembly(article) {
1035
+ if (!article || !article.body) {
1036
+ return false;
1037
+ }
1038
+
1039
+ for (var i = 0; i < article.body.length; i++) {
1040
+ var block = article.body[i];
1041
+ if (block._type === 'formassembly') {
1042
+ return true;
1043
+ }
1044
+ }
1045
+ return false;
1046
+ };
983
1047
  var checkIfMediaSeriesHasVideo = function checkIfMediaSeriesHasVideo(article) {
984
1048
  var seriesInfo = { hasVideo: false, videoIndex: 0 };
985
1049
  if (!article || !article.body) {
@@ -1009,7 +1073,7 @@ var Article = React.forwardRef(function (props, ref) {
1009
1073
  var shareTitle = article.title;
1010
1074
  var shareSummary = article.summary;
1011
1075
  var shareImage = thumbnail && thumbnail.asset ? urlFor({ client: props.client, source: thumbnail.asset }) : shareImageDefault;
1012
- var siteName = props.website && props.website.title ? props.website.title : '';
1076
+ var siteName = props.Website && props.Website.title ? props.Website.title : '';
1013
1077
  var shareKeywords = getKeywords(props.article).join(',');
1014
1078
 
1015
1079
  var meta = {
@@ -1042,7 +1106,7 @@ var Article = React.forwardRef(function (props, ref) {
1042
1106
  var episodeNumber = fetchCurrentEpisode(props.sliderData, props.article);
1043
1107
  var isMediaSeries = article.documentGroup && article.documentGroup.isSeries ? true : false;
1044
1108
  var seriesInfo = checkIfMediaSeriesHasVideo(article);
1045
-
1109
+ var isFormAssembly = checkIfFormAssembly(article);
1046
1110
  return React__default['default'].createElement(
1047
1111
  React__default['default'].Fragment,
1048
1112
  null,
@@ -1096,7 +1160,7 @@ var Article = React.forwardRef(function (props, ref) {
1096
1160
  React__default['default'].createElement(
1097
1161
  'div',
1098
1162
  { className: 'left-wrap' },
1099
- !isVideoSeries && showPublished && React__default['default'].createElement(
1163
+ !isVideoSeries && !isFormAssembly && showPublished && React__default['default'].createElement(
1100
1164
  'div',
1101
1165
  null,
1102
1166
  React__default['default'].createElement(
@@ -1256,12 +1320,23 @@ var Article = React.forwardRef(function (props, ref) {
1256
1320
  )
1257
1321
  )
1258
1322
  ),
1259
- issue && issue.url && React__default['default'].createElement(
1260
- 'a',
1261
- { rel: 'noopener', href: issue.url, target: '_blank', title: 'Download issue' },
1262
- React__default['default'].createElement('img', { style: { margin: '1rem', maxHeight: '40px', maxWidth: '40px' }, src: '/download.png', alt: 'download issue' }),
1263
- 'Download Issue : ',
1264
- issue.name
1323
+ React__default['default'].createElement(
1324
+ 'div',
1325
+ { className: 'downloads-container' },
1326
+ issue && downloadCitation && React__default['default'].createElement(
1327
+ Button__default['default'],
1328
+ { className: 'ris-download-button', onClick: function onClick() {
1329
+ return downloadRIS();
1330
+ } },
1331
+ 'Download RIS'
1332
+ ),
1333
+ issue && issue.url && React__default['default'].createElement(
1334
+ 'a',
1335
+ { rel: 'noopener', href: issue.url, target: '_blank', title: 'Download issue' },
1336
+ React__default['default'].createElement('img', { style: { margin: '1rem', maxHeight: '40px', maxWidth: '40px' }, src: '/download.png', alt: 'download issue' }),
1337
+ 'Download Issue : ',
1338
+ issue.name
1339
+ )
1265
1340
  )
1266
1341
  ),
1267
1342
  React__default['default'].createElement('div', { className: 'clearfix', style: { minHeight: '1px' } }),
@@ -10,9 +10,9 @@ var getQuery = function getQuery(type) {
10
10
 
11
11
  switch (type) {
12
12
  case 'related':
13
- 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 && 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 ' + conditions + '\n ]| order(published desc)[' + (articleCount ? articleCount : '$index') + ']{\n ' + params + '\n title,\n published,\n summary,\n thumbnail,\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 },\n documentGroupMapping[]-> {\n _id,\n name,\n thumbnail,\n parent->{...,parent->},\n isShow,\n showSocialShare,\n \'path\': identifier.current,\n adTargetingURL\n },\n \'issue\' : *[_type == \'publication\' && !(_id in path("drafts.**")) && is_visible == true && _id == ^.issueGroup._ref][0] {\n name,\n \'path\': identifier.current,\n \'publication\' : *[_type == \'publication\' && !(_id in path("drafts.**")) && is_visible == true && _id == ^.parent._ref][0] {\n name,\n \'path\': identifier.current\n },\n \'url\' : pdf.asset-> url\n }\n }';
13
+ 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 && 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 ' + 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 },\n documentGroupMapping[]-> {\n _id,\n name,\n thumbnail,\n parent->{...,parent->},\n isShow,\n showSocialShare,\n \'path\': identifier.current,\n adTargetingURL\n },\n \'issue\' : *[_type == \'publication\' && !(_id in path("drafts.**")) && is_visible == true && _id == ^.issueGroup._ref][0] {\n name,\n \'path\': identifier.current,\n \'publication\' : *[_type == \'publication\' && !(_id in path("drafts.**")) && is_visible == true && _id == ^.parent._ref][0] {\n name,\n \'path\': identifier.current\n },\n \'url\' : pdf.asset-> url,\n isbn_issn,\n abbreviatedJournal,\n }\n }';
14
14
  case 'article':
15
- 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 ...,\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 showSocialShare,\n \'path\': identifier.current,\n adTargetingURL\n },\n documentGroupMapping[]-> {\n _id,\n name,\n thumbnail,\n parent->{...,parent->},\n isShow,\n showSocialShare,\n \'path\': identifier.current\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 \'issueNumber\': number,\n \'articleSource\': source,\n \'path\': identifier.current,\n \'publication\' : *[_type == \'publication\' && !(_id in path("drafts.**")) && is_visible == true && _id == ^.parent._ref][0] {\n name,\n \'path\': identifier.current\n },\n \'url\' : pdf.asset-> url\n }\n\n }';
15
+ 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 showSocialShare,\n \'path\': identifier.current,\n adTargetingURL\n },\n documentGroupMapping[]-> {\n _id,\n name,\n thumbnail,\n parent->{...,parent->},\n isShow,\n showSocialShare,\n \'path\': identifier.current\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 \'publication\' : *[_type == \'publication\' && !(_id in path("drafts.**")) && is_visible == true && _id == ^.parent._ref][0] {\n name,\n \'path\': identifier.current\n },\n \'url\' : pdf.asset-> url,\n isbn_issn,\n abbreviatedJournal,\n }\n\n }';
16
16
  case 'publication':
17
17
  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 }';
18
18
  case 'issue':
package/dist/cjs/index.js CHANGED
@@ -195,6 +195,7 @@ require('./md5-e1ca5797.js');
195
195
  require('./SeriesSlider-ba0c5d1a.js');
196
196
  require('./style-inject.es-dcee06b6.js');
197
197
  require('disqus-react');
198
+ require('file-saver');
198
199
  require('react-twitter-embed');
199
200
  require('./ImageSlider-6c00b878.js');
200
201
  require('./defineProperty-e0fb52c5.js');
package/dist/esm/View.js CHANGED
@@ -27,6 +27,7 @@ import { s as styleInject } from './style-inject.es-1f59c1d0.js';
27
27
  import './index-755f2cc2.js';
28
28
  import { DiscussionEmbed } from 'disqus-react';
29
29
  import Schema from './Schema.js';
30
+ import FileSaver from 'file-saver';
30
31
  import { _ as _Object$keys } from './keys-31dcdb31.js';
31
32
  import { I as InfiniteScroll } from './index.es-a6137319.js';
32
33
  import { l as lib_3 } from './index-f0fc23eb.js';
@@ -547,7 +548,9 @@ var Article = forwardRef(function (props, ref) {
547
548
  _props$refreshFlag = props.refreshFlag,
548
549
  refreshFlag = _props$refreshFlag === undefined ? false : _props$refreshFlag,
549
550
  disqusConfig = props.disqusConfig,
550
- showDisqus = props.showDisqus;
551
+ showDisqus = props.showDisqus,
552
+ _props$downloadCitati = props.downloadCitation,
553
+ downloadCitation = _props$downloadCitati === undefined ? false : _props$downloadCitati;
551
554
 
552
555
 
553
556
  var targeting = getTargeting(props);
@@ -656,6 +659,53 @@ var Article = forwardRef(function (props, ref) {
656
659
  }
657
660
  return null;
658
661
  };
662
+ var generateRIS = function generateRIS() {
663
+ var fileContent = 'TY - JOUR\n';
664
+ if (issue) {
665
+ if (article.title) {
666
+ fileContent += 'TI - ' + article.title + '\n'; //Title - TI
667
+ fileContent += 'T1 - ' + article.title + '\n'; //Title - T1
668
+ }
669
+ if (issue.publication && issue.publication.name) {
670
+ fileContent += 'T2 - ' + issue.publication.name + '\n'; //Secondary Title - T2
671
+ fileContent += 'JF - ' + issue.publication.name + '\n'; //Journal Name - JF
672
+ }
673
+ if (issue.abbreviatedJournal) {
674
+ fileContent += 'JO - ' + issue.abbreviatedJournal + '\n'; //Journal Name - JO
675
+ }
676
+ if (article.fieldAbstract) fileContent += 'N2 - ' + article.fieldAbstract + '\n'; //Abstract - N2
677
+ if (issue.issueNumber) fileContent += 'IS - ' + issue.issueNumber + '\n'; //Issue Number - IS
678
+ fileContent += 'PB - MJH Life Sciences\n'; //Publisher - PB
679
+ if (issue.year) fileContent += 'PY - ' + issue.year + '\n'; //Published Year - PY
680
+ if (issue.volume) fileContent += 'VL - ' + issue.volume + '\n'; //Volume - VL
681
+ if (issue.url) fileContent += 'L1 - ' + issue.url + '\n'; //Link to PDF - L1
682
+ if (shareOptions && shareOptions.shareBaseUrl) {
683
+ fileContent += 'L2 - ' + (shareOptions.shareBaseUrl + url) + '\n'; //Link to Full-text - L2
684
+ fileContent += 'UR - ' + (shareOptions.shareBaseUrl + url) + '\n'; //Doc URL - UR
685
+ }
686
+ if (props.Website) fileContent += 'LK - https://' + props.Website.liveDomain + '\n'; //Website Link - LK
687
+ if (issue.isbn_issn) {
688
+ fileContent += 'SN - ' + issue.isbn_issn + '\n'; //ISSN/ISBN - TI
689
+ }
690
+ if (pageNumber) {
691
+ if (pageNumber.includes('-')) {
692
+ fileContent += 'SP - ' + pageNumber.split('-')[0] + '\n'; //Start Page - SP
693
+ fileContent += 'EP - ' + pageNumber.split('-')[1] + '\n'; //End Page - EP
694
+ } else {
695
+ fileContent += 'SP - ' + pageNumber + '\n';
696
+ }
697
+ }
698
+ if (article.published) fileContent += 'Y1 - ' + moment(published).format('DD-MMMM-YYYY') + '\n'; //Primary Date - Y1
699
+ fileContent += 'Y2 - ' + moment().format('DD-MMMM-YYYY') + '\n'; //Access Date - Y2
700
+ }
701
+ fileContent += 'ER -\n'; //End of Record
702
+ return fileContent;
703
+ };
704
+ var downloadRIS = function downloadRIS() {
705
+ var fileContent = generateRIS();
706
+ var file = new File([fileContent], 'citation-' + url + '.ris', { type: 'application/x-research-info-systems;charset=utf-8' });
707
+ FileSaver.saveAs(file, 'citation-' + url + '.ris');
708
+ };
659
709
 
660
710
  var RelevantTopics = function RelevantTopics() {
661
711
  if (content_placement && content_placement.length > 0 || documentGroupMapping && documentGroupMapping.length > 0) {
@@ -970,6 +1020,19 @@ var Article = forwardRef(function (props, ref) {
970
1020
 
971
1021
  return false;
972
1022
  };
1023
+ var checkIfFormAssembly = function checkIfFormAssembly(article) {
1024
+ if (!article || !article.body) {
1025
+ return false;
1026
+ }
1027
+
1028
+ for (var i = 0; i < article.body.length; i++) {
1029
+ var block = article.body[i];
1030
+ if (block._type === 'formassembly') {
1031
+ return true;
1032
+ }
1033
+ }
1034
+ return false;
1035
+ };
973
1036
  var checkIfMediaSeriesHasVideo = function checkIfMediaSeriesHasVideo(article) {
974
1037
  var seriesInfo = { hasVideo: false, videoIndex: 0 };
975
1038
  if (!article || !article.body) {
@@ -999,7 +1062,7 @@ var Article = forwardRef(function (props, ref) {
999
1062
  var shareTitle = article.title;
1000
1063
  var shareSummary = article.summary;
1001
1064
  var shareImage = thumbnail && thumbnail.asset ? urlFor({ client: props.client, source: thumbnail.asset }) : shareImageDefault;
1002
- var siteName = props.website && props.website.title ? props.website.title : '';
1065
+ var siteName = props.Website && props.Website.title ? props.Website.title : '';
1003
1066
  var shareKeywords = getKeywords(props.article).join(',');
1004
1067
 
1005
1068
  var meta = {
@@ -1032,7 +1095,7 @@ var Article = forwardRef(function (props, ref) {
1032
1095
  var episodeNumber = fetchCurrentEpisode(props.sliderData, props.article);
1033
1096
  var isMediaSeries = article.documentGroup && article.documentGroup.isSeries ? true : false;
1034
1097
  var seriesInfo = checkIfMediaSeriesHasVideo(article);
1035
-
1098
+ var isFormAssembly = checkIfFormAssembly(article);
1036
1099
  return React__default.createElement(
1037
1100
  React__default.Fragment,
1038
1101
  null,
@@ -1086,7 +1149,7 @@ var Article = forwardRef(function (props, ref) {
1086
1149
  React__default.createElement(
1087
1150
  'div',
1088
1151
  { className: 'left-wrap' },
1089
- !isVideoSeries && showPublished && React__default.createElement(
1152
+ !isVideoSeries && !isFormAssembly && showPublished && React__default.createElement(
1090
1153
  'div',
1091
1154
  null,
1092
1155
  React__default.createElement(
@@ -1246,12 +1309,23 @@ var Article = forwardRef(function (props, ref) {
1246
1309
  )
1247
1310
  )
1248
1311
  ),
1249
- issue && issue.url && React__default.createElement(
1250
- 'a',
1251
- { rel: 'noopener', href: issue.url, target: '_blank', title: 'Download issue' },
1252
- React__default.createElement('img', { style: { margin: '1rem', maxHeight: '40px', maxWidth: '40px' }, src: '/download.png', alt: 'download issue' }),
1253
- 'Download Issue : ',
1254
- issue.name
1312
+ React__default.createElement(
1313
+ 'div',
1314
+ { className: 'downloads-container' },
1315
+ issue && downloadCitation && React__default.createElement(
1316
+ Button,
1317
+ { className: 'ris-download-button', onClick: function onClick() {
1318
+ return downloadRIS();
1319
+ } },
1320
+ 'Download RIS'
1321
+ ),
1322
+ issue && issue.url && React__default.createElement(
1323
+ 'a',
1324
+ { rel: 'noopener', href: issue.url, target: '_blank', title: 'Download issue' },
1325
+ React__default.createElement('img', { style: { margin: '1rem', maxHeight: '40px', maxWidth: '40px' }, src: '/download.png', alt: 'download issue' }),
1326
+ 'Download Issue : ',
1327
+ issue.name
1328
+ )
1255
1329
  )
1256
1330
  ),
1257
1331
  React__default.createElement('div', { className: 'clearfix', style: { minHeight: '1px' } }),
@@ -8,9 +8,9 @@ var getQuery = function getQuery(type) {
8
8
 
9
9
  switch (type) {
10
10
  case 'related':
11
- 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 && 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 ' + conditions + '\n ]| order(published desc)[' + (articleCount ? articleCount : '$index') + ']{\n ' + params + '\n title,\n published,\n summary,\n thumbnail,\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 },\n documentGroupMapping[]-> {\n _id,\n name,\n thumbnail,\n parent->{...,parent->},\n isShow,\n showSocialShare,\n \'path\': identifier.current,\n adTargetingURL\n },\n \'issue\' : *[_type == \'publication\' && !(_id in path("drafts.**")) && is_visible == true && _id == ^.issueGroup._ref][0] {\n name,\n \'path\': identifier.current,\n \'publication\' : *[_type == \'publication\' && !(_id in path("drafts.**")) && is_visible == true && _id == ^.parent._ref][0] {\n name,\n \'path\': identifier.current\n },\n \'url\' : pdf.asset-> url\n }\n }';
11
+ 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 && 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 ' + 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 },\n documentGroupMapping[]-> {\n _id,\n name,\n thumbnail,\n parent->{...,parent->},\n isShow,\n showSocialShare,\n \'path\': identifier.current,\n adTargetingURL\n },\n \'issue\' : *[_type == \'publication\' && !(_id in path("drafts.**")) && is_visible == true && _id == ^.issueGroup._ref][0] {\n name,\n \'path\': identifier.current,\n \'publication\' : *[_type == \'publication\' && !(_id in path("drafts.**")) && is_visible == true && _id == ^.parent._ref][0] {\n name,\n \'path\': identifier.current\n },\n \'url\' : pdf.asset-> url,\n isbn_issn,\n abbreviatedJournal,\n }\n }';
12
12
  case 'article':
13
- 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 ...,\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 showSocialShare,\n \'path\': identifier.current,\n adTargetingURL\n },\n documentGroupMapping[]-> {\n _id,\n name,\n thumbnail,\n parent->{...,parent->},\n isShow,\n showSocialShare,\n \'path\': identifier.current\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 \'issueNumber\': number,\n \'articleSource\': source,\n \'path\': identifier.current,\n \'publication\' : *[_type == \'publication\' && !(_id in path("drafts.**")) && is_visible == true && _id == ^.parent._ref][0] {\n name,\n \'path\': identifier.current\n },\n \'url\' : pdf.asset-> url\n }\n\n }';
13
+ 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 showSocialShare,\n \'path\': identifier.current,\n adTargetingURL\n },\n documentGroupMapping[]-> {\n _id,\n name,\n thumbnail,\n parent->{...,parent->},\n isShow,\n showSocialShare,\n \'path\': identifier.current\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 \'publication\' : *[_type == \'publication\' && !(_id in path("drafts.**")) && is_visible == true && _id == ^.parent._ref][0] {\n name,\n \'path\': identifier.current\n },\n \'url\' : pdf.asset-> url,\n isbn_issn,\n abbreviatedJournal,\n }\n\n }';
14
14
  case 'publication':
15
15
  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 }';
16
16
  case 'issue':
package/dist/esm/index.js CHANGED
@@ -192,6 +192,7 @@ import './md5-4e42248e.js';
192
192
  import './SeriesSlider-45adb8dc.js';
193
193
  import './style-inject.es-1f59c1d0.js';
194
194
  import 'disqus-react';
195
+ import 'file-saver';
195
196
  import 'react-twitter-embed';
196
197
  import './ImageSlider-f84174cb.js';
197
198
  import './defineProperty-23a8f8cd.js';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mjhls/mjh-framework",
3
- "version": "1.0.910",
3
+ "version": "1.0.912",
4
4
  "description": "Foundation Framework",
5
5
  "author": "mjh-framework",
6
6
  "license": "MIT",
@@ -56,6 +56,7 @@
56
56
  "eslint-plugin-react": "^7.10.0",
57
57
  "eslint-plugin-react-hooks": "^2.3.0",
58
58
  "eslint-plugin-standard": "^3.1.0",
59
+ "file-saver": "^2.0.5",
59
60
  "get-youtube-id": "^1.0.1",
60
61
  "gh-pages": "^1.2.0",
61
62
  "lodash": "^4.17.15",