Skip to content

Commit

Permalink
Merge pull request #494 from audioverse-org/AV-661-Search-by-Bible-Bo…
Browse files Browse the repository at this point in the history
…oks-on-the-Content-Type-Filter-Section-website

Av 661 search by bible books on the content type filter section website
  • Loading branch information
jlaverde77 authored Nov 9, 2023
2 parents f55f5d2 + 5f8a7bb commit 4e3219c
Show file tree
Hide file tree
Showing 5 changed files with 62 additions and 6 deletions.
14 changes: 13 additions & 1 deletion public/compiled-lang/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -4771,6 +4771,18 @@
"value": "All"
}
],
"search__bibleBooksHeading": [
{
"type": 0,
"value": "Bible"
}
],
"search__bileBooksSeeAll": [
{
"type": 0,
"value": "See All Matching Bible books"
}
],
"search__booksHeading": [
{
"type": 0,
Expand Down Expand Up @@ -4798,7 +4810,7 @@
"search__egwbooksHeading": [
{
"type": 0,
"value": "Ellen White"
"value": "EGW"
}
],
"search__egwbooksSeeAll": [
Expand Down
8 changes: 7 additions & 1 deletion public/lang/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -2280,6 +2280,12 @@
"search__allHeading": {
"string": "All"
},
"search__bibleBooksHeading": {
"string": "Bible"
},
"search__bileBooksSeeAll": {
"string": "See All Matching Bible books"
},
"search__booksHeading": {
"string": "Audiobooks"
},
Expand All @@ -2293,7 +2299,7 @@
"string": "See All Matching Conferences"
},
"search__egwbooksHeading": {
"string": "Ellen White"
"string": "EGW"
},
"search__egwbooksSeeAll": {
"string": "See All Matching Ellen White Audiobooks"
Expand Down
18 changes: 14 additions & 4 deletions src/components/organisms/searchResults.filters.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { FormattedMessage } from 'react-intl';

import {
GetSearchAudiobooksDocument,
GetSearchBiblebooksDocument,
GetSearchConferencesDocument,
GetSearchEgwAudiobooksDocument,
GetSearchMusicTracksDocument,
Expand Down Expand Up @@ -78,6 +79,18 @@ export const filters: Record<string, EntityFilter> = {
),
document: GetSearchSeriesDocument,
},
bible: {
heading: (
<FormattedMessage id="search__bibleBooksHeading" defaultMessage="Bible" />
),
seeAll: (
<FormattedMessage
id="search__bileBooksSeeAll"
defaultMessage="See All Matching Bible books"
/>
),
document: GetSearchBiblebooksDocument,
},
books: {
heading: (
<FormattedMessage id="search__booksHeading" defaultMessage="Audiobooks" />
Expand All @@ -92,10 +105,7 @@ export const filters: Record<string, EntityFilter> = {
},
egwbooks: {
heading: (
<FormattedMessage
id="search__egwbooksHeading"
defaultMessage="Ellen White"
/>
<FormattedMessage id="search__egwbooksHeading" defaultMessage="EGW" />
),
seeAll: (
<FormattedMessage
Expand Down
27 changes: 27 additions & 0 deletions src/components/organisms/searchResults.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,33 @@ query getSearchEgwAudiobooks(
}
}
}
query getSearchBiblebooks(
$language: Language!
$term: String!
$first: Int!
$after: String
) {
sequences(
language: $language
contentType: BIBLE_BOOK
first: $first
after: $after
search: $term
orderBy: [{ field: ID, direction: ASC }]
) {
aggregate {
count
}
nodes {
...cardSequence
}

pageInfo {
hasNextPage
endCursor
}
}
}

query getSearchMusicTracks(
$language: Language!
Expand Down
1 change: 1 addition & 0 deletions src/components/organisms/searchResults.useResults.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ function useQueryResults(filter: EntityFilterId, term: string) {
series: useFilterQuery('series', vars, filter),
books: useFilterQuery('books', vars, filter),
egwbooks: useFilterQuery('egwbooks', vars, filter),
bible: useFilterQuery('bible', vars, filter),
sponsors: useFilterQuery('sponsors', vars, filter),
conferences: useFilterQuery('conferences', vars, filter),
music: useFilterQuery('music', vars, filter),
Expand Down

1 comment on commit 4e3219c

@vercel
Copy link

@vercel vercel bot commented on 4e3219c Nov 9, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.