From ef3ae5a5cfc8615043101799aff4c64683436efb Mon Sep 17 00:00:00 2001 From: Jake Lee Kennedy <1731150+Jakeii@users.noreply.github.com> Date: Tue, 11 Aug 2026 16:14:31 +0100 Subject: [PATCH 1/2] remove matchUrl from data model --- .../fixtures/generated/match-report.ts | 567 ------------------ .../scripts/test-data/gen-fixtures.js | 28 - .../src/frontend/feFootballMatchInfoPage.ts | 1 - .../src/layouts/StandardLayout.tsx | 14 +- .../src/layouts/StandardLayoutArticleGrid.tsx | 9 +- dotcom-rendering/src/lib/mockRESTCalls.ts | 4 - .../src/server/handler.sportDataPage.ts | 1 - dotcom-rendering/src/sportDataPage.ts | 1 - 8 files changed, 10 insertions(+), 615 deletions(-) delete mode 100644 dotcom-rendering/fixtures/generated/match-report.ts diff --git a/dotcom-rendering/fixtures/generated/match-report.ts b/dotcom-rendering/fixtures/generated/match-report.ts deleted file mode 100644 index 40cd0a4d3c7..00000000000 --- a/dotcom-rendering/fixtures/generated/match-report.ts +++ /dev/null @@ -1,567 +0,0 @@ -/** - * DO NOT EDIT THIS FILE! - * - * This file was automatically generated using the gen-fixtures.js script. Any edits - * you make here will be lost. - * - * If the data in these fixtures is not what you expect then - * - * 1. Refresh the data using 'make gen-fixtures' or - * 2. if the latest live data is not what you need, then consider editing - * gen-fixtures.js directly. - */ - -import type { MatchReportType } from '../../src/types/matchReport'; - -export const matchReport: MatchReportType = { - id: '4479251', - isResult: true, - homeTeam: { - id: '7699', - name: 'Germany', - codename: 'GER', - players: [ - { - id: '519035', - name: 'Ann-Katrin Berger', - position: 'Goal Keeper', - lastName: 'Berger', - substitute: false, - timeOnPitch: '107:43', - shirtNumber: '1', - events: [], - }, - { - id: '671576', - name: 'Carlotta Wamser', - position: 'Defender', - lastName: 'Wamser', - substitute: false, - timeOnPitch: '107:43', - shirtNumber: '5', - events: [], - }, - { - id: '669621', - name: 'Janina Minge', - position: 'Midfielder', - lastName: 'Minge', - substitute: false, - timeOnPitch: '107:43', - shirtNumber: '6', - events: [], - }, - { - id: '537641', - name: 'Rebecca Knaak', - position: 'Defender', - lastName: 'Knaak', - substitute: false, - timeOnPitch: '87:47', - shirtNumber: '4', - events: [ - { - eventTime: '49', - eventType: 'booking', - }, - ], - }, - { - id: '642145', - name: 'Sarai Linder', - position: 'Defender', - lastName: 'Linder', - substitute: false, - timeOnPitch: '107:43', - shirtNumber: '2', - events: [], - }, - { - id: '673131', - name: 'Elisa Senss', - position: 'Midfielder', - lastName: 'Senss', - substitute: false, - timeOnPitch: '107:43', - shirtNumber: '20', - events: [], - }, - { - id: '664723', - name: 'Sjoeke Nusken', - position: 'Defender', - lastName: 'Nusken', - substitute: false, - timeOnPitch: '107:43', - shirtNumber: '9', - events: [], - }, - { - id: '642149', - name: 'Jule Brand', - position: 'Midfielder', - lastName: 'Brand', - substitute: false, - timeOnPitch: '105:08', - shirtNumber: '22', - events: [], - }, - { - id: '465927', - name: 'Linda Dallmann', - position: 'Midfielder', - lastName: 'Dallmann', - substitute: false, - timeOnPitch: '77:00', - shirtNumber: '16', - events: [], - }, - { - id: '613923', - name: 'Klara Buehl', - position: 'Striker', - lastName: 'Buehl', - substitute: false, - timeOnPitch: '107:43', - shirtNumber: '19', - events: [], - }, - { - id: '613921', - name: 'Lea Schuller', - position: 'Striker', - lastName: 'Schuller', - substitute: false, - timeOnPitch: '76:51', - shirtNumber: '11', - events: [], - }, - { - id: '664721', - name: 'Stina Johannes', - position: 'Goal Keeper', - lastName: 'Johannes', - substitute: true, - timeOnPitch: '0:00', - shirtNumber: '12', - events: [], - }, - { - id: '404997', - name: 'Kathrin-Julia Hendrich', - position: 'Defender', - lastName: 'Hendrich', - substitute: true, - timeOnPitch: '19:56', - shirtNumber: '3', - events: [ - { - eventTime: '81', - eventType: 'substitution', - }, - ], - }, - { - id: '628694', - name: 'Sydney Lohmann', - position: 'Midfielder', - lastName: 'Lohmann', - substitute: true, - timeOnPitch: '0:00', - shirtNumber: '8', - events: [], - }, - { - id: '653596', - name: 'Laura Freigang', - position: 'Striker', - lastName: 'Freigang', - substitute: true, - timeOnPitch: '30:43', - shirtNumber: '10', - events: [ - { - eventTime: '70', - eventType: 'substitution', - }, - ], - }, - { - id: '512230', - name: 'Sara Dabritz', - position: 'Midfielder', - lastName: 'Dabritz', - substitute: true, - timeOnPitch: '0:00', - shirtNumber: '13', - events: [], - }, - { - id: '688664', - name: 'Cora Zicai', - position: 'Striker', - lastName: 'Zicai', - substitute: true, - timeOnPitch: '2:35', - shirtNumber: '14', - events: [ - { - eventTime: '90', - eventType: 'substitution', - }, - ], - }, - { - id: '683596', - name: 'Selina Cerci', - position: 'Striker', - lastName: 'Cerci', - substitute: true, - timeOnPitch: '0:00', - shirtNumber: '15', - events: [], - }, - { - id: '650041', - name: 'Franziska Kett', - position: 'Defender', - lastName: 'Kett', - substitute: true, - timeOnPitch: '0:00', - shirtNumber: '17', - events: [], - }, - { - id: '683597', - name: 'Giovanna Hoffmann', - position: 'Striker', - lastName: 'Hoffmann', - substitute: true, - timeOnPitch: '30:52', - shirtNumber: '18', - events: [ - { - eventTime: '70', - eventType: 'substitution', - }, - ], - }, - { - id: '653595', - name: 'Sophia Kleinherne', - position: 'Defender', - lastName: 'Kleinherne', - substitute: true, - timeOnPitch: '0:00', - shirtNumber: '23', - events: [], - }, - { - id: '664722', - name: 'Ena Mahmutovic', - position: 'Goal Keeper', - lastName: 'Mahmutovic', - substitute: true, - timeOnPitch: '0:00', - shirtNumber: '21', - events: [], - }, - ], - score: 2, - scorers: ['Sjoeke Nusken 56 Pen', 'Lea Schuller 66'], - possession: 69, - shotsOn: 7, - shotsOff: 6, - corners: 10, - fouls: 4, - colours: '#01009a', - crest: 'https://sport.guim.co.uk/football/crests/120/7699.png', - }, - awayTeam: { - id: '35854', - name: 'Denmark', - codename: 'DEN', - players: [ - { - id: '664928', - name: 'Maja Bay', - position: 'Goal Keeper', - lastName: 'Bay', - substitute: false, - timeOnPitch: '107:43', - shirtNumber: '1', - events: [], - }, - { - id: '642239', - name: 'Emma Faerge', - position: 'Defender', - lastName: 'Faerge', - substitute: false, - timeOnPitch: '107:43', - shirtNumber: '4', - events: [], - }, - { - id: '653587', - name: 'Stine Ballisager', - position: 'Defender', - lastName: 'Ballisager', - substitute: false, - timeOnPitch: '107:43', - shirtNumber: '3', - events: [], - }, - { - id: '381287', - name: 'Katrine Veje', - position: 'Defender', - lastName: 'Veje', - substitute: false, - timeOnPitch: '91:26', - shirtNumber: '11', - events: [ - { - eventTime: '51', - eventType: 'booking', - }, - ], - }, - { - id: '520582', - name: 'Frederikke Thogersen', - position: 'Midfielder', - lastName: 'Thogersen', - substitute: false, - timeOnPitch: '107:43', - shirtNumber: '15', - events: [], - }, - { - id: '653591', - name: 'Karen Holmgaard', - position: 'Midfielder', - lastName: 'Holmgaard', - substitute: false, - timeOnPitch: '67:16', - shirtNumber: '6', - events: [], - }, - { - id: '647619', - name: 'Emma Snerle', - position: 'Midfielder', - lastName: 'Snerle', - substitute: false, - timeOnPitch: '75:12', - shirtNumber: '8', - events: [], - }, - { - id: '653590', - name: 'Sara Holmgaard', - position: 'Midfielder', - lastName: 'Holmgaard', - substitute: false, - timeOnPitch: '107:43', - shirtNumber: '18', - events: [], - }, - { - id: '653588', - name: 'Janni Thomsen', - position: 'Defender', - lastName: 'Thomsen', - substitute: false, - timeOnPitch: '67:11', - shirtNumber: '19', - events: [], - }, - { - id: '663301', - name: 'Amalie Vangsgaard', - position: 'Striker', - lastName: 'Vangsgaard', - substitute: false, - timeOnPitch: '67:15', - shirtNumber: '21', - events: [], - }, - { - id: '404911', - name: 'Pernille Harder', - position: 'Striker', - lastName: 'Harder', - substitute: false, - timeOnPitch: '107:43', - shirtNumber: '10', - events: [], - }, - { - id: '664929', - name: 'Kathrine Larsen', - position: 'Goal Keeper', - lastName: 'Larsen', - substitute: true, - timeOnPitch: '0:00', - shirtNumber: '16', - events: [], - }, - { - id: '653589', - name: 'Sara Thrige', - position: 'Midfielder', - lastName: 'Thrige', - substitute: true, - timeOnPitch: '0:00', - shirtNumber: '2', - events: [], - }, - { - id: '642109', - name: 'Isabella Obaze', - position: 'Defender', - lastName: 'Obaze', - substitute: true, - timeOnPitch: '0:00', - shirtNumber: '5', - events: [], - }, - { - id: '381286', - name: 'Sanne Troelsgaard', - position: 'Striker', - lastName: 'Troelsgaard', - substitute: true, - timeOnPitch: '40:27', - shirtNumber: '7', - events: [ - { - eventTime: '61', - eventType: 'substitution', - }, - ], - }, - { - id: '433273', - name: 'Nadia Nadim', - position: 'Striker', - lastName: 'Nadim', - substitute: true, - timeOnPitch: '16:17', - shirtNumber: '9', - events: [ - { - eventTime: '85', - eventType: 'substitution', - }, - ], - }, - { - id: '653592', - name: 'Kathrine Kuhl', - position: 'Midfielder', - lastName: 'Kuhl', - substitute: true, - timeOnPitch: '0:00', - shirtNumber: '12', - events: [], - }, - { - id: '664932', - name: 'Josefine Hasbo', - position: 'Midfielder', - lastName: 'Hasbo', - substitute: true, - timeOnPitch: '32:31', - shirtNumber: '13', - events: [ - { - eventTime: '69', - eventType: 'substitution', - }, - ], - }, - { - id: '653593', - name: 'Sofie Bredgaard', - position: 'Midfielder', - lastName: 'Bredgaard', - substitute: true, - timeOnPitch: '0:00', - shirtNumber: '14', - events: [], - }, - { - id: '653594', - name: 'Rikke Madsen', - position: 'Striker', - lastName: 'Madsen', - substitute: true, - timeOnPitch: '0:00', - shirtNumber: '17', - events: [], - }, - { - id: '628635', - name: 'Signe Bruun', - position: 'Striker', - lastName: 'Bruun', - substitute: true, - timeOnPitch: '40:32', - shirtNumber: '20', - events: [ - { - eventTime: '61', - eventType: 'substitution', - }, - ], - }, - { - id: '642108', - name: 'Cornelia Kramer', - position: 'Striker', - lastName: 'Kramer', - substitute: true, - timeOnPitch: '40:28', - shirtNumber: '23', - events: [ - { - eventTime: '61', - eventType: 'substitution', - }, - ], - }, - { - id: '664930', - name: 'Alberte Vingum', - position: 'Goal Keeper', - lastName: 'Vingum', - substitute: true, - timeOnPitch: '0:00', - shirtNumber: '22', - events: [], - }, - ], - score: 1, - scorers: ['Amalie Vangsgaard 26'], - possession: 31, - shotsOn: 3, - shotsOff: 1, - corners: 3, - fouls: 5, - colours: '#ff0000', - crest: 'https://sport.guim.co.uk/football/crests/120/35854.png', - }, - competition: { - fullName: "Women's Euro 2025", - }, - isLive: false, - venue: 'St Jakob Park', - comments: '', - minByMinUrl: - '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/scripts/test-data/gen-fixtures.js b/dotcom-rendering/scripts/test-data/gen-fixtures.js index 095f6d55a1a..abe1aaa5acf 100644 --- a/dotcom-rendering/scripts/test-data/gen-fixtures.js +++ b/dotcom-rendering/scripts/test-data/gen-fixtures.js @@ -246,34 +246,6 @@ requests.push( }), ); -// MatchReport fixtures -requests.push( - // this URL may expire in the future; you can get a fresh one by finding a recent match - // from https://www.theguardian.com/tone/matchreports, then opening your network tab in - // your browser's devtools, and find a similar looking `api.nextgen` request, and copy - // that URL in here. - fetch( - 'https://api.nextgen.guardianapps.co.uk/football/api/match-nav/2025/07/08/35854/7699.json?dcr=true&page=football%2F2025%2Fjul%2F08%2Fgermany-denmark-women-euro-2025-group-c-match-report', - ) - .then((res) => res.json()) - .then((json) => { - // Write the new fixture data - const contents = `${HEADER} -import type { MatchReportType } from '../../src/types/matchReport'; - -export const matchReport: MatchReportType = ${JSON.stringify(json, null, 4)}`; - return fs.writeFile( - `${root}/fixtures/generated/match-report.ts`, - contents, - 'utf8', - ); - }) - .then(() => 'match-report.ts') - .catch((err) => { - throw new Error('Failed to create match-report.ts', { cause: err }); - }), -); - // Series requests.push( fetch( diff --git a/dotcom-rendering/src/frontend/feFootballMatchInfoPage.ts b/dotcom-rendering/src/frontend/feFootballMatchInfoPage.ts index 3fb8f40a7cb..c2eb91c7439 100644 --- a/dotcom-rendering/src/frontend/feFootballMatchInfoPage.ts +++ b/dotcom-rendering/src/frontend/feFootballMatchInfoPage.ts @@ -64,7 +64,6 @@ export type FEFootballMatchInfoPage = FEFootballDataPage & { matchInfo: FEFootballMatch; group?: FEGroupSummary; competitionName: string; - matchUrl: string; matchHeaderUrl: string; }; diff --git a/dotcom-rendering/src/layouts/StandardLayout.tsx b/dotcom-rendering/src/layouts/StandardLayout.tsx index 8a855b830a5..f35c80ec033 100644 --- a/dotcom-rendering/src/layouts/StandardLayout.tsx +++ b/dotcom-rendering/src/layouts/StandardLayout.tsx @@ -66,19 +66,21 @@ export const StandardLayout = (props: WebProps | AppProps) => { // 1) Read 'forceEpic' value from URL parameter and use it to force the slot to render // 2) Otherwise, ensure slot only renders if `article.config.shouldHideReaderRevenue` equals false. - const footballMatchUrl = + const footballMatchStatsUrl = article.matchType === 'FootballMatchType' - ? article.matchUrl + ? article.matchStatsUrl : undefined; const isFootballMatchReport = - format.design === ArticleDesign.MatchReport && !!footballMatchUrl; + format.design === ArticleDesign.MatchReport && !!footballMatchStatsUrl; - const cricketMatchUrl = - article.matchType == 'CricketMatchType' ? article.matchUrl : undefined; + const cricketMatchHeaderUrl = + article.matchType == 'CricketMatchType' + ? article.matchHeaderUrl + : undefined; const isCricketMatchReport = - format.design === ArticleDesign.MatchReport && !!cricketMatchUrl; + format.design === ArticleDesign.MatchReport && !!cricketMatchHeaderUrl; const showComments = article.isCommentable && !isPaidContent; diff --git a/dotcom-rendering/src/layouts/StandardLayoutArticleGrid.tsx b/dotcom-rendering/src/layouts/StandardLayoutArticleGrid.tsx index e366da5e64d..3479c82e80e 100644 --- a/dotcom-rendering/src/layouts/StandardLayoutArticleGrid.tsx +++ b/dotcom-rendering/src/layouts/StandardLayoutArticleGrid.tsx @@ -111,13 +111,8 @@ export const StandardLayoutArticleGrid = ({ format.design === ArticleDesign.Audio; const isShowcase = format.display === ArticleDisplay.Showcase; - const footballMatchUrl = - article.matchType === 'FootballMatchType' - ? article.matchUrl - : undefined; - const isFootballMatchReport = - format.design === ArticleDesign.MatchReport && !!footballMatchUrl; + format.design === ArticleDesign.MatchReport && !!footballMatchStatsUrl; const layoutType: LayoutType = isMedia ? 'media' @@ -166,7 +161,7 @@ export const StandardLayoutArticleGrid = ({ sectionLabel={article.sectionLabel} sectionUrl={article.sectionUrl} guardianBaseURL={article.guardianBaseURL} - isMatch={!!footballMatchUrl} + isMatch={isFootballMatchReport} /> diff --git a/dotcom-rendering/src/lib/mockRESTCalls.ts b/dotcom-rendering/src/lib/mockRESTCalls.ts index 3f7c1eef524..b1eadc2eea1 100644 --- a/dotcom-rendering/src/lib/mockRESTCalls.ts +++ b/dotcom-rendering/src/lib/mockRESTCalls.ts @@ -1,4 +1,3 @@ -import { matchReport } from '../../fixtures/generated/match-report'; import { series } from '../../fixtures/generated/series'; import { storyPackage } from '../../fixtures/generated/story-package'; import { comment } from '../../fixtures/manual/comment'; @@ -97,9 +96,6 @@ export const mockFetch: typeof global.fetch = ( // Get country code case /.*api\.nextgen\.guardianapps\.co\.uk\/geolocation.*/.test(url): return createMockResponse(200, { country: 'GB' }); - // Match report data - case /.*api\.nextgen\.guardianapps\.co\.uk\/football\/api.*/.test(url): - return createMockResponse(200, matchReport); // Get user discussion api (used for myAccount dropdown) case url.includes( 'discussionApiUrl/profile/me?strict_sanctions_check=false', diff --git a/dotcom-rendering/src/server/handler.sportDataPage.ts b/dotcom-rendering/src/server/handler.sportDataPage.ts index 59b68e90089..310e2b09250 100644 --- a/dotcom-rendering/src/server/handler.sportDataPage.ts +++ b/dotcom-rendering/src/server/handler.sportDataPage.ts @@ -268,7 +268,6 @@ const parseFEFootballMatch = ( matchInfo: matchInfo.value, competitionName: data.competitionName, group: group?.value, - matchUrl: data.matchUrl, matchHeaderUrl: headerUrl.value, kind: 'FootballMatchSummary', editionId: data.editionId, diff --git a/dotcom-rendering/src/sportDataPage.ts b/dotcom-rendering/src/sportDataPage.ts index 8bbb31b3126..85b773c8041 100644 --- a/dotcom-rendering/src/sportDataPage.ts +++ b/dotcom-rendering/src/sportDataPage.ts @@ -57,7 +57,6 @@ export type FootballMatchInfoPage = SportPageConfig & { matchInfo: FootballMatchV2; group?: FootballTableSummary; competitionName: string; - matchUrl: string; matchHeaderUrl: URL; kind: 'FootballMatchSummary'; }; From 2d0c7f32d3d59b7fafc525c98961edea7b78a938 Mon Sep 17 00:00:00 2001 From: Jake Lee Kennedy <1731150+Jakeii@users.noreply.github.com> Date: Tue, 11 Aug 2026 16:16:49 +0100 Subject: [PATCH 2/2] update schema --- .../src/frontend/schemas/feFootballMatchInfoPage.json | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/dotcom-rendering/src/frontend/schemas/feFootballMatchInfoPage.json b/dotcom-rendering/src/frontend/schemas/feFootballMatchInfoPage.json index e24bc5f08aa..c7ddbeaa3ff 100644 --- a/dotcom-rendering/src/frontend/schemas/feFootballMatchInfoPage.json +++ b/dotcom-rendering/src/frontend/schemas/feFootballMatchInfoPage.json @@ -246,9 +246,6 @@ "competitionName": { "type": "string" }, - "matchUrl": { - "type": "string" - }, "matchHeaderUrl": { "type": "string" } @@ -257,8 +254,7 @@ "competitionName", "matchHeaderUrl", "matchInfo", - "matchStats", - "matchUrl" + "matchStats" ] } ],