Skip to content

Commit 530658a

Browse files
Merge branch 'main' into a11y-aria-labels
2 parents 3826fc7 + ac95a39 commit 530658a

17 files changed

+783
-62
lines changed

ab-testing/cdk/lib/__snapshots__/abTestingConfig.test.ts.snap

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@ exports[`The ID5 Baton Lambda stack > matches the CODE snapshot 1`] = `
44
"gu:cdk:constructs": [],
55
"gu:cdk:version": "62.0.1"
66
},
7+
"Parameters": {
8+
"BuildId": {
9+
"Type": "String",
10+
"Description": "The riff-raff build id, automatically generated and provided by riff-raff"
11+
}
12+
},
713
"Resources": {
814
"InvokeDictionaryDeployLambda": {
915
"Type": "Custom::FastlyEdgeDictionaryDeploy",
@@ -24,7 +30,10 @@ exports[`The ID5 Baton Lambda stack > matches the CODE snapshot 1`] = `
2430
]
2531
]
2632
},
27-
"ServiceTimeout": "300"
33+
"ServiceTimeout": "300",
34+
"BuildId": {
35+
"Ref": "BuildId"
36+
}
2837
},
2938
"UpdateReplacePolicy": "Delete",
3039
"DeletionPolicy": "Delete"
@@ -39,6 +48,12 @@ exports[`The ID5 Baton Lambda stack > matches the PROD snapshot 1`] = `
3948
"gu:cdk:constructs": [],
4049
"gu:cdk:version": "62.0.1"
4150
},
51+
"Parameters": {
52+
"BuildId": {
53+
"Type": "String",
54+
"Description": "The riff-raff build id, automatically generated and provided by riff-raff"
55+
}
56+
},
4257
"Resources": {
4358
"InvokeDictionaryDeployLambda": {
4459
"Type": "Custom::FastlyEdgeDictionaryDeploy",
@@ -59,7 +74,10 @@ exports[`The ID5 Baton Lambda stack > matches the PROD snapshot 1`] = `
5974
]
6075
]
6176
},
62-
"ServiceTimeout": "300"
77+
"ServiceTimeout": "300",
78+
"BuildId": {
79+
"Ref": "BuildId"
80+
}
6381
},
6482
"UpdateReplacePolicy": "Delete",
6583
"DeletionPolicy": "Delete"

ab-testing/cdk/lib/abTestingConfig.ts

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import type { GuStackProps } from "@guardian/cdk/lib/constructs/core/stack.js";
22
import { GuStack } from "@guardian/cdk/lib/constructs/core/stack.js";
33
import type { App } from "aws-cdk-lib";
4-
import { CustomResource, Duration } from "aws-cdk-lib";
4+
import { CfnParameter, CustomResource, Duration } from "aws-cdk-lib";
55
import { Function } from "aws-cdk-lib/aws-lambda";
66
import { lambdaFunctionName } from "./deploymentLambda.ts";
77

@@ -15,11 +15,21 @@ export class AbTestingConfig extends GuStack {
1515
`${lambdaFunctionName}-${this.stage}`,
1616
);
1717

18+
const buildId = new CfnParameter(this, "BuildId", {
19+
type: "String",
20+
description:
21+
"The riff-raff build id, automatically generated and provided by riff-raff",
22+
});
23+
1824
// Trigger the Lambda to run upon deployment
1925
new CustomResource(this, "InvokeDictionaryDeployLambda", {
2026
serviceToken: lambda.functionArn,
2127
serviceTimeout: Duration.minutes(5),
2228
resourceType: "Custom::FastlyEdgeDictionaryDeploy",
29+
properties: {
30+
/** Ensures the custom resource is invoked on every deploy */
31+
BuildId: buildId.valueAsString,
32+
},
2333
});
2434
}
2535
}

