Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 3 additions & 5 deletions dotcom-rendering/src/model/enhanceCards.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import type {
DCRSlideshowImage,
DCRSupportingContent,
FEFrontCard,
FEMediaAtoms,
FEMediaAtom,
FESupportingContent,
} from '../types/front';
import type { MainMedia } from '../types/mainMedia';
Expand Down Expand Up @@ -185,9 +185,7 @@ const enhanceTags = (tags: FETagType[]): TagType[] => {
* @see https://github.com/guardian/frontend/pull/26247 for inspiration
*/

const getActiveMediaAtom = (
mediaAtom?: FEMediaAtoms,
): MainMedia | undefined => {
const getActiveMediaAtom = (mediaAtom?: FEMediaAtom): MainMedia | undefined => {
if (mediaAtom) {
const asset = mediaAtom.assets.find(
({ version }) => version === mediaAtom.activeVersion,
Expand Down Expand Up @@ -220,7 +218,7 @@ const getActiveMediaAtom = (
const decideMedia = (
format: ArticleFormat,
showMainVideo?: boolean,
mediaAtom?: FEMediaAtoms,
mediaAtom?: FEMediaAtom,
): MainMedia | undefined => {
// If the showVideo toggle is enabled in the fronts tool,
// we should return the active mediaAtom regardless of the design
Expand Down
8 changes: 4 additions & 4 deletions dotcom-rendering/src/model/front-schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -755,7 +755,7 @@
"mediaAtoms": {
"type": "array",
"items": {
"$ref": "#/definitions/FEMediaAtoms"
"$ref": "#/definitions/FEMediaAtom"
}
}
},
Expand Down Expand Up @@ -1477,7 +1477,7 @@
"mediaAtoms": {
"type": "array",
"items": {
"$ref": "#/definitions/FEMediaAtoms"
"$ref": "#/definitions/FEMediaAtom"
}
}
},
Expand Down Expand Up @@ -2199,7 +2199,7 @@
"mediaAtoms": {
"type": "array",
"items": {
"$ref": "#/definitions/FEMediaAtoms"
"$ref": "#/definitions/FEMediaAtom"
}
}
},
Expand Down Expand Up @@ -2928,7 +2928,7 @@
],
"type": "string"
},
"FEMediaAtoms": {
"FEMediaAtom": {
"type": "object",
"properties": {
"id": {
Expand Down
4 changes: 2 additions & 2 deletions dotcom-rendering/src/model/tag-front-schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@
"mediaAtoms": {
"type": "array",
"items": {
"$ref": "#/definitions/FEMediaAtoms"
"$ref": "#/definitions/FEMediaAtom"
}
}
},
Expand Down Expand Up @@ -1243,7 +1243,7 @@
],
"type": "string"
},
"FEMediaAtoms": {
"FEMediaAtom": {
"type": "object",
"properties": {
"id": {
Expand Down
4 changes: 2 additions & 2 deletions dotcom-rendering/src/types/front.ts
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ interface MediaAsset {
}

/** @see https://github.com/guardian/frontend/blob/0bf69f55a/common/app/model/content/Atom.scala#L158-L169 */
export interface FEMediaAtoms {
export interface FEMediaAtom {
id: string;
// defaultHtml: string; // currently unused
assets: MediaAsset[];
Expand Down Expand Up @@ -206,7 +206,7 @@ export type FEFrontCard = {
};
elements: {
mainVideo?: unknown;
mediaAtoms: FEMediaAtoms[];
mediaAtoms: FEMediaAtom[];
};
tags: { tags: FETagType[] };
};
Expand Down