@mjhls/mjh-framework 1.0.551 → 1.0.552
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 +1 -1
- package/dist/cjs/View.js +44 -5
- package/dist/cjs/getQuery.js +2 -2
- package/dist/esm/View.js +44 -5
- package/dist/esm/getQuery.js +2 -2
- package/package.json +1 -1
package/README.md
CHANGED
package/dist/cjs/View.js
CHANGED
|
@@ -40,7 +40,7 @@ var AdSlot = require('./AdSlot.js');
|
|
|
40
40
|
var BlockContent = require('./BlockContent-f942392e.js');
|
|
41
41
|
require('./smoothscroll-95231a70.js');
|
|
42
42
|
require('./GroupDeck.js');
|
|
43
|
-
require('react-bootstrap');
|
|
43
|
+
var reactBootstrap = require('react-bootstrap');
|
|
44
44
|
var Button = _interopDefault(require('react-bootstrap/Button'));
|
|
45
45
|
var getSerializers = require('./getSerializers.js');
|
|
46
46
|
require('./util-f2c1b65b.js');
|
|
@@ -62,6 +62,8 @@ var urlFor = require('./urlFor.js');
|
|
|
62
62
|
|
|
63
63
|
var renderAuthor = function renderAuthor(authorName, authorURL, index, length) {
|
|
64
64
|
var defaultUrl = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 'authors';
|
|
65
|
+
var biography = arguments[5];
|
|
66
|
+
var profileImage = arguments[6];
|
|
65
67
|
|
|
66
68
|
if (authorName && authorURL) {
|
|
67
69
|
return React__default.createElement(
|
|
@@ -69,9 +71,41 @@ var renderAuthor = function renderAuthor(authorName, authorURL, index, length) {
|
|
|
69
71
|
null,
|
|
70
72
|
React__default.createElement(
|
|
71
73
|
'a',
|
|
72
|
-
{ href: '/' + defaultUrl + '/' + authorURL.current, key: index },
|
|
74
|
+
{ className: 'author-details-link-' + index, href: '/' + defaultUrl + '/' + authorURL.current, key: index },
|
|
73
75
|
authorName
|
|
74
76
|
),
|
|
77
|
+
React__default.createElement(
|
|
78
|
+
reactBootstrap.Card,
|
|
79
|
+
{ className: 'author-details-card-' + index },
|
|
80
|
+
React__default.createElement(
|
|
81
|
+
reactBootstrap.Row,
|
|
82
|
+
null,
|
|
83
|
+
profileImage && React__default.createElement(
|
|
84
|
+
reactBootstrap.Col,
|
|
85
|
+
{ sm: 12, md: 4, className: 'author-details-img-container' },
|
|
86
|
+
React__default.createElement(reactBootstrap.Card.Img, { className: 'author-details-img', src: profileImage, alt: authorName })
|
|
87
|
+
),
|
|
88
|
+
React__default.createElement(
|
|
89
|
+
reactBootstrap.Col,
|
|
90
|
+
{ className: 'author-details-col', sm: 12, md: 8 },
|
|
91
|
+
React__default.createElement(
|
|
92
|
+
'h5',
|
|
93
|
+
null,
|
|
94
|
+
authorName
|
|
95
|
+
),
|
|
96
|
+
React__default.createElement(
|
|
97
|
+
'p',
|
|
98
|
+
null,
|
|
99
|
+
biography
|
|
100
|
+
)
|
|
101
|
+
)
|
|
102
|
+
)
|
|
103
|
+
),
|
|
104
|
+
React__default.createElement(
|
|
105
|
+
'style',
|
|
106
|
+
{ jsx: 'true' },
|
|
107
|
+
'\n .author-details-card-' + index + ' {\n display: none;\n position: absolute;\n width: 90%;\n max-width: 450px;\n max-height: 450px;\n z-index: 9999;\n }\n .author-details-card-' + index + ' h5 {\n font-weight: 500;\n }\n .author-details-link-' + index + ':hover + .author-details-card-' + index + ', .author-details-card-' + index + ':hover {\n display: block;\n box-shadow: 0px 0px 5px #aaa;\n padding: 15px;\n border-radius: 5px;\n }\n '
|
|
108
|
+
),
|
|
75
109
|
length !== index + 1 && ' , '
|
|
76
110
|
);
|
|
77
111
|
} else if (authorName) {
|
|
@@ -348,7 +382,12 @@ var Article = function Article(props) {
|
|
|
348
382
|
return false;
|
|
349
383
|
}
|
|
350
384
|
};
|
|
351
|
-
|
|
385
|
+
var renderAuthorBiography = function renderAuthorBiography(biography) {
|
|
386
|
+
return React__default.createElement(BlockContent.BlockContent, _extends._extends({
|
|
387
|
+
serializers: getSerializers(client, pageview, videoAccountIDs, onVote, true, drupalLeadSettings, currentPage, false, contextualADFlag),
|
|
388
|
+
blocks: [biography]
|
|
389
|
+
}, client.config()));
|
|
390
|
+
};
|
|
352
391
|
var renderIsiContent = function renderIsiContent(article) {
|
|
353
392
|
var url = article.url.current;
|
|
354
393
|
|
|
@@ -683,7 +722,7 @@ var Article = function Article(props) {
|
|
|
683
722
|
React__default.createElement(
|
|
684
723
|
'style',
|
|
685
724
|
{ jsx: 'true' },
|
|
686
|
-
'\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 '
|
|
725
|
+
'\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 border-radius: 50%;\n border: 1px solid #ccc;\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 '
|
|
687
726
|
),
|
|
688
727
|
React__default.createElement(
|
|
689
728
|
'div',
|
|
@@ -702,7 +741,7 @@ var Article = function Article(props) {
|
|
|
702
741
|
return React__default.createElement(
|
|
703
742
|
'span',
|
|
704
743
|
{ key: index },
|
|
705
|
-
renderAuthor(authorDetail.displayName, authorDetail.url, index, authorDetails.length, authorPrefix)
|
|
744
|
+
renderAuthor(authorDetail.displayName, authorDetail.url, index, authorDetails.length, authorPrefix, authorDetail.biography && renderAuthorBiography(authorDetail.biography[0]), authorDetail.profileImage && urlFor(props.client, authorDetail.profileImage).url())
|
|
706
745
|
);
|
|
707
746
|
}),
|
|
708
747
|
React__default.createElement(
|
package/dist/cjs/getQuery.js
CHANGED
|
@@ -12,9 +12,9 @@ var getQuery = function getQuery(type) {
|
|
|
12
12
|
|
|
13
13
|
switch (type) {
|
|
14
14
|
case 'related':
|
|
15
|
-
return '*[\n _type == "article"\n && defined(title)\n && defined(url)\n && !(_id in path("drafts.**"))\n && is_visible == true\n && published <= 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)[$index]{\n ' + params + '\n title,\n published,\n summary,\n thumbnail,\n ...,\n passwordLock,\n password,\n "authorDetails": authorMapping[]->{ displayName, url },\n body[] {\n ...,\n upload_doc {\n _type,\n asset->\n },\n uploadAudio {\n _type,\n asset->\n }\n },\n \'content_placement\': taxonomyMapping[]-> {\n \'ancestor\': parent->parent->identifier,\n \'parent\': parent->identifier,\n \'name\': name,\n \'path\': identifier,\n disableAds\n },\n documentGroup-> {\n name,\n thumbnail,\n parent->{...,parent->},\n \'path\': identifier.current\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 }';
|
|
15
|
+
return '*[\n _type == "article"\n && defined(title)\n && defined(url)\n && !(_id in path("drafts.**"))\n && is_visible == true\n && published <= 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)[$index]{\n ' + params + '\n title,\n published,\n summary,\n thumbnail,\n ...,\n passwordLock,\n password,\n "authorDetails": authorMapping[]->{ displayName, url, profileImage, biography },\n body[] {\n ...,\n upload_doc {\n _type,\n asset->\n },\n uploadAudio {\n _type,\n asset->\n }\n },\n \'content_placement\': taxonomyMapping[]-> {\n \'ancestor\': parent->parent->identifier,\n \'parent\': parent->identifier,\n \'name\': name,\n \'path\': identifier,\n disableAds\n },\n documentGroup-> {\n name,\n thumbnail,\n parent->{...,parent->},\n \'path\': identifier.current\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 }';
|
|
16
16
|
case 'article':
|
|
17
|
-
return '*[\n _type == "article"\n && !(_id in path("drafts.**"))\n && defined(title)\n && defined(url)\n && url.current == $url\n ' + conditions + '\n ][0]{\n ' + params + '\n title,\n published,\n summary,\n thumbnail,\n ...,\n passwordLock,\n password,\n "authorDetails": authorMapping[]->{ displayName, url },\n body[] {\n ...,\n upload_doc {\n _type,\n asset->\n },\n uploadAudio {\n _type,\n asset->\n }\n },\n \'content_placement\': taxonomyMapping[]-> {\n ...,\n \'ancestor\': parent->parent->identifier,\n \'parent\': parent->identifier,\n \'name\': name,\n \'path\': identifier\n },\n documentGroup-> {\n name,\n thumbnail,\n parent->{...,parent->},\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 }';
|
|
17
|
+
return '*[\n _type == "article"\n && !(_id in path("drafts.**"))\n && defined(title)\n && defined(url)\n && url.current == $url\n ' + conditions + '\n ][0]{\n ' + params + '\n title,\n published,\n summary,\n thumbnail,\n ...,\n passwordLock,\n password,\n "authorDetails": authorMapping[]->{ displayName, url, profileImage, biography },\n body[] {\n ...,\n upload_doc {\n _type,\n asset->\n },\n uploadAudio {\n _type,\n asset->\n }\n },\n \'content_placement\': taxonomyMapping[]-> {\n ...,\n \'ancestor\': parent->parent->identifier,\n \'parent\': parent->identifier,\n \'name\': name,\n \'path\': identifier\n },\n documentGroup-> {\n name,\n thumbnail,\n parent->{...,parent->},\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 }';
|
|
18
18
|
case 'publication':
|
|
19
19
|
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 pdf{asset->}\n } | order(year desc, month desc)\n }';
|
|
20
20
|
case 'issue':
|
package/dist/esm/View.js
CHANGED
|
@@ -34,7 +34,7 @@ import DFPAdSlot from './AdSlot.js';
|
|
|
34
34
|
import { B as BlockContent } from './BlockContent-a614acdf.js';
|
|
35
35
|
import './smoothscroll-4b699764.js';
|
|
36
36
|
import './GroupDeck.js';
|
|
37
|
-
import 'react-bootstrap';
|
|
37
|
+
import { Card, Row, Col } from 'react-bootstrap';
|
|
38
38
|
import Button from 'react-bootstrap/Button';
|
|
39
39
|
import getSerializers from './getSerializers.js';
|
|
40
40
|
import './util-7700fc59.js';
|
|
@@ -56,6 +56,8 @@ import urlFor from './urlFor.js';
|
|
|
56
56
|
|
|
57
57
|
var renderAuthor = function renderAuthor(authorName, authorURL, index, length) {
|
|
58
58
|
var defaultUrl = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 'authors';
|
|
59
|
+
var biography = arguments[5];
|
|
60
|
+
var profileImage = arguments[6];
|
|
59
61
|
|
|
60
62
|
if (authorName && authorURL) {
|
|
61
63
|
return React__default.createElement(
|
|
@@ -63,9 +65,41 @@ var renderAuthor = function renderAuthor(authorName, authorURL, index, length) {
|
|
|
63
65
|
null,
|
|
64
66
|
React__default.createElement(
|
|
65
67
|
'a',
|
|
66
|
-
{ href: '/' + defaultUrl + '/' + authorURL.current, key: index },
|
|
68
|
+
{ className: 'author-details-link-' + index, href: '/' + defaultUrl + '/' + authorURL.current, key: index },
|
|
67
69
|
authorName
|
|
68
70
|
),
|
|
71
|
+
React__default.createElement(
|
|
72
|
+
Card,
|
|
73
|
+
{ className: 'author-details-card-' + index },
|
|
74
|
+
React__default.createElement(
|
|
75
|
+
Row,
|
|
76
|
+
null,
|
|
77
|
+
profileImage && React__default.createElement(
|
|
78
|
+
Col,
|
|
79
|
+
{ sm: 12, md: 4, className: 'author-details-img-container' },
|
|
80
|
+
React__default.createElement(Card.Img, { className: 'author-details-img', src: profileImage, alt: authorName })
|
|
81
|
+
),
|
|
82
|
+
React__default.createElement(
|
|
83
|
+
Col,
|
|
84
|
+
{ className: 'author-details-col', sm: 12, md: 8 },
|
|
85
|
+
React__default.createElement(
|
|
86
|
+
'h5',
|
|
87
|
+
null,
|
|
88
|
+
authorName
|
|
89
|
+
),
|
|
90
|
+
React__default.createElement(
|
|
91
|
+
'p',
|
|
92
|
+
null,
|
|
93
|
+
biography
|
|
94
|
+
)
|
|
95
|
+
)
|
|
96
|
+
)
|
|
97
|
+
),
|
|
98
|
+
React__default.createElement(
|
|
99
|
+
'style',
|
|
100
|
+
{ jsx: 'true' },
|
|
101
|
+
'\n .author-details-card-' + index + ' {\n display: none;\n position: absolute;\n width: 90%;\n max-width: 450px;\n max-height: 450px;\n z-index: 9999;\n }\n .author-details-card-' + index + ' h5 {\n font-weight: 500;\n }\n .author-details-link-' + index + ':hover + .author-details-card-' + index + ', .author-details-card-' + index + ':hover {\n display: block;\n box-shadow: 0px 0px 5px #aaa;\n padding: 15px;\n border-radius: 5px;\n }\n '
|
|
102
|
+
),
|
|
69
103
|
length !== index + 1 && ' , '
|
|
70
104
|
);
|
|
71
105
|
} else if (authorName) {
|
|
@@ -342,7 +376,12 @@ var Article = function Article(props) {
|
|
|
342
376
|
return false;
|
|
343
377
|
}
|
|
344
378
|
};
|
|
345
|
-
|
|
379
|
+
var renderAuthorBiography = function renderAuthorBiography(biography) {
|
|
380
|
+
return React__default.createElement(BlockContent, _extends({
|
|
381
|
+
serializers: getSerializers(client, pageview, videoAccountIDs, onVote, true, drupalLeadSettings, currentPage, false, contextualADFlag),
|
|
382
|
+
blocks: [biography]
|
|
383
|
+
}, client.config()));
|
|
384
|
+
};
|
|
346
385
|
var renderIsiContent = function renderIsiContent(article) {
|
|
347
386
|
var url = article.url.current;
|
|
348
387
|
|
|
@@ -677,7 +716,7 @@ var Article = function Article(props) {
|
|
|
677
716
|
React__default.createElement(
|
|
678
717
|
'style',
|
|
679
718
|
{ jsx: 'true' },
|
|
680
|
-
'\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 '
|
|
719
|
+
'\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 border-radius: 50%;\n border: 1px solid #ccc;\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 '
|
|
681
720
|
),
|
|
682
721
|
React__default.createElement(
|
|
683
722
|
'div',
|
|
@@ -696,7 +735,7 @@ var Article = function Article(props) {
|
|
|
696
735
|
return React__default.createElement(
|
|
697
736
|
'span',
|
|
698
737
|
{ key: index },
|
|
699
|
-
renderAuthor(authorDetail.displayName, authorDetail.url, index, authorDetails.length, authorPrefix)
|
|
738
|
+
renderAuthor(authorDetail.displayName, authorDetail.url, index, authorDetails.length, authorPrefix, authorDetail.biography && renderAuthorBiography(authorDetail.biography[0]), authorDetail.profileImage && urlFor(props.client, authorDetail.profileImage).url())
|
|
700
739
|
);
|
|
701
740
|
}),
|
|
702
741
|
React__default.createElement(
|
package/dist/esm/getQuery.js
CHANGED
|
@@ -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 && published <= 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)[$index]{\n ' + params + '\n title,\n published,\n summary,\n thumbnail,\n ...,\n passwordLock,\n password,\n "authorDetails": authorMapping[]->{ displayName, url },\n body[] {\n ...,\n upload_doc {\n _type,\n asset->\n },\n uploadAudio {\n _type,\n asset->\n }\n },\n \'content_placement\': taxonomyMapping[]-> {\n \'ancestor\': parent->parent->identifier,\n \'parent\': parent->identifier,\n \'name\': name,\n \'path\': identifier,\n disableAds\n },\n documentGroup-> {\n name,\n thumbnail,\n parent->{...,parent->},\n \'path\': identifier.current\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 && published <= 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)[$index]{\n ' + params + '\n title,\n published,\n summary,\n thumbnail,\n ...,\n passwordLock,\n password,\n "authorDetails": authorMapping[]->{ displayName, url, profileImage, biography },\n body[] {\n ...,\n upload_doc {\n _type,\n asset->\n },\n uploadAudio {\n _type,\n asset->\n }\n },\n \'content_placement\': taxonomyMapping[]-> {\n \'ancestor\': parent->parent->identifier,\n \'parent\': parent->identifier,\n \'name\': name,\n \'path\': identifier,\n disableAds\n },\n documentGroup-> {\n name,\n thumbnail,\n parent->{...,parent->},\n \'path\': identifier.current\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 }';
|
|
14
14
|
case 'article':
|
|
15
|
-
return '*[\n _type == "article"\n && !(_id in path("drafts.**"))\n && defined(title)\n && defined(url)\n && url.current == $url\n ' + conditions + '\n ][0]{\n ' + params + '\n title,\n published,\n summary,\n thumbnail,\n ...,\n passwordLock,\n password,\n "authorDetails": authorMapping[]->{ displayName, url },\n body[] {\n ...,\n upload_doc {\n _type,\n asset->\n },\n uploadAudio {\n _type,\n asset->\n }\n },\n \'content_placement\': taxonomyMapping[]-> {\n ...,\n \'ancestor\': parent->parent->identifier,\n \'parent\': parent->identifier,\n \'name\': name,\n \'path\': identifier\n },\n documentGroup-> {\n name,\n thumbnail,\n parent->{...,parent->},\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 && url.current == $url\n ' + conditions + '\n ][0]{\n ' + params + '\n title,\n published,\n summary,\n thumbnail,\n ...,\n passwordLock,\n password,\n "authorDetails": authorMapping[]->{ displayName, url, profileImage, biography },\n body[] {\n ...,\n upload_doc {\n _type,\n asset->\n },\n uploadAudio {\n _type,\n asset->\n }\n },\n \'content_placement\': taxonomyMapping[]-> {\n ...,\n \'ancestor\': parent->parent->identifier,\n \'parent\': parent->identifier,\n \'name\': name,\n \'path\': identifier\n },\n documentGroup-> {\n name,\n thumbnail,\n parent->{...,parent->},\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 }';
|
|
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 pdf{asset->}\n } | order(year desc, month desc)\n }';
|
|
18
18
|
case 'issue':
|