dotcom-rendering/cdk/bin/cdk.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,8 @@ new RenderingCDKStack(cdkApp, 'FaciaRendering-PROD', {
6868
stage: 'PROD',
6969
domainName: 'facia-rendering.guardianapis.com',
7070
scaling: {
71-
minimumInstances: 48,
72-
maximumInstances: 240,
71+
minimumInstances: 21,
72+
maximumInstances: 210,
7373
policies: {
7474
step: {
7575
cpu: cpuScalingSteps,
Lines changed: 242 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,242 @@
1+
import type { ProductBlockElement } from '../../src/types/content';
2+
import { productImage } from './productImage';
3+
4+
export const exampleProduct: ProductBlockElement = {
5+
_type: 'model.dotcomrendering.pageElements.ProductBlockElement',
6+
elementId: 'b1f6e8e2-3f3a-4f0c-8d1e-5f3e3e3e3e3e',
7+
primaryHeadingHtml: 'Best overall',
8+
secondaryHeadingHtml: 'Bosch Sky Kettle',
9+
brandName: 'Bosch',
10+
productName: 'Sky Kettle',
11+
image: productImage,
12+
displayType: 'InlineWithProductCard',
13+
lowestPrice: '£39.99',
14+
customAttributes: [
15+
{ name: 'What we love', value: 'It pours well and looks great' },
16+
{
17+
name: "What we don't love",
18+
value: 'The handle feels a bit cheap compared to the rest of it',
19+
},
20+
],
21+
productCtas: [
22+
{
23+
url: 'https://www.johnlewis.com/bosch-twk7203gb-sky-variable-temperature-kettle-1-7l-black/p3228625',
24+
text: '',
25+
retailer: 'John Lewis',
26+
price: '£45.99',
27+
},
28+
{
29+
url: 'https://www.amazon.co.uk/Bosch-TWK7203GB-Sky-Variable-Temperature/dp/B07Z8VQ2V6',
30+
text: '',
31+
retailer: 'Amazon',
32+
price: '£39.99',
33+
},
34+
],
35+
starRating: 'none-selected',
36+
content: [
37+
{
38+
displayCredit: true,
39+
_type: 'model.dotcomrendering.pageElements.ImageBlockElement',
40+
role: 'inline',
41+
media: {
42+
allImages: [
43+
{
44+
index: 0,
45+
fields: {
46+
height: '3213',
47+
width: '3213',
48+
},
49+
mediaType: 'Image',
50+
mimeType: 'image/jpeg',
51+
url: 'https://media.guimcode.co.uk/bacede2d976c26d6a224ede074d5634a3f1d304f/0_0_3213_3213/3213.jpg',
52+
},
53+
{
54+
index: 1,
55+
fields: {
56+
isMaster: 'true',
57+
height: '3213',
58+
width: '3213',
59+
},
60+
mediaType: 'Image',
61+
mimeType: 'image/jpeg',
62+
url: 'https://media.guimcode.co.uk/bacede2d976c26d6a224ede074d5634a3f1d304f/0_0_3213_3213/master/3213.jpg',
63+
},
64+
{
65+
index: 2,
66+
fields: {
67+
height: '2000',
68+
width: '2000',
69+
},
70+
mediaType: 'Image',
71+
mimeType: 'image/jpeg',
72+
url: 'https://media.guimcode.co.uk/bacede2d976c26d6a224ede074d5634a3f1d304f/0_0_3213_3213/2000.jpg',
73+
},
74+
{
75+
index: 3,
76+
fields: {
77+
height: '1000',
78+
width: '1000',
79+
},
80+
mediaType: 'Image',
81+
mimeType: 'image/jpeg',
82+
url: 'https://media.guimcode.co.uk/bacede2d976c26d6a224ede074d5634a3f1d304f/0_0_3213_3213/1000.jpg',
83+
},
84+
{
85+
index: 4,
86+
fields: {
87+
height: '500',
88+
width: '500',
89+
},
90+
mediaType: 'Image',
91+
mimeType: 'image/jpeg',
92+
url: 'https://media.guimcode.co.uk/bacede2d976c26d6a224ede074d5634a3f1d304f/0_0_3213_3213/500.jpg',
93+
},
94+
{
95+
index: 5,
96+
fields: {
97+
height: '140',
98+
width: '140',
99+
},
100+
mediaType: 'Image',
101+
mimeType: 'image/jpeg',
102+
url: 'https://media.guimcode.co.uk/bacede2d976c26d6a224ede074d5634a3f1d304f/0_0_3213_3213/140.jpg',
103+
},
104+
],
105+
},
106+
elementId: '76686aa1-2e47-4616-b4ed-a88d0afe07ed',
107+
imageSources: [
108+
{
109+
weighting: 'inline',
110+
srcSet: [
111+
{
112+
src: 'https://media.guimcode.co.uk/bacede2d976c26d6a224ede074d5634a3f1d304f/0_0_3213_3213/master/3213.jpg',
113+
width: 620,
114+
},
115+
{
116+
src: 'https://media.guimcode.co.uk/bacede2d976c26d6a224ede074d5634a3f1d304f/0_0_3213_3213/master/3213.jpg',
117+
width: 1240,
118+
},
119+
{
120+
src: 'https://media.guimcode.co.uk/bacede2d976c26d6a224ede074d5634a3f1d304f/0_0_3213_3213/master/3213.jpg',
121+
width: 605,
122+
},
123+
{
124+
src: 'https://media.guimcode.co.uk/bacede2d976c26d6a224ede074d5634a3f1d304f/0_0_3213_3213/master/3213.jpg',
125+
width: 1210,
126+
},
127+
{
128+
src: 'https://media.guimcode.co.uk/bacede2d976c26d6a224ede074d5634a3f1d304f/0_0_3213_3213/master/3213.jpg',
129+
width: 445,
130+
},
131+
{
132+
src: 'https://media.guimcode.co.uk/bacede2d976c26d6a224ede074d5634a3f1d304f/0_0_3213_3213/master/3213.jpg',
133+
width: 890,
134+
},
135+
],
136+
},
137+
{
138+
weighting: 'thumbnail',
139+
srcSet: [
140+
{
141+
src: 'https://media.guimcode.co.uk/bacede2d976c26d6a224ede074d5634a3f1d304f/0_0_3213_3213/master/3213.jpg',
142+
width: 140,
143+
},
144+
{
145+
src: 'https://media.guimcode.co.uk/bacede2d976c26d6a224ede074d5634a3f1d304f/0_0_3213_3213/master/3213.jpg',
146+
width: 280,
147+
},
148+
{
149+
src: 'https://media.guimcode.co.uk/bacede2d976c26d6a224ede074d5634a3f1d304f/0_0_3213_3213/master/3213.jpg',
150+
width: 120,
151+
},
152+
{
153+
src: 'https://media.guimcode.co.uk/bacede2d976c26d6a224ede074d5634a3f1d304f/0_0_3213_3213/master/3213.jpg',
154+
width: 240,
155+
},
156+
],
157+
},
158+
{
159+
weighting: 'supporting',
160+
srcSet: [
161+
{
162+
src: 'https://media.guimcode.co.uk/bacede2d976c26d6a224ede074d5634a3f1d304f/0_0_3213_3213/master/3213.jpg',
163+
width: 380,
164+
},
165+
{
166+
src: 'https://media.guimcode.co.uk/bacede2d976c26d6a224ede074d5634a3f1d304f/0_0_3213_3213/master/3213.jpg',
167+
width: 760,
168+
},
169+
{
170+
src: 'https://media.guimcode.co.uk/bacede2d976c26d6a224ede074d5634a3f1d304f/0_0_3213_3213/master/3213.jpg',
171+
width: 300,
172+
},
173+
{
174+
src: 'https://media.guimcode.co.uk/bacede2d976c26d6a224ede074d5634a3f1d304f/0_0_3213_3213/master/3213.jpg',
175+
width: 600,
176+
},
177+
{
178+
src: 'https://media.guimcode.co.uk/bacede2d976c26d6a224ede074d5634a3f1d304f/0_0_3213_3213/master/3213.jpg',
179+
width: 620,
180+
},
181+
{
182+
src: 'https://media.guimcode.co.uk/bacede2d976c26d6a224ede074d5634a3f1d304f/0_0_3213_3213/master/3213.jpg',
183+
width: 1240,
184+
},
185+
{
186+
src: 'https://media.guimcode.co.uk/bacede2d976c26d6a224ede074d5634a3f1d304f/0_0_3213_3213/master/3213.jpg',
187+
width: 605,
188+
},
189+
{
190+
src: 'https://media.guimcode.co.uk/bacede2d976c26d6a224ede074d5634a3f1d304f/0_0_3213_3213/master/3213.jpg',
191+
width: 1210,
192+
},
193+
{
194+
src: 'https://media.guimcode.co.uk/bacede2d976c26d6a224ede074d5634a3f1d304f/0_0_3213_3213/master/3213.jpg',
195+
width: 445,
196+
},
197+
{
198+
src: 'https://media.guimcode.co.uk/bacede2d976c26d6a224ede074d5634a3f1d304f/0_0_3213_3213/master/3213.jpg',
199+
width: 890,
200+
},
201+
],
202+
},
203+
],
204+
data: {
205+
alt: 'Testing Bosch Sky Kettle',
206+
credit: 'Photograph: Rachel Ogden/The Guardian',
207+
},
208+
},
209+
{
210+
_type: 'model.dotcomrendering.pageElements.LinkBlockElement',
211+
url: 'https://www.johnlewis.com/bosch-twk7203gb-sky-variable-temperature-kettle-1-7l-black/p3228625',
212+
label: '£79.99 at John Lewis',
213+
linkType: 'ProductButton',
214+
},
215+
{
216+
_type: 'model.dotcomrendering.pageElements.LinkBlockElement',
217+
url: 'https://www.amazon.co.uk/Bosch-TWK7203GB-Sky-Variable-Temperature/dp/B07Z8VQ2V6',
218+
label: '£79.99 at Amazon',
219+
linkType: 'ProductButton',
220+
},
221+
{
222+
_type: 'model.dotcomrendering.pageElements.TextBlockElement',
223+
html: '<p>Offering variable temperatures and a double-walled stainless-steel housing, the 3kW Sky is a brilliant blend of robust form and function. It boasts a low minimum boil (300ml), a keep-warm setting and touch controls.</p>',
224+
elementId: '4a27eb68-6a03-4e82-a7d0-e4f1ef3ccb6f',
225+
},
226+
{
227+
_type: 'model.dotcomrendering.pageElements.TextBlockElement',
228+
html: '<p><strong>Why we love it<br></strong>I found it difficult to select a best kettle from so many that performed well, but the Bosch Sky clinched it because it’s such a good all-rounder that will suit most people. It pours well, has a button that’s within easy reach of the handle so it’s simple to open the lid without touching it, and it’s insulated so the exterior doesn’t become too hot to touch. From a design perspective, it has a more industrial feel than many others – no frippery here – but not too modern that it wouldn’t fit into most kitchens. Its display is thoughtfully designed, easy to keep clean and lights up as it heats.</p>',
229+
elementId: 'f48f03d4-bece-4763-874b-4027a311643e',
230+
},
231+
{
232+
_type: 'model.dotcomrendering.pageElements.TextBlockElement',
233+
html: '<p>The exterior doesn’t get too hot (up to 40C), and while it wasn’t the fastest to boil in testing, it was only seconds behind the Dualit below. It clicked off at boiling point, and the water was still a toasty 78C 30 minutes later. At the hour point, it was 66C, and two hours 52C, meaning you’ll spend less time and energy reboiling.</p>',
234+
elementId: 'df571922-33b1-416a-8b3d-ee756b638cc1',
235+
},
236+
{
237+
_type: 'model.dotcomrendering.pageElements.TextBlockElement',
238+
html: '<p><strong>It’s a shame that … </strong> its premium look ends at the handle, which seems cheap and plasticky next to the sleek aesthetic of the rest of it.</p>',
239+
elementId: 'd98fc724-8908-46e2-acc6-4739ad4d5719',
240+
},
241+
],
242+
};

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -369,6 +369,7 @@ export const AudioAtom = ({
369369
value={percentPlayed}
370370
onClick={updateAudioCurrentTime}
371371
readOnly={true}
372+
aria-label="Audio progress percent played"
372373
/>
373374
</div>
374375
<div css={timeDurationStyle}>

dotcom-rendering/src/components/CalloutEmbed/FormFields/FileUpload.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ export const FileUpload = ({ formField, formData, setFormData }: Props) => {
4848
<>
4949
<FieldLabel formField={formField} />
5050
<input
51+
id={formField.id}
5152
data-testid={`form-field-${formField.id}`}
5253
css={fileUploadInputStyles}
5354
type="file"

dotcom-rendering/src/components/Discussion/AbuseReportForm.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,12 @@ export const AbuseReportForm = ({
225225
formVariables.categoryId === legalIssueCategoryId;
226226

227227
return (
228-
<div aria-modal="true" ref={modalRef}>
228+
<div
229+
role="dialog"
230+
aria-modal="true"
231+
aria-label="Report abuse"
232+
ref={modalRef}
233+
>
229234
<form css={formWrapper} onSubmit={onSubmit}>
230235
<div
231236
css={[

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ export interface DropdownLinkType {
3131
isActive?: boolean;
3232
dataLinkName: string;
3333
notifications?: Notification[];
34+
onClick?: () => void;
3435
}
3536

3637
interface Props {
@@ -370,6 +371,7 @@ const DropdownLink = ({ link, index }: DropdownLinkProps) => {
370371
renderingTarget,
371372
);
372373
}
374+
link.onClick?.();
373375
}}
374376
>
375377
<div>

0 commit comments

Comments
 (0)