feat(SW-962): remove open in new tab key
This commit is contained in:
@@ -19,7 +19,6 @@ export const activitiesCardSchema = z.object({
|
||||
body_text: z.string(),
|
||||
cta_text: z.string(),
|
||||
heading: z.string(),
|
||||
open_in_new_tab: z.boolean(),
|
||||
scripted_title: z.string().optional(),
|
||||
hotel_page_activities_content_pageConnection: z.object({
|
||||
edges: z.array(
|
||||
@@ -36,19 +35,20 @@ export const activitiesCardSchema = z.object({
|
||||
}),
|
||||
})
|
||||
.transform((data) => {
|
||||
let contentPage = { href: "" }
|
||||
let preamble = ""
|
||||
let contentPage = { href: "", preamble: "" }
|
||||
if (data.hotel_page_activities_content_pageConnection.edges.length) {
|
||||
const page =
|
||||
data.hotel_page_activities_content_pageConnection.edges[0].node
|
||||
preamble = page.header.preamble
|
||||
|
||||
if (page.web.original_url) {
|
||||
contentPage = {
|
||||
href: page.web.original_url,
|
||||
preamble: page.header.preamble,
|
||||
}
|
||||
} else {
|
||||
contentPage = {
|
||||
href: removeMultipleSlashes(`/${page.system.locale}/${page.url}`),
|
||||
preamble: page.header.preamble,
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -58,9 +58,7 @@ export const activitiesCardSchema = z.object({
|
||||
contentPage,
|
||||
ctaText: data.cta_text,
|
||||
heading: data.heading,
|
||||
openInNewTab: !!data.open_in_new_tab,
|
||||
scriptedTopTitle: data.scripted_title,
|
||||
preamble,
|
||||
}
|
||||
}),
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user