Repository navigation
fix: preserve facet term keys in catalog search responses [FC-0137] - #185
Conversation
|
Thanks for the pull request, @rpenido! This repository is currently maintained by Once you've gone through the following steps feel free to tag them in a comment and let them know that your changes are ready for engineering review. 🔘 Get product approvalIf you haven't already, check this list to see if your contribution needs to go through the product review process.
🔘 Provide contextTo help your reviewers and other members of the community understand the purpose and larger context of your changes, feel free to add as much of the following information to the PR description as you can:
🔘 Get a green buildIf one or more checks are failing, continue working on your changes until this is no longer the case and your build turns green. DetailsWhere can I find more information?If you'd like to get more details on all aspects of the review process for open source pull requests (OSPRs), check out the following resources: When can I expect my changes to be merged?Our goal is to get community contributions seen and reviewed as efficiently as possible. However, the amount of time that it takes to review and merge a PR can vary significantly based on factors such as:
💡 As a result it may take up to several weeks or months to complete a review and merge your PR. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #185 +/- ##
=======================================
Coverage 99.57% 99.57%
=======================================
Files 101 101
Lines 708 708
Branches 166 177 +11
=======================================
Hits 705 705
Misses 2 2
Partials 1 1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
cbc78bd to
45ab706
Compare
3275696 to
ed9dae1
Compare
ed9dae1 to
99117c1
Compare
7595c2c to
e5407d9
Compare
brian-smith-tcril
left a comment
There was a problem hiding this comment.
LGTM!
I'll merge this once #175 lands!
e5407d9 to
fdff8fa
Compare
- Adds `SearchResponseBase`, `CatalogSearchResult` and `CatalogSearchResponse`, where a result is a `Course` or a `Pathway`. `PathwayData` is the pathway payload type; the card component comes in the next PR. - Normalizes `result.type` in `normalizeCatalogSearchResponse`: pathway rows stay `pathway` and every other row becomes `course`, so callers can test `type === 'course'` instead of `!== 'pathway'`. The legacy `_doc` arm is removed from `Course`. - Adds optional `labels` to aggregation facets, and preserves the dynamic keys under `aggs.*.labels`, which are backend slugs and must be sent back verbatim as filter values. The `aggs.*.terms` fix is in #185. - Adds the `catalogDataTable.v1` and `catalogDataTableCardView.v1` slot ids. Both carry the mixed response and wrap the deprecated `courseCatalogDataTable.v1` and `courseCatalogDataTableCardView.v1`, which keep `CourseListSearchResponse` and `totalCourses` and only receive course rows. `totalItems` is the new data table prop. - Restores `CourseListSearchResponse` to its pre-pathway declaration and exports it next to `CatalogSearchResponse`. - Widens the hook, `useCatalogData` and the page types to the mixed response. - Until the pathway card exists, the home list uses a switch that skips pathway results. #176 adds the pathway card case.
fdff8fa to
a6a06c9
Compare
|
🎉 This PR is included in version 1.0.0-alpha.7 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Description
camelCaseObjectwas rewriting the keys under aggregationterms, so a facet value such asopen-edxbecameopenEdx.transformAggregationsToFilterChoicessends those keys back as filter values, so any org or category slug that lodash changes never matched. This normalizes the response to camelCase while keepingaggs.*.termskeys verbatim.#175 is merged, so this is the first PR on top of
master. Review only the last commit.Supporting information
labelsaddition to the normalizer stays in feat: support mixed course and pathway search responses [FC-0137] #175.Testing instructions
.nvmrcand install dependencies withnpm ci.npm run devand open http://apps.local.openedx.io:1998/catalog/courses against an LMS with an org or category slug that camelCase would alter.Private ref: FAL-4374