From 4a93c87fb1444c9dd9f5c97e1af2d08631075e51 Mon Sep 17 00:00:00 2001 From: Okeino McGowan Date: Wed, 4 Oct 2023 05:20:43 -0400 Subject: [PATCH 01/16] tests work --- next.config.js | 31 ++++++ package-lock.json | 6 +- public/apple-app-site-association | 1 + public/compiled-lang/en.json | 48 +++++++- public/lang/en.json | 27 ++++- .../molecules/card/favoriteEntity.tsx | 2 +- src/components/molecules/card/inferred.tsx | 4 +- src/components/molecules/card/person.tsx | 13 ++- .../molecules/card/sequence.module.scss | 12 ++ src/components/molecules/card/sequence.tsx | 26 +++-- .../cardSlider/section/audiobooks.tsx | 2 +- .../cardSlider/section/egwAudiobooks.graphql | 21 ++++ .../cardSlider/section/egwAudiobooks.tsx | 36 ++++++ .../cardSlider/section/presenters.tsx | 2 +- src/containers/audiobook/egwList.graphql | 28 +++++ src/containers/audiobook/egwList.tsx | 46 ++++++++ src/containers/audiobook/list.tsx | 5 +- src/containers/collection/detail.tsx | 6 +- src/containers/collection/presenters.tsx | 2 +- src/containers/discover/collections.tsx | 2 + src/containers/discover/index.tsx | 4 + src/containers/search/persons.tsx | 2 +- src/lib/routes/egwbooks.ts | 12 ++ src/lib/routes/index.ts | 2 + src/lib/useNavigationItems.tsx | 12 +- src/pages/[language]/books/page/[i].tsx | 2 +- src/pages/[language]/discover/collections.ts | 1 + .../[language]/egwbooks/[id]/[[...slugs]].tsx | 58 ++++++++++ .../egwbooks/[id]/feed.xml/index.ts | 105 ++++++++++++++++++ src/pages/[language]/egwbooks/page/[i].tsx | 48 ++++++++ .../egwbooks/tracks/[id]/[[...slugs]].tsx | 58 ++++++++++ src/styles/common.scss | 2 + 32 files changed, 594 insertions(+), 32 deletions(-) create mode 100644 src/components/organisms/cardSlider/section/egwAudiobooks.graphql create mode 100644 src/components/organisms/cardSlider/section/egwAudiobooks.tsx create mode 100644 src/containers/audiobook/egwList.graphql create mode 100644 src/containers/audiobook/egwList.tsx create mode 100644 src/lib/routes/egwbooks.ts create mode 100644 src/pages/[language]/egwbooks/[id]/[[...slugs]].tsx create mode 100644 src/pages/[language]/egwbooks/[id]/feed.xml/index.ts create mode 100644 src/pages/[language]/egwbooks/page/[i].tsx create mode 100644 src/pages/[language]/egwbooks/tracks/[id]/[[...slugs]].tsx diff --git a/next.config.js b/next.config.js index 7561735e2..0e899d2bb 100644 --- a/next.config.js +++ b/next.config.js @@ -110,6 +110,11 @@ module.exports = withBundleAnalyzer( destination: '/:lang/books/:seriesId/feed.xml', permanent: true, }, + { + source: '/:lang/audiobooks/egwbooks/podcast/:seriesId/latest/:slug', + destination: '/:lang/egwbooks/:seriesId/feed.xml', + permanent: true, + }, { source: '/:lang/music/browse/podcast/:seriesId/latest/:slug', destination: '/:lang/songs/albums/:seriesId/feed.xml', @@ -181,6 +186,11 @@ module.exports = withBundleAnalyzer( destination: '/:lang/books', permanent: true, }, + { + source: '/:lang/egwbooks/page/1', + destination: '/:lang/egwbooks', + permanent: true, + }, { source: '/:lang/conferences/page/1', destination: '/:lang/conferences', @@ -323,11 +333,28 @@ module.exports = withBundleAnalyzer( permanent: false, destination: '/:lang/stories/albums/page/1', }, + { + source: '/:lang/audiobooks/egwbooks', + has: [ + { + type: 'query', + key: 'stories', + value: '1', + }, + ], + permanent: false, + destination: '/:lang/stories/albums/page/1', + }, { source: '/:lang/audiobooks/books/:path*', destination: '/:lang/books/:path*', permanent: true, }, + { + source: '/:lang/audiobooks/egwbooks/:path*', + destination: '/:lang/egwbooks/:path*', + permanent: true, + }, { source: '/:lang/music/browse', destination: '/:lang/songs/albums', @@ -505,6 +532,10 @@ module.exports = withBundleAnalyzer( source: '/:lang/books', destination: '/:lang/books/page/1', }, + { + source: '/:lang/egwbooks', + destination: '/:lang/egwbooks/page/1', + }, { source: '/:lang/conferences', destination: '/:lang/conferences/page/1', diff --git a/package-lock.json b/package-lock.json index 014f0cb71..168d3d7e7 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10908,9 +10908,9 @@ } }, "node_modules/caniuse-lite": { - "version": "1.0.30001539", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001539.tgz", - "integrity": "sha512-hfS5tE8bnNiNvEOEkm8HElUHroYwlqMMENEzELymy77+tJ6m+gA2krtHl5hxJaj71OlpC2cHZbdSMX1/YEqEkA==", + "version": "1.0.30001542", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001542.tgz", + "integrity": "sha512-UrtAXVcj1mvPBFQ4sKd38daP8dEcXXr5sQe6QNNinaPd0iA/cxg9/l3VrSdL73jgw5sKyuQ6jNgiKO12W3SsVA==", "funding": [ { "type": "opencollective", diff --git a/public/apple-app-site-association b/public/apple-app-site-association index ccd07ccfe..49d68ef3a 100644 --- a/public/apple-app-site-association +++ b/public/apple-app-site-association @@ -11,6 +11,7 @@ "/*/series/*", "/*/bibles/*", "/*/books/*", + "/*/egwbooks/*", "/*/songs/*", "/*/stories/*", "/*/conferences/*", diff --git a/public/compiled-lang/en.json b/public/compiled-lang/en.json index 1bdbfc758..3388d9ee7 100644 --- a/public/compiled-lang/en.json +++ b/public/compiled-lang/en.json @@ -608,7 +608,7 @@ "audiobookList__heading": [ { "type": 0, - "value": "All Audiobooks" + "value": "Books" } ], "bibleBook__backToChapter": [ @@ -714,7 +714,7 @@ "books__title": [ { "type": 0, - "value": "All Audiobooks" + "value": "Books" } ], "buttonShareRecording__emailSubject": [ @@ -891,6 +891,12 @@ "value": " chapters" } ], + "cardSequence_egwAudiobookType": [ + { + "type": 0, + "value": "ELLEN G. WHITE" + } + ], "cardSequence_readByLabel": [ { "type": 0, @@ -1583,6 +1589,18 @@ "value": "m" } ], + "egwAudiobookList__heading": [ + { + "type": 0, + "value": "Ellen G. White" + } + ], + "egwbooks__title": [ + { + "type": 0, + "value": "Ellen G. White" + } + ], "embed__partInfo": [ { "type": 0, @@ -1839,6 +1857,12 @@ "value": "Conferences" } ], + "header__navItemCollections-egwbooks": [ + { + "type": 0, + "value": "Ellen G. White" + } + ], "header__navItemCollections-presenters": [ { "type": 0, @@ -3800,7 +3824,7 @@ "organismSection__audiobooksHeading": [ { "type": 0, - "value": "Audiobooks" + "value": "Discover Books" } ], "organismSection__audiobooksNext": [ @@ -3833,6 +3857,24 @@ "value": "Previous Bible books" } ], + "organismSection__egwAudiobooksHeading": [ + { + "type": 0, + "value": "Discover Ellen G. White" + } + ], + "organismSection__egwAudiobooksNext": [ + { + "type": 0, + "value": "Next EGW audiobooks" + } + ], + "organismSection__egwAudiobooksPrevious": [ + { + "type": 0, + "value": "Previous EGW audiobooks" + } + ], "organismSection_presentersHeading": [ { "type": 0, diff --git a/public/lang/en.json b/public/lang/en.json index fade17e90..2ecbf4e1e 100644 --- a/public/lang/en.json +++ b/public/lang/en.json @@ -306,7 +306,7 @@ "string": "progress" }, "audiobookList__heading": { - "string": "All Audiobooks" + "string": "Books" }, "bibleBook__backToChapter": { "string": "Back to Chapter Info" @@ -359,7 +359,7 @@ "string": "All Blog Posts" }, "books__title": { - "string": "All Audiobooks" + "string": "Books" }, "buttonShareRecording__emailSubject": { "string": "{title} by {presenters}" @@ -428,6 +428,9 @@ "cardSequence_chaptersLabel": { "string": "{count} chapters" }, + "cardSequence_egwAudiobookType": { + "string": "ELLEN G. WHITE" + }, "cardSequence_readByLabel": { "string": "Read By {name}" }, @@ -744,6 +747,12 @@ "comment": "duration minutes", "string": "{minutes}m" }, + "egwAudiobookList__heading": { + "string": "Ellen G. White" + }, + "egwbooks__title": { + "string": "Ellen G. White" + }, "embed__partInfo": { "string": "Part {index} of {count}" }, @@ -818,6 +827,9 @@ "header__navItemCollections-conferences": { "string": "Conferences" }, + "header__navItemCollections-egwbooks": { + "string": "Ellen G. White" + }, "header__navItemCollections-presenters": { "string": "Presenters" }, @@ -1795,7 +1807,7 @@ "string": "Sponsor" }, "organismSection__audiobooksHeading": { - "string": "Audiobooks" + "string": "Discover Books" }, "organismSection__audiobooksNext": { "string": "Next audiobooks" @@ -1812,6 +1824,15 @@ "organismSection__bibleBooksPrevious": { "string": "Previous Bible books" }, + "organismSection__egwAudiobooksHeading": { + "string": "Discover Ellen G. White" + }, + "organismSection__egwAudiobooksNext": { + "string": "Next EGW audiobooks" + }, + "organismSection__egwAudiobooksPrevious": { + "string": "Previous EGW audiobooks" + }, "organismSection_presentersHeading": { "string": "Presenters" }, diff --git a/src/components/molecules/card/favoriteEntity.tsx b/src/components/molecules/card/favoriteEntity.tsx index 162cd6aa5..b5c764e6b 100644 --- a/src/components/molecules/card/favoriteEntity.tsx +++ b/src/components/molecules/card/favoriteEntity.tsx @@ -23,7 +23,7 @@ export default function CardFavoriteEntity({ case 'Collection': return ; case 'Person': - return ; + return ; case 'Recording': return ; case 'Sequence': diff --git a/src/components/molecules/card/inferred.tsx b/src/components/molecules/card/inferred.tsx index a36c5d226..2dc4fd788 100644 --- a/src/components/molecules/card/inferred.tsx +++ b/src/components/molecules/card/inferred.tsx @@ -34,7 +34,9 @@ const Typename = { export default function CardInferred({ entity }: { entity: InferrableEntity }) { switch (entity.__typename) { case Typename.Person: - return ; + return ( + + ); case Typename.Recording: return ; case Typename.Sequence: diff --git a/src/components/molecules/card/person.tsx b/src/components/molecules/card/person.tsx index 3723aa9d1..0841d50ef 100644 --- a/src/components/molecules/card/person.tsx +++ b/src/components/molecules/card/person.tsx @@ -19,11 +19,17 @@ import styles from './person.module.scss'; interface CardCollectionProps { person: CardPersonFragment; compact?: boolean; + largeinit?: boolean; + midinit?: boolean; + smallinit?: boolean; } export default function CardPerson({ person, compact = false, + largeinit = false, + midinit = false, + smallinit = false, }: CardCollectionProps): JSX.Element { const { isFavorited, toggleFavorited } = useIsPersonFavorited(person.id); const { canonicalPath, image, name, recordings } = person; @@ -39,7 +45,12 @@ export default function CardPerson({ ) : ( - + )} {name} diff --git a/src/components/molecules/card/sequence.module.scss b/src/components/molecules/card/sequence.module.scss index 7efd1bd3a..8460c248e 100644 --- a/src/components/molecules/card/sequence.module.scss +++ b/src/components/molecules/card/sequence.module.scss @@ -8,6 +8,13 @@ $container-padding: 16px; border-radius: 16px; overflow: hidden; transition-duration: $transition-medium; + &.EGWAUDIOBOOK { + --sequenceHeadingColor: #{$ts-white}; + --sequenceTextColor: #{$ts-white}; + --sequenceTextSecondaryColor: #{$ts-lightTone}; + background-color: $ts-egw; + --sequenceBackgroundColorHover: #{$ts-darkened-egw}; + } &.AUDIOBOOK { --sequenceHeadingColor: #{$ts-white}; --sequenceTextColor: #{$ts-white}; @@ -90,6 +97,11 @@ $container-padding: 16px; color: $ts-lightTone; } +.bookReadBy { + font-weight: 300; + color: $ts-lightTone; +} + .kicker { margin-bottom: 8px; display: -webkit-box; diff --git a/src/components/molecules/card/sequence.tsx b/src/components/molecules/card/sequence.tsx index 05c984cf3..ff9af5faf 100644 --- a/src/components/molecules/card/sequence.tsx +++ b/src/components/molecules/card/sequence.tsx @@ -34,12 +34,14 @@ interface CardCollectionProps { sequence: CardSequenceFragment; recordings?: CardRecordingFragment[] | null; slim?: boolean; + egw?: boolean; } export default function CardSequence({ sequence, recordings, slim, + egw, }: CardCollectionProps): JSX.Element { const [ref, isHovered] = useHover(); const [subRef, isSubHovered] = useHover(); @@ -65,15 +67,20 @@ export default function CardSequence({ const { Icon, accentColor, backgroundColor, textColor, label, labelColor } = ( { [SequenceContentType.Audiobook]: { - Icon: BookIcon, + Icon: egw ? FeatherIcon : BookIcon, accentColor: BaseColors.SALMON, - backgroundColor: BaseColors.BOOK_B, + backgroundColor: egw ? BaseColors.DARK : BaseColors.BOOK_B, iconColor: BaseColors.WHITE, textColor: BaseColors.LIGHT_TONE, - label: intl.formatMessage({ - id: 'cardSequence_audiobookType', - defaultMessage: 'Book', - }), + label: egw + ? intl.formatMessage({ + id: 'cardSequence_egwAudiobookType', + defaultMessage: 'ELLEN G. WHITE', + }) + : intl.formatMessage({ + id: 'cardSequence_audiobookType', + defaultMessage: 'Book', + }), labelColor: BaseColors.WHITE, }, [SequenceContentType.BibleBook]: { @@ -154,13 +161,13 @@ export default function CardSequence({ > {title} - {isBibleBook && ( + {(isBibleBook || egw) && ( )} {!!persons.length && + !egw && sequence.contentType !== SequenceContentType.BibleBook && (!recordings?.length || sequence.contentType === SequenceContentType.Audiobook || @@ -277,7 +285,7 @@ export default function CardSequence({ const className = clsx( styles.container, (isHovered || isSubHovered) && styles.otherHovered, - styles[contentType] + egw ? styles['EGWAUDIOBOOK'] : styles[contentType] ); const linkUrl = (isBibleBook && (sequence.allRecordings.nodes || [])[0].canonicalPath) || diff --git a/src/components/organisms/cardSlider/section/audiobooks.tsx b/src/components/organisms/cardSlider/section/audiobooks.tsx index 525bc4a8f..48a076230 100644 --- a/src/components/organisms/cardSlider/section/audiobooks.tsx +++ b/src/components/organisms/cardSlider/section/audiobooks.tsx @@ -17,7 +17,7 @@ export default function Audiobooks(): JSX.Element { infiniteQuery={useInfiniteGetSectionAudiobooksQuery} heading={intl.formatMessage({ id: 'organismSection__audiobooksHeading', - defaultMessage: 'Audiobooks', + defaultMessage: 'Discover Books', })} previous={intl.formatMessage({ id: 'organismSection__audiobooksPrevious', diff --git a/src/components/organisms/cardSlider/section/egwAudiobooks.graphql b/src/components/organisms/cardSlider/section/egwAudiobooks.graphql new file mode 100644 index 000000000..47f11d0cf --- /dev/null +++ b/src/components/organisms/cardSlider/section/egwAudiobooks.graphql @@ -0,0 +1,21 @@ +query getSectionEgwAudiobooks( + $language: Language! + $first: Int! = 3 + $after: String = null +) { + audiobooks( + language: $language + first: $first + after: $after + orderBy: [{ field: RECORDING_PUBLISHED_AT, direction: DESC }] + persons: [{ personId: 128 }] + ) { + nodes { + ...cardSequence + } + pageInfo { + hasNextPage + endCursor + } + } +} diff --git a/src/components/organisms/cardSlider/section/egwAudiobooks.tsx b/src/components/organisms/cardSlider/section/egwAudiobooks.tsx new file mode 100644 index 000000000..f51796926 --- /dev/null +++ b/src/components/organisms/cardSlider/section/egwAudiobooks.tsx @@ -0,0 +1,36 @@ +import React from 'react'; +import { useIntl } from 'react-intl'; + +import { CardSequenceFragment } from '~src/components/molecules/card/__generated__/sequence'; +import CardSequence from '~src/components/molecules/card/sequence'; +import root from '~src/lib/routes'; +import { useLanguageId } from '~src/lib/useLanguageId'; + +import { useInfiniteGetSectionEgwAudiobooksQuery } from './__generated__/egwAudiobooks'; +import Section from './index'; + +export default function EgwAudiobooks(): JSX.Element { + const intl = useIntl(); + const lang = useLanguageId(); + return ( +
( + + )} + /> + ); +} diff --git a/src/components/organisms/cardSlider/section/presenters.tsx b/src/components/organisms/cardSlider/section/presenters.tsx index 391e98420..a67d3daad 100644 --- a/src/components/organisms/cardSlider/section/presenters.tsx +++ b/src/components/organisms/cardSlider/section/presenters.tsx @@ -38,7 +38,7 @@ export default function Presenters(props: { })} seeAllUrl={root.lang(lang).presenters.get()} Card={(p: { node: CardPersonFragment }) => ( - + )} /> ); diff --git a/src/containers/audiobook/egwList.graphql b/src/containers/audiobook/egwList.graphql new file mode 100644 index 000000000..c0b9d6936 --- /dev/null +++ b/src/containers/audiobook/egwList.graphql @@ -0,0 +1,28 @@ +query getEgwAudiobookListPageData( + $language: Language! + $first: Int = 12 + $offset: Int = 0 +) { + audiobooks( + language: $language + first: $first + offset: $offset + orderBy: [{ field: TITLE, direction: ASC }] + persons: [{ personId: 128 }] + ) { + nodes { + ...cardSequence + } + aggregate { + count + } + } +} + +query getEgwAudiobookListPathsData($language: Language!) { + audiobooks(language: $language) { + aggregate { + count + } + } +} diff --git a/src/containers/audiobook/egwList.tsx b/src/containers/audiobook/egwList.tsx new file mode 100644 index 000000000..6b6f4dfb3 --- /dev/null +++ b/src/containers/audiobook/egwList.tsx @@ -0,0 +1,46 @@ +import React from 'react'; +import { FormattedMessage } from 'react-intl'; + +import withFailStates from '~components/HOCs/withFailStates'; +import CardSequence from '~components/molecules/card/sequence'; +import PaginatedCardList from '~components/organisms/paginatedCardList'; +import { PaginatedProps } from '~lib/getPaginatedStaticProps'; +import root from '~lib/routes'; + +import { GetEgwAudiobookListPageDataQuery } from './__generated__/egwList'; + +export type EgwAudiobooksListProps = PaginatedProps< + NonNullable[0], + GetEgwAudiobookListPageDataQuery +>; + +export function EgwAudiobooksList({ + nodes, + pagination, +}: EgwAudiobooksListProps): JSX.Element { + return ( + + } + makeRoute={(l, i) => root.lang(l).egwbooks.page(i).get()} + > + {nodes.map((node) => ( + + ))} + + ); +} + +export default withFailStates(EgwAudiobooksList, { + useShould404: ({ nodes }) => !nodes.length, +}); diff --git a/src/containers/audiobook/list.tsx b/src/containers/audiobook/list.tsx index a91b3e9e0..7aa3ac769 100644 --- a/src/containers/audiobook/list.tsx +++ b/src/containers/audiobook/list.tsx @@ -22,10 +22,7 @@ export function AudiobooksList({ + } makeRoute={(l, i) => root.lang(l).books.page(i).get()} > diff --git a/src/containers/collection/detail.tsx b/src/containers/collection/detail.tsx index de0094b75..72db480aa 100644 --- a/src/containers/collection/detail.tsx +++ b/src/containers/collection/detail.tsx @@ -244,7 +244,11 @@ function CollectionDetail({ {persons.nodes.map((person) => ( - + ))} {persons.pageInfo.hasNextPage && ( diff --git a/src/containers/collection/presenters.tsx b/src/containers/collection/presenters.tsx index a4ce7fe31..604c23491 100644 --- a/src/containers/collection/presenters.tsx +++ b/src/containers/collection/presenters.tsx @@ -43,7 +43,7 @@ function CollectionPresenters({ {nodes.map((node) => ( - + ))} + + + {nodes.map((node) => ( - + ))} ); diff --git a/src/lib/routes/egwbooks.ts b/src/lib/routes/egwbooks.ts new file mode 100644 index 000000000..bc7e8f640 --- /dev/null +++ b/src/lib/routes/egwbooks.ts @@ -0,0 +1,12 @@ +import { Scalars } from '~src/__generated__/graphql'; + +import node from './primatives/node'; + +const egwbooks = (r: string) => ({ + id: (bookId: Scalars['ID']['output']) => + node(`${r}/${bookId}`, (r) => ({ + feed: node(`${r}/feed.xml`), + })), +}); + +export default egwbooks; diff --git a/src/lib/routes/index.ts b/src/lib/routes/index.ts index 2c49fe032..e366f04cb 100644 --- a/src/lib/routes/index.ts +++ b/src/lib/routes/index.ts @@ -5,6 +5,7 @@ import books from './books'; import conferences from './conferences'; import contact from './contact'; import discover from './discover'; +import egwbooks from './egwbooks'; import library from './library'; import presenters from './presenters'; import node from './primatives/node'; @@ -24,6 +25,7 @@ const namespaces = (r: string) => ({ bibles: node(`${r}/bibles`, bibles), blog: paginatedNode(`${r}/blog`), books: paginatedNode(`${r}/books`, books), + egwbooks: paginatedNode(`${r}/egwbooks`, egwbooks), conferences: paginatedNode(`${r}/conferences`, conferences), contact: node(`${r}/contact`, contact), discover: node(`${r}/discover`, discover), diff --git a/src/lib/useNavigationItems.tsx b/src/lib/useNavigationItems.tsx index ef774180a..dde3806cf 100644 --- a/src/lib/useNavigationItems.tsx +++ b/src/lib/useNavigationItems.tsx @@ -196,12 +196,21 @@ export function useNavigationItems(): INavigationItem[] { { key: 'stories', href: root.lang(languageRoute).stories.albums.get(), - Icon: iconMap.fa_feather, + Icon: iconMap.fa_seedling, label: intl.formatMessage({ id: `header__navItemCollections-stories`, defaultMessage: 'Stories', }), }, + { + key: 'egwbooks', + href: root.lang(languageRoute).egwbooks.get(), + Icon: iconMap.fa_feather, + label: intl.formatMessage({ + id: `header__navItemCollections-egwbooks`, + defaultMessage: 'Ellen G. White', + }), + }, { key: 'books', href: root.lang(languageRoute).books.get(), @@ -211,6 +220,7 @@ export function useNavigationItems(): INavigationItem[] { defaultMessage: 'Books', }), }, + { key: 'songs', href: root.lang(languageRoute).songs.albums.get(), diff --git a/src/pages/[language]/books/page/[i].tsx b/src/pages/[language]/books/page/[i].tsx index 97779cb87..64d1808b7 100644 --- a/src/pages/[language]/books/page/[i].tsx +++ b/src/pages/[language]/books/page/[i].tsx @@ -33,7 +33,7 @@ export async function getStaticProps({ () => ({ title: intl.formatMessage({ id: 'books__title', - defaultMessage: 'All Audiobooks', + defaultMessage: 'Books', }), }) ); diff --git a/src/pages/[language]/discover/collections.ts b/src/pages/[language]/discover/collections.ts index 84d5d8431..a065db7f2 100644 --- a/src/pages/[language]/discover/collections.ts +++ b/src/pages/[language]/discover/collections.ts @@ -37,6 +37,7 @@ export async function getStaticProps({ getSectionConferences: { language }, getSectionPresenters: { language }, getSectionStorySeasons: { language }, + getSectionEgwAudiobooks: { language }, getSectionAudiobooks: { language }, getSectionSponsors: { language }, getSectionScriptureSongs: { language }, diff --git a/src/pages/[language]/egwbooks/[id]/[[...slugs]].tsx b/src/pages/[language]/egwbooks/[id]/[[...slugs]].tsx new file mode 100644 index 000000000..0462f5e7c --- /dev/null +++ b/src/pages/[language]/egwbooks/[id]/[[...slugs]].tsx @@ -0,0 +1,58 @@ +import { + GetStaticPathsResult, + GetStaticPropsContext, + GetStaticPropsResult, +} from 'next'; + +import { + getAudiobookDetailPageData, + getAudiobookDetailPathsData, +} from '~containers/audiobook/__generated__/detail'; +import AudiobookDetail, { + AudiobookDetailProps, +} from '~containers/audiobook/detail'; +import { IBaseProps } from '~containers/base'; +import { REVALIDATE, REVALIDATE_FAILURE } from '~lib/constants'; +import { getDetailStaticPaths } from '~lib/getDetailStaticPaths'; +import { getLanguageIdByRouteOrLegacyRoute } from '~lib/getLanguageIdByRouteOrLegacyRoute'; + +export default AudiobookDetail; + +export async function getStaticProps({ + params, +}: GetStaticPropsContext<{ language: string; id: string }>): Promise< + GetStaticPropsResult +> { + const id = params?.id as string; + + const { audiobook: sequence } = await getAudiobookDetailPageData({ + id, + }).catch(() => ({ + audiobook: null, + })); + if ( + sequence?.language !== getLanguageIdByRouteOrLegacyRoute(params?.language) + ) { + return { + notFound: true, + revalidate: REVALIDATE_FAILURE, + }; + } + + return { + props: { + sequence, + title: sequence?.title, + canonicalUrl: sequence?.canonicalUrl, + }, + revalidate: REVALIDATE, + }; +} + +export async function getStaticPaths(): Promise { + return getDetailStaticPaths( + getAudiobookDetailPathsData, + (d) => d.audiobooks.nodes, + (l, { canonicalPath }) => canonicalPath + ); +} diff --git a/src/pages/[language]/egwbooks/[id]/feed.xml/index.ts b/src/pages/[language]/egwbooks/[id]/feed.xml/index.ts new file mode 100644 index 000000000..33b89cc4f --- /dev/null +++ b/src/pages/[language]/egwbooks/[id]/feed.xml/index.ts @@ -0,0 +1,105 @@ +import { GetServerSidePropsContext, GetServerSidePropsResult } from 'next'; + +import { getAudiobookFeedData } from '~containers/audiobook/__generated__/detail'; +import { generateFeed, sendRSSHeaders } from '~lib/generateFeed'; +import getIntl from '~lib/getIntl'; +import { getLanguageIdByRouteOrLegacyRoute } from '~lib/getLanguageIdByRouteOrLegacyRoute'; +import { SequenceContentType } from '~src/__generated__/graphql'; + +export default (): void => void 0; + +type BookFeedDescription = { + title: string; + recordings: { + nodes: + | { + authors: { + name: string; + }[]; + narrators: { + name: string; + }[]; + }[] + | null; + }; +}; + +export const formatBooksDescription = async ( + languageRoute: string, + sequence: BookFeedDescription +): Promise => { + const intl = await getIntl(languageRoute); + const formatNameString = (persons: { name: string }[]) => + [...new Set(persons.map((p) => p.name))].join(', '); + const recordings = sequence.recordings.nodes || []; + return intl.formatMessage( + { + id: 'storyAlbumsFeed__description', + defaultMessage: '{title}, by {authors}, narrated by {narrators}', + }, + { + title: sequence.title, + authors: formatNameString( + recordings.reduce<{ name: string }[]>( + (carry, { authors }) => [...carry, ...authors], + [] + ) + ), + narrators: formatNameString( + recordings.reduce<{ name: string }[]>( + (carry, { narrators }) => [...carry, ...narrators], + [] + ) + ), + } + ); +}; + +export async function getServerSideProps({ + params, + res, +}: GetServerSidePropsContext<{ language: string; id: string }>): Promise< + GetServerSidePropsResult> +> { + const id = params?.id as string; + const languageRoute = params?.language as string; + + const { sequence } = await getAudiobookFeedData({ + id, + }).catch(() => ({ + sequence: null, + })); + + if ( + !sequence || + sequence.language !== getLanguageIdByRouteOrLegacyRoute(languageRoute) || + (sequence.contentType !== SequenceContentType.Audiobook && + sequence.contentType !== SequenceContentType.StorySeason) + ) { + return { + notFound: true, + }; + } + + if (res) { + sendRSSHeaders(res); + + const feed = await generateFeed( + languageRoute, + { + link: sequence.canonicalUrl, + title: sequence.title, + description: await formatBooksDescription(languageRoute, sequence), + image: sequence.image?.url, + }, + sequence.recordings.nodes || [] + ); + res.write(feed); + + res.end(); + } + + return { + props: {}, + }; +} diff --git a/src/pages/[language]/egwbooks/page/[i].tsx b/src/pages/[language]/egwbooks/page/[i].tsx new file mode 100644 index 000000000..c3a81e268 --- /dev/null +++ b/src/pages/[language]/egwbooks/page/[i].tsx @@ -0,0 +1,48 @@ +import { + GetStaticPathsResult, + GetStaticPropsContext, + GetStaticPropsResult, +} from 'next'; + +import { + getEgwAudiobookListPageData, + getEgwAudiobookListPathsData, +} from '~containers/audiobook/__generated__/egwList'; +import EgwAudiobooksList, { + EgwAudiobooksListProps, +} from '~containers/audiobook/egwList'; +import getIntl from '~lib/getIntl'; +import { getLanguageIdByRoute } from '~lib/getLanguageIdByRoute'; +import { getNumberedStaticPaths } from '~lib/getNumberedStaticPaths'; +import { getPaginatedStaticProps } from '~lib/getPaginatedStaticProps'; + +export default EgwAudiobooksList; + +export async function getStaticProps({ + params, +}: GetStaticPropsContext<{ + i: string; + language: string; +}>): Promise> { + const intl = await getIntl(getLanguageIdByRoute(params?.language)); + return getPaginatedStaticProps( + params, + getEgwAudiobookListPageData, + (d) => d.audiobooks.nodes, + (d) => d.audiobooks.aggregate?.count, + () => ({ + title: intl.formatMessage({ + id: 'egwbooks__title', + defaultMessage: 'Ellen G. White', + }), + }) + ); +} + +export async function getStaticPaths(): Promise { + return getNumberedStaticPaths( + 'egwbooks', + getEgwAudiobookListPathsData, + (d) => d.audiobooks.aggregate?.count + ); +} diff --git a/src/pages/[language]/egwbooks/tracks/[id]/[[...slugs]].tsx b/src/pages/[language]/egwbooks/tracks/[id]/[[...slugs]].tsx new file mode 100644 index 000000000..3ae34275d --- /dev/null +++ b/src/pages/[language]/egwbooks/tracks/[id]/[[...slugs]].tsx @@ -0,0 +1,58 @@ +import { + GetStaticPathsResult, + GetStaticPropsContext, + GetStaticPropsResult, +} from 'next'; + +import { + getAudiobookTrackDetailData, + getAudiobookTrackDetailStaticPaths, +} from '~containers/audiobook/tracks/__generated__/detail'; +import AudiobookTrackDetail, { + AudiobookTrackDetailProps, +} from '~containers/audiobook/tracks/detail'; +import { IBaseProps } from '~containers/base'; +import { REVALIDATE, REVALIDATE_FAILURE } from '~lib/constants'; +import { getDetailStaticPaths } from '~lib/getDetailStaticPaths'; +import { getLanguageIdByRouteOrLegacyRoute } from '~lib/getLanguageIdByRouteOrLegacyRoute'; + +export default AudiobookTrackDetail; + +export async function getStaticProps({ + params, +}: GetStaticPropsContext<{ language: string; id: string }>): Promise< + GetStaticPropsResult +> { + const id = params?.id as string; + const { audiobookTrack: recording } = await getAudiobookTrackDetailData({ + id, + }).catch(() => ({ + audiobookTrack: null, + })); + + if ( + recording?.language !== getLanguageIdByRouteOrLegacyRoute(params?.language) + ) { + return { + notFound: true, + revalidate: REVALIDATE_FAILURE, + }; + } + + return { + props: { + recording, + title: recording?.title, + canonicalUrl: recording?.canonicalUrl, + }, + revalidate: REVALIDATE, + }; +} + +export async function getStaticPaths(): Promise { + return getDetailStaticPaths( + getAudiobookTrackDetailStaticPaths, + (d) => d.audiobookTracks.nodes, + (baseUrl, { canonicalPath }) => canonicalPath + ); +} diff --git a/src/styles/common.scss b/src/styles/common.scss index 2c3f00de8..c0ce72555 100644 --- a/src/styles/common.scss +++ b/src/styles/common.scss @@ -1,6 +1,7 @@ $serif: ivyjournal, serif; // T&S Named Colors +$ts-egw: #3d1212; $ts-white: #ffffff; $ts-bibleB: #f1f2f4; $ts-bibleH: #000000; @@ -27,6 +28,7 @@ $ts-bufferTone: #a5afb8; $ts-cccccc: #cccccc; +$ts-darkened-egw: #2c0d0d; $ts-darkened-white: #f8f8f8; $ts-darkened-bibleB: #e4e7ea; $ts-darkened-bibleH: #292929; From 38ef67a5cab815aa4cc7fad0893d924d8d5a86cb Mon Sep 17 00:00:00 2001 From: Okeino McGowan Date: Fri, 6 Oct 2023 08:54:06 -0400 Subject: [PATCH 02/16] Co-authored-by: Nathan Arthur --- next.config.js | 2 +- src/components/molecules/card/sequence.module.scss | 1 + src/components/molecules/card/sequence.tsx | 2 +- src/containers/discover/collections.tsx | 2 +- src/containers/discover/index.tsx | 2 +- src/lib/routes/index.ts | 2 +- src/lib/useNavigationItems.tsx | 2 +- src/pages/[language]/discover/collections.ts | 2 +- src/pages/[language]/egwbooks/page/[i].tsx | 2 +- src/styles/common.scss | 2 +- 10 files changed, 10 insertions(+), 9 deletions(-) diff --git a/next.config.js b/next.config.js index 0e899d2bb..a1703b730 100644 --- a/next.config.js +++ b/next.config.js @@ -113,7 +113,7 @@ module.exports = withBundleAnalyzer( { source: '/:lang/audiobooks/egwbooks/podcast/:seriesId/latest/:slug', destination: '/:lang/egwbooks/:seriesId/feed.xml', - permanent: true, + permanent: true, //egw }, { source: '/:lang/music/browse/podcast/:seriesId/latest/:slug', diff --git a/src/components/molecules/card/sequence.module.scss b/src/components/molecules/card/sequence.module.scss index 8460c248e..513bd6af2 100644 --- a/src/components/molecules/card/sequence.module.scss +++ b/src/components/molecules/card/sequence.module.scss @@ -9,6 +9,7 @@ $container-padding: 16px; overflow: hidden; transition-duration: $transition-medium; &.EGWAUDIOBOOK { + //egw --sequenceHeadingColor: #{$ts-white}; --sequenceTextColor: #{$ts-white}; --sequenceTextSecondaryColor: #{$ts-lightTone}; diff --git a/src/components/molecules/card/sequence.tsx b/src/components/molecules/card/sequence.tsx index ff9af5faf..8b2252a44 100644 --- a/src/components/molecules/card/sequence.tsx +++ b/src/components/molecules/card/sequence.tsx @@ -34,7 +34,7 @@ interface CardCollectionProps { sequence: CardSequenceFragment; recordings?: CardRecordingFragment[] | null; slim?: boolean; - egw?: boolean; + egw?: boolean; //egw } export default function CardSequence({ diff --git a/src/containers/discover/collections.tsx b/src/containers/discover/collections.tsx index 12dd2ed52..d4c4370b8 100644 --- a/src/containers/discover/collections.tsx +++ b/src/containers/discover/collections.tsx @@ -5,7 +5,7 @@ import LineHeading from '~components/atoms/lineHeading'; import CardFavoriteEntity from '~components/molecules/card/favoriteEntity'; import Audiobooks from '~src/components/organisms/cardSlider/section/audiobooks'; import Conferences from '~src/components/organisms/cardSlider/section/conferences'; -import EgwAudiobooks from '~src/components/organisms/cardSlider/section/egwAudiobooks'; +import EgwAudiobooks from '~src/components/organisms/cardSlider/section/egwAudiobooks'; //egw import Presenters from '~src/components/organisms/cardSlider/section/presenters'; import ScriptureSongs from '~src/components/organisms/cardSlider/section/scriptureSongs'; import Series from '~src/components/organisms/cardSlider/section/series'; diff --git a/src/containers/discover/index.tsx b/src/containers/discover/index.tsx index 18e115ec4..04bcfc70e 100644 --- a/src/containers/discover/index.tsx +++ b/src/containers/discover/index.tsx @@ -11,7 +11,7 @@ import TrendingMusic from '~components/organisms/cardSlider/section/trendingMusi import TrendingTeachings from '~components/organisms/cardSlider/section/trendingTeachings'; import Audiobooks from '~src/components/organisms/cardSlider/section/audiobooks'; import BibleBooks from '~src/components/organisms/cardSlider/section/bibleBooks'; -import EgwAudiobooks from '~src/components/organisms/cardSlider/section/egwAudiobooks'; +import EgwAudiobooks from '~src/components/organisms/cardSlider/section/egwAudiobooks'; //egw import Presenters from '~src/components/organisms/cardSlider/section/presenters'; export default function Discover(): JSX.Element { diff --git a/src/lib/routes/index.ts b/src/lib/routes/index.ts index e366f04cb..4d8441f94 100644 --- a/src/lib/routes/index.ts +++ b/src/lib/routes/index.ts @@ -5,7 +5,7 @@ import books from './books'; import conferences from './conferences'; import contact from './contact'; import discover from './discover'; -import egwbooks from './egwbooks'; +import egwbooks from './egwbooks'; //egw import library from './library'; import presenters from './presenters'; import node from './primatives/node'; diff --git a/src/lib/useNavigationItems.tsx b/src/lib/useNavigationItems.tsx index dde3806cf..047d3845f 100644 --- a/src/lib/useNavigationItems.tsx +++ b/src/lib/useNavigationItems.tsx @@ -207,7 +207,7 @@ export function useNavigationItems(): INavigationItem[] { href: root.lang(languageRoute).egwbooks.get(), Icon: iconMap.fa_feather, label: intl.formatMessage({ - id: `header__navItemCollections-egwbooks`, + id: `header__navItemCollections-egwbooks`, //egw defaultMessage: 'Ellen G. White', }), }, diff --git a/src/pages/[language]/discover/collections.ts b/src/pages/[language]/discover/collections.ts index a065db7f2..67862e675 100644 --- a/src/pages/[language]/discover/collections.ts +++ b/src/pages/[language]/discover/collections.ts @@ -37,7 +37,7 @@ export async function getStaticProps({ getSectionConferences: { language }, getSectionPresenters: { language }, getSectionStorySeasons: { language }, - getSectionEgwAudiobooks: { language }, + getSectionEgwAudiobooks: { language }, //egw getSectionAudiobooks: { language }, getSectionSponsors: { language }, getSectionScriptureSongs: { language }, diff --git a/src/pages/[language]/egwbooks/page/[i].tsx b/src/pages/[language]/egwbooks/page/[i].tsx index c3a81e268..ddb79a24b 100644 --- a/src/pages/[language]/egwbooks/page/[i].tsx +++ b/src/pages/[language]/egwbooks/page/[i].tsx @@ -5,7 +5,7 @@ import { } from 'next'; import { - getEgwAudiobookListPageData, + getEgwAudiobookListPageData, //egw getEgwAudiobookListPathsData, } from '~containers/audiobook/__generated__/egwList'; import EgwAudiobooksList, { diff --git a/src/styles/common.scss b/src/styles/common.scss index c0ce72555..d7d8c51d3 100644 --- a/src/styles/common.scss +++ b/src/styles/common.scss @@ -1,7 +1,7 @@ $serif: ivyjournal, serif; // T&S Named Colors -$ts-egw: #3d1212; +$ts-egw: #3d1212; //egw $ts-white: #ffffff; $ts-bibleB: #f1f2f4; $ts-bibleH: #000000; From b78c2fd19ce095dbadb94c47bfea41ca5d2332de Mon Sep 17 00:00:00 2001 From: Okeino McGowan Date: Mon, 9 Oct 2023 10:27:05 -0400 Subject: [PATCH 03/16] Egw audiobook list.spec updated --- src/containers/audiobook/egwList.spec.tsx | 157 ++++++++++++++++++++++ src/containers/audiobook/egwList.tsx | 3 + src/containers/audiobook/list.spec.tsx | 2 +- 3 files changed, 161 insertions(+), 1 deletion(-) create mode 100644 src/containers/audiobook/egwList.spec.tsx diff --git a/src/containers/audiobook/egwList.spec.tsx b/src/containers/audiobook/egwList.spec.tsx new file mode 100644 index 000000000..c9412cb00 --- /dev/null +++ b/src/containers/audiobook/egwList.spec.tsx @@ -0,0 +1,157 @@ +import { screen } from '@testing-library/react'; +import { when } from 'jest-when'; +import { __loadRouter } from 'next/router'; +import React from 'react'; + +import { fetchApi } from '~lib/api/fetchApi'; +import { ENTRIES_PER_PAGE } from '~lib/constants'; +import renderWithProviders from '~lib/test/renderWithProviders'; +import EgwAudiobooksList, { + getStaticPaths, + getStaticProps, +} from '~pages/[language]/egwbooks/page/[i]'; +import { SequenceContentType } from '~src/__generated__/graphql'; + +import { + GetEgwAudiobookListPageDataDocument, + GetEgwAudiobookListPageDataQuery, + GetEgwAudiobookListPathsDataDocument, +} from './__generated__/egwList'; + +async function renderPage( + params: Partial[0]['params']> = {} +) { + __loadRouter({ query: params }); + + const { props } = (await getStaticProps({ + params: { language: 'en', i: '1', ...params }, + })) as any; + + return renderWithProviders(, undefined); +} + +function loadData(data: Partial = {}) { + when(fetchApi) + .calledWith(GetEgwAudiobookListPageDataDocument, expect.anything()) + .mockResolvedValue({ + audiobooks: { + nodes: [ + { + id: 'the_book_id', + title: 'the_book_title', + canonicalPath: 'the_book_path', + contentType: SequenceContentType.Audiobook, + sequenceWriters: [], + allRecordings: {}, + }, + ], + aggregate: { + count: 100, + }, + }, + ...data, + }); +} + +describe('audiobook list page', () => { + it('renders', async () => { + await renderPage(); + + expect(fetchApi).toBeCalledWith(GetEgwAudiobookListPageDataDocument, { + variables: { + language: 'ENGLISH', + first: ENTRIES_PER_PAGE, + offset: 0, + }, + }); + }); + + it('lists book titles', async () => { + loadData(); + + await renderPage(); + + expect(screen.getByText('the_book_title')).toBeInTheDocument(); + }); + + it('generates static paths', async () => { + when(fetchApi) + .calledWith(GetEgwAudiobookListPathsDataDocument, expect.anything()) + .mockResolvedValue({ + audiobooks: { + aggregate: { + count: 1, + }, + }, + }); + + const { paths } = await getStaticPaths(); + + expect(paths).toContain('/en/egwbooks/page/1'); + }); + + it('renders pagination', async () => { + loadData(); + + await renderPage(); + + expect(screen.getByText('1')).toBeInTheDocument(); + }); + + it('links pagination properly', async () => { + loadData(); + + await renderPage(); + + const link = screen.getByText('1') as HTMLLinkElement; + + expect(link.href).toContain('/en/egwbooks'); + }); + + it('localizes pagination links', async () => { + loadData(); + + await renderPage({ language: 'es' }); + + const link = screen.getByText('1') as HTMLLinkElement; + + expect(link.href).toContain('/es/egwbooks'); + }); + + it('renders 404', async () => { + await renderPage(); + + expect(screen.getByText('Sorry!')).toBeInTheDocument(); + }); + + it('calculates page count correctly', async () => { + loadData(); + + await renderPage(); + + expect(screen.queryByText('0')).not.toBeInTheDocument(); + }); + + it('links entries', async () => { + loadData(); + + await renderPage(); + + const link = screen.getByRole('link', { + name: /the_book_title/, + }); + + expect(link).toHaveAttribute( + 'href', + expect.stringContaining('the_book_path') + ); + }); + + it('renders page title', async () => { + loadData(); + + await renderPage(); + + expect(screen.getByText('Ellen G. White')).toBeInTheDocument(); + }); +}); diff --git a/src/containers/audiobook/egwList.tsx b/src/containers/audiobook/egwList.tsx index 6b6f4dfb3..a6632fa82 100644 --- a/src/containers/audiobook/egwList.tsx +++ b/src/containers/audiobook/egwList.tsx @@ -30,12 +30,15 @@ export function EgwAudiobooksList({ makeRoute={(l, i) => root.lang(l).egwbooks.page(i).get()} > {nodes.map((node) => ( + + + ))} ); diff --git a/src/containers/audiobook/list.spec.tsx b/src/containers/audiobook/list.spec.tsx index b7b8ad93e..9fb9556b3 100644 --- a/src/containers/audiobook/list.spec.tsx +++ b/src/containers/audiobook/list.spec.tsx @@ -152,6 +152,6 @@ describe('audiobook list page', () => { await renderPage(); - expect(screen.getByText('All Audiobooks')).toBeInTheDocument(); + expect(screen.getByText('Books')).toBeInTheDocument(); }); }); From de9c48d60f0305b286d42c8810fdc1bcafb1f25f Mon Sep 17 00:00:00 2001 From: Okeino McGowan Date: Mon, 9 Oct 2023 10:30:07 -0400 Subject: [PATCH 04/16] small test change to egwList --- src/containers/audiobook/egwList.tsx | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/containers/audiobook/egwList.tsx b/src/containers/audiobook/egwList.tsx index a6632fa82..6b6f4dfb3 100644 --- a/src/containers/audiobook/egwList.tsx +++ b/src/containers/audiobook/egwList.tsx @@ -30,15 +30,12 @@ export function EgwAudiobooksList({ makeRoute={(l, i) => root.lang(l).egwbooks.page(i).get()} > {nodes.map((node) => ( - - - ))} ); From 64b85eaa4209042a710fa12b1caf605f813c4953 Mon Sep 17 00:00:00 2001 From: Okeino McGowan Date: Mon, 9 Oct 2023 10:50:02 -0400 Subject: [PATCH 05/16] removed egwlist spec for testing --- src/containers/audiobook/egwList.spec.tsx | 284 +++++++++++----------- 1 file changed, 142 insertions(+), 142 deletions(-) diff --git a/src/containers/audiobook/egwList.spec.tsx b/src/containers/audiobook/egwList.spec.tsx index c9412cb00..9d6b0353b 100644 --- a/src/containers/audiobook/egwList.spec.tsx +++ b/src/containers/audiobook/egwList.spec.tsx @@ -1,157 +1,157 @@ -import { screen } from '@testing-library/react'; -import { when } from 'jest-when'; -import { __loadRouter } from 'next/router'; -import React from 'react'; - -import { fetchApi } from '~lib/api/fetchApi'; -import { ENTRIES_PER_PAGE } from '~lib/constants'; -import renderWithProviders from '~lib/test/renderWithProviders'; -import EgwAudiobooksList, { - getStaticPaths, - getStaticProps, -} from '~pages/[language]/egwbooks/page/[i]'; -import { SequenceContentType } from '~src/__generated__/graphql'; - -import { - GetEgwAudiobookListPageDataDocument, - GetEgwAudiobookListPageDataQuery, - GetEgwAudiobookListPathsDataDocument, -} from './__generated__/egwList'; - -async function renderPage( - params: Partial[0]['params']> = {} -) { - __loadRouter({ query: params }); - - const { props } = (await getStaticProps({ - params: { language: 'en', i: '1', ...params }, - })) as any; - - return renderWithProviders(, undefined); -} - -function loadData(data: Partial = {}) { - when(fetchApi) - .calledWith(GetEgwAudiobookListPageDataDocument, expect.anything()) - .mockResolvedValue({ - audiobooks: { - nodes: [ - { - id: 'the_book_id', - title: 'the_book_title', - canonicalPath: 'the_book_path', - contentType: SequenceContentType.Audiobook, - sequenceWriters: [], - allRecordings: {}, - }, - ], - aggregate: { - count: 100, - }, - }, - ...data, - }); -} - -describe('audiobook list page', () => { - it('renders', async () => { - await renderPage(); - - expect(fetchApi).toBeCalledWith(GetEgwAudiobookListPageDataDocument, { - variables: { - language: 'ENGLISH', - first: ENTRIES_PER_PAGE, - offset: 0, - }, - }); - }); - - it('lists book titles', async () => { - loadData(); - - await renderPage(); - - expect(screen.getByText('the_book_title')).toBeInTheDocument(); - }); - - it('generates static paths', async () => { - when(fetchApi) - .calledWith(GetEgwAudiobookListPathsDataDocument, expect.anything()) - .mockResolvedValue({ - audiobooks: { - aggregate: { - count: 1, - }, - }, - }); - - const { paths } = await getStaticPaths(); - - expect(paths).toContain('/en/egwbooks/page/1'); - }); - - it('renders pagination', async () => { - loadData(); - - await renderPage(); - - expect(screen.getByText('1')).toBeInTheDocument(); - }); - - it('links pagination properly', async () => { - loadData(); - - await renderPage(); - - const link = screen.getByText('1') as HTMLLinkElement; - - expect(link.href).toContain('/en/egwbooks'); - }); - - it('localizes pagination links', async () => { - loadData(); +// import { screen } from '@testing-library/react'; +// import { when } from 'jest-when'; +// import { __loadRouter } from 'next/router'; +// import React from 'react'; + +// import { fetchApi } from '~lib/api/fetchApi'; +// import { ENTRIES_PER_PAGE } from '~lib/constants'; +// import renderWithProviders from '~lib/test/renderWithProviders'; +// import EgwAudiobooksList, { +// getStaticPaths, +// getStaticProps, +// } from '~pages/[language]/egwbooks/page/[i]'; +// import { SequenceContentType } from '~src/__generated__/graphql'; + +// import { +// GetEgwAudiobookListPageDataDocument, +// GetEgwAudiobookListPageDataQuery, +// GetEgwAudiobookListPathsDataDocument, +// } from './__generated__/egwList'; + +// async function renderPage( +// params: Partial[0]['params']> = {} +// ) { +// __loadRouter({ query: params }); + +// const { props } = (await getStaticProps({ +// params: { language: 'en', i: '1', ...params }, +// })) as any; + +// return renderWithProviders(, undefined); +// } + +// function loadData(data: Partial = {}) { +// when(fetchApi) +// .calledWith(GetEgwAudiobookListPageDataDocument, expect.anything()) +// .mockResolvedValue({ +// audiobooks: { +// nodes: [ +// { +// id: 'the_book_id', +// title: 'the_book_title', +// canonicalPath: 'the_book_path', +// contentType: SequenceContentType.Audiobook, +// sequenceWriters: [], +// allRecordings: {}, +// }, +// ], +// aggregate: { +// count: 100, +// }, +// }, +// ...data, +// }); +// } + +// describe('audiobook list page', () => { +// it('renders', async () => { +// await renderPage(); + +// expect(fetchApi).toBeCalledWith(GetEgwAudiobookListPageDataDocument, { +// variables: { +// language: 'ENGLISH', +// first: ENTRIES_PER_PAGE, +// offset: 0, +// }, +// }); +// }); + +// it('lists book titles', async () => { +// loadData(); + +// await renderPage(); + +// expect(screen.getByText('the_book_title')).toBeInTheDocument(); +// }); + +// it('generates static paths', async () => { +// when(fetchApi) +// .calledWith(GetEgwAudiobookListPathsDataDocument, expect.anything()) +// .mockResolvedValue({ +// audiobooks: { +// aggregate: { +// count: 1, +// }, +// }, +// }); + +// const { paths } = await getStaticPaths(); + +// expect(paths).toContain('/en/egwbooks/page/1'); +// }); + +// it('renders pagination', async () => { +// loadData(); + +// await renderPage(); + +// expect(screen.getByText('1')).toBeInTheDocument(); +// }); + +// it('links pagination properly', async () => { +// loadData(); + +// await renderPage(); + +// const link = screen.getByText('1') as HTMLLinkElement; + +// expect(link.href).toContain('/en/egwbooks'); +// }); + +// it('localizes pagination links', async () => { +// loadData(); - await renderPage({ language: 'es' }); +// await renderPage({ language: 'es' }); - const link = screen.getByText('1') as HTMLLinkElement; +// const link = screen.getByText('1') as HTMLLinkElement; - expect(link.href).toContain('/es/egwbooks'); - }); +// expect(link.href).toContain('/es/egwbooks'); +// }); - it('renders 404', async () => { - await renderPage(); +// it('renders 404', async () => { +// await renderPage(); - expect(screen.getByText('Sorry!')).toBeInTheDocument(); - }); +// expect(screen.getByText('Sorry!')).toBeInTheDocument(); +// }); - it('calculates page count correctly', async () => { - loadData(); +// it('calculates page count correctly', async () => { +// loadData(); - await renderPage(); +// await renderPage(); - expect(screen.queryByText('0')).not.toBeInTheDocument(); - }); +// expect(screen.queryByText('0')).not.toBeInTheDocument(); +// }); - it('links entries', async () => { - loadData(); +// it('links entries', async () => { +// loadData(); - await renderPage(); +// await renderPage(); - const link = screen.getByRole('link', { - name: /the_book_title/, - }); +// const link = screen.getByRole('link', { +// name: /the_book_title/, +// }); - expect(link).toHaveAttribute( - 'href', - expect.stringContaining('the_book_path') - ); - }); +// expect(link).toHaveAttribute( +// 'href', +// expect.stringContaining('the_book_path') +// ); +// }); - it('renders page title', async () => { - loadData(); +// it('renders page title', async () => { +// loadData(); - await renderPage(); +// await renderPage(); - expect(screen.getByText('Ellen G. White')).toBeInTheDocument(); - }); -}); +// expect(screen.getByText('Ellen G. White')).toBeInTheDocument(); +// }); +// }); From 7366dcc9fd9cedc620237e20a02d7d8efdff67e1 Mon Sep 17 00:00:00 2001 From: Okeino McGowan Date: Mon, 9 Oct 2023 11:02:11 -0400 Subject: [PATCH 06/16] deleted egwList.spec --- src/containers/audiobook/egwList.spec.tsx | 157 ---------------------- 1 file changed, 157 deletions(-) delete mode 100644 src/containers/audiobook/egwList.spec.tsx diff --git a/src/containers/audiobook/egwList.spec.tsx b/src/containers/audiobook/egwList.spec.tsx deleted file mode 100644 index 9d6b0353b..000000000 --- a/src/containers/audiobook/egwList.spec.tsx +++ /dev/null @@ -1,157 +0,0 @@ -// import { screen } from '@testing-library/react'; -// import { when } from 'jest-when'; -// import { __loadRouter } from 'next/router'; -// import React from 'react'; - -// import { fetchApi } from '~lib/api/fetchApi'; -// import { ENTRIES_PER_PAGE } from '~lib/constants'; -// import renderWithProviders from '~lib/test/renderWithProviders'; -// import EgwAudiobooksList, { -// getStaticPaths, -// getStaticProps, -// } from '~pages/[language]/egwbooks/page/[i]'; -// import { SequenceContentType } from '~src/__generated__/graphql'; - -// import { -// GetEgwAudiobookListPageDataDocument, -// GetEgwAudiobookListPageDataQuery, -// GetEgwAudiobookListPathsDataDocument, -// } from './__generated__/egwList'; - -// async function renderPage( -// params: Partial[0]['params']> = {} -// ) { -// __loadRouter({ query: params }); - -// const { props } = (await getStaticProps({ -// params: { language: 'en', i: '1', ...params }, -// })) as any; - -// return renderWithProviders(, undefined); -// } - -// function loadData(data: Partial = {}) { -// when(fetchApi) -// .calledWith(GetEgwAudiobookListPageDataDocument, expect.anything()) -// .mockResolvedValue({ -// audiobooks: { -// nodes: [ -// { -// id: 'the_book_id', -// title: 'the_book_title', -// canonicalPath: 'the_book_path', -// contentType: SequenceContentType.Audiobook, -// sequenceWriters: [], -// allRecordings: {}, -// }, -// ], -// aggregate: { -// count: 100, -// }, -// }, -// ...data, -// }); -// } - -// describe('audiobook list page', () => { -// it('renders', async () => { -// await renderPage(); - -// expect(fetchApi).toBeCalledWith(GetEgwAudiobookListPageDataDocument, { -// variables: { -// language: 'ENGLISH', -// first: ENTRIES_PER_PAGE, -// offset: 0, -// }, -// }); -// }); - -// it('lists book titles', async () => { -// loadData(); - -// await renderPage(); - -// expect(screen.getByText('the_book_title')).toBeInTheDocument(); -// }); - -// it('generates static paths', async () => { -// when(fetchApi) -// .calledWith(GetEgwAudiobookListPathsDataDocument, expect.anything()) -// .mockResolvedValue({ -// audiobooks: { -// aggregate: { -// count: 1, -// }, -// }, -// }); - -// const { paths } = await getStaticPaths(); - -// expect(paths).toContain('/en/egwbooks/page/1'); -// }); - -// it('renders pagination', async () => { -// loadData(); - -// await renderPage(); - -// expect(screen.getByText('1')).toBeInTheDocument(); -// }); - -// it('links pagination properly', async () => { -// loadData(); - -// await renderPage(); - -// const link = screen.getByText('1') as HTMLLinkElement; - -// expect(link.href).toContain('/en/egwbooks'); -// }); - -// it('localizes pagination links', async () => { -// loadData(); - -// await renderPage({ language: 'es' }); - -// const link = screen.getByText('1') as HTMLLinkElement; - -// expect(link.href).toContain('/es/egwbooks'); -// }); - -// it('renders 404', async () => { -// await renderPage(); - -// expect(screen.getByText('Sorry!')).toBeInTheDocument(); -// }); - -// it('calculates page count correctly', async () => { -// loadData(); - -// await renderPage(); - -// expect(screen.queryByText('0')).not.toBeInTheDocument(); -// }); - -// it('links entries', async () => { -// loadData(); - -// await renderPage(); - -// const link = screen.getByRole('link', { -// name: /the_book_title/, -// }); - -// expect(link).toHaveAttribute( -// 'href', -// expect.stringContaining('the_book_path') -// ); -// }); - -// it('renders page title', async () => { -// loadData(); - -// await renderPage(); - -// expect(screen.getByText('Ellen G. White')).toBeInTheDocument(); -// }); -// }); From 3eb8e82b328f4f73312258a73760f16f0b35feaa Mon Sep 17 00:00:00 2001 From: Okeino McGowan Date: Mon, 9 Oct 2023 12:42:17 -0400 Subject: [PATCH 07/16] removed egwbooks id folder --- .../[language]/egwbooks/[id]/[[...slugs]].tsx | 58 ---------- .../egwbooks/[id]/feed.xml/index.ts | 105 ------------------ 2 files changed, 163 deletions(-) delete mode 100644 src/pages/[language]/egwbooks/[id]/[[...slugs]].tsx delete mode 100644 src/pages/[language]/egwbooks/[id]/feed.xml/index.ts diff --git a/src/pages/[language]/egwbooks/[id]/[[...slugs]].tsx b/src/pages/[language]/egwbooks/[id]/[[...slugs]].tsx deleted file mode 100644 index 0462f5e7c..000000000 --- a/src/pages/[language]/egwbooks/[id]/[[...slugs]].tsx +++ /dev/null @@ -1,58 +0,0 @@ -import { - GetStaticPathsResult, - GetStaticPropsContext, - GetStaticPropsResult, -} from 'next'; - -import { - getAudiobookDetailPageData, - getAudiobookDetailPathsData, -} from '~containers/audiobook/__generated__/detail'; -import AudiobookDetail, { - AudiobookDetailProps, -} from '~containers/audiobook/detail'; -import { IBaseProps } from '~containers/base'; -import { REVALIDATE, REVALIDATE_FAILURE } from '~lib/constants'; -import { getDetailStaticPaths } from '~lib/getDetailStaticPaths'; -import { getLanguageIdByRouteOrLegacyRoute } from '~lib/getLanguageIdByRouteOrLegacyRoute'; - -export default AudiobookDetail; - -export async function getStaticProps({ - params, -}: GetStaticPropsContext<{ language: string; id: string }>): Promise< - GetStaticPropsResult -> { - const id = params?.id as string; - - const { audiobook: sequence } = await getAudiobookDetailPageData({ - id, - }).catch(() => ({ - audiobook: null, - })); - if ( - sequence?.language !== getLanguageIdByRouteOrLegacyRoute(params?.language) - ) { - return { - notFound: true, - revalidate: REVALIDATE_FAILURE, - }; - } - - return { - props: { - sequence, - title: sequence?.title, - canonicalUrl: sequence?.canonicalUrl, - }, - revalidate: REVALIDATE, - }; -} - -export async function getStaticPaths(): Promise { - return getDetailStaticPaths( - getAudiobookDetailPathsData, - (d) => d.audiobooks.nodes, - (l, { canonicalPath }) => canonicalPath - ); -} diff --git a/src/pages/[language]/egwbooks/[id]/feed.xml/index.ts b/src/pages/[language]/egwbooks/[id]/feed.xml/index.ts deleted file mode 100644 index 33b89cc4f..000000000 --- a/src/pages/[language]/egwbooks/[id]/feed.xml/index.ts +++ /dev/null @@ -1,105 +0,0 @@ -import { GetServerSidePropsContext, GetServerSidePropsResult } from 'next'; - -import { getAudiobookFeedData } from '~containers/audiobook/__generated__/detail'; -import { generateFeed, sendRSSHeaders } from '~lib/generateFeed'; -import getIntl from '~lib/getIntl'; -import { getLanguageIdByRouteOrLegacyRoute } from '~lib/getLanguageIdByRouteOrLegacyRoute'; -import { SequenceContentType } from '~src/__generated__/graphql'; - -export default (): void => void 0; - -type BookFeedDescription = { - title: string; - recordings: { - nodes: - | { - authors: { - name: string; - }[]; - narrators: { - name: string; - }[]; - }[] - | null; - }; -}; - -export const formatBooksDescription = async ( - languageRoute: string, - sequence: BookFeedDescription -): Promise => { - const intl = await getIntl(languageRoute); - const formatNameString = (persons: { name: string }[]) => - [...new Set(persons.map((p) => p.name))].join(', '); - const recordings = sequence.recordings.nodes || []; - return intl.formatMessage( - { - id: 'storyAlbumsFeed__description', - defaultMessage: '{title}, by {authors}, narrated by {narrators}', - }, - { - title: sequence.title, - authors: formatNameString( - recordings.reduce<{ name: string }[]>( - (carry, { authors }) => [...carry, ...authors], - [] - ) - ), - narrators: formatNameString( - recordings.reduce<{ name: string }[]>( - (carry, { narrators }) => [...carry, ...narrators], - [] - ) - ), - } - ); -}; - -export async function getServerSideProps({ - params, - res, -}: GetServerSidePropsContext<{ language: string; id: string }>): Promise< - GetServerSidePropsResult> -> { - const id = params?.id as string; - const languageRoute = params?.language as string; - - const { sequence } = await getAudiobookFeedData({ - id, - }).catch(() => ({ - sequence: null, - })); - - if ( - !sequence || - sequence.language !== getLanguageIdByRouteOrLegacyRoute(languageRoute) || - (sequence.contentType !== SequenceContentType.Audiobook && - sequence.contentType !== SequenceContentType.StorySeason) - ) { - return { - notFound: true, - }; - } - - if (res) { - sendRSSHeaders(res); - - const feed = await generateFeed( - languageRoute, - { - link: sequence.canonicalUrl, - title: sequence.title, - description: await formatBooksDescription(languageRoute, sequence), - image: sequence.image?.url, - }, - sequence.recordings.nodes || [] - ); - res.write(feed); - - res.end(); - } - - return { - props: {}, - }; -} From a2531fd90e7bcbc288fbb4781a957b5c6de40cd2 Mon Sep 17 00:00:00 2001 From: Okeino McGowan Date: Mon, 9 Oct 2023 12:51:52 -0400 Subject: [PATCH 08/16] removed egwbook tracks folder --- .../egwbooks/tracks/[id]/[[...slugs]].tsx | 58 ------------------- 1 file changed, 58 deletions(-) delete mode 100644 src/pages/[language]/egwbooks/tracks/[id]/[[...slugs]].tsx diff --git a/src/pages/[language]/egwbooks/tracks/[id]/[[...slugs]].tsx b/src/pages/[language]/egwbooks/tracks/[id]/[[...slugs]].tsx deleted file mode 100644 index 3ae34275d..000000000 --- a/src/pages/[language]/egwbooks/tracks/[id]/[[...slugs]].tsx +++ /dev/null @@ -1,58 +0,0 @@ -import { - GetStaticPathsResult, - GetStaticPropsContext, - GetStaticPropsResult, -} from 'next'; - -import { - getAudiobookTrackDetailData, - getAudiobookTrackDetailStaticPaths, -} from '~containers/audiobook/tracks/__generated__/detail'; -import AudiobookTrackDetail, { - AudiobookTrackDetailProps, -} from '~containers/audiobook/tracks/detail'; -import { IBaseProps } from '~containers/base'; -import { REVALIDATE, REVALIDATE_FAILURE } from '~lib/constants'; -import { getDetailStaticPaths } from '~lib/getDetailStaticPaths'; -import { getLanguageIdByRouteOrLegacyRoute } from '~lib/getLanguageIdByRouteOrLegacyRoute'; - -export default AudiobookTrackDetail; - -export async function getStaticProps({ - params, -}: GetStaticPropsContext<{ language: string; id: string }>): Promise< - GetStaticPropsResult -> { - const id = params?.id as string; - const { audiobookTrack: recording } = await getAudiobookTrackDetailData({ - id, - }).catch(() => ({ - audiobookTrack: null, - })); - - if ( - recording?.language !== getLanguageIdByRouteOrLegacyRoute(params?.language) - ) { - return { - notFound: true, - revalidate: REVALIDATE_FAILURE, - }; - } - - return { - props: { - recording, - title: recording?.title, - canonicalUrl: recording?.canonicalUrl, - }, - revalidate: REVALIDATE, - }; -} - -export async function getStaticPaths(): Promise { - return getDetailStaticPaths( - getAudiobookTrackDetailStaticPaths, - (d) => d.audiobookTracks.nodes, - (baseUrl, { canonicalPath }) => canonicalPath - ); -} From 3d90469ad07dd842a56b830b19aaee46668e5d8b Mon Sep 17 00:00:00 2001 From: Okeino McGowan Date: Mon, 9 Oct 2023 14:24:36 -0400 Subject: [PATCH 09/16] updated package lock json --- package-lock.json | 396 +++++++++++++++++++++++----------------------- 1 file changed, 195 insertions(+), 201 deletions(-) diff --git a/package-lock.json b/package-lock.json index 6eb3a6e99..4f4372902 100644 --- a/package-lock.json +++ b/package-lock.json @@ -2198,9 +2198,9 @@ } }, "node_modules/@eslint-community/regexpp": { - "version": "4.8.2", - "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.8.2.tgz", - "integrity": "sha512-0MGxAVt1m/ZK+LTJp/j0qF7Hz97D9O/FH9Ms3ltnyIdDD57cbb1ACIQTkbHvNXtWDv5TPq7w5Kq56+cNukbo7g==", + "version": "4.9.1", + "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.9.1.tgz", + "integrity": "sha512-Y27x+MBLjXa+0JWDhykM3+JE+il3kHKAEqabfEWq3SDhZjLYb6/BHL/JKFnH3fe207JaXkyDo685Oc2Glt6ifA==", "dev": true, "engines": { "node": "^12.0.0 || ^14.0.0 || >=16.0.0" @@ -2230,9 +2230,9 @@ } }, "node_modules/@eslint/eslintrc/node_modules/globals": { - "version": "13.22.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-13.22.0.tgz", - "integrity": "sha512-H1Ddc/PbZHTDVJSnj8kWptIRSD6AM3pK+mKytuIVF4uoBV7rshFlhhvA58ceJ5wp3Er58w6zj7bykMpYXt3ETw==", + "version": "13.23.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-13.23.0.tgz", + "integrity": "sha512-XAmF0RjlrjY23MA51q3HltdlGxUpXPvg0GioKiD9X6HD28iMjo2dKC8Vqwm7lne4GNr78+RHTfliktR6ZH09wA==", "dev": true, "dependencies": { "type-fest": "^0.20.2" @@ -2257,9 +2257,9 @@ } }, "node_modules/@eslint/js": { - "version": "8.50.0", - "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.50.0.tgz", - "integrity": "sha512-NCC3zz2+nvYd+Ckfh87rA47zfu2QsQpvc6k1yzTk+b9KzRj0wkGa8LSoGOXN6Zv4lRf/EIoZ80biDh9HOI+RNQ==", + "version": "8.51.0", + "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.51.0.tgz", + "integrity": "sha512-HxjQ8Qn+4SI3/AFv6sOrDB+g6PpUTDwSJiQqOrnneEk8L71161srI9gjzzZvYVbzHiVg/BvcH95+cK/zfIt4pg==", "dev": true, "engines": { "node": "^12.22.0 || ^14.17.0 || >=16.0.0" @@ -5740,23 +5740,23 @@ } }, "node_modules/@next/bundle-analyzer": { - "version": "13.5.3", - "resolved": "https://registry.npmjs.org/@next/bundle-analyzer/-/bundle-analyzer-13.5.3.tgz", - "integrity": "sha512-AUHl9hu/0SNo2TCu9awOGY5hJdQHTPThYbjKk3rmjL04GfYAotn5i5pFQGqe209mbCxtu+QnvMEHLXU4GdFi1Q==", + "version": "13.5.4", + "resolved": "https://registry.npmjs.org/@next/bundle-analyzer/-/bundle-analyzer-13.5.4.tgz", + "integrity": "sha512-2vgmkuSKyTiyI7NorL+zYerxQRvzmSGbCDr2/kVrbKX28a4UNhbYn8/cQW8z6pvx0EncEFpd0GCUA5r9aRLhJg==", "dev": true, "dependencies": { "webpack-bundle-analyzer": "4.7.0" } }, "node_modules/@next/env": { - "version": "13.5.3", - "resolved": "https://registry.npmjs.org/@next/env/-/env-13.5.3.tgz", - "integrity": "sha512-X4te86vsbjsB7iO4usY9jLPtZ827Mbx+WcwNBGUOIuswuTAKQtzsuoxc/6KLxCMvogKG795MhrR1LDhYgDvasg==" + "version": "13.5.4", + "resolved": "https://registry.npmjs.org/@next/env/-/env-13.5.4.tgz", + "integrity": "sha512-LGegJkMvRNw90WWphGJ3RMHMVplYcOfRWf2Be3td3sUa+1AaxmsYyANsA+znrGCBjXJNi4XAQlSoEfUxs/4kIQ==" }, "node_modules/@next/eslint-plugin-next": { - "version": "13.5.3", - "resolved": "https://registry.npmjs.org/@next/eslint-plugin-next/-/eslint-plugin-next-13.5.3.tgz", - "integrity": "sha512-lbZOoEjzSuTtpk9UgV9rOmxYw+PsSfNR+00mZcInqooiDMZ1u+RqT1YQYLsEZPW1kumZoQe5+exkCBtZ2xn0uw==", + "version": "13.5.4", + "resolved": "https://registry.npmjs.org/@next/eslint-plugin-next/-/eslint-plugin-next-13.5.4.tgz", + "integrity": "sha512-vI94U+D7RNgX6XypSyjeFrOzxGlZyxOplU0dVE5norIfZGn/LDjJYPHdvdsR5vN1eRtl6PDAsOHmycFEOljK5A==", "dev": true, "dependencies": { "glob": "7.1.7" @@ -5783,9 +5783,9 @@ } }, "node_modules/@next/swc-darwin-arm64": { - "version": "13.5.3", - "resolved": "https://registry.npmjs.org/@next/swc-darwin-arm64/-/swc-darwin-arm64-13.5.3.tgz", - "integrity": "sha512-6hiYNJxJmyYvvKGrVThzo4nTcqvqUTA/JvKim7Auaj33NexDqSNwN5YrrQu+QhZJCIpv2tULSHt+lf+rUflLSw==", + "version": "13.5.4", + "resolved": "https://registry.npmjs.org/@next/swc-darwin-arm64/-/swc-darwin-arm64-13.5.4.tgz", + "integrity": "sha512-Df8SHuXgF1p+aonBMcDPEsaahNo2TCwuie7VXED4FVyECvdXfRT9unapm54NssV9tF3OQFKBFOdlje4T43VO0w==", "cpu": [ "arm64" ], @@ -5798,9 +5798,9 @@ } }, "node_modules/@next/swc-darwin-x64": { - "version": "13.5.3", - "resolved": "https://registry.npmjs.org/@next/swc-darwin-x64/-/swc-darwin-x64-13.5.3.tgz", - "integrity": "sha512-UpBKxu2ob9scbpJyEq/xPgpdrgBgN3aLYlxyGqlYX5/KnwpJpFuIHU2lx8upQQ7L+MEmz+fA1XSgesoK92ppwQ==", + "version": "13.5.4", + "resolved": "https://registry.npmjs.org/@next/swc-darwin-x64/-/swc-darwin-x64-13.5.4.tgz", + "integrity": "sha512-siPuUwO45PnNRMeZnSa8n/Lye5ZX93IJom9wQRB5DEOdFrw0JjOMu1GINB8jAEdwa7Vdyn1oJ2xGNaQpdQQ9Pw==", "cpu": [ "x64" ], @@ -5813,9 +5813,9 @@ } }, "node_modules/@next/swc-linux-arm64-gnu": { - "version": "13.5.3", - "resolved": "https://registry.npmjs.org/@next/swc-linux-arm64-gnu/-/swc-linux-arm64-gnu-13.5.3.tgz", - "integrity": "sha512-5AzM7Yx1Ky+oLY6pHs7tjONTF22JirDPd5Jw/3/NazJ73uGB05NqhGhB4SbeCchg7SlVYVBeRMrMSZwJwq/xoA==", + "version": "13.5.4", + "resolved": "https://registry.npmjs.org/@next/swc-linux-arm64-gnu/-/swc-linux-arm64-gnu-13.5.4.tgz", + "integrity": "sha512-l/k/fvRP/zmB2jkFMfefmFkyZbDkYW0mRM/LB+tH5u9pB98WsHXC0WvDHlGCYp3CH/jlkJPL7gN8nkTQVrQ/2w==", "cpu": [ "arm64" ], @@ -5828,9 +5828,9 @@ } }, "node_modules/@next/swc-linux-arm64-musl": { - "version": "13.5.3", - "resolved": "https://registry.npmjs.org/@next/swc-linux-arm64-musl/-/swc-linux-arm64-musl-13.5.3.tgz", - "integrity": "sha512-A/C1shbyUhj7wRtokmn73eBksjTM7fFQoY2v/0rTM5wehpkjQRLOXI8WJsag2uLhnZ4ii5OzR1rFPwoD9cvOgA==", + "version": "13.5.4", + "resolved": "https://registry.npmjs.org/@next/swc-linux-arm64-musl/-/swc-linux-arm64-musl-13.5.4.tgz", + "integrity": "sha512-YYGb7SlLkI+XqfQa8VPErljb7k9nUnhhRrVaOdfJNCaQnHBcvbT7cx/UjDQLdleJcfyg1Hkn5YSSIeVfjgmkTg==", "cpu": [ "arm64" ], @@ -5843,9 +5843,9 @@ } }, "node_modules/@next/swc-linux-x64-gnu": { - "version": "13.5.3", - "resolved": "https://registry.npmjs.org/@next/swc-linux-x64-gnu/-/swc-linux-x64-gnu-13.5.3.tgz", - "integrity": "sha512-FubPuw/Boz8tKkk+5eOuDHOpk36F80rbgxlx4+xty/U71e3wZZxVYHfZXmf0IRToBn1Crb8WvLM9OYj/Ur815g==", + "version": "13.5.4", + "resolved": "https://registry.npmjs.org/@next/swc-linux-x64-gnu/-/swc-linux-x64-gnu-13.5.4.tgz", + "integrity": "sha512-uE61vyUSClnCH18YHjA8tE1prr/PBFlBFhxBZis4XBRJoR+txAky5d7gGNUIbQ8sZZ7LVkSVgm/5Fc7mwXmRAg==", "cpu": [ "x64" ], @@ -5858,9 +5858,9 @@ } }, "node_modules/@next/swc-linux-x64-musl": { - "version": "13.5.3", - "resolved": "https://registry.npmjs.org/@next/swc-linux-x64-musl/-/swc-linux-x64-musl-13.5.3.tgz", - "integrity": "sha512-DPw8nFuM1uEpbX47tM3wiXIR0Qa+atSzs9Q3peY1urkhofx44o7E1svnq+a5Q0r8lAcssLrwiM+OyJJgV/oj7g==", + "version": "13.5.4", + "resolved": "https://registry.npmjs.org/@next/swc-linux-x64-musl/-/swc-linux-x64-musl-13.5.4.tgz", + "integrity": "sha512-qVEKFYML/GvJSy9CfYqAdUexA6M5AklYcQCW+8JECmkQHGoPxCf04iMh7CPR7wkHyWWK+XLt4Ja7hhsPJtSnhg==", "cpu": [ "x64" ], @@ -5873,9 +5873,9 @@ } }, "node_modules/@next/swc-win32-arm64-msvc": { - "version": "13.5.3", - "resolved": "https://registry.npmjs.org/@next/swc-win32-arm64-msvc/-/swc-win32-arm64-msvc-13.5.3.tgz", - "integrity": "sha512-zBPSP8cHL51Gub/YV8UUePW7AVGukp2D8JU93IHbVDu2qmhFAn9LWXiOOLKplZQKxnIPUkJTQAJDCWBWU4UWUA==", + "version": "13.5.4", + "resolved": "https://registry.npmjs.org/@next/swc-win32-arm64-msvc/-/swc-win32-arm64-msvc-13.5.4.tgz", + "integrity": "sha512-mDSQfqxAlfpeZOLPxLymZkX0hYF3juN57W6vFHTvwKlnHfmh12Pt7hPIRLYIShk8uYRsKPtMTth/EzpwRI+u8w==", "cpu": [ "arm64" ], @@ -5888,9 +5888,9 @@ } }, "node_modules/@next/swc-win32-ia32-msvc": { - "version": "13.5.3", - "resolved": "https://registry.npmjs.org/@next/swc-win32-ia32-msvc/-/swc-win32-ia32-msvc-13.5.3.tgz", - "integrity": "sha512-ONcL/lYyGUj4W37D4I2I450SZtSenmFAvapkJQNIJhrPMhzDU/AdfLkW98NvH1D2+7FXwe7yclf3+B7v28uzBQ==", + "version": "13.5.4", + "resolved": "https://registry.npmjs.org/@next/swc-win32-ia32-msvc/-/swc-win32-ia32-msvc-13.5.4.tgz", + "integrity": "sha512-aoqAT2XIekIWoriwzOmGFAvTtVY5O7JjV21giozBTP5c6uZhpvTWRbmHXbmsjZqY4HnEZQRXWkSAppsIBweKqw==", "cpu": [ "ia32" ], @@ -5903,9 +5903,9 @@ } }, "node_modules/@next/swc-win32-x64-msvc": { - "version": "13.5.3", - "resolved": "https://registry.npmjs.org/@next/swc-win32-x64-msvc/-/swc-win32-x64-msvc-13.5.3.tgz", - "integrity": "sha512-2Vz2tYWaLqJvLcWbbTlJ5k9AN6JD7a5CN2pAeIzpbecK8ZF/yobA39cXtv6e+Z8c5UJuVOmaTldEAIxvsIux/Q==", + "version": "13.5.4", + "resolved": "https://registry.npmjs.org/@next/swc-win32-x64-msvc/-/swc-win32-x64-msvc-13.5.4.tgz", + "integrity": "sha512-cyRvlAxwlddlqeB9xtPSfNSCRy8BOa4wtMo0IuI9P7Y0XT2qpDrpFKRyZ7kUngZis59mPVla5k8X1oOJ8RxDYg==", "cpu": [ "x64" ], @@ -6537,9 +6537,9 @@ "integrity": "sha512-EYNwp3bU+98cpU4lAWYYL7Zz+2gryWH1qbdDTidVd6hkiR6weksdbMadyXKXNPEkQFhXM+hVO9ZygomHXp+AIw==" }, "node_modules/@rushstack/eslint-patch": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/@rushstack/eslint-patch/-/eslint-patch-1.4.0.tgz", - "integrity": "sha512-cEjvTPU32OM9lUFegJagO0mRnIn+rbqrG89vV8/xLnLFX0DoR0r1oy5IlTga71Q7uT3Qus7qm7wgeiMT/+Irlg==", + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/@rushstack/eslint-patch/-/eslint-patch-1.5.1.tgz", + "integrity": "sha512-6i/8UoL0P5y4leBIGzvkZdS85RDMG9y1ihZzmTZQ5LdHUYmZ7pKFoj8X0236s3lusPs1Fa5HTQUpwI+UfTcmeA==", "dev": true }, "node_modules/@sentry/core": { @@ -7029,20 +7029,20 @@ } }, "node_modules/@tanstack/query-core": { - "version": "4.35.3", - "resolved": "https://registry.npmjs.org/@tanstack/query-core/-/query-core-4.35.3.tgz", - "integrity": "sha512-PS+WEjd9wzKTyNjjQymvcOe1yg8f3wYc6mD+vb6CKyZAKvu4sIJwryfqfBULITKCla7P9C4l5e9RXePHvZOZeQ==", + "version": "4.36.1", + "resolved": "https://registry.npmjs.org/@tanstack/query-core/-/query-core-4.36.1.tgz", + "integrity": "sha512-DJSilV5+ytBP1FbFcEJovv4rnnm/CokuVvrBEtW/Va9DvuJ3HksbXUJEpI0aV1KtuL4ZoO9AVE6PyNLzF7tLeA==", "funding": { "type": "github", "url": "https://github.com/sponsors/tannerlinsley" } }, "node_modules/@tanstack/react-query": { - "version": "4.35.3", - "resolved": "https://registry.npmjs.org/@tanstack/react-query/-/react-query-4.35.3.tgz", - "integrity": "sha512-UgTPioip/rGG3EQilXfA2j4BJkhEQsR+KAbF+KIuvQ7j4MkgnTCJF01SfRpIRNtQTlEfz/+IL7+jP8WA8bFbsw==", + "version": "4.36.1", + "resolved": "https://registry.npmjs.org/@tanstack/react-query/-/react-query-4.36.1.tgz", + "integrity": "sha512-y7ySVHFyyQblPl3J3eQBWpXZkliroki3ARnBKsdJchlgt7yJLRDUcf4B8soufgiYt3pEQIkBWBx1N9/ZPIeUWw==", "dependencies": { - "@tanstack/query-core": "4.35.3", + "@tanstack/query-core": "4.36.1", "use-sync-external-store": "^1.2.0" }, "funding": { @@ -7064,9 +7064,9 @@ } }, "node_modules/@tanstack/react-query-devtools": { - "version": "4.35.3", - "resolved": "https://registry.npmjs.org/@tanstack/react-query-devtools/-/react-query-devtools-4.35.3.tgz", - "integrity": "sha512-UvLT7qPzCuCZ3NfjwsOqDUVN84JvSOuW6ukrjZmSqgjPqVxD6ra/HUp1CEOatQY2TRvKCp8y1lTVu+trXM30fg==", + "version": "4.36.1", + "resolved": "https://registry.npmjs.org/@tanstack/react-query-devtools/-/react-query-devtools-4.36.1.tgz", + "integrity": "sha512-WYku83CKP3OevnYSG8Y/QO9g0rT75v1om5IvcWUwiUZJ4LanYGLVCZ8TdFG5jfsq4Ej/lu2wwDAULEUnRIMBSw==", "dependencies": { "@tanstack/match-sorter-utils": "^8.7.0", "superjson": "^1.10.0", @@ -7077,7 +7077,7 @@ "url": "https://github.com/sponsors/tannerlinsley" }, "peerDependencies": { - "@tanstack/react-query": "^4.35.3", + "@tanstack/react-query": "^4.36.1", "react": "^16.8.0 || ^17.0.0 || ^18.0.0", "react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0" } @@ -7446,18 +7446,18 @@ "dev": true }, "node_modules/@types/istanbul-lib-report": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/@types/istanbul-lib-report/-/istanbul-lib-report-3.0.0.tgz", - "integrity": "sha512-plGgXAPfVKFoYfa9NpYDAkseG+g6Jr294RqeqcqDixSbU34MZVJRi/P+7Y8GDpzkEwLaGZZOpKIEmeVZNtKsrg==", + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/@types/istanbul-lib-report/-/istanbul-lib-report-3.0.1.tgz", + "integrity": "sha512-gPQuzaPR5h/djlAv2apEG1HVOyj1IUs7GpfMZixU0/0KXT3pm64ylHuMUI1/Akh+sq/iikxg6Z2j+fcMDXaaTQ==", "dev": true, "dependencies": { "@types/istanbul-lib-coverage": "*" } }, "node_modules/@types/istanbul-reports": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/@types/istanbul-reports/-/istanbul-reports-3.0.1.tgz", - "integrity": "sha512-c3mAZEuK0lvBp8tmuL74XRKn1+y2dcwOUpH7x4WrF6gk1GIgiluDRgMYQtw2OFcBvAJWlt6ASU3tSqxp0Uu0Aw==", + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/@types/istanbul-reports/-/istanbul-reports-3.0.2.tgz", + "integrity": "sha512-kv43F9eb3Lhj+lr/Hn6OcLCs/sSM8bt+fIaP11rCYngfV6NVjzWXJ17owQtDQTL9tQ8WSLUrGsSJ6rJz0F1w1A==", "dev": true, "dependencies": { "@types/istanbul-lib-report": "*" @@ -7523,14 +7523,17 @@ "integrity": "sha512-K0VQKziLUWkVKiRVrx4a40iPaxTUefQmjtkQofBkYRcoaaL/8rhwDWww9qWbrgicNOgnpIsMxyNIUM4+n6dUIA==" }, "node_modules/@types/node": { - "version": "20.7.0", - "resolved": "https://registry.npmjs.org/@types/node/-/node-20.7.0.tgz", - "integrity": "sha512-zI22/pJW2wUZOVyguFaUL1HABdmSVxpXrzIqkjsHmyUjNhPoWM1CKfvVuXfetHhIok4RY573cqS0mZ1SJEnoTg==" + "version": "20.8.4", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.8.4.tgz", + "integrity": "sha512-ZVPnqU58giiCjSxjVUESDtdPk4QR5WQhhINbc9UBrKLU68MX5BF6kbQzTrkwbolyr0X8ChBpXfavr5mZFKZQ5A==", + "dependencies": { + "undici-types": "~5.25.1" + } }, "node_modules/@types/node-forge": { - "version": "1.3.6", - "resolved": "https://registry.npmjs.org/@types/node-forge/-/node-forge-1.3.6.tgz", - "integrity": "sha512-rOLL54+BcPO1BV0ogdKCtfmohdL3WW3ODCbnh8gA8ZWPYfHM0aVFyXQljme5DoICH29/2JZOXqgkS9CEd/NmSQ==", + "version": "1.3.7", + "resolved": "https://registry.npmjs.org/@types/node-forge/-/node-forge-1.3.7.tgz", + "integrity": "sha512-uWvTDObXqNQPVprvvm7FCS/B0qexgRMmNCJCRETywf7cBm3C7uGRtGfaSqCoUlksrmY5Yn3++fvA7awBE5lAzw==", "dev": true, "dependencies": { "@types/node": "*" @@ -7551,9 +7554,9 @@ "dev": true }, "node_modules/@types/prop-types": { - "version": "15.7.7", - "resolved": "https://registry.npmjs.org/@types/prop-types/-/prop-types-15.7.7.tgz", - "integrity": "sha512-FbtmBWCcSa2J4zL781Zf1p5YUBXQomPEcep9QZCfRfQgTxz3pJWiDFLebohZ9fFntX5ibzOkSsrJ0TEew8cAog==" + "version": "15.7.8", + "resolved": "https://registry.npmjs.org/@types/prop-types/-/prop-types-15.7.8.tgz", + "integrity": "sha512-kMpQpfZKSCBqltAJwskgePRaYRFukDkm1oItcAbC3gNELR20XIBcN9VRgg4+m8DKsTfkWeA4m4Imp4DDuWy7FQ==" }, "node_modules/@types/raf-schd": { "version": "4.0.1", @@ -7561,9 +7564,9 @@ "integrity": "sha512-Ha+EnKHFIh9EKW0/XZJPUd3EGDFisEvauaBd4VVCRPKeOqUxNEc9TodiY2Zhk33XCgzJucoFEcaoNcBAPHTQ2A==" }, "node_modules/@types/react": { - "version": "18.2.22", - "resolved": "https://registry.npmjs.org/@types/react/-/react-18.2.22.tgz", - "integrity": "sha512-60fLTOLqzarLED2O3UQImc/lsNRgG0jE/a1mPW9KjMemY0LMITWEsbS4VvZ4p6rorEHd5YKxxmMKSDK505GHpA==", + "version": "18.2.27", + "resolved": "https://registry.npmjs.org/@types/react/-/react-18.2.27.tgz", + "integrity": "sha512-Wfv7B7FZiR2r3MIqbAlXoY1+tXm4bOqfz4oRr+nyXdBqapDBZ0l/IGcSlAfvxIHEEJjkPU0MYAc/BlFPOcrgLw==", "dependencies": { "@types/prop-types": "*", "@types/scheduler": "*", @@ -7571,36 +7574,36 @@ } }, "node_modules/@types/react-dom": { - "version": "18.2.7", - "resolved": "https://registry.npmjs.org/@types/react-dom/-/react-dom-18.2.7.tgz", - "integrity": "sha512-GRaAEriuT4zp9N4p1i8BDBYmEyfo+xQ3yHjJU4eiK5NDa1RmUZG+unZABUTK4/Ox/M+GaHwb6Ow8rUITrtjszA==", + "version": "18.2.12", + "resolved": "https://registry.npmjs.org/@types/react-dom/-/react-dom-18.2.12.tgz", + "integrity": "sha512-QWZuiA/7J/hPIGocXreCRbx7wyoeet9ooxfbSA+zbIWqyQEE7GMtRn4A37BdYyksnN+/NDnWgfxZH9UVGDw1hg==", "dev": true, "dependencies": { "@types/react": "*" } }, "node_modules/@types/react-facebook-login": { - "version": "4.1.5", - "resolved": "https://registry.npmjs.org/@types/react-facebook-login/-/react-facebook-login-4.1.5.tgz", - "integrity": "sha512-adYUfzgeOa0I0dtgFsG/KzigvslSEY8KWXyAp9RjjPp7aWzbpNbkw8KR1RaGb98m+xO0udf9OnjDlpGsPcfCvA==", + "version": "4.1.6", + "resolved": "https://registry.npmjs.org/@types/react-facebook-login/-/react-facebook-login-4.1.6.tgz", + "integrity": "sha512-rkY7l0eUiAJSFpGruUhV/YPiam8B6MUH9lImlXmJBSdTE23eTAvpX4nMPKHtCX932nuJw/entYRj4fA/D26Xdg==", "dev": true, "dependencies": { "@types/react": "*" } }, "node_modules/@types/react-is": { - "version": "17.0.4", - "resolved": "https://registry.npmjs.org/@types/react-is/-/react-is-17.0.4.tgz", - "integrity": "sha512-FLzd0K9pnaEvKz4D1vYxK9JmgQPiGk1lu23o1kqGsLeT0iPbRSF7b76+S5T9fD8aRa0B8bY7I/3DebEj+1ysBA==", + "version": "17.0.5", + "resolved": "https://registry.npmjs.org/@types/react-is/-/react-is-17.0.5.tgz", + "integrity": "sha512-mTTgVYfA8fLtyyuppoO7hQJWLV5TNivNKle5vBryoOwlA5158/4UgcZFOx59po/zC0K2ZBEv/IRATlxdVJRVQA==", "dev": true, "dependencies": { "@types/react": "^17" } }, "node_modules/@types/react-is/node_modules/@types/react": { - "version": "17.0.65", - "resolved": "https://registry.npmjs.org/@types/react/-/react-17.0.65.tgz", - "integrity": "sha512-oxur785xZYHvnI7TRS61dXbkIhDPnGfsXKv0cNXR/0ml4SipRIFpSMzA7HMEfOywFwJ5AOnPrXYTEiTRUQeGlQ==", + "version": "17.0.67", + "resolved": "https://registry.npmjs.org/@types/react/-/react-17.0.67.tgz", + "integrity": "sha512-zE76EIJ0Y58Oy9yDX/9csb/NuKjt0Eq2YgWb/8Wxo91YmuLzzbyiRoaqJE9h8iDlsT7n35GdpoLomHlaB1kFbg==", "dev": true, "dependencies": { "@types/prop-types": "*", @@ -7609,9 +7612,9 @@ } }, "node_modules/@types/react-transition-group": { - "version": "4.4.6", - "resolved": "https://registry.npmjs.org/@types/react-transition-group/-/react-transition-group-4.4.6.tgz", - "integrity": "sha512-VnCdSxfcm08KjsJVQcfBmhEQAPnLB8G08hAxn39azX1qYBQ/5RVQuoHuKIcfKOdncuaUvEpFKFzEvbtIMsfVew==", + "version": "4.4.7", + "resolved": "https://registry.npmjs.org/@types/react-transition-group/-/react-transition-group-4.4.7.tgz", + "integrity": "sha512-ICCyBl5mvyqYp8Qeq9B5G/fyBSRC0zx3XM3sCC6KkcMsNeAHqXBKkmat4GqdJET5jtYUpZXrxI5flve5qhi2Eg==", "dependencies": { "@types/react": "*" } @@ -7678,9 +7681,9 @@ "integrity": "sha512-IDaobHimLQhjwsQ/NMwRVfa/yL7L/wriQPMhw1ZJall0KX6E1oxk29XMDeilW5qTIg5aoiqf5Udy8U/51aNoQQ==" }, "node_modules/@types/video.js": { - "version": "7.3.52", - "resolved": "https://registry.npmjs.org/@types/video.js/-/video.js-7.3.52.tgz", - "integrity": "sha512-WFj/HkNVCfkchXDeDU0QbimC356FB5vva3g5mgsjk8n3UMKqP9S522rQAmu9LGPiCmShZRPuAlkXmbp5WId6ow==", + "version": "7.3.53", + "resolved": "https://registry.npmjs.org/@types/video.js/-/video.js-7.3.53.tgz", + "integrity": "sha512-pE3ozDRXEPs9ZC401IhN3XWDihJs2GUzEZVu/qq8IfryOIvg2U1i9LExo16y9FdP2ZV2WnZhM4klb+lP03PpeQ==", "dev": true }, "node_modules/@types/ws": { @@ -7693,9 +7696,9 @@ } }, "node_modules/@types/yargs": { - "version": "17.0.25", - "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-17.0.25.tgz", - "integrity": "sha512-gy7iPgwnzNvxgAEi2bXOHWCVOG6f7xsprVJH4MjlAWeBmJ7vh/Y1kwMtUrs64ztf24zVIRCpr3n/z6gm9QIkgg==", + "version": "17.0.28", + "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-17.0.28.tgz", + "integrity": "sha512-N3e3fkS86hNhtk6BEnc0rj3zcehaxx8QWhCROJkqpl5Zaoi7nAic3jH8q94jVD3zu5LGk+PUB6KAiDmimYOEQw==", "dev": true, "dependencies": { "@types/yargs-parser": "*" @@ -10723,9 +10726,9 @@ "dev": true }, "node_modules/browserslist": { - "version": "4.21.11", - "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.21.11.tgz", - "integrity": "sha512-xn1UXOKUz7DjdGlg9RrUr0GGiWzI97UQJnugHtH0OLDfJB7jMgoIkYvRIEO1l9EeEERVqeqLYOcFBW9ldjypbQ==", + "version": "4.22.1", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.22.1.tgz", + "integrity": "sha512-FEVc202+2iuClEhZhrWy6ZiAcRLvNMyYcxZ8raemul1DYVOVdFsbqckWLdsixQZCpJlwe77Z3UTalE7jsjnKfQ==", "funding": [ { "type": "opencollective", @@ -10741,8 +10744,8 @@ } ], "dependencies": { - "caniuse-lite": "^1.0.30001538", - "electron-to-chromium": "^1.4.526", + "caniuse-lite": "^1.0.30001541", + "electron-to-chromium": "^1.4.535", "node-releases": "^2.0.13", "update-browserslist-db": "^1.0.13" }, @@ -10908,15 +10911,9 @@ } }, "node_modules/caniuse-lite": { -<<<<<<< HEAD - "version": "1.0.30001543", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001543.tgz", - "integrity": "sha512-qxdO8KPWPQ+Zk6bvNpPeQIOH47qZSYdFZd6dXQzb2KzhnSXju4Kd7H1PkSJx6NICSMgo/IhRZRhhfPTHYpJUCA==", -======= - "version": "1.0.30001542", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001542.tgz", - "integrity": "sha512-UrtAXVcj1mvPBFQ4sKd38daP8dEcXXr5sQe6QNNinaPd0iA/cxg9/l3VrSdL73jgw5sKyuQ6jNgiKO12W3SsVA==", ->>>>>>> audiobook1 + "version": "1.0.30001546", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001546.tgz", + "integrity": "sha512-zvtSJwuQFpewSyRrI3AsftF6rM0X80mZkChIt1spBGEvRglCrjTniXvinc8JKRoqTwXAgvqTImaN9igfSMtUBw==", "funding": [ { "type": "opencollective", @@ -11185,9 +11182,9 @@ } }, "node_modules/ci-info": { - "version": "3.8.0", - "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-3.8.0.tgz", - "integrity": "sha512-eXTggHWSooYhq49F2opQhuHWgzucfF2YgODK4e1566GQs5BIfP30B0oenwBJHfWxAs2fyPB1s7Mg949zLf61Yw==", + "version": "3.9.0", + "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-3.9.0.tgz", + "integrity": "sha512-NIxF55hv4nSqQswkAeiOi1r83xy8JldOFDTWiug55KBu9Jnblncd2U6ViHmYgHf01TPZS77NJBhBMKdWj9HQMQ==", "dev": true, "funding": [ { @@ -11898,11 +11895,11 @@ } }, "node_modules/core-js-compat": { - "version": "3.32.2", - "resolved": "https://registry.npmjs.org/core-js-compat/-/core-js-compat-3.32.2.tgz", - "integrity": "sha512-+GjlguTDINOijtVRUxrQOv3kfu9rl+qPNdX2LTbJ/ZyVTuxK+ksVSAGX1nHstu4hrv1En/uPTtWgq2gI5wt4AQ==", + "version": "3.33.0", + "resolved": "https://registry.npmjs.org/core-js-compat/-/core-js-compat-3.33.0.tgz", + "integrity": "sha512-0w4LcLXsVEuNkIqwjjf9rjCoPhK8uqA4tMRh4Ge26vfLtUutshn+aRJU21I9LCJlh2QQHfisNToLjw1XEJLTWw==", "dependencies": { - "browserslist": "^4.21.10" + "browserslist": "^4.22.1" }, "funding": { "type": "opencollective", @@ -12692,9 +12689,9 @@ } }, "node_modules/electron-to-chromium": { - "version": "1.4.528", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.528.tgz", - "integrity": "sha512-UdREXMXzLkREF4jA8t89FQjA8WHI6ssP38PMY4/4KhXFQbtImnghh4GkCgrtiZwLKUKVD2iTVXvDVQjfomEQuA==" + "version": "1.4.545", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.545.tgz", + "integrity": "sha512-G1HKumUw+y5yxMjewGfKz0XrqG6O+Tb4zrlC/Vs1+9riRXBuFlO0hOEXP3xeI+ltlJkbVUuLkYdmjHYH6Jkiow==" }, "node_modules/emittery": { "version": "0.8.1", @@ -12987,15 +12984,15 @@ } }, "node_modules/eslint": { - "version": "8.50.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.50.0.tgz", - "integrity": "sha512-FOnOGSuFuFLv/Sa+FDVRZl4GGVAAFFi8LecRsI5a1tMO5HIE8nCm4ivAlzt4dT3ol/PaaGC0rJEEXQmHJBGoOg==", + "version": "8.51.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.51.0.tgz", + "integrity": "sha512-2WuxRZBrlwnXi+/vFSJyjMqrNjtJqiasMzehF0shoLaW7DzS3/9Yvrmq5JiT66+pNjiX4UBnLDiKHcWAr/OInA==", "dev": true, "dependencies": { "@eslint-community/eslint-utils": "^4.2.0", "@eslint-community/regexpp": "^4.6.1", "@eslint/eslintrc": "^2.1.2", - "@eslint/js": "8.50.0", + "@eslint/js": "8.51.0", "@humanwhocodes/config-array": "^0.11.11", "@humanwhocodes/module-importer": "^1.0.1", "@nodelib/fs.walk": "^1.2.8", @@ -13041,12 +13038,12 @@ } }, "node_modules/eslint-config-next": { - "version": "13.5.3", - "resolved": "https://registry.npmjs.org/eslint-config-next/-/eslint-config-next-13.5.3.tgz", - "integrity": "sha512-VN2qbCpq2DMWgs7SVF8KTmc8bVaWz3s4nmcFqRLs7PNBt5AXejOhJuZ4zg2sCEHOvz5RvqdwLeI++NSCV6qHVg==", + "version": "13.5.4", + "resolved": "https://registry.npmjs.org/eslint-config-next/-/eslint-config-next-13.5.4.tgz", + "integrity": "sha512-FzQGIj4UEszRX7fcRSJK6L1LrDiVZvDFW320VVntVKh3BSU8Fb9kpaoxQx0cdFgf3MQXdeSbrCXJ/5Z/NndDkQ==", "dev": true, "dependencies": { - "@next/eslint-plugin-next": "13.5.3", + "@next/eslint-plugin-next": "13.5.4", "@rushstack/eslint-patch": "^1.3.3", "@typescript-eslint/parser": "^5.4.2 || ^6.0.0", "eslint-import-resolver-node": "^0.3.6", @@ -13535,9 +13532,9 @@ } }, "node_modules/eslint/node_modules/globals": { - "version": "13.22.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-13.22.0.tgz", - "integrity": "sha512-H1Ddc/PbZHTDVJSnj8kWptIRSD6AM3pK+mKytuIVF4uoBV7rshFlhhvA58ceJ5wp3Er58w6zj7bykMpYXt3ETw==", + "version": "13.23.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-13.23.0.tgz", + "integrity": "sha512-XAmF0RjlrjY23MA51q3HltdlGxUpXPvg0GioKiD9X6HD28iMjo2dKC8Vqwm7lne4GNr78+RHTfliktR6ZH09wA==", "dev": true, "dependencies": { "type-fest": "^0.20.2" @@ -14653,12 +14650,12 @@ } }, "node_modules/flat-cache": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.1.0.tgz", - "integrity": "sha512-OHx4Qwrrt0E4jEIcI5/Xb+f+QmJYNj2rrK8wiIdQOIrB9WrrJL8cjZvXdXuBTkkEwEqLycb5BeZDV1o2i9bTew==", + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.1.1.tgz", + "integrity": "sha512-/qM2b3LUIaIgviBQovTLvijfyOQXPtSRnRK26ksj2J7rzPIecePUIpJsZ4T02Qg+xiAEKIs5K8dsHEd+VaKa/Q==", "dev": true, "dependencies": { - "flatted": "^3.2.7", + "flatted": "^3.2.9", "keyv": "^4.5.3", "rimraf": "^3.0.2" }, @@ -15118,9 +15115,9 @@ "dev": true }, "node_modules/graphql-config": { - "version": "5.0.2", - "resolved": "https://registry.npmjs.org/graphql-config/-/graphql-config-5.0.2.tgz", - "integrity": "sha512-7TPxOrlbiG0JplSZYCyxn2XQtqVhXomEjXUmWJVSS5ET1nPhOJSsIb/WTwqWhcYX6G0RlHXSj9PLtGTKmxLNGg==", + "version": "5.0.3", + "resolved": "https://registry.npmjs.org/graphql-config/-/graphql-config-5.0.3.tgz", + "integrity": "sha512-BNGZaoxIBkv9yy6Y7omvsaBUHOzfFcII3UN++tpH8MGOKFPFkCPZuwx09ggANMt8FgyWP1Od8SWPmrUEZca4NQ==", "dev": true, "dependencies": { "@graphql-tools/graphql-file-loader": "^8.0.0", @@ -15189,9 +15186,9 @@ } }, "node_modules/graphql-ws": { - "version": "5.14.0", - "resolved": "https://registry.npmjs.org/graphql-ws/-/graphql-ws-5.14.0.tgz", - "integrity": "sha512-itrUTQZP/TgswR4GSSYuwWUzrE/w5GhbwM2GX3ic2U7aw33jgEsayfIlvaj7/GcIvZgNMzsPTrE5hqPuFUiE5g==", + "version": "5.14.1", + "resolved": "https://registry.npmjs.org/graphql-ws/-/graphql-ws-5.14.1.tgz", + "integrity": "sha512-aqkls1espsygP1PfkAuuLIV96IbztQ6EaADse97pw8wRIMT3+AL/OYfS8V2iCRkc0gzckitoDRGCQEdnySggiA==", "dev": true, "engines": { "node": ">=10" @@ -15251,12 +15248,9 @@ "dev": true }, "node_modules/has": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", - "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", - "dependencies": { - "function-bind": "^1.1.1" - }, + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/has/-/has-1.0.4.tgz", + "integrity": "sha512-qdSAmqLF6209RFj4VVItywPMbm3vWylknmB3nvNiUIs72xAimcM8nVYxYr7ncvZq5qzk9MKIZR8ijqD/1QuYjQ==", "engines": { "node": ">= 0.4.0" } @@ -19625,9 +19619,9 @@ "dev": true }, "node_modules/jose": { - "version": "4.14.6", - "resolved": "https://registry.npmjs.org/jose/-/jose-4.14.6.tgz", - "integrity": "sha512-EqJPEUlZD0/CSUMubKtMaYUOtWe91tZXTWMJZoKSbLk+KtdhNdcvppH8lA9XwVu2V4Ailvsj0GBZJ2ZwDjfesQ==", + "version": "4.15.2", + "resolved": "https://registry.npmjs.org/jose/-/jose-4.15.2.tgz", + "integrity": "sha512-IY73F228OXRl9ar3jJagh7Vnuhj/GzBunPiZP13K0lOl7Am9SoWW3kEzq3MCllJMTtZqHTiDXQvoRd4U95aU6A==", "dev": true, "funding": { "url": "https://github.com/sponsors/panva" @@ -20015,9 +20009,9 @@ "integrity": "sha512-Rdgz9Hl9Iv4QKi8b0OlCRQEzp4AgVxyCtz5S/+VIHezDmrDhkp2N2TqBWOLz0/gbeREXOOiI9/4b8BY9uw2vFg==" }, "node_modules/keyv": { - "version": "4.5.3", - "resolved": "https://registry.npmjs.org/keyv/-/keyv-4.5.3.tgz", - "integrity": "sha512-QCiSav9WaX1PgETJ+SpNnx2PRRapJ/oRSXM4VO5OGYGSjrxbKPVFVhB3l2OCbLCk329N8qyAtsJjSjvVBWzEug==", + "version": "4.5.4", + "resolved": "https://registry.npmjs.org/keyv/-/keyv-4.5.4.tgz", + "integrity": "sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw==", "dev": true, "dependencies": { "json-buffer": "3.0.1" @@ -21061,18 +21055,17 @@ "integrity": "sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw==" }, "node_modules/next": { - "version": "13.5.3", - "resolved": "https://registry.npmjs.org/next/-/next-13.5.3.tgz", - "integrity": "sha512-4Nt4HRLYDW/yRpJ/QR2t1v63UOMS55A38dnWv3UDOWGezuY0ZyFO1ABNbD7mulVzs9qVhgy2+ppjdsANpKP1mg==", + "version": "13.5.4", + "resolved": "https://registry.npmjs.org/next/-/next-13.5.4.tgz", + "integrity": "sha512-+93un5S779gho8y9ASQhb/bTkQF17FNQOtXLKAj3lsNgltEcF0C5PMLLncDmH+8X1EnJH1kbqAERa29nRXqhjA==", "dependencies": { - "@next/env": "13.5.3", + "@next/env": "13.5.4", "@swc/helpers": "0.5.2", "busboy": "1.6.0", "caniuse-lite": "^1.0.30001406", - "postcss": "8.4.14", + "postcss": "8.4.31", "styled-jsx": "5.1.1", - "watchpack": "2.4.0", - "zod": "3.21.4" + "watchpack": "2.4.0" }, "bin": { "next": "dist/bin/next" @@ -21081,15 +21074,15 @@ "node": ">=16.14.0" }, "optionalDependencies": { - "@next/swc-darwin-arm64": "13.5.3", - "@next/swc-darwin-x64": "13.5.3", - "@next/swc-linux-arm64-gnu": "13.5.3", - "@next/swc-linux-arm64-musl": "13.5.3", - "@next/swc-linux-x64-gnu": "13.5.3", - "@next/swc-linux-x64-musl": "13.5.3", - "@next/swc-win32-arm64-msvc": "13.5.3", - "@next/swc-win32-ia32-msvc": "13.5.3", - "@next/swc-win32-x64-msvc": "13.5.3" + "@next/swc-darwin-arm64": "13.5.4", + "@next/swc-darwin-x64": "13.5.4", + "@next/swc-linux-arm64-gnu": "13.5.4", + "@next/swc-linux-arm64-musl": "13.5.4", + "@next/swc-linux-x64-gnu": "13.5.4", + "@next/swc-linux-x64-musl": "13.5.4", + "@next/swc-win32-arm64-msvc": "13.5.4", + "@next/swc-win32-ia32-msvc": "13.5.4", + "@next/swc-win32-x64-msvc": "13.5.4" }, "peerDependencies": { "@opentelemetry/api": "^1.1.0", @@ -22573,9 +22566,9 @@ } }, "node_modules/postcss": { - "version": "8.4.14", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.14.tgz", - "integrity": "sha512-E398TUmfAYFPBSdzgeieK2Y1+1cpdxJx8yXbK/m57nRhKSmk1GB2tO4lbLBtlkfPQTDKfe4Xqv1ASWPpayPEig==", + "version": "8.4.31", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.31.tgz", + "integrity": "sha512-PS08Iboia9mts/2ygV3eLpY5ghnUcfLV/EXTOW1E2qYxJKGGBUtNjN76FYHnMs36RmARn41bC0AZmn+rR0OVpQ==", "funding": [ { "type": "opencollective", @@ -22584,10 +22577,14 @@ { "type": "tidelift", "url": "https://tidelift.com/funding/github/npm/postcss" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" } ], "dependencies": { - "nanoid": "^3.3.4", + "nanoid": "^3.3.6", "picocolors": "^1.0.0", "source-map-js": "^1.0.2" }, @@ -24248,9 +24245,9 @@ } }, "node_modules/sass": { - "version": "1.68.0", - "resolved": "https://registry.npmjs.org/sass/-/sass-1.68.0.tgz", - "integrity": "sha512-Lmj9lM/fef0nQswm1J2HJcEsBUba4wgNx2fea6yJHODREoMFnwRpZydBnX/RjyXw2REIwdkbqE4hrTo4qfDBUA==", + "version": "1.69.0", + "resolved": "https://registry.npmjs.org/sass/-/sass-1.69.0.tgz", + "integrity": "sha512-l3bbFpfTOGgQZCLU/gvm1lbsQ5mC/WnLz3djL2v4WCJBDrWm58PO+jgngcGRNnKUh6wSsdm50YaovTqskZ0xDQ==", "dependencies": { "chokidar": ">=3.0.0 <4.0.0", "immutable": "^4.0.0", @@ -24269,9 +24266,9 @@ "integrity": "sha512-fsXeu4J4i6WNWSikpI88v/PcVflZz+6kMhUfIwc5SY+poQRPnaf5V7qds6SUyUN3cVxEzuCab7QIoLOQ+DQ1wA==" }, "node_modules/sax": { - "version": "1.2.4", - "resolved": "https://registry.npmjs.org/sax/-/sax-1.2.4.tgz", - "integrity": "sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw==" + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/sax/-/sax-1.3.0.tgz", + "integrity": "sha512-0s+oAmw9zLl1V1cS9BtZN7JAd0cW5e0QH4W3LWEK6a4LaLEA2OTpGYWDY+6XasBLtz6wkm3u1xRw95mRuJ59WA==" }, "node_modules/saxes": { "version": "5.0.1", @@ -24967,9 +24964,9 @@ } }, "node_modules/spdx-license-ids": { - "version": "3.0.15", - "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.15.tgz", - "integrity": "sha512-lpT8hSQp9jAKp9mhtBU4Xjon8LPGBvLIuBiSVhMEtmLecTh2mO0tlqrAMp47tBXzMr13NJMQ2lf7RpQGLJ3HsQ==", + "version": "3.0.16", + "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.16.tgz", + "integrity": "sha512-eWN+LnM3GR6gPu35WxNgbGl8rmY1AEmoMDvL/QD6zYmPWgywxWqJWNdLGT+ke8dKNWrcYgYjPpG5gbTfghP8rw==", "dev": true, "optional": true, "peer": true @@ -25457,9 +25454,9 @@ } }, "node_modules/superjson": { - "version": "1.13.1", - "resolved": "https://registry.npmjs.org/superjson/-/superjson-1.13.1.tgz", - "integrity": "sha512-AVH2eknm9DEd3qvxM4Sq+LTCkSXE2ssfh1t11MHMXyYXFQyQ1HLgVvV+guLTsaQnJU3gnaVo34TohHPulY/wLg==", + "version": "1.13.3", + "resolved": "https://registry.npmjs.org/superjson/-/superjson-1.13.3.tgz", + "integrity": "sha512-mJiVjfd2vokfDxsQPOwJ/PtanO87LhpYY88ubI5dUB1Ab58Txbyje3+jpm+/83R/fevaq/107NNhtYBLuoTrFg==", "dependencies": { "copy-anything": "^3.0.2" }, @@ -25687,9 +25684,9 @@ } }, "node_modules/terser": { - "version": "5.20.0", - "resolved": "https://registry.npmjs.org/terser/-/terser-5.20.0.tgz", - "integrity": "sha512-e56ETryaQDyebBwJIWYB2TT6f2EZ0fL0sW/JRXNMN26zZdKi2u/E/5my5lG6jNxym6qsrVXfFRmOdV42zlAgLQ==", + "version": "5.21.0", + "resolved": "https://registry.npmjs.org/terser/-/terser-5.21.0.tgz", + "integrity": "sha512-WtnFKrxu9kaoXuiZFSGrcAvvBqAdmKx0SFNmVNYdJamMu9yyN3I/QF0FbH4QcqJQ+y1CJnzxGIKH0cSj+FGYRw==", "dependencies": { "@jridgewell/source-map": "^0.3.3", "acorn": "^8.8.2", @@ -26324,9 +26321,9 @@ } }, "node_modules/type-fest": { - "version": "4.3.1", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-4.3.1.tgz", - "integrity": "sha512-pphNW/msgOUSkJbH58x8sqpq8uQj6b0ZKGxEsLKMUnGorRcDjrUaLS+39+/ub41JNTwrrMyJcUB8+YZs3mbwqw==", + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-4.4.0.tgz", + "integrity": "sha512-HT3RRs7sTfY22KuPQJkD/XjbTbxgP2Je5HPt6H6JEGvcjHd5Lqru75EbrP3tb4FYjNJ+DjLp+MNQTFQU0mhXNw==", "dev": true, "engines": { "node": ">=16" @@ -26505,6 +26502,11 @@ "node": ">=0.10.0" } }, + "node_modules/undici-types": { + "version": "5.25.3", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.25.3.tgz", + "integrity": "sha512-Ga1jfYwRn7+cP9v8auvEXN1rX3sWqlayd4HP7OKk4mZWylEmu3KzXDUGrQUN6Ol7qo1gPvB2e5gX6udnyEPgdA==" + }, "node_modules/unicode-canonical-property-names-ecmascript": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/unicode-canonical-property-names-ecmascript/-/unicode-canonical-property-names-ecmascript-2.0.0.tgz", @@ -27870,14 +27872,6 @@ "funding": { "url": "https://github.com/sponsors/sindresorhus" } - }, - "node_modules/zod": { - "version": "3.21.4", - "resolved": "https://registry.npmjs.org/zod/-/zod-3.21.4.tgz", - "integrity": "sha512-m46AKbrzKVzOzs/DZgVnG5H55N1sv1M8qZU3A8RIKbs3mrACDNeIOeilDymVb2HdmP8uwshOCF4uJ8uM9rCqJw==", - "funding": { - "url": "https://github.com/sponsors/colinhacks" - } } } } From c98aa7687944bda7d92d900c27cd2d498ef9f62b Mon Sep 17 00:00:00 2001 From: Okeino McGowan Date: Tue, 17 Oct 2023 08:54:30 -0400 Subject: [PATCH 10/16] added components to check empty carasel --- schema.graphql | 27 +++++++++++++++++++ src/components/atoms/hasTitleField.tsx | 16 +++++++++++ src/components/atoms/isComponentEmpty.tsx | 12 +++++++++ .../cardSlider/section/audiobooks.graphql | 1 + src/containers/audiobook/list.graphql | 1 + 5 files changed, 57 insertions(+) create mode 100644 src/components/atoms/hasTitleField.tsx create mode 100644 src/components/atoms/isComponentEmpty.tsx diff --git a/schema.graphql b/schema.graphql index 9fb413672..6a56cdf65 100644 --- a/schema.graphql +++ b/schema.graphql @@ -546,6 +546,9 @@ type Collection implements Node & UniformResourceLocatable { after: String collectionIds: [ID!] + """The sequence must not be associated with any of the persons provided.""" + excludePersons: [RecordingPersonInput!] + """Return up to the first `n` elements from the list.""" first: Int @@ -2087,6 +2090,9 @@ type Person implements Node & UniformResourceLocatable { collectionId: ID collectionIds: [ID!] + """The sequence must not be associated with any of the persons provided.""" + excludePersons: [RecordingPersonInput!] + """Return up to the first `n` elements from the list.""" first: Int @@ -2399,6 +2405,9 @@ type Query { collectionId: ID collectionIds: [ID!] + """The sequence must not be associated with any of the persons provided.""" + excludePersons: [RecordingPersonInput!] + """Return up to the first `n` elements from the list.""" first: Int @@ -2653,6 +2662,9 @@ type Query { collectionIds: [ID!] contentType: SequenceContentType + """The sequence must not be associated with any of the persons provided.""" + excludePersons: [RecordingPersonInput!] + """Return up to the first `n` elements from the list.""" first: Int @@ -2786,6 +2798,9 @@ type Query { collectionId: ID collectionIds: [ID!] + """The sequence must not be associated with any of the persons provided.""" + excludePersons: [RecordingPersonInput!] + """Return up to the first `n` elements from the list.""" first: Int @@ -3200,6 +3215,9 @@ type Query { collectionIds: [ID!] contentType: SequenceContentType + """The sequence must not be associated with any of the persons provided.""" + excludePersons: [RecordingPersonInput!] + """Return up to the first `n` elements from the list.""" first: Int @@ -3228,6 +3246,9 @@ type Query { collectionId: ID collectionIds: [ID!] + """The sequence must not be associated with any of the persons provided.""" + excludePersons: [RecordingPersonInput!] + """Return up to the first `n` elements from the list.""" first: Int @@ -3459,6 +3480,9 @@ type Query { collectionId: ID collectionIds: [ID!] + """The sequence must not be associated with any of the persons provided.""" + excludePersons: [RecordingPersonInput!] + """Return up to the first `n` elements from the list.""" first: Int @@ -4540,6 +4564,9 @@ type Sponsor implements Node & UniformResourceLocatable { collectionIds: [ID!] contentType: SequenceContentType = SERIES + """The sequence must not be associated with any of the persons provided.""" + excludePersons: [RecordingPersonInput!] + """Return up to the first `n` elements from the list.""" first: Int diff --git a/src/components/atoms/hasTitleField.tsx b/src/components/atoms/hasTitleField.tsx new file mode 100644 index 000000000..998f51f43 --- /dev/null +++ b/src/components/atoms/hasTitleField.tsx @@ -0,0 +1,16 @@ +import React from 'react'; + +interface ComponentWithTitleProps { + children?: React.ReactNode; + title?: string; // Modify this type according to your specific title field type +} + +const hasTitleField = ( + component: React.ReactElement +): boolean => { + const { title } = component.props; + + return !!title; // Return true if the component has a non-empty title +}; + +export default hasTitleField; diff --git a/src/components/atoms/isComponentEmpty.tsx b/src/components/atoms/isComponentEmpty.tsx new file mode 100644 index 000000000..9e7f904d2 --- /dev/null +++ b/src/components/atoms/isComponentEmpty.tsx @@ -0,0 +1,12 @@ +import React from 'react'; + +const isComponentEmpty = (component: React.ReactNode): boolean => { + // Check if the component is null, undefined, or has no children + return ( + component === null || + component === undefined || + React.Children.count(component) === 0 + ); +}; + +export default isComponentEmpty; diff --git a/src/components/organisms/cardSlider/section/audiobooks.graphql b/src/components/organisms/cardSlider/section/audiobooks.graphql index 49a5fef10..770c4a98c 100644 --- a/src/components/organisms/cardSlider/section/audiobooks.graphql +++ b/src/components/organisms/cardSlider/section/audiobooks.graphql @@ -8,6 +8,7 @@ query getSectionAudiobooks( first: $first after: $after orderBy: [{ field: RECORDING_PUBLISHED_AT, direction: DESC }] + excludePersons: [{ personId: "128" }] ) { nodes { ...cardSequence diff --git a/src/containers/audiobook/list.graphql b/src/containers/audiobook/list.graphql index 1b70f0a5b..bb5d371bc 100644 --- a/src/containers/audiobook/list.graphql +++ b/src/containers/audiobook/list.graphql @@ -8,6 +8,7 @@ query getAudiobookListPageData( first: $first offset: $offset orderBy: [{ field: TITLE, direction: ASC }] + excludePersons: [{ personId: "128" }] ) { nodes { ...cardSequence From 49159d62b979fc62a5fe8737a254fe5ef4056417 Mon Sep 17 00:00:00 2001 From: Okeino McGowan Date: Tue, 17 Oct 2023 09:05:34 -0400 Subject: [PATCH 11/16] updated schema --- schema.graphql | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/schema.graphql b/schema.graphql index 9fb413672..6a56cdf65 100644 --- a/schema.graphql +++ b/schema.graphql @@ -546,6 +546,9 @@ type Collection implements Node & UniformResourceLocatable { after: String collectionIds: [ID!] + """The sequence must not be associated with any of the persons provided.""" + excludePersons: [RecordingPersonInput!] + """Return up to the first `n` elements from the list.""" first: Int @@ -2087,6 +2090,9 @@ type Person implements Node & UniformResourceLocatable { collectionId: ID collectionIds: [ID!] + """The sequence must not be associated with any of the persons provided.""" + excludePersons: [RecordingPersonInput!] + """Return up to the first `n` elements from the list.""" first: Int @@ -2399,6 +2405,9 @@ type Query { collectionId: ID collectionIds: [ID!] + """The sequence must not be associated with any of the persons provided.""" + excludePersons: [RecordingPersonInput!] + """Return up to the first `n` elements from the list.""" first: Int @@ -2653,6 +2662,9 @@ type Query { collectionIds: [ID!] contentType: SequenceContentType + """The sequence must not be associated with any of the persons provided.""" + excludePersons: [RecordingPersonInput!] + """Return up to the first `n` elements from the list.""" first: Int @@ -2786,6 +2798,9 @@ type Query { collectionId: ID collectionIds: [ID!] + """The sequence must not be associated with any of the persons provided.""" + excludePersons: [RecordingPersonInput!] + """Return up to the first `n` elements from the list.""" first: Int @@ -3200,6 +3215,9 @@ type Query { collectionIds: [ID!] contentType: SequenceContentType + """The sequence must not be associated with any of the persons provided.""" + excludePersons: [RecordingPersonInput!] + """Return up to the first `n` elements from the list.""" first: Int @@ -3228,6 +3246,9 @@ type Query { collectionId: ID collectionIds: [ID!] + """The sequence must not be associated with any of the persons provided.""" + excludePersons: [RecordingPersonInput!] + """Return up to the first `n` elements from the list.""" first: Int @@ -3459,6 +3480,9 @@ type Query { collectionId: ID collectionIds: [ID!] + """The sequence must not be associated with any of the persons provided.""" + excludePersons: [RecordingPersonInput!] + """Return up to the first `n` elements from the list.""" first: Int @@ -4540,6 +4564,9 @@ type Sponsor implements Node & UniformResourceLocatable { collectionIds: [ID!] contentType: SequenceContentType = SERIES + """The sequence must not be associated with any of the persons provided.""" + excludePersons: [RecordingPersonInput!] + """Return up to the first `n` elements from the list.""" first: Int From c5ad9c7478f841c92ddb084a2d4e98c16f13eb44 Mon Sep 17 00:00:00 2001 From: Okeino McGowan Date: Tue, 17 Oct 2023 13:54:45 -0400 Subject: [PATCH 12/16] created a name matcher to check for EGW so as to apply css --- src/components/atoms/nameMatcher.tsx | 17 +++++++++++++++++ src/components/molecules/card/sequence.tsx | 11 ++++++++++- 2 files changed, 27 insertions(+), 1 deletion(-) create mode 100644 src/components/atoms/nameMatcher.tsx diff --git a/src/components/atoms/nameMatcher.tsx b/src/components/atoms/nameMatcher.tsx new file mode 100644 index 000000000..bc00fdbc2 --- /dev/null +++ b/src/components/atoms/nameMatcher.tsx @@ -0,0 +1,17 @@ +import React from 'react'; + +interface Person { + __typename?: string; + name: string; +} + +interface NameMatcherProps { + person: Person; + targetName: string; +} + +const NameMatcher: React.FC = ({ person, targetName }) => { + return person.name === targetName; +}; + +export default NameMatcher; diff --git a/src/components/molecules/card/sequence.tsx b/src/components/molecules/card/sequence.tsx index 8b2252a44..441026cf9 100644 --- a/src/components/molecules/card/sequence.tsx +++ b/src/components/molecules/card/sequence.tsx @@ -21,6 +21,7 @@ import IconClosure from '~public/img/icons/icon-closure.svg'; import IconDisclosure from '~public/img/icons/icon-disclosure.svg'; import SuccessIcon from '~public/img/icons/icon-success-light.svg'; import { SequenceContentType } from '~src/__generated__/graphql'; +import NameMatcher from '~src/components/atoms/nameMatcher'; import ButtonFavorite from '../buttonFavorite'; import PersonLockup from '../personLockup'; @@ -49,6 +50,7 @@ export default function CardSequence({ const { isFavorited, toggleFavorited, playbackCompletedPercentage } = useIsSequenceFavorited(sequence.id); const [personsExpanded, setPersonsExpanded] = useState(false); + //const [thisPerson, setThisPerson] = useState(false); const router = useRouter(); const isBibleBook = sequence.contentType === SequenceContentType.BibleBook; @@ -136,6 +138,9 @@ export default function CardSequence({ ? writers.nodes : speakers.nodes) || []; + const isPersonMatched = persons.some((person) => + NameMatcher({ person, targetName: 'Ellen G. White' }) + ); const inner = ( <>
@@ -285,7 +290,11 @@ export default function CardSequence({ const className = clsx( styles.container, (isHovered || isSubHovered) && styles.otherHovered, - egw ? styles['EGWAUDIOBOOK'] : styles[contentType] + egw + ? styles['EGWAUDIOBOOK'] + : isPersonMatched + ? styles['EGWAUDIOBOOK'] + : styles[contentType] ); const linkUrl = (isBibleBook && (sequence.allRecordings.nodes || [])[0].canonicalPath) || From 5d18b103ef78126bca13d77e98714ddcf377d4b5 Mon Sep 17 00:00:00 2001 From: Okeino McGowan Date: Tue, 17 Oct 2023 16:11:56 -0400 Subject: [PATCH 13/16] updated book and EGW book sections to have dynamic headings --- public/compiled-lang/en.json | 16 ++++++++++++++-- public/lang/en.json | 10 ++++++++-- src/components/molecules/card/sequence.tsx | 19 +++++++++++-------- .../cardSlider/section/audiobooks.tsx | 17 ++++++++++++----- .../cardSlider/section/egwAudiobooks.tsx | 17 ++++++++++++----- src/containers/discover/index.tsx | 18 ++++++++++++++++-- 6 files changed, 73 insertions(+), 24 deletions(-) diff --git a/public/compiled-lang/en.json b/public/compiled-lang/en.json index ad2e60b90..4681cb1a9 100644 --- a/public/compiled-lang/en.json +++ b/public/compiled-lang/en.json @@ -1359,12 +1359,24 @@ "value": "Discover Collections" } ], + "discoverCollections_audiobooksHeading": [ + { + "type": 0, + "value": "Discover Books" + } + ], "discoverCollections_conferencesHeading": [ { "type": 0, "value": "Conferences" } ], + "discoverCollections_egwAudiobooksHeading": [ + { + "type": 0, + "value": "Discover Ellen G. White" + } + ], "discoverCollections_storySeasonsHeading": [ { "type": 0, @@ -3836,7 +3848,7 @@ "organismSection__audiobooksHeading": [ { "type": 0, - "value": "Discover Books" + "value": "Books" } ], "organismSection__audiobooksNext": [ @@ -3872,7 +3884,7 @@ "organismSection__egwAudiobooksHeading": [ { "type": 0, - "value": "Discover Ellen G. White" + "value": "Ellen G. White" } ], "organismSection__egwAudiobooksNext": [ diff --git a/public/lang/en.json b/public/lang/en.json index 2d5878104..69556a558 100644 --- a/public/lang/en.json +++ b/public/lang/en.json @@ -639,9 +639,15 @@ "discoverCollections__title": { "string": "Discover Collections" }, + "discoverCollections_audiobooksHeading": { + "string": "Discover Books" + }, "discoverCollections_conferencesHeading": { "string": "Conferences" }, + "discoverCollections_egwAudiobooksHeading": { + "string": "Discover Ellen G. White" + }, "discoverCollections_storySeasonsHeading": { "string": "Stories" }, @@ -1813,7 +1819,7 @@ "string": "Sponsor" }, "organismSection__audiobooksHeading": { - "string": "Discover Books" + "string": "Books" }, "organismSection__audiobooksNext": { "string": "Next audiobooks" @@ -1831,7 +1837,7 @@ "string": "Previous Bible books" }, "organismSection__egwAudiobooksHeading": { - "string": "Discover Ellen G. White" + "string": "Ellen G. White" }, "organismSection__egwAudiobooksNext": { "string": "Next EGW audiobooks" diff --git a/src/components/molecules/card/sequence.tsx b/src/components/molecules/card/sequence.tsx index 441026cf9..ffde52b25 100644 --- a/src/components/molecules/card/sequence.tsx +++ b/src/components/molecules/card/sequence.tsx @@ -17,6 +17,7 @@ import BookIcon from '~public/img/icons/fa-book-light.svg'; import FeatherIcon from '~public/img/icons/fa-feather-light.svg'; import ListIcon from '~public/img/icons/fa-list-alt.svg'; import MusicIcon from '~public/img/icons/fa-music-light.svg'; +import SeedlingIcon from '~public/img/icons/fa-seedling.svg'; import IconClosure from '~public/img/icons/icon-closure.svg'; import IconDisclosure from '~public/img/icons/icon-disclosure.svg'; import SuccessIcon from '~public/img/icons/icon-success-light.svg'; @@ -119,7 +120,7 @@ export default function CardSequence({ labelColor: BaseColors.DARK, }, [SequenceContentType.StorySeason]: { - Icon: FeatherIcon, + Icon: SeedlingIcon, accentColor: BaseColors.SALMON, backgroundColor: BaseColors.STORY_B, iconColor: BaseColors.WHITE, @@ -174,13 +175,15 @@ export default function CardSequence({ ultralight className={egw ? styles.bookReadBy : styles.bibleReadBy} > - + {(speakers.nodes || [])[0]?.name && ( + + )} )} {summary && ( diff --git a/src/components/organisms/cardSlider/section/audiobooks.tsx b/src/components/organisms/cardSlider/section/audiobooks.tsx index 48a076230..6ebeb4007 100644 --- a/src/components/organisms/cardSlider/section/audiobooks.tsx +++ b/src/components/organisms/cardSlider/section/audiobooks.tsx @@ -9,16 +9,23 @@ import { useLanguageId } from '~src/lib/useLanguageId'; import { useInfiniteGetSectionAudiobooksQuery } from './__generated__/audiobooks'; import Section from './index'; -export default function Audiobooks(): JSX.Element { +export default function Audiobooks(props: { + heading?: string | JSX.Element; +}): JSX.Element { const intl = useIntl(); const lang = useLanguageId(); + + const { + heading = intl.formatMessage({ + id: 'organismSection__audiobooksHeading', + defaultMessage: 'Books', + }), + } = props; + return (
- - + + } + /> + + } + /> Date: Thu, 19 Oct 2023 07:04:54 -0400 Subject: [PATCH 14/16] updated section index to return an empty JSX element is cards length < 1 --- .../cardSlider/section/egwAudiobooks.tsx | 31 +++++++++++-------- .../organisms/cardSlider/section/index.tsx | 5 +++ 2 files changed, 23 insertions(+), 13 deletions(-) diff --git a/src/components/organisms/cardSlider/section/egwAudiobooks.tsx b/src/components/organisms/cardSlider/section/egwAudiobooks.tsx index 38a40b23b..de1fe5e00 100644 --- a/src/components/organisms/cardSlider/section/egwAudiobooks.tsx +++ b/src/components/organisms/cardSlider/section/egwAudiobooks.tsx @@ -9,23 +9,28 @@ import { useLanguageId } from '~src/lib/useLanguageId'; import { useInfiniteGetSectionEgwAudiobooksQuery } from './__generated__/egwAudiobooks'; import Section from './index'; -export default function EgwAudiobooks(props: { +interface EgwAudiobooksProps { heading?: string | JSX.Element; -}): JSX.Element { +} + +const EgwAudiobooks: React.FC = ({ heading }) => { const intl = useIntl(); const lang = useLanguageId(); - const { - heading = intl.formatMessage({ - id: 'organismSection__egwAudiobooksHeading', - defaultMessage: 'Ellen G. White', - }), - } = props; + const renderCard = (p: { node: CardSequenceFragment }) => { + return ; + }; return (
( - - )} + Card={renderCard} /> ); -} +}; + +export default EgwAudiobooks; diff --git a/src/components/organisms/cardSlider/section/index.tsx b/src/components/organisms/cardSlider/section/index.tsx index 79f74480c..ac091ba86 100644 --- a/src/components/organisms/cardSlider/section/index.tsx +++ b/src/components/organisms/cardSlider/section/index.tsx @@ -97,6 +97,11 @@ export default function Section({ [fetchNextPage] ); + // Check if there's content to render, if not, return an empty JSX element + if (cards.length < 1) { + return <>; + } + return (
From 5eaf8e5327d171d2221de089434c278e097b88d2 Mon Sep 17 00:00:00 2001 From: Okeino McGowan Date: Tue, 24 Oct 2023 10:03:19 -0400 Subject: [PATCH 15/16] added EGW IDs to audiobook queries --- .../organisms/cardSlider/section/audiobooks.graphql | 9 ++++++++- .../organisms/cardSlider/section/egwAudiobooks.graphql | 9 ++++++++- src/containers/audiobook/egwList.graphql | 9 ++++++++- src/containers/audiobook/list.graphql | 9 ++++++++- 4 files changed, 32 insertions(+), 4 deletions(-) diff --git a/src/components/organisms/cardSlider/section/audiobooks.graphql b/src/components/organisms/cardSlider/section/audiobooks.graphql index 770c4a98c..5b44d8a09 100644 --- a/src/components/organisms/cardSlider/section/audiobooks.graphql +++ b/src/components/organisms/cardSlider/section/audiobooks.graphql @@ -8,7 +8,14 @@ query getSectionAudiobooks( first: $first after: $after orderBy: [{ field: RECORDING_PUBLISHED_AT, direction: DESC }] - excludePersons: [{ personId: "128" }] + excludePersons: [ + { personId: 128 } + { personId: 381 } + { personId: 445 } + { personId: 506 } + { personId: 1208 } + { personId: 1884 } + ] #temp fix, need a flag on DB ) { nodes { ...cardSequence diff --git a/src/components/organisms/cardSlider/section/egwAudiobooks.graphql b/src/components/organisms/cardSlider/section/egwAudiobooks.graphql index 47f11d0cf..28f70aa63 100644 --- a/src/components/organisms/cardSlider/section/egwAudiobooks.graphql +++ b/src/components/organisms/cardSlider/section/egwAudiobooks.graphql @@ -8,7 +8,14 @@ query getSectionEgwAudiobooks( first: $first after: $after orderBy: [{ field: RECORDING_PUBLISHED_AT, direction: DESC }] - persons: [{ personId: 128 }] + persons: [ + { personId: 128 } + { personId: 381 } + { personId: 445 } + { personId: 506 } + { personId: 1208 } + { personId: 1884 } + ] #temp fix, need a flag on DB ) { nodes { ...cardSequence diff --git a/src/containers/audiobook/egwList.graphql b/src/containers/audiobook/egwList.graphql index c0b9d6936..a60b86966 100644 --- a/src/containers/audiobook/egwList.graphql +++ b/src/containers/audiobook/egwList.graphql @@ -8,7 +8,14 @@ query getEgwAudiobookListPageData( first: $first offset: $offset orderBy: [{ field: TITLE, direction: ASC }] - persons: [{ personId: 128 }] + persons: [ + { personId: 128 } + { personId: 381 } + { personId: 445 } + { personId: 506 } + { personId: 1208 } + { personId: 1884 } + ] #temp fix, need a flag on DB ) { nodes { ...cardSequence diff --git a/src/containers/audiobook/list.graphql b/src/containers/audiobook/list.graphql index bb5d371bc..f50099110 100644 --- a/src/containers/audiobook/list.graphql +++ b/src/containers/audiobook/list.graphql @@ -8,7 +8,14 @@ query getAudiobookListPageData( first: $first offset: $offset orderBy: [{ field: TITLE, direction: ASC }] - excludePersons: [{ personId: "128" }] + excludePersons: [ + { personId: 128 } + { personId: 381 } + { personId: 445 } + { personId: 506 } + { personId: 1208 } + { personId: 1884 } + ] #temp fix, need a flag on DB ) { nodes { ...cardSequence From 48982deca0900923684be6400f36360e545c85c4 Mon Sep 17 00:00:00 2001 From: Okeino McGowan Date: Tue, 24 Oct 2023 10:54:39 -0400 Subject: [PATCH 16/16] removed comments fron query audiobook files --- src/components/organisms/cardSlider/section/audiobooks.graphql | 2 +- .../organisms/cardSlider/section/egwAudiobooks.graphql | 2 +- src/containers/audiobook/egwList.graphql | 2 +- src/containers/audiobook/list.graphql | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/components/organisms/cardSlider/section/audiobooks.graphql b/src/components/organisms/cardSlider/section/audiobooks.graphql index 5b44d8a09..d0c632be9 100644 --- a/src/components/organisms/cardSlider/section/audiobooks.graphql +++ b/src/components/organisms/cardSlider/section/audiobooks.graphql @@ -15,7 +15,7 @@ query getSectionAudiobooks( { personId: 506 } { personId: 1208 } { personId: 1884 } - ] #temp fix, need a flag on DB + ] ) { nodes { ...cardSequence diff --git a/src/components/organisms/cardSlider/section/egwAudiobooks.graphql b/src/components/organisms/cardSlider/section/egwAudiobooks.graphql index 28f70aa63..d69486743 100644 --- a/src/components/organisms/cardSlider/section/egwAudiobooks.graphql +++ b/src/components/organisms/cardSlider/section/egwAudiobooks.graphql @@ -15,7 +15,7 @@ query getSectionEgwAudiobooks( { personId: 506 } { personId: 1208 } { personId: 1884 } - ] #temp fix, need a flag on DB + ] ) { nodes { ...cardSequence diff --git a/src/containers/audiobook/egwList.graphql b/src/containers/audiobook/egwList.graphql index a60b86966..5b4ca2d7a 100644 --- a/src/containers/audiobook/egwList.graphql +++ b/src/containers/audiobook/egwList.graphql @@ -15,7 +15,7 @@ query getEgwAudiobookListPageData( { personId: 506 } { personId: 1208 } { personId: 1884 } - ] #temp fix, need a flag on DB + ] ) { nodes { ...cardSequence diff --git a/src/containers/audiobook/list.graphql b/src/containers/audiobook/list.graphql index f50099110..835a662db 100644 --- a/src/containers/audiobook/list.graphql +++ b/src/containers/audiobook/list.graphql @@ -15,7 +15,7 @@ query getAudiobookListPageData( { personId: 506 } { personId: 1208 } { personId: 1884 } - ] #temp fix, need a flag on DB + ] ) { nodes { ...cardSequence