Skip to content

Commit 953f234

Browse files
committed
Merge branch 'main' into rjr-fix-poster-image-on-video-articles-attempt-4
2 parents d411e96 + f66c847 commit 953f234

26 files changed

+485
-170
lines changed

dotcom-rendering/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
"@guardian/ophan-tracker-js": "2.3.0",
4242
"@guardian/react-crossword": "6.3.0",
4343
"@guardian/shimport": "1.0.2",
44-
"@guardian/source": "9.0.0",
44+
"@guardian/source": "10.2.0",
4545
"@guardian/source-development-kitchen": "18.1.1",
4646
"@guardian/support-dotcom-components": "7.6.2",
4747
"@guardian/tsconfig": "0.2.0",

dotcom-rendering/scripts/perf/k6/article-nier-automata.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1590,7 +1590,6 @@
15901590
"enableDiscussionSwitch": true,
15911591
"prebidXaxis": true,
15921592
"stickyVideos": true,
1593-
"interactiveFullHeaderSwitch": true,
15941593
"discussionAllPageSize": true,
15951594
"prebidUserSync": true,
15961595
"audioOnwardJourneySwitch": true,

dotcom-rendering/src/components/AppsFooter.importable.tsx

Lines changed: 101 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,53 @@
11
import { css } from '@emotion/react';
2-
import { remSpace, textSans15 } from '@guardian/source/foundations';
2+
import {
3+
between,
4+
from,
5+
remSpace,
6+
space,
7+
textSans15,
8+
until,
9+
} from '@guardian/source/foundations';
310
import { ButtonLink } from '@guardian/source/react-components';
411
import { useEffect, useState } from 'react';
12+
import { grid } from '../grid';
13+
import { ArticleDesign } from '../lib/articleFormat';
514
import { getNavigationClient, getUserClient } from '../lib/bridgetApi';
615
import { palette } from '../palette';
716

817
const year = new Date().getFullYear();
918

10-
const footerStyles = css`
11-
${textSans15}
12-
padding: ${remSpace[4]} ${remSpace[3]};
13-
background-color: ${palette('--apps-footer-background')};
19+
const footerContainerStyles = (design?: ArticleDesign) => {
20+
if (design === ArticleDesign.Gallery) {
21+
return css`
22+
${textSans15}
23+
${grid.paddedContainer}
24+
background-color: ${palette('--apps-footer-background')};
25+
26+
${until.tablet} {
27+
padding-top: ${space[1]}px;
28+
}
29+
30+
${from.tablet} {
31+
border-left: 1px solid ${palette('--footer-border')};
32+
border-right: 1px solid ${palette('--footer-border')};
33+
}
34+
`;
35+
} else {
36+
return css`
37+
${textSans15}
38+
padding: ${remSpace[4]} ${remSpace[3]};
39+
background-color: ${palette('--apps-footer-background')};
40+
`;
41+
}
42+
};
43+
44+
const galleryFooterStyles = css`
45+
${grid.column.centre}
46+
padding: ${remSpace[4]} 0;
47+
48+
${from.leftCol} {
49+
${grid.between('centre-column-start', 'right-column-end')}
50+
}
1451
`;
1552

1653
const linkStyles = css`
@@ -62,7 +99,40 @@ const PrivacySettings = ({
6299
}
63100
};
64101

