diff --git a/dotcom-rendering/fixtures/generated/match-report.ts b/dotcom-rendering/fixtures/generated/match-report.ts index d3619a35dc0..abf5e631e9a 100644 --- a/dotcom-rendering/fixtures/generated/match-report.ts +++ b/dotcom-rendering/fixtures/generated/match-report.ts @@ -563,4 +563,5 @@ export const matchReport: MatchReportType = { 'https://www.theguardian.com/football/live/2025/jul/08/germany-v-denmark-euro-2025-live', reportUrl: 'https://www.theguardian.com/football/2025/jul/08/germany-denmark-women-euro-2025-group-c-match-report', + status: 'FT', }; diff --git a/dotcom-rendering/src/components/FootballMatchSummary.stories.tsx b/dotcom-rendering/src/components/FootballMatchSummary.stories.tsx index 7ac195fc9cc..598c379576c 100644 --- a/dotcom-rendering/src/components/FootballMatchSummary.stories.tsx +++ b/dotcom-rendering/src/components/FootballMatchSummary.stories.tsx @@ -24,6 +24,7 @@ export const FootballMatchSummary = { homeTeam: matchReport.homeTeam, awayTeam: matchReport.awayTeam, comments: matchReport.comments, + status: matchReport.status, }, }, } satisfies Story; diff --git a/dotcom-rendering/src/components/GetMatchNav.importable.tsx b/dotcom-rendering/src/components/GetMatchNav.importable.tsx index 45202381aea..a686d7e7747 100644 --- a/dotcom-rendering/src/components/GetMatchNav.importable.tsx +++ b/dotcom-rendering/src/components/GetMatchNav.importable.tsx @@ -20,6 +20,7 @@ type Props = { type MatchData = { homeTeam: Pick; awayTeam: Pick; + status: string; comments?: string; minByMinUrl?: string; venue?: string; @@ -35,6 +36,7 @@ const fallbackTeam = { const fallbackData = { homeTeam: fallbackTeam, awayTeam: fallbackTeam, + status: '', } satisfies MatchData; const validateMatchData = (data: unknown): data is MatchData => { diff --git a/dotcom-rendering/src/footballMatch.ts b/dotcom-rendering/src/footballMatch.ts index c9a25c19c72..ad3d9c893a8 100644 --- a/dotcom-rendering/src/footballMatch.ts +++ b/dotcom-rendering/src/footballMatch.ts @@ -1,5 +1,5 @@ import { isOneOf } from '@guardian/libs'; -import { listParse } from './footballMatches'; +import { listParse, replaceLiveMatchStatus } from './footballMatches'; import type { FEFootballMatch, FEFootballPlayer, @@ -48,6 +48,7 @@ export type FootballPlayer = { export type FootballMatch = { homeTeam: FootballTeam; awayTeam: FootballTeam; + status: string; comments?: string; }; @@ -142,6 +143,7 @@ export const parse = ( return ok({ homeTeam: parsedHomeTeam.value, awayTeam: parsedAwayTeam.value, + status: replaceLiveMatchStatus(feFootballMatch.status), comments: feFootballMatch.comments, }); }; diff --git a/dotcom-rendering/src/footballMatches.ts b/dotcom-rendering/src/footballMatches.ts index 61332484c61..40c88d802f3 100644 --- a/dotcom-rendering/src/footballMatches.ts +++ b/dotcom-rendering/src/footballMatches.ts @@ -411,6 +411,6 @@ const paStatusToMatchStatus: Record = { Cancelled: 'C', // A Match has been Cancelled. }; -const replaceLiveMatchStatus = (status: string): string => { +export const replaceLiveMatchStatus = (status: string): string => { return paStatusToMatchStatus[status] ?? status.slice(0, 2); }; diff --git a/dotcom-rendering/src/frontend/feFootballMatchPage.ts b/dotcom-rendering/src/frontend/feFootballMatchPage.ts index 6320a529ddd..b67f5fb9e62 100644 --- a/dotcom-rendering/src/frontend/feFootballMatchPage.ts +++ b/dotcom-rendering/src/frontend/feFootballMatchPage.ts @@ -36,6 +36,7 @@ export type FEFootballMatch = { id: string; homeTeam: FEFootballTeam; awayTeam: FEFootballTeam; + status: string; comments?: string; }; diff --git a/dotcom-rendering/src/frontend/schemas/feFootballMatchPage.json b/dotcom-rendering/src/frontend/schemas/feFootballMatchPage.json index 205fe136e3e..a5f1ef61a5e 100644 --- a/dotcom-rendering/src/frontend/schemas/feFootballMatchPage.json +++ b/dotcom-rendering/src/frontend/schemas/feFootballMatchPage.json @@ -281,6 +281,9 @@ "shotsOn" ] }, + "status": { + "type": "string" + }, "comments": { "type": "string" } @@ -288,7 +291,8 @@ "required": [ "awayTeam", "homeTeam", - "id" + "id", + "status" ] } }, diff --git a/dotcom-rendering/src/layouts/LiveLayout.tsx b/dotcom-rendering/src/layouts/LiveLayout.tsx index f745d7fd14f..e78442c22f7 100644 --- a/dotcom-rendering/src/layouts/LiveLayout.tsx +++ b/dotcom-rendering/src/layouts/LiveLayout.tsx @@ -360,9 +360,7 @@ export const LiveLayout = (props: WebProps | AppsProps) => { {footballMatchUrl ? (