From 9bb704b4fedda4e78442f306e9576a253e3098f4 Mon Sep 17 00:00:00 2001 From: Ashleigh Carr Date: Fri, 21 Jul 2023 12:13:31 +0100 Subject: [PATCH] Mark DocumentBlockElement props as optional --- .../src/components/DocumentBlockComponent.importable.tsx | 4 ++-- dotcom-rendering/src/model/article-schema.json | 5 +---- dotcom-rendering/src/model/block-schema.json | 5 +---- dotcom-rendering/src/types/content.ts | 6 +++--- 4 files changed, 7 insertions(+), 13 deletions(-) diff --git a/dotcom-rendering/src/components/DocumentBlockComponent.importable.tsx b/dotcom-rendering/src/components/DocumentBlockComponent.importable.tsx index 1c50fbaaf23..00fac3e5713 100644 --- a/dotcom-rendering/src/components/DocumentBlockComponent.importable.tsx +++ b/dotcom-rendering/src/components/DocumentBlockComponent.importable.tsx @@ -25,14 +25,14 @@ export const getDocumentCloudAssetUrl = ( type Props = { embedUrl?: string; - height: number; + height?: number; isMainMedia: boolean; isTracking: boolean; role?: RoleType; source?: string; sourceDomain?: string; title?: string; - width: number; + width?: number; }; export const DocumentBlockComponent = ({ diff --git a/dotcom-rendering/src/model/article-schema.json b/dotcom-rendering/src/model/article-schema.json index b971ecfb0c6..d3bb7796c5b 100644 --- a/dotcom-rendering/src/model/article-schema.json +++ b/dotcom-rendering/src/model/article-schema.json @@ -1666,10 +1666,7 @@ "required": [ "_type", "elementId", - "embedUrl", - "height", - "isThirdPartyTracking", - "width" + "isThirdPartyTracking" ] }, "EmbedBlockElement": { diff --git a/dotcom-rendering/src/model/block-schema.json b/dotcom-rendering/src/model/block-schema.json index 073e572beb9..80b7111cfe7 100644 --- a/dotcom-rendering/src/model/block-schema.json +++ b/dotcom-rendering/src/model/block-schema.json @@ -1197,10 +1197,7 @@ "required": [ "_type", "elementId", - "embedUrl", - "height", - "isThirdPartyTracking", - "width" + "isThirdPartyTracking" ] }, "EmbedBlockElement": { diff --git a/dotcom-rendering/src/types/content.ts b/dotcom-rendering/src/types/content.ts index 38abc02a098..3da0b2c607b 100644 --- a/dotcom-rendering/src/types/content.ts +++ b/dotcom-rendering/src/types/content.ts @@ -158,9 +158,9 @@ export interface DividerBlockElement { export interface DocumentBlockElement extends ThirdPartyEmbeddedContent { _type: 'model.dotcomrendering.pageElements.DocumentBlockElement'; elementId: string; - embedUrl: string; - height: number; - width: number; + embedUrl?: string; + height?: number; + width?: number; title?: string; role?: RoleType; }