Skip to content

Commit 8b91b02

Browse files
committed
Merge remote-tracking branch 'origin/main' into jlk/ab-testing/call-fastly-sequentially
2 parents 067d8cb + 4d4322c commit 8b91b02

File tree

7 files changed

+37
-47
lines changed

7 files changed

+37
-47
lines changed

ab-testing/config/abTests.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,18 @@ const ABTests: ABTest[] = [
5858
groups: ["control", "variant"],
5959
shouldForceMetricsCollection: true,
6060
},
61+
{
62+
name: "fronts-and-curation-onward-journeys",
63+
description: "Testing the new Onward Journey component on all articles",
64+
owners: ["[email protected]"],
65+
expirationDate: `2026-02-25`,
66+
type: "client",
67+
status: "ON",
68+
audienceSize: 50 / 100,
69+
audienceSpace: "A",
70+
groups: ["control", "variant"],
71+
shouldForceMetricsCollection: false,
72+
},
6173
];
6274

6375
const activeABtests = ABTests.filter((test) => test.status === "ON");

ab-testing/config/types.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ type AudienceSpace = Map<string, FastlyTestParams>;
44

55
type AllSpace = Map<string, FastlyTestParams[]>;
66

7-
type Team = "commercial" | "webex" | "thefilter";
7+
type Team = "commercial" | "webex" | "thefilter" | "fronts-and-curation";
88

99
type TestName = `${Team}-${string}`;
1010

@@ -23,7 +23,8 @@ type ABTest = {
2323
expirationDate: `${Year}-${Month}-${Day}`;
2424
/** Test type: should this run on the server or client */
2525
type: "server" | "client";
26-
/** Whether the AB test is currently running or not
26+
/**
27+
* Whether the AB test is currently running or not
2728
* Would be nice to know who changed the status last and when
2829
*/
2930
status: "ON" | "OFF";
@@ -37,7 +38,8 @@ type ABTest = {
3738
audienceSpace?: "A" | "B" | "C";
3839
/** Test group definition */
3940
groups: string[];
40-
/** Bypasses sampling to force metrics collection for this test
41+
/**
42+
* Bypasses sampling to force metrics collection for this test
4143
* See DCR Metrics component for end usage
4244
*/
4345
shouldForceMetricsCollection?: boolean;

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

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import {
77
Pillar,
88
} from '../lib/articleFormat';
99
import type { EditionId } from '../lib/edition';
10-
import { useAB } from '../lib/useAB';
10+
import { useBetaAB } from '../lib/useAB';
1111
import { useIsHorizontalScrollingSupported } from '../lib/useIsHorizontalScrollingSupported';
1212
import { palette } from '../palette';
1313
import type { OnwardsSource } from '../types/onwards';
@@ -227,10 +227,13 @@ export const OnwardsUpper = ({
227227
webURL,
228228
isInStarRatingVariant,
229229
}: Props) => {
230-
const abTestAPI = useAB()?.api;
230+
const abTests = useBetaAB();
231231
const isInOnwardsAbTestVariant =
232232
renderingTarget === 'Web' &&
233-
abTestAPI?.isUserInVariant('OnwardJourneys', 'variant');
233+
abTests?.isUserInTestGroup(
234+
'fronts-and-curation-onward-journeys',
235+
'variant',
236+
);
234237

235238
const isHorizontalScrollingSupported = useIsHorizontalScrollingSupported();
236239
if (!isHorizontalScrollingSupported) return null;

dotcom-rendering/src/components/RichLink.tsx

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,10 @@ const headerStyles = css`
8080
color: ${themePalette('--rich-link-header')};
8181
`;
8282

83-
const titleStyles = (parentIsBlog: boolean) => css`
83+
const titleStyles = (
84+
parentIsBlog: boolean,
85+
isStarRatingRedesign: boolean,
86+
) => css`
8487
${parentIsBlog ? headlineMedium17 : headlineMedium14};
8588
padding-top: 1px;
8689
@@ -92,7 +95,7 @@ const titleStyles = (parentIsBlog: boolean) => css`
9295
* Please speak to your team's designer and update this to use a more appropriate preset.
9396
*/
9497
font-weight: 400;
95-
padding-bottom: 5px;
98+
${!isStarRatingRedesign && `padding-bottom: 5px`};
9699
}
97100
`;
98101

@@ -223,6 +226,8 @@ export const RichLink = ({
223226

224227
const isLabs = linkFormat.theme === ArticleSpecial.Labs;
225228

229+
const isStarRatingRedesign =
230+
!isUndefined(starRating) && isInStarRatingVariant;
226231
return (
227232
<div
228233
data-print-layout="hide"
@@ -251,7 +256,10 @@ export const RichLink = ({
251256
<div css={headerStyles}>
252257
<div
253258
css={[
254-
titleStyles(parentIsBlog),
259+
titleStyles(
260+
parentIsBlog,
261+
!!isStarRatingRedesign,
262+
),
255263
isLabs && labsTitleStyles,
256264
]}
257265
>

dotcom-rendering/src/components/marketing/shared/ResponsiveImage.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ type ResponsiveImageProps = {
2121
cssOverrides?: SerializedStyles;
2222
};
2323

24-
function createSource(image: ImageAttrs): ReactElement {
25-
return <source media={image.media} srcSet={image.url} key={image.url} />;
24+
function createSource(image: ImageAttrs, index: number): ReactElement {
25+
return <source media={image.media} srcSet={image.url} key={index} />;
2626
}
2727

2828
export const ResponsiveImage: ReactComponent<ResponsiveImageProps> = ({
Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,8 @@
11
import type { ABTest } from '@guardian/ab-core';
22
import { abTestTest } from './tests/ab-test-test';
33
import { noAuxiaSignInGate } from './tests/no-auxia-sign-in-gate';
4-
import { onwardJourneys } from './tests/onward-journeys';
54
import { userBenefitsApi } from './tests/user-benefits-api';
65

76
// keep in sync with ab-tests in frontend
87
// https://github.com/guardian/frontend/tree/main/static/src/javascripts/projects/common/modules/experiments/ab-tests.ts
9-
export const tests: ABTest[] = [
10-
abTestTest,
11-
userBenefitsApi,
12-
noAuxiaSignInGate,
13-
onwardJourneys,
14-
];
8+
export const tests: ABTest[] = [abTestTest, userBenefitsApi, noAuxiaSignInGate];

dotcom-rendering/src/experiments/tests/onward-journeys.ts

Lines changed: 0 additions & 29 deletions
This file was deleted.

0 commit comments

Comments
 (0)