@mjhls/mjh-framework 1.0.885-beta.0 → 1.0.886-beta.0
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/MediaSeriesLanding.js +1 -1
- package/dist/cjs/MediaSeriesLandingPaginated.js +1 -1
- package/dist/cjs/PartnerDetailListing.js +4 -4
- package/dist/cjs/PartnerDetailListingPaginated.js +4 -4
- package/dist/cjs/getQuery.js +1 -1
- package/dist/esm/MediaSeriesLanding.js +1 -1
- package/dist/esm/MediaSeriesLandingPaginated.js +1 -1
- package/dist/esm/PartnerDetailListing.js +4 -4
- package/dist/esm/PartnerDetailListingPaginated.js +4 -4
- package/dist/esm/getQuery.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# mjh-framework v. 1.0.
|
|
1
|
+
# mjh-framework v. 1.0.886
|
|
2
2
|
|
|
3
3
|
[](https://www.npmjs.com/package/mjh-framework) [](https://standardjs.com)
|
|
4
4
|
|
|
@@ -401,7 +401,7 @@ MediaSeriesLanding.getInitialData = function () {
|
|
|
401
401
|
|
|
402
402
|
case 9:
|
|
403
403
|
docGroupID = _context2.sent;
|
|
404
|
-
seriesQuery = '*[_type == \'documentGroup\' && references(\'' + docGroupID._id + '\') && isSeries != false && isShow != false && defined(published) && dateTime(published) <= dateTime(now()) ] | order(published desc) [$from...$to] {\n _id,\n name,\n identifier,\n published,\n thumbnail,\n description,\n topicMapping[]->,\n isGated,\n \'pageNumber\': ' + currentPage + ',\n \'parentUrl\': \'' + identifier + '\'\n }';
|
|
404
|
+
seriesQuery = '*[_type == \'documentGroup\' && references(\'' + docGroupID._id + '\') && isSeries != false && isShow != false && defined(published) && dateTime(published) <= dateTime(now()) ] | order(published desc) [$from...$to] {\n _id,\n name,\n identifier,\n published,\n thumbnail{ ..., asset-> },\n description,\n topicMapping[]->,\n isGated,\n \'pageNumber\': ' + currentPage + ',\n \'parentUrl\': \'' + identifier + '\'\n }';
|
|
405
405
|
_context2.next = 13;
|
|
406
406
|
return client.fetch(seriesQuery, params);
|
|
407
407
|
|
|
@@ -421,7 +421,7 @@ MediaSeriesLanding.getInitialData = function () {
|
|
|
421
421
|
docGroupID = _context2.sent;
|
|
422
422
|
seriesQueryFilters = '[\n _type == \'documentGroup\' \n && references(\'' + docGroupID._id + '\') \n && isSeries != false \n && isShow != false \n && defined(published) \n && published <= now()\n ]';
|
|
423
423
|
seriesQuerySorts = 'order(published desc) [$from...$to]';
|
|
424
|
-
seriesQueryProjection = '{\n _id,\n name,\n identifier,\n published,\n thumbnail,\n description,\n topicMapping[]->,\n isGated,\n \'parentUrl\': \'' + identifier + '\'\n }';
|
|
424
|
+
seriesQueryProjection = '{\n _id,\n name,\n identifier,\n published,\n thumbnail{ ..., asset-> },\n description,\n topicMapping[]->,\n isGated,\n \'parentUrl\': \'' + identifier + '\'\n }';
|
|
425
425
|
seriesQuery = ['*'].concat(seriesQueryFilters).concat(seriesQuerySorts).concat(seriesQueryProjection).join('|');
|
|
426
426
|
totalSeriesCountQuery = 'count(' + ['*'].concat(seriesQueryFilters).join('|') + ')';
|
|
427
427
|
_context2.next = 17;
|
|
@@ -236,15 +236,15 @@ PartnerDetails.returnGetInitialProps = function () {
|
|
|
236
236
|
switch (_context.prev = _context.next) {
|
|
237
237
|
case 0:
|
|
238
238
|
today = moment.moment().utc().format();
|
|
239
|
-
featureQuery = '*[_type == \'feature\' && is_active == true && feature_url == \'/' + partnerPageUrl + '/' + (category ? category + '/' : null) + identifier + '\'] | order(_updatedAt asc)[0..5]{\n ...,\n \'feature_img\' : feature_img.asset
|
|
240
|
-
partnerQuery = '*[_type == \'documentGroup\' \n && !(_id in path("drafts.**"))\n && references(\'' + partnerDocumentGroupID + '\')\n && identifier.current == \'' + identifier + '\'] | order(name asc) [0] {\n description,\n name,\n identifier,\n thumbnail,\n twitter,\n facebook,\n linkedin,\n "affiliates": description[_type==\'slideshows\']{\n ...,\n slides->{...}\n }\n }';
|
|
239
|
+
featureQuery = '*[_type == \'feature\' && is_active == true && feature_url == \'/' + partnerPageUrl + '/' + (category ? category + '/' : null) + identifier + '\'] | order(_updatedAt asc)[0..5]{\n ...,\n \'feature_img\' : feature_img.asset->\n }';
|
|
240
|
+
partnerQuery = '*[_type == \'documentGroup\' \n && !(_id in path("drafts.**"))\n && references(\'' + partnerDocumentGroupID + '\')\n && identifier.current == \'' + identifier + '\'] | order(name asc) [0] {\n description,\n name,\n identifier,\n thumbnail{ ..., asset-> },\n twitter,\n facebook,\n linkedin,\n "affiliates": description[_type==\'slideshows\']{\n ...,\n slides->{...}\n }\n }';
|
|
241
241
|
|
|
242
242
|
|
|
243
243
|
if (category) {
|
|
244
244
|
// if partners page has a sub category such as onclive
|
|
245
245
|
// e.g. /sap-partner/[category]/[partner]
|
|
246
246
|
|
|
247
|
-
partnerQuery = '*[_type == \'documentGroup\' && !(_id in path("drafts.**")) && identifier.current == \'' + category + '\' && references(\'' + partnerDocumentGroupID + '\')] [0] {\n ...,\n \'partner\': *[_type == \'documentGroup\' && identifier.current == \'' + identifier + '\' && references(^._id)] [0] {\n description,\n name,\n identifier,\n thumbnail,\n twitter,\n facebook,\n linkedin,\n "affiliates": description[_type==\'slideshows\']{\n ...,\n slides->{...}\n }\n \n }\n }';
|
|
247
|
+
partnerQuery = '*[_type == \'documentGroup\' && !(_id in path("drafts.**")) && identifier.current == \'' + category + '\' && references(\'' + partnerDocumentGroupID + '\')] [0] {\n ...,\n \'partner\': *[_type == \'documentGroup\' && identifier.current == \'' + identifier + '\' && references(^._id)] [0] {\n description,\n name,\n identifier,\n thumbnail{ ..., asset-> },\n twitter,\n facebook,\n linkedin,\n "affiliates": description[_type==\'slideshows\']{\n ...,\n slides->{...}\n }\n \n }\n }';
|
|
248
248
|
}
|
|
249
249
|
|
|
250
250
|
taxonomyQuery = '*[_type == \'documentGroup\' \n && !(_id in path("drafts.**"))\n && references(\'' + partnerDocumentGroupID + '\')\n && isShow != false\n && identifier.current == \'' + identifier + '\'] [0] {\n \'id\': _id,\n \'title\': name\n }';
|
|
@@ -261,7 +261,7 @@ PartnerDetails.returnGetInitialProps = function () {
|
|
|
261
261
|
features = _ref4[0];
|
|
262
262
|
partnerDetails = _ref4[1];
|
|
263
263
|
taxonomyDetails = _ref4[2];
|
|
264
|
-
articlesQuery = '*[_type == \'article\' && !(_id in path("drafts.**")) && defined(title) && is_visible == true && defined(url) && dateTime(published) <= dateTime(\'' + today + '\') && passwordLocked != true && references(\'' + taxonomyDetails.id + '\')] | order(published desc)[$from...$to]{\n title,\n summary,\n thumbnail,\n url,\n published,\n contentCategory->,\n \'pageNumber\': ' + currentPage + '\n }';
|
|
264
|
+
articlesQuery = '*[_type == \'article\' && !(_id in path("drafts.**")) && defined(title) && is_visible == true && defined(url) && dateTime(published) <= dateTime(\'' + today + '\') && passwordLocked != true && references(\'' + taxonomyDetails.id + '\')] | order(published desc)[$from...$to]{\n title,\n summary,\n thumbnail{ ..., asset-> },\n url,\n published,\n contentCategory->,\n \'pageNumber\': ' + currentPage + '\n }';
|
|
265
265
|
_context.next = 16;
|
|
266
266
|
return client.fetch(articlesQuery, params);
|
|
267
267
|
|
|
@@ -236,15 +236,15 @@ PartnerDetails.returnGetInitialProps = function () {
|
|
|
236
236
|
while (1) {
|
|
237
237
|
switch (_context.prev = _context.next) {
|
|
238
238
|
case 0:
|
|
239
|
-
featureQuery = '*[_type == \'feature\' && is_active == true && feature_url == \'/' + partnerPageUrl + '/' + (category ? category + '/' : null) + identifier + '\'] | order(_updatedAt asc)[0..5]{\n ...,\n \'feature_img\' : feature_img.asset
|
|
240
|
-
partnerQuery = '*[_type == \'documentGroup\' \n && !(_id in path("drafts.**"))\n && references(\'' + partnerDocumentGroupID + '\')\n && identifier.current == \'' + identifier + '\'] | order(name asc) [0] {\n description,\n name,\n identifier,\n thumbnail,\n twitter,\n facebook,\n linkedin,\n "affiliates": description[_type==\'slideshows\']{\n ...,\n slides->{...}\n }\n }';
|
|
239
|
+
featureQuery = '*[_type == \'feature\' && is_active == true && feature_url == \'/' + partnerPageUrl + '/' + (category ? category + '/' : null) + identifier + '\'] | order(_updatedAt asc)[0..5]{\n ...,\n \'feature_img\' : feature_img.asset->\n }';
|
|
240
|
+
partnerQuery = '*[_type == \'documentGroup\' \n && !(_id in path("drafts.**"))\n && references(\'' + partnerDocumentGroupID + '\')\n && identifier.current == \'' + identifier + '\'] | order(name asc) [0] {\n description,\n name,\n identifier,\n thumbnail{ ..., asset-> },\n twitter,\n facebook,\n linkedin,\n "affiliates": description[_type==\'slideshows\']{\n ...,\n slides->{...}\n }\n }';
|
|
241
241
|
|
|
242
242
|
|
|
243
243
|
if (category) {
|
|
244
244
|
// if partners page has a sub category such as onclive
|
|
245
245
|
// e.g. /sap-partner/[category]/[partner]
|
|
246
246
|
|
|
247
|
-
partnerQuery = '*[_type == \'documentGroup\' && !(_id in path("drafts.**")) && identifier.current == \'' + category + '\' && references(\'' + partnerDocumentGroupID + '\')] [0] {\n ...,\n \'partner\': *[_type == \'documentGroup\' && identifier.current == \'' + identifier + '\' && references(^._id)] [0] {\n description,\n name,\n identifier,\n thumbnail,\n twitter,\n facebook,\n linkedin,\n "affiliates": description[_type==\'slideshows\']{\n ...,\n slides->{...}\n }\n \n }\n }';
|
|
247
|
+
partnerQuery = '*[_type == \'documentGroup\' && !(_id in path("drafts.**")) && identifier.current == \'' + category + '\' && references(\'' + partnerDocumentGroupID + '\')] [0] {\n ...,\n \'partner\': *[_type == \'documentGroup\' && identifier.current == \'' + identifier + '\' && references(^._id)] [0] {\n description,\n name,\n identifier,\n thumbnail{ ..., asset-> },\n twitter,\n facebook,\n linkedin,\n "affiliates": description[_type==\'slideshows\']{\n ...,\n slides->{...}\n }\n \n }\n }';
|
|
248
248
|
}
|
|
249
249
|
|
|
250
250
|
taxonomyQuery = '*[_type == \'documentGroup\' \n && !(_id in path("drafts.**"))\n && references(\'' + partnerDocumentGroupID + '\')\n && isShow != false\n && identifier.current == \'' + identifier + '\'] [0] {\n \'id\': _id,\n \'title\': name\n }';
|
|
@@ -263,7 +263,7 @@ PartnerDetails.returnGetInitialProps = function () {
|
|
|
263
263
|
taxonomyDetails = _ref4[2];
|
|
264
264
|
articlesQueryFilters = '[\n _type == \'article\' \n && !(_id in path("drafts.**")) \n && defined(title) \n && is_visible == true \n && defined(url) \n && published <= now()\n && passwordLocked != true \n && references(\'' + taxonomyDetails.id + '\')\n ]';
|
|
265
265
|
articlesQuerySorts = 'order(published desc)[$from...$to]';
|
|
266
|
-
articlesQueryProjection = '{\n title,\n summary,\n thumbnail,\n url,\n published,\n contentCategory->\n }';
|
|
266
|
+
articlesQueryProjection = '{\n title,\n summary,\n thumbnail{ ..., asset-> },\n url,\n published,\n contentCategory->\n }';
|
|
267
267
|
articlesQuery = ['*'].concat(articlesQueryFilters).concat(articlesQuerySorts).concat(articlesQueryProjection).join('|');
|
|
268
268
|
totalArticlesCountQuery = 'count(' + ['*'].concat(articlesQueryFilters).join('|') + ')';
|
|
269
269
|
_context.next = 19;
|
package/dist/cjs/getQuery.js
CHANGED
|
@@ -14,7 +14,7 @@ var getQuery = function getQuery(type) {
|
|
|
14
14
|
case 'article':
|
|
15
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 }';
|
|
16
16
|
case 'publication':
|
|
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 taxonomyMapping[]->,\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 thumbnail{ ..., asset-> },\n taxonomyMapping[]->,\n pdf{asset->},\n } | order(year desc, month desc)\n }';
|
|
18
18
|
case 'issue':
|
|
19
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 && defined(published) \n && dateTime(published) <= dateTime(now())\n && passwordLock != true\n && references(^._id)] | order(published desc) {\n ...,\n authorMapping[0]->,\n contentCategory->,\n issueSection-> {\n name\n }\n }\n }\n }';
|
|
20
20
|
case 'externalResources':
|
|
@@ -396,7 +396,7 @@ MediaSeriesLanding.getInitialData = function () {
|
|
|
396
396
|
|
|
397
397
|
case 9:
|
|
398
398
|
docGroupID = _context2.sent;
|
|
399
|
-
seriesQuery = '*[_type == \'documentGroup\' && references(\'' + docGroupID._id + '\') && isSeries != false && isShow != false && defined(published) && dateTime(published) <= dateTime(now()) ] | order(published desc) [$from...$to] {\n _id,\n name,\n identifier,\n published,\n thumbnail,\n description,\n topicMapping[]->,\n isGated,\n \'pageNumber\': ' + currentPage + ',\n \'parentUrl\': \'' + identifier + '\'\n }';
|
|
399
|
+
seriesQuery = '*[_type == \'documentGroup\' && references(\'' + docGroupID._id + '\') && isSeries != false && isShow != false && defined(published) && dateTime(published) <= dateTime(now()) ] | order(published desc) [$from...$to] {\n _id,\n name,\n identifier,\n published,\n thumbnail{ ..., asset-> },\n description,\n topicMapping[]->,\n isGated,\n \'pageNumber\': ' + currentPage + ',\n \'parentUrl\': \'' + identifier + '\'\n }';
|
|
400
400
|
_context2.next = 13;
|
|
401
401
|
return client.fetch(seriesQuery, params);
|
|
402
402
|
|
|
@@ -416,7 +416,7 @@ MediaSeriesLanding.getInitialData = function () {
|
|
|
416
416
|
docGroupID = _context2.sent;
|
|
417
417
|
seriesQueryFilters = '[\n _type == \'documentGroup\' \n && references(\'' + docGroupID._id + '\') \n && isSeries != false \n && isShow != false \n && defined(published) \n && published <= now()\n ]';
|
|
418
418
|
seriesQuerySorts = 'order(published desc) [$from...$to]';
|
|
419
|
-
seriesQueryProjection = '{\n _id,\n name,\n identifier,\n published,\n thumbnail,\n description,\n topicMapping[]->,\n isGated,\n \'parentUrl\': \'' + identifier + '\'\n }';
|
|
419
|
+
seriesQueryProjection = '{\n _id,\n name,\n identifier,\n published,\n thumbnail{ ..., asset-> },\n description,\n topicMapping[]->,\n isGated,\n \'parentUrl\': \'' + identifier + '\'\n }';
|
|
420
420
|
seriesQuery = ['*'].concat(seriesQueryFilters).concat(seriesQuerySorts).concat(seriesQueryProjection).join('|');
|
|
421
421
|
totalSeriesCountQuery = 'count(' + ['*'].concat(seriesQueryFilters).join('|') + ')';
|
|
422
422
|
_context2.next = 17;
|
|
@@ -231,15 +231,15 @@ PartnerDetails.returnGetInitialProps = function () {
|
|
|
231
231
|
switch (_context.prev = _context.next) {
|
|
232
232
|
case 0:
|
|
233
233
|
today = moment().utc().format();
|
|
234
|
-
featureQuery = '*[_type == \'feature\' && is_active == true && feature_url == \'/' + partnerPageUrl + '/' + (category ? category + '/' : null) + identifier + '\'] | order(_updatedAt asc)[0..5]{\n ...,\n \'feature_img\' : feature_img.asset
|
|
235
|
-
partnerQuery = '*[_type == \'documentGroup\' \n && !(_id in path("drafts.**"))\n && references(\'' + partnerDocumentGroupID + '\')\n && identifier.current == \'' + identifier + '\'] | order(name asc) [0] {\n description,\n name,\n identifier,\n thumbnail,\n twitter,\n facebook,\n linkedin,\n "affiliates": description[_type==\'slideshows\']{\n ...,\n slides->{...}\n }\n }';
|
|
234
|
+
featureQuery = '*[_type == \'feature\' && is_active == true && feature_url == \'/' + partnerPageUrl + '/' + (category ? category + '/' : null) + identifier + '\'] | order(_updatedAt asc)[0..5]{\n ...,\n \'feature_img\' : feature_img.asset->\n }';
|
|
235
|
+
partnerQuery = '*[_type == \'documentGroup\' \n && !(_id in path("drafts.**"))\n && references(\'' + partnerDocumentGroupID + '\')\n && identifier.current == \'' + identifier + '\'] | order(name asc) [0] {\n description,\n name,\n identifier,\n thumbnail{ ..., asset-> },\n twitter,\n facebook,\n linkedin,\n "affiliates": description[_type==\'slideshows\']{\n ...,\n slides->{...}\n }\n }';
|
|
236
236
|
|
|
237
237
|
|
|
238
238
|
if (category) {
|
|
239
239
|
// if partners page has a sub category such as onclive
|
|
240
240
|
// e.g. /sap-partner/[category]/[partner]
|
|
241
241
|
|
|
242
|
-
partnerQuery = '*[_type == \'documentGroup\' && !(_id in path("drafts.**")) && identifier.current == \'' + category + '\' && references(\'' + partnerDocumentGroupID + '\')] [0] {\n ...,\n \'partner\': *[_type == \'documentGroup\' && identifier.current == \'' + identifier + '\' && references(^._id)] [0] {\n description,\n name,\n identifier,\n thumbnail,\n twitter,\n facebook,\n linkedin,\n "affiliates": description[_type==\'slideshows\']{\n ...,\n slides->{...}\n }\n \n }\n }';
|
|
242
|
+
partnerQuery = '*[_type == \'documentGroup\' && !(_id in path("drafts.**")) && identifier.current == \'' + category + '\' && references(\'' + partnerDocumentGroupID + '\')] [0] {\n ...,\n \'partner\': *[_type == \'documentGroup\' && identifier.current == \'' + identifier + '\' && references(^._id)] [0] {\n description,\n name,\n identifier,\n thumbnail{ ..., asset-> },\n twitter,\n facebook,\n linkedin,\n "affiliates": description[_type==\'slideshows\']{\n ...,\n slides->{...}\n }\n \n }\n }';
|
|
243
243
|
}
|
|
244
244
|
|
|
245
245
|
taxonomyQuery = '*[_type == \'documentGroup\' \n && !(_id in path("drafts.**"))\n && references(\'' + partnerDocumentGroupID + '\')\n && isShow != false\n && identifier.current == \'' + identifier + '\'] [0] {\n \'id\': _id,\n \'title\': name\n }';
|
|
@@ -256,7 +256,7 @@ PartnerDetails.returnGetInitialProps = function () {
|
|
|
256
256
|
features = _ref4[0];
|
|
257
257
|
partnerDetails = _ref4[1];
|
|
258
258
|
taxonomyDetails = _ref4[2];
|
|
259
|
-
articlesQuery = '*[_type == \'article\' && !(_id in path("drafts.**")) && defined(title) && is_visible == true && defined(url) && dateTime(published) <= dateTime(\'' + today + '\') && passwordLocked != true && references(\'' + taxonomyDetails.id + '\')] | order(published desc)[$from...$to]{\n title,\n summary,\n thumbnail,\n url,\n published,\n contentCategory->,\n \'pageNumber\': ' + currentPage + '\n }';
|
|
259
|
+
articlesQuery = '*[_type == \'article\' && !(_id in path("drafts.**")) && defined(title) && is_visible == true && defined(url) && dateTime(published) <= dateTime(\'' + today + '\') && passwordLocked != true && references(\'' + taxonomyDetails.id + '\')] | order(published desc)[$from...$to]{\n title,\n summary,\n thumbnail{ ..., asset-> },\n url,\n published,\n contentCategory->,\n \'pageNumber\': ' + currentPage + '\n }';
|
|
260
260
|
_context.next = 16;
|
|
261
261
|
return client.fetch(articlesQuery, params);
|
|
262
262
|
|
|
@@ -231,15 +231,15 @@ PartnerDetails.returnGetInitialProps = function () {
|
|
|
231
231
|
while (1) {
|
|
232
232
|
switch (_context.prev = _context.next) {
|
|
233
233
|
case 0:
|
|
234
|
-
featureQuery = '*[_type == \'feature\' && is_active == true && feature_url == \'/' + partnerPageUrl + '/' + (category ? category + '/' : null) + identifier + '\'] | order(_updatedAt asc)[0..5]{\n ...,\n \'feature_img\' : feature_img.asset
|
|
235
|
-
partnerQuery = '*[_type == \'documentGroup\' \n && !(_id in path("drafts.**"))\n && references(\'' + partnerDocumentGroupID + '\')\n && identifier.current == \'' + identifier + '\'] | order(name asc) [0] {\n description,\n name,\n identifier,\n thumbnail,\n twitter,\n facebook,\n linkedin,\n "affiliates": description[_type==\'slideshows\']{\n ...,\n slides->{...}\n }\n }';
|
|
234
|
+
featureQuery = '*[_type == \'feature\' && is_active == true && feature_url == \'/' + partnerPageUrl + '/' + (category ? category + '/' : null) + identifier + '\'] | order(_updatedAt asc)[0..5]{\n ...,\n \'feature_img\' : feature_img.asset->\n }';
|
|
235
|
+
partnerQuery = '*[_type == \'documentGroup\' \n && !(_id in path("drafts.**"))\n && references(\'' + partnerDocumentGroupID + '\')\n && identifier.current == \'' + identifier + '\'] | order(name asc) [0] {\n description,\n name,\n identifier,\n thumbnail{ ..., asset-> },\n twitter,\n facebook,\n linkedin,\n "affiliates": description[_type==\'slideshows\']{\n ...,\n slides->{...}\n }\n }';
|
|
236
236
|
|
|
237
237
|
|
|
238
238
|
if (category) {
|
|
239
239
|
// if partners page has a sub category such as onclive
|
|
240
240
|
// e.g. /sap-partner/[category]/[partner]
|
|
241
241
|
|
|
242
|
-
partnerQuery = '*[_type == \'documentGroup\' && !(_id in path("drafts.**")) && identifier.current == \'' + category + '\' && references(\'' + partnerDocumentGroupID + '\')] [0] {\n ...,\n \'partner\': *[_type == \'documentGroup\' && identifier.current == \'' + identifier + '\' && references(^._id)] [0] {\n description,\n name,\n identifier,\n thumbnail,\n twitter,\n facebook,\n linkedin,\n "affiliates": description[_type==\'slideshows\']{\n ...,\n slides->{...}\n }\n \n }\n }';
|
|
242
|
+
partnerQuery = '*[_type == \'documentGroup\' && !(_id in path("drafts.**")) && identifier.current == \'' + category + '\' && references(\'' + partnerDocumentGroupID + '\')] [0] {\n ...,\n \'partner\': *[_type == \'documentGroup\' && identifier.current == \'' + identifier + '\' && references(^._id)] [0] {\n description,\n name,\n identifier,\n thumbnail{ ..., asset-> },\n twitter,\n facebook,\n linkedin,\n "affiliates": description[_type==\'slideshows\']{\n ...,\n slides->{...}\n }\n \n }\n }';
|
|
243
243
|
}
|
|
244
244
|
|
|
245
245
|
taxonomyQuery = '*[_type == \'documentGroup\' \n && !(_id in path("drafts.**"))\n && references(\'' + partnerDocumentGroupID + '\')\n && isShow != false\n && identifier.current == \'' + identifier + '\'] [0] {\n \'id\': _id,\n \'title\': name\n }';
|
|
@@ -258,7 +258,7 @@ PartnerDetails.returnGetInitialProps = function () {
|
|
|
258
258
|
taxonomyDetails = _ref4[2];
|
|
259
259
|
articlesQueryFilters = '[\n _type == \'article\' \n && !(_id in path("drafts.**")) \n && defined(title) \n && is_visible == true \n && defined(url) \n && published <= now()\n && passwordLocked != true \n && references(\'' + taxonomyDetails.id + '\')\n ]';
|
|
260
260
|
articlesQuerySorts = 'order(published desc)[$from...$to]';
|
|
261
|
-
articlesQueryProjection = '{\n title,\n summary,\n thumbnail,\n url,\n published,\n contentCategory->\n }';
|
|
261
|
+
articlesQueryProjection = '{\n title,\n summary,\n thumbnail{ ..., asset-> },\n url,\n published,\n contentCategory->\n }';
|
|
262
262
|
articlesQuery = ['*'].concat(articlesQueryFilters).concat(articlesQuerySorts).concat(articlesQueryProjection).join('|');
|
|
263
263
|
totalArticlesCountQuery = 'count(' + ['*'].concat(articlesQueryFilters).join('|') + ')';
|
|
264
264
|
_context.next = 19;
|
package/dist/esm/getQuery.js
CHANGED
|
@@ -12,7 +12,7 @@ var getQuery = function getQuery(type) {
|
|
|
12
12
|
case 'article':
|
|
13
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 }';
|
|
14
14
|
case 'publication':
|
|
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 taxonomyMapping[]->,\n pdf{asset->},\n } | order(year desc, month desc)\n }';
|
|
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':
|
|
17
17
|
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 && defined(published) \n && dateTime(published) <= dateTime(now())\n && passwordLock != true\n && references(^._id)] | order(published desc) {\n ...,\n authorMapping[0]->,\n contentCategory->,\n issueSection-> {\n name\n }\n }\n }\n }';
|
|
18
18
|
case 'externalResources':
|