Merged in feat/SW-286-collectionPage (pull request #765)

Feat(SW-286): CollectionPage

Approved-by: Erik Tiekstra
Approved-by: Fredrik Thorsson
This commit is contained in:
Matilda Landström
2024-11-04 12:10:51 +00:00
parent dabdd597e2
commit d5efaa686c
45 changed files with 918 additions and 35 deletions

View File

@@ -1,4 +1,4 @@
import { CardsGrid } from "@/types/trpc/routers/contentstack/blocks"
import type { CardsGrid } from "@/types/trpc/routers/contentstack/blocks"
export interface CardsGridProps extends Pick<CardsGrid, "cards_grid"> {
firstItem?: boolean

View File

@@ -1,8 +1,13 @@
import type { Block as AccountPageBlock } from "@/types/trpc/routers/contentstack/accountPage"
import type { Block as CollectionPageBlock } from "@/types/trpc/routers/contentstack/collectionPage"
import type { Block as ContentPageBlock } from "@/types/trpc/routers/contentstack/contentPage"
import type { Block as LoyaltyPageBlock } from "@/types/trpc/routers/contentstack/loyaltyPage"
export type Blocks = AccountPageBlock | ContentPageBlock | LoyaltyPageBlock
export type Blocks =
| AccountPageBlock
| CollectionPageBlock
| ContentPageBlock
| LoyaltyPageBlock
export interface BlocksProps {
blocks: Blocks[]

View File

@@ -5,6 +5,7 @@ import type { Lang } from "@/constants/languages"
export enum TrackingChannelEnum {
"scandic-friends" = "scandic-friends",
"static-content-page" = "static-content-page",
"collection-page" = "collection-page",
}
export type TrackingChannel = keyof typeof TrackingChannelEnum

View File

@@ -0,0 +1,9 @@
export namespace CollectionPageEnum {
export namespace ContentStack {
export const enum blocks {
CardsGrid = "CollectionPageBlocksCardsGrid",
Shortcuts = "CollectionPageBlocksShortcuts",
UspGrid = "CollectionPageBlocksUspGrid",
}
}
}

View File

@@ -1,6 +1,7 @@
export namespace ContentEnum {
export const enum blocks {
AccountPage = "AccountPage",
CollectionPage = "CollectionPage",
ContentPage = "ContentPage",
HotelPage = "HotelPage",
ImageContainer = "ImageContainer",

View File

@@ -0,0 +1,9 @@
export enum scriptedCardThemeEnum {
one = "one",
two = "two",
three = "three",
primaryDim = "primaryDim",
primaryDark = "primaryDark",
primaryInverted = "primaryInverted",
primaryStrong = "primaryStrong",
}

View File

@@ -17,7 +17,11 @@ export type StatusParams = {
}
export type ContentTypeParams = {
contentType: "loyalty-page" | "content-page" | "hotel-page"
contentType:
| "loyalty-page"
| "content-page"
| "hotel-page"
| "collection-page"
}
export type ContentTypeWebviewParams = {

View File

@@ -2,6 +2,7 @@ export enum ContentTypeEnum {
accountPage = "account_page",
loyaltyPage = "loyalty_page",
hotelPage = "hotel_page",
collectionPage = "collection_page",
contentPage = "content_page",
currentBlocksPage = "current_blocks_page",
}

View File

@@ -14,6 +14,7 @@ const entryResolveSchema = z.object({
export const validateEntryResolveSchema = z.object({
all_account_page: entryResolveSchema,
all_collection_page: entryResolveSchema,
all_content_page: entryResolveSchema,
all_loyalty_page: entryResolveSchema,
all_current_blocks_page: entryResolveSchema,

View File

@@ -3,5 +3,6 @@ export enum PageTypeEnum {
loyaltyPage = "loyalty-page",
hotelPage = "hotel-page",
contentPage = "content-page",
collectionPage = "collection-page",
currentBlocksPage = "current-blocks-page",
}

View File

@@ -0,0 +1,20 @@
import { z } from "zod"
import {
blocksSchema,
collectionPageRefsSchema,
collectionPageSchema,
} from "@/server/routers/contentstack/collectionPage/output"
export interface GetCollectionPageRefsSchema
extends z.input<typeof collectionPageRefsSchema> {}
export interface CollectionPageRefs
extends z.output<typeof collectionPageRefsSchema> {}
export interface GetCollectionPageSchema
extends z.input<typeof collectionPageSchema> {}
export interface CollectionPage extends z.output<typeof collectionPageSchema> {}
export type Block = z.output<typeof blocksSchema>