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