@mjhls/mjh-framework 1.0.455 → 1.0.456

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,5 +1,5 @@
1
1
 
2
- # mjh-framework v. 1.0.455
2
+ # mjh-framework v. 1.0.456
3
3
 
4
4
  > Foundation Framework
5
5
 
package/dist/cjs/View.js CHANGED
@@ -57,7 +57,7 @@ var getSerializers = require('./getSerializers.js');
57
57
  require('./util-f2c1b65b.js');
58
58
  require('react-bootstrap/Pagination');
59
59
  require('next/dynamic');
60
- var getTargeting = require('./getTargeting-ec7dd217.js');
60
+ var getTargeting = require('./getTargeting-37612527.js');
61
61
  var urlFor = require('./urlFor.js');
62
62
 
63
63
  var renderAuthor = function renderAuthor(authorName, authorURL, index, length) {
@@ -52,8 +52,6 @@ var getTargeting = function getTargeting(props) {
52
52
  context = context && context.split('?')[0];
53
53
  context = context && context.split('&')[0];
54
54
  var content_placement_urls = [];
55
- // New variable to store document group
56
- var document_group_urls = [];
57
55
  if (content_placement && prevUrl && prevUrl.length) {
58
56
  content_placement.forEach(function (item) {
59
57
  var path = item.path;
@@ -72,32 +70,21 @@ var getTargeting = function getTargeting(props) {
72
70
  });
73
71
  }
74
72
 
75
- // Comparing document group with previous url to store in 'document_group_urls'.
76
- if (document_group && prevUrl && prevUrl.length) {
77
- var previous_url_to_check = prevUrl;
78
- if (prevUrl.includes('?')) {
79
- previous_url_to_check = prevUrl.split('?')[0];
73
+ if (content_placement) {
74
+ if (content_placement_urls.length === 0) {
75
+ content_placement_urls = content_placement.map(function (item) {
76
+ return cpModificationRequired ? getContentPlacementUrl(item) : item.path;
77
+ });
80
78
  }
81
-
82
- if (previous_url_to_check.endsWith(document_group)) {
83
- document_group_urls.push(document_group);
84
- }
85
- }
86
-
87
- // Updating condition to set content_placement only when 'document_group_urls' and 'content_placement_urls' is empty.
88
- if (content_placement && content_placement_urls.length === 0 && document_group_urls.length === 0) {
89
- content_placement_urls = content_placement.map(function (item) {
90
- return cpModificationRequired ? getContentPlacementUrl(item) : item.path;
91
- });
79
+ } else {
80
+ content_placement_urls = ['/'];
92
81
  }
93
-
94
82
  var articleKeywords = [].concat(toConsumableArray._toConsumableArray(internalTag), toConsumableArray._toConsumableArray(userDefinedTag), toConsumableArray._toConsumableArray(SponsorshipTag), toConsumableArray._toConsumableArray(seoTag));
95
83
  var targeting = {
96
84
  tags: articleKeywords,
97
- // making sure either 'document_group' or 'content_placement' is returned in targeting.
98
- document_group: content_placement_urls && content_placement_urls.length ? '' : document_group_urls,
85
+ document_group: [document_group],
99
86
  document_url: [url],
100
- content_placement: document_group_urls && document_group_urls.length ? '' : content_placement_urls
87
+ content_placement: content_placement_urls
101
88
  };
102
89
 
103
90
  if (article.issue && article.issue.path) {
@@ -8,7 +8,7 @@ require('./from-ea347372.js');
8
8
  require('./toConsumableArray-ca04303b.js');
9
9
  require('./_object-pie-68c5bcbc.js');
10
10
  require('./extends-60837c34.js');
11
- var getTargeting = require('./getTargeting-ec7dd217.js');
11
+ var getTargeting = require('./getTargeting-37612527.js');
12
12
 
13
13
 
14
14
 
package/dist/cjs/index.js CHANGED
@@ -158,7 +158,7 @@ require('swr');
158
158
  require('passport-local');
159
159
  require('mysql');
160
160
  var View = require('./View.js');
161
- var getTargeting = require('./getTargeting-ec7dd217.js');
161
+ var getTargeting = require('./getTargeting-37612527.js');
162
162
  var urlFor = require('./urlFor.js');
163
163
  var getKeywords = require('./getKeywords.js');
164
164
  var getQuery = require('./getQuery.js');
package/dist/esm/View.js CHANGED
@@ -52,7 +52,7 @@ import getSerializers from './getSerializers.js';
52
52
  import './util-7700fc59.js';
53
53
  import 'react-bootstrap/Pagination';
54
54
  import 'next/dynamic';
55
- import { a as getContentPlacementUrl, g as getTargeting } from './getTargeting-02118961.js';
55
+ import { a as getContentPlacementUrl, g as getTargeting } from './getTargeting-8f4bd5db.js';
56
56
  import urlFor from './urlFor.js';
57
57
 
58
58
  var renderAuthor = function renderAuthor(authorName, authorURL, index, length) {
@@ -50,8 +50,6 @@ var getTargeting = function getTargeting(props) {
50
50
  context = context && context.split('?')[0];
51
51
  context = context && context.split('&')[0];
52
52
  var content_placement_urls = [];
53
- // New variable to store document group
54
- var document_group_urls = [];
55
53
  if (content_placement && prevUrl && prevUrl.length) {
56
54
  content_placement.forEach(function (item) {
57
55
  var path = item.path;
@@ -70,32 +68,21 @@ var getTargeting = function getTargeting(props) {
70
68
  });
71
69
  }
72
70
 
73
- // Comparing document group with previous url to store in 'document_group_urls'.
74
- if (document_group && prevUrl && prevUrl.length) {
75
- var previous_url_to_check = prevUrl;
76
- if (prevUrl.includes('?')) {
77
- previous_url_to_check = prevUrl.split('?')[0];
71
+ if (content_placement) {
72
+ if (content_placement_urls.length === 0) {
73
+ content_placement_urls = content_placement.map(function (item) {
74
+ return cpModificationRequired ? getContentPlacementUrl(item) : item.path;
75
+ });
78
76
  }
79
-
80
- if (previous_url_to_check.endsWith(document_group)) {
81
- document_group_urls.push(document_group);
82
- }
83
- }
84
-
85
- // Updating condition to set content_placement only when 'document_group_urls' and 'content_placement_urls' is empty.
86
- if (content_placement && content_placement_urls.length === 0 && document_group_urls.length === 0) {
87
- content_placement_urls = content_placement.map(function (item) {
88
- return cpModificationRequired ? getContentPlacementUrl(item) : item.path;
89
- });
77
+ } else {
78
+ content_placement_urls = ['/'];
90
79
  }
91
-
92
80
  var articleKeywords = [].concat(_toConsumableArray(internalTag), _toConsumableArray(userDefinedTag), _toConsumableArray(SponsorshipTag), _toConsumableArray(seoTag));
93
81
  var targeting = {
94
82
  tags: articleKeywords,
95
- // making sure either 'document_group' or 'content_placement' is returned in targeting.
96
- document_group: content_placement_urls && content_placement_urls.length ? '' : document_group_urls,
83
+ document_group: [document_group],
97
84
  document_url: [url],
98
- content_placement: document_group_urls && document_group_urls.length ? '' : content_placement_urls
85
+ content_placement: content_placement_urls
99
86
  };
100
87
 
101
88
  if (article.issue && article.issue.path) {
@@ -6,4 +6,4 @@ import './from-2c0a5f49.js';
6
6
  import './toConsumableArray-8712d678.js';
7
7
  import './_object-pie-33c40e79.js';
8
8
  import './extends-6e00b262.js';
9
- export { g as default } from './getTargeting-02118961.js';
9
+ export { g as default } from './getTargeting-8f4bd5db.js';
package/dist/esm/index.js CHANGED
@@ -154,7 +154,7 @@ import 'swr';
154
154
  import 'passport-local';
155
155
  import 'mysql';
156
156
  export { default as View } from './View.js';
157
- export { g as getTargeting } from './getTargeting-02118961.js';
157
+ export { g as getTargeting } from './getTargeting-8f4bd5db.js';
158
158
  export { default as urlFor } from './urlFor.js';
159
159
  export { default as getKeywords } from './getKeywords.js';
160
160
  export { default as getQuery } from './getQuery.js';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mjhls/mjh-framework",
3
- "version": "1.0.455",
3
+ "version": "1.0.456",
4
4
  "description": "Foundation Framework",
5
5
  "author": "mjh-framework",
6
6
  "license": "MIT",