Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert "Refactor YoutubeAtom so it does not rely on an external elementId" #10248

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions dotcom-rendering/fixtures/generated/articles/Dead.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1974,6 +1974,7 @@ export const Dead: DCRArticle = {
],
expired: false,
duration: 142,
elementId: '61b9e0cb-6602-4ccb-bda6-a6d6c3f2eae0',
},
],
attributes: {
Expand Down
1 change: 1 addition & 0 deletions dotcom-rendering/fixtures/generated/articles/Feature.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1455,6 +1455,7 @@ export const Feature: DCRArticle = {
duration: 207,
altText:
"Press Room - 92nd Academy Awards<br>epa08208148 Joaquin Phoenix poses in the press room with the Oscar for Best Actor for his performance in 'Joker' during the 92nd annual Academy Awards ceremony at the Dolby Theatre in Hollywood, California, USA, 09 February 2020. The Oscars are presented for outstanding individual or collective efforts in filmmaking in 24 categories. EPA/DAVID SWANSON",
elementId: 'c7aded24-44a0-42fb-bf42-94d2559c0a25',
},
],
canonicalUrl:
Expand Down
1 change: 1 addition & 0 deletions dotcom-rendering/fixtures/generated/articles/Live.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1974,6 +1974,7 @@ export const Live: DCRArticle = {
],
expired: false,
duration: 142,
elementId: '93a2d182-3d98-4319-9a8b-602e4adff560',
},
],
attributes: {
Expand Down
4 changes: 2 additions & 2 deletions dotcom-rendering/fixtures/manual/trails.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ export const trails: [
showQuotedHeadline: false,
mainMedia: {
type: 'Video',
id: 'abcdef',
elementId: 'abcdef',
videoId: 'abcd',
title: 'some title',
duration: 378,
Expand Down Expand Up @@ -527,7 +527,7 @@ export const trails: [
],
mainMedia: {
type: 'Video',
id: 'abcdef',
elementId: 'abcdef',
videoId: 'abcd',
title: 'some title',
duration: 378,
Expand Down
2 changes: 1 addition & 1 deletion dotcom-rendering/src/components/Card/Card.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ const aBasicLink = {

const mainVideo: MainMedia = {
type: 'Video',
id: '1234-abcdef-09876-xyz',
elementId: '1234-abcdef-09876-xyz',
videoId: '8M_yH-e9cq8',
title: '’I care, but I don’t care’: Life after the Queen’s death | Anywhere but Westminster',
expired: false,
Expand Down
5 changes: 4 additions & 1 deletion dotcom-rendering/src/components/Card/Card.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -473,7 +473,10 @@ export const Card = ({
defer={{ until: 'visible' }}
>
<YoutubeBlockComponent
id={media.mainMedia.id}
id={media.mainMedia.elementId}
elementId={
media.mainMedia.elementId
}
assetId={
media.mainMedia.videoId
}
Expand Down
2 changes: 1 addition & 1 deletion dotcom-rendering/src/components/Elements.amp.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,7 @@ export const Elements = (
case 'model.dotcomrendering.pageElements.YoutubeBlockElement':
return (
<YoutubeBlockComponent
key={element.id}
key={element.elementId}
element={element}
pillar={pillar}
adTargeting={adTargeting}
Expand Down
1 change: 1 addition & 0 deletions dotcom-rendering/src/components/LiveBlock.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@ export const Video = () => {
},
{
duration: 142,
elementId: '27eac530-7088-4541-a1c5-3347a3d837fb',
expired: false,
mediaTitle:
'Nasa launches Perseverance rover in mission to find evidence of life on Mars – video',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ export const NoConsent = (): JSX.Element => {
return (
<div style={containerStyle}>
<YoutubeAtom
index={123}
elementId="xyz"
videoId="-ZCvZmYlQD8"
alt=""
eventEmitters={[
Expand Down Expand Up @@ -83,7 +83,7 @@ export const NoOverlay = (): JSX.Element => {
return (
<div style={containerStyle}>
<YoutubeAtom
index={123}
elementId="xyz"
videoId="-ZCvZmYlQD8"
alt=""
eventEmitters={[
Expand Down Expand Up @@ -118,7 +118,7 @@ export const WithOverrideImage = (): JSX.Element => {
<div style={containerStyle}>
<OverlayAutoplayExplainer />
<YoutubeAtom
index={123}
elementId="xyz"
videoId="3jpXAMwRSu4"
alt="Microscopic image of COVID"
eventEmitters={[
Expand Down Expand Up @@ -150,7 +150,7 @@ export const WithPosterImage = (): JSX.Element => {
<div style={containerStyle}>
<OverlayAutoplayExplainer />
<YoutubeAtom
index={123}
elementId="xyz"
videoId="N9Cgy-ke5-s"
alt=""
eventEmitters={[
Expand Down Expand Up @@ -185,7 +185,7 @@ export const WithOverlayAndPosterImage = (): JSX.Element => {
<div style={containerStyle}>
<OverlayAutoplayExplainer />
<YoutubeAtom
index={123}
elementId="xyz"
videoId="N9Cgy-ke5-s"
alt=""
eventEmitters={[
Expand Down Expand Up @@ -224,7 +224,7 @@ export const GiveConsent = (): JSX.Element => {
<button onClick={() => setConsented(true)}>Give consent</button>
<div style={containerStyle}>
<YoutubeAtom
index={123}
elementId="xyz"
videoId="3jpXAMwRSu4"
alt="Microscopic image of COVID"
eventEmitters={[
Expand Down Expand Up @@ -258,7 +258,7 @@ export const Sticky = (): JSX.Element => {
<div>Scroll down...</div>
<div style={{ height: '1000px' }}></div>
<YoutubeAtom
index={123}
elementId="xyz"
videoId="-ZCvZmYlQD8"
alt=""
eventEmitters={[
Expand Down Expand Up @@ -292,7 +292,7 @@ export const StickyMainMedia = (): JSX.Element => {
<div>Scroll down...</div>
<div style={{ height: '1000px' }}></div>
<YoutubeAtom
index={123}
elementId="xyz"
videoId="-ZCvZmYlQD8"
alt=""
eventEmitters={[
Expand Down Expand Up @@ -328,7 +328,7 @@ export const DuplicateVideos = (): JSX.Element => {
return (
<div style={containerStyleSmall}>
<YoutubeAtom
index={123}
elementId="xyz"
videoId="-ZCvZmYlQD8"
alt=""
eventEmitters={[
Expand All @@ -350,7 +350,7 @@ export const DuplicateVideos = (): JSX.Element => {
/>
<br />
<YoutubeAtom
index={345}
elementId="xyz2"
videoId="-ZCvZmYlQD8"
alt=""
eventEmitters={[
Expand Down Expand Up @@ -388,7 +388,7 @@ export const MultipleStickyVideos = (): JSX.Element => {
return (
<div style={{ width: '500px', height: '5000px' }}>
<YoutubeAtom
index={123}
elementId="xyz"
videoId="-ZCvZmYlQD8"
alt=""
eventEmitters={[
Expand All @@ -411,7 +411,7 @@ export const MultipleStickyVideos = (): JSX.Element => {
adTargeting={adTargeting}
/>
<YoutubeAtom
index={456}
elementId="xyz-2"
videoId="pcMiS6PW8aQ"
alt=""
eventEmitters={[
Expand All @@ -434,7 +434,7 @@ export const MultipleStickyVideos = (): JSX.Element => {
adTargeting={adTargeting}
/>
<YoutubeAtom
index={789}
elementId="xyu"
videoId="3jpXAMwRSu4"
alt=""
eventEmitters={[
Expand Down Expand Up @@ -469,7 +469,7 @@ export const PausesOffscreen = (): JSX.Element => {
<div>
<div>Scroll down...</div>
<YoutubeAtom
index={123}
elementId="xyz"
videoId="-ZCvZmYlQD8"
alt=""
eventEmitters={[
Expand Down Expand Up @@ -506,7 +506,7 @@ export const NoConsentWithIma = (): JSX.Element => {
return (
<div style={containerStyle}>
<YoutubeAtom
index={123}
elementId="xyz"
videoId="-ZCvZmYlQD8"
alt=""
eventEmitters={[
Expand Down Expand Up @@ -534,7 +534,7 @@ export const AdFreeWithIma = (): JSX.Element => {
return (
<div style={containerStyle}>
<YoutubeAtom
index={123}
elementId="xyz"
videoId="-ZCvZmYlQD8"
alt=""
eventEmitters={[
Expand Down Expand Up @@ -563,7 +563,7 @@ export const NoOverlayWithIma = (): JSX.Element => {
return (
<div style={containerStyle}>
<YoutubeAtom
index={123}
elementId="xyz"
videoId="-ZCvZmYlQD8"
alt=""
eventEmitters={[
Expand Down Expand Up @@ -593,7 +593,7 @@ export const WithOverrideImageWithIma = (): JSX.Element => {
return (
<div style={containerStyle}>
<YoutubeAtom
index={123}
elementId="xyz"
videoId="3jpXAMwRSu4"
alt="Microscopic image of COVID"
eventEmitters={[
Expand Down Expand Up @@ -622,7 +622,7 @@ export const WithPosterImageWithIma = (): JSX.Element => {
return (
<div style={containerStyle}>
<YoutubeAtom
index={123}
elementId="xyz"
videoId="N9Cgy-ke5-s"
alt=""
eventEmitters={[
Expand Down Expand Up @@ -653,7 +653,7 @@ export const WithOverlayAndPosterImageWithIma = (): JSX.Element => {
return (
<div style={containerStyle}>
<YoutubeAtom
index={123}
elementId="xyz"
videoId="N9Cgy-ke5-s"
alt=""
eventEmitters={[
Expand Down Expand Up @@ -688,7 +688,7 @@ export const GiveConsentWithIma = (): JSX.Element => {
<button onClick={() => setConsented(true)}>Give consent</button>
<div style={containerStyle}>
<YoutubeAtom
index={123}
elementId="xyz"
videoId="3jpXAMwRSu4"
alt="Microscopic image of COVID"
eventEmitters={[
Expand Down Expand Up @@ -722,7 +722,7 @@ export const StickyWithIma = (): JSX.Element => {
<div style={{ fontSize: '36px' }}>⬇️</div>
<div style={{ height: '1000px' }}></div>
<YoutubeAtom
index={123}
elementId="xyz"
videoId="-ZCvZmYlQD8"
alt=""
eventEmitters={[
Expand Down Expand Up @@ -755,7 +755,7 @@ export const StickyMainMediaWithIma = (): JSX.Element => {
<div style={{ fontSize: '36px' }}>⬇️</div>
<div style={{ height: '1000px' }}></div>
<YoutubeAtom
index={123}
elementId="xyz"
videoId="-ZCvZmYlQD8"
alt=""
eventEmitters={[
Expand Down Expand Up @@ -786,7 +786,7 @@ export const DuplicateVideosWithIma = (): JSX.Element => {
return (
<div style={containerStyleSmall}>
<YoutubeAtom
index={123}
elementId="xyz"
videoId="-ZCvZmYlQD8"
alt=""
eventEmitters={[
Expand All @@ -808,7 +808,7 @@ export const DuplicateVideosWithIma = (): JSX.Element => {
/>
<br />
<YoutubeAtom
index={345}
elementId="xyz2"
videoId="-ZCvZmYlQD8"
alt=""
eventEmitters={[
Expand Down Expand Up @@ -840,7 +840,7 @@ export const MultipleStickyVideosWithIma = (): JSX.Element => {
return (
<div style={{ width: '500px', height: '5000px' }}>
<YoutubeAtom
index={123}
elementId="xyz"
videoId="-ZCvZmYlQD8"
alt=""
eventEmitters={[
Expand All @@ -863,7 +863,7 @@ export const MultipleStickyVideosWithIma = (): JSX.Element => {
abTestParticipations={{}}
/>
<YoutubeAtom
index={456}
elementId="xyz-2"
videoId="pcMiS6PW8aQ"
alt=""
eventEmitters={[
Expand All @@ -886,7 +886,7 @@ export const MultipleStickyVideosWithIma = (): JSX.Element => {
abTestParticipations={{}}
/>
<YoutubeAtom
index={789}
elementId="xyu"
videoId="3jpXAMwRSu4"
alt=""
eventEmitters={[
Expand Down
Loading
Loading