fix(SW-3305): Added preamble to carousel cards block
Approved-by: Matilda Landström Approved-by: Chuma Mcphoy (We Ahead)
This commit is contained in:
@@ -105,6 +105,7 @@ fragment CarouselCards_StartPageRefs on StartPageBlocksCarouselCards {
|
||||
fragment CarouselCards_CampaignPage on CampaignPageBlocksCarouselCards {
|
||||
carousel_cards {
|
||||
heading
|
||||
preamble
|
||||
enable_filters
|
||||
card_groups {
|
||||
filter_label
|
||||
|
||||
@@ -11,6 +11,7 @@ import { linkConnectionRefsSchema } from "./utils/linkConnection"
|
||||
|
||||
const commonFields = {
|
||||
heading: z.string().optional(),
|
||||
preamble: z.string().nullish(),
|
||||
link: buttonSchema.nullish(),
|
||||
} as const
|
||||
|
||||
@@ -103,6 +104,7 @@ export const carouselCardsSchema = z.object({
|
||||
if (!data.enable_filters) {
|
||||
return {
|
||||
heading: data.heading,
|
||||
preamble: data.preamble,
|
||||
enableFilters: false,
|
||||
filterCategories: [],
|
||||
cards: data.card_groups.map((group) => group.cards).flat(),
|
||||
@@ -121,6 +123,7 @@ export const carouselCardsSchema = z.object({
|
||||
|
||||
return {
|
||||
heading: data.heading,
|
||||
preamble: data.preamble,
|
||||
enableFilters: true,
|
||||
filterCategories,
|
||||
cards: data.card_groups.map((group) => group.cards).flat(),
|
||||
|
||||
Reference in New Issue
Block a user