Skip to content

Commit

Permalink
Merge branch 'main' into sndrs/corepack
Browse files Browse the repository at this point in the history
  • Loading branch information
sndrs authored Nov 22, 2023
2 parents d7cbd48 + e1dc5ef commit 3b68340
Show file tree
Hide file tree
Showing 18 changed files with 674 additions and 242 deletions.
2 changes: 1 addition & 1 deletion dotcom-rendering/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Frontend rendering framework for theguardian.com. It uses [React](https://reactj

<!-- START doctoc generated TOC please keep comment here to allow auto update -->
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
<!-- Automatically created with yarn run createtoc and on push hook -->
<!-- Automatically created by running `yarn createtoc` in a pre-commit hook -->

- [Quick start](#quick-start)
- [Install Node.js](#install-nodejs)
Expand Down
2 changes: 1 addition & 1 deletion dotcom-rendering/docs/contributing/code-style.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<!-- START doctoc generated TOC please keep comment here to allow auto update -->
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
<!-- Automatically created with yarn run createtoc and on push hook -->
<!-- Automatically created by running `yarn createtoc` in a pre-commit hook -->

- [TypeScript](#typescript)
- [Always used named exports](#always-used-named-exports)
Expand Down
2 changes: 1 addition & 1 deletion dotcom-rendering/docs/contributing/detailed-setup-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<!-- START doctoc generated TOC please keep comment here to allow auto update -->
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
<!-- Automatically created with yarn run createtoc and on push hook -->
<!-- Automatically created by running `yarn createtoc` in a pre-commit hook -->

- [High level diagram](#high-level-diagram)
- [Developing](#developing)
Expand Down
4 changes: 2 additions & 2 deletions dotcom-rendering/docs/contributing/how-to.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@

<!-- START doctoc generated TOC please keep comment here to allow auto update -->
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
<!-- Automatically created with yarn run createtoc and on push hook -->
<!-- Automatically created by running `yarn createtoc` in a pre-commit hook -->

- [How can I add to this document?](#how-can-i-add-to-this-document)
- [How can I add client-side JavaScript?](#how-can-i-add-client-side-javascript)
- [How can I create an 'island' in DCR?](#how-can-i-create-an-island-in-dcr)
- [How can I make an AJAX request in DCR?](#how-can-i-make-an-ajax-request-in-dcr)
- [How to fetch external data on the client?](#how-to-fetch-external-data-on-the-client)

<!-- END doctoc generated TOC please keep comment here to allow auto update -->

Expand Down
25 changes: 12 additions & 13 deletions dotcom-rendering/docs/contributing/where-should-my-code-live.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,18 @@

<!-- START doctoc generated TOC please keep comment here to allow auto update -->
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
<!-- Automatically created with yarn run createtoc and on push hook -->

- [Where should my code live?](#where-should-my-code-live)
- [File locations](#file-locations)
- [File naming schemes](#file-naming-schemes)
- [Scripts](#scripts)
- [Data Sources \& Extraction](#data-sources--extraction)
- [Articles](#articles)
- [Fronts](#fronts)
- [Other](#other)
- [Considerations](#considerations)
- [Favour computation on the rendering server over computation on the client](#favour-computation-on-the-rendering-server-over-computation-on-the-client)
- [Minimize data over the wire](#minimize-data-over-the-wire)
<!-- Automatically created by running `yarn createtoc` in a pre-commit hook -->

- [File locations](#file-locations)
- [File naming schemes](#file-naming-schemes)
- [Scripts](#scripts)
- [Data Sources & Extraction](#data-sources--extraction)
- [Articles](#articles)
- [Fronts](#fronts)
- [Other](#other)
- [Considerations](#considerations)
- [Favour computation on the rendering server over computation on the client](#favour-computation-on-the-rendering-server-over-computation-on-the-client)
- [Minimize data over the wire](#minimize-data-over-the-wire)

<!-- END doctoc generated TOC please keep comment here to allow auto update -->

Expand Down
2 changes: 1 addition & 1 deletion dotcom-rendering/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"test": "jest --maxWorkers=50%",
"test:watch": "jest --watch --maxWorkers=25%",
"test:ci": "jest --runInBand",
"createtoc": "doctoc $npm_package_tocList --github --update-only --title '<!-- Automatically created with yarn run createtoc and on push hook -->' ",
"createtoc": "doctoc $npm_package_tocList --github --update-only --title '<!-- Automatically created by running `yarn createtoc` in a pre-commit hook -->' ",
"addandcommittoc": "git add $npm_package_tocList && git commit -m 'Add TOC update' || true",
"playwright:open": "playwright test --ui",
"playwright:run": "playwright test",
Expand Down
18 changes: 9 additions & 9 deletions dotcom-rendering/scripts/gen-stories/get-stories.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ const testLayoutFormats =
display: 'Showcase',
design: 'Standard',
theme: 'NewsPillar',
config: { renderingTarget: 'Apps', darkModeAvailable: false },
config: { renderingTarget: 'Apps', darkModeAvailable: true },
},
{
display: 'Showcase',
Expand All @@ -238,7 +238,7 @@ const testLayoutFormats =
display: 'Standard',
design: 'Comment',
theme: 'NewsPillar',
config: { renderingTarget: 'Apps', darkModeAvailable: false },
config: { renderingTarget: 'Apps', darkModeAvailable: true },
},
{
display: 'Standard',
Expand Down Expand Up @@ -286,43 +286,43 @@ const testLayoutFormats =
display: 'Standard',
design: 'LiveBlog',
theme: 'OpinionPillar',
config: { renderingTarget: 'Web', darkModeAvailable: false },
config: { renderingTarget: 'Apps', darkModeAvailable: true },
},
{
display: 'Standard',
design: 'LiveBlog',
theme: 'SportPillar',
config: { renderingTarget: 'Web', darkModeAvailable: false },
config: { renderingTarget: 'Apps', darkModeAvailable: true },
},
{
display: 'Standard',
design: 'LiveBlog',
theme: 'CulturePillar',
config: { renderingTarget: 'Web', darkModeAvailable: false },
config: { renderingTarget: 'Apps', darkModeAvailable: true },
},
{
display: 'Standard',
design: 'LiveBlog',
theme: 'LifestylePillar',
config: { renderingTarget: 'Web', darkModeAvailable: false },
config: { renderingTarget: 'Apps', darkModeAvailable: true },
},
{
display: 'Standard',
design: 'LiveBlog',
theme: 'SpecialReportPillar',
config: { renderingTarget: 'Web', darkModeAvailable: false },
config: { renderingTarget: 'Apps', darkModeAvailable: true },
},
{
display: 'Standard',
design: 'LiveBlog',
theme: 'LabsPillar',
config: { renderingTarget: 'Web', darkModeAvailable: false },
config: { renderingTarget: 'Apps', darkModeAvailable: true },
},
{
display: 'Standard',
design: 'LiveBlog',
theme: 'SpecialReportAltPillar',
config: { renderingTarget: 'Web', darkModeAvailable: false },
config: { renderingTarget: 'Apps', darkModeAvailable: true },
},
{
display: 'Standard',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export const TrailTextWrapper = ({
css`
display: flex;
flex-direction: column;
color: ${palette('--card-trail-text')};
color: ${palette('--card-headline-trail-text')};
${body.small({ lineHeight: 'regular' })};
font-size: 14px;
padding-left: 5px;
Expand Down
2 changes: 1 addition & 1 deletion dotcom-rendering/src/components/CardHeadline.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ export const CardHeadline = ({
{showQuotes && <QuoteIcon colour={kickerColour} />}
<span
css={css`
color: ${palette('--card-headline-text')};
color: ${palette('--card-headline-trail-text')};
`}
className="show-underline"
>
Expand Down
2 changes: 1 addition & 1 deletion dotcom-rendering/src/components/ContainerOverrides.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export const ContainerOverrides = ({
: { text: undefined, background: undefined, topBar: undefined };

const paletteOverrides = {
'--card-headline-text': isDynamo
'--card-headline-trail-text': isDynamo
? text?.dynamoHeadline
: text?.cardHeadline,
'--card-footer-text': isDynamo
Expand Down
67 changes: 39 additions & 28 deletions dotcom-rendering/src/layouts/CommentLayout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,8 @@ import { css } from '@emotion/react';
import type { ArticleFormat } from '@guardian/libs';
import { ArticleDesign, ArticleDisplay, ArticleSpecial } from '@guardian/libs';
import {
brandBackground,
brandBorder,
brandLine,
from,
neutral,
palette as sourcePalette,
until,
} from '@guardian/source-foundations';
import { StraightLines } from '@guardian/source-react-components-development-kitchen';
Expand Down Expand Up @@ -44,10 +41,10 @@ import { SubNav } from '../components/SubNav.importable';
import { getSoleContributor } from '../lib/byline';
import { canRenderAds } from '../lib/canRenderAds';
import { getContributionsServiceUrl } from '../lib/contributions';
import { decidePalette } from '../lib/decidePalette';
import { decideTrail } from '../lib/decideTrail';
import { parse } from '../lib/slot-machine-flags';
import type { NavType } from '../model/extract-nav';
import { palette as themePalette } from '../palette';
import type { DCRArticle } from '../types/frontend';
import type { RenderingTarget } from '../types/renderingTarget';
import { BannerWrapper, SendToBack, Stuck } from './lib/stickiness';
Expand Down Expand Up @@ -297,8 +294,6 @@ export const CommentLayout = (props: WebProps | AppsProps) => {

const { branding } = article.commercialProperties[article.editionId];

const palette = decidePalette(format);

const contributionsServiceUrl = getContributionsServiceUrl(article);

const renderAds = renderingTarget === 'Web' && canRenderAds(article);
Expand Down Expand Up @@ -329,7 +324,7 @@ export const CommentLayout = (props: WebProps | AppsProps) => {
showTopBorder={false}
showSideBorders={false}
padSides={false}
backgroundColour={brandBackground.primary}
backgroundColour={sourcePalette.brand[400]}
element="header"
>
<Header
Expand Down Expand Up @@ -357,10 +352,10 @@ export const CommentLayout = (props: WebProps | AppsProps) => {

<Section
fullWidth={true}
borderColour={brandLine.primary}
borderColour={sourcePalette.brand[600]}
showTopBorder={false}
padSides={false}
backgroundColour={brandBackground.primary}
backgroundColour={sourcePalette.brand[400]}
element="nav"
>
<Nav
Expand Down Expand Up @@ -388,7 +383,9 @@ export const CommentLayout = (props: WebProps | AppsProps) => {
{props.NAV.subNavSections && (
<Section
fullWidth={true}
backgroundColour={palette.background.article}
backgroundColour={themePalette(
'--article-background',
)}
padSides={false}
element="aside"
>
Expand All @@ -403,18 +400,22 @@ export const CommentLayout = (props: WebProps | AppsProps) => {
currentNavLink={
props.NAV.currentNavLink
}
linkHoverColour={
palette.text.articleLinkHover
}
borderColour={palette.border.subNav}
linkHoverColour={themePalette(
'--article-link-text-hover',
)}
borderColour={themePalette(
'--sub-nav-border',
)}
/>
</Island>
</Section>
)}

<Section
fullWidth={true}
backgroundColour={palette.background.article}
backgroundColour={themePalette(
'--article-background',
)}
padSides={false}
showTopBorder={false}
>
Expand All @@ -423,7 +424,9 @@ export const CommentLayout = (props: WebProps | AppsProps) => {
cssOverrides={css`
display: block;
`}
color={palette.border.secondary}
color={themePalette(
'--article-border-secondary',
)}
/>
</Section>
</SendToBack>
Expand All @@ -439,7 +442,7 @@ export const CommentLayout = (props: WebProps | AppsProps) => {
<Section
fullWidth={true}
showTopBorder={false}
backgroundColour={palette.background.article}
backgroundColour={themePalette('--article-background')}
element="article"
>
<StandardGrid display={format.display}>
Expand Down Expand Up @@ -527,7 +530,9 @@ export const CommentLayout = (props: WebProps | AppsProps) => {
cssOverrides={css`
display: block;
`}
color={palette.border.secondary}
color={themePalette(
'--article-border-secondary',
)}
/>
</div>
</div>
Expand All @@ -541,7 +546,9 @@ export const CommentLayout = (props: WebProps | AppsProps) => {
cssOverrides={css`
display: block;
`}
color={palette.border.secondary}
color={themePalette(
'--article-border-secondary',
)}
/>
</Hide>
</div>
Expand Down Expand Up @@ -663,7 +670,9 @@ export const CommentLayout = (props: WebProps | AppsProps) => {
cssOverrides={css`
display: block;
`}
color={palette.border.secondary}
color={themePalette(
'--article-border-secondary',
)}
/>
<SubMeta
format={format}
Expand Down Expand Up @@ -722,7 +731,7 @@ export const CommentLayout = (props: WebProps | AppsProps) => {
padSides={false}
showTopBorder={false}
showSideBorders={false}
backgroundColour={neutral[93]}
backgroundColour={sourcePalette.neutral[93]}
element="aside"
>
<AdSlot
Expand Down Expand Up @@ -832,7 +841,7 @@ export const CommentLayout = (props: WebProps | AppsProps) => {
padSides={false}
showTopBorder={false}
showSideBorders={false}
backgroundColour={neutral[93]}
backgroundColour={sourcePalette.neutral[93]}
element="aside"
>
<AdSlot
Expand All @@ -849,8 +858,10 @@ export const CommentLayout = (props: WebProps | AppsProps) => {
<SubNav
subNavSections={props.NAV.subNavSections}
currentNavLink={props.NAV.currentNavLink}
linkHoverColour={palette.text.articleLinkHover}
borderColour={palette.border.subNav}
linkHoverColour={themePalette(
'--article-link-text-hover',
)}
borderColour={themePalette('--sub-nav-border')}
/>
</Island>
</Section>
Expand All @@ -860,8 +871,8 @@ export const CommentLayout = (props: WebProps | AppsProps) => {
<Section
fullWidth={true}
padSides={false}
backgroundColour={brandBackground.primary}
borderColour={brandBorder.primary}
backgroundColour={sourcePalette.brand[400]}
borderColour={sourcePalette.brand[600]}
showSideBorders={false}
element="footer"
>
Expand Down Expand Up @@ -918,7 +929,7 @@ export const CommentLayout = (props: WebProps | AppsProps) => {
<Section
fullWidth={true}
data-print-layout="hide"
backgroundColour={neutral[97]}
backgroundColour={sourcePalette.neutral[97]}
padSides={false}
showSideBorders={false}
element="footer"
Expand Down
4 changes: 3 additions & 1 deletion dotcom-rendering/src/layouts/LiveLayout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -477,7 +477,9 @@ export const LiveLayout = (props: WebProps | AppsProps) => {
<Section
fullWidth={true}
showTopBorder={false}
backgroundColour={themePalette('--header-background')}
backgroundColour={themePalette(
'--headline-blog-background',
)}
borderColour={themePalette('--headline-border')}
>
<HeadlineGrid>
Expand Down
Loading

0 comments on commit 3b68340

Please sign in to comment.