Skip to content

fix: preserve facet term keys in catalog search responses [FC-0137] - #185

Merged
brian-smith-tcril merged 1 commit into
openedx:masterfrom
open-craft:rpenido/fal-4374/fix-facet-term-keys
Dec 1, 2026
Merged

brian-smith-tcril merged 1 commit into
openedx:masterfrom
open-craft:rpenido/fal-4374/fix-facet-term-keys

Conversation

@rpenido

@rpenido rpenido commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

Description

camelCaseObject was rewriting the keys under aggregation terms, so a facet value such as open-edx became openEdx. transformAggregationsToFilterChoices sends those keys back as filter values, so any org or category slug that lodash changes never matched. This normalizes the response to camelCase while keeping aggs.*.terms keys verbatim.

#175 is merged, so this is the first PR on top of master. Review only the last commit.

Supporting information

Testing instructions

  1. Use the Node version in .nvmrc and install dependencies with npm ci.
  2. Start the app with npm run dev and open http://apps.local.openedx.io:1998/catalog/courses against an LMS with an org or category slug that camelCase would alter.
  3. Select that org or category in the filters and verify the results are filtered instead of disappearing.

Private ref: FAL-4374

@openedx-webhooks openedx-webhooks added the open-source-contribution PR author is not from Axim or 2U label Nov 10, 2026
@openedx-webhooks

openedx-webhooks commented Nov 10, 2026 •

Copy link
Copy Markdown

Thanks for the pull request, @rpenido!

This repository is currently maintained by @openedx/committers-frontend.

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 approval

If you haven't already, check this list to see if your contribution needs to go through the product review process.

  • If it does, you'll need to submit a product proposal for your contribution, and have it reviewed by the Product Working Group.
    • This process (including the steps you'll need to take) is documented here.
  • If it doesn't, simply proceed with the next step.
🔘 Provide context

To 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:

  • Dependencies

    This PR must be merged before / after / at the same time as ...

  • Blockers

    This PR is waiting for OEP-1234 to be accepted.

  • Timeline information

    This PR must be merged by XX date because ...

  • Partner information

    This is for a course on edx.org.

  • Supporting documentation
  • Relevant Open edX discussion forum threads
🔘 Get a green build

If one or more checks are failing, continue working on your changes until this is no longer the case and your build turns green.

Details
Where 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:

  • The size and impact of the changes that it introduces
  • The need for product review
  • Maintenance status of the parent repository

💡 As a result it may take up to several weeks or months to complete a review and merge your PR.

@codecov

codecov Bot commented Nov 10, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.57%. Comparing base (adb7edf) to head (a6a06c9).
⚠️ Report is 1 commits behind head on master.

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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@rpenido rpenido moved this to Upstream review in Learning Pathways Nov 10, 2026
@rpenido
rpenido force-pushed the rpenido/fal-4374/fix-facet-term-keys branch from cbc78bd to 45ab706 Compare November 10, 2026 23:05
@rpenido
rpenido force-pushed the rpenido/fal-4374/fix-facet-term-keys branch 2 times, most recently from 3275696 to ed9dae1 Compare November 10, 2026 23:31
@mphilbrick211 mphilbrick211 added the FC Relates to an Axim Funded Contribution project label Nov 16, 2026
@mphilbrick211 mphilbrick211 moved this from Needs Triage to Ready for Review in Contributions Nov 16, 2026
@rpenido
rpenido marked this pull request as draft November 16, 2026 18:57
@rpenido
rpenido marked this pull request as ready for review November 16, 2026 18:58
@rpenido
rpenido force-pushed the rpenido/fal-4374/fix-facet-term-keys branch from ed9dae1 to 99117c1 Compare November 16, 2026 21:27
@rpenido
rpenido force-pushed the rpenido/fal-4374/fix-facet-term-keys branch 4 times, most recently from 7595c2c to e5407d9 Compare November 24, 2026 21:52

@brian-smith-tcril brian-smith-tcril left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM!

I'll merge this once #175 lands!

@rpenido
rpenido force-pushed the rpenido/fal-4374/fix-facet-term-keys branch from e5407d9 to fdff8fa Compare December 1, 2026 17:35
brian-smith-tcril pushed a commit that referenced this pull request Dec 1, 2026
- 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.
@rpenido
rpenido force-pushed the rpenido/fal-4374/fix-facet-term-keys branch from fdff8fa to a6a06c9 Compare December 1, 2026 17:46
@brian-smith-tcril
brian-smith-tcril enabled auto-merge (squash) December 1, 2026 17:48
@brian-smith-tcril
brian-smith-tcril merged commit a734c56 into openedx:master Dec 1, 2026
4 checks passed
@github-project-automation github-project-automation Bot moved this from Ready for Review to Done in Contributions Dec 1, 2026
@github-project-automation github-project-automation Bot moved this from Upstream review to Done in Learning Pathways Dec 1, 2026
@openedx-semantic-release-bot

Copy link
Copy Markdown

🎉 This PR is included in version 1.0.0-alpha.7 🎉

The release is available on:

Your semantic-release bot 📦🚀

@rpenido
rpenido deleted the rpenido/fal-4374/fix-facet-term-keys branch December 1, 2026 18:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

FC Relates to an Axim Funded Contribution project open-source-contribution PR author is not from Axim or 2U released on @latest

Projects

Status: Done
Status: Done

Development

Successfully merging this pull request may close these issues.

5 participants