65-
export const AppsFooter = () => {
102+
const galleryBorder = css`
103+
grid-row: 1 / 3;
104+
position: relative;
105+
106+
${between.desktop.and.leftCol} {
107+
${grid.column.right}
108+
109+
&::before {
110+
content: '';
111+
position: absolute;
112+
left: -10px; /* 10px to the left of this element */
113+
top: 0;
114+
bottom: 0;
115+
width: 1px;
116+
background-color: ${palette('--footer-border')};
117+
}
118+
}
119+
120+
${from.leftCol} {
121+
${grid.column.left}
122+
123+
&::after {
124+
content: '';
125+
position: absolute;
126+
right: -10px;
127+
top: 0;
128+
bottom: 0;
129+
width: 1px;
130+
background-color: ${palette('--footer-border')};
131+
}
132+
}
133+
`;
134+
135+
export const AppsFooter = ({ design }: { design?: ArticleDesign }) => {
66136
const [isCcpa, setIsCcpa] = useState<boolean>(false);
67137

68138
useEffect(() => {
@@ -90,21 +160,32 @@ export const AppsFooter = () => {
90160
};
91161

92162
return (
93-
<div css={footerStyles}>
94-
&#169; {year} Guardian News and Media Limited or its affiliated
95-
companies. All rights reserved. (dcar)
96-
<br />
97-
<PrivacySettings
98-
isCcpa={isCcpa}
99-
privacySettingsClickHandler={privacySettingsClickHandler}
100-
/>
101-
<ButtonLink
102-
priority="secondary"
103-
onClick={privacyPolicyClickHandler}
104-
cssOverrides={linkStyles}
163+
<div css={footerContainerStyles(design)}>
164+
{design === ArticleDesign.Gallery && (
165+
<div css={galleryBorder}></div>
166+
)}
167+
<div
168+
css={
169+
design === ArticleDesign.Gallery
170+
? galleryFooterStyles
171+
: undefined
172+
}
105173
>
106-
Privacy Policy
107-
</ButtonLink>
174+
&#169; {year} Guardian News and Media Limited or its affiliated
175+
companies. All rights reserved. (dcar)
176+
<br />
177+
<PrivacySettings
178+
isCcpa={isCcpa}
179+
privacySettingsClickHandler={privacySettingsClickHandler}
180+
/>
181+
<ButtonLink
182+
priority="secondary"
183+
onClick={privacyPolicyClickHandler}
184+
cssOverrides={linkStyles}
185+
>
186+
Privacy Policy
187+
</ButtonLink>
188+
</div>
108189
</div>
109190
);
110191
};

dotcom-rendering/src/components/ArticlePage.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,11 @@ export const ArticlePage = (props: WebProps | AppProps) => {
9090
<Island priority="enhancement" defer={{ until: 'idle' }}>
9191
<FocusStyles />
9292
</Island>
93+
{!!frontendData.affiliateLinksDisclaimer && (
94+
<Island priority="feature" defer={{ until: 'idle' }}>
95+
<EnhanceAffiliateLinks />
96+
</Island>
97+
)}
9398
{(format.design === ArticleDesign.LiveBlog ||
9499
format.design === ArticleDesign.DeadBlog) && (
95100
<SkipTo id={'key-events-carousel'} label="Skip to key events" />
@@ -131,11 +136,6 @@ export const ArticlePage = (props: WebProps | AppProps) => {
131136
serverSideTests={frontendData.config.abTests}
132137
/>
133138
</Island>
134-
{!!frontendData.affiliateLinksDisclaimer && (
135-
<Island priority="feature" defer={{ until: 'idle' }}>
136-
<EnhanceAffiliateLinks />
137-
</Island>
138-
)}
139139
</>
140140
)}
141141
{renderingTarget === 'Web' ? (

dotcom-rendering/src/components/Caption.tsx

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import {
66
textSans14,
77
until,
88
} from '@guardian/source/foundations';
9+
import { grid } from '../grid';
910
import {
1011
ArticleDesign,
1112
ArticleDisplay,
@@ -208,12 +209,21 @@ const captionLink = css`
208209
}
209210
`;
210211

212+
const galleryStyles = css`
213+
${grid.column.centre}
214+
${from.leftCol} {
215+
${grid.column.left}
216+
grid-row-start: 8;
217+
}
218+
`;
219+
211220
const CameraIcon = ({ format }: IconProps) => {
212221
return (
213222
<span
214223
css={[
215224
iconStyle,
216-
format.display === ArticleDisplay.Immersive &&
225+
(format.display === ArticleDisplay.Immersive ||
226+
format.design === ArticleDesign.Gallery) &&
217227
hideIconBelowLeftCol,
218228
]}
219229
>
@@ -256,6 +266,8 @@ export const Caption = ({
256266
const hideCredit = !displayCredit;
257267
if (noCaption && (noCredit || hideCredit)) return null;
258268

269+
const isGallery = format.design === ArticleDesign.Gallery;
270+
259271
const isBlog =
260272
format.design === ArticleDesign.LiveBlog ||
261273
format.design === ArticleDesign.DeadBlog;
@@ -271,6 +283,7 @@ export const Caption = ({
271283
tabletCaptionPadding,
272284
padCaption && captionPadding,
273285
isImmersive && immersivePadding,
286+
isGallery && galleryStyles,
274287
]}
275288
data-spacefinder-role="inline"
276289
>

dotcom-rendering/src/components/FrontSection.tsx

Lines changed: 34 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { css } from '@emotion/react';
22
import { isString } from '@guardian/libs';
33
import { between, from, space, until } from '@guardian/source/foundations';
44
import { pageSkinContainer } from '../layouts/lib/pageSkin';
5-
import type { EditionId } from '../lib/edition';
5+
import { type EditionId, isNetworkFront } from '../lib/edition';
66
import { hideAge } from '../lib/hideAge';
77
import { palette, palette as schemePalette } from '../palette';
88
import type { CollectionBranding } from '../types/branding';
@@ -98,13 +98,21 @@ type Props = {
9898
const width = (columns: number, columnWidth: number, columnGap: number) =>
9999
`width: ${columns * columnWidth + (columns - 1) * columnGap}px;`;
100100

101-
const borderColourStyles = (title?: string): string => {
101+
const borderColourStyles = (
102+
title?: string,
103+
showSectionColours?: boolean,
104+
): string => {
105+
if (!showSectionColours) {
106+
return schemePalette('--section-border-primary');
107+
}
108+
102109
switch (title) {
103110
case 'News':
104111
return schemePalette('--section-border-news');
105112
case 'Opinion':
106113
return schemePalette('--section-border-opinion');
107114
case 'Sport':
115+
case 'Sports':
108116
return schemePalette('--section-border-sport');
109117
case 'Lifestyle':
110118
return schemePalette('--section-border-lifestyle');
@@ -115,13 +123,21 @@ const borderColourStyles = (title?: string): string => {
115123
}
116124
};
117125

118-
const articleSectionTitleStyles = (title?: string): string => {
126+
const articleSectionTitleStyles = (
127+
title?: string,
128+
showSectionColours?: boolean,
129+
): string => {
130+
if (!showSectionColours) {
131+
return schemePalette('--article-section-title');
132+
}
133+
119134
switch (title) {
120135
case 'News':
121136
return schemePalette('--article-section-title-news');
122137
case 'Opinion':
123138
return schemePalette('--article-section-title-opinion');
124139
case 'Sport':
140+
case 'Sports':
125141
return schemePalette('--article-section-title-sport');
126142
case 'Lifestyle':
127143
return schemePalette('--article-section-title-lifestyle');
@@ -435,10 +451,13 @@ const bottomPaddingBetaContainer = (
435451
}
436452
`;
437453

438-
const primaryLevelTopBorder = (title?: string) => css`
454+
const primaryLevelTopBorder = (
455+
title?: string,
456+
showSectionColours?: boolean,
457+
) => css`
439458
grid-row: 1;
440459
grid-column: 1 / -1;
441-
border-top: 2px solid ${borderColourStyles(title)};
460+
border-top: 2px solid ${borderColourStyles(title, showSectionColours)};
442461
/** Ensures the top border sits above the side borders */
443462
z-index: 1;
444463
height: fit-content;
@@ -591,6 +610,8 @@ export const FrontSection = ({
591610
const useLargeSpacingDesktop =
592611
!!isNextCollectionPrimary || isAboveDesktopAd;
593612

613+
const showSectionColours = isNetworkFront(pageId ?? '');
614+
594615
/**
595616
* id is being used to set the containerId in @see {ShowMore.importable.tsx}
596617
* this id pre-existed showMore so is probably also being used for something else.
@@ -624,7 +645,10 @@ export const FrontSection = ({
624645
css={[
625646
containerLevel === 'Secondary'
626647
? secondaryLevelTopBorder
627-
: primaryLevelTopBorder(title),
648+
: primaryLevelTopBorder(
649+
title,
650+
showSectionColours,
651+
),
628652
]}
629653
/>
630654
)}
@@ -663,7 +687,10 @@ export const FrontSection = ({
663687
? schemePalette(
664688
'--article-section-secondary-title',
665689
)
666-
: articleSectionTitleStyles(title)
690+
: articleSectionTitleStyles(
691+
title,
692+
showSectionColours,
693+
)
667694
}
668695
// On paid fronts the title is not treated as a link
669696
url={!isOnPaidContentFront ? url : undefined}

dotcom-rendering/src/components/LoopVideo.stories.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ export const Without5to4Ratio: Story = {
4444

4545
export const PausePlay: Story = {
4646
...Default,
47+
name: 'Pause and play interaction',
4748
play: async ({ canvasElement }) => {
4849
const canvas = within(canvasElement);
4950
const videoEl = canvas.getByTestId('loop-video');
@@ -64,6 +65,7 @@ export const PausePlay: Story = {
6465

6566
export const UnmuteMute: Story = {
6667
...Default,
68+
name: 'Unmute and mute interaction',
6769
parameters: {
6870
test: {
6971
// The following error is received without this flag: "TypeError: ophan.trackClickComponentEvent is not a function"
@@ -90,6 +92,7 @@ function sleep(ms: number) {
9092

9193
export const InteractionObserver: Story = {
9294
...Default,
95+
name: 'Interaction observer',
9396
render: (args) => (
9497
<div data-testid="test-container">
9598
<LoopVideo {...args} />

dotcom-rendering/src/components/LoopVideoPlayer.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,7 @@ export const LoopVideoPlayer = forwardRef(
144144
data-link-name={`gu-video-loop-${
145145
showPlayIcon ? 'play' : 'pause'
146146
}-${atomId}`}
147+
data-chromatic="ignore"
147148
preload={preloadPartialData ? 'metadata' : 'none'}
148149
loop={true}
149150
muted={isMuted}

dotcom-rendering/src/components/ScrollableFeature.importable.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ export const ScrollableFeature = ({
3939
>
4040
{trails.map((card) => {
4141
const isLoopingVideo = card.mainMedia?.type === 'LoopVideo';
42+
4243
return (
4344
<ScrollableCarousel.Item key={card.url}>
4445
<FeatureCard

0 commit comments

Comments
 (0)