Merged in feat/SW-1450-destination-page-cs-components (pull request #1204)

feat(SW-1450): added components in destination pages from cs

* feat(SW-1450): added components in destination pages from cs

* feat(SW-1450): added correct refs and removed classNames


Approved-by: Fredrik Thorsson
This commit is contained in:
Erik Tiekstra
2025-01-24 12:06:43 +00:00
parent 7343d873c2
commit a88a033e30
45 changed files with 1237 additions and 195 deletions
@@ -20,11 +20,8 @@ import {
getDestinationCountryPageRefsSuccessCounter,
getDestinationCountryPageSuccessCounter,
} from "./telemetry"
import { generatePageTags } from "./utils"
import {
TrackingChannelEnum,
type TrackingSDKPageData,
} from "@/types/components/tracking"
import type {
GetDestinationCountryPageData,
GetDestinationCountryPageRefsSchema,
@@ -91,6 +88,8 @@ export const destinationCountryPageQueryRouter = router({
JSON.stringify({ query: { lang, uid } })
)
const tags = generatePageTags(validatedRefsData.data, lang)
getDestinationCountryPageCounter.add(1, { lang, uid: `${uid}` })
console.info(
"contentstack.destinationCountryPage start",
@@ -107,7 +106,7 @@ export const destinationCountryPageQueryRouter = router({
{
cache: "force-cache",
next: {
tags: [generateTag(lang, uid)],
tags,
},
}
)
@@ -158,23 +157,6 @@ export const destinationCountryPageQueryRouter = router({
})
)
const system = destinationCountryPage.data.destination_country_page.system
const tracking: TrackingSDKPageData = {
pageId: system.uid,
domainLanguage: lang,
publishDate: system.updated_at,
createDate: system.created_at,
channel: TrackingChannelEnum["destination-page"],
pageType: "staticcontentpage",
pageName: destinationCountryPage.data.trackingProps.url,
siteSections: destinationCountryPage.data.trackingProps.url,
siteVersion: "new-web",
}
return {
destinationCountryPage:
destinationCountryPage.data.destination_country_page,
tracking,
}
return destinationCountryPage.data
}),
})