Skip to content

Commit eb63c91

Browse files
Merge pull request #13571 from guardian/crossword-entries-schema
Bump to V3 @guardian/react-crossword: Fix entries schema
2 parents 4091191 + d6e964c commit eb63c91

File tree

6 files changed

+102
-99
lines changed

6 files changed

+102
-99
lines changed

dotcom-rendering/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
"@guardian/libs": "22.0.0",
5151
"@guardian/ophan-tracker-js": "2.2.5",
5252
"@guardian/react-crossword": "2.0.2",
53-
"@guardian/react-crossword-next": "npm:@guardian/react-crossword@0.0.0-canary-20250307143039",
53+
"@guardian/react-crossword-next": "npm:@guardian/react-crossword@3.0.0",
5454
"@guardian/shimport": "1.0.2",
5555
"@guardian/source": "8.0.0",
5656
"@guardian/source-development-kitchen": "12.0.0",

dotcom-rendering/scripts/env/check-deps.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,7 @@ if (pkg.devDependencies) {
1212
* We don't check packages that are not semver-compatible
1313
* @type {RegExp[]}
1414
*/
15-
const exceptions = /** @type {const} */ ([
16-
/npm:@guardian\/react-crossword@0.0.0-canary/,
17-
]);
15+
const exceptions = /** @type {const} */ ([/npm:@guardian\/react-crossword@/]);
1816

1917
const mismatches = Object.entries(pkg.dependencies)
2018
.filter(

dotcom-rendering/src/layouts/CrosswordLayout.tsx

Lines changed: 79 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -267,66 +267,89 @@ export const CrosswordLayout = (props: Props) => {
267267
/>
268268
</GridItem>
269269
)}
270-
<GridItem area="body" element="article">
271-
<ArticleContainer format={format}>
272-
<ArticleBody
273-
format={format}
274-
blocks={article.blocks}
275-
host={host}
276-
pageId={article.pageId}
277-
webTitle={article.webTitle}
278-
ajaxUrl={article.config.ajaxUrl}
279-
abTests={article.config.abTests}
280-
switches={article.config.switches}
281-
isSensitive={article.config.isSensitive}
282-
isAdFreeUser={article.isAdFreeUser}
283-
sectionId={article.config.section}
284-
shouldHideReaderRevenue={
285-
article.shouldHideReaderRevenue
286-
}
287-
tags={article.tags}
288-
isPaidContent={
289-
!!article.config.isPaidContent
290-
}
291-
contributionsServiceUrl={
292-
contributionsServiceUrl
293-
}
294-
contentType={article.contentType}
295-
isPreview={article.config.isPreview}
296-
idUrl={article.config.idUrl ?? ''}
297-
isDev={!!article.config.isDev}
298-
keywordIds={article.config.keywordIds}
299-
tableOfContents={
300-
article.tableOfContents
301-
}
302-
lang={article.lang}
303-
isRightToLeftLang={
304-
article.isRightToLeftLang
305-
}
306-
editionId={article.editionId}
307-
/>
308-
</ArticleContainer>
309-
</GridItem>
310-
<GridItem area="right-column">
311-
<RightColumn showFrom="wide">
312-
<div
313-
css={css`
314-
margin-top: ${remSpace[3]};
315-
`}
316-
>
317-
{renderAds ? (
318-
<AdSlot
319-
position="right"
320-
display={format.display}
321-
isPaidContent={isPaidContent}
270+
{Boolean(article.crossword?.entries.length) && (
271+
<>
272+
<GridItem area="body" element="article">
273+
<ArticleContainer format={format}>
274+
<ArticleBody
275+
format={format}
276+
blocks={article.blocks}
277+
host={host}
278+
pageId={article.pageId}
279+
webTitle={article.webTitle}
280+
ajaxUrl={article.config.ajaxUrl}
281+
abTests={article.config.abTests}
282+
switches={
283+
article.config.switches
284+
}
285+
isSensitive={
286+
article.config.isSensitive
287+
}
288+
isAdFreeUser={
289+
article.isAdFreeUser
290+
}
291+
sectionId={
292+
article.config.section
293+
}
322294
shouldHideReaderRevenue={
323295
article.shouldHideReaderRevenue
324296
}
297+
tags={article.tags}
298+
isPaidContent={
299+
!!article.config
300+
.isPaidContent
301+
}
302+
contributionsServiceUrl={
303+
contributionsServiceUrl
304+
}
305+
contentType={
306+
article.contentType
307+
}
308+
isPreview={
309+
article.config.isPreview
310+
}
311+
idUrl={
312+
article.config.idUrl ?? ''
313+
}
314+
isDev={!!article.config.isDev}
315+
keywordIds={
316+
article.config.keywordIds
317+
}
318+
tableOfContents={
319+
article.tableOfContents
320+
}
321+
lang={article.lang}
322+
isRightToLeftLang={
323+
article.isRightToLeftLang
324+
}
325+
editionId={article.editionId}
325326
/>
326-
) : null}
327-
</div>
328-
</RightColumn>
329-
</GridItem>
327+
</ArticleContainer>
328+
</GridItem>
329+
<GridItem area="right-column">
330+
<RightColumn showFrom="wide">
331+
<div
332+
css={css`
333+
margin-top: ${remSpace[3]};
334+
`}
335+
>
336+
{renderAds ? (
337+
<AdSlot
338+
position="right"
339+
display={format.display}
340+
isPaidContent={
341+
isPaidContent
342+
}
343+
shouldHideReaderRevenue={
344+
article.shouldHideReaderRevenue
345+
}
346+
/>
347+
) : null}
348+
</div>
349+
</RightColumn>
350+
</GridItem>
351+
</>
352+
)}
330353
</CrosswordGrid>
331354
</div>
332355
</Section>

dotcom-rendering/src/model/article-schema.json

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -492,13 +492,7 @@
492492
},
493493
"entries": {
494494
"type": "array",
495-
"items": [
496-
{
497-
"$ref": "#/definitions/CAPIEntry"
498-
}
499-
],
500-
"minItems": 1,
501-
"additionalItems": {
495+
"items": {
502496
"$ref": "#/definitions/CAPIEntry"
503497
}
504498
},
@@ -4220,13 +4214,7 @@
42204214
},
42214215
"entries": {
42224216
"type": "array",
4223-
"items": [
4224-
{
4225-
"$ref": "#/definitions/CAPIEntry"
4226-
}
4227-
],
4228-
"minItems": 1,
4229-
"additionalItems": {
4217+
"items": {
42304218
"$ref": "#/definitions/CAPIEntry"
42314219
}
42324220
},

dotcom-rendering/src/model/block-schema.json

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3707,13 +3707,7 @@
37073707
},
37083708
"entries": {
37093709
"type": "array",
3710-
"items": [
3711-
{
3712-
"$ref": "#/definitions/CAPIEntry"
3713-
}
3714-
],
3715-
"minItems": 1,
3716-
"additionalItems": {
3710+
"items": {
37173711
"$ref": "#/definitions/CAPIEntry"
37183712
}
37193713
},

pnpm-lock.yaml

Lines changed: 18 additions & 18 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)