Skip to content

Commit 83900ac

Browse files
committed
Merge remote-tracking branch 'origin/main' into jlk/update-commercial
2 parents c048d9e + 0c8802d commit 83900ac

File tree

15 files changed

+214
-123
lines changed

15 files changed

+214
-123
lines changed

ab-testing/cdk/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,9 @@
2626
"@guardian/eslint-config": "12.0.1",
2727
"@guardian/tsconfig": "1.0.1",
2828
"@types/node": "22.17.0",
29-
"aws-cdk": "2.1110.0",
30-
"aws-cdk-lib": "2.241.0",
31-
"constructs": "10.5.1",
29+
"aws-cdk": "2.1115.1",
30+
"aws-cdk-lib": "2.246.0",
31+
"constructs": "10.6.0",
3232
"eslint": "9.39.1",
3333
"prettier": "3.0.3",
3434
"source-map-support": "0.5.21",

ab-testing/config/abTests.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,16 +58,16 @@ const ABTests: ABTest[] = [
5858
shouldForceMetricsCollection: false,
5959
},
6060
{
61-
name: "thefilter-at-a-glance-redesign",
61+
name: "thefilter-at-a-glance-redesign-v2",
6262
description:
6363
"Testing redesigned at a glance component on The Filter articles",
6464
owners: ["thefilter.dev@guardian.co.uk"],
65-
expirationDate: "2026-04-06",
65+
expirationDate: "2026-05-06",
6666
type: "server",
6767
status: "ON",
6868
audienceSize: 0 / 100,
6969
audienceSpace: "C",
70-
groups: ["control", "stacked", "carousel"],
70+
groups: ["control", "carousel", "stacked-default", "stacked-expanded"],
7171
shouldForceMetricsCollection: false,
7272
},
7373
{

ab-testing/config/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,9 @@
3434
"@guardian/eslint-config": "12.0.1",
3535
"@guardian/tsconfig": "1.0.1",
3636
"@types/node": "22.17.0",
37-
"aws-cdk": "2.1110.0",
38-
"aws-cdk-lib": "2.241.0",
39-
"constructs": "10.5.1",
37+
"aws-cdk": "2.1115.1",
38+
"aws-cdk-lib": "2.246.0",
39+
"constructs": "10.6.0",
4040
"eslint": "9.39.1",
4141
"prettier": "3.0.3",
4242
"source-map-support": "0.5.21",

ab-testing/deploy-lambda/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,9 @@
2626
"@rollup/plugin-node-resolve": "16.0.3",
2727
"@types/aws-lambda": "8.10.158",
2828
"@types/node": "22.17.0",
29-
"aws-cdk": "2.1110.0",
30-
"aws-cdk-lib": "2.241.0",
31-
"constructs": "10.5.1",
29+
"aws-cdk": "2.1115.1",
30+
"aws-cdk-lib": "2.246.0",
31+
"constructs": "10.6.0",
3232
"esbuild": "0.27.0",
3333
"eslint": "9.39.1",
3434
"prettier": "3.0.3",

dotcom-rendering/package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
"@guardian/eslint-config-typescript": "12.0.0",
3838
"@guardian/identity-auth": "6.0.1",
3939
"@guardian/identity-auth-frontend": "8.1.0",
40-
"@guardian/libs": "30.1.1",
40+
"@guardian/libs": "31.0.0",
4141
"@guardian/ophan-tracker-js": "2.8.0",
4242
"@guardian/react-crossword": "11.1.0",
4343
"@guardian/shimport": "1.0.2",
@@ -90,15 +90,15 @@
9090
"@types/youtube": "0.0.50",
9191
"ajv": "8.18.0",
9292
"ajv-formats": "2.1.1",
93-
"aws-cdk": "2.1110.0",
94-
"aws-cdk-lib": "2.241.0",
93+
"aws-cdk": "2.1115.1",
94+
"aws-cdk-lib": "2.246.0",
9595
"body-parser": "1.20.4",
9696
"browserslist": "4.24.4",
9797
"buffer": "6.0.3",
9898
"clean-css": "5.3.3",
9999
"compare-versions": "6.1.0",
100100
"compression": "1.7.4",
101-
"constructs": "10.5.1",
101+
"constructs": "10.6.0",
102102
"cpy": "11.0.0",
103103
"css-loader": "7.1.2",
104104
"dompurify": "3.2.4",

dotcom-rendering/src/components/ProductSummary.island.tsx

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,26 @@ export const ProductSummary = ({
2222
);
2323
}
2424

25+
if (variant === 'stacked-default') {
26+
return (
27+
<Island priority="feature" defer={{ until: 'idle' }}>
28+
<StackedProducts
29+
products={products}
30+
heading={'At a glance'}
31+
format={format}
32+
showAllProducts={false}
33+
/>
34+
</Island>
35+
);
36+
}
37+
2538
return (
2639
<Island priority="feature" defer={{ until: 'idle' }}>
2740
<StackedProducts
2841
products={products}
2942
heading={'At a glance'}
3043
format={format}
44+
showAllProducts={true}
3145
/>
3246
</Island>
3347
);

dotcom-rendering/src/components/StackedProducts.island.tsx

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,12 @@ export const StackedProducts = ({
3333
products,
3434
heading,
3535
format,
36+
showAllProducts,
3637
}: {
3738
products: ProductBlockElement[];
3839
heading: string;
3940
format: ArticleFormat;
41+
showAllProducts: boolean;
4042
}) => {
4143
const [isExpanded, setIsExpanded] = useState(false);
4244
return (
@@ -54,7 +56,7 @@ export const StackedProducts = ({
5456
<Subheading format={format} topPadding={false}>
5557
{heading}
5658
</Subheading>
57-
{products.length > cardsShownByDefault && (
59+
{products.length > cardsShownByDefault && !showAllProducts && (
5860
<p css={cardCounterStyles}>
5961
{isExpanded
6062
? products.length
@@ -79,10 +81,14 @@ export const StackedProducts = ({
7981
{products.map((product: ProductBlockElement, index) => (
8082
<div
8183
key={index}
82-
data-component={`at-a-glance-stacked-card-${index + 1}`}
84+
data-component={`at-a-glance-stacked-card-${
85+
showAllProducts ? 'expanded' : 'default'
86+
}-${index + 1}`}
8387
style={{
8488
display:
85-
!isExpanded && index >= cardsShownByDefault
89+
!isExpanded &&
90+
index >= cardsShownByDefault &&
91+
!showAllProducts
8692
? 'none'
8793
: 'block',
8894
}}
@@ -95,7 +101,7 @@ export const StackedProducts = ({
95101
))}
96102
</div>
97103

98-
{products.length > cardsShownByDefault && (
104+
{products.length > cardsShownByDefault && !showAllProducts && (
99105
<LinkButton
100106
onClick={() => setIsExpanded(!isExpanded)}
101107
cssOverrides={showAllButtonStyles}

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

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ const meta = preview.meta({
1515
display: ArticleDisplay.Standard,
1616
theme: Pillar.Lifestyle,
1717
},
18+
showAllProducts: false,
1819
},
1920
decorators: [centreColumnDecorator],
2021
});
@@ -24,11 +25,12 @@ export const Default = meta.story();
2425
export const FourProducts = meta.story({
2526
args: {
2627
products: exampleAtAGlanceProductArray.slice(0, 4),
27-
heading: 'At a glance',
28-
format: {
29-
design: ArticleDesign.Review,
30-
display: ArticleDisplay.Standard,
31-
theme: Pillar.Lifestyle,
32-
},
28+
},
29+
});
30+
31+
export const AllCardsExpanded = meta.story({
32+
args: {
33+
products: exampleAtAGlanceProductArray.slice(0, 7),
34+
showAllProducts: true,
3335
},
3436
});

dotcom-rendering/src/frontend/schemas/feArticle.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4774,7 +4774,8 @@
47744774
"variant": {
47754775
"enum": [
47764776
"carousel",
4777-
"stacked"
4777+
"stacked-default",
4778+
"stacked-expanded"
47784779
],
47794780
"type": "string"
47804781
}

dotcom-rendering/src/model/block-schema.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4256,7 +4256,8 @@
42564256
"variant": {
42574257
"enum": [
42584258
"carousel",
4259-
"stacked"
4259+
"stacked-default",
4260+
"stacked-expanded"
42604261
],
42614262
"type": "string"
42624263
}

0 commit comments

Comments
 (0)