Merged in feat/SW-1577-activity-card (pull request #2517)

feat(SW-1577): activity card: add linking to collection page

* feat(SW-1577): add linking to collection page


Approved-by: Erik Tiekstra
This commit is contained in:
Matilda Landström
2025-07-04 07:38:18 +00:00
parent 55622f582c
commit c3279ec254
2 changed files with 23 additions and 2 deletions

View File

@@ -3,6 +3,7 @@
#import "../../Fragments/AccountPage/Ref.graphql" #import "../../Fragments/AccountPage/Ref.graphql"
#import "../../Fragments/CollectionPage/Ref.graphql" #import "../../Fragments/CollectionPage/Ref.graphql"
#import "../../Fragments/ContentPage/Ref.graphql"
#import "../../Fragments/Blocks/Accordion.graphql" #import "../../Fragments/Blocks/Accordion.graphql"
#import "../../Fragments/Blocks/Refs/Accordion.graphql" #import "../../Fragments/Blocks/Refs/Accordion.graphql"
@@ -59,6 +60,12 @@ query GetHotelPage($locale: String!, $uid: String!) {
preamble preamble
} }
} }
... on CollectionPage {
...CollectionPageLink
header {
preamble
}
}
} }
} }
} }
@@ -108,6 +115,7 @@ query GetHotelPageRefs($locale: String!, $uid: String!) {
edges { edges {
node { node {
__typename __typename
...CollectionPageRef
...ContentPageRef ...ContentPageRef
} }
} }

View File

@@ -4,7 +4,12 @@ import { removeMultipleSlashes } from "@scandic-hotels/common/utils/url"
import { HotelPageEnum } from "../../../../types/hotelPageEnum" import { HotelPageEnum } from "../../../../types/hotelPageEnum"
import { tempImageVaultAssetSchema } from "../imageVault" import { tempImageVaultAssetSchema } from "../imageVault"
import { contentPageRefSchema, contentPageSchema } from "../pageLinks" import {
collectionPageRefSchema,
collectionPageSchema,
contentPageRefSchema,
contentPageSchema,
} from "../pageLinks"
export const activitiesCardSchema = z.object({ export const activitiesCardSchema = z.object({
typename: z typename: z
@@ -29,6 +34,11 @@ export const activitiesCardSchema = z.object({
preamble: z.string(), preamble: z.string(),
}), }),
}), }),
collectionPageSchema.extend({
header: z.object({
preamble: z.string(),
}),
}),
]), ]),
}) })
), ),
@@ -67,7 +77,10 @@ export const activitiesCardRefSchema = z.object({
hotel_page_activities_content_pageConnection: z.object({ hotel_page_activities_content_pageConnection: z.object({
edges: z.array( edges: z.array(
z.object({ z.object({
node: z.discriminatedUnion("__typename", [contentPageRefSchema]), node: z.discriminatedUnion("__typename", [
contentPageRefSchema,
collectionPageRefSchema,
]),
}) })
), ),
}), }),