@mjhls/mjh-framework 1.0.977-docgroup-test → 1.0.977-docgroup-test-v2

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/dist/cjs/View.js CHANGED
@@ -853,6 +853,17 @@ var RelevantTopics = function RelevantTopics(props) {
853
853
  return null;
854
854
  };
855
855
 
856
+ var checkDocGroupMappingForSeries = function checkDocGroupMappingForSeries(docGroupArray) {
857
+
858
+ for (var i = 0; i < docGroupArray.length; i++) {
859
+ if (docGroupArray[i].isSeries) {
860
+ return docGroupArray[i];
861
+ }
862
+ }
863
+
864
+ return false;
865
+ };
866
+
856
867
  var Article = React__default['default'].memo(React.forwardRef(function (props, ref) {
857
868
  var onVote = function () {
858
869
  var _ref = asyncToGenerator._asyncToGenerator( /*#__PURE__*/asyncToGenerator.regenerator.mark(function _callee(nodeKey, selectedChoice) {
@@ -982,6 +993,7 @@ var Article = React__default['default'].memo(React.forwardRef(function (props, r
982
993
  if (article && article.documentGroup && article.documentGroup.hideSeriesSlider === true) {
983
994
  sliderData = null;
984
995
  }
996
+
985
997
  //next video url
986
998
  if (sliderData) {
987
999
  var nextArticle = void 0;
@@ -1302,7 +1314,7 @@ var Article = React__default['default'].memo(React.forwardRef(function (props, r
1302
1314
  var isMediaSeries = false;
1303
1315
  if (article.documentGroup && article.documentGroup.isSeries) {
1304
1316
  isMediaSeries = true;
1305
- } else if (!article.documentGroup && article.documentGroupMapping && article.documentGroupMapping[0] && article.documentGroupMapping[0].isSeries) {
1317
+ } else if (!article.documentGroup && article.documentGroupMapping && checkDocGroupMappingForSeries(article.documentGroupMapping)) {
1306
1318
  isMediaSeries = true;
1307
1319
  }
1308
1320
 
@@ -1577,9 +1589,10 @@ var Article = React__default['default'].memo(React.forwardRef(function (props, r
1577
1589
  if (article.documentGroup && article.documentGroup.isSeries) {
1578
1590
  isMediaSeries = true;
1579
1591
  mediaSeriesName = article.documentGroup.name;
1580
- } else if (!article.documentGroup && article.documentGroupMapping && article.documentGroupMapping[0] && article.documentGroupMapping[0].isSeries) {
1592
+ }
1593
+ if (!article.documentGroup && article.documentGroupMapping && checkDocGroupMappingForSeries(article.documentGroupMapping)) {
1581
1594
  isMediaSeries = true;
1582
- mediaSeriesName = article.documentGroupMapping[0].name;
1595
+ mediaSeriesName = checkDocGroupMappingForSeries(article.documentGroupMapping).name;
1583
1596
  }
1584
1597
 
1585
1598
  return React__default['default'].createElement(
@@ -2273,7 +2286,7 @@ var View = function View(props) {
2273
2286
  if (article.documentGroup && article.documentGroup.isSeries) {
2274
2287
  isMediaSeries = true;
2275
2288
  }
2276
- if (!article.documentGroup && article.documentGroupMapping && article.documentGroupMapping[0] && article.documentGroupMapping[0].isSeries) {
2289
+ if (!article.documentGroup && article.documentGroupMapping && checkDocGroupMappingForSeries(article.documentGroupMapping)) {
2277
2290
  isMediaSeries = true;
2278
2291
  }
2279
2292
 
package/dist/esm/View.js CHANGED
@@ -842,6 +842,17 @@ var RelevantTopics = function RelevantTopics(props) {
842
842
  return null;
843
843
  };
844
844
 
845
+ var checkDocGroupMappingForSeries = function checkDocGroupMappingForSeries(docGroupArray) {
846
+
847
+ for (var i = 0; i < docGroupArray.length; i++) {
848
+ if (docGroupArray[i].isSeries) {
849
+ return docGroupArray[i];
850
+ }
851
+ }
852
+
853
+ return false;
854
+ };
855
+
845
856
  var Article = React__default.memo(forwardRef(function (props, ref) {
846
857
  var onVote = function () {
847
858
  var _ref = _asyncToGenerator( /*#__PURE__*/regenerator.mark(function _callee(nodeKey, selectedChoice) {
@@ -971,6 +982,7 @@ var Article = React__default.memo(forwardRef(function (props, ref) {
971
982
  if (article && article.documentGroup && article.documentGroup.hideSeriesSlider === true) {
972
983
  sliderData = null;
973
984
  }
985
+
974
986
  //next video url
975
987
  if (sliderData) {
976
988
  var nextArticle = void 0;
@@ -1291,7 +1303,7 @@ var Article = React__default.memo(forwardRef(function (props, ref) {
1291
1303
  var isMediaSeries = false;
1292
1304
  if (article.documentGroup && article.documentGroup.isSeries) {
1293
1305
  isMediaSeries = true;
1294
- } else if (!article.documentGroup && article.documentGroupMapping && article.documentGroupMapping[0] && article.documentGroupMapping[0].isSeries) {
1306
+ } else if (!article.documentGroup && article.documentGroupMapping && checkDocGroupMappingForSeries(article.documentGroupMapping)) {
1295
1307
  isMediaSeries = true;
1296
1308
  }
1297
1309
 
@@ -1566,9 +1578,10 @@ var Article = React__default.memo(forwardRef(function (props, ref) {
1566
1578
  if (article.documentGroup && article.documentGroup.isSeries) {
1567
1579
  isMediaSeries = true;
1568
1580
  mediaSeriesName = article.documentGroup.name;
1569
- } else if (!article.documentGroup && article.documentGroupMapping && article.documentGroupMapping[0] && article.documentGroupMapping[0].isSeries) {
1581
+ }
1582
+ if (!article.documentGroup && article.documentGroupMapping && checkDocGroupMappingForSeries(article.documentGroupMapping)) {
1570
1583
  isMediaSeries = true;
1571
- mediaSeriesName = article.documentGroupMapping[0].name;
1584
+ mediaSeriesName = checkDocGroupMappingForSeries(article.documentGroupMapping).name;
1572
1585
  }
1573
1586
 
1574
1587
  return React__default.createElement(
@@ -2262,7 +2275,7 @@ var View = function View(props) {
2262
2275
  if (article.documentGroup && article.documentGroup.isSeries) {
2263
2276
  isMediaSeries = true;
2264
2277
  }
2265
- if (!article.documentGroup && article.documentGroupMapping && article.documentGroupMapping[0] && article.documentGroupMapping[0].isSeries) {
2278
+ if (!article.documentGroup && article.documentGroupMapping && checkDocGroupMappingForSeries(article.documentGroupMapping)) {
2266
2279
  isMediaSeries = true;
2267
2280
  }
2268
2281
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mjhls/mjh-framework",
3
- "version": "1.0.977-docgroup-test",
3
+ "version": "1.0.977-docgroup-test-v2",
4
4
  "description": "Foundation Framework",
5
5
  "author": "mjh-framework",
6
6
  "license": "MIT",