Skip to content
Draft
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
567 changes: 0 additions & 567 deletions dotcom-rendering/fixtures/generated/match-report.ts

This file was deleted.

28 changes: 0 additions & 28 deletions dotcom-rendering/scripts/test-data/gen-fixtures.js
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
1 change: 0 additions & 1 deletion dotcom-rendering/src/frontend/feFootballMatchInfoPage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@ export type FEFootballMatchInfoPage = FEFootballDataPage & {
matchInfo: FEFootballMatch;
group?: FEGroupSummary;
competitionName: string;
matchUrl: string;
matchHeaderUrl: string;
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -246,9 +246,6 @@
"competitionName": {
"type": "string"
},
"matchUrl": {
"type": "string"
},
"matchHeaderUrl": {
"type": "string"
}
Expand All @@ -257,8 +254,7 @@
"competitionName",
"matchHeaderUrl",
"matchInfo",
"matchStats",
"matchUrl"
"matchStats"
]
}
],
Expand Down
14 changes: 8 additions & 6 deletions dotcom-rendering/src/layouts/StandardLayout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
9 changes: 2 additions & 7 deletions dotcom-rendering/src/layouts/StandardLayoutArticleGrid.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down Expand Up @@ -166,7 +161,7 @@ export const StandardLayoutArticleGrid = ({
sectionLabel={article.sectionLabel}
sectionUrl={article.sectionUrl}
guardianBaseURL={article.guardianBaseURL}
isMatch={!!footballMatchUrl}
isMatch={isFootballMatchReport}
/>
</GridItem>
<GridItem area="headline" layoutType={layoutType}>
Expand Down
4 changes: 0 additions & 4 deletions dotcom-rendering/src/lib/mockRESTCalls.ts
Original file line number Diff line number Diff line change
@@ -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';
Expand Down Expand Up @@ -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',
Expand Down
1 change: 0 additions & 1 deletion dotcom-rendering/src/server/handler.sportDataPage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
1 change: 0 additions & 1 deletion dotcom-rendering/src/sportDataPage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ export type FootballMatchInfoPage = SportPageConfig & {
matchInfo: FootballMatchV2;
group?: FootballTableSummary;
competitionName: string;
matchUrl: string;
matchHeaderUrl: URL;
kind: 'FootballMatchSummary';
};
Expand Down
Loading