Skip to content

Commit 999be27

Browse files
Merge branch 'main' into rachel/test-sourcepoint-australia-migration
2 parents 1eb8c50 + c401707 commit 999be27

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+982
-427
lines changed

dotcom-rendering/.storybook/mocks/bridgetApi.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,14 @@ export const getListenToArticleClient: BridgetApi<
102102
isAvailable: async () => true,
103103
isPlaying: async () => false,
104104
});
105+
106+
export const getNativeABTestingClient: BridgetApi<
107+
'getNativeABTestingClient'
108+
> = () => ({
109+
getParticipations: async () =>
110+
new Map(Object.entries({ 'test-id': 'variant' })),
111+
});
112+
105113
export const ensure_all_exports_are_present = {
106114
getUserClient,
107115
getAcquisitionsClient,
@@ -119,6 +127,7 @@ export const ensure_all_exports_are_present = {
119127
getInteractionClient,
120128
getInteractivesClient,
121129
getListenToArticleClient,
130+
getNativeABTestingClient,
122131
} satisfies {
123132
[Method in keyof BridgeModule]: BridgetApi<Method>;
124133
};

dotcom-rendering/package.json

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
"@emotion/server": "11.11.0",
2929
"@guardian/ab-core": "8.0.0",
3030
"@guardian/braze-components": "22.2.0",
31-
"@guardian/bridget": "8.6.0",
31+
"@guardian/bridget": "8.7.0",
3232
"@guardian/browserslist-config": "6.1.0",
3333
"@guardian/cdk": "61.4.0",
3434
"@guardian/commercial-core": "27.1.0",
@@ -46,8 +46,7 @@
4646
"@guardian/support-dotcom-components": "7.7.0",
4747
"@guardian/tsconfig": "0.2.0",
4848
"@playwright/test": "1.52.0",
49-
"@sentry/browser": "7.75.1",
50-
"@sentry/integrations": "7.75.1",
49+
"@sentry/browser": "10.3.0",
5150
"@storybook/addon-essentials": "8.6.14",
5251
"@storybook/addon-interactions": "8.6.14",
5352
"@storybook/addon-webpack5-compiler-swc": "3.0.0",

dotcom-rendering/src/client/sentryLoader/sentry.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import * as Sentry from '@sentry/browser';
22
import type { BrowserOptions } from '@sentry/browser';
3-
import { CaptureConsole } from '@sentry/integrations';
43
import { BUILD_VARIANT, dcrJavascriptBundle } from '../../../webpack/bundles';
54
import type { ReportError } from '../../types/sentry';
65

@@ -44,7 +43,7 @@ Sentry.init({
4443
allowUrls,
4544
dsn: dcrSentryDsn,
4645
environment: stage || 'DEV',
47-
integrations: [new CaptureConsole({ levels: ['error'] })],
46+
integrations: [Sentry.captureConsoleIntegration({ levels: ['error'] })],
4847
maxBreadcrumbs: 50,
4948
// sampleRate: // We use Math.random in init.ts to sample errors
5049
});

dotcom-rendering/src/components/Card/Card.tsx

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,8 @@ export type Props = {
147147
trailTextSize?: TrailTextSize;
148148
/** A kicker image is seperate to the main media and renders as part of the kicker */
149149
showKickerImage?: boolean;
150+
isInLoopingVideoTestVariant?: boolean;
151+
isInLoopingVideoTestControl?: boolean;
150152
};
151153

152154
const starWrapper = (cardHasImage: boolean) => css`
@@ -250,6 +252,7 @@ const getMedia = ({
250252
mainMedia,
251253
canPlayInline,
252254
isBetaContainer,
255+
isInLoopingVideoTestControl,
253256
}: {
254257
imageUrl?: string;
255258
imageAltText?: string;
@@ -259,8 +262,13 @@ const getMedia = ({
259262
mainMedia?: MainMedia;
260263
canPlayInline?: boolean;
261264
isBetaContainer: boolean;
265+
isInLoopingVideoTestControl: boolean;
262266
}) => {
263-
if (mainMedia?.type === 'LoopVideo' && canPlayInline) {
267+
if (
268+
mainMedia?.type === 'LoopVideo' &&
269+
!isInLoopingVideoTestControl &&
270+
canPlayInline
271+
) {
264272
return {
265273
type: 'loop-video',
266274
mainMedia,
@@ -412,6 +420,8 @@ export const Card = ({
412420
showTopBarMobile = true,
413421
trailTextSize,
414422
showKickerImage = false,
423+
isInLoopingVideoTestVariant = false,
424+
isInLoopingVideoTestControl = false,
415425
}: Props) => {
416426
const hasSublinks = supportingContent && supportingContent.length > 0;
417427
const sublinkPosition = decideSublinkPosition(
@@ -564,6 +574,7 @@ export const Card = ({
564574
mainMedia,
565575
canPlayInline,
566576
isBetaContainer,
577+
isInLoopingVideoTestControl,
567578
});
568579

569580
/**
@@ -895,6 +906,10 @@ export const Card = ({
895906
fallbackImageLoading={imageLoading}
896907
fallbackImageAlt={media.imageAltText}
897908
fallbackImageAspectRatio="5:4"
909+
linkTo={linkTo}
910+
isInLoopingVideoTestVariant={
911+
isInLoopingVideoTestVariant
912+
}
898913
/>
899914
</Island>
900915
)}
@@ -1011,6 +1026,9 @@ export const Card = ({
10111026
loading={imageLoading}
10121027
roundedCorners={isOnwardContent}
10131028
aspectRatio={aspectRatio}
1029+
isInLoopingVideoTestControl={
1030+
isInLoopingVideoTestControl
1031+
}
10141032
/>
10151033
{isVideoMainMedia && mainMedia.duration > 0 && (
10161034
<div

dotcom-rendering/src/components/CardPicture.tsx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ export type Props = {
1818
isCircular?: boolean;
1919
aspectRatio?: AspectRatio;
2020
mobileAspectRatio?: AspectRatio;
21+
isInLoopingVideoTestControl?: boolean;
2122
};
2223

2324
/**
@@ -200,6 +201,7 @@ export const CardPicture = ({
200201
isCircular,
201202
aspectRatio = '5:3',
202203
mobileAspectRatio,
204+
isInLoopingVideoTestControl,
203205
}: Props) => {
204206
if (mainImage === '') {
205207
return null;
@@ -214,6 +216,11 @@ export const CardPicture = ({
214216

215217
return (
216218
<picture
219+
data-component={
220+
isInLoopingVideoTestControl
221+
? 'loop-video-player-control'
222+
: undefined
223+
}
217224
data-size={imageSize}
218225
css={[
219226
block,

dotcom-rendering/src/components/DecideContainer.tsx

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,8 @@ type Props = {
4848
frontId?: string;
4949
collectionId: number;
5050
containerLevel?: DCRContainerLevel;
51+
isInLoopingVideoTestVariant?: boolean;
52+
isInLoopingVideoTestControl?: boolean;
5153
};
5254

5355
export const DecideContainer = ({
@@ -63,6 +65,8 @@ export const DecideContainer = ({
6365
frontId,
6466
collectionId,
6567
containerLevel,
68+
isInLoopingVideoTestVariant,
69+
isInLoopingVideoTestControl,
6670
}: Props) => {
6771
switch (containerType) {
6872
case 'dynamic/fast':
@@ -255,6 +259,8 @@ export const DecideContainer = ({
255259
imageLoading={imageLoading}
256260
aspectRatio={aspectRatio}
257261
collectionId={collectionId}
262+
isInLoopingVideoTestVariant={isInLoopingVideoTestVariant}
263+
isInLoopingVideoTestControl={isInLoopingVideoTestControl}
258264
/>
259265
);
260266
case 'flexible/general':
@@ -268,6 +274,8 @@ export const DecideContainer = ({
268274
aspectRatio={aspectRatio}
269275
containerLevel={containerLevel}
270276
collectionId={collectionId}
277+
isInLoopingVideoTestVariant={isInLoopingVideoTestVariant}
278+
isInLoopingVideoTestControl={isInLoopingVideoTestControl}
271279
/>
272280
);
273281
case 'scrollable/small':

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import { FrontSection } from './FrontSection';
77

88
export default {
99
component: DynamicFast,
10-
title: 'Components/DynamicFast',
10+
title: 'Front Containers/Deprecated Containers/DynamicFast',
1111
parameters: {
1212
chromatic: {
1313
viewports: [

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ const defaultGroupedTrails: DCRGroupedTrails = {
2222

2323
const meta = {
2424
component: DynamicPackage,
25-
title: 'Components/DynamicPackage',
25+
title: 'Front Containers/Deprecated Containers/DynamicPackage',
2626
parameters: {
2727
chromatic: {
2828
viewports: [

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ const defaultGroupedTrails: DCRGroupedTrails = {
2323

2424
export default {
2525
component: DynamicSlow,
26-
title: 'Components/DynamicSlow',
26+
title: 'Front Containers/Deprecated Containers/DynamicSlow',
2727
parameters: {
2828
chromatic: {
2929
viewports: [

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import { FrontSection } from './FrontSection';
77

88
export default {
99
component: DynamicSlowMPU,
10-
title: 'Components/DynamicSlowMPU',
10+
title: 'Front Containers/Deprecated Containers/DynamicSlowMPU',
1111
parameters: {
1212
chromatic: {
1313
viewports: [

0 commit comments

Comments
 (0)