Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
207a08e
Add code structure required for /IndexPage endpoint
OllysCoding May 17, 2023
c4bf06c
Add basic index page layout with nav, header, trending topics & footer
OllysCoding May 17, 2023
d693e40
Group trails for index page & display them
OllysCoding May 17, 2023
c0b354b
Remove commented out code in index page
OllysCoding May 17, 2023
8243bbc
Add a page title to index pages
OllysCoding May 17, 2023
3558058
refactor: just use the webtitle
OllysCoding May 17, 2023
9356b9e
Add support for urls to individual days for index pages
OllysCoding May 17, 2023
fdc6efa
fix: support 'month' grouping for index pages
OllysCoding May 17, 2023
fbe7abf
Add getSpeedFromTrails for index pages
OllysCoding May 17, 2023
7fe1c33
chore: Remove unused imports
OllysCoding May 17, 2023
5479614
Add support for forcing day view on index page
OllysCoding May 17, 2023
a1c04d1
Add pagination to index pages
OllysCoding May 18, 2023
fec5800
Create DecideContainerByTrails, adding support for a variety of trail…
OllysCoding May 18, 2023
9495238
fix: tsc errors
OllysCoding May 18, 2023
a93cd21
fix: Add support for kickers on index pages
OllysCoding May 18, 2023
e828a40
refactor: Tidy up & document groupTrailsByDates
OllysCoding May 19, 2023
ee06178
feat: Add support for six cards on tag fronts
OllysCoding May 24, 2023
1c7358a
feat: Support > 8 trails on tag fronts, add dividers
OllysCoding May 24, 2023
0cb345b
refactor: IndexPage to TagFront
OllysCoding May 31, 2023
869efcd
WIP: Header for tag fronts
OllysCoding Jun 1, 2023
32ce428
feat: Add tag front header (WIP)
OllysCoding Jun 21, 2023
320bf0e
Merge branch 'main' of github.com:guardian/dotcom-rendering into olly…
OllysCoding Jun 21, 2023
cdfc428
fix: correct imports after flattening
OllysCoding Jun 21, 2023
cb48e3e
fix: correct override palette use
OllysCoding Jun 21, 2023
0e4e6ff
fix: support HTML parsing & rendering for front header description
OllysCoding Jun 22, 2023
64c1406
fix: use correct source imports for colors
OllysCoding Jun 22, 2023
5ede001
refactor: support image resolutions & sizes on tag front header
OllysCoding Jun 22, 2023
7d7d7b7
Add stories & fix page=1 on FrontPagination
OllysCoding Jun 22, 2023
98cbad6
fix: remove duplicated newsletter check
OllysCoding Jun 22, 2023
51254b2
fix: use UTC values for all grouping
OllysCoding Jun 22, 2023
9f4b483
Merge branch 'main' of github.com:guardian/dotcom-rendering into olly…
OllysCoding Jun 22, 2023
dbaae91
Add tag front link to dev-server & basic redirect support
OllysCoding Jun 22, 2023
539ae83
fix: support BRs in tag front header
OllysCoding Jun 22, 2023
8a1ebd0
fix: dont show pagination if theres only one page
OllysCoding Jun 22, 2023
19b8919
fix: correctly consider slow/fast frequency & add a comment explainin…
OllysCoding Jun 22, 2023
673e71f
fix: check correct schema for tag fronts
OllysCoding Jun 22, 2023
a073b57
Tidy up
OllysCoding Jun 22, 2023
a63b43c
Remove unused import & make slowTags as const
OllysCoding Jun 22, 2023
c3ad824
Update tag front schema
OllysCoding Jun 22, 2023
b74b21c
refactor: use existing number formatting
OllysCoding Jun 23, 2023
e6e96ce
refactor: use correct ids & remove comment from tag front layout
OllysCoding Jun 23, 2023
d50dba5
refactor: use map instead of record
OllysCoding Jun 23, 2023
f92d7bf
Add tests for gruopTrailsByDAtes
OllysCoding Jun 23, 2023
d623211
refactor: use a more functional getPageRange function
OllysCoding Jun 23, 2023
133a13f
Add "profile" tag fronts to auto-redirecting in dev-server
OllysCoding Jun 23, 2023
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
12 changes: 10 additions & 2 deletions dotcom-rendering/scripts/json-schema/check-schema.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
/* eslint-disable no-console -- logs are useful in scripts */
const fs = require('fs');
const path = require('path');

