feat(BOOK-735): Removed video block from start page and collection page
Approved-by: Bianca Widstam
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user