feat(BOOK-735): Removed video block from start page and collection page
Approved-by: Bianca Widstam
This commit is contained in:
@@ -6,7 +6,6 @@ import CardsGrid from "@/components/Blocks/CardsGrid"
|
||||
import CarouselCards from "@/components/Blocks/CarouselCards"
|
||||
import FullWidthCampaign from "@/components/Blocks/FullWidthCampaign"
|
||||
import JoinScandicFriends from "@/components/Blocks/JoinScandicFriends"
|
||||
import { VideoBlock } from "@/components/Blocks/Video"
|
||||
import { VideoCardBlock } from "@/components/Blocks/VideoCard"
|
||||
|
||||
import styles from "./blocks.module.css"
|
||||
@@ -67,12 +66,6 @@ export function Blocks({ blocks }: BlocksProps) {
|
||||
/>
|
||||
</div>
|
||||
)
|
||||
case BlocksEnums.block.Video:
|
||||
return (
|
||||
<div key={`${block.typename}-${idx}`} className={styles.block}>
|
||||
<VideoBlock key={`${block.typename}-${idx}`} video={block.video} />
|
||||
</div>
|
||||
)
|
||||
default:
|
||||
return null
|
||||
}
|
||||
|
||||
@@ -12,26 +12,6 @@ export const Video_ContentPage = gql`
|
||||
${Video}
|
||||
`
|
||||
|
||||
export const Video_CollectionPage = gql`
|
||||
fragment Video_CollectionPage on CollectionPageBlocksVideo {
|
||||
__typename
|
||||
video {
|
||||
...Video
|
||||
}
|
||||
}
|
||||
${Video}
|
||||
`
|
||||
|
||||
export const Video_StartPage = gql`
|
||||
fragment Video_StartPage on StartPageBlocksVideo {
|
||||
__typename
|
||||
video {
|
||||
...Video
|
||||
}
|
||||
}
|
||||
${Video}
|
||||
`
|
||||
|
||||
export const Video_ContentPageRefs = gql`
|
||||
fragment Video_ContentPageRefs on ContentPageBlocksVideo {
|
||||
__typename
|
||||
@@ -41,23 +21,3 @@ export const Video_ContentPageRefs = gql`
|
||||
}
|
||||
${VideoRef}
|
||||
`
|
||||
|
||||
export const Video_CollectionPageRefs = gql`
|
||||
fragment Video_CollectionPageRefs on CollectionPageBlocksVideo {
|
||||
__typename
|
||||
video {
|
||||
...VideoRef
|
||||
}
|
||||
}
|
||||
${VideoRef}
|
||||
`
|
||||
|
||||
export const Video_StartPageRefs = gql`
|
||||
fragment Video_StartPageRefs on StartPageBlocksVideo {
|
||||
__typename
|
||||
video {
|
||||
...VideoRef
|
||||
}
|
||||
}
|
||||
${VideoRef}
|
||||
`
|
||||
|
||||
@@ -16,10 +16,6 @@ import {
|
||||
UspGrid_CollectionPage,
|
||||
UspGrid_CollectionPageRefs,
|
||||
} from "../../Fragments/Blocks/UspGrid.graphql"
|
||||
import {
|
||||
Video_CollectionPage,
|
||||
Video_CollectionPageRefs,
|
||||
} from "../../Fragments/Blocks/Video.graphql"
|
||||
import {
|
||||
VideoCard_CollectionPage,
|
||||
VideoCard_CollectionPageRefs,
|
||||
@@ -60,7 +56,6 @@ export const GetCollectionPage = gql`
|
||||
...UspGrid_CollectionPage
|
||||
...DynamicContent_CollectionPage
|
||||
...VideoCard_CollectionPage
|
||||
...Video_CollectionPage
|
||||
}
|
||||
system {
|
||||
...System
|
||||
@@ -81,7 +76,6 @@ export const GetCollectionPage = gql`
|
||||
${DynamicContent_CollectionPage}
|
||||
${VideoCard_CollectionPage}
|
||||
${Video}
|
||||
${Video_CollectionPage}
|
||||
`
|
||||
|
||||
export const GetCollectionPageRefs = gql`
|
||||
@@ -101,7 +95,6 @@ export const GetCollectionPageRefs = gql`
|
||||
...UspGrid_CollectionPageRefs
|
||||
...DynamicContent_CollectionPageRefs
|
||||
...VideoCard_CollectionPageRefs
|
||||
...Video_CollectionPageRefs
|
||||
}
|
||||
system {
|
||||
...System
|
||||
@@ -117,7 +110,6 @@ export const GetCollectionPageRefs = gql`
|
||||
${DynamicContent_CollectionPageRefs}
|
||||
${VideoRef}
|
||||
${VideoCard_CollectionPageRefs}
|
||||
${Video_CollectionPageRefs}
|
||||
`
|
||||
|
||||
export const GetDaDeEnUrlsCollectionPage = gql`
|
||||
|
||||
@@ -16,10 +16,6 @@ import {
|
||||
JoinScandicFriends_StartPage,
|
||||
JoinScandicFriends_StartPageRefs,
|
||||
} from "../../Fragments/Blocks/JoinScandicFriends.graphql"
|
||||
import {
|
||||
Video_StartPage,
|
||||
Video_StartPageRefs,
|
||||
} from "../../Fragments/Blocks/Video.graphql"
|
||||
import {
|
||||
VideoCard_StartPage,
|
||||
VideoCard_StartPageRefs,
|
||||
@@ -53,7 +49,6 @@ export const GetStartPage = gql`
|
||||
}
|
||||
...JoinScandicFriends_StartPage
|
||||
...VideoCard_StartPage
|
||||
...Video_StartPage
|
||||
}
|
||||
system {
|
||||
...System
|
||||
@@ -71,7 +66,6 @@ export const GetStartPage = gql`
|
||||
${CarouselCards_StartPage}
|
||||
${JoinScandicFriends_StartPage}
|
||||
${VideoCard_StartPage}
|
||||
${Video_StartPage}
|
||||
`
|
||||
|
||||
export const GetStartPageRefs = gql`
|
||||
@@ -94,7 +88,6 @@ export const GetStartPageRefs = gql`
|
||||
}
|
||||
...JoinScandicFriends_StartPageRefs
|
||||
...VideoCard_StartPageRefs
|
||||
...Video_StartPageRefs
|
||||
}
|
||||
system {
|
||||
...System
|
||||
@@ -107,7 +100,6 @@ export const GetStartPageRefs = gql`
|
||||
${CarouselCards_StartPageRefs}
|
||||
${JoinScandicFriends_StartPageRefs}
|
||||
${VideoCard_StartPageRefs}
|
||||
${Video_StartPageRefs}
|
||||
`
|
||||
|
||||
export const GetDaDeEnUrlsStartPage = gql`
|
||||
|
||||
@@ -17,7 +17,6 @@ import {
|
||||
shortcutsSchema,
|
||||
} from "../schemas/blocks/shortcuts"
|
||||
import { uspGridRefsSchema, uspGridSchema } from "../schemas/blocks/uspGrid"
|
||||
import { videoBlockRefsSchema, videoBlockSchema } from "../schemas/blocks/video"
|
||||
import {
|
||||
videoCardRefsSchema,
|
||||
videoCardSchema,
|
||||
@@ -63,19 +62,12 @@ export const collectionPageVideoCard = z
|
||||
})
|
||||
.merge(videoCardSchema)
|
||||
|
||||
export const collectionPageVideo = z
|
||||
.object({
|
||||
__typename: z.literal(CollectionPageEnum.ContentStack.blocks.Video),
|
||||
})
|
||||
.merge(videoBlockSchema)
|
||||
|
||||
export const blocksSchema = z.discriminatedUnion("__typename", [
|
||||
collectionPageCards,
|
||||
collectionPageDynamicContent,
|
||||
collectionPageShortcuts,
|
||||
collectionPageUspGrid,
|
||||
collectionPageVideoCard,
|
||||
collectionPageVideo,
|
||||
])
|
||||
|
||||
const navigationLinksSchema = z
|
||||
@@ -158,19 +150,12 @@ const collectionPageVideoCardRefs = z
|
||||
})
|
||||
.merge(videoCardRefsSchema)
|
||||
|
||||
const collectionPageVideoRefs = z
|
||||
.object({
|
||||
__typename: z.literal(CollectionPageEnum.ContentStack.blocks.Video),
|
||||
})
|
||||
.merge(videoBlockRefsSchema)
|
||||
|
||||
const collectionPageBlockRefsItem = z.discriminatedUnion("__typename", [
|
||||
collectionPageShortcutsRefs,
|
||||
collectionPageDynamicContentRefs,
|
||||
collectionPageCardsRefs,
|
||||
collectionPageUspGridRefs,
|
||||
collectionPageVideoCardRefs,
|
||||
collectionPageVideoRefs,
|
||||
])
|
||||
|
||||
const collectionPageHeaderRefs = z.object({
|
||||
|
||||
@@ -114,11 +114,6 @@ export function getConnectionsFromAssets({
|
||||
)
|
||||
}
|
||||
break
|
||||
case CollectionPageEnum.ContentStack.blocks.Video:
|
||||
if (block.video?.sourceConnection.edges[0]) {
|
||||
connections.push(block.video.sourceConnection.edges[0].node.system)
|
||||
}
|
||||
break
|
||||
default:
|
||||
break
|
||||
}
|
||||
@@ -155,7 +150,6 @@ export function getConnections({ collection_page }: CollectionPageRefs) {
|
||||
}
|
||||
break
|
||||
case CollectionPageEnum.ContentStack.blocks.DynamicContent:
|
||||
case CollectionPageEnum.ContentStack.blocks.Video:
|
||||
break
|
||||
default:
|
||||
const _exhaustiveCheck: never = typeName
|
||||
|
||||
@@ -19,7 +19,6 @@ import {
|
||||
joinScandicFriendsBlockRefsSchema,
|
||||
joinScandicFriendsBlockSchema,
|
||||
} from "../schemas/blocks/joinScandicFriends"
|
||||
import { videoBlockRefsSchema, videoBlockSchema } from "../schemas/blocks/video"
|
||||
import {
|
||||
videoCardRefsSchema,
|
||||
videoCardSchema,
|
||||
@@ -57,19 +56,12 @@ const startPageVideoCard = z
|
||||
})
|
||||
.merge(videoCardSchema)
|
||||
|
||||
const startPageVideo = z
|
||||
.object({
|
||||
__typename: z.literal(StartPageEnum.ContentStack.blocks.Video),
|
||||
})
|
||||
.merge(videoBlockSchema)
|
||||
|
||||
export const blocksSchema = z.discriminatedUnion("__typename", [
|
||||
startPageCards,
|
||||
startPageFullWidthCampaign,
|
||||
startPageCarouselCards,
|
||||
startPageJoinScandicFriends,
|
||||
startPageVideoCard,
|
||||
startPageVideo,
|
||||
])
|
||||
|
||||
export const startPageSchema = z.object({
|
||||
@@ -125,19 +117,12 @@ const startPageVideoCardRef = z
|
||||
})
|
||||
.merge(videoCardRefsSchema)
|
||||
|
||||
const startPageVideoRef = z
|
||||
.object({
|
||||
__typename: z.literal(StartPageEnum.ContentStack.blocks.Video),
|
||||
})
|
||||
.merge(videoBlockRefsSchema)
|
||||
|
||||
const startPageBlockRefsItem = z.discriminatedUnion("__typename", [
|
||||
startPageCardsRefs,
|
||||
startPageFullWidthCampaignRef,
|
||||
startPageCarouselCardsRef,
|
||||
startPageJoinScandicFriendsRef,
|
||||
startPageVideoCardRef,
|
||||
startPageVideoRef,
|
||||
])
|
||||
|
||||
export const startPageRefsSchema = z.object({
|
||||
|
||||
@@ -11,7 +11,6 @@ export namespace StartPageEnum {
|
||||
FullWidthCampaign = "StartPageBlocksFullWidthCampaign",
|
||||
JoinScandicFriends = "StartPageBlocksJoinScandicFriends",
|
||||
VideoCard = "StartPageBlocksVideoCard",
|
||||
Video = "StartPageBlocksVideo",
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -31,11 +30,6 @@ export function getConnectionsFromAssets({ start_page }: StartPageRefs) {
|
||||
)
|
||||
}
|
||||
break
|
||||
case StartPageEnum.ContentStack.blocks.Video:
|
||||
if (block.video?.sourceConnection.edges[0]) {
|
||||
connections.push(block.video.sourceConnection.edges[0].node.system)
|
||||
}
|
||||
break
|
||||
default:
|
||||
break
|
||||
}
|
||||
@@ -83,8 +77,6 @@ export function getConnections({ start_page }: StartPageRefs) {
|
||||
}
|
||||
break
|
||||
}
|
||||
case StartPageEnum.ContentStack.blocks.Video:
|
||||
break
|
||||
default:
|
||||
const _exhaustiveCheck: never = typeName
|
||||
break
|
||||
|
||||
@@ -30,7 +30,6 @@ export namespace CollectionPageEnum {
|
||||
Shortcuts = "CollectionPageBlocksShortcuts",
|
||||
UspGrid = "CollectionPageBlocksUspGrid",
|
||||
VideoCard = "CollectionPageBlocksVideoCard",
|
||||
Video = "CollectionPageBlocksVideo",
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user