@mjhls/mjh-framework 1.0.994-Cypress → 1.0.994-CypressV2
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 +1 -1
- package/dist/cjs/ArticleProgramLandingPage.js +1 -1
- package/dist/cjs/CypressTesting.js +4 -3
- package/dist/cjs/ExternalResources.js +1 -1
- package/dist/cjs/HamMagazine.js +20 -20
- package/dist/cjs/HorizontalArticleListing.js +1 -1
- package/dist/cjs/IssueLanding.js +1 -1
- package/dist/cjs/MediaSeriesCard-2e5cd247.js +81 -0
- package/dist/cjs/MediaSeriesLanding.js +17 -16
- package/dist/cjs/MediaSeriesLandingPaginated.js +16 -15
- package/dist/cjs/PartnerDetailListing.js +1 -1
- package/dist/cjs/PartnerDetailListingPaginated.js +30 -8
- package/dist/cjs/PodcastsLanding.js +235 -0
- package/dist/cjs/TaxonomyDescription.js +1 -1
- package/dist/cjs/{MediaSeriesCard-cf144b71.js → Tooltip-f075b7ef.js} +0 -73
- package/dist/cjs/VideoProgramLandingPage.js +1 -1
- package/dist/cjs/View.js +51 -38
- package/dist/cjs/getQuery.js +1 -1
- package/dist/cjs/getSerializers.js +1 -1
- package/dist/cjs/{index-e9d3f910.js → index-f95a3c0f.js} +20 -7
- package/dist/cjs/index.js +1 -1
- package/dist/esm/ArticleProgramLandingPage.js +1 -1
- package/dist/esm/CypressTesting.js +4 -3
- package/dist/esm/ExternalResources.js +1 -1
- package/dist/esm/HamMagazine.js +18 -18
- package/dist/esm/HorizontalArticleListing.js +1 -1
- package/dist/esm/IssueLanding.js +1 -1
- package/dist/esm/MediaSeriesCard-afb517a5.js +75 -0
- package/dist/esm/MediaSeriesLanding.js +8 -7
- package/dist/esm/MediaSeriesLandingPaginated.js +7 -6
- package/dist/esm/PartnerDetailListing.js +1 -1
- package/dist/esm/PartnerDetailListingPaginated.js +30 -8
- package/dist/esm/PodcastsLanding.js +228 -0
- package/dist/esm/TaxonomyDescription.js +1 -1
- package/dist/esm/{MediaSeriesCard-2a65b9da.js → Tooltip-95655b44.js} +1 -73
- package/dist/esm/VideoProgramLandingPage.js +1 -1
- package/dist/esm/View.js +51 -38
- package/dist/esm/getQuery.js +1 -1
- package/dist/esm/getSerializers.js +1 -1
- package/dist/esm/{index-9a58ca55.js → index-04817712.js} +20 -7
- package/dist/esm/index.js +1 -1
- package/package.json +3 -3
|
@@ -0,0 +1,228 @@
|
|
|
1
|
+
import { _ as _asyncToGenerator, r as regenerator } from './asyncToGenerator-958ef5fc.js';
|
|
2
|
+
import { _ as _extends } from './extends-6d8e3924.js';
|
|
3
|
+
import { _ as _slicedToArray } from './slicedToArray-6ebcbfea.js';
|
|
4
|
+
import React__default, { useState } from 'react';
|
|
5
|
+
import Link from 'next/link';
|
|
6
|
+
import MasterDeck from './MasterDeck.js';
|
|
7
|
+
import { M as MediaSeriesCard } from './MediaSeriesCard-afb517a5.js';
|
|
8
|
+
import { B as BlockContent } from './BlockContent-1e73bd2c.js';
|
|
9
|
+
import { g as getSerializers } from './index-04817712.js';
|
|
10
|
+
import './_commonjsHelpers-0c4b6f40.js';
|
|
11
|
+
import './core.get-iterator-method-ea258bb1.js';
|
|
12
|
+
import './web.dom.iterable-ab4dea5c.js';
|
|
13
|
+
import './_library-528f1934.js';
|
|
14
|
+
import './_iter-detect-98db3b07.js';
|
|
15
|
+
import './_object-pie-133f504a.js';
|
|
16
|
+
import './toConsumableArray-f7074d7c.js';
|
|
17
|
+
import './inherits-a6ba2ec4.js';
|
|
18
|
+
import './_object-sap-7cee6f84.js';
|
|
19
|
+
import './define-property-5f1bda73.js';
|
|
20
|
+
import './typeof-e9fc0c5d.js';
|
|
21
|
+
import './_is-array-8d21b9e3.js';
|
|
22
|
+
import './index-f0fc23eb.js';
|
|
23
|
+
import './events-6c3a7a63.js';
|
|
24
|
+
import 'prop-types';
|
|
25
|
+
import 'react-bootstrap/Container';
|
|
26
|
+
import 'react-bootstrap/Row';
|
|
27
|
+
import 'react-bootstrap/Col';
|
|
28
|
+
import 'react-bootstrap/Card';
|
|
29
|
+
import './moment-bc12cb97.js';
|
|
30
|
+
import 'next/router';
|
|
31
|
+
import './lodash-f97fd99a.js';
|
|
32
|
+
import './debounce-533d9748.js';
|
|
33
|
+
import './isSymbol-a7e9aafe.js';
|
|
34
|
+
import './toNumber-5aeba6e7.js';
|
|
35
|
+
import './index.es-a6137319.js';
|
|
36
|
+
import './visibility-sensor-72fd8f8b.js';
|
|
37
|
+
import 'react-dom';
|
|
38
|
+
import './index-3f5c03b2.js';
|
|
39
|
+
import './ADlgInfeed-5e36f317.js';
|
|
40
|
+
import './AdSlot.js';
|
|
41
|
+
import './Beam.js';
|
|
42
|
+
import './stringify-2b084bee.js';
|
|
43
|
+
import './Segment.js';
|
|
44
|
+
import './main-1894c974.js';
|
|
45
|
+
import './ADInfeed-5765a73a.js';
|
|
46
|
+
import './index-755f2cc2.js';
|
|
47
|
+
import './urlFor.js';
|
|
48
|
+
import './style-inject.es-1f59c1d0.js';
|
|
49
|
+
import 'react-bootstrap';
|
|
50
|
+
import './index-c7e2ac95.js';
|
|
51
|
+
import './util-8ed16d48.js';
|
|
52
|
+
import './urlForFile-b69adffc.js';
|
|
53
|
+
import './brightcove-react-player-loader.es-57a70a56.js';
|
|
54
|
+
import 'react-bootstrap/Modal';
|
|
55
|
+
import 'react-bootstrap/Button';
|
|
56
|
+
import 'react-bootstrap/Form';
|
|
57
|
+
import 'react-ga';
|
|
58
|
+
import './GroupDeck.js';
|
|
59
|
+
import './smoothscroll-fa4e3f8c.js';
|
|
60
|
+
import './SocialShare.js';
|
|
61
|
+
import 'next/head';
|
|
62
|
+
import 'react-share';
|
|
63
|
+
import './_object-to-array-2300e51b.js';
|
|
64
|
+
import 'react-bootstrap/Pagination';
|
|
65
|
+
import './entities-6d9154b4.js';
|
|
66
|
+
import './index.esm-eb1e8e80.js';
|
|
67
|
+
import './iconBase-ccc56b97.js';
|
|
68
|
+
import 'react-bootstrap/Figure';
|
|
69
|
+
import 'react-bootstrap/OverlayTrigger';
|
|
70
|
+
import 'react-bootstrap/Tooltip';
|
|
71
|
+
import 'react-bootstrap/Popover';
|
|
72
|
+
import './checkSisterSite-baa4fb6b.js';
|
|
73
|
+
|
|
74
|
+
var _this = undefined;
|
|
75
|
+
|
|
76
|
+
var PodcastsLanding = function PodcastsLanding(props) {
|
|
77
|
+
var client = props.client,
|
|
78
|
+
pageview = props.pageview,
|
|
79
|
+
currentPage = props.currentPage;
|
|
80
|
+
props.taxonomyId;
|
|
81
|
+
props.parentUrl;
|
|
82
|
+
var nextPagePostsCount = props.nextPagePostsCount;
|
|
83
|
+
|
|
84
|
+
var _useState = useState(props.seriesData),
|
|
85
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
86
|
+
seriesData = _useState2[0];
|
|
87
|
+
_useState2[1];
|
|
88
|
+
|
|
89
|
+
var _useState3 = useState(props.params),
|
|
90
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
91
|
+
params = _useState4[0];
|
|
92
|
+
_useState4[1];
|
|
93
|
+
|
|
94
|
+
var _useState5 = useState(props.query),
|
|
95
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
96
|
+
query = _useState6[0];
|
|
97
|
+
_useState6[1];
|
|
98
|
+
|
|
99
|
+
if (props.statusCode === 404) {
|
|
100
|
+
return React__default.createElement(
|
|
101
|
+
'div',
|
|
102
|
+
{ className: 'd-flex flex-column align-items-center mt-3' },
|
|
103
|
+
React__default.createElement(
|
|
104
|
+
'h3',
|
|
105
|
+
null,
|
|
106
|
+
'404: Resource not found'
|
|
107
|
+
),
|
|
108
|
+
React__default.createElement(
|
|
109
|
+
'p',
|
|
110
|
+
null,
|
|
111
|
+
'We seem to have misplaced the page you\'re looking for. Sorry! Please try checking the URL for errors.'
|
|
112
|
+
),
|
|
113
|
+
React__default.createElement(
|
|
114
|
+
'p',
|
|
115
|
+
null,
|
|
116
|
+
'Click here to',
|
|
117
|
+
React__default.createElement(
|
|
118
|
+
Link,
|
|
119
|
+
{ href: '/' },
|
|
120
|
+
React__default.createElement(
|
|
121
|
+
'a',
|
|
122
|
+
{ style: { color: 'blue', textDecoration: 'underline' } },
|
|
123
|
+
' return to homepage.'
|
|
124
|
+
)
|
|
125
|
+
)
|
|
126
|
+
)
|
|
127
|
+
);
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
return React__default.createElement(
|
|
131
|
+
'div',
|
|
132
|
+
{ className: 'mb-5' },
|
|
133
|
+
props.taxonomy && props.taxonomy.summary && React__default.createElement(BlockContent, { style: { marginTop: '1rem !important' }, blocks: props.taxonomy.summary, serializers: getSerializers(client) }),
|
|
134
|
+
React__default.createElement('hr', { style: { marginTop: '2rem', marginBottom: '2rem' } }),
|
|
135
|
+
seriesData && React__default.createElement(MasterDeck, {
|
|
136
|
+
deck: MediaSeriesCard,
|
|
137
|
+
variant: 'left',
|
|
138
|
+
defaultImage: '/placeholder.jpg',
|
|
139
|
+
client: client,
|
|
140
|
+
dataRecord: seriesData,
|
|
141
|
+
query: query && query,
|
|
142
|
+
params: params && params,
|
|
143
|
+
currentPage: currentPage,
|
|
144
|
+
pageview: pageview,
|
|
145
|
+
autoScroll: true,
|
|
146
|
+
seoPaginate: true,
|
|
147
|
+
nextPagePostsCount: nextPagePostsCount
|
|
148
|
+
})
|
|
149
|
+
);
|
|
150
|
+
};
|
|
151
|
+
|
|
152
|
+
PodcastsLanding.getInitialData = function () {
|
|
153
|
+
var _ref = _asyncToGenerator( /*#__PURE__*/regenerator.mark(function _callee(ctx, client, cache) {
|
|
154
|
+
var urlQuery, pathname, identifier, itemsPerPage, currentPage, start, statusCode, params, taxonomyId, seriesQuery, seriesData, nextPagePostsCount;
|
|
155
|
+
return regenerator.wrap(function _callee$(_context) {
|
|
156
|
+
while (1) {
|
|
157
|
+
switch (_context.prev = _context.next) {
|
|
158
|
+
case 0:
|
|
159
|
+
urlQuery = ctx.query, pathname = ctx.pathname;
|
|
160
|
+
identifier = pathname.replace('/', '');
|
|
161
|
+
itemsPerPage = 10;
|
|
162
|
+
currentPage = urlQuery.page ? parseInt(urlQuery.page) : 1;
|
|
163
|
+
start = (currentPage - 1) * itemsPerPage;
|
|
164
|
+
statusCode = 200;
|
|
165
|
+
params = {
|
|
166
|
+
count: itemsPerPage,
|
|
167
|
+
from: start,
|
|
168
|
+
to: start + itemsPerPage,
|
|
169
|
+
url: pathname,
|
|
170
|
+
itemsPerPage: itemsPerPage
|
|
171
|
+
};
|
|
172
|
+
_context.next = 9;
|
|
173
|
+
return client.fetch('*[_type == \'taxonomy\' && identifier == \'' + identifier + '\'][0]{\n _id, \n name,\n summary,\n pixelTrackingCode->\n }');
|
|
174
|
+
|
|
175
|
+
case 9:
|
|
176
|
+
taxonomyId = _context.sent;
|
|
177
|
+
|
|
178
|
+
// const taxonomyId = await client.fetch(`*[_type == 'taxonomy' && _id == '6d748e0d-7946-4a14-968e-ca8182f06c1e']`)
|
|
179
|
+
// console.log('taxonomyId', taxonomyId)
|
|
180
|
+
seriesQuery = '*[_type == \'taxonomy\' && isMainTopic == true && references(\'' + taxonomyId._id + '\')] | order(published desc) [$from...$to] {\n _id,\n name,\n identifier,\n thumbnail{ ..., asset-> },\n summary,\n \'pageNumber\': ' + currentPage + ',\n \'parentUrl\': \'' + identifier + '\'\n }';
|
|
181
|
+
_context.next = 13;
|
|
182
|
+
return client.fetch(seriesQuery, params);
|
|
183
|
+
|
|
184
|
+
case 13:
|
|
185
|
+
seriesData = _context.sent;
|
|
186
|
+
|
|
187
|
+
seriesData.forEach(function (seriesObj) {
|
|
188
|
+
seriesObj.description = seriesObj.summary;
|
|
189
|
+
seriesObj.identifier = { _type: 'slug', current: seriesObj.identifier };
|
|
190
|
+
});
|
|
191
|
+
_context.next = 17;
|
|
192
|
+
return client.fetch('count(' + seriesQuery + ')', _extends({}, params, { from: params.to, to: params.to + itemsPerPage }));
|
|
193
|
+
|
|
194
|
+
case 17:
|
|
195
|
+
nextPagePostsCount = _context.sent;
|
|
196
|
+
|
|
197
|
+
|
|
198
|
+
if (currentPage > 1 && seriesData.length === 0) {
|
|
199
|
+
statusCode = 404;
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
return _context.abrupt('return', {
|
|
203
|
+
seriesData: seriesData,
|
|
204
|
+
query: seriesQuery,
|
|
205
|
+
params: params,
|
|
206
|
+
currentPage: currentPage,
|
|
207
|
+
identifier: identifier,
|
|
208
|
+
taxonomyId: taxonomyId,
|
|
209
|
+
parentUrl: identifier,
|
|
210
|
+
statusCode: statusCode,
|
|
211
|
+
taxonomy: taxonomyId,
|
|
212
|
+
nextPagePostsCount: nextPagePostsCount
|
|
213
|
+
});
|
|
214
|
+
|
|
215
|
+
case 20:
|
|
216
|
+
case 'end':
|
|
217
|
+
return _context.stop();
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
}, _callee, _this);
|
|
221
|
+
}));
|
|
222
|
+
|
|
223
|
+
return function (_x, _x2, _x3) {
|
|
224
|
+
return _ref.apply(this, arguments);
|
|
225
|
+
};
|
|
226
|
+
}();
|
|
227
|
+
|
|
228
|
+
export { PodcastsLanding as default };
|
|
@@ -5,7 +5,7 @@ import React__default, { useState, useEffect } from 'react';
|
|
|
5
5
|
import { useRouter } from 'next/router';
|
|
6
6
|
import Head from 'next/head';
|
|
7
7
|
import { B as BlockContent } from './BlockContent-1e73bd2c.js';
|
|
8
|
-
import { g as getSerializers } from './index-
|
|
8
|
+
import { g as getSerializers } from './index-04817712.js';
|
|
9
9
|
import './_commonjsHelpers-0c4b6f40.js';
|
|
10
10
|
import './core.get-iterator-method-ea258bb1.js';
|
|
11
11
|
import './_object-pie-133f504a.js';
|
|
@@ -3,13 +3,6 @@ import React__default, { useCallback, useRef, useState, useContext, useMemo, use
|
|
|
3
3
|
import PropTypes from 'prop-types';
|
|
4
4
|
import ReactDOM from 'react-dom';
|
|
5
5
|
import { c as createCommonjsModule, u as unwrapExports } from './_commonjsHelpers-0c4b6f40.js';
|
|
6
|
-
import { _ as _typeof } from './typeof-e9fc0c5d.js';
|
|
7
|
-
import { L as LazyLoad } from './index-755f2cc2.js';
|
|
8
|
-
import urlFor from './urlFor.js';
|
|
9
|
-
import { m as moment } from './moment-bc12cb97.js';
|
|
10
|
-
import { s as styleInject } from './style-inject.es-1f59c1d0.js';
|
|
11
|
-
import { B as BlockContent } from './BlockContent-1e73bd2c.js';
|
|
12
|
-
import { g as getSerializers } from './index-9a58ca55.js';
|
|
13
6
|
|
|
14
7
|
/**
|
|
15
8
|
* Copyright (c) 2013-present, Facebook, Inc.
|
|
@@ -9449,69 +9442,4 @@ var Tooltip = React__default.forwardRef(function (_ref, ref) {
|
|
|
9449
9442
|
Tooltip.defaultProps = defaultProps;
|
|
9450
9443
|
Tooltip.displayName = 'Tooltip';
|
|
9451
9444
|
|
|
9452
|
-
|
|
9453
|
-
var styles = { "article": "MediaSeriesCard-module_article__SAFYK", "thumb": "MediaSeriesCard-module_thumb__3jRAU", "info": "MediaSeriesCard-module_info__3L7_o", "published": "MediaSeriesCard-module_published__E4oiz", "summary": "MediaSeriesCard-module_summary__1xanh", "author": "MediaSeriesCard-module_author__e5fuR", "name": "MediaSeriesCard-module_name__2m5KY" };
|
|
9454
|
-
styleInject(css);
|
|
9455
|
-
|
|
9456
|
-
var MediaSeriesCard = function MediaSeriesCard(props) {
|
|
9457
|
-
var data = props.data,
|
|
9458
|
-
variant = props.variant,
|
|
9459
|
-
defaultImage = props.defaultImage,
|
|
9460
|
-
client = props.client;
|
|
9461
|
-
|
|
9462
|
-
|
|
9463
|
-
return React__default.createElement(
|
|
9464
|
-
'div',
|
|
9465
|
-
{ className: 'media-series-article ' + styles.article },
|
|
9466
|
-
React__default.createElement(
|
|
9467
|
-
'a',
|
|
9468
|
-
{ href: '/' + data.parentUrl + '/' + data.identifier.current, style: variant === 'right' ? { flexDirection: 'row-reverse' } : {} },
|
|
9469
|
-
React__default.createElement(
|
|
9470
|
-
'div',
|
|
9471
|
-
{ className: 'media-series-thumbnail ' + styles.thumb },
|
|
9472
|
-
data.thumbnail && data.thumbnail.asset && React__default.createElement(
|
|
9473
|
-
'figure',
|
|
9474
|
-
null,
|
|
9475
|
-
React__default.createElement(
|
|
9476
|
-
LazyLoad,
|
|
9477
|
-
null,
|
|
9478
|
-
React__default.createElement('img', {
|
|
9479
|
-
src: data.thumbnail && data.thumbnail.asset ? urlFor({ client: client, source: data.thumbnail }) : data.thumbnail && _typeof(data.thumbnail == 'string') ? data.thumbnail : defaultImage
|
|
9480
|
-
})
|
|
9481
|
-
)
|
|
9482
|
-
)
|
|
9483
|
-
),
|
|
9484
|
-
React__default.createElement(
|
|
9485
|
-
'div',
|
|
9486
|
-
{ className: 'media-series-info ' + styles.info, style: variant === 'right' ? { padding: '0 1rem 0 0' } : { padding: ' 0 0 0 1rem' } },
|
|
9487
|
-
React__default.createElement(
|
|
9488
|
-
'div',
|
|
9489
|
-
{ className: 'media-series-name ' + styles.name },
|
|
9490
|
-
data.name
|
|
9491
|
-
),
|
|
9492
|
-
data.published && React__default.createElement(
|
|
9493
|
-
'p',
|
|
9494
|
-
{ className: 'media-series-published ' + styles.published },
|
|
9495
|
-
moment(data.published).format('MMMM Do YYYY')
|
|
9496
|
-
),
|
|
9497
|
-
data.authorMapping && data.authorMapping.displayName && React__default.createElement(
|
|
9498
|
-
'p',
|
|
9499
|
-
{ className: 'media-series-author ' + styles.author },
|
|
9500
|
-
'By ',
|
|
9501
|
-
React__default.createElement(
|
|
9502
|
-
'span',
|
|
9503
|
-
null,
|
|
9504
|
-
data.authorMapping.displayName
|
|
9505
|
-
)
|
|
9506
|
-
),
|
|
9507
|
-
data.description && React__default.createElement(
|
|
9508
|
-
'div',
|
|
9509
|
-
{ className: 'media-series-desc' },
|
|
9510
|
-
React__default.createElement(BlockContent, { blocks: data.description, serializers: getSerializers(client) })
|
|
9511
|
-
)
|
|
9512
|
-
)
|
|
9513
|
-
)
|
|
9514
|
-
);
|
|
9515
|
-
};
|
|
9516
|
-
|
|
9517
|
-
export { DropdownButton as D, MediaSeriesCard as M, Dropdown as a };
|
|
9445
|
+
export { DropdownButton as D, Dropdown as a };
|
|
@@ -5,7 +5,7 @@ import { B as BlockContent } from './BlockContent-1e73bd2c.js';
|
|
|
5
5
|
import Col from 'react-bootstrap/Col';
|
|
6
6
|
import Form from 'react-bootstrap/Form';
|
|
7
7
|
import Button from 'react-bootstrap/Button';
|
|
8
|
-
import { g as getSerializers } from './index-
|
|
8
|
+
import { g as getSerializers } from './index-04817712.js';
|
|
9
9
|
import VideoSeriesListing from './VideoSeriesListing.js';
|
|
10
10
|
import './_commonjsHelpers-0c4b6f40.js';
|
|
11
11
|
import './core.get-iterator-method-ea258bb1.js';
|
package/dist/esm/View.js
CHANGED
|
@@ -15,7 +15,7 @@ import FormControl from 'react-bootstrap/FormControl';
|
|
|
15
15
|
import Button from 'react-bootstrap/Button';
|
|
16
16
|
import { V as VisibilitySensor } from './visibility-sensor-72fd8f8b.js';
|
|
17
17
|
import SocialShare from './SocialShare.js';
|
|
18
|
-
import { r as renderAuthor, g as getSerializers } from './index-
|
|
18
|
+
import { r as renderAuthor, g as getSerializers } from './index-04817712.js';
|
|
19
19
|
import DFPAdSlot from './AdSlot.js';
|
|
20
20
|
import { S as SeriesSlider } from './SeriesSlider-f771e20d.js';
|
|
21
21
|
import { a as getContentPlacementUrl, g as getTargeting } from './getTargeting-9bd28724.js';
|
|
@@ -1018,6 +1018,8 @@ var Article = React__default.memo(forwardRef(function (props, ref) {
|
|
|
1018
1018
|
downloadCitation = _props$downloadCitati === undefined ? false : _props$downloadCitati,
|
|
1019
1019
|
_props$useSegmentReco = props.useSegmentRecommendedArticles,
|
|
1020
1020
|
useSegmentRecommendedArticles = _props$useSegmentReco === undefined ? false : _props$useSegmentReco,
|
|
1021
|
+
showIssueNameOnly = props.showIssueNameOnly,
|
|
1022
|
+
showPageNumber = props.showPageNumber,
|
|
1021
1023
|
emailList = props.emailList,
|
|
1022
1024
|
articleRecs = props.articleRecs;
|
|
1023
1025
|
var sliderData = props.sliderData;
|
|
@@ -1028,9 +1030,9 @@ var Article = React__default.memo(forwardRef(function (props, ref) {
|
|
|
1028
1030
|
if (article && article.documentGroup && article.documentGroup.disableEpisodeNumber === true) {
|
|
1029
1031
|
disableEpisodeNumber = true;
|
|
1030
1032
|
}
|
|
1031
|
-
var logicforDisplayingEpisodeNumber = disableEpisodeNumber
|
|
1033
|
+
var logicforDisplayingEpisodeNumber = !disableEpisodeNumber;
|
|
1032
1034
|
var targeting = getTargeting(props);
|
|
1033
|
-
//remove slider data if toggled
|
|
1035
|
+
// remove slider data if toggled
|
|
1034
1036
|
if (article && article.documentGroup && article.documentGroup.hideSeriesSlider === true) {
|
|
1035
1037
|
sliderData = null;
|
|
1036
1038
|
}
|
|
@@ -1054,12 +1056,12 @@ var Article = React__default.memo(forwardRef(function (props, ref) {
|
|
|
1054
1056
|
}
|
|
1055
1057
|
}
|
|
1056
1058
|
|
|
1057
|
-
//if showSocialShare is not disabled for entire site, check article taxonomy, docgroup, authors for showSocialShare === false
|
|
1059
|
+
// if showSocialShare is not disabled for entire site, check article taxonomy, docgroup, authors for showSocialShare === false
|
|
1058
1060
|
if (showSocialShare) {
|
|
1059
1061
|
showSocialShare = getSocialShareDisableFlag(props.article);
|
|
1060
1062
|
}
|
|
1061
1063
|
|
|
1062
|
-
//If sponsored flag, disable contextual ads
|
|
1064
|
+
// If sponsored flag, disable contextual ads
|
|
1063
1065
|
if (sponsoredFlag) {
|
|
1064
1066
|
article.contextualVideoAD = false;
|
|
1065
1067
|
article.contextualAD = false;
|
|
@@ -1068,7 +1070,7 @@ var Article = React__default.memo(forwardRef(function (props, ref) {
|
|
|
1068
1070
|
if (article.disableRelatedContent) {
|
|
1069
1071
|
showRelatedArticles = false;
|
|
1070
1072
|
}
|
|
1071
|
-
//This was being done in ArticleQueue2 which wasnt effecting articles excluded from infinite scroll, moved inside article component
|
|
1073
|
+
// This was being done in ArticleQueue2 which wasnt effecting articles excluded from infinite scroll, moved inside article component
|
|
1072
1074
|
if (!sponsoredFlag && Ads.getVideoContextualAD) {
|
|
1073
1075
|
article.contextualVideoAD = Ads.getVideoContextualAD(getTargeting(props, 'in-context_video'));
|
|
1074
1076
|
}
|
|
@@ -1149,9 +1151,11 @@ var Article = React__default.memo(forwardRef(function (props, ref) {
|
|
|
1149
1151
|
|
|
1150
1152
|
var getAbstract = function getAbstract() {
|
|
1151
1153
|
return article.abstract && article.abstract.map(function (block) {
|
|
1152
|
-
if (block.children)
|
|
1153
|
-
|
|
1154
|
-
|
|
1154
|
+
if (block.children) {
|
|
1155
|
+
return block.children.map(function (child) {
|
|
1156
|
+
if (child._type === 'span') return child.text;
|
|
1157
|
+
});
|
|
1158
|
+
}
|
|
1155
1159
|
}).join(' ');
|
|
1156
1160
|
};
|
|
1157
1161
|
|
|
@@ -1169,52 +1173,52 @@ var Article = React__default.memo(forwardRef(function (props, ref) {
|
|
|
1169
1173
|
var fileContent = 'TY - JOUR\n';
|
|
1170
1174
|
if (issue) {
|
|
1171
1175
|
if (article.title) {
|
|
1172
|
-
fileContent += 'TI - ' + article.title + '\n'; //Title - TI
|
|
1173
|
-
fileContent += 'T1 - ' + article.title + '\n'; //Title - T1
|
|
1176
|
+
fileContent += 'TI - ' + article.title + '\n'; // Title - TI
|
|
1177
|
+
fileContent += 'T1 - ' + article.title + '\n'; // Title - T1
|
|
1174
1178
|
}
|
|
1175
1179
|
if (authorDetails && authorDetails.length) {
|
|
1176
1180
|
authorDetails.map(function (authorDetail, index) {
|
|
1177
1181
|
return fileContent += 'AU - ' + (authorDetail.firstName && authorDetail.lastName ? authorDetail.lastName + ', ' + authorDetail.firstName : '' + authorDetail.displayName) + '\n';
|
|
1178
|
-
} //Author
|
|
1182
|
+
} // Author
|
|
1179
1183
|
);
|
|
1180
1184
|
}
|
|
1181
1185
|
if (issue.publication && issue.publication.name) {
|
|
1182
|
-
fileContent += 'T2 - ' + issue.publication.name + '\n'; //Secondary Title - T2
|
|
1183
|
-
fileContent += 'JF - ' + issue.publication.name + '\n'; //Journal Name - JF
|
|
1186
|
+
fileContent += 'T2 - ' + issue.publication.name + '\n'; // Secondary Title - T2
|
|
1187
|
+
fileContent += 'JF - ' + issue.publication.name + '\n'; // Journal Name - JF
|
|
1184
1188
|
}
|
|
1185
1189
|
if (issue.name) {
|
|
1186
|
-
fileContent += 'T3 - ' + issue.name + '\n'; //Issue Name - T3
|
|
1190
|
+
fileContent += 'T3 - ' + issue.name + '\n'; // Issue Name - T3
|
|
1187
1191
|
}
|
|
1188
1192
|
if (issue.abbreviatedJournal) {
|
|
1189
|
-
fileContent += 'JO - ' + issue.abbreviatedJournal + '\n'; //Journal Name - JO
|
|
1193
|
+
fileContent += 'JO - ' + issue.abbreviatedJournal + '\n'; // Journal Name - JO
|
|
1190
1194
|
}
|
|
1191
|
-
if (article.abstract) fileContent += 'AB - ' + getAbstract() + '\n'; //Abstract - AB
|
|
1192
|
-
if (article.abstract) fileContent += 'N2 - ' + getAbstract() + '\n'; //Abstract - N2
|
|
1193
|
-
if (issue.issueNumber) fileContent += 'IS - ' + issue.issueNumber + '\n'; //Issue Number - IS
|
|
1194
|
-
fileContent += 'PB - MJH Life Sciences\n'; //Publisher - PB
|
|
1195
|
-
if (issue.year) fileContent += 'PY - ' + issue.year + '\n'; //Published Year - PY
|
|
1196
|
-
if (issue.volume) fileContent += 'VL - ' + issue.volume + '\n'; //Volume - VL
|
|
1197
|
-
if (issue.url) fileContent += 'L1 - ' + issue.url + '\n'; //Link to PDF - L1
|
|
1195
|
+
if (article.abstract) fileContent += 'AB - ' + getAbstract() + '\n'; // Abstract - AB
|
|
1196
|
+
if (article.abstract) fileContent += 'N2 - ' + getAbstract() + '\n'; // Abstract - N2
|
|
1197
|
+
if (issue.issueNumber) fileContent += 'IS - ' + issue.issueNumber + '\n'; // Issue Number - IS
|
|
1198
|
+
fileContent += 'PB - MJH Life Sciences\n'; // Publisher - PB
|
|
1199
|
+
if (issue.year) fileContent += 'PY - ' + issue.year + '\n'; // Published Year - PY
|
|
1200
|
+
if (issue.volume) fileContent += 'VL - ' + issue.volume + '\n'; // Volume - VL
|
|
1201
|
+
if (issue.url) fileContent += 'L1 - ' + issue.url + '\n'; // Link to PDF - L1
|
|
1198
1202
|
if (shareOptions && shareOptions.shareBaseUrl) {
|
|
1199
|
-
fileContent += 'L2 - ' + (shareOptions.shareBaseUrl + url) + '\n'; //Link to Full-text - L2
|
|
1200
|
-
fileContent += 'UR - ' + (shareOptions.shareBaseUrl + url) + '\n'; //Doc URL - UR
|
|
1203
|
+
fileContent += 'L2 - ' + (shareOptions.shareBaseUrl + url) + '\n'; // Link to Full-text - L2
|
|
1204
|
+
fileContent += 'UR - ' + (shareOptions.shareBaseUrl + url) + '\n'; // Doc URL - UR
|
|
1201
1205
|
}
|
|
1202
|
-
if (props.Website) fileContent += 'LK - https://' + props.Website.liveDomain + '\n'; //Website Link - LK
|
|
1206
|
+
if (props.Website) fileContent += 'LK - https://' + props.Website.liveDomain + '\n'; // Website Link - LK
|
|
1203
1207
|
if (issue.isbn_issn) {
|
|
1204
|
-
fileContent += 'SN - ' + issue.isbn_issn + '\n'; //ISSN/ISBN - TI
|
|
1208
|
+
fileContent += 'SN - ' + issue.isbn_issn + '\n'; // ISSN/ISBN - TI
|
|
1205
1209
|
}
|
|
1206
1210
|
if (pageNumber) {
|
|
1207
1211
|
if (pageNumber.includes('-')) {
|
|
1208
|
-
fileContent += 'SP - ' + pageNumber.split('-')[0] + '\n'; //Start Page - SP
|
|
1209
|
-
fileContent += 'EP - ' + pageNumber.split('-')[1] + '\n'; //End Page - EP
|
|
1212
|
+
fileContent += 'SP - ' + pageNumber.split('-')[0] + '\n'; // Start Page - SP
|
|
1213
|
+
fileContent += 'EP - ' + pageNumber.split('-')[1] + '\n'; // End Page - EP
|
|
1210
1214
|
} else {
|
|
1211
1215
|
fileContent += 'SP - ' + pageNumber + '\n';
|
|
1212
1216
|
}
|
|
1213
1217
|
}
|
|
1214
|
-
if (article.published) fileContent += 'Y1 - ' + moment(published).format('DD-MMMM-YYYY') + '\n'; //Primary Date - Y1
|
|
1215
|
-
fileContent += 'Y2 - ' + moment().format('DD-MMMM-YYYY') + '\n'; //Access Date - Y2
|
|
1218
|
+
if (article.published) fileContent += 'Y1 - ' + moment(published).format('DD-MMMM-YYYY') + '\n'; // Primary Date - Y1
|
|
1219
|
+
fileContent += 'Y2 - ' + moment().format('DD-MMMM-YYYY') + '\n'; // Access Date - Y2
|
|
1216
1220
|
}
|
|
1217
|
-
fileContent += 'ER -\n'; //End of Record
|
|
1221
|
+
fileContent += 'ER -\n'; // End of Record
|
|
1218
1222
|
return fileContent;
|
|
1219
1223
|
};
|
|
1220
1224
|
var getAuthorList = function getAuthorList() {
|
|
@@ -1777,7 +1781,7 @@ var Article = React__default.memo(forwardRef(function (props, ref) {
|
|
|
1777
1781
|
{ className: 'volume-issue' },
|
|
1778
1782
|
issue.publication && issue.publication.name && React__default.createElement(
|
|
1779
1783
|
'span',
|
|
1780
|
-
{ className: 'mb-0' },
|
|
1784
|
+
{ className: 'mb-0-pub' },
|
|
1781
1785
|
React__default.createElement(
|
|
1782
1786
|
'b',
|
|
1783
1787
|
null,
|
|
@@ -1786,17 +1790,22 @@ var Article = React__default.memo(forwardRef(function (props, ref) {
|
|
|
1786
1790
|
',',
|
|
1787
1791
|
' '
|
|
1788
1792
|
),
|
|
1789
|
-
issue.name && React__default.createElement(
|
|
1793
|
+
issue.name && showIssueNameOnly === undefined ? React__default.createElement(
|
|
1790
1794
|
'span',
|
|
1791
1795
|
{ className: 'mb-0' },
|
|
1792
1796
|
issue.name,
|
|
1793
1797
|
', '
|
|
1794
|
-
)
|
|
1798
|
+
) : issue.name && showIssueNameOnly === false ? React__default.createElement(
|
|
1799
|
+
'span',
|
|
1800
|
+
{ className: 'mb-0' },
|
|
1801
|
+
issue.name,
|
|
1802
|
+
', '
|
|
1803
|
+
) : null,
|
|
1795
1804
|
issue.volume && React__default.createElement(
|
|
1796
1805
|
'span',
|
|
1797
1806
|
null,
|
|
1798
1807
|
'Volume ' + issue.volume,
|
|
1799
|
-
','
|
|
1808
|
+
', '
|
|
1800
1809
|
),
|
|
1801
1810
|
issue.issueNumber && React__default.createElement(
|
|
1802
1811
|
'span',
|
|
@@ -1804,11 +1813,15 @@ var Article = React__default.memo(forwardRef(function (props, ref) {
|
|
|
1804
1813
|
' Issue ' + issue.issueNumber
|
|
1805
1814
|
)
|
|
1806
1815
|
),
|
|
1807
|
-
pageNumber && React__default.createElement(
|
|
1816
|
+
pageNumber && showPageNumber ? React__default.createElement(
|
|
1808
1817
|
'div',
|
|
1809
1818
|
{ className: 'article-pageNumber' },
|
|
1810
1819
|
'Pages: ' + pageNumber
|
|
1811
|
-
)
|
|
1820
|
+
) : pageNumber && showPageNumber === undefined ? React__default.createElement(
|
|
1821
|
+
'div',
|
|
1822
|
+
{ className: 'article-pageNumber' },
|
|
1823
|
+
'Pages: ' + pageNumber
|
|
1824
|
+
) : null
|
|
1812
1825
|
),
|
|
1813
1826
|
React__default.createElement(
|
|
1814
1827
|
'div',
|
package/dist/esm/getQuery.js
CHANGED
|
@@ -11,7 +11,7 @@ var getQuery = function getQuery(type) {
|
|
|
11
11
|
case 'related':
|
|
12
12
|
return '*[\n _type == "article"\n && defined(title)\n && defined(url)\n && !(_id in path("drafts.**"))\n && is_visible == true\n && defined(published) \n && dateTime(published) <= dateTime(now())\n && passwordLock!=true\n && isHealthcareProfessional != true\n && taxonomyMapping[]._ref in $taxonomy\n && taxonomyMapping[].disableAds != \'true\'\n && contentCategory->.name != \'Poll\'\n && contentCategory->.name != \'Slideshows\'\n && contentCategory->.disableAds != \'true\'\n && ExcludeFromInfiniteScroll !=true\n && url.current != $url\n && !defined(body[].videos)\n && !defined(body[].quizzes)\n && !defined(body[].slides)\n && !defined(body[].articles)\n ' + conditions + '\n ]| order(published desc)[' + (articleCount ? articleCount : '$index') + ']{\n ' + params + '\n title,\n published,\n summary,\n thumbnail,\n abstract,\n ...,\n passwordLock,\n password,\n "authorDetails": authorMapping[]->{ displayName, firstName, lastName, url, profileImage, biography, showSocialShare },\n body[] {\n ...,\n asset->,\n images[]{\n ...,\n asset->\n },\n content[]{\n ...,\n asset->\n },\n videos[]{\n ...,\n thumbnail{\n _type,\n asset->\n }\n },\n response[]{\n ...,\n asset->\n },\n quizzes[]{\n ...,\n answer[]{\n ...,\n asset->\n },\n question[]{\n ...,\n asset->\n }\n },\n poster {\n _type,\n asset->\n },\n slides[]{\n ...,\n slideshowImage{\n ...,\n asset->\n }\n },\n upload_doc {\n _type,\n asset->\n },\n uploadAudio {\n _type,\n asset->\n }\n },\n \'category\':contentCategory->{\n name,\n disableAds\n },\n \'content_placement\': taxonomyMapping[]-> {\n _id,\n \'ancestor\': parent->parent->identifier,\n \'parent\': parent->identifier,\n \'name\': name,\n \'path\': identifier,\n disableAds,\n showSocialShare,\n pixelTrackingCode->\n },\n documentGroup-> {\n name,\n thumbnail,\n parent->{...,parent->},\n isShow,\n showSocialShare,\n \'path\': identifier.current,\n adTargetingURL,\n hideSeriesSlider,\n pixelTrackingCode->\n },\n documentGroupMapping[]-> {\n _id,\n name,\n thumbnail,\n parent->{...,parent->},\n isShow,\n showSocialShare,\n \'path\': identifier.current,\n adTargetingURL,\n hideSeriesSlider,\n pixelTrackingCode->\n },\n \'issue\' : *[_type == \'publication\' && !(_id in path("drafts.**")) && is_visible == true && _id == ^.issueGroup._ref][0] {\n name,\n \'path\': identifier.current,\n show_download_ris_button,\n \'publication\' : *[_type == \'publication\' && !(_id in path("drafts.**")) && is_visible == true && _id == ^.parent._ref][0] {\n name,\n \'path\': identifier.current,\n show_download_ris_button,\n },\n \'url\' : pdf.asset-> url,\n \'pdf\': pdf.asset->,\n isbn_issn,\n abbreviatedJournal,\n }\n }';
|
|
13
13
|
case 'article':
|
|
14
|
-
return '*[\n _type == "article"\n && !(_id in path("drafts.**"))\n && defined(title)\n && defined(url)\n && is_visible != false\n && url.current == $url\n ' + conditions + '\n ][0]{\n ' + params + '\n title,\n published,\n summary,\n thumbnail,\n abstract,\n ...,\n passwordLock,\n password,\n issueGroup-> { _id, name, identifier, parent-> },\n "authorDetails": authorMapping[]->{ displayName, firstName, lastName, url, profileImage, biography, showSocialShare },\n body[] {\n ...,\n asset->,\n images[]{\n ...,\n asset->\n },\n content[]{\n ...,\n asset->\n },\n videos[]{\n ...,\n thumbnail{\n _type,\n asset->\n }\n },\n response[]{\n ...,\n asset->\n },\n quizzes[]{\n ...,\n answer[]{\n ...,\n asset->\n },\n question[]{\n ...,\n asset->\n }\n },\n poster {\n _type,\n asset->\n },\n slides[]{\n ...,\n slideshowImage{\n ...,\n asset->\n }\n },\n upload_doc {\n _type,\n asset->\n },\n uploadAudio {\n _type,\n asset->\n },\n medias[]{\n ...,\n upload_doc {\n _type,\n asset-> \n },\n poster {\n _type,\n asset-> \n }\n },\n articles[]{\n ...,\n thumbnail{\n ...,\n asset-> \n },\n "authorDetails": authorMapping[]->{ displayName, firstName, lastName, url, profileImage, biography, showSocialShare },\n text[]{\n ...,\n upload_doc {\n _type,\n asset->\n },\n uploadAudio {\n _type,\n asset->\n },\n }\n }\n },\n \'content_placement\': taxonomyMapping[]-> {\n ...,\n \'ancestor\': parent->parent->identifier,\n \'parent\': parent->identifier,\n \'name\': name,\n \'path\': identifier,\n showSocialShare,\n pixelTrackingCode->\n },\n documentGroup-> {\n _id,\n name,\n thumbnail,\n parent->{...,parent->},\n isShow,\n isSeries,\n disableEpisodeNumber,\n excludeRelatedContents,\n showSocialShare,\n \'path\': identifier.current,\n adTargetingURL,\n hideSeriesSlider,\n pixelTrackingCode->\n },\n documentGroupMapping[]-> {\n _id,\n name,\n thumbnail,\n isSeries,\n disableEpisodeNumber,\n parent->{...,parent->},\n isShow,\n showSocialShare,\n excludeRelatedContents,\n \'path\': identifier.current,\n hideSeriesSlider,\n pixelTrackingCode->\n },\n \'category\':contentCategory->{\n name,\n disableAds\n },\n \'issue\' : *[_type == \'publication\' && !(_id in path("drafts.**")) && is_visible == true && _id == ^.issueGroup._ref][0] {\n name,\n volume,\n year,\n \'issueNumber\': number,\n \'articleSource\': source,\n \'path\': identifier.current,\n show_download_ris_button,\n \'publication\' : *[_type == \'publication\' && !(_id in path("drafts.**")) && is_visible == true && _id == ^.parent._ref][0] {\n name,\n \'path\': identifier.current,\n show_download_ris_button,\n },\n \'url\' : pdf.asset-> url,\n \'pdf\': pdf.asset->,\n isbn_issn,\n abbreviatedJournal,\n }\n\n }';
|
|
14
|
+
return '*[\n _type == "article"\n && !(_id in path("drafts.**"))\n && defined(title)\n && defined(url)\n && is_visible != false\n && url.current == $url\n ' + conditions + '\n ][0]{\n ' + params + '\n title,\n published,\n summary,\n thumbnail,\n abstract,\n ...,\n passwordLock,\n password,\n issueGroup-> { _id, name, identifier, showIssueNameOnly, showPageNumber, parent-> },\n "authorDetails": authorMapping[]->{ displayName, firstName, lastName, url, profileImage, biography, showSocialShare },\n body[] {\n ...,\n asset->,\n images[]{\n ...,\n asset->\n },\n content[]{\n ...,\n asset->\n },\n videos[]{\n ...,\n thumbnail{\n _type,\n asset->\n }\n },\n response[]{\n ...,\n asset->\n },\n quizzes[]{\n ...,\n answer[]{\n ...,\n asset->\n },\n question[]{\n ...,\n asset->\n }\n },\n poster {\n _type,\n asset->\n },\n slides[]{\n ...,\n slideshowImage{\n ...,\n asset->\n }\n },\n upload_doc {\n _type,\n asset->\n },\n uploadAudio {\n _type,\n asset->\n },\n medias[]{\n ...,\n upload_doc {\n _type,\n asset-> \n },\n poster {\n _type,\n asset-> \n }\n },\n articles[]{\n ...,\n thumbnail{\n ...,\n asset-> \n },\n "authorDetails": authorMapping[]->{ displayName, firstName, lastName, url, profileImage, biography, showSocialShare },\n text[]{\n ...,\n upload_doc {\n _type,\n asset->\n },\n uploadAudio {\n _type,\n asset->\n },\n }\n }\n },\n \'content_placement\': taxonomyMapping[]-> {\n ...,\n \'ancestor\': parent->parent->identifier,\n \'parent\': parent->identifier,\n \'name\': name,\n \'path\': identifier,\n showSocialShare,\n pixelTrackingCode->\n },\n documentGroup-> {\n _id,\n name,\n thumbnail,\n parent->{...,parent->},\n isShow,\n isSeries,\n disableEpisodeNumber,\n excludeRelatedContents,\n showSocialShare,\n \'path\': identifier.current,\n adTargetingURL,\n hideSeriesSlider,\n pixelTrackingCode->\n },\n documentGroupMapping[]-> {\n _id,\n name,\n thumbnail,\n isSeries,\n disableEpisodeNumber,\n parent->{...,parent->},\n isShow,\n showSocialShare,\n excludeRelatedContents,\n \'path\': identifier.current,\n hideSeriesSlider,\n pixelTrackingCode->\n },\n \'category\':contentCategory->{\n name,\n disableAds\n },\n \'issue\' : *[_type == \'publication\' && !(_id in path("drafts.**")) && is_visible == true && _id == ^.issueGroup._ref][0] {\n name,\n volume,\n year,\n \'issueNumber\': number,\n \'articleSource\': source,\n \'path\': identifier.current,\n show_download_ris_button,\n \'publication\' : *[_type == \'publication\' && !(_id in path("drafts.**")) && is_visible == true && _id == ^.parent._ref][0] {\n name,\n \'path\': identifier.current,\n show_download_ris_button,\n },\n \'url\' : pdf.asset-> url,\n \'pdf\': pdf.asset->,\n isbn_issn,\n abbreviatedJournal,\n }\n\n }';
|
|
15
15
|
case 'publication':
|
|
16
16
|
return '*[_type == \'publication\'\n && identifier.current == $publication\n ' + conditions + '][0] {\n ' + params + '\n ...,\n \'issues\': *[_type == \'publication\'\n && is_visible\n && references(^._id)\n && defined(identifier)] {\n ...,\n thumbnail{ ..., asset-> },\n taxonomyMapping[]->,\n pdf{asset->},\n } | order(year desc, month desc)\n }';
|
|
17
17
|
case 'issue':
|