@mjhls/mjh-framework 1.0.881-beta.0 → 1.0.881-beta.1

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.
@@ -30,7 +30,7 @@ import { V as VisibilitySensor } from './visibility-sensor-72fd8f8b.js';
30
30
  import './slicedToArray-67a08c9c.js';
31
31
  import './index-73819142.js';
32
32
  import { m as main_36 } from './main-c0612122.js';
33
- import './stringify-70b72959.js';
33
+ import { _ as _JSON$stringify } from './stringify-70b72959.js';
34
34
  import { _ as _asyncToGenerator, r as regenerator, a as _Promise } from './asyncToGenerator-64812e90.js';
35
35
  import './Segment.js';
36
36
  import './Beam.js';
@@ -39,7 +39,7 @@ import { A as ADInfeed } from './ADInfeed-0c13c803.js';
39
39
  import { l as lodash } from './lodash-17fdfebb.js';
40
40
  import { A as ADlgInfeed } from './ADlgInfeed-e4e2031a.js';
41
41
  import Spinner$1 from 'react-bootstrap/Spinner';
42
- import { P as Pagination } from './Pagination-f7c4c5ae.js';
42
+ import { P as Pagination } from './Pagination-a24855d4.js';
43
43
 
44
44
  var MasterDeck = function (_React$Component) {
45
45
  _inherits(MasterDeck, _React$Component);
@@ -56,12 +56,13 @@ var MasterDeck = function (_React$Component) {
56
56
  args[_key] = arguments[_key];
57
57
  }
58
58
 
59
- return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_ref = MasterDeck.__proto__ || _Object$getPrototypeOf(MasterDeck)).call.apply(_ref, [this].concat(args))), _this), _this.Deck = _this.props.deck, _this.variant = _this.props.variant, _this.mapping = _this.props.mapping, _this.data = _this.props.dataRecord || [], _this.query = _this.props.query, _this.params = _this.props.params, _this.pointer = _this.props.pointer ? _this.props.pointer : false, _this.pointerArray = _this.props.pointerArray ? _this.props.pointerArray : false, _this.defaultImage = _this.props.defaultImage ? _this.props.defaultImage : '/placeholder.jpg', _this.rightItems = _this.props.rightItems ? _this.props.rightItems : false, _this.isSeriesLanding = _this.props.isSeriesLanding ? _this.props.isSeriesLanding : false, _this.client = _this.props.client, _this.state = {
59
+ return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_ref = MasterDeck.__proto__ || _Object$getPrototypeOf(MasterDeck)).call.apply(_ref, [this].concat(args))), _this), _this.Deck = _this.props.deck, _this.data = _this.props.dataRecord || [], _this.pointer = _this.props.pointer ? _this.props.pointer : false, _this.pointerArray = _this.props.pointerArray ? _this.props.pointerArray : false, _this.defaultImage = _this.props.defaultImage ? _this.props.defaultImage : '/placeholder.jpg', _this.rightItems = _this.props.rightItems ? _this.props.rightItems : false, _this.isSeriesLanding = _this.props.isSeriesLanding ? _this.props.isSeriesLanding : false, _this.state = {
60
60
  isDataLoading: false,
61
61
  data: _this.data,
62
+ prevData: _this.data,
62
63
  currentPage: _this.props.currentPage || 1,
63
64
  dataRemapped: !_this.props.showBI || !_this.props.brandInsightAd,
64
- itemsPerPage: _this.params ? _this.params.to - _this.params.from : 2,
65
+ itemsPerPage: _this.props.params ? _this.props.params.to - _this.props.params.from : 2,
65
66
  mobileView: false
66
67
  }, _this.seoPagination = function (pageNumber) {
67
68
  var _this$props = _this.props,
@@ -353,17 +354,17 @@ var MasterDeck = function (_React$Component) {
353
354
  _createClass(MasterDeck, [{
354
355
  key: 'componentDidUpdate',
355
356
  value: function componentDidUpdate(prevProps, prevState) {
357
+ if (_JSON$stringify(prevState.prevData) !== _JSON$stringify(this.state.prevData)) {
358
+ this.seoPagination(this.state.currentPage);
359
+ }
356
360
  // set dataRemap to true as there are no infeed or BI ads or window width is less than limit
357
361
  if (typeof window !== 'undefined' && (!this.props.lgInfeedAd || !this.props.brandInsightAd || window.innerWidth < 1400) && !this.state.dataRemapped) {
358
362
  !this.state.dataRemapped && this.setState({ dataRemapped: true });
359
363
  }
360
-
361
364
  if (typeof window !== 'undefined' && window.innerWidth <= 1191) {
362
365
  !this.state.mobileView && this.setState({ mobileView: true });
363
366
  }
364
367
  }
365
- // Passing 'brandInsightAd','showBI' and 'lgInfeedAd'
366
-
367
368
  }, {
368
369
  key: 'render',
369
370
  value: function render() {
@@ -377,6 +378,7 @@ var MasterDeck = function (_React$Component) {
377
378
  lgInfeedAd = _props$lgInfeedAd === undefined ? false : _props$lgInfeedAd,
378
379
  totalDataCount = _props.totalDataCount;
379
380
  var _state = this.state,
381
+ data = _state.data,
380
382
  itemsPerPage = _state.itemsPerPage,
381
383
  currentPage = _state.currentPage,
382
384
  isDataLoading = _state.isDataLoading;
@@ -396,7 +398,7 @@ var MasterDeck = function (_React$Component) {
396
398
  'Loading...'
397
399
  )
398
400
  )
399
- ) : React__default.createElement(
401
+ ) : data && data.length > 0 ? React__default.createElement(
400
402
  Container$1,
401
403
  null,
402
404
  this.cardLoader({ variant: variant, brandInsightAd: brandInsightAd, showBI: showBI, lgInfeedAd: lgInfeedAd }),
@@ -415,9 +417,23 @@ var MasterDeck = function (_React$Component) {
415
417
  '\n .pagination-wrapper {\n margin: 3rem 0;\n }\n @media only screen and (max-width: 768px) {\n .pagination-wrapper {\n margin-bottom: 6rem;\n }\n }\n '
416
418
  )
417
419
  )
418
- )
420
+ ) : null
419
421
  );
420
422
  }
423
+ }], [{
424
+ key: 'getDerivedStateFromProps',
425
+ value: function getDerivedStateFromProps(props, state) {
426
+ if (_JSON$stringify(props.dataRecord) !== _JSON$stringify(state.prevData)) {
427
+ return {
428
+ data: props.dataRecord,
429
+ prevData: props.dataRecord,
430
+ currentPage: props.currentPage
431
+ };
432
+ }
433
+ return null;
434
+ }
435
+ // Passing 'brandInsightAd','showBI' and 'lgInfeedAd'
436
+
421
437
  }]);
422
438
 
423
439
  return MasterDeck;
@@ -688,6 +704,7 @@ var MasterDeck$1 = function (_React$Component) {
688
704
  content_placement: brandInsightAd.targeting.content_placement,
689
705
  document_url: brandInsightAd.targeting.document_url,
690
706
  rootDocumentGroup: brandInsightAd.targeting.rootDocumentGroup
707
+
691
708
  },
692
709
  _type: 'brandInsightAd',
693
710
  /* Passing refresh flag */
@@ -852,6 +869,7 @@ var MasterDeck$1 = function (_React$Component) {
852
869
  value: function render() {
853
870
  var _this3 = this;
854
871
 
872
+ if (this.props.totalDataCount) return React__default.createElement(MasterDeckPaginated, this.props);
855
873
  // Setting default value for 'showBI' and 'lgInfeedAd'
856
874
  var _props = this.props,
857
875
  columns = _props.columns,
@@ -864,9 +882,6 @@ var MasterDeck$1 = function (_React$Component) {
864
882
  _props$lgInfeedAd = _props.lgInfeedAd,
865
883
  lgInfeedAd = _props$lgInfeedAd === undefined ? false : _props$lgInfeedAd;
866
884
 
867
-
868
- if (this.props.totalDataCount) return React__default.createElement(MasterDeckPaginated, this.props);
869
-
870
885
  return React__default.createElement(
871
886
  'div',
872
887
  { className: 'contentDeck' },
@@ -34,7 +34,7 @@ import { L as LazyLoad } from './index-5f7e79e7.js';
34
34
  import './main-c0612122.js';
35
35
  import './entities-7cc3bf45.js';
36
36
  import './stringify-70b72959.js';
37
- import { _ as _asyncToGenerator, r as regenerator } from './asyncToGenerator-64812e90.js';
37
+ import { _ as _asyncToGenerator, r as regenerator, a as _Promise } from './asyncToGenerator-64812e90.js';
38
38
  import './Segment.js';
39
39
  import './Beam.js';
40
40
  import './AdSlot.js';
@@ -43,7 +43,7 @@ import './lodash-17fdfebb.js';
43
43
  import './ADlgInfeed-e4e2031a.js';
44
44
  import 'react-bootstrap/Button';
45
45
  import 'react-bootstrap/Spinner';
46
- import './Pagination-f7c4c5ae.js';
46
+ import './Pagination-a24855d4.js';
47
47
  import { B as BlockContent } from './BlockContent-e9b4ddcf.js';
48
48
  import './index-c7e2ac95.js';
49
49
  import './smoothscroll-0cd4c7a6.js';
@@ -9623,6 +9623,450 @@ var Filter = function Filter(_ref) {
9623
9623
  };
9624
9624
 
9625
9625
  var MediaSeriesLanding = function MediaSeriesLanding(props) {
9626
+ var client = props.client,
9627
+ pageview = props.pageview;
9628
+
9629
+ var _useState7 = useState(false),
9630
+ _useState8 = _slicedToArray(_useState7, 2),
9631
+ filterTopicID = _useState8[0],
9632
+ setFilterTopicID = _useState8[1];
9633
+
9634
+ var _useState9 = useState(props.seriesData),
9635
+ _useState10 = _slicedToArray(_useState9, 2),
9636
+ seriesData = _useState10[0],
9637
+ setSeriesData = _useState10[1];
9638
+
9639
+ var _useState11 = useState(props.totalSeriesCount),
9640
+ _useState12 = _slicedToArray(_useState11, 2),
9641
+ totalSeriesCount = _useState12[0],
9642
+ setTotalSeriesCount = _useState12[1];
9643
+
9644
+ var _useState13 = useState(props.params),
9645
+ _useState14 = _slicedToArray(_useState13, 2),
9646
+ params = _useState14[0],
9647
+ setParams = _useState14[1];
9648
+
9649
+ var _useState15 = useState(props.query),
9650
+ _useState16 = _slicedToArray(_useState15, 2),
9651
+ query = _useState16[0],
9652
+ setQuery = _useState16[1];
9653
+
9654
+ var _useState17 = useState(props.currentPage),
9655
+ _useState18 = _slicedToArray(_useState17, 2),
9656
+ currentPage = _useState18[0],
9657
+ setCurrentPage = _useState18[1];
9658
+
9659
+ useEffect(function () {
9660
+ if (filterTopicID) {
9661
+ fetchFilteredData();
9662
+ }
9663
+ }, [filterTopicID]);
9664
+
9665
+ var fetchFilteredData = function () {
9666
+ var _ref2 = _asyncToGenerator( /*#__PURE__*/regenerator.mark(function _callee() {
9667
+ var newParams, filterQuery, x, filters, sorts, projection, seriesQuery, totalSeriesCountQuery, _ref3, _ref4, newData, newDataCount;
9668
+
9669
+ return regenerator.wrap(function _callee$(_context) {
9670
+ while (1) {
9671
+ switch (_context.prev = _context.next) {
9672
+ case 0:
9673
+ newParams = _extends$2({}, params, { from: 0, to: 10 });
9674
+ filterQuery = void 0;
9675
+
9676
+ if ((typeof filterTopicID === 'undefined' ? 'undefined' : _typeof(filterTopicID)) == 'object') {
9677
+ filterQuery = '[';
9678
+ for (x = 0; x < filterTopicID.length; x++) {
9679
+ filterQuery = filterQuery + (' references(\'' + filterTopicID[x] + '\') ');
9680
+ if (x == filterTopicID.length - 1) {
9681
+ filterQuery = filterQuery + ']';
9682
+ } else {
9683
+ filterQuery = filterQuery + ' || ';
9684
+ }
9685
+ }
9686
+ } else {
9687
+ filterQuery = filterTopicID !== 'all' ? '[references(\'' + filterTopicID + '\')]' : '';
9688
+ }
9689
+
9690
+ filters = props.filters, sorts = props.sorts, projection = props.projection;
9691
+ seriesQuery = ['*'].concat([filters, filterQuery]).concat(sorts).concat(projection).join('|');
9692
+ totalSeriesCountQuery = 'count(' + ['*'].concat([filters, filterQuery]).join('|') + ')';
9693
+ _context.next = 8;
9694
+ return _Promise.all([client.fetch(seriesQuery, newParams), client.fetch(totalSeriesCountQuery)]);
9695
+
9696
+ case 8:
9697
+ _ref3 = _context.sent;
9698
+ _ref4 = _slicedToArray(_ref3, 2);
9699
+ newData = _ref4[0];
9700
+ newDataCount = _ref4[1];
9701
+
9702
+
9703
+ setParams(newParams);
9704
+ setQuery(seriesQuery);
9705
+ setSeriesData(newData);
9706
+ setTotalSeriesCount(newDataCount);
9707
+ setCurrentPage(1);
9708
+
9709
+ case 17:
9710
+ case 'end':
9711
+ return _context.stop();
9712
+ }
9713
+ }
9714
+ }, _callee, _this);
9715
+ }));
9716
+
9717
+ return function fetchFilteredData() {
9718
+ return _ref2.apply(this, arguments);
9719
+ };
9720
+ }();
9721
+
9722
+ if (props.statusCode === 404) {
9723
+ return React__default.createElement(
9724
+ 'div',
9725
+ { className: 'd-flex flex-column align-items-center mt-3' },
9726
+ React__default.createElement(
9727
+ 'h3',
9728
+ null,
9729
+ '404: Resource not found'
9730
+ ),
9731
+ React__default.createElement(
9732
+ 'p',
9733
+ null,
9734
+ 'We seem to have misplaced the page you\'re looking for. Sorry! Please try checking the URL for errors.'
9735
+ ),
9736
+ React__default.createElement(
9737
+ 'p',
9738
+ null,
9739
+ 'Click here to',
9740
+ React__default.createElement(
9741
+ Link,
9742
+ { href: '/' },
9743
+ React__default.createElement(
9744
+ 'a',
9745
+ { style: { color: 'blue', textDecoration: 'underline' } },
9746
+ ' return to homepage.'
9747
+ )
9748
+ )
9749
+ )
9750
+ );
9751
+ }
9752
+
9753
+ return React__default.createElement(
9754
+ 'div',
9755
+ { className: 'mb-5' },
9756
+ props.docGroup && props.docGroup.description && React__default.createElement(BlockContent, { blocks: props.docGroup.description, serializers: getSerializers(client) }),
9757
+ props.taxonomyFilter && props.taxonomyFilter && React__default.createElement(
9758
+ 'div',
9759
+ { className: '' },
9760
+ React__default.createElement(Filter, { setFilterTopicID: setFilterTopicID, filterData: props.taxonomyFilter }),
9761
+ React__default.createElement('hr', null)
9762
+ ),
9763
+ seriesData && React__default.createElement(MasterDeck, {
9764
+ deck: MediaSeriesCard,
9765
+ variant: 'left',
9766
+ defaultImage: '/placeholder.jpg',
9767
+ client: client,
9768
+ dataRecord: seriesData,
9769
+ totalDataCount: totalSeriesCount,
9770
+ query: query && query,
9771
+ params: params && params,
9772
+ currentPage: currentPage,
9773
+ pageview: pageview,
9774
+ autoScroll: true,
9775
+ seoPaginate: true
9776
+ })
9777
+ );
9778
+ };
9779
+
9780
+ MediaSeriesLanding.getInitialData = function () {
9781
+ var _ref5 = _asyncToGenerator( /*#__PURE__*/regenerator.mark(function _callee2(ctx, client, cache) {
9782
+ var urlQuery, pathname, req, identifier, itemsPerPage, currentPage, start, statusCode, params, docGroupID, filters, sorts, projection, seriesQuery, totalSeriesCountQuery, _ref6, _ref7, seriesData, totalSeriesCount, allSeries, buildUsedTopicsArray, usedTopics, taxonomyFilter;
9783
+
9784
+ return regenerator.wrap(function _callee2$(_context2) {
9785
+ while (1) {
9786
+ switch (_context2.prev = _context2.next) {
9787
+ case 0:
9788
+ urlQuery = ctx.query, pathname = ctx.pathname, req = ctx.req;
9789
+ identifier = pathname.replace('/', '');
9790
+ itemsPerPage = 10;
9791
+ currentPage = urlQuery.page ? parseInt(urlQuery.page) : 1;
9792
+ start = (currentPage - 1) * itemsPerPage;
9793
+ statusCode = 200;
9794
+ params = {
9795
+ count: itemsPerPage,
9796
+ from: start,
9797
+ to: start + itemsPerPage,
9798
+ url: pathname
9799
+ };
9800
+ _context2.next = 9;
9801
+ return client.fetch('*[_type == \'documentGroup\' && identifier.current == \'' + identifier + '\'][0]{\n _id, \n isGated,\n name,\n description\n }');
9802
+
9803
+ case 9:
9804
+ docGroupID = _context2.sent;
9805
+ filters = '[\n _type == \'documentGroup\' \n && references(\'' + docGroupID._id + '\') \n && isSeries != false \n && isShow != false \n && defined(published) \n && published <= now()\n ]';
9806
+ sorts = 'order(published desc) [$from...$to]';
9807
+ projection = '{\n _id,\n name,\n identifier,\n published,\n thumbnail,\n description,\n topicMapping[]->,\n isGated,\n \'parentUrl\': \'' + identifier + '\'\n }';
9808
+ seriesQuery = ['*'].concat(filters).concat(sorts).concat(projection).join('|');
9809
+ totalSeriesCountQuery = 'count(' + ['*'].concat(filters).join('|') + ')';
9810
+ _context2.next = 17;
9811
+ return _Promise.all([client.fetch(seriesQuery, params), client.fetch(totalSeriesCountQuery)]);
9812
+
9813
+ case 17:
9814
+ _ref6 = _context2.sent;
9815
+ _ref7 = _slicedToArray(_ref6, 2);
9816
+ seriesData = _ref7[0];
9817
+ totalSeriesCount = _ref7[1];
9818
+ _context2.next = 23;
9819
+ return client.fetch('*[_type == \'documentGroup\' && references(\'' + docGroupID._id + '\') && isSeries != false && isShow != false && defined(published) && dateTime(published) <= dateTime(now()) ] {\n topicMapping[]->\n }');
9820
+
9821
+ case 23:
9822
+ allSeries = _context2.sent;
9823
+
9824
+ //Take all series topicMapping and put in an array
9825
+ buildUsedTopicsArray = function buildUsedTopicsArray(seriesArray) {
9826
+ var usedTopics = [];
9827
+ for (var x = 0; x < seriesArray.length; x++) {
9828
+ if (seriesArray[x].topicMapping) {
9829
+ seriesArray[x].topicMapping.forEach(function (topic) {
9830
+ if (!usedTopics.includes(topic._id)) {
9831
+ usedTopics.push(topic._id);
9832
+ }
9833
+ });
9834
+ }
9835
+ }
9836
+ return usedTopics;
9837
+ };
9838
+
9839
+ usedTopics = buildUsedTopicsArray(allSeries);
9840
+ _context2.next = 28;
9841
+ return client.fetch('\n *[_type == \'taxonomy\' && !defined(parent) && isMainTopic]{\n _id,\n identifier,\n name,\n "children": *[_type == \'taxonomy\' && references(^._id)]{\n _id,\n name,\n identifier,\n "grandchildren": *[_type == \'taxonomy\' && references(^._id)]\n }\t\n }');
9842
+
9843
+ case 28:
9844
+ taxonomyFilter = _context2.sent;
9845
+
9846
+
9847
+ taxonomyFilter.forEach(function (topic) {
9848
+ if (topic.children) {
9849
+ topic.children.forEach(function (child) {
9850
+ if (child.grandchildren) {
9851
+ child.grandchildren = child.grandchildren.filter(function (grandchild) {
9852
+ if (!usedTopics.includes(grandchild._id)) {
9853
+ return false;
9854
+ }
9855
+ return true;
9856
+ });
9857
+ }
9858
+ if (!usedTopics.includes(child._id) || !child.grandchildren) {
9859
+ child._id = null;
9860
+ child.name = null;
9861
+ }
9862
+ });
9863
+
9864
+ topic.children = topic.children.filter(function (child) {
9865
+ return child._id !== null;
9866
+ });
9867
+ }
9868
+ });
9869
+
9870
+ if (currentPage > 1 && seriesData.length === 0) {
9871
+ statusCode = 404;
9872
+ }
9873
+
9874
+ return _context2.abrupt('return', {
9875
+ seriesData: seriesData,
9876
+ totalSeriesCount: totalSeriesCount,
9877
+ query: seriesQuery,
9878
+ filters: filters,
9879
+ sorts: sorts,
9880
+ projection: projection,
9881
+ params: params,
9882
+ currentPage: currentPage,
9883
+ taxonomyFilter: taxonomyFilter,
9884
+ identifier: identifier,
9885
+ docGroupID: docGroupID._id,
9886
+ parentUrl: identifier,
9887
+ statusCode: statusCode,
9888
+ docGroup: docGroupID
9889
+ });
9890
+
9891
+ case 32:
9892
+ case 'end':
9893
+ return _context2.stop();
9894
+ }
9895
+ }
9896
+ }, _callee2, _this);
9897
+ }));
9898
+
9899
+ return function (_x, _x2, _x3) {
9900
+ return _ref5.apply(this, arguments);
9901
+ };
9902
+ }();
9903
+
9904
+ var _this$1 = undefined;
9905
+
9906
+ var Filter$1 = function Filter(_ref) {
9907
+ var filterData = _ref.filterData,
9908
+ setFilterTopicID = _ref.setFilterTopicID;
9909
+
9910
+ if (!filterData || filterData.length == 0) return null;
9911
+
9912
+ var _useState = useState(null),
9913
+ _useState2 = _slicedToArray(_useState, 2),
9914
+ parentData = _useState2[0],
9915
+ setParentData = _useState2[1];
9916
+
9917
+ var _useState3 = useState(null),
9918
+ _useState4 = _slicedToArray(_useState3, 2),
9919
+ childData = _useState4[0],
9920
+ setChildData = _useState4[1];
9921
+
9922
+ var _useState5 = useState(null),
9923
+ _useState6 = _slicedToArray(_useState5, 2),
9924
+ grandChildData = _useState6[0],
9925
+ setGrandChildData = _useState6[1];
9926
+ /*
9927
+ {parent: showAll,
9928
+ chidlren: show selected from parent,
9929
+ grandchildren: show selected from children
9930
+ }
9931
+ */
9932
+
9933
+
9934
+ useEffect(function () {
9935
+ if (filterData.length < 2) {
9936
+ setChildData({ name: null, data: filterData[0].children, _id: filterData[0]._id });
9937
+ } else {
9938
+ setParentData({ name: null, data: filterData });
9939
+ }
9940
+ }, []);
9941
+
9942
+ var handleFilterSelect = function handleFilterSelect(group, type) {
9943
+ if (type === 'parent') {
9944
+ setParentData(function (prevState) {
9945
+ return _extends$2({}, prevState, { name: group.name ? group.name : null });
9946
+ });
9947
+ if (group && group.children && group.children.length > 0) {
9948
+ setChildData({ data: group.children, _id: group._id });
9949
+ setFilterTopicID(group._id);
9950
+ } else {
9951
+ //handle filter
9952
+ setChildData(null);
9953
+ setGrandChildData(null);
9954
+ setFilterTopicID(group._id ? group._id : 'all');
9955
+ }
9956
+ }
9957
+ if (type === 'child') {
9958
+ setChildData(function (prevState) {
9959
+ return _extends$2({}, prevState, { name: group.name ? group.name : null, _id: group._id });
9960
+ });
9961
+ if (group && group.grandchildren && group.grandchildren.length > 0) {
9962
+ setGrandChildData({ data: group.grandchildren, _id: group._id });
9963
+ setFilterTopicID(group._id);
9964
+ var topics = [];
9965
+ topics.push(group._id);
9966
+ group.grandchildren.forEach(function (topic) {
9967
+ topics.push(topic._id);
9968
+ });
9969
+ setFilterTopicID(topics);
9970
+ } else {
9971
+ //handle filter
9972
+ setGrandChildData(null);
9973
+ setFilterTopicID(group._id ? group._id : 'all');
9974
+ }
9975
+ }
9976
+ if (type === 'grandchild') {
9977
+ setGrandChildData(function (prevState) {
9978
+ return _extends$2({}, prevState, { name: group.name ? group.name : 'All', _id: group._id });
9979
+ });
9980
+ //handle filter
9981
+ if (!group._id) {
9982
+ var _topics = [];
9983
+ _topics.push(childData._id);
9984
+ grandChildData.data.forEach(function (topic) {
9985
+ _topics.push(topic._id);
9986
+ });
9987
+ setFilterTopicID(_topics);
9988
+ } else {
9989
+ setFilterTopicID([group._id, childData._id]);
9990
+ }
9991
+ }
9992
+ };
9993
+
9994
+ return React__default.createElement(
9995
+ 'div',
9996
+ { className: 'flex-container' },
9997
+ parentData && React__default.createElement(
9998
+ DropdownButton,
9999
+ { drop: 'down', style: { borderRadius: '3px' }, className: 'filter-btn', title: parentData.name ? parentData.name : 'Filter By Category' },
10000
+ React__default.createElement(
10001
+ Dropdown$1.Item,
10002
+ { onSelect: function onSelect() {
10003
+ return handleFilterSelect({}, 'parent');
10004
+ } },
10005
+ 'All'
10006
+ ),
10007
+ parentData.data.map(function (docGroup) {
10008
+ if (!docGroup._id) return null;
10009
+ return React__default.createElement(
10010
+ Dropdown$1.Item,
10011
+ { key: docGroup._id, onSelect: function onSelect() {
10012
+ return handleFilterSelect(docGroup, 'parent');
10013
+ } },
10014
+ docGroup.name
10015
+ );
10016
+ })
10017
+ ),
10018
+ childData && childData.data && childData.data.length > 0 && React__default.createElement(
10019
+ DropdownButton,
10020
+ { drop: 'down', style: { borderRadius: '3px' }, className: 'filter-btn ml-3', title: childData.name ? childData.name : 'Filter By Topic' },
10021
+ React__default.createElement(
10022
+ Dropdown$1.Item,
10023
+ { onSelect: function onSelect() {
10024
+ return handleFilterSelect({}, 'child');
10025
+ } },
10026
+ 'All'
10027
+ ),
10028
+ childData.data.map(function (docGroup) {
10029
+ if (!docGroup._id) return null;
10030
+ return React__default.createElement(
10031
+ Dropdown$1.Item,
10032
+ { key: docGroup._id, onSelect: function onSelect() {
10033
+ return handleFilterSelect(docGroup, 'child');
10034
+ } },
10035
+ docGroup.name
10036
+ );
10037
+ })
10038
+ ),
10039
+ grandChildData && grandChildData.data && grandChildData.data.length > 0 && React__default.createElement(
10040
+ DropdownButton,
10041
+ { drop: 'down', style: { borderRadius: '3px' }, className: 'filter-btn ml-3', title: grandChildData.name ? grandChildData.name : 'Select Sub Topic' },
10042
+ React__default.createElement(
10043
+ Dropdown$1.Item,
10044
+ { onSelect: function onSelect() {
10045
+ return handleFilterSelect({}, 'grandchild');
10046
+ } },
10047
+ 'All'
10048
+ ),
10049
+ grandChildData.data.map(function (docGroup) {
10050
+ if (!docGroup._id) return null;
10051
+ return React__default.createElement(
10052
+ Dropdown$1.Item,
10053
+ { key: docGroup._id, onSelect: function onSelect() {
10054
+ return handleFilterSelect(docGroup, 'grandchild');
10055
+ } },
10056
+ docGroup.name
10057
+ );
10058
+ })
10059
+ ),
10060
+ React__default.createElement(
10061
+ 'style',
10062
+ { jsx: 'true' },
10063
+ '\n .flex-container {\n display: flex;\n flex-direction: row;\n align-items: center;\n }\n .filter-btn button {\n border-radius: 3px;\n z-index: 99999;\n }\n .filter-btn .dropdown-menu {\n z-index: 9999999;\n }\n @media (max-width: 768px) {\n .flex-container {\n flex-direction: column;\n align-items: flex-start;\n }\n }\n '
10064
+ )
10065
+ );
10066
+ };
10067
+
10068
+ var MediaSeriesLanding$1 = function MediaSeriesLanding$1(props) {
10069
+ if (props.totalSeriesCount) return React__default.createElement(MediaSeriesLanding, props);
9626
10070
  var client = props.client,
9627
10071
  pageview = props.pageview,
9628
10072
  currentPage = props.currentPage,
@@ -9695,7 +10139,7 @@ var MediaSeriesLanding = function MediaSeriesLanding(props) {
9695
10139
  return _context.stop();
9696
10140
  }
9697
10141
  }
9698
- }, _callee, _this);
10142
+ }, _callee, _this$1);
9699
10143
  }));
9700
10144
 
9701
10145
  return function fetchFilteredData() {
@@ -9741,7 +10185,7 @@ var MediaSeriesLanding = function MediaSeriesLanding(props) {
9741
10185
  props.taxonomyFilter && props.taxonomyFilter && React__default.createElement(
9742
10186
  'div',
9743
10187
  { className: '' },
9744
- React__default.createElement(Filter, { setFilterTopicID: setFilterTopicID, filterData: props.taxonomyFilter }),
10188
+ React__default.createElement(Filter$1, { setFilterTopicID: setFilterTopicID, filterData: props.taxonomyFilter }),
9745
10189
  React__default.createElement('hr', null)
9746
10190
  ),
9747
10191
  seriesData && React__default.createElement(MasterDeck, {
@@ -9760,7 +10204,7 @@ var MediaSeriesLanding = function MediaSeriesLanding(props) {
9760
10204
  );
9761
10205
  };
9762
10206
 
9763
- MediaSeriesLanding.getInitialData = function () {
10207
+ MediaSeriesLanding$1.getInitialData = function () {
9764
10208
  var _ref3 = _asyncToGenerator( /*#__PURE__*/regenerator.mark(function _callee2(ctx, client, cache) {
9765
10209
  var _ref4;
9766
10210
 
@@ -9855,12 +10299,13 @@ MediaSeriesLanding.getInitialData = function () {
9855
10299
  return _context2.stop();
9856
10300
  }
9857
10301
  }
9858
- }, _callee2, _this);
10302
+ }, _callee2, _this$1);
9859
10303
  }));
9860
10304
 
9861
10305
  return function (_x, _x2, _x3) {
9862
10306
  return _ref3.apply(this, arguments);
9863
10307
  };
9864
10308
  }();
10309
+ MediaSeriesLanding$1.getInitialData = MediaSeriesLanding.getInitialData;
9865
10310
 
9866
- export default MediaSeriesLanding;
10311
+ export default MediaSeriesLanding$1;
@@ -17,8 +17,6 @@ var Pagination = function Pagination(props) {
17
17
  pageRangeDisplayed = _props$pageRangeDispl === undefined ? 5 : _props$pageRangeDispl,
18
18
  _props$currentPage = props.currentPage,
19
19
  currentPage = _props$currentPage === undefined ? 1 : _props$currentPage,
20
- _props$disableInitial = props.disableInitialCallback,
21
- disableInitialCallback = _props$disableInitial === undefined ? true : _props$disableInitial,
22
20
  _onPageChange = props.onPageChange;
23
21
 
24
22
  if (!pageCount || pageCount <= 0) return null;
@@ -30,7 +28,6 @@ var Pagination = function Pagination(props) {
30
28
  marginPagesDisplayed: marginPagesDisplayed,
31
29
  pageRangeDisplayed: pageRangeDisplayed,
32
30
  forcePage: currentPage - 1,
33
- disableInitialCallback: disableInitialCallback,
34
31
  onPageChange: function onPageChange(_ref) {
35
32
  var selected = _ref.selected;
36
33
  return _onPageChange(selected + 1);
@@ -43,7 +43,7 @@ import './ADlgInfeed-e4e2031a.js';
43
43
  import './getContentCategory-15dcc413.js';
44
44
  import './AuthorComponent-e6f95c2f.js';
45
45
  import 'react-bootstrap/Button';
46
- import './Pagination-f7c4c5ae.js';
46
+ import './Pagination-a24855d4.js';
47
47
  import { B as BlockContent } from './BlockContent-e9b4ddcf.js';
48
48
  import { r as reactSocialIcons_1 } from './react-social-icons-a7d5c5c7.js';
49
49
  import './index-c7e2ac95.js';
@@ -35,7 +35,7 @@ import './lodash-17fdfebb.js';
35
35
  import './ADlgInfeed-e4e2031a.js';
36
36
  import './getContentCategory-15dcc413.js';
37
37
  import './AuthorComponent-e6f95c2f.js';
38
- import './Pagination-f7c4c5ae.js';
38
+ import './Pagination-a24855d4.js';
39
39
  import 'react-bootstrap';
40
40
  import './timeDifferenceCalc.js';
41
41
  import QueueDeckExpanded from './QueueDeckExpanded.js';
@@ -35,7 +35,7 @@ import { l as lodash } from './lodash-17fdfebb.js';
35
35
  import { A as ADlgInfeed } from './ADlgInfeed-e4e2031a.js';
36
36
  import { g as getContentCategory } from './getContentCategory-15dcc413.js';
37
37
  import { A as AuthorComponent } from './AuthorComponent-e6f95c2f.js';
38
- import { P as Pagination } from './Pagination-f7c4c5ae.js';
38
+ import { P as Pagination } from './Pagination-a24855d4.js';
39
39
  import { Spinner, Container, Media } from 'react-bootstrap';
40
40
  import timeDifferenceCalc from './timeDifferenceCalc.js';
41
41