Repository navigation
Conversation
Show, above the learning header, the pathways that include the current course and in which the learner is enrolled. The labels that do not fit are moved to a "+N" popover, following the same logic as the course card strip in the learner dashboard. - Add the `course-pathways` data layer: `getPathwaysByCourse` in the API layer, which returns an empty map until the backend exists, and the `useCoursePathways` hook, which extracts the course pathways from it. - Add the `CoursePathwaysStrip` and `MorePathwaysPopover` components and the `useVisiblePathways` hook to split the visible and hidden pathways. - Add the `org.openedx.frontend.learning.course_pathways_strip.v1` plugin slot, rendered by `TabPage` once the course page has loaded. - Add mock pathways as test fixtures.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
…s strip and request its pathways
…over and align it to the end of the strip Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ip slot below the course header
…p in its own pathways-strip folder
…ourse pathways strip to them
|
Thanks for the pull request, @ChrisChV! 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 #2231 +/- ##
==========================================
+ Coverage 96.16% 96.28% +0.12%
==========================================
Files 368 389 +21
Lines 6019 6215 +196
Branches 1486 1513 +27
==========================================
+ Hits 5788 5984 +196
Misses 222 222
Partials 9 9 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
@ChrisChV @cassiezamparini Since this PR is part of Pathways, can we consider it approved from a product perspective? |
@itsjeyd It's in internal dev review |
| <Route | ||
| path={DECODE_ROUTES.PATHWAY_OUTLINE} | ||
| element={( | ||
| <PathwayOutline /> |
There was a problem hiding this comment.
Every other route in this file ends up inside PageWrap, directly or through DecodePageRoute, and PageWrap is the only place in this app that calls sendPageEvent() when the pathname changes. These three routes render their page elements directly, so opening a pathway page, or switching between its tabs, produces no analytics.
| <PathwayOutline /> | |
| <DecodePageRoute> | |
| <PathwayOutline /> | |
| </DecodePageRoute> |
| <Route | ||
| path={DECODE_ROUTES.PATHWAY_PROGRESS} | ||
| element={( | ||
| <PathwayProgress /> |
There was a problem hiding this comment.
| <PathwayProgress /> | |
| <DecodePageRoute> | |
| <PathwayProgress /> | |
| </DecodePageRoute> |
| <Route | ||
| path={DECODE_ROUTES.PATHWAY_ACHIEVEMENTS} | ||
| element={( | ||
| <PathwayAchievements /> |
There was a problem hiding this comment.
| <PathwayAchievements /> | |
| <DecodePageRoute> | |
| <PathwayAchievements /> | |
| </DecodePageRoute> |
| <Link | ||
| to={url} | ||
| className={classNames('nav-item flex-shrink-0 nav-link', { active: slug === activeTabSlug })} | ||
| > | ||
| {title} | ||
| </Link> |
There was a problem hiding this comment.
| <Link | |
| to={url} | |
| className={classNames('nav-item flex-shrink-0 nav-link', { active: slug === activeTabSlug })} | |
| > | |
| {title} | |
| </Link> | |
| <Link | |
| to={url} | |
| aria-current={slug === activeTabSlug ? 'page' : undefined} | |
| className={classNames('nav-item flex-shrink-0 nav-link', { active: slug === activeTabSlug })} | |
| > | |
| {title} | |
| </Link> |
| ); | ||
|
|
||
| export interface TabView { | ||
| isLoading: boolean; |
There was a problem hiding this comment.
Do you think we can change this to make it consistent with Tanstack?
| isLoading: boolean; | |
| isPending: boolean; |
| { tabId: 'outline', route: DECODE_ROUTES.PATHWAY_OUTLINE, message: messages.home }, | ||
| { tabId: 'progress', route: DECODE_ROUTES.PATHWAY_PROGRESS, message: messages.progress }, | ||
| { tabId: 'achievements', route: DECODE_ROUTES.PATHWAY_ACHIEVEMENTS, message: messages.achievements }, | ||
| ]; |
There was a problem hiding this comment.
What do you think about a PATHWAY_TAB_SLUGS (here or in a new pathway-tabs/constants.ts file)?
Then we can remove the hardcoded string in the components (i.e. activeTabSlug="outline" in PathwayOutline.tsx) and we can rename them in one place.
I added a suggestion in another comment: https://github.com/openedx/frontend-app-learning/pull/2231/changes#r4587858520
|
|
||
| const PATHWAY_TABS = [ | ||
| // TODO: The Outline Tab title must be the category label | ||
| { tabId: 'outline', route: DECODE_ROUTES.PATHWAY_OUTLINE, message: messages.home }, | ||
| { tabId: 'progress', route: DECODE_ROUTES.PATHWAY_PROGRESS, message: messages.progress }, | ||
| { tabId: 'achievements', route: DECODE_ROUTES.PATHWAY_ACHIEVEMENTS, message: messages.achievements }, | ||
| ]; |
There was a problem hiding this comment.
| const PATHWAY_TABS = [ | |
| // TODO: The Outline Tab title must be the category label | |
| { tabId: 'outline', route: DECODE_ROUTES.PATHWAY_OUTLINE, message: messages.home }, | |
| { tabId: 'progress', route: DECODE_ROUTES.PATHWAY_PROGRESS, message: messages.progress }, | |
| { tabId: 'achievements', route: DECODE_ROUTES.PATHWAY_ACHIEVEMENTS, message: messages.achievements }, | |
| ]; | |
| export const PATHWAY_TAB_SLUGS = { | |
| OUTLINE: 'outline', | |
| PROGRESS: 'progress', | |
| ACHIEVEMENTS: 'achievements', | |
| } as const; | |
| const PATHWAY_TABS = [ | |
| // TODO: The Outline Tab title must be the category label | |
| { tabId: PATHWAY_TAB_SLUGS.OUTLINE, route: DECODE_ROUTES.PATHWAY_OUTLINE, message: messages.home }, | |
| { tabId: PATHWAY_TAB_SLUGS.PROGRESS, route: DECODE_ROUTES.PATHWAY_PROGRESS, message: messages.progress }, | |
| { tabId: PATHWAY_TAB_SLUGS.ACHIEVEMENTS, route: DECODE_ROUTES.PATHWAY_ACHIEVEMENTS, message: messages.achievements }, | |
| ]; |
| @@ -0,0 +1,54 @@ | |||
| # Pathway Tab Links Slot | |||
|
|
|||
| ### Slot ID: `org.openedx.frontend.learning.pathway_tab_links.v1` | |||
There was a problem hiding this comment.
We are missing the screenshots for this slot.
Description
Review only the changes of this PR: open-craft/frontend-app-learning@chris/fal-4397-course-pathway-strip...chris/fal-4398-pathway-tabs
It adds the pathway pages and the navigation between them. The content of the Progress and Achievements tabs comes in the next PRs.
deriveViewand the tab status type out of the courseTabPageintosrc/tab-page/utils.ts, and makes them generic/pathway/:pathwayId/outline,/pathway/:pathwayId/progressand/pathway/:pathwayId/achievements.TabPage: header with the pathway title and provider, loading and error states, the tabs navigation and the footer.org.openedx.frontend.learning.pathway_tab_links.v1plugin slotSupporting Information
Testing instructions
Notes
Stack