Repository navigation
Conversation
Adds PathwayCard with a type badge that honors operator-supplied background and text colors, plus the HomePathwayCardSlot that offers it to consumers. The card and its style follow the frontend-base layout: imports come from @openedx/frontend-base, the pilot gate reads ENABLE_PATHWAY_PILOT_UI through getAppConfig, and the slot uses the Slot API under the org.openedx.frontend.slot.catalog.homePathwayCard.v1 id. isValidCssColor moves to src/utils, the only module both cards reach for. Co-Authored-By: Navin Karkera <navin@opencraft.com>
Co-Authored-By: Navin Karkera <navin@opencraft.com>
Generalize course-specific catalog naming for mixed course and pathway results. Render a Categories filter from the backend category aggregation, supporting courses and custom pathway types such as bootcamps and tutorials. CourseCatalogIntroSlot becomes ExploreIntroSlot under the org.openedx.frontend.slot.catalog.exploreIntro.v1 id, since the page is no longer courses-only. Its result count prop is now resultsCount; courseDataResultsLength is still passed so plugins written against the old name keep working. Extend the mock with dummy category terms for temporary UI testing. Co-Authored-By: Navin Karkera <navin@opencraft.com>
The catalog will list pathways alongside courses, so its cached search response is no longer course-specific. Rename useCourseData to useCatalogData and courseData/previousCourseData to catalogData/previousCatalogData. Co-Authored-By: Navin Karkera <navin@opencraft.com>
Split the search response envelope from its result list so the mixed catalog response can reuse it, and reuse CourseData instead of restating the course payload. Aggregation facets gain an optional labels map for the category facet the catalog will read from. Co-Authored-By: Navin Karkera <navin@opencraft.com>
Introduce a generic search response envelope and a discriminated mixed result type so the catalog can render courses and pathways from one ranked, paginated response. Rename useCourseListSearch to useCatalogListSearch and update consumers (CatalogPage, CoursesList, data-table card slot) to branch on result type and render pathway cards. Add ADR-0003 documenting the generic catalog search endpoint decision. Unlike the original branch, fetchData keeps carrying enableCourseSortingByStartDate forward, per the upstream fix for the sort setting resetting on refetch. Co-Authored-By: Navin Karkera <navin@opencraft.com>
Read category display labels from the facet's labels map instead of capitalizing the slug, and stop camelCasing the dynamic keys under aggregation terms and labels: those are backend slugs that go back to the API as filter values. Rename the pathway badge fields from type* to category*, matching the category metadata the search response will carry. Co-Authored-By: Navin Karkera <navin@opencraft.com>
The card view renders one card per result, so results are dispatched by type to either the course or pathway card slot. Cover the dispatch, and the new pathway card slot, with tests, and document both slots' props. Co-Authored-By: Navin Karkera <navin@opencraft.com>
|
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 #169 +/- ##
==========================================
+ Coverage 99.56% 99.59% +0.03%
==========================================
Files 101 105 +4
Lines 682 744 +62
Branches 168 188 +20
==========================================
+ Hits 679 741 +62
Misses 2 2
Partials 1 1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
28c6a10 to
b16d590
Compare
1d98a2c to
69db0aa
Compare
69db0aa to
f3a45e5
Compare
7496fa4 to
2130dda
Compare
2130dda to
3b8419e
Compare
| to={pathwayId ? `/pathways/${pathwayId}` : undefined} | ||
| // TODO: Temporary use of `d-flex` to fix alignment. Remove once the related Paragon issue | ||
| // (https://github.com/openedx/paragon/issues/3792) is resolved. | ||
| className={`pathway-card d-flex ${isExtraSmall ? 'w-100' : 'pathway-card-desktop'}`} |
There was a problem hiding this comment.
@rpenido From #169 (comment):
They are aligned to me, and I didn't find anything different in the code.
Can you check if it is still happening and give me more info on the applied styles?
Something interesting is happening here. In my local environment, specifically while working on the learner-dashboard, I’ve also defined a pathway-card class. The issue is that, in frontend-base, the CSS for all applications is global; as a result, these styles overlap. In this case, the dashboard’s styling has been applied here in catalog, effectively overwriting the intended styles.
We can fix this by making those styles more specific: dashboard-pathway-card and catalog-pathway-card.
There was a problem hiding this comment.
The classes were not declared here, so I removed them: d9c9f80
f32056c to
bdf9260
Compare
ChrisChV
left a comment
There was a problem hiding this comment.
Looks good 👍
- I tested this: I followed the testing instructions
- I read through the code and considered the security, stability and performance implications of the changes.
- I tested that the UI can be used with a keyboard only (tab order, keyboard controls).
- Includes tests for bugfixes and/or features added.
- Includes documentation
|
@kdmccormick and @ormsbee, this is ready for review! |
kdmccormick
left a comment
There was a problem hiding this comment.
@rpenido It's exciting to see so much progress at once, but this PR is very large and will be hard to review as it is. Could you break it into more manageable pieces? For example, #148 was a manageable size. If you rebased that, we be happy to review it now.
I'd also advocate for the removal of the ENABLE_PATHWAY_PILOT_UI flag unless it's absolutely necessary. I know the backend APIs aren't in place, but it would be fine for the app to attempt hit the Pathways APIs and gracefully degrade to "no pathways" if the APIs return 404.
|
Thanks for the input, @kdmccormick!
Sure! One thing that is adding a lot for the diff here is that we did some renames
The main point of the flag now is to render dummy data so we can test, validate the design, and do demos in the sync meeting using the sandbox. The alternative for that would be maintaining branches with the mock data so we can have a demo sandbox (and keeping it in sync would require an increasing effort as we progress). If you think we can postpone the demos for when we have the backend ready (or have a better idea on how we can do it), we can remove them without issues. Meanwhile, I'll check if @cassiezamparini already did a review pass in the designs. |
|
@rpenido I've looked at the designs, they're looking good. There are some cosmetic changes I'd like to make to better the overall feel, so it's closer to the proposed UI. But for now you have bigger fish to fry! |
|
thank you @rpenido !! this is super helpful. |
Description
This pull request compiles the pathway work from #148 and #149 into a single change that prepares the catalog (Explore) page for mixed course/pathway results and adds pathway cards, badges, and a Categories filter.
Supporting information
docs/decisions/0003-use-a-generic-catalog-search-endpoint.rst, which documents the backend contract for the planned generic catalog search endpoint. The frontend continues to call the existingcourse_list_searchendpoint; this PR only generalizes request/response handling and naming.Testing instructions
.nvmrcand install dependencies withnpm ci.ENABLE_PATHWAY_PILOT_UI: trueinsite.config.dev.tsx(it defaults tofalse). While the flag is on, the catalog search client serves the bundled mock mixed catalog, so no backend search call is made.npm run devand open http://apps.local.openedx.io:1998/catalog. A running Open edX (Tutor dev) instance is still needed for login and other APIs, but the catalog search itself is served from the mock.Bootcamp,Tutorial), that course cards show theCoursebadge, and that theCategoriesfilter lists the category terms. The filter renders whenENABLE_COURSE_DISCOVERYis true, whichsite.config.dev.tsxsets.ENABLE_PATHWAY_PILOT_UIback tofalse(or remove it), restart, and verify that course cards no longer show theCoursebadge and the mock mixed data is not used. Conflicts between the flag and the Categories filter are expected: the filter depends on the response aggregation, not on the flag.Other information
ENABLE_PATHWAY_PILOT_UIdefaults tofalsebecause the backend pathways API is still pending. Today the flag gates the course card badge and switches the catalog search to the bundled mock; pathway cards render whenever the response contains a result withtype: 'pathway'.fetchCatalogListSearchis development/testing only and is excluded from coverage.categoryaggregation whose terms are usable as filter options, with an optionallabelsmap; courses always carry the reservedcoursecategory and participate in that aggregation; other category slugs (for example bootcamps and tutorials) are arbitrary registered slugs, not hardcoded in the frontend; the existing generic filter request mechanism is reused; and pathway results include the fields the cards render (display name, org, item count, optional image, start date, and category).AI disclosure: Use GPT 5.6 Sol to help with development as well as drafting detailed pull request description.
Private refs: