Merge branch 'develop' into feature/tracking

This commit is contained in:
Linus Flood
2024-10-24 12:39:34 +02:00
221 changed files with 5789 additions and 1491 deletions
+2
View File
@@ -7,6 +7,7 @@ import d from "dayjs"
import advancedFormat from "dayjs/plugin/advancedFormat"
import isToday from "dayjs/plugin/isToday"
import relativeTime from "dayjs/plugin/relativeTime"
import timezone from "dayjs/plugin/timezone"
import utc from "dayjs/plugin/utc"
/**
@@ -59,6 +60,7 @@ d.locale("no", {
d.extend(advancedFormat)
d.extend(isToday)
d.extend(relativeTime)
d.extend(timezone)
d.extend(utc)
export const dt = d
+88
View File
@@ -0,0 +1,88 @@
#import "./PageLink/AccountPageLink.graphql"
#import "./PageLink/ContentPageLink.graphql"
#import "./PageLink/HotelPageLink.graphql"
#import "./PageLink/LoyaltyPageLink.graphql"
#import "./AccountPage/Ref.graphql"
#import "./ContentPage/Ref.graphql"
#import "./HotelPage/Ref.graphql"
#import "./LoyaltyPage/Ref.graphql"
fragment Alert on Alert {
type
heading
text
phone_contact {
display_text
phone_number
footnote
}
has_link
link {
title
linkConnection {
edges {
node {
__typename
...AccountPageLink
...ContentPageLink
...HotelPageLink
...LoyaltyPageLink
}
}
}
}
has_sidepeek_button
sidepeek_button {
cta_text
}
sidepeek_content {
heading
content {
embedded_itemsConnection {
edges {
node {
__typename
...AccountPageLink
...ContentPageLink
...HotelPageLink
...LoyaltyPageLink
}
}
}
json
}
}
}
fragment AlertRef on Alert {
link {
linkConnection {
edges {
node {
__typename
...AccountPageRef
...ContentPageRef
...HotelPageRef
...LoyaltyPageRef
}
}
}
}
sidepeek_content {
content {
embedded_itemsConnection {
edges {
node {
__typename
...AccountPageRef
...ContentPageRef
...HotelPageRef
...LoyaltyPageRef
}
}
}
json
}
}
}
@@ -22,6 +22,7 @@ fragment Content_ContentPage on ContentPageBlocksContent {
...ContentPageLink
...HotelPageLink
...LoyaltyPageLink
...ImageContainer
}
}
}
@@ -41,6 +42,7 @@ fragment Content_ContentPageRefs on ContentPageBlocksContent {
...ContentPageRef
...HotelPageRef
...LoyaltyPageRef
...ImageContainerRef
}
}
}
@@ -0,0 +1,23 @@
#import "../AccountPage/Ref.graphql"
#import "../ContentPage/Ref.graphql"
#import "../LoyaltyPage/Ref.graphql"
#import "../PageLink/AccountPageLink.graphql"
#import "../PageLink/ContentPageLink.graphql"
#import "../PageLink/LoyaltyPageLink.graphql"
#import "../Blocks/Shortcuts.graphql"
fragment QuickLinksSidebar_ContentPage on ContentPageSidebarShortcuts {
__typename
shortcuts {
...Shortcuts
}
}
fragment QuickLinksSidebar_ContentPageRefs on ContentPageSidebarShortcuts {
shortcuts {
__typename
...ShortcutsRefs
}
}
@@ -0,0 +1,38 @@
#import "../AccountPage/Ref.graphql"
#import "../ContentPage/Ref.graphql"
#import "../LoyaltyPage/Ref.graphql"
#import "../PageLink/AccountPageLink.graphql"
#import "../PageLink/ContentPageLink.graphql"
#import "../PageLink/LoyaltyPageLink.graphql"
#import "../Blocks/Card.graphql"
#import "../Blocks/Refs/Card.graphql"
fragment ScriptedCardSidebar_ContentPage on ContentPageSidebarScriptedCard {
__typename
scripted_card {
theme
scripted_cardConnection {
edges {
node {
__typename
...CardBlock
}
}
}
}
}
fragment ScriptedCardSidebar_ContentPageRefs on ContentPageSidebarScriptedCard {
scripted_card {
scripted_cardConnection {
edges {
node {
__typename
...CardBlockRef
}
}
}
}
}
@@ -0,0 +1,38 @@
#import "../AccountPage/Ref.graphql"
#import "../ContentPage/Ref.graphql"
#import "../LoyaltyPage/Ref.graphql"
#import "../PageLink/AccountPageLink.graphql"
#import "../PageLink/ContentPageLink.graphql"
#import "../PageLink/LoyaltyPageLink.graphql"
#import "../Blocks/TeaserCard.graphql"
#import "../Blocks/Refs/TeaserCard.graphql"
fragment TeaserCardSidebar_ContentPage on ContentPageSidebarTeaserCard {
__typename
teaser_card {
theme
teaser_cardConnection {
edges {
node {
__typename
...TeaserCardBlock
}
}
}
}
}
fragment TeaserCardSidebar_ContentPageRefs on ContentPageSidebarTeaserCard {
teaser_card {
teaser_cardConnection {
edges {
node {
__typename
...TeaserCardBlockRef
}
}
}
}
}
+2
View File
@@ -19,10 +19,12 @@ query GetContactConfig($locale: String!) {
phone {
number
name
footnote
}
phone_loyalty {
name
number
footnote
}
title
visiting_address {
@@ -13,6 +13,9 @@
#import "../../Fragments/Sidebar/Content.graphql"
#import "../../Fragments/Sidebar/DynamicContent.graphql"
#import "../../Fragments/Sidebar/JoinLoyaltyContact.graphql"
#import "../../Fragments/Sidebar/TeaserCard.graphql"
#import "../../Fragments/Sidebar/ScriptedCard.graphql"
#import "../../Fragments/Sidebar/QuickLinks.graphql"
query GetContentPage($locale: String!, $uid: String!) {
content_page(uid: $uid, locale: $locale) {
@@ -28,6 +31,9 @@ query GetContentPage($locale: String!, $uid: String!) {
...ContentSidebar_ContentPage
...DynamicContentSidebar_ContentPage
...JoinLoyaltyContactSidebar_ContentPage
...ScriptedCardSidebar_ContentPage
...TeaserCardSidebar_ContentPage
...QuickLinksSidebar_ContentPage
}
system {
...System
@@ -80,6 +86,22 @@ query GetContentPageRefs($locale: String!, $uid: String!) {
}
}
}
sidebar {
__typename
...ContentSidebar_ContentPageRefs
...JoinLoyaltyContactSidebar_ContentPageRefs
...ScriptedCardSidebar_ContentPageRefs
...TeaserCardSidebar_ContentPageRefs
...QuickLinksSidebar_ContentPageRefs
}
system {
...System
}
}
}
query GetContentPageBlocksRefs($locale: String!, $uid: String!) {
content_page(locale: $locale, uid: $uid) {
blocks {
__typename
...Accordion_ContentPageRefs
@@ -90,14 +112,6 @@ query GetContentPageRefs($locale: String!, $uid: String!) {
...TextCols_ContentPageRef
...UspGrid_ContentPageRefs
}
sidebar {
__typename
...ContentSidebar_ContentPageRefs
...JoinLoyaltyContactSidebar_ContentPageRefs
}
system {
...System
}
}
}
+39
View File
@@ -0,0 +1,39 @@
#import "../Fragments/System.graphql"
#import "../Fragments/Alert.graphql"
query GetSiteConfig($locale: String!) {
all_site_config(limit: 1, locale: $locale) {
items {
sitewide_alert {
booking_widget_disabled
alertConnection {
edges {
node {
...Alert
}
}
}
}
}
}
}
query GetSiteConfigRef($locale: String!) {
all_site_config(limit: 1, locale: $locale) {
items {
sitewide_alert {
alertConnection {
edges {
node {
...AlertRef
}
}
}
}
system {
...System
}
}
}
}
+20
View File
@@ -16,6 +16,22 @@ export const getProfileSafely = cache(
}
)
export const getCreditCardsSafely = cache(
async function getMemoizedCreditCardsSafely() {
return serverClient().user.safeCreditCards()
}
)
export const getHotelData = cache(async function getMemoizedHotelData(
hotelId: string,
language: string
) {
return serverClient().hotel.hotelData.get({
hotelId,
language,
})
})
export const getFooter = cache(async function getMemoizedFooter() {
return serverClient().contentstack.base.footer()
})
@@ -29,3 +45,7 @@ export const getLanguageSwitcher = cache(
return serverClient().contentstack.languageSwitcher.get()
}
)
export const getSiteConfig = cache(async function getMemoizedSiteConfig() {
return serverClient().contentstack.base.siteConfig()
})