Merged in fix/BOOK-755-alert-content (pull request #3523)
fix(BOOK-755, BOOK-787): Fixed issue for phone number and sidepeeks not showing * fix(BOOK-755): Fixed issue for phone number and sidepeeks not showing * fix(BOOK-755): fix issue phonenumber alert * fix(BOOK-755): fix issue phonenumber Approved-by: Matilda Landström
This commit is contained in:
committed by
Bianca Widstam
parent
b3c4761ae5
commit
0cda37808e
@@ -1,6 +1,5 @@
|
||||
import { gql } from "graphql-tag"
|
||||
|
||||
import { Alert } from "../Alert.graphql"
|
||||
import { ImageContainer } from "../ImageContainer.graphql"
|
||||
import { AccountPageLink } from "../PageLink/AccountPageLink.graphql"
|
||||
import { CampaignOverviewPageLink } from "../PageLink/CampaignOverviewPageLink.graphql"
|
||||
@@ -25,7 +24,6 @@ export const Content_ContentPage = gql`
|
||||
node {
|
||||
__typename
|
||||
...SysAsset
|
||||
...Alert
|
||||
...ImageContainer
|
||||
...AccountPageLink
|
||||
...CampaignOverviewPageLink
|
||||
@@ -47,7 +45,6 @@ export const Content_ContentPage = gql`
|
||||
}
|
||||
}
|
||||
${SysAsset}
|
||||
${Alert}
|
||||
${ImageContainer}
|
||||
${AccountPageLink}
|
||||
${CampaignOverviewPageLink}
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
import { z } from "zod"
|
||||
|
||||
import { BlocksEnums } from "../../../../types/blocksEnum"
|
||||
import { ContentEnum } from "../../../../types/content"
|
||||
import { alertSchema, transformAlertSchema } from "../alert"
|
||||
import { rawLinkUnionSchema, transformPageLink } from "../pageLinks"
|
||||
import { imageContainerSchema } from "./imageContainer"
|
||||
import { sysAssetSchema } from "./sysAsset"
|
||||
@@ -24,11 +22,7 @@ export const contentSchema = z.object({
|
||||
.discriminatedUnion("__typename", [
|
||||
imageContainerSchema,
|
||||
sysAssetSchema,
|
||||
alertSchema.merge(
|
||||
z.object({
|
||||
__typename: z.literal(ContentEnum.blocks.Alert),
|
||||
})
|
||||
),
|
||||
|
||||
...rawLinkUnionSchema.options,
|
||||
])
|
||||
.transform((data) => {
|
||||
@@ -36,12 +30,6 @@ export const contentSchema = z.object({
|
||||
if (link) {
|
||||
return link
|
||||
}
|
||||
if (data.__typename === ContentEnum.blocks.Alert) {
|
||||
return {
|
||||
__typename: data.__typename,
|
||||
...transformAlertSchema(data),
|
||||
}
|
||||
}
|
||||
return data
|
||||
}),
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user