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

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
@@ -165,8 +165,13 @@ var DocumentGroup = function DocumentGroup(_ref) {
165
165
  if (article.documentGroup && article.documentGroup.isShow !== false && article.documentGroup.isSeries !== true) {
166
166
  mediaSeriesGroup = article.documentGroup;
167
167
  }
168
- if (!article.documentGroup && article.documentGroupMapping && article.documentGroupMapping[0] && article.documentGroupMapping[0].isShow !== false && article.documentGroupMapping[0].isSeries !== true) {
169
- mediaSeriesGroup = article.documentGroupMapping[0];
168
+ if (!article.documentGroup && article.documentGroupMapping) {
169
+ for (var i = 0; i < documentGroupMapping.length; i++) {
170
+ if (article.documentGroupMapping[i].isShow !== false && article.documentGroupMapping[i].isSeries !== true) {
171
+ mediaSeriesGroup = article.documentGroupMapping[i];
172
+ break;
173
+ }
174
+ }
170
175
  }
171
176
 
172
177
  if (!mediaSeriesGroup) {
@@ -853,6 +858,17 @@ var RelevantTopics = function RelevantTopics(props) {
853
858
  return null;
854
859
  };
855
860
 
861
+ var checkDocGroupMappingForSeries = function checkDocGroupMappingForSeries(docGroupArray) {
862
+
863
+ for (var i = 0; i < docGroupArray.length; i++) {
864
+ if (docGroupArray[i].isSeries) {
865
+ return docGroupArray[i];
866
+ }
867
+ }
868
+
869
+ return false;
870
+ };
871
+
856
872
  var Article = React__default['default'].memo(React.forwardRef(function (props, ref) {
857
873
  var onVote = function () {
858
874
  var _ref = asyncToGenerator._asyncToGenerator( /*#__PURE__*/asyncToGenerator.regenerator.mark(function _callee(nodeKey, selectedChoice) {
@@ -982,6 +998,7 @@ var Article = React__default['default'].memo(React.forwardRef(function (props, r
982
998
  if (article && article.documentGroup && article.documentGroup.hideSeriesSlider === true) {
983
999
  sliderData = null;
984
1000
  }
1001
+
985
1002
  //next video url
986
1003
  if (sliderData) {
987
1004
  var nextArticle = void 0;
@@ -1302,7 +1319,7 @@ var Article = React__default['default'].memo(React.forwardRef(function (props, r
1302
1319
  var isMediaSeries = false;
1303
1320
  if (article.documentGroup && article.documentGroup.isSeries) {
1304
1321
  isMediaSeries = true;
1305
- } else if (!article.documentGroup && article.documentGroupMapping && article.documentGroupMapping[0] && article.documentGroupMapping[0].isSeries) {
1322
+ } else if (!article.documentGroup && article.documentGroupMapping && checkDocGroupMappingForSeries(article.documentGroupMapping)) {
1306
1323
  isMediaSeries = true;
1307
1324
  }
1308
1325
 
@@ -1577,9 +1594,10 @@ var Article = React__default['default'].memo(React.forwardRef(function (props, r
1577
1594
  if (article.documentGroup && article.documentGroup.isSeries) {
1578
1595
  isMediaSeries = true;
1579
1596
  mediaSeriesName = article.documentGroup.name;
1580
- } else if (!article.documentGroup && article.documentGroupMapping && article.documentGroupMapping[0] && article.documentGroupMapping[0].isSeries) {
1597
+ }
1598
+ if (!article.documentGroup && article.documentGroupMapping && checkDocGroupMappingForSeries(article.documentGroupMapping)) {
1581
1599
  isMediaSeries = true;
1582
- mediaSeriesName = article.documentGroupMapping[0].name;
1600
+ mediaSeriesName = checkDocGroupMappingForSeries(article.documentGroupMapping).name;
1583
1601
  }
1584
1602
 
1585
1603
  return React__default['default'].createElement(
@@ -2273,7 +2291,7 @@ var View = function View(props) {
2273
2291
  if (article.documentGroup && article.documentGroup.isSeries) {
2274
2292
  isMediaSeries = true;
2275
2293
  }
2276
- if (!article.documentGroup && article.documentGroupMapping && article.documentGroupMapping[0] && article.documentGroupMapping[0].isSeries) {
2294
+ if (!article.documentGroup && article.documentGroupMapping && checkDocGroupMappingForSeries(article.documentGroupMapping)) {
2277
2295
  isMediaSeries = true;
2278
2296
  }
2279
2297
 
package/dist/esm/View.js CHANGED
@@ -154,8 +154,13 @@ var DocumentGroup = function DocumentGroup(_ref) {
154
154
  if (article.documentGroup && article.documentGroup.isShow !== false && article.documentGroup.isSeries !== true) {
155
155
  mediaSeriesGroup = article.documentGroup;
156
156
  }
157
- if (!article.documentGroup && article.documentGroupMapping && article.documentGroupMapping[0] && article.documentGroupMapping[0].isShow !== false && article.documentGroupMapping[0].isSeries !== true) {
158
- mediaSeriesGroup = article.documentGroupMapping[0];
157
+ if (!article.documentGroup && article.documentGroupMapping) {
158
+ for (var i = 0; i < documentGroupMapping.length; i++) {
159
+ if (article.documentGroupMapping[i].isShow !== false && article.documentGroupMapping[i].isSeries !== true) {
160
+ mediaSeriesGroup = article.documentGroupMapping[i];
161
+ break;
162
+ }
163
+ }
159
164
  }
160
165
 
161
166
  if (!mediaSeriesGroup) {
@@ -842,6 +847,17 @@ var RelevantTopics = function RelevantTopics(props) {
842
847
  return null;
843
848
  };
844
849
 
850
+ var checkDocGroupMappingForSeries = function checkDocGroupMappingForSeries(docGroupArray) {
851
+
852
+ for (var i = 0; i < docGroupArray.length; i++) {
853
+ if (docGroupArray[i].isSeries) {
854
+ return docGroupArray[i];
855
+ }
856
+ }
857
+
858
+ return false;
859
+ };
860
+
845
861
  var Article = React__default.memo(forwardRef(function (props, ref) {
846
862
  var onVote = function () {
847
863
  var _ref = _asyncToGenerator( /*#__PURE__*/regenerator.mark(function _callee(nodeKey, selectedChoice) {
@@ -971,6 +987,7 @@ var Article = React__default.memo(forwardRef(function (props, ref) {
971
987
  if (article && article.documentGroup && article.documentGroup.hideSeriesSlider === true) {
972
988
  sliderData = null;
973
989
  }
990
+
974
991
  //next video url
975
992
  if (sliderData) {
976
993
  var nextArticle = void 0;
@@ -1291,7 +1308,7 @@ var Article = React__default.memo(forwardRef(function (props, ref) {
1291
1308
  var isMediaSeries = false;
1292
1309
  if (article.documentGroup && article.documentGroup.isSeries) {
1293
1310
  isMediaSeries = true;
1294
- } else if (!article.documentGroup && article.documentGroupMapping && article.documentGroupMapping[0] && article.documentGroupMapping[0].isSeries) {
1311
+ } else if (!article.documentGroup && article.documentGroupMapping && checkDocGroupMappingForSeries(article.documentGroupMapping)) {
1295
1312
  isMediaSeries = true;
1296
1313
  }
1297
1314
 
@@ -1566,9 +1583,10 @@ var Article = React__default.memo(forwardRef(function (props, ref) {
1566
1583
  if (article.documentGroup && article.documentGroup.isSeries) {
1567
1584
  isMediaSeries = true;
1568
1585
  mediaSeriesName = article.documentGroup.name;
1569
- } else if (!article.documentGroup && article.documentGroupMapping && article.documentGroupMapping[0] && article.documentGroupMapping[0].isSeries) {
1586
+ }
1587
+ if (!article.documentGroup && article.documentGroupMapping && checkDocGroupMappingForSeries(article.documentGroupMapping)) {
1570
1588
  isMediaSeries = true;
1571
- mediaSeriesName = article.documentGroupMapping[0].name;
1589
+ mediaSeriesName = checkDocGroupMappingForSeries(article.documentGroupMapping).name;
1572
1590
  }
1573
1591
 
1574
1592
  return React__default.createElement(
@@ -2262,7 +2280,7 @@ var View = function View(props) {
2262
2280
  if (article.documentGroup && article.documentGroup.isSeries) {
2263
2281
  isMediaSeries = true;
2264
2282
  }
2265
- if (!article.documentGroup && article.documentGroupMapping && article.documentGroupMapping[0] && article.documentGroupMapping[0].isSeries) {
2283
+ if (!article.documentGroup && article.documentGroupMapping && checkDocGroupMappingForSeries(article.documentGroupMapping)) {
2266
2284
  isMediaSeries = true;
2267
2285
  }
2268
2286
 
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-v3",
4
4
  "description": "Foundation Framework",
5
5
  "author": "mjh-framework",
6
6
  "license": "MIT",