Skip to content

Commit 6d17f77

Browse files
authored
Merge pull request #14701 from guardian/doml/remove-all-boosts-experiment
Remove all boosts AB test
2 parents 801de6f + 83fe729 commit 6d17f77

File tree

12 files changed

+27
-325
lines changed

12 files changed

+27
-325
lines changed

dotcom-rendering/src/components/Avatar.tsx

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -57,19 +57,17 @@ type Props = {
5757
alt: string;
5858
shape?: AvatarShape;
5959
imageSize?: MediaSizeType;
60-
isInAllBoostsTest?: boolean;
6160
};
6261

6362
const decideImageWidths = (
6463
imageSize: MediaSizeType,
65-
isInAllBoostsTest = false,
6664
): [ImageWidthType, ...ImageWidthType[]] => {
6765
switch (imageSize) {
6866
case 'small':
6967
return [
7068
{
7169
breakpoint: breakpoints.mobile,
72-
width: isInAllBoostsTest ? 150 : 80,
70+
width: 80,
7371
aspectRatio: '1:1',
7472
},
7573
];
@@ -144,15 +142,9 @@ const defaultImageSizes: [ImageWidthType, ...ImageWidthType[]] = [
144142
{ breakpoint: breakpoints.tablet, width: 140 },
145143
];
146144

147-
export const Avatar = ({
148-
src,
149-
alt,
150-
shape = 'round',
151-
imageSize,
152-
isInAllBoostsTest,
153-
}: Props) => {
145+
export const Avatar = ({ src, alt, shape = 'round', imageSize }: Props) => {
154146
const imageWidths = imageSize
155-
? decideImageWidths(imageSize, isInAllBoostsTest)
147+
? decideImageWidths(imageSize)
156148
: defaultImageSizes;
157149

158150
const sources = generateSources(getSourceImageUrl(src), imageWidths);

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

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,6 @@ export type Props = {
157157
trailTextSize?: TrailTextSize;
158158
/** A kicker image is seperate to the main media and renders as part of the kicker */
159159
showKickerImage?: boolean;
160-
isInAllBoostsTest?: boolean;
161160
fixImageWidth?: boolean;
162161
/** Determines if the headline should be positioned within the content or outside the content */
163162
headlinePosition?: 'inner' | 'outer';
@@ -401,7 +400,6 @@ export const Card = ({
401400
trailTextSize,
402401
showKickerImage = false,
403402
fixImageWidth,
404-
isInAllBoostsTest = false,
405403
headlinePosition = 'inner',
406404
showLabsRedesign = false,
407405
}: Props) => {
@@ -595,12 +593,18 @@ export const Card = ({
595593
const mediaFixedSizeOptions = (): MediaFixedSizeOptions => {
596594
if (isSmallCard) {
597595
return {
598-
mobile: isInAllBoostsTest ? undefined : 'tiny',
596+
mobile: 'tiny',
599597
tablet: 'small',
600598
desktop: 'small',
601599
};
602600
}
603-
if (isFlexibleContainer) return { mobile: 'small' };
601+
602+
if (isFlexibleContainer) {
603+
return {
604+
mobile: 'small',
605+
};
606+
}
607+
604608
return { mobile: 'medium' };
605609
};
606610

@@ -939,15 +943,13 @@ export const Card = ({
939943
imagePositionOnMobile={mediaPositionOnMobile}
940944
isBetaContainer={isBetaContainer}
941945
isFlexibleContainer={isFlexibleContainer}
942-
isInAllBoostsTest={isInAllBoostsTest}
943946
>
944947
<Avatar
945948
src={media.avatarUrl}
946949
alt={byline ?? ''}
947950
imageSize={
948951
isBetaContainer ? mediaSize : undefined
949952
}
950-
isInAllBoostsTest={isInAllBoostsTest}
951953
/>
952954
</AvatarContainer>
953955
)}
@@ -1071,9 +1073,6 @@ export const Card = ({
10711073
!isMoreGalleriesOnwardContent
10721074
}
10731075
aspectRatio={aspectRatio}
1074-
isInAllBoostsTest={
1075-
isInAllBoostsTest
1076-
}
10771076
/>
10781077
</div>
10791078
)}
@@ -1091,7 +1090,6 @@ export const Card = ({
10911090
!isMoreGalleriesOnwardContent
10921091
}
10931092
aspectRatio={aspectRatio}
1094-
isInAllBoostsTest={isInAllBoostsTest}
10951093
/>
10961094
{isVideoMainMedia && mainMedia.duration > 0 && (
10971095
<div
@@ -1141,7 +1139,6 @@ export const Card = ({
11411139
alt={media.trailImage.altText}
11421140
loading={imageLoading}
11431141
aspectRatio={aspectRatio}
1144-
isInAllBoostsTest={isInAllBoostsTest}
11451142
/>
11461143
)}
11471144
</>

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

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ type Props = {
99
imagePositionOnMobile: MediaPositionType;
1010
isBetaContainer: boolean;
1111
isFlexibleContainer: boolean;
12-
isInAllBoostsTest?: boolean;
1312
};
1413

1514
const sideMarginStyles = css`
@@ -32,7 +31,6 @@ const sizingStyles = (
3231
isFlexibleContainer: boolean,
3332
isVerticalOnDesktop: boolean,
3433
isVerticalOnMobile: boolean,
35-
isInAllBoostsTest = false,
3634
) => {
3735
if (!isBetaContainer) {
3836
switch (imageSize) {
@@ -83,26 +81,6 @@ const sizingStyles = (
8381

8482
switch (imageSize) {
8583
case 'small':
86-
if (isInAllBoostsTest) {
87-
return isFlexibleContainer
88-
? css`
89-
width: 90px;
90-
height: 90px;
91-
${until.tablet} {
92-
height: 150px;
93-
width: 150px;
94-
}
95-
`
96-
: css`
97-
width: 80px;
98-
height: 80px;
99-
${until.tablet} {
100-
height: 150px;
101-
width: 150px;
102-
}
103-
`;
104-
}
105-
10684
return isFlexibleContainer
10785
? css`
10886
width: 90px;
@@ -159,7 +137,6 @@ export const AvatarContainer = ({
159137
imagePositionOnMobile,
160138
isBetaContainer,
161139
isFlexibleContainer,
162-
isInAllBoostsTest,
163140
}: Props) => {
164141
const isVerticalOnDesktop =
165142
imagePositionOnDesktop === 'top' || imagePositionOnDesktop === 'bottom';
@@ -178,7 +155,6 @@ export const AvatarContainer = ({
178155
isFlexibleContainer,
179156
isVerticalOnDesktop,
180157
isVerticalOnMobile,
181-
isInAllBoostsTest,
182158
),
183159
]}
184160
>

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

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -166,9 +166,12 @@ const fixMediaWidth = ({
166166
tablet,
167167
desktop,
168168
}: MediaFixedSizeOptions) => css`
169-
${until.tablet} {
170-
${mobile !== undefined && fixMediaWidthStyles(mediaFixedSize[mobile])}
171-
}
169+
${mobile &&
170+
css`
171+
${until.tablet} {
172+
${fixMediaWidthStyles(mediaFixedSize[mobile])}
173+
}
174+
`}
172175
${tablet &&
173176
css`
174177
${between.tablet.and.desktop} {

dotcom-rendering/src/components/CardPicture.tsx

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ export type Props = {
1818
isCircular?: boolean;
1919
aspectRatio?: AspectRatio;
2020
mobileAspectRatio?: AspectRatio;
21-
isInAllBoostsTest?: boolean;
2221
};
2322

2423
/**
@@ -30,7 +29,6 @@ export type Props = {
3029
const decideImageWidths = (
3130
imageSize: MediaSizeType,
3231
aspectRatio: AspectRatio,
33-
isInAllBoostsTest: boolean,
3432
): [ImageWidthType, ...ImageWidthType[]] => {
3533
switch (imageSize) {
3634
// @TODO missing image size option
@@ -56,7 +54,7 @@ const decideImageWidths = (
5654
return [
5755
{
5856
breakpoint: breakpoints.mobile,
59-
width: isInAllBoostsTest ? 465 : 120,
57+
width: 120,
6058
aspectRatio,
6159
},
6260
{ breakpoint: breakpoints.tablet, width: 160, aspectRatio },
@@ -216,15 +214,14 @@ export const CardPicture = ({
216214
isCircular,
217215
aspectRatio = '5:3',
218216
mobileAspectRatio,
219-
isInAllBoostsTest = false,
220217
}: Props) => {
221218
if (mainImage === '') {
222219
return null;
223220
}
224221

225222
const sources = generateSources(
226223
mainImage,
227-
decideImageWidths(imageSize, aspectRatio, isInAllBoostsTest),
224+
decideImageWidths(imageSize, aspectRatio),
228225
);
229226

230227
const fallbackSource = getFallbackSource(sources);

dotcom-rendering/src/components/DecideContainer.tsx

Lines changed: 2 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ type Props = {
4646
sectionId: string;
4747
frontId?: string;
4848
collectionId: number;
49-
isInAllBoostsTest?: boolean;
5049
containerLevel?: DCRContainerLevel;
5150
/** Feature flag for the labs redesign work */
5251
showLabsRedesign?: boolean;
@@ -64,7 +63,6 @@ export const DecideContainer = ({
6463
sectionId,
6564
frontId,
6665
collectionId,
67-
isInAllBoostsTest,
6866
containerLevel,
6967
showLabsRedesign = false,
7068
}: Props) => {
@@ -248,7 +246,6 @@ export const DecideContainer = ({
248246
absoluteServerTimes={absoluteServerTimes}
249247
imageLoading={imageLoading}
250248
aspectRatio={aspectRatio}
251-
isInAllBoostsTest={!!isInAllBoostsTest}
252249
collectionId={collectionId}
253250
showLabsRedesign={!!showLabsRedesign}
254251
/>
@@ -263,25 +260,12 @@ export const DecideContainer = ({
263260
imageLoading={imageLoading}
264261
aspectRatio={aspectRatio}
265262
containerLevel={containerLevel}
266-
isInAllBoostsTest={!!isInAllBoostsTest}
267263
collectionId={collectionId}
268264
showLabsRedesign={!!showLabsRedesign}
269265
/>
270266
);
271267
case 'scrollable/small':
272-
return isInAllBoostsTest ? (
273-
<ScrollableSmall
274-
trails={trails}
275-
imageLoading={imageLoading}
276-
containerPalette={containerPalette}
277-
showAge={showAge}
278-
absoluteServerTimes={absoluteServerTimes}
279-
aspectRatio={aspectRatio}
280-
isInAllBoostsTest={true}
281-
sectionId={sectionId}
282-
showLabsRedesign={!!showLabsRedesign}
283-
/>
284-
) : (
268+
return (
285269
<Island priority="feature" defer={{ until: 'visible' }}>
286270
<ScrollableSmall
287271
trails={trails}
@@ -290,27 +274,13 @@ export const DecideContainer = ({
290274
showAge={showAge}
291275
absoluteServerTimes={absoluteServerTimes}
292276
aspectRatio={aspectRatio}
293-
isInAllBoostsTest={false}
294277
sectionId={sectionId}
295278
showLabsRedesign={!!showLabsRedesign}
296279
/>
297280
</Island>
298281
);
299282
case 'scrollable/medium':
300-
return isInAllBoostsTest ? (
301-
<ScrollableMedium
302-
trails={trails}
303-
imageLoading={imageLoading}
304-
containerPalette={containerPalette}
305-
showAge={showAge}
306-
absoluteServerTimes={absoluteServerTimes}
307-
aspectRatio={aspectRatio}
308-
sectionId={sectionId}
309-
showLabsRedesign={!!showLabsRedesign}
310-
containerLevel={containerLevel}
311-
isInAllBoostsTest={true}
312-
/>
313-
) : (
283+
return (
314284
<Island priority="feature" defer={{ until: 'visible' }}>
315285
<ScrollableMedium
316286
trails={trails}
@@ -321,8 +291,6 @@ export const DecideContainer = ({
321291
aspectRatio={aspectRatio}
322292
sectionId={sectionId}
323293
showLabsRedesign={!!showLabsRedesign}
324-
containerLevel={containerLevel}
325-
isInAllBoostsTest={isInAllBoostsTest}
326294
/>
327295
</Island>
328296
);
@@ -336,7 +304,6 @@ export const DecideContainer = ({
336304
imageLoading={imageLoading}
337305
aspectRatio={aspectRatio}
338306
showLabsRedesign={!!showLabsRedesign}
339-
isInAllBoostsTest={isInAllBoostsTest}
340307
/>
341308
);
342309
case 'scrollable/feature':

0 commit comments

Comments
 (0)