From cb74bed99da35d8f903d2d713dd5f3b5795ebe26 Mon Sep 17 00:00:00 2001 From: Eric Sanner Date: Thu, 7 Mar 2024 15:09:03 -0500 Subject: [PATCH] Enable EE/Pages. Include settings items. --- .../src/components/Basic Components/Event.tsx | 44 +++++-- .../Basic Components/EventTeaser.tsx | 13 +- .../src/components/Basic Components/Link.tsx | 9 +- .../components/Basic Components/Person.tsx | 60 +++++---- .../components/Basic Components/TextImage.tsx | 23 ++-- .../components/Basic Components/VideoText.tsx | 35 +++--- .../components/List Components/PeopleGrid.tsx | 13 +- .../Branches/Sugcon2024/Basic Components.yml | 31 +++++ .../_name.yml | 36 ++++++ .../Branches/Sugcon2024/List Components.yml | 31 +++++ ...le Headless List Components Renderings.yml | 114 ++++++++++++++++++ .../_name.yml | 31 +++++ .../Add Text and Images Data Item.yml | 41 +++++++ .../Event Teaser.yml | 12 +- .../List Components/People Grid.yml | 9 +- .../items/SiteEU/EU/Data/Events.yml | 31 +++++ .../items/SiteEU/EU/Data/People.yml | 31 +++++ .../items/SiteEU/EU/Data/Text and Image.yml | 31 +++++ .../items/SiteEU/EU/Data/Video and Text.yml | 31 +++++ .../SiteShared/Shared/Data/Text and Image.yml | 31 +++++ .../Event Teaser Folder/__Standard Values.yml | 9 -- .../Event Teaser/__Standard Values.yml | 9 -- .../Event Teaser Folder.yml | 4 +- .../Event Teaser Folder/__Standard Values.yml | 29 +++++ .../Event Teaser.yml | 4 +- .../Event Teaser/Content.yml | 2 +- .../Event Teaser/Content/Events.yml | 2 +- .../Event Teaser/Content/Headline.yml | 2 +- .../Rendering Parameters/Event Teaser.yml | 4 +- .../Event Teaser/__Standard Values.yml | 23 ++++ 30 files changed, 640 insertions(+), 105 deletions(-) create mode 100644 src/Project/Sugcon2024/items/Branches/Sugcon2024/Basic Components.yml create mode 100644 src/Project/Sugcon2024/items/Branches/Sugcon2024/Basic Components/Available Headless Basic Components Renderings/_name.yml create mode 100644 src/Project/Sugcon2024/items/Branches/Sugcon2024/List Components.yml create mode 100644 src/Project/Sugcon2024/items/Branches/Sugcon2024/List Components/Available Headless List Components Renderings.yml create mode 100644 src/Project/Sugcon2024/items/Branches/Sugcon2024/List Components/Available Headless List Components Renderings/_name.yml create mode 100644 src/Project/Sugcon2024/items/Modules/Sugcon2024/Basic Components/Basic Components Headless Site Setup/Add Text and Images Data Item.yml rename src/Project/Sugcon2024/items/Renderings/Sugcon2024/{Basic Components => List Components}/Event Teaser.yml (90%) create mode 100644 src/Project/Sugcon2024/items/SiteEU/EU/Data/Events.yml create mode 100644 src/Project/Sugcon2024/items/SiteEU/EU/Data/People.yml create mode 100644 src/Project/Sugcon2024/items/SiteEU/EU/Data/Text and Image.yml create mode 100644 src/Project/Sugcon2024/items/SiteEU/EU/Data/Video and Text.yml create mode 100644 src/Project/Sugcon2024/items/SiteShared/Shared/Data/Text and Image.yml delete mode 100644 src/Project/Sugcon2024/items/Templates/Sugcon2024/Basic Components/Event Teaser Folder/__Standard Values.yml delete mode 100644 src/Project/Sugcon2024/items/Templates/Sugcon2024/Basic Components/Rendering Parameters/Event Teaser/__Standard Values.yml rename src/Project/Sugcon2024/items/Templates/Sugcon2024/{Basic Components => List Components}/Event Teaser Folder.yml (93%) create mode 100644 src/Project/Sugcon2024/items/Templates/Sugcon2024/List Components/Event Teaser Folder/__Standard Values.yml rename src/Project/Sugcon2024/items/Templates/Sugcon2024/{Basic Components => List Components}/Event Teaser.yml (93%) rename src/Project/Sugcon2024/items/Templates/Sugcon2024/{Basic Components => List Components}/Event Teaser/Content.yml (94%) rename src/Project/Sugcon2024/items/Templates/Sugcon2024/{Basic Components => List Components}/Event Teaser/Content/Events.yml (90%) rename src/Project/Sugcon2024/items/Templates/Sugcon2024/{Basic Components => List Components}/Event Teaser/Content/Headline.yml (94%) rename src/Project/Sugcon2024/items/Templates/Sugcon2024/{Basic Components => List Components}/Rendering Parameters/Event Teaser.yml (93%) create mode 100644 src/Project/Sugcon2024/items/Templates/Sugcon2024/List Components/Rendering Parameters/Event Teaser/__Standard Values.yml diff --git a/src/Project/Sugcon2024/Sugcon/src/components/Basic Components/Event.tsx b/src/Project/Sugcon2024/Sugcon/src/components/Basic Components/Event.tsx index 7e264e21..6caf4034 100644 --- a/src/Project/Sugcon2024/Sugcon/src/components/Basic Components/Event.tsx +++ b/src/Project/Sugcon2024/Sugcon/src/components/Basic Components/Event.tsx @@ -1,6 +1,15 @@ import React from 'react'; import { Box, Heading, Text, Image, Link } from '@chakra-ui/react'; -import { Field, ImageField, LinkField } from '@sitecore-jss/sitecore-jss-nextjs'; +import { + Field, + ImageField, + Image as JssImage, + LinkField, + Link as JssLink, + TextField, + Text as JssText, +} from '@sitecore-jss/sitecore-jss-nextjs'; +import { isEditorActive } from '@sitecore-jss/sitecore-jss-nextjs/utils'; // Define the type of props that Event will accept export interface Fields { @@ -8,7 +17,7 @@ export interface Fields { Image: ImageField; /** Name of the event */ - EventName: Field; + EventName: TextField; /** Date of the event */ EventDate: Field; @@ -42,27 +51,44 @@ export const Default = (props: Fields): JSX.Element => { return ( - + - {props.EventName?.value} + {dateString} + {isEditorActive() && ( + + + + )} {locationString} - {props.LinkToSite?.value?.href !== '' && ( + {isEditorActive() && ( + + + + + + + + + + + + )} + {(isEditorActive() || props.LinkToSite?.value?.href !== '') && ( - {props.LinkToSite?.value?.text} - + field={props.LinkToSite} + /> )} ; + Headline: TextField; /** Multilist of Events */ Events: Array; @@ -38,9 +39,11 @@ export type EventTeaserProps = { export const Default = (props: EventTeaserProps): JSX.Element => { return ( - - {props.fields?.Headline?.value} - + {(isEditorActive() || props.fields?.Headline?.value !== '') && ( + + + + )} {props.fields?.Events.map((event, idx) => { return ; diff --git a/src/Project/Sugcon2024/Sugcon/src/components/Basic Components/Link.tsx b/src/Project/Sugcon2024/Sugcon/src/components/Basic Components/Link.tsx index c945eb30..6f1d20b8 100644 --- a/src/Project/Sugcon2024/Sugcon/src/components/Basic Components/Link.tsx +++ b/src/Project/Sugcon2024/Sugcon/src/components/Basic Components/Link.tsx @@ -1,6 +1,6 @@ import React from 'react'; import { Box, Link } from '@chakra-ui/react'; -import { LinkField } from '@sitecore-jss/sitecore-jss-nextjs'; +import { LinkField, Link as JssLink } from '@sitecore-jss/sitecore-jss-nextjs'; // Define the type of props that Link will accept interface Fields { @@ -17,11 +17,10 @@ export const Default = (props: LinkProps): JSX.Element => { return ( - {props.fields?.Link?.value?.text} - + /> ); }; diff --git a/src/Project/Sugcon2024/Sugcon/src/components/Basic Components/Person.tsx b/src/Project/Sugcon2024/Sugcon/src/components/Basic Components/Person.tsx index d67e9813..d054fd87 100644 --- a/src/Project/Sugcon2024/Sugcon/src/components/Basic Components/Person.tsx +++ b/src/Project/Sugcon2024/Sugcon/src/components/Basic Components/Person.tsx @@ -16,7 +16,15 @@ import { ModalFooter, useDisclosure, } from '@chakra-ui/react'; -import { Field, ImageField, LinkField } from '@sitecore-jss/sitecore-jss-nextjs'; +import { + ImageField, + Image as JssImage, + LinkField, + Link as JssLink, + TextField, + Text as JssText, +} from '@sitecore-jss/sitecore-jss-nextjs'; +import { isEditorActive } from '@sitecore-jss/sitecore-jss-nextjs/utils'; // Define the type of props that Hero will accept export interface PersonFields { @@ -24,16 +32,16 @@ export interface PersonFields { Image: ImageField; /** Person's full name */ - Name: Field; + Name: TextField; /** Person's job role */ - JobRole: Field; + JobRole: TextField; /** Person's company */ - Company: Field; + Company: TextField; /** Person's Biography */ - Biography: Field; + Biography: TextField; /** Linkedin Link */ Linkedin: LinkField; @@ -52,57 +60,65 @@ export const Default = (props: PersonProps): JSX.Element => { return ( {props.params?.LinkToBio == '1' && ( )} {!props.params?.LinkToBio && ( - {props.fields.Name?.value} + )} - {props.fields.JobRole?.value} + - {props.fields.Company?.value} + - {props.params?.DisplaySocialLinks == '1' && props.fields.Linkedin?.value?.href !== '' && ( + {(isEditorActive() || + (props.params?.DisplaySocialLinks == '1' && props.fields.Linkedin?.value?.href !== '')) && ( - Linkedin - + field={props.fields.Linkedin} + /> )} - {props.params?.DisplaySocialLinks == '1' && - props.fields.Linkedin?.value?.href !== '' && - props.fields.Twitter?.value?.href !== '' && / } - {props.params?.DisplaySocialLinks == '1' && props.fields.Twitter?.value?.href !== '' && ( + {(isEditorActive() || + (props.params?.DisplaySocialLinks == '1' && + props.fields.Linkedin?.value?.href !== '' && + props.fields.Twitter?.value?.href !== '')) && / } + {(isEditorActive() || + (props.params?.DisplaySocialLinks == '1' && props.fields.Twitter?.value?.href !== '')) && ( - Twitter - + field={props.fields.Twitter} + /> + )} + {isEditorActive() && ( + + + )} {props.params?.LinkToBio == '1' && ( diff --git a/src/Project/Sugcon2024/Sugcon/src/components/Basic Components/TextImage.tsx b/src/Project/Sugcon2024/Sugcon/src/components/Basic Components/TextImage.tsx index db4ddfae..a54709dc 100644 --- a/src/Project/Sugcon2024/Sugcon/src/components/Basic Components/TextImage.tsx +++ b/src/Project/Sugcon2024/Sugcon/src/components/Basic Components/TextImage.tsx @@ -1,14 +1,21 @@ import React from 'react'; import { Box, Heading, Text, Image, Flex } from '@chakra-ui/react'; -import { Field, ImageField } from '@sitecore-jss/sitecore-jss-nextjs'; +import { + TextField, + Text as JssText, + RichTextField, + RichText as JssRichText, + ImageField, + Image as JssImage, +} from '@sitecore-jss/sitecore-jss-nextjs'; // Define the type of props that TextImage will accept interface Fields { /** Title of the TextImage */ - Headline: Field; + Headline: TextField; /** Richtext of the TextImage */ - Text: Field; + Text: RichTextField; /** Image of the TextImage */ Image: ImageField; @@ -35,24 +42,22 @@ export const Default = (props: TextImageProps): JSX.Element => { > - {props.fields.Headline?.value} + - {props.fields.Text?.value !== '' && ( - - {props.fields.Text?.value} - - )} + {' '} {props.fields.Image?.value?.alt} diff --git a/src/Project/Sugcon2024/Sugcon/src/components/Basic Components/VideoText.tsx b/src/Project/Sugcon2024/Sugcon/src/components/Basic Components/VideoText.tsx index 958f1cb4..14452481 100644 --- a/src/Project/Sugcon2024/Sugcon/src/components/Basic Components/VideoText.tsx +++ b/src/Project/Sugcon2024/Sugcon/src/components/Basic Components/VideoText.tsx @@ -1,20 +1,26 @@ import React from 'react'; import { Box, Heading, Text, Flex } from '@chakra-ui/react'; -import { Field } from '@sitecore-jss/sitecore-jss-nextjs'; +import { + TextField, + Text as JssText, + RichTextField, + RichText as JssRichText, +} from '@sitecore-jss/sitecore-jss-nextjs'; +import { isEditorActive } from '@sitecore-jss/sitecore-jss-nextjs/utils'; // Define the type of props that VideoText will accept interface Fields { /** Title of the VideoText */ - Headline: Field; + Headline: TextField; /** Youtube Video Id (not the full youtube.com url)*/ - YoutubeVideoId: Field; + YoutubeVideoId: TextField; /** Text headline of the VideoText */ - TextHeadline: Field; + TextHeadline: TextField; /** Richtext of the VideoText */ - Text: Field; + Text: RichTextField; } export type VideoTextProps = { @@ -25,12 +31,11 @@ export type VideoTextProps = { export const Default = (props: VideoTextProps): JSX.Element => { return ( - {props.fields.Headline?.value !== '' && ( + {(isEditorActive() || props.fields.Headline?.value !== '') && ( - {props.fields.Headline?.value} + )} -