From 73a5071f790ac36d65c4cda94dccdfd30a0ad8fb Mon Sep 17 00:00:00 2001 From: Alex Sanders Date: Thu, 12 Dec 2024 13:46:04 +0000 Subject: [PATCH] crossword instructions are in the main type --- .../src/model/article-schema.json | 335 ++++++++---------- dotcom-rendering/src/model/block-schema.json | 168 ++++----- dotcom-rendering/src/types/content.ts | 2 +- dotcom-rendering/src/types/frontend.ts | 2 +- 4 files changed, 234 insertions(+), 273 deletions(-) diff --git a/dotcom-rendering/src/model/article-schema.json b/dotcom-rendering/src/model/article-schema.json index 1572360541..e3f3d0027e 100644 --- a/dotcom-rendering/src/model/article-schema.json +++ b/dotcom-rendering/src/model/article-schema.json @@ -438,116 +438,101 @@ "type": "boolean" }, "crossword": { - "allOf": [ - { + "type": "object", + "properties": { + "creator": { "type": "object", "properties": { - "creator": { - "type": "object", - "properties": { - "name": { - "type": "string" - }, - "webUrl": { - "type": "string" - } - }, - "required": [ - "name", - "webUrl" - ] - }, - "crosswordType": { - "enum": [ - "cryptic", - "everyman", - "prize", - "quick", - "quick-cryptic", - "quiptic", - "special", - "speedy", - "weekend" - ], - "type": "string" - }, - "date": { - "type": "number" - }, - "dateSolutionAvailable": { - "type": "number" - }, - "dimensions": { - "type": "object", - "properties": { - "rows": { - "type": "number" - }, - "cols": { - "type": "number" - } - }, - "required": [ - "cols", - "rows" - ] - }, - "entries": { - "type": "array", - "items": [ - { - "$ref": "#/definitions/CAPIEntry" - } - ], - "minItems": 1, - "additionalItems": { - "$ref": "#/definitions/CAPIEntry" - } - }, - "id": { - "type": "string" - }, "name": { "type": "string" }, - "number": { - "type": "number" - }, - "pdf": { - "type": "string" - }, - "solutionAvailable": { - "type": "boolean" - }, - "webPublicationDate": { - "type": "number" - }, - "instructions": { + "webUrl": { "type": "string" } }, "required": [ - "crosswordType", - "date", - "dimensions", - "entries", - "id", "name", - "number", - "solutionAvailable" + "webUrl" ] }, - { + "crosswordType": { + "enum": [ + "cryptic", + "everyman", + "prize", + "quick", + "quick-cryptic", + "quiptic", + "special", + "speedy", + "weekend" + ], + "type": "string" + }, + "date": { + "type": "number" + }, + "dateSolutionAvailable": { + "type": "number" + }, + "dimensions": { "type": "object", "properties": { - "instructions": { - "type": "string" + "rows": { + "type": "number" + }, + "cols": { + "type": "number" } }, "required": [ - "instructions" + "cols", + "rows" ] + }, + "entries": { + "type": "array", + "items": [ + { + "$ref": "#/definitions/CAPIEntry" + } + ], + "minItems": 1, + "additionalItems": { + "$ref": "#/definitions/CAPIEntry" + } + }, + "id": { + "type": "string" + }, + "name": { + "type": "string" + }, + "number": { + "type": "number" + }, + "pdf": { + "type": "string" + }, + "solutionAvailable": { + "type": "boolean" + }, + "webPublicationDate": { + "type": "number" + }, + "instructions": { + "type": "string" } + }, + "required": [ + "crosswordType", + "date", + "dimensions", + "entries", + "id", + "name", + "number", + "solutionAvailable" ] } }, @@ -4102,113 +4087,101 @@ "const": "model.dotcomrendering.pageElements.CrosswordElement" }, "crossword": { - "allOf": [ - { + "type": "object", + "properties": { + "creator": { "type": "object", "properties": { - "creator": { - "type": "object", - "properties": { - "name": { - "type": "string" - }, - "webUrl": { - "type": "string" - } - }, - "required": [ - "name", - "webUrl" - ] - }, - "crosswordType": { - "enum": [ - "cryptic", - "everyman", - "prize", - "quick", - "quick-cryptic", - "quiptic", - "special", - "speedy", - "weekend" - ], - "type": "string" - }, - "date": { - "type": "number" - }, - "dateSolutionAvailable": { - "type": "number" - }, - "dimensions": { - "type": "object", - "properties": { - "rows": { - "type": "number" - }, - "cols": { - "type": "number" - } - }, - "required": [ - "cols", - "rows" - ] - }, - "entries": { - "type": "array", - "items": [ - { - "$ref": "#/definitions/CAPIEntry" - } - ], - "minItems": 1, - "additionalItems": { - "$ref": "#/definitions/CAPIEntry" - } - }, - "id": { - "type": "string" - }, "name": { "type": "string" }, - "number": { - "type": "number" - }, - "pdf": { - "type": "string" - }, - "solutionAvailable": { - "type": "boolean" - }, - "webPublicationDate": { - "type": "number" - }, - "instructions": { + "webUrl": { "type": "string" } }, "required": [ - "crosswordType", - "date", - "dimensions", - "entries", - "id", "name", - "number", - "solutionAvailable" + "webUrl" ] }, - { + "crosswordType": { + "enum": [ + "cryptic", + "everyman", + "prize", + "quick", + "quick-cryptic", + "quiptic", + "special", + "speedy", + "weekend" + ], + "type": "string" + }, + "date": { + "type": "number" + }, + "dateSolutionAvailable": { + "type": "number" + }, + "dimensions": { "type": "object", "properties": { - "instructions": { - "type": "string" + "rows": { + "type": "number" + }, + "cols": { + "type": "number" } + }, + "required": [ + "cols", + "rows" + ] + }, + "entries": { + "type": "array", + "items": [ + { + "$ref": "#/definitions/CAPIEntry" + } + ], + "minItems": 1, + "additionalItems": { + "$ref": "#/definitions/CAPIEntry" } + }, + "id": { + "type": "string" + }, + "name": { + "type": "string" + }, + "number": { + "type": "number" + }, + "pdf": { + "type": "string" + }, + "solutionAvailable": { + "type": "boolean" + }, + "webPublicationDate": { + "type": "number" + }, + "instructions": { + "type": "string" } + }, + "required": [ + "crosswordType", + "date", + "dimensions", + "entries", + "id", + "name", + "number", + "solutionAvailable" ] } }, diff --git a/dotcom-rendering/src/model/block-schema.json b/dotcom-rendering/src/model/block-schema.json index 53e7a6246b..6ef5a7178a 100644 --- a/dotcom-rendering/src/model/block-schema.json +++ b/dotcom-rendering/src/model/block-schema.json @@ -3574,113 +3574,101 @@ "const": "model.dotcomrendering.pageElements.CrosswordElement" }, "crossword": { - "allOf": [ - { + "type": "object", + "properties": { + "creator": { "type": "object", "properties": { - "creator": { - "type": "object", - "properties": { - "name": { - "type": "string" - }, - "webUrl": { - "type": "string" - } - }, - "required": [ - "name", - "webUrl" - ] - }, - "crosswordType": { - "enum": [ - "cryptic", - "everyman", - "prize", - "quick", - "quick-cryptic", - "quiptic", - "special", - "speedy", - "weekend" - ], - "type": "string" - }, - "date": { - "type": "number" - }, - "dateSolutionAvailable": { - "type": "number" - }, - "dimensions": { - "type": "object", - "properties": { - "rows": { - "type": "number" - }, - "cols": { - "type": "number" - } - }, - "required": [ - "cols", - "rows" - ] - }, - "entries": { - "type": "array", - "items": [ - { - "$ref": "#/definitions/CAPIEntry" - } - ], - "minItems": 1, - "additionalItems": { - "$ref": "#/definitions/CAPIEntry" - } - }, - "id": { - "type": "string" - }, "name": { "type": "string" }, - "number": { - "type": "number" - }, - "pdf": { - "type": "string" - }, - "solutionAvailable": { - "type": "boolean" - }, - "webPublicationDate": { - "type": "number" - }, - "instructions": { + "webUrl": { "type": "string" } }, "required": [ - "crosswordType", - "date", - "dimensions", - "entries", - "id", "name", - "number", - "solutionAvailable" + "webUrl" ] }, - { + "crosswordType": { + "enum": [ + "cryptic", + "everyman", + "prize", + "quick", + "quick-cryptic", + "quiptic", + "special", + "speedy", + "weekend" + ], + "type": "string" + }, + "date": { + "type": "number" + }, + "dateSolutionAvailable": { + "type": "number" + }, + "dimensions": { "type": "object", "properties": { - "instructions": { - "type": "string" + "rows": { + "type": "number" + }, + "cols": { + "type": "number" } + }, + "required": [ + "cols", + "rows" + ] + }, + "entries": { + "type": "array", + "items": [ + { + "$ref": "#/definitions/CAPIEntry" + } + ], + "minItems": 1, + "additionalItems": { + "$ref": "#/definitions/CAPIEntry" } + }, + "id": { + "type": "string" + }, + "name": { + "type": "string" + }, + "number": { + "type": "number" + }, + "pdf": { + "type": "string" + }, + "solutionAvailable": { + "type": "boolean" + }, + "webPublicationDate": { + "type": "number" + }, + "instructions": { + "type": "string" } + }, + "required": [ + "crosswordType", + "date", + "dimensions", + "entries", + "id", + "name", + "number", + "solutionAvailable" ] } }, diff --git a/dotcom-rendering/src/types/content.ts b/dotcom-rendering/src/types/content.ts index a1db80b0f9..b8c9226379 100644 --- a/dotcom-rendering/src/types/content.ts +++ b/dotcom-rendering/src/types/content.ts @@ -736,7 +736,7 @@ interface WitnessTypeBlockElement extends ThirdPartyEmbeddedContent { export interface CrosswordElement { _type: 'model.dotcomrendering.pageElements.CrosswordElement'; - crossword: CrosswordProps['data'] & { instructions?: string }; + crossword: CrosswordProps['data']; } export type FEElement = diff --git a/dotcom-rendering/src/types/frontend.ts b/dotcom-rendering/src/types/frontend.ts index 1c3bee83cd..ce15ae5681 100644 --- a/dotcom-rendering/src/types/frontend.ts +++ b/dotcom-rendering/src/types/frontend.ts @@ -127,7 +127,7 @@ export interface FEArticleType { showTableOfContents: boolean; lang?: string; isRightToLeftLang?: boolean; - crossword?: CrosswordProps['data'] & { instructions: string }; + crossword?: CrosswordProps['data']; } type PageTypeType = {