File tree Expand file tree Collapse file tree 36 files changed +3636
-1420
lines changed Expand file tree Collapse file tree 36 files changed +3636
-1420
lines changed Load Diff Large diffs are not rendered by default.
Original file line number Diff line number Diff line change 1
- import type { FootballMatches , Region } from '../../src/footballMatches' ;
1
+ import type { Region } from '../../src/footballDataPage' ;
2
+ import type { FootballMatches } from '../../src/footballMatches' ;
2
3
3
4
export const regions : Region [ ] = [
4
5
{
Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ import type {
4
4
FEMatchByDateAndCompetition ,
5
5
FEMatchDay ,
6
6
FEResult ,
7
- } from '../../src/feFootballDataPage ' ;
7
+ } from '../../src/frontend/feFootballMatchListPage ' ;
8
8
9
9
const matchData = {
10
10
id : '1' ,
@@ -91,6 +91,7 @@ export const emptyMatches: FEMatchByDateAndCompetition[] = [
91
91
url : '/football/premierleague' ,
92
92
fullName : 'Premier League' ,
93
93
nation : 'English' ,
94
+ tableDividers : [ ] ,
94
95
} ,
95
96
matches : [ ] ,
96
97
} ,
Original file line number Diff line number Diff line change @@ -15,7 +15,8 @@ const program = TJS.getProgramFromFiles(
15
15
path . resolve ( `${ root } /src/frontend/feTagPage.ts` ) ,
16
16
path . resolve ( `${ root } /src/types/newslettersPage.ts` ) ,
17
17
path . resolve ( `${ root } /src/types/editionsCrossword.ts` ) ,
18
- path . resolve ( `${ root } /src/feFootballDataPage.ts` ) ,
18
+ path . resolve ( `${ root } /src/frontend/feFootballMatchListPage.ts` ) ,
19
+ path . resolve ( `${ root } /src/frontend/feFootballTablesPage.ts` ) ,
19
20
] ,
20
21
{
21
22
skipLibCheck : true ,
@@ -59,8 +60,12 @@ const schemas = [
59
60
file : `${ root } /src/model/editions-crossword-schema.json` ,
60
61
} ,
61
62
{
62
- typeName : 'FEFootballDataPage' ,
63
- file : `${ root } /src/model/fe-football-data-page-schema.json` ,
63
+ typeName : 'FEFootballMatchListPage' ,
64
+ file : `${ root } /src/frontend/schemas/feFootballMatchListPage.json` ,
65
+ } ,
66
+ {
67
+ typeName : 'FEFootballTablesPage' ,
68
+ file : `${ root } /src/frontend/schemas/feFootballTablesPage.json` ,
64
69
} ,
65
70
] ;
66
71
Original file line number Diff line number Diff line change @@ -9,7 +9,7 @@ const { configOverrides } = require('../../fixtures/config-overrides');
9
9
const { switchOverrides } = require ( '../../fixtures/switch-overrides' ) ;
10
10
const {
11
11
validateAsFEArticle,
12
- validateAsFootballDataPageType ,
12
+ validateAsFootballMatchListPage ,
13
13
} = require ( '../../src/model/validate' ) ;
14
14
15
15
const root = resolve ( __dirname , '..' , '..' ) ;
@@ -327,15 +327,16 @@ requests.push(
327
327
delete json . config . weatherapiurl ;
328
328
delete json . config . isAdFree ;
329
329
delete json . config . userBenefitsApiUrl ;
330
+ delete json . config . frontendSentryDsn ;
330
331
331
- const footballDataPageData = validateAsFootballDataPageType ( json ) ;
332
+ const footballMatchListPage = validateAsFootballMatchListPage ( json ) ;
332
333
333
334
// Write the new frontend fixture data
334
335
const contents = `${ HEADER }
335
- import type { FEFootballDataPage } from '../../src/feFootballDataPage ';
336
+ import type { FEFootballMatchListPage } from '../../src/frontend/feFootballMatchListPage ';
336
337
337
- export const footballData: FEFootballDataPage = ${ JSON . stringify (
338
- footballDataPageData ,
338
+ export const footballData: FEFootballMatchListPage = ${ JSON . stringify (
339
+ footballMatchListPage ,
339
340
null ,
340
341
4 ,
341
342
) }
Original file line number Diff line number Diff line change 1
1
import { Option , Select } from '@guardian/source/react-components' ;
2
- import type { FootballMatchKind , Region } from '../footballMatches' ;
2
+ import type { Region } from '../footballDataPage' ;
3
+ import type { FootballMatchKind } from '../footballMatches' ;
3
4
import { palette } from '../palette' ;
4
5
5
6
type FootballSelectKind = FootballMatchKind | 'Tables' ;
Original file line number Diff line number Diff line change 1
1
import { Global } from '@emotion/react' ;
2
2
import { StrictMode } from 'react' ;
3
- import type { DCRFootballDataPage } from '../footballMatches' ;
3
+ import type {
4
+ FootballMatchListPage ,
5
+ FootballTablesPage ,
6
+ } from '../footballDataPage' ;
4
7
import { FootballDataPageLayout } from '../layouts/FootballDataPageLayout' ;
5
8
import { buildAdTargeting } from '../lib/ad-targeting' ;
6
9
import { ArticleDesign , ArticleDisplay , Pillar } from '../lib/articleFormat' ;
@@ -17,7 +20,7 @@ import { SetAdTargeting } from './SetAdTargeting.importable';
17
20
import { SkipTo } from './SkipTo' ;
18
21
19
22
type Props = {
20
- footballData : DCRFootballDataPage ;
23
+ footballData : FootballMatchListPage | FootballTablesPage ;
21
24
} ;
22
25
23
26
/**
Original file line number Diff line number Diff line change @@ -436,6 +436,7 @@ export const FootballMatchList = ({
436
436
437
437
const [ days , setDays ] = useState ( initialDays ) ;
438
438
const [ isError , setIsError ] = useState < boolean > ( false ) ;
439
+
439
440
return (
440
441
< >
441
442
{ days . map ( ( day ) => (
Original file line number Diff line number Diff line change @@ -5,11 +5,8 @@ import {
5
5
space ,
6
6
until ,
7
7
} from '@guardian/source/foundations' ;
8
- import type {
9
- FootballMatches ,
10
- FootballMatchKind ,
11
- Region ,
12
- } from '../footballMatches' ;
8
+ import type { Region } from '../footballDataPage' ;
9
+ import type { FootballMatches , FootballMatchKind } from '../footballMatches' ;
13
10
import { grid } from '../grid' ;
14
11
import type { EditionId } from '../lib/edition' ;
15
12
import type { Result } from '../lib/result' ;
Original file line number Diff line number Diff line change 1
1
import { isObject , isUndefined } from '@guardian/libs' ;
2
2
import type { Dispatch , SetStateAction } from 'react' ;
3
3
import { useState } from 'react' ;
4
- import type { FEFootballDataPage } from '../feFootballDataPage ' ;
4
+ import type { Region } from '../footballDataPage ' ;
5
5
import {
6
6
type FootballMatches ,
7
7
type FootballMatchKind ,
8
8
getParserErrorMessage ,
9
9
parse ,
10
- type Region ,
11
10
} from '../footballMatches' ;
11
+ import type { FEFootballMatchListPage } from '../frontend/feFootballMatchListPage' ;
12
12
import type { EditionId } from '../lib/edition' ;
13
13
import type { Result } from '../lib/result' ;
14
14
import { error , ok } from '../lib/result' ;
@@ -27,7 +27,7 @@ export const getMoreDays =
27
27
const responseJson : unknown = await fetchResponse . json ( ) ;
28
28
29
29
if ( isObject ( responseJson ) ) {
30
- const feFootballData = responseJson as FEFootballDataPage ;
30
+ const feFootballData = responseJson as FEFootballMatchListPage ;
31
31
const parsedFootballMatches = parse ( feFootballData . matchesList ) ;
32
32
33
33
if ( parsedFootballMatches . kind === 'error' ) {
You can’t perform that action at this time.
0 commit comments