Skip to content

Commit bce9042

Browse files
authored
Merge pull request #13407 from guardian/revert-13344-mob/video-spike
Revert "Display test loop video container when in 0% AB test"
2 parents d415974 + d189fb7 commit bce9042

File tree

8 files changed

+10
-134
lines changed

8 files changed

+10
-134
lines changed

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

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,6 @@ export type Props = {
150150
trailTextSize?: TrailTextSize;
151151
/** A kicker image is seperate to the main media and renders as part of the kicker */
152152
showKickerImage?: boolean;
153-
isInLoopVideoTest?: boolean;
154153
};
155154

156155
const starWrapper = (cardHasImage: boolean) => css`
@@ -411,7 +410,6 @@ export const Card = ({
411410
showTopBarMobile = false,
412411
trailTextSize,
413412
showKickerImage = false,
414-
isInLoopVideoTest = false,
415413
}: Props) => {
416414
const hasSublinks = supportingContent && supportingContent.length > 0;
417415
const sublinkPosition = decideSublinkPosition(
@@ -829,7 +827,6 @@ export const Card = ({
829827
media.type === 'slideshow' && isFlexibleContainer
830828
}
831829
padImage={isMediaCardOrNewsletter && isBetaContainer}
832-
isInLoopVideoTest={isInLoopVideoTest}
833830
>
834831
{media.type === 'slideshow' &&
835832
(isFlexibleContainer ? (
@@ -996,7 +993,6 @@ export const Card = ({
996993
loading={imageLoading}
997994
roundedCorners={isOnwardContent}
998995
aspectRatio={aspectRatio}
999-
isInLoopVideoTest={isInLoopVideoTest}
1000996
/>
1001997
{(isVideoMainMedia ||
1002998
(isVideoArticle && !isBetaContainer)) &&

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

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ type Props = {
4242
*/
4343
hideImageOverlay?: boolean;
4444
padImage?: boolean;
45-
isInLoopVideoTest?: boolean;
4645
};
4746

4847
/**
@@ -129,13 +128,11 @@ export const ImageWrapper = ({
129128
imagePositionOnMobile,
130129
hideImageOverlay,
131130
padImage,
132-
isInLoopVideoTest = false,
133131
}: Props) => {
134132
const isHorizontalOnDesktop =
135133
imagePositionOnDesktop === 'left' || imagePositionOnDesktop === 'right';
136134
const isHorizontalOnMobile =
137135
imagePositionOnMobile === 'left' || imagePositionOnMobile === 'right';
138-
139136
return (
140137
<div
141138
css={[
@@ -182,8 +179,7 @@ export const ImageWrapper = ({
182179
{children}
183180
{/* This image overlay is styled when the CardLink is hovered */}
184181
{(imageType === 'picture' || imageType === 'slideshow') &&
185-
!hideImageOverlay &&
186-
!isInLoopVideoTest && <div className="image-overlay" />}
182+
!hideImageOverlay && <div className="image-overlay" />}
187183
</>
188184
</div>
189185
);

dotcom-rendering/src/components/CardPicture.tsx

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import type { ImgHTMLAttributes } from 'react';
44
import React from 'react';
55
import type { AspectRatio } from '../types/front';
66
import type { ImageSizeType } from './Card/components/ImageWrapper';
7-
import { LoopVideoABTest } from './LoopVideoABTest';
87
import type { ImageWidthType } from './Picture';
98
import { generateSources, getFallbackSource } from './Picture';
109

@@ -18,7 +17,6 @@ type Props = {
1817
roundedCorners?: boolean;
1918
isCircular?: boolean;
2019
aspectRatio?: AspectRatio;
21-
isInLoopVideoTest?: boolean;
2220
};
2321

2422
/**
@@ -157,7 +155,6 @@ export const CardPicture = ({
157155
roundedCorners,
158156
isCircular,
159157
aspectRatio,
160-
isInLoopVideoTest = false,
161158
}: Props) => {
162159
const sources = generateSources(
163160
mainImage,
@@ -167,10 +164,6 @@ export const CardPicture = ({
167164

168165
const fallbackSource = getFallbackSource(sources);
169166

170-
if (isInLoopVideoTest) {
171-
return <LoopVideoABTest />;
172-
}
173-
174167
return (
175168
<picture
176169
data-size={imageSize}

dotcom-rendering/src/components/FrontCard.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,6 @@ export const FrontCard = (props: Props) => {
5757
slideshowImages: trail.slideshowImages,
5858
showLivePlayable: trail.showLivePlayable,
5959
showMainVideo: trail.showMainVideo,
60-
isInLoopVideoTest: trail.isInLoopVideoTest,
6160
};
6261

6362
return Card({ ...defaultProps, ...cardProps });

dotcom-rendering/src/components/LoopVideoABTest.tsx

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

dotcom-rendering/src/layouts/FrontLayout.tsx

Lines changed: 9 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ import {
4343
getMobileAdPositions,
4444
} from '../lib/getFrontsAdPositions';
4545
import { hideAge } from '../lib/hideAge';
46-
import { testVideoCollection } from '../lib/loop-video-ab-test-data';
4746
import { ophanComponentId } from '../lib/ophan-helpers';
4847
import type { NavType } from '../model/extract-nav';
4948
import { palette as schemePalette } from '../palette';
@@ -109,13 +108,7 @@ const decideLeftContent = (
109108

110109
export const FrontLayout = ({ front, NAV }: Props) => {
111110
const {
112-
config: {
113-
abTests,
114-
hasPageSkin: hasPageSkinConfig,
115-
isPaidContent,
116-
isPreview,
117-
pageId,
118-
},
111+
config: { isPaidContent, hasPageSkin: hasPageSkinConfig, pageId },
119112
editionId,
120113
} = front;
121114

@@ -125,18 +118,9 @@ export const FrontLayout = ({ front, NAV }: Props) => {
125118

126119
const hasPageSkin = renderAds && hasPageSkinConfig;
127120

128-
const isInLoopVideoTest = abTests.loopVideoTestVariant === 'variant';
129-
130-
const filteredCollections = isInLoopVideoTest
131-
? [
132-
testVideoCollection,
133-
...front.pressedPage.collections.filter(
134-
(collection) => !isHighlights(collection),
135-
),
136-
]
137-
: front.pressedPage.collections.filter(
138-
(collection) => !isHighlights(collection),
139-
);
121+
const filteredCollections = front.pressedPage.collections.filter(
122+
(collection) => !isHighlights(collection),
123+
);
140124

141125
const merchHighAdPosition = getMerchHighPosition(filteredCollections);
142126

@@ -153,6 +137,8 @@ export const FrontLayout = ({ front, NAV }: Props) => {
153137

154138
const contributionsServiceUrl = getContributionsServiceUrl(front);
155139

140+
const { abTests, isPreview } = front.config;
141+
156142
const { absoluteServerTimes = false } = front.config.switches;
157143

158144
const fallbackAspectRatio = (collectionType: DCRContainerType) => {
@@ -286,13 +272,9 @@ export const FrontLayout = ({ front, NAV }: Props) => {
286272
)}
287273
{filteredCollections.map((collection, index) => {
288274
// Backfills should be added to the end of any curated content
289-
const trails = collection.curated
290-
.concat(collection.backfill)
291-
.map((tr) => ({
292-
...tr,
293-
isInLoopVideoTest: isInLoopVideoTest && index === 0,
294-
}));
295-
275+
const trails = collection.curated.concat(
276+
collection.backfill,
277+
);
296278
const [trail] = trails;
297279

298280
// There are some containers that have zero trails. We don't want to render these

dotcom-rendering/src/lib/loop-video-ab-test-data.ts

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

dotcom-rendering/src/types/front.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -351,7 +351,6 @@ export type DCRFrontCard = {
351351
branding?: Branding;
352352
slideshowImages?: DCRSlideshowImage[];
353353
showMainVideo?: boolean;
354-
isInLoopVideoTest?: boolean;
355354
};
356355

357356
export type DCRSlideshowImage = {

0 commit comments

Comments
 (0)