From 99daab87890915b6c19007d814438400aa71dd21 Mon Sep 17 00:00:00 2001 From: Stephanie Smith Date: Fri, 6 Dec 2024 10:46:57 -0500 Subject: [PATCH] fix: allowing hero videos to be inline on news pages (#712) * allowing hero videos to be inline on news pages * switching logic from show to hideShareLinks * Revert "switching logic from show to hideShareLinks" This reverts commit 2f362a524f1e2986c4ddb4d8b8e4db45c6d8be29. * fixing BlockVideo import, adding autplay property to video data --- .../PageNewsDetail/PageNewsDetail.stories.js | 3 ++- .../templates/PageNewsDetail/PageNewsDetail.vue | 17 +++++++---------- 2 files changed, 9 insertions(+), 11 deletions(-) diff --git a/packages/vue/src/templates/PageNewsDetail/PageNewsDetail.stories.js b/packages/vue/src/templates/PageNewsDetail/PageNewsDetail.stories.js index e6030c96..5b67c1d6 100644 --- a/packages/vue/src/templates/PageNewsDetail/PageNewsDetail.stories.js +++ b/packages/vue/src/templates/PageNewsDetail/PageNewsDetail.stories.js @@ -116,7 +116,8 @@ export const HeroVideo = { blockType: 'VideoBlock', video: BaseVideoData, caption: 'Lorem ipsum dolor sit amet', - credit: 'NASA/JPL' + credit: 'NASA/JPL', + autoplay: true } ] } diff --git a/packages/vue/src/templates/PageNewsDetail/PageNewsDetail.vue b/packages/vue/src/templates/PageNewsDetail/PageNewsDetail.vue index adbc040f..b395e96f 100644 --- a/packages/vue/src/templates/PageNewsDetail/PageNewsDetail.vue +++ b/packages/vue/src/templates/PageNewsDetail/PageNewsDetail.vue @@ -176,7 +176,7 @@ import BlockImageStandard from './../../components/BlockImage/BlockImageStandard import BlockLinkCarousel from './../../components/BlockLinkCarousel/BlockLinkCarousel.vue' import ShareButtons from './../../components/ShareButtons/ShareButtons.vue' import BlockText from './../../components/BlockText/BlockText.vue' -import BlockVideo from './../../components/BlockText/BlockText.vue' +import BlockVideo from './../../components/BlockVideo/BlockVideo.vue' export default defineComponent({ name: 'PageNewsDetail', @@ -207,16 +207,13 @@ export default defineComponent({ return (this.data?.hero || []).length === 0 }, heroInline(): boolean { - if (!this.heroEmpty) { - if (this.data?.hero[0].blockType === 'VideoBlock') { - return false - } else if ( - this.data?.heroPosition === 'inline' || + if ( + !this.heroEmpty && + (this.data?.heroPosition === 'inline' || this.data?.hero[0].blockType === 'CarouselBlock' || - this.data?.hero[0].blockType === 'VideoEmbedBlock' - ) { - return true - } + this.data?.hero[0].blockType === 'VideoEmbedBlock') + ) { + return true } return false },