@mjhls/mjh-framework 1.0.1068-publication-pixel-v3 → 1.0.1068-publication-pixel-v4

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.
@@ -140,9 +140,8 @@ var PixelTrackingArticle = React__default['default'].memo(function (_ref2) {
140
140
  }
141
141
 
142
142
  //publication issue
143
- if (article.issue && article.issue.pixelTrackingCode) {
143
+ if (article.issue && article.issue.pixelTrackingCode && article.issue.pixelTrackingArticleDetail) {
144
144
  if (article.issue.pixelTrackingCode.trackingCode && article.issue.pixelTrackingCode.is_active) {
145
- // console.log('has pixel code: docGroup :', article.documentGroup.pixelTrackingCode.trackingCode)
146
145
  if (!trackingArray.includes(article.issue.pixelTrackingCode.trackingCode)) {
147
146
  trackingArray.push(article.issue.pixelTrackingCode.trackingCode);
148
147
  }
@@ -17,7 +17,7 @@ var getQuery = function getQuery(type) {
17
17
  case 'publication':
18
18
  return '*[_type == \'publication\'\n && identifier.current == $publication\n ' + conditions + '][0] {\n ' + params + '\n ...,\n \'issues\': *[_type == \'publication\'\n && is_visible\n && references(^._id)\n && defined(identifier)] {\n ...,\n thumbnail{ ..., asset-> },\n taxonomyMapping[]->,\n pdf{asset->}\n } | order(year desc, month desc)\n }';
19
19
  case 'issue':
20
- return '*[_type == \'publication\'\n && identifier.current == $publication\n ' + conditions + '][0] {\n ' + params + '\n ...,\n \'issue\': *[_type == \'publication\'\n && references(^._id)\n && is_visible != false\n && identifier.current == $issue][0] {\n ...,\n pixelTrackingCode->,\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 thumbnail{ ..., asset-> },\n authorMapping[0]->,\n contentCategory->,\n issueSection-> {\n name\n },\n \'pageNumber\': 1\n }\n }\n }';
20
+ return '*[_type == \'publication\'\n && identifier.current == $publication\n ' + conditions + '][0] {\n ' + params + '\n ...,\n \'issue\': *[_type == \'publication\'\n && references(^._id)\n && is_visible != false\n && identifier.current == $issue][0] {\n ...,\n pixelTrackingCode->,\n pixelTrackingArticleDetail,\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 thumbnail{ ..., asset-> },\n authorMapping[0]->,\n contentCategory->,\n issueSection-> {\n name\n },\n \'pageNumber\': 1\n }\n }\n }';
21
21
  case 'externalResources':
22
22
  return '{\n \'archived\': *[_type == "external" && archived && isVisible ' + conditions + '] | order(displayDate desc){ ..., thumbnail{ ..., asset-> }},\n \'recent\': *[_type == "external" && archived != true && isVisible ' + conditions + '] | order(displayDate asc){ ..., thumbnail{ ..., asset-> }}\n }';
23
23
  case 'mediaseries':
@@ -132,9 +132,8 @@ var PixelTrackingArticle = React__default.memo(function (_ref2) {
132
132
  }
133
133
 
134
134
  //publication issue
135
- if (article.issue && article.issue.pixelTrackingCode) {
135
+ if (article.issue && article.issue.pixelTrackingCode && article.issue.pixelTrackingArticleDetail) {
136
136
  if (article.issue.pixelTrackingCode.trackingCode && article.issue.pixelTrackingCode.is_active) {
137
- // console.log('has pixel code: docGroup :', article.documentGroup.pixelTrackingCode.trackingCode)
138
137
  if (!trackingArray.includes(article.issue.pixelTrackingCode.trackingCode)) {
139
138
  trackingArray.push(article.issue.pixelTrackingCode.trackingCode);
140
139
  }
@@ -15,7 +15,7 @@ var getQuery = function getQuery(type) {
15
15
  case 'publication':
16
16
  return '*[_type == \'publication\'\n && identifier.current == $publication\n ' + conditions + '][0] {\n ' + params + '\n ...,\n \'issues\': *[_type == \'publication\'\n && is_visible\n && references(^._id)\n && defined(identifier)] {\n ...,\n thumbnail{ ..., asset-> },\n taxonomyMapping[]->,\n pdf{asset->}\n } | order(year desc, month desc)\n }';
17
17
  case 'issue':
18
- return '*[_type == \'publication\'\n && identifier.current == $publication\n ' + conditions + '][0] {\n ' + params + '\n ...,\n \'issue\': *[_type == \'publication\'\n && references(^._id)\n && is_visible != false\n && identifier.current == $issue][0] {\n ...,\n pixelTrackingCode->,\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 thumbnail{ ..., asset-> },\n authorMapping[0]->,\n contentCategory->,\n issueSection-> {\n name\n },\n \'pageNumber\': 1\n }\n }\n }';
18
+ return '*[_type == \'publication\'\n && identifier.current == $publication\n ' + conditions + '][0] {\n ' + params + '\n ...,\n \'issue\': *[_type == \'publication\'\n && references(^._id)\n && is_visible != false\n && identifier.current == $issue][0] {\n ...,\n pixelTrackingCode->,\n pixelTrackingArticleDetail,\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 thumbnail{ ..., asset-> },\n authorMapping[0]->,\n contentCategory->,\n issueSection-> {\n name\n },\n \'pageNumber\': 1\n }\n }\n }';
19
19
  case 'externalResources':
20
20
  return '{\n \'archived\': *[_type == "external" && archived && isVisible ' + conditions + '] | order(displayDate desc){ ..., thumbnail{ ..., asset-> }},\n \'recent\': *[_type == "external" && archived != true && isVisible ' + conditions + '] | order(displayDate asc){ ..., thumbnail{ ..., asset-> }}\n }';
21
21
  case 'mediaseries':
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mjhls/mjh-framework",
3
- "version": "1.0.1068-publication-pixel-v3",
3
+ "version": "1.0.1068-publication-pixel-v4",
4
4
  "description": "Foundation Framework",
5
5
  "author": "mjh-framework",
6
6
  "license": "MIT",