Skip to content

Conversation

carylwyatt
Copy link
Member

@carylwyatt carylwyatt commented Dec 5, 2024

related to hathitrust/babel#70 and hathitrust/catalog#65

This adds an "Original Location" filter option to the advanced search component.

See this in action on dev-3 catalog and ls (vpn required).

FilterableSelection component

I added another FilterableSelection component to match the 'Language' and 'Format' selection options. This version, however, sets the 'multiple' prop to false because selecting two locations did not work in either catalog or ls.

search parameters

I updated the functions for catalog and ls search URLs. The form itself is identical, but the URLs for searching in catalog and ls have slight differences. I added functions for appending an htsource facet/filter to the search parameters. There is also some logic in the onMount() hook that checks if there are existing search parameters when the page is loaded (in case the user clicked 'Revise this advanced search' from the search results page) so that those options are pre-filled/pre-selected in the form. I added some conditionals for original location for both catalog and ls that updates the component with that value from the URL.

testing

Things you could test:

  • multiple search terms with a location selected
  • multiple languages with location selected
  • * as search term with location selected (to see all items from that location)
  • click the “revise this advanced search” button (in both catalog and ls views) to make sure all facets are retained (this is annoying to do with the FilterableSelection components, but we will be addressing this in the future)

@carylwyatt carylwyatt changed the title DEV-900 DEV-900: add 'original location' filter to advanced search Dec 12, 2024
Copy link

@mwarin mwarin left a comment

Choose a reason for hiding this comment

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

Works well for me, both in catalog & ls. I tried searching, refining, faceting, and they all work as expected. Seems to work fine in combination with other search terms. I was barred from supplying multiple "Original Location" values, which you pointed out. Using original location containing non-latin chars (e.g. Keio, Beirut) works fine.

Had a look at the code diffs but saw nothing to remark on there.

My only minor gripe is that the restriction that only 0/1 original location can be used in a search is not clearly communicated. The "Format" selector above says "Select one or more options ..." but "Original Location" says nothing.

I don't know the rules for where to break a Japanese string for line wrapping, but Keio wraps like this:
image

... when all other "Original Location" names break on whitespace.

In summary: Neat! I saw no issues. APPROVE.

@carylwyatt
Copy link
Member Author

@mwarin Thanks for your comment about line breaks in Japanese, it hadn't occurred to me that it probably wasn't right! I'm going to leave an issue in the catalog repo (this line of text comes from the derived_data via solr) with some notes for maybe an idea of how to fix it.

@carylwyatt carylwyatt merged commit af29218 into main Dec 19, 2024
6 checks passed
@carylwyatt carylwyatt deleted the DEV-900 branch March 13, 2025 16:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants