@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.
- package/dist/cjs/ArticleSeriesLandingPage.js +1 -1
- package/dist/cjs/DeckQueue.js +27 -5
- package/dist/cjs/IssueLanding.js +1 -1
- package/dist/cjs/MasterDeck.js +27 -12
- package/dist/cjs/MediaSeriesLanding.js +451 -6
- package/dist/cjs/{Pagination-d6a59f99.js → Pagination-f3ef7bc1.js} +0 -3
- package/dist/cjs/PartnerDetailListing.js +1 -1
- package/dist/cjs/PubSection.js +1 -1
- package/dist/cjs/QueueDeckExpanded.js +1 -1
- package/dist/cjs/VideoSeriesLandingPage.js +1 -1
- package/dist/cjs/index.js +1 -1
- package/dist/esm/ArticleSeriesLandingPage.js +1 -1
- package/dist/esm/DeckQueue.js +27 -5
- package/dist/esm/IssueLanding.js +1 -1
- package/dist/esm/MasterDeck.js +27 -12
- package/dist/esm/MediaSeriesLanding.js +452 -7
- package/dist/esm/{Pagination-f7c4c5ae.js → Pagination-a24855d4.js} +0 -3
- package/dist/esm/PartnerDetailListing.js +1 -1
- package/dist/esm/PubSection.js +1 -1
- package/dist/esm/QueueDeckExpanded.js +1 -1
- package/dist/esm/VideoSeriesLandingPage.js +1 -1
- package/dist/esm/index.js +1 -1
- package/package.json +1 -1
|
@@ -49,7 +49,7 @@ require('./lodash-fc2922d0.js');
|
|
|
49
49
|
require('./ADlgInfeed-c39c7131.js');
|
|
50
50
|
require('react-bootstrap/Button');
|
|
51
51
|
require('react-bootstrap/Spinner');
|
|
52
|
-
require('./Pagination-
|
|
52
|
+
require('./Pagination-f3ef7bc1.js');
|
|
53
53
|
var BlockContent = require('./BlockContent-091a991f.js');
|
|
54
54
|
require('./index-187c967e.js');
|
|
55
55
|
require('./smoothscroll-5054361f.js');
|
|
@@ -9629,6 +9629,450 @@ var Filter = function Filter(_ref) {
|
|
|
9629
9629
|
};
|
|
9630
9630
|
|
|
9631
9631
|
var MediaSeriesLanding = function MediaSeriesLanding(props) {
|
|
9632
|
+
var client = props.client,
|
|
9633
|
+
pageview = props.pageview;
|
|
9634
|
+
|
|
9635
|
+
var _useState7 = React.useState(false),
|
|
9636
|
+
_useState8 = slicedToArray._slicedToArray(_useState7, 2),
|
|
9637
|
+
filterTopicID = _useState8[0],
|
|
9638
|
+
setFilterTopicID = _useState8[1];
|
|
9639
|
+
|
|
9640
|
+
var _useState9 = React.useState(props.seriesData),
|
|
9641
|
+
_useState10 = slicedToArray._slicedToArray(_useState9, 2),
|
|
9642
|
+
seriesData = _useState10[0],
|
|
9643
|
+
setSeriesData = _useState10[1];
|
|
9644
|
+
|
|
9645
|
+
var _useState11 = React.useState(props.totalSeriesCount),
|
|
9646
|
+
_useState12 = slicedToArray._slicedToArray(_useState11, 2),
|
|
9647
|
+
totalSeriesCount = _useState12[0],
|
|
9648
|
+
setTotalSeriesCount = _useState12[1];
|
|
9649
|
+
|
|
9650
|
+
var _useState13 = React.useState(props.params),
|
|
9651
|
+
_useState14 = slicedToArray._slicedToArray(_useState13, 2),
|
|
9652
|
+
params = _useState14[0],
|
|
9653
|
+
setParams = _useState14[1];
|
|
9654
|
+
|
|
9655
|
+
var _useState15 = React.useState(props.query),
|
|
9656
|
+
_useState16 = slicedToArray._slicedToArray(_useState15, 2),
|
|
9657
|
+
query = _useState16[0],
|
|
9658
|
+
setQuery = _useState16[1];
|
|
9659
|
+
|
|
9660
|
+
var _useState17 = React.useState(props.currentPage),
|
|
9661
|
+
_useState18 = slicedToArray._slicedToArray(_useState17, 2),
|
|
9662
|
+
currentPage = _useState18[0],
|
|
9663
|
+
setCurrentPage = _useState18[1];
|
|
9664
|
+
|
|
9665
|
+
React.useEffect(function () {
|
|
9666
|
+
if (filterTopicID) {
|
|
9667
|
+
fetchFilteredData();
|
|
9668
|
+
}
|
|
9669
|
+
}, [filterTopicID]);
|
|
9670
|
+
|
|
9671
|
+
var fetchFilteredData = function () {
|
|
9672
|
+
var _ref2 = asyncToGenerator$1._asyncToGenerator( /*#__PURE__*/asyncToGenerator$1.regenerator.mark(function _callee() {
|
|
9673
|
+
var newParams, filterQuery, x, filters, sorts, projection, seriesQuery, totalSeriesCountQuery, _ref3, _ref4, newData, newDataCount;
|
|
9674
|
+
|
|
9675
|
+
return asyncToGenerator$1.regenerator.wrap(function _callee$(_context) {
|
|
9676
|
+
while (1) {
|
|
9677
|
+
switch (_context.prev = _context.next) {
|
|
9678
|
+
case 0:
|
|
9679
|
+
newParams = _extends$1._extends({}, params, { from: 0, to: 10 });
|
|
9680
|
+
filterQuery = void 0;
|
|
9681
|
+
|
|
9682
|
+
if ((typeof filterTopicID === 'undefined' ? 'undefined' : _typeof._typeof(filterTopicID)) == 'object') {
|
|
9683
|
+
filterQuery = '[';
|
|
9684
|
+
for (x = 0; x < filterTopicID.length; x++) {
|
|
9685
|
+
filterQuery = filterQuery + (' references(\'' + filterTopicID[x] + '\') ');
|
|
9686
|
+
if (x == filterTopicID.length - 1) {
|
|
9687
|
+
filterQuery = filterQuery + ']';
|
|
9688
|
+
} else {
|
|
9689
|
+
filterQuery = filterQuery + ' || ';
|
|
9690
|
+
}
|
|
9691
|
+
}
|
|
9692
|
+
} else {
|
|
9693
|
+
filterQuery = filterTopicID !== 'all' ? '[references(\'' + filterTopicID + '\')]' : '';
|
|
9694
|
+
}
|
|
9695
|
+
|
|
9696
|
+
filters = props.filters, sorts = props.sorts, projection = props.projection;
|
|
9697
|
+
seriesQuery = ['*'].concat([filters, filterQuery]).concat(sorts).concat(projection).join('|');
|
|
9698
|
+
totalSeriesCountQuery = 'count(' + ['*'].concat([filters, filterQuery]).join('|') + ')';
|
|
9699
|
+
_context.next = 8;
|
|
9700
|
+
return asyncToGenerator$1._Promise.all([client.fetch(seriesQuery, newParams), client.fetch(totalSeriesCountQuery)]);
|
|
9701
|
+
|
|
9702
|
+
case 8:
|
|
9703
|
+
_ref3 = _context.sent;
|
|
9704
|
+
_ref4 = slicedToArray._slicedToArray(_ref3, 2);
|
|
9705
|
+
newData = _ref4[0];
|
|
9706
|
+
newDataCount = _ref4[1];
|
|
9707
|
+
|
|
9708
|
+
|
|
9709
|
+
setParams(newParams);
|
|
9710
|
+
setQuery(seriesQuery);
|
|
9711
|
+
setSeriesData(newData);
|
|
9712
|
+
setTotalSeriesCount(newDataCount);
|
|
9713
|
+
setCurrentPage(1);
|
|
9714
|
+
|
|
9715
|
+
case 17:
|
|
9716
|
+
case 'end':
|
|
9717
|
+
return _context.stop();
|
|
9718
|
+
}
|
|
9719
|
+
}
|
|
9720
|
+
}, _callee, _this);
|
|
9721
|
+
}));
|
|
9722
|
+
|
|
9723
|
+
return function fetchFilteredData() {
|
|
9724
|
+
return _ref2.apply(this, arguments);
|
|
9725
|
+
};
|
|
9726
|
+
}();
|
|
9727
|
+
|
|
9728
|
+
if (props.statusCode === 404) {
|
|
9729
|
+
return React__default.createElement(
|
|
9730
|
+
'div',
|
|
9731
|
+
{ className: 'd-flex flex-column align-items-center mt-3' },
|
|
9732
|
+
React__default.createElement(
|
|
9733
|
+
'h3',
|
|
9734
|
+
null,
|
|
9735
|
+
'404: Resource not found'
|
|
9736
|
+
),
|
|
9737
|
+
React__default.createElement(
|
|
9738
|
+
'p',
|
|
9739
|
+
null,
|
|
9740
|
+
'We seem to have misplaced the page you\'re looking for. Sorry! Please try checking the URL for errors.'
|
|
9741
|
+
),
|
|
9742
|
+
React__default.createElement(
|
|
9743
|
+
'p',
|
|
9744
|
+
null,
|
|
9745
|
+
'Click here to',
|
|
9746
|
+
React__default.createElement(
|
|
9747
|
+
Link,
|
|
9748
|
+
{ href: '/' },
|
|
9749
|
+
React__default.createElement(
|
|
9750
|
+
'a',
|
|
9751
|
+
{ style: { color: 'blue', textDecoration: 'underline' } },
|
|
9752
|
+
' return to homepage.'
|
|
9753
|
+
)
|
|
9754
|
+
)
|
|
9755
|
+
)
|
|
9756
|
+
);
|
|
9757
|
+
}
|
|
9758
|
+
|
|
9759
|
+
return React__default.createElement(
|
|
9760
|
+
'div',
|
|
9761
|
+
{ className: 'mb-5' },
|
|
9762
|
+
props.docGroup && props.docGroup.description && React__default.createElement(BlockContent.BlockContent, { blocks: props.docGroup.description, serializers: getSerializers.getSerializers(client) }),
|
|
9763
|
+
props.taxonomyFilter && props.taxonomyFilter && React__default.createElement(
|
|
9764
|
+
'div',
|
|
9765
|
+
{ className: '' },
|
|
9766
|
+
React__default.createElement(Filter, { setFilterTopicID: setFilterTopicID, filterData: props.taxonomyFilter }),
|
|
9767
|
+
React__default.createElement('hr', null)
|
|
9768
|
+
),
|
|
9769
|
+
seriesData && React__default.createElement(MasterDeck, {
|
|
9770
|
+
deck: MediaSeriesCard,
|
|
9771
|
+
variant: 'left',
|
|
9772
|
+
defaultImage: '/placeholder.jpg',
|
|
9773
|
+
client: client,
|
|
9774
|
+
dataRecord: seriesData,
|
|
9775
|
+
totalDataCount: totalSeriesCount,
|
|
9776
|
+
query: query && query,
|
|
9777
|
+
params: params && params,
|
|
9778
|
+
currentPage: currentPage,
|
|
9779
|
+
pageview: pageview,
|
|
9780
|
+
autoScroll: true,
|
|
9781
|
+
seoPaginate: true
|
|
9782
|
+
})
|
|
9783
|
+
);
|
|
9784
|
+
};
|
|
9785
|
+
|
|
9786
|
+
MediaSeriesLanding.getInitialData = function () {
|
|
9787
|
+
var _ref5 = asyncToGenerator$1._asyncToGenerator( /*#__PURE__*/asyncToGenerator$1.regenerator.mark(function _callee2(ctx, client, cache) {
|
|
9788
|
+
var urlQuery, pathname, req, identifier, itemsPerPage, currentPage, start, statusCode, params, docGroupID, filters, sorts, projection, seriesQuery, totalSeriesCountQuery, _ref6, _ref7, seriesData, totalSeriesCount, allSeries, buildUsedTopicsArray, usedTopics, taxonomyFilter;
|
|
9789
|
+
|
|
9790
|
+
return asyncToGenerator$1.regenerator.wrap(function _callee2$(_context2) {
|
|
9791
|
+
while (1) {
|
|
9792
|
+
switch (_context2.prev = _context2.next) {
|
|
9793
|
+
case 0:
|
|
9794
|
+
urlQuery = ctx.query, pathname = ctx.pathname, req = ctx.req;
|
|
9795
|
+
identifier = pathname.replace('/', '');
|
|
9796
|
+
itemsPerPage = 10;
|
|
9797
|
+
currentPage = urlQuery.page ? parseInt(urlQuery.page) : 1;
|
|
9798
|
+
start = (currentPage - 1) * itemsPerPage;
|
|
9799
|
+
statusCode = 200;
|
|
9800
|
+
params = {
|
|
9801
|
+
count: itemsPerPage,
|
|
9802
|
+
from: start,
|
|
9803
|
+
to: start + itemsPerPage,
|
|
9804
|
+
url: pathname
|
|
9805
|
+
};
|
|
9806
|
+
_context2.next = 9;
|
|
9807
|
+
return client.fetch('*[_type == \'documentGroup\' && identifier.current == \'' + identifier + '\'][0]{\n _id, \n isGated,\n name,\n description\n }');
|
|
9808
|
+
|
|
9809
|
+
case 9:
|
|
9810
|
+
docGroupID = _context2.sent;
|
|
9811
|
+
filters = '[\n _type == \'documentGroup\' \n && references(\'' + docGroupID._id + '\') \n && isSeries != false \n && isShow != false \n && defined(published) \n && published <= now()\n ]';
|
|
9812
|
+
sorts = 'order(published desc) [$from...$to]';
|
|
9813
|
+
projection = '{\n _id,\n name,\n identifier,\n published,\n thumbnail,\n description,\n topicMapping[]->,\n isGated,\n \'parentUrl\': \'' + identifier + '\'\n }';
|
|
9814
|
+
seriesQuery = ['*'].concat(filters).concat(sorts).concat(projection).join('|');
|
|
9815
|
+
totalSeriesCountQuery = 'count(' + ['*'].concat(filters).join('|') + ')';
|
|
9816
|
+
_context2.next = 17;
|
|
9817
|
+
return asyncToGenerator$1._Promise.all([client.fetch(seriesQuery, params), client.fetch(totalSeriesCountQuery)]);
|
|
9818
|
+
|
|
9819
|
+
case 17:
|
|
9820
|
+
_ref6 = _context2.sent;
|
|
9821
|
+
_ref7 = slicedToArray._slicedToArray(_ref6, 2);
|
|
9822
|
+
seriesData = _ref7[0];
|
|
9823
|
+
totalSeriesCount = _ref7[1];
|
|
9824
|
+
_context2.next = 23;
|
|
9825
|
+
return client.fetch('*[_type == \'documentGroup\' && references(\'' + docGroupID._id + '\') && isSeries != false && isShow != false && defined(published) && dateTime(published) <= dateTime(now()) ] {\n topicMapping[]->\n }');
|
|
9826
|
+
|
|
9827
|
+
case 23:
|
|
9828
|
+
allSeries = _context2.sent;
|
|
9829
|
+
|
|
9830
|
+
//Take all series topicMapping and put in an array
|
|
9831
|
+
buildUsedTopicsArray = function buildUsedTopicsArray(seriesArray) {
|
|
9832
|
+
var usedTopics = [];
|
|
9833
|
+
for (var x = 0; x < seriesArray.length; x++) {
|
|
9834
|
+
if (seriesArray[x].topicMapping) {
|
|
9835
|
+
seriesArray[x].topicMapping.forEach(function (topic) {
|
|
9836
|
+
if (!usedTopics.includes(topic._id)) {
|
|
9837
|
+
usedTopics.push(topic._id);
|
|
9838
|
+
}
|
|
9839
|
+
});
|
|
9840
|
+
}
|
|
9841
|
+
}
|
|
9842
|
+
return usedTopics;
|
|
9843
|
+
};
|
|
9844
|
+
|
|
9845
|
+
usedTopics = buildUsedTopicsArray(allSeries);
|
|
9846
|
+
_context2.next = 28;
|
|
9847
|
+
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 }');
|
|
9848
|
+
|
|
9849
|
+
case 28:
|
|
9850
|
+
taxonomyFilter = _context2.sent;
|
|
9851
|
+
|
|
9852
|
+
|
|
9853
|
+
taxonomyFilter.forEach(function (topic) {
|
|
9854
|
+
if (topic.children) {
|
|
9855
|
+
topic.children.forEach(function (child) {
|
|
9856
|
+
if (child.grandchildren) {
|
|
9857
|
+
child.grandchildren = child.grandchildren.filter(function (grandchild) {
|
|
9858
|
+
if (!usedTopics.includes(grandchild._id)) {
|
|
9859
|
+
return false;
|
|
9860
|
+
}
|
|
9861
|
+
return true;
|
|
9862
|
+
});
|
|
9863
|
+
}
|
|
9864
|
+
if (!usedTopics.includes(child._id) || !child.grandchildren) {
|
|
9865
|
+
child._id = null;
|
|
9866
|
+
child.name = null;
|
|
9867
|
+
}
|
|
9868
|
+
});
|
|
9869
|
+
|
|
9870
|
+
topic.children = topic.children.filter(function (child) {
|
|
9871
|
+
return child._id !== null;
|
|
9872
|
+
});
|
|
9873
|
+
}
|
|
9874
|
+
});
|
|
9875
|
+
|
|
9876
|
+
if (currentPage > 1 && seriesData.length === 0) {
|
|
9877
|
+
statusCode = 404;
|
|
9878
|
+
}
|
|
9879
|
+
|
|
9880
|
+
return _context2.abrupt('return', {
|
|
9881
|
+
seriesData: seriesData,
|
|
9882
|
+
totalSeriesCount: totalSeriesCount,
|
|
9883
|
+
query: seriesQuery,
|
|
9884
|
+
filters: filters,
|
|
9885
|
+
sorts: sorts,
|
|
9886
|
+
projection: projection,
|
|
9887
|
+
params: params,
|
|
9888
|
+
currentPage: currentPage,
|
|
9889
|
+
taxonomyFilter: taxonomyFilter,
|
|
9890
|
+
identifier: identifier,
|
|
9891
|
+
docGroupID: docGroupID._id,
|
|
9892
|
+
parentUrl: identifier,
|
|
9893
|
+
statusCode: statusCode,
|
|
9894
|
+
docGroup: docGroupID
|
|
9895
|
+
});
|
|
9896
|
+
|
|
9897
|
+
case 32:
|
|
9898
|
+
case 'end':
|
|
9899
|
+
return _context2.stop();
|
|
9900
|
+
}
|
|
9901
|
+
}
|
|
9902
|
+
}, _callee2, _this);
|
|
9903
|
+
}));
|
|
9904
|
+
|
|
9905
|
+
return function (_x, _x2, _x3) {
|
|
9906
|
+
return _ref5.apply(this, arguments);
|
|
9907
|
+
};
|
|
9908
|
+
}();
|
|
9909
|
+
|
|
9910
|
+
var _this$1 = undefined;
|
|
9911
|
+
|
|
9912
|
+
var Filter$1 = function Filter(_ref) {
|
|
9913
|
+
var filterData = _ref.filterData,
|
|
9914
|
+
setFilterTopicID = _ref.setFilterTopicID;
|
|
9915
|
+
|
|
9916
|
+
if (!filterData || filterData.length == 0) return null;
|
|
9917
|
+
|
|
9918
|
+
var _useState = React.useState(null),
|
|
9919
|
+
_useState2 = slicedToArray._slicedToArray(_useState, 2),
|
|
9920
|
+
parentData = _useState2[0],
|
|
9921
|
+
setParentData = _useState2[1];
|
|
9922
|
+
|
|
9923
|
+
var _useState3 = React.useState(null),
|
|
9924
|
+
_useState4 = slicedToArray._slicedToArray(_useState3, 2),
|
|
9925
|
+
childData = _useState4[0],
|
|
9926
|
+
setChildData = _useState4[1];
|
|
9927
|
+
|
|
9928
|
+
var _useState5 = React.useState(null),
|
|
9929
|
+
_useState6 = slicedToArray._slicedToArray(_useState5, 2),
|
|
9930
|
+
grandChildData = _useState6[0],
|
|
9931
|
+
setGrandChildData = _useState6[1];
|
|
9932
|
+
/*
|
|
9933
|
+
{parent: showAll,
|
|
9934
|
+
chidlren: show selected from parent,
|
|
9935
|
+
grandchildren: show selected from children
|
|
9936
|
+
}
|
|
9937
|
+
*/
|
|
9938
|
+
|
|
9939
|
+
|
|
9940
|
+
React.useEffect(function () {
|
|
9941
|
+
if (filterData.length < 2) {
|
|
9942
|
+
setChildData({ name: null, data: filterData[0].children, _id: filterData[0]._id });
|
|
9943
|
+
} else {
|
|
9944
|
+
setParentData({ name: null, data: filterData });
|
|
9945
|
+
}
|
|
9946
|
+
}, []);
|
|
9947
|
+
|
|
9948
|
+
var handleFilterSelect = function handleFilterSelect(group, type) {
|
|
9949
|
+
if (type === 'parent') {
|
|
9950
|
+
setParentData(function (prevState) {
|
|
9951
|
+
return _extends$1._extends({}, prevState, { name: group.name ? group.name : null });
|
|
9952
|
+
});
|
|
9953
|
+
if (group && group.children && group.children.length > 0) {
|
|
9954
|
+
setChildData({ data: group.children, _id: group._id });
|
|
9955
|
+
setFilterTopicID(group._id);
|
|
9956
|
+
} else {
|
|
9957
|
+
//handle filter
|
|
9958
|
+
setChildData(null);
|
|
9959
|
+
setGrandChildData(null);
|
|
9960
|
+
setFilterTopicID(group._id ? group._id : 'all');
|
|
9961
|
+
}
|
|
9962
|
+
}
|
|
9963
|
+
if (type === 'child') {
|
|
9964
|
+
setChildData(function (prevState) {
|
|
9965
|
+
return _extends$1._extends({}, prevState, { name: group.name ? group.name : null, _id: group._id });
|
|
9966
|
+
});
|
|
9967
|
+
if (group && group.grandchildren && group.grandchildren.length > 0) {
|
|
9968
|
+
setGrandChildData({ data: group.grandchildren, _id: group._id });
|
|
9969
|
+
setFilterTopicID(group._id);
|
|
9970
|
+
var topics = [];
|
|
9971
|
+
topics.push(group._id);
|
|
9972
|
+
group.grandchildren.forEach(function (topic) {
|
|
9973
|
+
topics.push(topic._id);
|
|
9974
|
+
});
|
|
9975
|
+
setFilterTopicID(topics);
|
|
9976
|
+
} else {
|
|
9977
|
+
//handle filter
|
|
9978
|
+
setGrandChildData(null);
|
|
9979
|
+
setFilterTopicID(group._id ? group._id : 'all');
|
|
9980
|
+
}
|
|
9981
|
+
}
|
|
9982
|
+
if (type === 'grandchild') {
|
|
9983
|
+
setGrandChildData(function (prevState) {
|
|
9984
|
+
return _extends$1._extends({}, prevState, { name: group.name ? group.name : 'All', _id: group._id });
|
|
9985
|
+
});
|
|
9986
|
+
//handle filter
|
|
9987
|
+
if (!group._id) {
|
|
9988
|
+
var _topics = [];
|
|
9989
|
+
_topics.push(childData._id);
|
|
9990
|
+
grandChildData.data.forEach(function (topic) {
|
|
9991
|
+
_topics.push(topic._id);
|
|
9992
|
+
});
|
|
9993
|
+
setFilterTopicID(_topics);
|
|
9994
|
+
} else {
|
|
9995
|
+
setFilterTopicID([group._id, childData._id]);
|
|
9996
|
+
}
|
|
9997
|
+
}
|
|
9998
|
+
};
|
|
9999
|
+
|
|
10000
|
+
return React__default.createElement(
|
|
10001
|
+
'div',
|
|
10002
|
+
{ className: 'flex-container' },
|
|
10003
|
+
parentData && React__default.createElement(
|
|
10004
|
+
DropdownButton,
|
|
10005
|
+
{ drop: 'down', style: { borderRadius: '3px' }, className: 'filter-btn', title: parentData.name ? parentData.name : 'Filter By Category' },
|
|
10006
|
+
React__default.createElement(
|
|
10007
|
+
Dropdown$1.Item,
|
|
10008
|
+
{ onSelect: function onSelect() {
|
|
10009
|
+
return handleFilterSelect({}, 'parent');
|
|
10010
|
+
} },
|
|
10011
|
+
'All'
|
|
10012
|
+
),
|
|
10013
|
+
parentData.data.map(function (docGroup) {
|
|
10014
|
+
if (!docGroup._id) return null;
|
|
10015
|
+
return React__default.createElement(
|
|
10016
|
+
Dropdown$1.Item,
|
|
10017
|
+
{ key: docGroup._id, onSelect: function onSelect() {
|
|
10018
|
+
return handleFilterSelect(docGroup, 'parent');
|
|
10019
|
+
} },
|
|
10020
|
+
docGroup.name
|
|
10021
|
+
);
|
|
10022
|
+
})
|
|
10023
|
+
),
|
|
10024
|
+
childData && childData.data && childData.data.length > 0 && React__default.createElement(
|
|
10025
|
+
DropdownButton,
|
|
10026
|
+
{ drop: 'down', style: { borderRadius: '3px' }, className: 'filter-btn ml-3', title: childData.name ? childData.name : 'Filter By Topic' },
|
|
10027
|
+
React__default.createElement(
|
|
10028
|
+
Dropdown$1.Item,
|
|
10029
|
+
{ onSelect: function onSelect() {
|
|
10030
|
+
return handleFilterSelect({}, 'child');
|
|
10031
|
+
} },
|
|
10032
|
+
'All'
|
|
10033
|
+
),
|
|
10034
|
+
childData.data.map(function (docGroup) {
|
|
10035
|
+
if (!docGroup._id) return null;
|
|
10036
|
+
return React__default.createElement(
|
|
10037
|
+
Dropdown$1.Item,
|
|
10038
|
+
{ key: docGroup._id, onSelect: function onSelect() {
|
|
10039
|
+
return handleFilterSelect(docGroup, 'child');
|
|
10040
|
+
} },
|
|
10041
|
+
docGroup.name
|
|
10042
|
+
);
|
|
10043
|
+
})
|
|
10044
|
+
),
|
|
10045
|
+
grandChildData && grandChildData.data && grandChildData.data.length > 0 && React__default.createElement(
|
|
10046
|
+
DropdownButton,
|
|
10047
|
+
{ drop: 'down', style: { borderRadius: '3px' }, className: 'filter-btn ml-3', title: grandChildData.name ? grandChildData.name : 'Select Sub Topic' },
|
|
10048
|
+
React__default.createElement(
|
|
10049
|
+
Dropdown$1.Item,
|
|
10050
|
+
{ onSelect: function onSelect() {
|
|
10051
|
+
return handleFilterSelect({}, 'grandchild');
|
|
10052
|
+
} },
|
|
10053
|
+
'All'
|
|
10054
|
+
),
|
|
10055
|
+
grandChildData.data.map(function (docGroup) {
|
|
10056
|
+
if (!docGroup._id) return null;
|
|
10057
|
+
return React__default.createElement(
|
|
10058
|
+
Dropdown$1.Item,
|
|
10059
|
+
{ key: docGroup._id, onSelect: function onSelect() {
|
|
10060
|
+
return handleFilterSelect(docGroup, 'grandchild');
|
|
10061
|
+
} },
|
|
10062
|
+
docGroup.name
|
|
10063
|
+
);
|
|
10064
|
+
})
|
|
10065
|
+
),
|
|
10066
|
+
React__default.createElement(
|
|
10067
|
+
'style',
|
|
10068
|
+
{ jsx: 'true' },
|
|
10069
|
+
'\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 '
|
|
10070
|
+
)
|
|
10071
|
+
);
|
|
10072
|
+
};
|
|
10073
|
+
|
|
10074
|
+
var MediaSeriesLanding$1 = function MediaSeriesLanding$1(props) {
|
|
10075
|
+
if (props.totalSeriesCount) return React__default.createElement(MediaSeriesLanding, props);
|
|
9632
10076
|
var client = props.client,
|
|
9633
10077
|
pageview = props.pageview,
|
|
9634
10078
|
currentPage = props.currentPage,
|
|
@@ -9701,7 +10145,7 @@ var MediaSeriesLanding = function MediaSeriesLanding(props) {
|
|
|
9701
10145
|
return _context.stop();
|
|
9702
10146
|
}
|
|
9703
10147
|
}
|
|
9704
|
-
}, _callee, _this);
|
|
10148
|
+
}, _callee, _this$1);
|
|
9705
10149
|
}));
|
|
9706
10150
|
|
|
9707
10151
|
return function fetchFilteredData() {
|
|
@@ -9747,7 +10191,7 @@ var MediaSeriesLanding = function MediaSeriesLanding(props) {
|
|
|
9747
10191
|
props.taxonomyFilter && props.taxonomyFilter && React__default.createElement(
|
|
9748
10192
|
'div',
|
|
9749
10193
|
{ className: '' },
|
|
9750
|
-
React__default.createElement(Filter, { setFilterTopicID: setFilterTopicID, filterData: props.taxonomyFilter }),
|
|
10194
|
+
React__default.createElement(Filter$1, { setFilterTopicID: setFilterTopicID, filterData: props.taxonomyFilter }),
|
|
9751
10195
|
React__default.createElement('hr', null)
|
|
9752
10196
|
),
|
|
9753
10197
|
seriesData && React__default.createElement(MasterDeck, {
|
|
@@ -9766,7 +10210,7 @@ var MediaSeriesLanding = function MediaSeriesLanding(props) {
|
|
|
9766
10210
|
);
|
|
9767
10211
|
};
|
|
9768
10212
|
|
|
9769
|
-
MediaSeriesLanding.getInitialData = function () {
|
|
10213
|
+
MediaSeriesLanding$1.getInitialData = function () {
|
|
9770
10214
|
var _ref3 = asyncToGenerator$1._asyncToGenerator( /*#__PURE__*/asyncToGenerator$1.regenerator.mark(function _callee2(ctx, client, cache) {
|
|
9771
10215
|
var _ref4;
|
|
9772
10216
|
|
|
@@ -9861,12 +10305,13 @@ MediaSeriesLanding.getInitialData = function () {
|
|
|
9861
10305
|
return _context2.stop();
|
|
9862
10306
|
}
|
|
9863
10307
|
}
|
|
9864
|
-
}, _callee2, _this);
|
|
10308
|
+
}, _callee2, _this$1);
|
|
9865
10309
|
}));
|
|
9866
10310
|
|
|
9867
10311
|
return function (_x, _x2, _x3) {
|
|
9868
10312
|
return _ref3.apply(this, arguments);
|
|
9869
10313
|
};
|
|
9870
10314
|
}();
|
|
10315
|
+
MediaSeriesLanding$1.getInitialData = MediaSeriesLanding.getInitialData;
|
|
9871
10316
|
|
|
9872
|
-
module.exports = MediaSeriesLanding;
|
|
10317
|
+
module.exports = MediaSeriesLanding$1;
|
|
@@ -22,8 +22,6 @@ var Pagination = function Pagination(props) {
|
|
|
22
22
|
pageRangeDisplayed = _props$pageRangeDispl === undefined ? 5 : _props$pageRangeDispl,
|
|
23
23
|
_props$currentPage = props.currentPage,
|
|
24
24
|
currentPage = _props$currentPage === undefined ? 1 : _props$currentPage,
|
|
25
|
-
_props$disableInitial = props.disableInitialCallback,
|
|
26
|
-
disableInitialCallback = _props$disableInitial === undefined ? true : _props$disableInitial,
|
|
27
25
|
_onPageChange = props.onPageChange;
|
|
28
26
|
|
|
29
27
|
if (!pageCount || pageCount <= 0) return null;
|
|
@@ -35,7 +33,6 @@ var Pagination = function Pagination(props) {
|
|
|
35
33
|
marginPagesDisplayed: marginPagesDisplayed,
|
|
36
34
|
pageRangeDisplayed: pageRangeDisplayed,
|
|
37
35
|
forcePage: currentPage - 1,
|
|
38
|
-
disableInitialCallback: disableInitialCallback,
|
|
39
36
|
onPageChange: function onPageChange(_ref) {
|
|
40
37
|
var selected = _ref.selected;
|
|
41
38
|
return _onPageChange(selected + 1);
|
|
@@ -49,7 +49,7 @@ require('./ADlgInfeed-c39c7131.js');
|
|
|
49
49
|
require('./getContentCategory-f38a4c00.js');
|
|
50
50
|
require('./AuthorComponent-02e827ae.js');
|
|
51
51
|
require('react-bootstrap/Button');
|
|
52
|
-
require('./Pagination-
|
|
52
|
+
require('./Pagination-f3ef7bc1.js');
|
|
53
53
|
var BlockContent = require('./BlockContent-091a991f.js');
|
|
54
54
|
var reactSocialIcons = require('./react-social-icons-f7f48f71.js');
|
|
55
55
|
require('./index-187c967e.js');
|
package/dist/cjs/PubSection.js
CHANGED
|
@@ -40,7 +40,7 @@ require('./lodash-fc2922d0.js');
|
|
|
40
40
|
require('./ADlgInfeed-c39c7131.js');
|
|
41
41
|
require('./getContentCategory-f38a4c00.js');
|
|
42
42
|
require('./AuthorComponent-02e827ae.js');
|
|
43
|
-
require('./Pagination-
|
|
43
|
+
require('./Pagination-f3ef7bc1.js');
|
|
44
44
|
require('react-bootstrap');
|
|
45
45
|
require('./timeDifferenceCalc.js');
|
|
46
46
|
var QueueDeckExpanded = require('./QueueDeckExpanded.js');
|
|
@@ -41,7 +41,7 @@ var lodash = require('./lodash-fc2922d0.js');
|
|
|
41
41
|
var ADlgInfeed = require('./ADlgInfeed-c39c7131.js');
|
|
42
42
|
var getContentCategory = require('./getContentCategory-f38a4c00.js');
|
|
43
43
|
var AuthorComponent = require('./AuthorComponent-02e827ae.js');
|
|
44
|
-
var Pagination = require('./Pagination-
|
|
44
|
+
var Pagination = require('./Pagination-f3ef7bc1.js');
|
|
45
45
|
var reactBootstrap = require('react-bootstrap');
|
|
46
46
|
var timeDifferenceCalc = require('./timeDifferenceCalc.js');
|
|
47
47
|
|
|
@@ -46,7 +46,7 @@ require('./ADInfeed-2e48af77.js');
|
|
|
46
46
|
require('./lodash-fc2922d0.js');
|
|
47
47
|
require('./ADlgInfeed-c39c7131.js');
|
|
48
48
|
require('react-bootstrap/Spinner');
|
|
49
|
-
require('./Pagination-
|
|
49
|
+
require('./Pagination-f3ef7bc1.js');
|
|
50
50
|
var index$3 = require('./index-187c967e.js');
|
|
51
51
|
var MasterDeck = require('./MasterDeck.js');
|
|
52
52
|
require('react-bootstrap/Breadcrumb');
|
package/dist/cjs/index.js
CHANGED
|
@@ -57,7 +57,7 @@ require('./AuthorComponent-02e827ae.js');
|
|
|
57
57
|
require('react-bootstrap/Button');
|
|
58
58
|
var GridContent = require('./GridContent.js');
|
|
59
59
|
require('react-bootstrap/Spinner');
|
|
60
|
-
require('./Pagination-
|
|
60
|
+
require('./Pagination-f3ef7bc1.js');
|
|
61
61
|
var DeckQueue = require('./DeckQueue.js');
|
|
62
62
|
require('react-bootstrap/Media');
|
|
63
63
|
var ThumbnailCard = require('./ThumbnailCard.js');
|
|
@@ -39,7 +39,7 @@ import './ADInfeed-0c13c803.js';
|
|
|
39
39
|
import './lodash-17fdfebb.js';
|
|
40
40
|
import './ADlgInfeed-e4e2031a.js';
|
|
41
41
|
import 'react-bootstrap/Spinner';
|
|
42
|
-
import './Pagination-
|
|
42
|
+
import './Pagination-a24855d4.js';
|
|
43
43
|
import MasterDeck from './MasterDeck.js';
|
|
44
44
|
|
|
45
45
|
var _this = undefined;
|
package/dist/esm/DeckQueue.js
CHANGED
|
@@ -33,11 +33,12 @@ import urlFor from './urlFor.js';
|
|
|
33
33
|
import { L as LazyLoad } from './index-5f7e79e7.js';
|
|
34
34
|
import { m as main_36 } from './main-c0612122.js';
|
|
35
35
|
import { c as clean_html_1 } from './entities-7cc3bf45.js';
|
|
36
|
+
import { _ as _JSON$stringify } from './stringify-70b72959.js';
|
|
36
37
|
import { _ as _asyncToGenerator, r as regenerator } from './asyncToGenerator-64812e90.js';
|
|
37
38
|
import { g as get_1 } from './get-1e515072.js';
|
|
38
39
|
import './eq-b470f743.js';
|
|
39
40
|
import Spinner$1 from 'react-bootstrap/Spinner';
|
|
40
|
-
import { P as Pagination } from './Pagination-
|
|
41
|
+
import { P as Pagination } from './Pagination-a24855d4.js';
|
|
41
42
|
|
|
42
43
|
var DeckQueue = function (_React$Component) {
|
|
43
44
|
_inherits(DeckQueue, _React$Component);
|
|
@@ -54,11 +55,12 @@ var DeckQueue = function (_React$Component) {
|
|
|
54
55
|
args[_key] = arguments[_key];
|
|
55
56
|
}
|
|
56
57
|
|
|
57
|
-
return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_ref = DeckQueue.__proto__ || _Object$getPrototypeOf(DeckQueue)).call.apply(_ref, [this].concat(args))), _this), _this.page = _this.props.page, _this.data = _this.props.dataRecord, _this.
|
|
58
|
+
return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_ref = DeckQueue.__proto__ || _Object$getPrototypeOf(DeckQueue)).call.apply(_ref, [this].concat(args))), _this), _this.page = _this.props.page, _this.data = _this.props.dataRecord, _this.client = _this.props.client, _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.imageHeight = _this.props.imageHeight ? _this.props.imageHeight : 270, _this.state = {
|
|
58
59
|
data: _this.data,
|
|
60
|
+
prevData: _this.data,
|
|
59
61
|
currentPage: _this.props.currentPage || 1,
|
|
60
62
|
isDataLoading: false,
|
|
61
|
-
itemsPerPage: _this.params ? _this.params.to - _this.params.from : 2
|
|
63
|
+
itemsPerPage: _this.props.params ? _this.props.params.to - _this.props.params.from : 2
|
|
62
64
|
}, _this.renderCardImage = function (row) {
|
|
63
65
|
if (row.thumbnail && row.thumbnail.asset) {
|
|
64
66
|
var url = urlFor({
|
|
@@ -166,6 +168,13 @@ var DeckQueue = function (_React$Component) {
|
|
|
166
168
|
}
|
|
167
169
|
|
|
168
170
|
_createClass(DeckQueue, [{
|
|
171
|
+
key: 'componentDidUpdate',
|
|
172
|
+
value: function componentDidUpdate(prevProps, prevState) {
|
|
173
|
+
if (_JSON$stringify(prevState.prevData) !== _JSON$stringify(this.state.prevData)) {
|
|
174
|
+
this.seoPagination(this.state.currentPage);
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
}, {
|
|
169
178
|
key: 'cardLoader',
|
|
170
179
|
value: function cardLoader(_ref3) {
|
|
171
180
|
var _this3 = this;
|
|
@@ -265,6 +274,7 @@ var DeckQueue = function (_React$Component) {
|
|
|
265
274
|
variant = _props.variant,
|
|
266
275
|
totalDataCount = _props.totalDataCount;
|
|
267
276
|
var _state = this.state,
|
|
277
|
+
data = _state.data,
|
|
268
278
|
isDataLoading = _state.isDataLoading,
|
|
269
279
|
itemsPerPage = _state.itemsPerPage,
|
|
270
280
|
currentPage = _state.currentPage;
|
|
@@ -284,7 +294,7 @@ var DeckQueue = function (_React$Component) {
|
|
|
284
294
|
'Loading...'
|
|
285
295
|
)
|
|
286
296
|
)
|
|
287
|
-
) : React__default.createElement(
|
|
297
|
+
) : data && data.length > 0 ? React__default.createElement(
|
|
288
298
|
Container$1,
|
|
289
299
|
null,
|
|
290
300
|
this.cardLoader({ columns: columns, variant: variant }),
|
|
@@ -303,9 +313,21 @@ var DeckQueue = function (_React$Component) {
|
|
|
303
313
|
'\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 '
|
|
304
314
|
)
|
|
305
315
|
)
|
|
306
|
-
)
|
|
316
|
+
) : null
|
|
307
317
|
);
|
|
308
318
|
}
|
|
319
|
+
}], [{
|
|
320
|
+
key: 'getDerivedStateFromProps',
|
|
321
|
+
value: function getDerivedStateFromProps(props, state) {
|
|
322
|
+
if (_JSON$stringify(props.dataRecord) !== _JSON$stringify(state.prevData)) {
|
|
323
|
+
return {
|
|
324
|
+
data: props.dataRecord,
|
|
325
|
+
prevData: props.dataRecord,
|
|
326
|
+
currentPage: props.currentPage
|
|
327
|
+
};
|
|
328
|
+
}
|
|
329
|
+
return null;
|
|
330
|
+
}
|
|
309
331
|
}]);
|
|
310
332
|
|
|
311
333
|
return DeckQueue;
|
package/dist/esm/IssueLanding.js
CHANGED
|
@@ -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-
|
|
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';
|