const root = path.resolve(__dirname, '..', '..');
const {
getArticleSchema,
getFrontSchema,
getNewsletterPageSchema,
getTagFrontSchema,
getBlockSchema,
} = require('./get-schema');

const root = path.resolve(__dirname, '..', '..');

const existingArticleSchema = fs.readFileSync(
`${root}/src/model/article-schema.json`,
{ encoding: 'utf-8' },
Expand All @@ -17,6 +19,10 @@ const existingFrontSchema = fs.readFileSync(
`${root}/src/model/front-schema.json`,
{ encoding: 'utf-8' },
);
const existingTagFrontSchema = fs.readFileSync(
`${root}/src/model/tag-front-schema.json`,
{ encoding: 'utf-8' },
);
const existingNewsletterSchema = fs.readFileSync(
`${root}/src/model/newsletter-page-schema.json`,
{ encoding: 'utf-8' },
Expand All @@ -28,12 +34,14 @@ const existingBlockSchema = fs.readFileSync(

const articleSchema = getArticleSchema();
const frontSchema = getFrontSchema();
const tagFrontSchema = getTagFrontSchema();
const newsletterSchema = getNewsletterPageSchema();
const blockSchema = getBlockSchema();

if (
existingArticleSchema !== articleSchema ||
existingFrontSchema !== frontSchema ||
existingTagFrontSchema !== tagFrontSchema ||
existingNewsletterSchema !== newsletterSchema ||
existingBlockSchema !== blockSchema
) {
Expand Down
24 changes: 17 additions & 7 deletions dotcom-rendering/scripts/json-schema/gen-schema.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,19 @@
const path = require('path');

const root = path.resolve(__dirname, '..', '..');
/* eslint-disable no-console -- Logs are useful for scripts */
const fs = require('fs');
const path = require('path');
const {
getArticleSchema,
getFrontSchema,
getNewsletterPageSchema,
getTagFrontSchema,
getBlockSchema,
} = require('./get-schema');

const root = path.resolve(__dirname, '..', '..');

const articleSchema = getArticleSchema();
const frontSchema = getFrontSchema();
const tagFrontSchema = getTagFrontSchema();
const newsletterPageSchema = getNewsletterPageSchema();
const blockSchema = getBlockSchema();

Expand All @@ -20,7 +23,6 @@ fs.writeFile(
'utf8',
(err) => {
if (err) {
// eslint-disable-next-line @typescript-eslint/tslint/config
console.log(err);
}
},
Expand All @@ -32,7 +34,17 @@ fs.writeFile(
'utf8',
(err) => {
if (err) {
// eslint-disable-next-line @typescript-eslint/tslint/config
console.log(err);
}
},
);

fs.writeFile(
`${root}/src/model/tag-front-schema.json`,
tagFrontSchema,
'utf8',
(err) => {
if (err) {
console.log(err);
}
},
Expand All @@ -44,7 +56,6 @@ fs.writeFile(
'utf8',
(err) => {
if (err) {
// eslint-disable-next-line @typescript-eslint/tslint/config
console.log(err);
}
},
Expand All @@ -56,7 +67,6 @@ fs.writeFile(
'utf8',
(err) => {
if (err) {
// eslint-disable-next-line @typescript-eslint/tslint/config
console.log(err);
}
},
Expand Down
8 changes: 8 additions & 0 deletions dotcom-rendering/scripts/json-schema/get-schema.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ const program = TJS.getProgramFromFiles(
[
path.resolve(`${root}/index.d.ts`),
path.resolve(`${root}/src/types/frontend.ts`),
path.resolve(`${root}/src/types/tagFront.ts`),
path.resolve(`${root}/src/types/newslettersPage.ts`),
],
{
Expand All @@ -31,6 +32,13 @@ module.exports = {
4,
);
},
getTagFrontSchema: () => {
return JSON.stringify(
TJS.generateSchema(program, 'FETagFrontType', settings),
null,
4,
);
},
getNewsletterPageSchema: () => {
return JSON.stringify(
TJS.generateSchema(program, 'FENewslettersPageType', settings),
Expand Down
Loading