Skip to content

Commit

Permalink
added section for Ellen G, White in search results and updated search…
Browse files Browse the repository at this point in the history
… query
  • Loading branch information
okeino committed Oct 26, 2023
1 parent 7bc85ec commit 20abef3
Show file tree
Hide file tree
Showing 5 changed files with 82 additions and 1 deletion.
12 changes: 12 additions & 0 deletions public/compiled-lang/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -4795,6 +4795,18 @@
"value": "See All Matching Conferences"
}
],
"search__egwbooksHeading": [
{
"type": 0,
"value": "Ellen G. White"
}
],
"search__egwbooksSeeAll": [
{
"type": 0,
"value": "See All Matching Ellen G. White Audiobooks"
}
],
"search__emptyStateMessage": [
{
"type": 0,
Expand Down
6 changes: 6 additions & 0 deletions public/lang/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -2292,6 +2292,12 @@
"search__conferencesSeeAll": {
"string": "See All Matching Conferences"
},
"search__egwbooksHeading": {
"string": "Ellen G. White"
},
"search__egwbooksSeeAll": {
"string": "See All Matching Ellen G. White Audiobooks"
},
"search__emptyStateMessage": {
"string": "Try searching for something else"
},
Expand Down
16 changes: 16 additions & 0 deletions src/components/organisms/searchResults.filters.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { FormattedMessage } from 'react-intl';
import {
GetSearchAudiobooksDocument,
GetSearchConferencesDocument,
GetSearchEgwAudiobooksDocument,
GetSearchMusicTracksDocument,
GetSearchPersonsDocument,
GetSearchRecordingsDocument,
Expand Down Expand Up @@ -89,6 +90,21 @@ export const filters: Record<string, EntityFilter> = {
),
document: GetSearchAudiobooksDocument,
},
egwbooks: {
heading: (
<FormattedMessage
id="search__egwbooksHeading"
defaultMessage="Ellen G. White"
/>
),
seeAll: (
<FormattedMessage
id="search__egwbooksSeeAll"
defaultMessage="See All Matching Ellen G. White Audiobooks"
/>
),
document: GetSearchEgwAudiobooksDocument,
},
sponsors: {
heading: (
<FormattedMessage
Expand Down
48 changes: 47 additions & 1 deletion src/components/organisms/searchResults.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,53 @@ query getSearchAudiobooks(
$first: Int!
$after: String
) {
audiobooks(language: $language, search: $term, first: $first, after: $after) {
audiobooks(
language: $language
search: $term
first: $first
after: $after
excludePersons: [
{ personId: 128 }
{ personId: 381 }
{ personId: 445 }
{ personId: 506 }
{ personId: 1208 }
{ personId: 1884 }
]
) {
aggregate {
count
}
nodes {
...cardSequence
}
pageInfo {
hasNextPage
endCursor
}
}
}

query getSearchEgwAudiobooks(
$language: Language!
$term: String!
$first: Int!
$after: String
) {
audiobooks(
language: $language
search: $term
first: $first
after: $after
persons: [
{ personId: 128 }
{ personId: 381 }
{ personId: 445 }
{ personId: 506 }
{ personId: 1208 }
{ personId: 1884 }
]
) {
aggregate {
count
}
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 @@ -111,6 +111,7 @@ function useQueryResults(filter: EntityFilterId, term: string) {
teachings: useFilterQuery('teachings', vars, filter),
series: useFilterQuery('series', vars, filter),
books: useFilterQuery('books', vars, filter),
egwbooks: useFilterQuery('egwbooks', vars, filter),
sponsors: useFilterQuery('sponsors', vars, filter),
conferences: useFilterQuery('conferences', vars, filter),
music: useFilterQuery('music', vars, filter),
Expand Down

0 comments on commit 20abef3

Please sign in to comment.