Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(Search): Add text and categories search #190

Merged
merged 41 commits into from
Aug 15, 2023

Conversation

vogelino
Copy link
Contributor

@vogelino vogelino commented Aug 8, 2023

This PR adds a text and category search into the sidebar and URL.
It should now be possible to:

  • Filter items by text
  • Filter items by category
  • Combine filters together to find specific items
  • Get the same results when reloading the page and using the browser history
  • Clear the text search easily
  • See the first two categories by default when no parameters exist in the URL
  • Cache the result once loaded so it isn't requested from the API a second time
  • Avoid changing the filters while a request to the API is happening
  • Avoid text searches longer than 100 chars long (This limit can be changed)
  • Show the Sidebar button only when opened (Now only says "Suche" and doesn't show the number of active filters, as the categories are always active by default)

New texts key added in Grist:

  • textSearchLabel
  • textSearchPlaceholder
  • textSearchCategorySelfHelp
  • textSearchCategoryAdvising
  • textSearchCategoryClinics
  • textSearchCategoryOnlineOffers
  • textSearchCategoryDisctrictOfficeHelp
  • optionalFurtherSearchIntroText
  • filtersButtonLoading

Changed texts key in Grist:

  • filtersSearchTargetLabel
  • filterLabel

Todos:

  • URL Params Parsing
  • API search
  • Button count update
  • Refactor complex functions
  • Show current search config in list
  • Show "No results UI" in list
  • Advanced Text Field UI with confirmed state
  • Limit and sanitize text seach query

@vercel
Copy link

vercel bot commented Aug 8, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
wegweiser-frontend ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 15, 2023 7:35am

@socket-security
Copy link

New dependencies detected. Learn more about Socket for GitHub ↗︎

Packages Version New capabilities Transitives Size Publisher
@tailwindcss/container-queries 0.1.1 None +0 8.46 kB malfaitrobin
swr 2.2.0 None +1 301 kB vercel-release-bot

…gories by default

And remove logic that reactivates all categories when none is selected
anymore as discussed with @Esshahn
pages/sofortige-hilfe.tsx Outdated Show resolved Hide resolved
as it leads to formatting problems and is already handled by next
Copy link
Contributor

@raphael-arce raphael-arce left a comment

Choose a reason for hiding this comment

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

Minor: a few typos to correct, otherwise LGTM!

src/lib/UrlStateContext.tsx Outdated Show resolved Hide resolved
src/lib/UrlStateContext.tsx Outdated Show resolved Hide resolved
src/lib/facilityFilterUtil.ts Outdated Show resolved Hide resolved
src/lib/hooks/useFilteredFacilitiesCount.ts Outdated Show resolved Hide resolved
Copy link
Contributor

@raphael-arce raphael-arce left a comment

Choose a reason for hiding this comment

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

Great improvements, minor typos other LGTM

src/lib/UrlStateContext.tsx Outdated Show resolved Hide resolved
src/lib/TextsContext.tsx Outdated Show resolved Hide resolved
@vogelino vogelino merged commit 2a169bf into staging Aug 15, 2023
5 checks passed
@vogelino vogelino deleted the feat/full-text-search-frontend branch August 15, 2023 07:41
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.

3 participants