@mjhls/mjh-framework 1.0.474 → 1.0.475
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/ArticleQueue.js +6 -2
- package/dist/cjs/View.js +6 -2
- package/dist/cjs/getQuery.js +9 -4
- package/dist/esm/ArticleQueue.js +6 -2
- package/dist/esm/View.js +6 -2
- package/dist/esm/getQuery.js +9 -4
- package/package.json +1 -1
package/README.md
CHANGED
package/dist/cjs/ArticleQueue.js
CHANGED
|
@@ -130,6 +130,8 @@ var Article = function Article(props) {
|
|
|
130
130
|
authorDetails = _props$article.authorDetails,
|
|
131
131
|
pageNumber = _props$article.pageNumber,
|
|
132
132
|
published = _props$article.published,
|
|
133
|
+
_props$article$showPu = _props$article.showPublished,
|
|
134
|
+
showPublished = _props$article$showPu === undefined ? true : _props$article$showPu,
|
|
133
135
|
articleBody = _props$article.body,
|
|
134
136
|
thumbnail = _props$article.thumbnail,
|
|
135
137
|
content_placement = _props$article.content_placement,
|
|
@@ -512,11 +514,13 @@ var Article = function Article(props) {
|
|
|
512
514
|
React__default.createElement(
|
|
513
515
|
'div',
|
|
514
516
|
{ className: 'video-detail', style: { marginBottom: isCutomPage(props.article) ? '150px' : 0 } },
|
|
515
|
-
React__default.createElement(
|
|
517
|
+
showPublished && React__default.createElement(
|
|
516
518
|
'div',
|
|
517
519
|
null,
|
|
518
520
|
moment.moment(published).format('LL')
|
|
519
|
-
)
|
|
521
|
+
)
|
|
522
|
+
/* Show Published date */
|
|
523
|
+
,
|
|
520
524
|
React__default.createElement(
|
|
521
525
|
'div',
|
|
522
526
|
{ className: 'mb-3' },
|
package/dist/cjs/View.js
CHANGED
|
@@ -284,6 +284,8 @@ var Article = function Article(props) {
|
|
|
284
284
|
authorDetails = _props$article.authorDetails,
|
|
285
285
|
pageNumber = _props$article.pageNumber,
|
|
286
286
|
published = _props$article.published,
|
|
287
|
+
_props$article$showPu = _props$article.showPublished,
|
|
288
|
+
showPublished = _props$article$showPu === undefined ? true : _props$article$showPu,
|
|
287
289
|
articleBody = _props$article.body,
|
|
288
290
|
thumbnail = _props$article.thumbnail,
|
|
289
291
|
content_placement = _props$article.content_placement,
|
|
@@ -667,11 +669,13 @@ var Article = function Article(props) {
|
|
|
667
669
|
React__default.createElement(
|
|
668
670
|
'div',
|
|
669
671
|
{ className: 'left-wrap' },
|
|
670
|
-
React__default.createElement(
|
|
672
|
+
showPublished && React__default.createElement(
|
|
671
673
|
'div',
|
|
672
674
|
null,
|
|
673
675
|
moment.moment(published).format('LL')
|
|
674
|
-
)
|
|
676
|
+
)
|
|
677
|
+
/* Show Published date */
|
|
678
|
+
,
|
|
675
679
|
React__default.createElement(
|
|
676
680
|
'div',
|
|
677
681
|
{ className: 'mb-3' },
|
package/dist/cjs/getQuery.js
CHANGED
|
@@ -4,16 +4,21 @@ require('./_commonjsHelpers-06173234.js');
|
|
|
4
4
|
var moment = require('./moment-66a6a284.js');
|
|
5
5
|
|
|
6
6
|
var getQuery = function getQuery(type) {
|
|
7
|
+
var conditions = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
|
|
8
|
+
var params = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '';
|
|
9
|
+
|
|
10
|
+
//Added feature to include additional conditions and parameters for site level operations
|
|
11
|
+
//Site level conditions should start with && (logical AND), and site level params should end with , (comma) in order to execute query
|
|
7
12
|
var today = moment.moment().utc().format();
|
|
8
13
|
switch (type) {
|
|
9
14
|
case 'related':
|
|
10
|
-
return '*[\n _type == "article"
|
|
15
|
+
return '*[\n _type == "article"\n && defined(title)\n && defined(url)\n && !(_id in path("drafts.**"))\n && is_visible == true\n && published <= \'' + today + '\'\n && passwordLock!=true\n && taxonomyMapping[]._ref in $taxonomy\n && contentCategory->.name != \'Poll\'\n && contentCategory->.name != \'Slideshows\'\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 },\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 }';
|
|
11
16
|
case 'article':
|
|
12
|
-
return '*[\n _type == "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 },\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\n }';
|
|
13
18
|
case 'publication':
|
|
14
|
-
return '*[_type == \'publication\'\n && identifier.current == $publication][0] {\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 }';
|
|
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 }';
|
|
15
20
|
case 'issue':
|
|
16
|
-
return '*[_type == \'publication\'
|
|
21
|
+
return '*[_type == \'publication\'\n && identifier.current == $publication\n ' + conditions + '][0] {\n ' + params + '\n ...,\n \'issue\': *[_type == \'publication\'\n && references(^._id)\n && identifier.current == $issue][0] {\n ...,\n \'articles\': *[_type == \'article\'\n && !(_id in path("drafts.**"))\n && defined(title)\n && is_visible\n && defined(url)\n && dateTime(published) <= dateTime($currentDate)\n && references(^._id)] {\n ...,\n authorMapping[0]->,\n contentCategory->,\n issueSection-> {\n name\n }\n }\n }\n }';
|
|
17
22
|
}
|
|
18
23
|
};
|
|
19
24
|
|
package/dist/esm/ArticleQueue.js
CHANGED
|
@@ -125,6 +125,8 @@ var Article = function Article(props) {
|
|
|
125
125
|
authorDetails = _props$article.authorDetails,
|
|
126
126
|
pageNumber = _props$article.pageNumber,
|
|
127
127
|
published = _props$article.published,
|
|
128
|
+
_props$article$showPu = _props$article.showPublished,
|
|
129
|
+
showPublished = _props$article$showPu === undefined ? true : _props$article$showPu,
|
|
128
130
|
articleBody = _props$article.body,
|
|
129
131
|
thumbnail = _props$article.thumbnail,
|
|
130
132
|
content_placement = _props$article.content_placement,
|
|
@@ -507,11 +509,13 @@ var Article = function Article(props) {
|
|
|
507
509
|
React__default.createElement(
|
|
508
510
|
'div',
|
|
509
511
|
{ className: 'video-detail', style: { marginBottom: isCutomPage(props.article) ? '150px' : 0 } },
|
|
510
|
-
React__default.createElement(
|
|
512
|
+
showPublished && React__default.createElement(
|
|
511
513
|
'div',
|
|
512
514
|
null,
|
|
513
515
|
moment(published).format('LL')
|
|
514
|
-
)
|
|
516
|
+
)
|
|
517
|
+
/* Show Published date */
|
|
518
|
+
,
|
|
515
519
|
React__default.createElement(
|
|
516
520
|
'div',
|
|
517
521
|
{ className: 'mb-3' },
|
package/dist/esm/View.js
CHANGED
|
@@ -279,6 +279,8 @@ var Article = function Article(props) {
|
|
|
279
279
|
authorDetails = _props$article.authorDetails,
|
|
280
280
|
pageNumber = _props$article.pageNumber,
|
|
281
281
|
published = _props$article.published,
|
|
282
|
+
_props$article$showPu = _props$article.showPublished,
|
|
283
|
+
showPublished = _props$article$showPu === undefined ? true : _props$article$showPu,
|
|
282
284
|
articleBody = _props$article.body,
|
|
283
285
|
thumbnail = _props$article.thumbnail,
|
|
284
286
|
content_placement = _props$article.content_placement,
|
|
@@ -662,11 +664,13 @@ var Article = function Article(props) {
|
|
|
662
664
|
React__default.createElement(
|
|
663
665
|
'div',
|
|
664
666
|
{ className: 'left-wrap' },
|
|
665
|
-
React__default.createElement(
|
|
667
|
+
showPublished && React__default.createElement(
|
|
666
668
|
'div',
|
|
667
669
|
null,
|
|
668
670
|
moment(published).format('LL')
|
|
669
|
-
)
|
|
671
|
+
)
|
|
672
|
+
/* Show Published date */
|
|
673
|
+
,
|
|
670
674
|
React__default.createElement(
|
|
671
675
|
'div',
|
|
672
676
|
{ className: 'mb-3' },
|
package/dist/esm/getQuery.js
CHANGED
|
@@ -2,16 +2,21 @@ import './_commonjsHelpers-0c4b6f40.js';
|
|
|
2
2
|
import { m as moment } from './moment-12415288.js';
|
|
3
3
|
|
|
4
4
|
var getQuery = function getQuery(type) {
|
|
5
|
+
var conditions = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
|
|
6
|
+
var params = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '';
|
|
7
|
+
|
|
8
|
+
//Added feature to include additional conditions and parameters for site level operations
|
|
9
|
+
//Site level conditions should start with && (logical AND), and site level params should end with , (comma) in order to execute query
|
|
5
10
|
var today = moment().utc().format();
|
|
6
11
|
switch (type) {
|
|
7
12
|
case 'related':
|
|
8
|
-
return '*[\n _type == "article"
|
|
13
|
+
return '*[\n _type == "article"\n && defined(title)\n && defined(url)\n && !(_id in path("drafts.**"))\n && is_visible == true\n && published <= \'' + today + '\'\n && passwordLock!=true\n && taxonomyMapping[]._ref in $taxonomy\n && contentCategory->.name != \'Poll\'\n && contentCategory->.name != \'Slideshows\'\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 },\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 }';
|
|
9
14
|
case 'article':
|
|
10
|
-
return '*[\n _type == "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 },\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\n }';
|
|
11
16
|
case 'publication':
|
|
12
|
-
return '*[_type == \'publication\'\n && identifier.current == $publication][0] {\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 }';
|
|
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 }';
|
|
13
18
|
case 'issue':
|
|
14
|
-
return '*[_type == \'publication\'
|
|
19
|
+
return '*[_type == \'publication\'\n && identifier.current == $publication\n ' + conditions + '][0] {\n ' + params + '\n ...,\n \'issue\': *[_type == \'publication\'\n && references(^._id)\n && identifier.current == $issue][0] {\n ...,\n \'articles\': *[_type == \'article\'\n && !(_id in path("drafts.**"))\n && defined(title)\n && is_visible\n && defined(url)\n && dateTime(published) <= dateTime($currentDate)\n && references(^._id)] {\n ...,\n authorMapping[0]->,\n contentCategory->,\n issueSection-> {\n name\n }\n }\n }\n }';
|
|
15
20
|
}
|
|
16
21
|
};
|
|
17
22
|
|