From d414970d640b2f6cf7ab0846c3adaa2fe1ec4a12 Mon Sep 17 00:00:00 2001 From: runarvestmann Date: Thu, 9 Jan 2025 16:13:26 +0000 Subject: [PATCH] Title --- .../Organization/Slice/OverviewLinks/OverviewLinks.tsx | 9 +++++++-- apps/web/screens/queries/fragments.ts | 1 + libs/cms/src/lib/models/overviewLinks.model.ts | 4 ++++ 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/apps/web/components/Organization/Slice/OverviewLinks/OverviewLinks.tsx b/apps/web/components/Organization/Slice/OverviewLinks/OverviewLinks.tsx index b67ae1008c6a..6b3267fcfcba 100644 --- a/apps/web/components/Organization/Slice/OverviewLinks/OverviewLinks.tsx +++ b/apps/web/components/Organization/Slice/OverviewLinks/OverviewLinks.tsx @@ -174,8 +174,13 @@ export const OverviewLinksSlice: React.FC< > {slice.hasBorderAbove && } - {cardView && } - {!cardView && } + + {Boolean(slice.titleAbove) && ( + {slice.titleAbove} + )} + {cardView && } + {!cardView && } + ) diff --git a/apps/web/screens/queries/fragments.ts b/apps/web/screens/queries/fragments.ts index f11ae4ab1aa8..ad507a91bec3 100644 --- a/apps/web/screens/queries/fragments.ts +++ b/apps/web/screens/queries/fragments.ts @@ -496,6 +496,7 @@ export const slices = gql` fragment OverviewLinksField on OverviewLinks { __typename id + titleAbove hasBorderAbove cardLinks { title diff --git a/libs/cms/src/lib/models/overviewLinks.model.ts b/libs/cms/src/lib/models/overviewLinks.model.ts index 45fd285b4f88..fbd0ff27a45a 100644 --- a/libs/cms/src/lib/models/overviewLinks.model.ts +++ b/libs/cms/src/lib/models/overviewLinks.model.ts @@ -23,6 +23,9 @@ export class OverviewLinks { @Field(() => ID) id!: string + @Field({ nullable: true }) + titleAbove?: string + @CacheField(() => [IntroLinkImage]) overviewLinks!: Array @@ -42,6 +45,7 @@ export const mapOverviewLinks = ({ }: IOverviewLinks): SystemMetadata => ({ typename: 'OverviewLinks', id: sys.id, + title: fields.displayedTitle ?? '', overviewLinks: (fields.overviewLinks ?? []) .filter((link) => link.sys.contentType.sys.id === 'introLinkImage') .map((link) => mapIntroLinkImage(link as IIntroLinkImage)),