Merged in feat/SW-1384-filterable-carousel-cards (pull request #1235)

feat(SW-1384): add CarouselCards block to start page

* feat(SW-1384): add filterable carousel cards block to start page

* fix(SW-1384): remove unnecessary link prop from SectionHeader

* fix(SW-1384): remove uneeded undefined

* fix(SW-1384): better type safety

* feat(SW-1384): Add see all link to filterable carousel cards section header

* refactor(SW-1384): Replace FilterableCarouselCards with CarouselCards block

* fix(SW-1384): Remove CardsEnumType type definition

* fix(SW-1384):Implement code review feedback to CarouselCards

* refactor(SW-1384): Convert CarouselCardFilterEnum to const enum with type


Approved-by: Christian Andolf
This commit is contained in:
Chuma Mcphoy (We Ahead)
2025-02-04 10:59:17 +00:00
parent 8b475e0ca8
commit 2e311be924
21 changed files with 764 additions and 177 deletions

View File

@@ -0,0 +1,96 @@
#import "../System.graphql"
#import "./ContentCard.graphql"
#import "../PageLink/AccountPageLink.graphql"
#import "../PageLink/CollectionPageLink.graphql"
#import "../PageLink/ContentPageLink.graphql"
#import "../PageLink/DestinationCityPageLink.graphql"
#import "../PageLink/DestinationCountryPageLink.graphql"
#import "../PageLink/DestinationOverviewPageLink.graphql"
#import "../PageLink/HotelPageLink.graphql"
#import "../PageLink/LoyaltyPageLink.graphql"
#import "../PageLink/StartPageLink.graphql"
#import "../AccountPage/Ref.graphql"
#import "../ContentPage/Ref.graphql"
#import "../HotelPage/Ref.graphql"
#import "../LoyaltyPage/Ref.graphql"
#import "../CollectionPage/Ref.graphql"
#import "../DestinationCityPage/Ref.graphql"
#import "../DestinationCountryPage/Ref.graphql"
#import "../DestinationOverviewPage/Ref.graphql"
fragment CarouselCards_StartPage on StartPageBlocksCarouselCards {
carousel_cards {
heading
enable_filters
default_filter
card_groups {
filter_category {
filter_identifier
filter_label
}
cardConnection {
edges {
node {
...ContentCardBlock
}
}
}
}
link {
cta_text
is_contentstack_link
open_in_new_tab
external_link {
href
title
}
linkConnection {
edges {
node {
__typename
...AccountPageLink
...CollectionPageLink
...ContentPageLink
...DestinationCityPageLink
...DestinationCountryPageLink
...DestinationOverviewPageLink
...HotelPageLink
...LoyaltyPageLink
}
}
}
}
}
}
fragment CarouselCards_StartPageRefs on StartPageBlocksCarouselCards {
carousel_cards {
card_groups {
cardConnection {
edges {
node {
...ContentCardBlockRef
}
}
}
}
link {
linkConnection {
edges {
node {
__typename
...AccountPageRef
...CollectionPageRef
...ContentPageRef
...DestinationCityPageRef
...DestinationCountryPageRef
...DestinationOverviewPageRef
...HotelPageRef
...LoyaltyPageRef
}
}
}
}
}
}

View File

@@ -0,0 +1,127 @@
#import "../System.graphql"
#import "../PageLink/AccountPageLink.graphql"
#import "../PageLink/CollectionPageLink.graphql"
#import "../PageLink/ContentPageLink.graphql"
#import "../PageLink/DestinationCityPageLink.graphql"
#import "../PageLink/DestinationCountryPageLink.graphql"
#import "../PageLink/DestinationOverviewPageLink.graphql"
#import "../PageLink/HotelPageLink.graphql"
#import "../PageLink/LoyaltyPageLink.graphql"
#import "../PageLink/StartPageLink.graphql"
#import "../AccountPage/Ref.graphql"
#import "../ContentPage/Ref.graphql"
#import "../HotelPage/Ref.graphql"
#import "../LoyaltyPage/Ref.graphql"
#import "../CollectionPage/Ref.graphql"
#import "../DestinationCityPage/Ref.graphql"
#import "../DestinationCountryPage/Ref.graphql"
#import "../DestinationOverviewPage/Ref.graphql"
#import "../StartPage/Ref.graphql"
fragment ContentCardBlock on ContentCard {
__typename
title
heading
image
body_text
has_primary_button
has_secondary_button
promo_text
primary_button {
cta_text
is_contentstack_link
open_in_new_tab
external_link {
href
title
}
linkConnection {
edges {
node {
__typename
...AccountPageLink
...CollectionPageLink
...ContentPageLink
...DestinationCityPageLink
...DestinationCountryPageLink
...DestinationOverviewPageLink
...HotelPageLink
...LoyaltyPageLink
...StartPageLink
}
}
}
}
secondary_button {
cta_text
is_contentstack_link
open_in_new_tab
external_link {
href
title
}
linkConnection {
edges {
node {
__typename
...AccountPageLink
...CollectionPageLink
...ContentPageLink
...DestinationCityPageLink
...DestinationCountryPageLink
...DestinationOverviewPageLink
...HotelPageLink
...LoyaltyPageLink
...StartPageLink
}
}
}
}
system {
...System
}
}
fragment ContentCardBlockRef on ContentCard {
__typename
primary_button {
linkConnection {
edges {
node {
__typename
...AccountPageRef
...CollectionPageRef
...ContentPageRef
...DestinationCityPageRef
...DestinationCountryPageRef
...DestinationOverviewPageRef
...HotelPageRef
...LoyaltyPageRef
...StartPageRef
}
}
}
}
secondary_button {
linkConnection {
edges {
node {
__typename
...AccountPageRef
...CollectionPageRef
...ContentPageRef
...DestinationCityPageRef
...DestinationCountryPageRef
...DestinationOverviewPageRef
...HotelPageRef
...LoyaltyPageRef
...StartPageRef
}
}
}
}
system {
...System
}
}

View File

@@ -0,0 +1,52 @@
#import "../../System.graphql"
#import "../../AccountPage/Ref.graphql"
#import "../../CollectionPage/Ref.graphql"
#import "../../ContentPage/Ref.graphql"
#import "../../DestinationCityPage/Ref.graphql"
#import "../../DestinationCountryPage/Ref.graphql"
#import "../../DestinationOverviewPage/Ref.graphql"
#import "../../HotelPage/Ref.graphql"
#import "../../LoyaltyPage/Ref.graphql"
#import "../../StartPage/Ref.graphql"
fragment ContentCardBlockRef on ContentCard {
secondary_button {
linkConnection {
edges {
node {
__typename
...AccountPageRef
...CollectionPageRef
...ContentPageRef
...DestinationCityPageRef
...DestinationCountryPageRef
...DestinationOverviewPageRef
...HotelPageRef
...LoyaltyPageRef
...StartPageRef
}
}
}
}
primary_button {
linkConnection {
edges {
node {
__typename
...AccountPageRef
...CollectionPageRef
...ContentPageRef
...DestinationCityPageRef
...DestinationCountryPageRef
...DestinationOverviewPageRef
...HotelPageRef
...LoyaltyPageRef
...StartPageRef
}
}
}
}
system {
...System
}
}

View File

@@ -1,6 +1,7 @@
#import "../../Fragments/System.graphql"
#import "../../Fragments/Blocks/CardsGrid.graphql"
#import "../../Fragments/Blocks/FullWidthCampaign.graphql"
#import "../../Fragments/Blocks/CarouselCards.graphql"
query GetStartPage($locale: String!, $uid: String!) {
start_page(locale: $locale, uid: $uid) {
@@ -13,6 +14,7 @@ query GetStartPage($locale: String!, $uid: String!) {
blocks {
__typename
...CardsGrid_StartPage
...CarouselCards_StartPage
... on StartPageBlocksFullWidthCampaign {
__typename
full_width_campaign {
@@ -42,6 +44,7 @@ query GetStartPageRefs($locale: String!, $uid: String!) {
blocks {
__typename
...CardsGrid_StartPageRefs
...CarouselCards_StartPageRefs
... on StartPageBlocksFullWidthCampaign {
full_width_campaign {
full_width_campaignConnection {