community-platform
community-platform copied to clipboard
feat: question filters
PR Checklist
- [x] - Commit messages are descriptive, it will be used in our Release Notes
PR Type
- [ ] Bug fix (non-breaking change which fixes an issue)
- [x] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to change)
- [ ] Developer experience (improves developer workflows for contributing to the project)
Description
Followup on https://github.com/ONEARMY/community-platform/pull/3121, #3222
Queries firebase directly for fetching questions, with pagination. It's possible to filter, sort, and load more items.
This is the new approach, ready for server-side rendering, which doesn't use mobx/fuse.js. Items are always requested from the database on each search/filter. Fetches only 10 (configurable) items at a time, instead of the whole collection.
Using the new, modular API from firestore. https://firebase.google.com/docs/firestore/query-data/queries#or_queries
(required for or
queries)
Deprecated Random filter as they are not possible with firestore queries. Search no longer supports fuzziness, but I don't think it's that useful or a blocker.
The required indexes are defined on a firebase config file and automatically deployed.
Git Issues
Closes https://github.com/ONEARMY/community-platform/issues/2968 Solves https://github.com/ONEARMY/community-platform/issues/3307 for Questions Module
Visit the preview URL for this PR (updated for commit 161bf52):
https://onearmy-next--pr3349-feat-question-filter-m9e6nih9.web.app
(expires Fri, 26 Apr 2024 11:04:28 GMT)
🔥 via Firebase Hosting GitHub Action 🌎
Sign: 6d65e4f8fee2f6ab2da0c1c3b85b8797d66afa59
Passing run #5324 ↗︎
![]() |
![]() |
![]() |
![]() |
![]() |
Details:
fix: unrelated cypress test issue with location | |||
Project: onearmy-community-platform | Commit: 161bf52631 |
||
Status: Passed | Duration: 04:37 💡 | ||
Started: Mar 25, 2024 12:45 PM | Ended: Mar 25, 2024 12:49 PM |
Review all test suite changes for PR #3349 ↗︎
Codecov Report
Attention: Patch coverage is 67.30769%
with 51 lines
in your changes are missing coverage. Please review.
Project coverage is 65.79%. Comparing base (
9472531
) to head (161bf52
).
Additional details and impacted files
@@ Coverage Diff @@
## master #3349 +/- ##
==========================================
- Coverage 65.85% 65.79% -0.07%
==========================================
Files 411 416 +5
Lines 13315 13450 +135
Branches 2436 2478 +42
==========================================
+ Hits 8769 8849 +80
- Misses 4494 4549 +55
Partials 52 52
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
I've added ts-jest
to make it easier to run tests locally
:tada: This PR is included in version 1.165.0 :tada:
The release is available on GitHub release
Your semantic-release bot :package::rocket: