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
1 change: 1 addition & 0 deletions dotcom-rendering/fixtures/generated/match-report.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
};
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ export const FootballMatchSummary = {
homeTeam: matchReport.homeTeam,
awayTeam: matchReport.awayTeam,
comments: matchReport.comments,
status: matchReport.status,
},
},
} satisfies Story;
2 changes: 2 additions & 0 deletions dotcom-rendering/src/components/GetMatchNav.importable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ type Props = {
type MatchData = {
homeTeam: Pick<TeamType, 'name' | 'score' | 'scorers' | 'crest'>;
awayTeam: Pick<TeamType, 'name' | 'score' | 'scorers' | 'crest'>;
status: string;
comments?: string;
minByMinUrl?: string;
venue?: string;
Expand All @@ -35,6 +36,7 @@ const fallbackTeam = {
const fallbackData = {
homeTeam: fallbackTeam,
awayTeam: fallbackTeam,
status: '',
} satisfies MatchData;

const validateMatchData = (data: unknown): data is MatchData => {
Expand Down
4 changes: 3 additions & 1 deletion dotcom-rendering/src/footballMatch.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { isOneOf } from '@guardian/libs';
import { listParse } from './footballMatches';
import { listParse, replaceLiveMatchStatus } from './footballMatches';
import type {
FEFootballMatch,
FEFootballPlayer,
Expand Down Expand Up @@ -48,6 +48,7 @@ export type FootballPlayer = {
export type FootballMatch = {
homeTeam: FootballTeam;
awayTeam: FootballTeam;
status: string;
comments?: string;
};

Expand Down Expand Up @@ -142,6 +143,7 @@ export const parse = (
return ok({
homeTeam: parsedHomeTeam.value,
awayTeam: parsedAwayTeam.value,
status: replaceLiveMatchStatus(feFootballMatch.status),
comments: feFootballMatch.comments,
});
};
2 changes: 1 addition & 1 deletion dotcom-rendering/src/footballMatches.ts
Original file line number Diff line number Diff line change
Expand Up @@ -411,6 +411,6 @@ const paStatusToMatchStatus: Record<string, string> = {
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);
};
1 change: 1 addition & 0 deletions dotcom-rendering/src/frontend/feFootballMatchPage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ export type FEFootballMatch = {
id: string;
homeTeam: FEFootballTeam;
awayTeam: FEFootballTeam;
status: string;
comments?: string;
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -281,14 +281,18 @@
"shotsOn"
]
},
"status": {
"type": "string"
},
"comments": {
"type": "string"
}
},
"required": [
"awayTeam",
"homeTeam",
"id"
"id",
"status"
]
}
},
Expand Down
4 changes: 1 addition & 3 deletions dotcom-rendering/src/layouts/LiveLayout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -360,9 +360,7 @@ export const LiveLayout = (props: WebProps | AppsProps) => {
{footballMatchUrl ? (
<Section
showTopBorder={false}
backgroundColour={themePalette(
'--match-nav-background',
)}
backgroundColour={'red'}
borderColour={themePalette('--headline-border')}
leftContent={
<ArticleTitle
Expand Down
1 change: 1 addition & 0 deletions dotcom-rendering/src/types/matchReport.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,5 @@ export type MatchReportType = {
comments: string;
minByMinUrl: string;
reportUrl: string;
status: string;
};
Loading