Skip to content

Commit

Permalink
Merge pull request #266 from performant-software/feature/basira257_da…
Browse files Browse the repository at this point in the history
…te_facet_input

BASIRA #257 - Date facet input
  • Loading branch information
dleadbetter authored Dec 9, 2024
2 parents 28e1748 + 8775003 commit 59d1297
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 21 deletions.
4 changes: 2 additions & 2 deletions client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
"dependencies": {
"@babel/eslint-parser": "^7.21.3",
"@babel/runtime": "^7.22.3",
"@performant-software/semantic-components": "^2.2.17",
"@performant-software/shared-components": "^2.2.17",
"@performant-software/semantic-components": "^2.2.18",
"@performant-software/shared-components": "^2.2.18",
"@testing-library/jest-dom": "^5.11.4",
"@testing-library/react": "^11.1.0",
"@testing-library/user-event": "^12.1.10",
Expand Down
7 changes: 1 addition & 6 deletions client/src/components/SearchFacets.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import {
import React, { useCallback, useRef } from 'react';
import { useTranslation } from 'react-i18next';
import {
useHits,
useRange,
useRefinementList,
useToggleRefinement
Expand All @@ -24,7 +23,6 @@ const MAX_SHOW_MORE_LIMIT = 1000;

const SearchFacets = (props: any) => {
const { getLabel } = useFacetLabels();
const { hits } = useHits(props);
const { t } = useTranslation();

const refs = useRef([]);
Expand Down Expand Up @@ -68,10 +66,6 @@ const SearchFacets = (props: any) => {
*/
const setRef = useCallback((element) => refs.current.push(element), [refs]);

if (_.isEmpty(hits)) {
return null;
}

return (
<Segment
className='search-facets'
Expand All @@ -93,6 +87,7 @@ const SearchFacets = (props: any) => {
<FacetSlider
attribute='artwork.date_range_facet'
defaultActive={false}
editable
ref={setRef}
title={getLabel('artwork.date_range_facet')}
useRangeSlider={useRange}
Expand Down
10 changes: 5 additions & 5 deletions client/src/pages/Search.js
Original file line number Diff line number Diff line change
Expand Up @@ -148,23 +148,23 @@ const Search = () => {
<SearchResultsSort
items={[{
label: t('Search.sort.relevance.label'),
value: 'documents/sort/_text_match:desc'
value: `${process.env.REACT_APP_TYPESENSE_COLLECTION_NAME}/sort/_text_match:desc`
}, {
label: t('Search.sort.artworkDate.label'),
description: t('Search.sort.artworkDate.descriptionAsc'),
value: 'documents/sort/artwork.date_start:asc'
value: `${process.env.REACT_APP_TYPESENSE_COLLECTION_NAME}/sort/artwork.date_start:asc`
}, {
label: t('Search.sort.artworkDate.label'),
description: t('Search.sort.artworkDate.descriptionDesc'),
value: 'documents/sort/artwork.date_start:desc'
value: `${process.env.REACT_APP_TYPESENSE_COLLECTION_NAME}/sort/artwork.date_start:desc`
}, {
label: t('Search.sort.creationDate.label'),
description: t('Search.sort.creationDate.descriptionAsc'),
value: 'documents/sort/artwork.created_at:asc'
value: `${process.env.REACT_APP_TYPESENSE_COLLECTION_NAME}/sort/artwork.created_at:asc`
}, {
label: t('Search.sort.creationDate.label'),
description: t('Search.sort.creationDate.descriptionDesc'),
value: 'documents/sort/artwork.created_at:desc'
value: `${process.env.REACT_APP_TYPESENSE_COLLECTION_NAME}/sort/artwork.created_at:desc`
}]}
useSortBy={useSortBy}
/>
Expand Down
16 changes: 8 additions & 8 deletions client/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2549,10 +2549,10 @@
"@nodelib/fs.scandir" "2.1.5"
fastq "^1.6.0"

"@performant-software/semantic-components@^2.2.17":
version "2.2.17"
resolved "https://registry.yarnpkg.com/@performant-software/semantic-components/-/semantic-components-2.2.17.tgz#3ca3d4d236a36b4feeea871f285bfc3648e1b7d3"
integrity sha512-nSQpHsFjq5sWlBp0yw5i/sCNIYjK5BHLoIc2vKEJ804v7jPvFWmhIzDC7hnRl00iR+Dlf3XPcmcgNlpXsTjEtw==
"@performant-software/semantic-components@^2.2.18":
version "2.2.18"
resolved "https://registry.yarnpkg.com/@performant-software/semantic-components/-/semantic-components-2.2.18.tgz#14ab574484afdc07c19e8ee6717b6e656e02e72e"
integrity sha512-Ejz5kUQMViDizkPwG2wFWO6LIc977WAnzSnmU0D6ZEpTdQT8Dxarz9beKJN4p2nBr/WCFHBbMx2XqRjMx8uW8A==
dependencies:
"@react-google-maps/api" "^2.8.1"
axios "^0.26.1"
Expand All @@ -2570,10 +2570,10 @@
zotero-api-client "^0.40.0"
zotero-translation-client "^5.0.1"

"@performant-software/shared-components@^2.2.17":
version "2.2.17"
resolved "https://registry.yarnpkg.com/@performant-software/shared-components/-/shared-components-2.2.17.tgz#d3aed2d957f6d711273ba8a20c9566e449778cbc"
integrity sha512-BQPj2bYjJPzjJi/NGQ0gURSadft9V+3ajJLJ2MXrrRIaWlPyH4HEA+5mD1sxlayEx0FGcWculdUh6V8MFAetIA==
"@performant-software/shared-components@^2.2.18":
version "2.2.18"
resolved "https://registry.yarnpkg.com/@performant-software/shared-components/-/shared-components-2.2.18.tgz#8c32e889606debd59aecb12de6d297fafad0d0dc"
integrity sha512-N/WDflcliCGRl9urVYFEw5oiEbVMEGc/RyYigsa9ozWAbUscmKUXdwsZxJ9ydqrmj+Q1DCCMiezNycXgaY3WAQ==
dependencies:
"@react-google-maps/api" "^2.8.1"
axios "^0.26.1"
Expand Down

0 comments on commit 59d1297

Please sign in to comment.