Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
5f92fb9
feat: add the course pathways strip above the course header
ChrisChV Oct 4, 2026
3a903df
fix: recalculate the visible pathways when the labels change width
ChrisChV Oct 4, 2026
8a0ecd3
style: Add plugin images
ChrisChV Oct 4, 2026
d80d6e6
fix: measure the pathway labels from the start edge in RTL
ChrisChV Oct 4, 2026
4f0f65b
style: Nits on the code
ChrisChV Oct 5, 2026
8fea1e6
feat: add the ENABLE_PATHWAY_PILOT_UI flag to show the course pathway…
ChrisChV Oct 5, 2026
cca472a
fix: Broken tests
ChrisChV Oct 5, 2026
45ffc32
fix: move the pathway labels that do not fit entirely to the "+N" pop…
ChrisChV Oct 7, 2026
e8f73ea
refactor: turn the pathways strip slot into a generic course info str…
ChrisChV Oct 16, 2026
585c008
refactor: rename the pathway course counts to item counts
ChrisChV Oct 16, 2026
b4369de
refactor: remove the ENABLE_PATHWAY_PILOT_UI flag
ChrisChV Oct 16, 2026
fc95bb5
refactor: move the course pathways code to src/pathways with the stri…
ChrisChV Oct 23, 2026
696901a
Merge remote-tracking branch 'origin/master' into chris/fal-4397-cour…
ChrisChV Oct 28, 2026
3201351
fix: Styles with the more popover
ChrisChV Nov 19, 2026
2fd9d73
feat: add the pathway pages with their tabs navigation and link the c…
ChrisChV Oct 28, 2026
bc679d0
feat: Update code with review feedback
ChrisChV Nov 17, 2026
fc6af58
feat: add the pathway achievements page with a card for each certific…
ChrisChV Oct 29, 2026
f0c62d7
feat: Update the code with review feedback
ChrisChV Nov 17, 2026
c941999
fix: Broken types
ChrisChV Nov 17, 2026
18dcdce
refactor: Make categoryLabel as required
ChrisChV Nov 24, 2026
62c4cce
refactor: use the Paragon Article icon in the certificate card
ChrisChV Nov 24, 2026
c3ad0c7
refactor: use the pathway tab slug constant in the achievements page
ChrisChV Dec 2, 2026
3c44f00
feat: add the pathway progress page with its completion, grades and a…
ChrisChV Oct 29, 2026
ed6d93d
feat: Update code with review feedback
ChrisChV Nov 17, 2026
02be9a2
refactor: use the pathway tab slug constant in the progress page
ChrisChV Dec 2, 2026
113f3b3
Merge branch 'master' into chris/fal-4397-course-pathway-strip
ChrisChV Dec 3, 2026
6d3e24e
refactor: import i18n from frontend-base in the pathways strip
ChrisChV Dec 3, 2026
216a935
test: adapt the pathways strip tests to the frontend-base test setup
ChrisChV Dec 3, 2026
c1143e8
refactor: migrate the course info strip slot to frontend-base
ChrisChV Dec 3, 2026
39e6890
fix: render the course info strip above the course tabs
ChrisChV Dec 3, 2026
cd6dbcf
fix: align the pathways strip with the header
ChrisChV Dec 3, 2026
40faaf6
Merge branch 'chris/fal-4397-course-pathway-strip' into chris/fal-439…
ChrisChV Dec 3, 2026
c201dd2
refactor: import i18n and site config from frontend-base in the pathw…
ChrisChV Dec 3, 2026
7f08df5
refactor: migrate the pathway tab links slot to frontend-base
ChrisChV Dec 3, 2026
6bf7559
refactor: route the pathway pages with frontend-base
ChrisChV Dec 3, 2026
ffcb4bc
feat: show the pathway in the header of the pathway pages
ChrisChV Dec 3, 2026
c737131
Merge branch 'chris/fal-4398-pathway-tabs' into chris/fal-4398-pathwa…
ChrisChV Dec 3, 2026
bc86f82
refactor: import i18n from frontend-base in the pathway achievements …
ChrisChV Dec 3, 2026
e3aa572
refactor: render the pathway achievements inside the achievements pag…
ChrisChV Dec 3, 2026
14c033d
feat: add the heading and the empty state to the pathway achievements…
ChrisChV Dec 3, 2026
36011a7
fix: use the achievements heading as the page's main heading
ChrisChV Dec 3, 2026
538b948
Merge branch 'chris/fal-4398-pathway-achievements-page' into chris/fa…
ChrisChV Dec 3, 2026
d616d50
refactor: import i18n from frontend-base in the pathway progress page
ChrisChV Dec 3, 2026
755bd8f
refactor: render the pathway progress inside the progress page frame
ChrisChV Dec 3, 2026
b62059b
fix: point the pathway grade details to the course progress under Lea…
ChrisChV Dec 3, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions src/app.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import {
} from '@openedx/frontend-base';

import { learningApp } from './index';
import { courseInfoStripApp } from './widgets/CourseInfoStrip';
import { coursewareSearchApp } from './widgets/CoursewareSearch';
import { coursewareTabApp } from './widgets/CoursewareTab';
import { datesTabApp } from './widgets/DatesTab';
Expand All @@ -24,6 +25,7 @@ import {
coursewareRole,
learningCourseRole,
learningRole,
pathwayRole,
} from './constants';

const [main] = learningApp.routes ?? [];
Expand All @@ -35,6 +37,7 @@ describe('learningApp', () => {
expect(learningApp.appId).toBe('org.openedx.frontend.app.learning');
expect(learningApp.slots).toEqual([
...(learningHeaderApp.slots ?? []),
...(courseInfoStripApp.slots ?? []),
...(coursewareSearchApp.slots ?? []),
...(discussionsSidebarApp.slots ?? []),
...(outlineTabApp.slots ?? []),
Expand Down Expand Up @@ -87,6 +90,7 @@ describe('learningApp', () => {
[':sequenceId/:unitId', [coursewareRole]],
]);
expect(nonCourse.map((route) => [route.path, route.handle?.roles])).toEqual([
['pathway/:pathwayId', [pathwayRole]],
['goal-unsubscribe/:token', undefined],
['redirect', undefined],
['preferences-unsubscribe/:userToken/:updatePatch?', undefined],
Expand Down Expand Up @@ -121,6 +125,10 @@ describe('role resolution', () => {
expect(url).not.toMatch(/:targetUserId/);
});

it('pathway resolves to the pathway, which prefix-matches every pathway tab', () => {
expect(getUrlByRouteRole(pathwayRole)).toBe('/learning/pathway/:pathwayId');
});

it('courseware resolves to the bare course path (an index route, hence the slash), not a sequence, unit or preview path', () => {
const url = getUrlByRouteRole(coursewareRole);
expect(url).toBe('/learning/course/:courseId/');
Expand Down
1 change: 1 addition & 0 deletions src/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ export const courseOutlineRole = 'org.openedx.frontend.role.courseOutline';
export const courseDatesRole = 'org.openedx.frontend.role.courseDates';
export const courseProgressRole = 'org.openedx.frontend.role.courseProgress';
export const coursewareRole = 'org.openedx.frontend.role.courseware';
export const pathwayRole = 'org.openedx.frontend.role.pathway';

export const dashboardRole = 'org.openedx.frontend.role.dashboard';
export const profileRole = 'org.openedx.frontend.role.profile';
Expand Down
1 change: 1 addition & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ export { default as ContentIFrame } from './courseware/course/sequence/Unit/Cont
export { getIFrameUrl } from './courseware/course/sequence/Unit/urls';
export { default as UnitNavigation } from './courseware/course/sequence/sequence-navigation/UnitNavigation';
export { CompletionIcon } from './courseware/course/sidebar/sidebars/course-outline/components/CompletionIcon';
export { PathwayTabLink } from './pathways/pathway-tabs/PathwayTabLink';

// Data a widget cannot get from its slot's props.
export { useExamsData } from './course-home/progress-tab/hooks';
48 changes: 48 additions & 0 deletions src/pages/PathwayAchievementsPage.test.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
import { screen } from '@testing-library/react';

import * as api from '@src/pathways/data/api';
import { dataEngineering, dataEngineeringAchievements } from '@src/pathways/data/__fixtures__/pathways';
import routes from '@src/routes';
import { renderRoutes } from '@src/tests/render';

const mockGetPathway = jest.spyOn(api, 'getPathway');
const mockGetPathwayAchievements = jest.spyOn(api, 'getPathwayAchievements');

const pathwayId = dataEngineering.pathway.id;
const path = `/learning/pathway/${pathwayId}/achievements`;

describe('PathwayAchievementsPage', () => {
beforeEach(() => {
mockGetPathway.mockResolvedValue(dataEngineering);
mockGetPathwayAchievements.mockResolvedValue(dataEngineeringAchievements);
});

it('shows a card for each achievement of the pathway in the URL', async () => {
renderRoutes(routes, path);

expect(await screen.findAllByRole('button', { name: 'View certificate' }))
.toHaveLength(dataEngineeringAchievements.length);
dataEngineeringAchievements.forEach(({ displayName }) => {
expect(screen.getByText(displayName)).toBeInTheDocument();
});
expect(screen.getByRole('link', { name: 'Achievements' })).toHaveClass('active');
expect(mockGetPathway).toHaveBeenCalledWith(pathwayId);
expect(mockGetPathwayAchievements).toHaveBeenCalledWith(pathwayId);
});

it('tells the learner they have no achievements yet when the pathway has none', async () => {
mockGetPathwayAchievements.mockResolvedValue([]);
renderRoutes(routes, path);

expect(await screen.findByText('No achievements earned yet.')).toBeInTheDocument();
expect(screen.queryByRole('button', { name: 'View certificate' })).not.toBeInTheDocument();
});

it('shows an error instead of the achievements when they cannot be loaded', async () => {
mockGetPathwayAchievements.mockRejectedValue(new Error('network error'));
renderRoutes(routes, path);

expect(await screen.findByText('There was an error loading this pathway.')).toBeInTheDocument();
expect(screen.queryByRole('button', { name: 'View certificate' })).not.toBeInTheDocument();
});
});
28 changes: 28 additions & 0 deletions src/pages/PathwayAchievementsPage.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import { useParams } from 'react-router-dom';

import { usePathway, usePathwayAchievements } from '@src/pathways/data/apiHooks';
import { PATHWAY_TAB_SLUGS } from '@src/pathways/pathway-tabs/constants';
import { PathwayAchievements } from '@src/pathways/pathways-achievements/PathwayAchievements';
import { TabPage } from '@src/pathways/tab-page/TabPage';

const PathwayAchievementsPage = () => {
const { pathwayId } = useParams();

const metadataQuery = usePathway(pathwayId);
const tabDataQuery = usePathwayAchievements(pathwayId);

return (
<TabPage
activeTabSlug={PATHWAY_TAB_SLUGS.ACHIEVEMENTS}
pathwayId={pathwayId}
pathwayStatus={{ metadataQuery, tabDataQuery }}
>
<PathwayAchievements
achievements={tabDataQuery.data ?? []}
categoryLabel={metadataQuery.data?.pathway.categoryLabel ?? ''}
/>
</TabPage>
);
};

export default PathwayAchievementsPage;
23 changes: 23 additions & 0 deletions src/pages/PathwayOutlinePage.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import { useParams } from 'react-router-dom';

import { usePathway } from '@src/pathways/data/apiHooks';
import { PATHWAY_TAB_SLUGS } from '@src/pathways/pathway-tabs/constants';
import { TabPage } from '@src/pathways/tab-page/TabPage';

const PathwayOutlinePage = () => {
const { pathwayId } = useParams();

const metadataQuery = usePathway(pathwayId);

return (
<TabPage
activeTabSlug={PATHWAY_TAB_SLUGS.OUTLINE}
pathwayId={pathwayId}
pathwayStatus={{ metadataQuery }}
>
Outline
</TabPage>
);
};

export default PathwayOutlinePage;
43 changes: 43 additions & 0 deletions src/pages/PathwayPages.test.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
import { render, screen } from '@testing-library/react';
import { MemoryRouter, Route, Routes } from 'react-router-dom';

import { usePathway } from '@src/pathways/data/apiHooks';
import { TabPage } from '@src/pathways/tab-page/TabPage';
import PathwayOutlinePage from './PathwayOutlinePage';

jest.mock('@src/pathways/data/apiHooks', () => ({
usePathway: jest.fn(),
}));

jest.mock('@src/pathways/tab-page/TabPage', () => ({
TabPage: jest.fn(({ children }) => <div>{children}</div>),
}));

const metadataQuery = { data: undefined };

// The pathway pages render their content inside the pathway TabPage
describe.each([
{ Page: PathwayOutlinePage, activeTabSlug: 'outline', content: 'Outline' },
])('$Page.name', ({ Page, activeTabSlug, content }) => {
beforeEach(() => {
jest.clearAllMocks();
(usePathway as jest.Mock).mockReturnValue(metadataQuery);
});

it('renders its tab of the pathway in the URL', () => {
render(
<MemoryRouter initialEntries={['/pathway/pathway-1']}>
<Routes>
<Route path="/pathway/:pathwayId" element={<Page />} />
</Routes>
</MemoryRouter>,
);

expect(usePathway).toHaveBeenCalledWith('pathway-1');
expect(TabPage).toHaveBeenCalledWith(
expect.objectContaining({ activeTabSlug, pathwayId: 'pathway-1', pathwayStatus: { metadataQuery } }),
expect.anything(),
);
expect(screen.getByText(content)).toBeInTheDocument();
});
});
53 changes: 53 additions & 0 deletions src/pages/PathwayProgressPage.test.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
import { screen } from '@testing-library/react';

import * as api from '@src/pathways/data/api';
import {
dataEngineering, dataEngineeringAchievements, dataEngineeringProgress,
} from '@src/pathways/data/__fixtures__/pathways';
import routes from '@src/routes';
import { renderRoutes } from '@src/tests/render';

const mockGetPathway = jest.spyOn(api, 'getPathway');
const mockGetPathwayAchievements = jest.spyOn(api, 'getPathwayAchievements');
const mockGetPathwayProgress = jest.spyOn(api, 'getPathwayProgress');

const pathwayId = dataEngineering.pathway.id;
const path = `/learning/pathway/${pathwayId}/progress`;

describe('PathwayProgressPage', () => {
beforeEach(() => {
mockGetPathway.mockResolvedValue(dataEngineering);
mockGetPathwayProgress.mockResolvedValue(dataEngineeringProgress);
mockGetPathwayAchievements.mockResolvedValue([]);
});

it('shows the completion, grades and achievements of the pathway in the URL', async () => {
renderRoutes(routes, path);

expect(await screen.findByRole('heading', { name: 'Bootcamp completion' })).toBeInTheDocument();
expect(screen.getByRole('img', { name: '3 of 6 items completed' })).toBeInTheDocument();
expect(screen.getByRole('row', { name: /Data Pipelines/ })).toBeInTheDocument();
expect(screen.getByText('No achievements earned')).toBeInTheDocument();
expect(screen.getByRole('link', { name: 'Progress' })).toHaveClass('active');

expect(mockGetPathway).toHaveBeenCalledWith(pathwayId);
expect(mockGetPathwayProgress).toHaveBeenCalledWith(pathwayId);
expect(mockGetPathwayAchievements).toHaveBeenCalledWith(pathwayId);
});

it('links to the achievements when the learner has earned some', async () => {
mockGetPathwayAchievements.mockResolvedValue(dataEngineeringAchievements);
renderRoutes(routes, path);

expect(await screen.findByRole('link', { name: 'View achievements' }))
.toHaveAttribute('href', `/learning/pathway/${pathwayId}/achievements`);
});

it('shows an error instead of the progress when it cannot be loaded', async () => {
mockGetPathwayProgress.mockRejectedValue(new Error('network error'));
renderRoutes(routes, path);

expect(await screen.findByText('There was an error loading this pathway.')).toBeInTheDocument();
expect(screen.queryByRole('heading', { name: 'Bootcamp completion' })).not.toBeInTheDocument();
});
});
33 changes: 33 additions & 0 deletions src/pages/PathwayProgressPage.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import { useParams } from 'react-router-dom';

import { usePathway, usePathwayAchievements, usePathwayProgress } from '@src/pathways/data/apiHooks';
import { PATHWAY_TAB_SLUGS } from '@src/pathways/pathway-tabs/constants';
import { PathwayProgress } from '@src/pathways/pathway-progress/PathwayProgress';
import { TabPage } from '@src/pathways/tab-page/TabPage';

const PathwayProgressPage = () => {
const { pathwayId } = useParams() as { pathwayId: string };

const metadataQuery = usePathway(pathwayId);
const progressQuery = usePathwayProgress(pathwayId);
const achievementsQuery = usePathwayAchievements(pathwayId);

return (
<TabPage
activeTabSlug={PATHWAY_TAB_SLUGS.PROGRESS}
pathwayId={pathwayId}
pathwayStatus={{ metadataQuery, tabDataQueries: [progressQuery, achievementsQuery] }}
>
<PathwayProgress
pathwayId={pathwayId}
categoryLabel={metadataQuery.data?.pathway.categoryLabel ?? ''}
itemCount={progressQuery.data?.itemCount ?? 0}
completedItemCount={progressQuery.data?.completedItemCount ?? 0}
grades={progressQuery.data?.grades ?? []}
hasAchievements={!!achievementsQuery.data?.length}
/>
</TabPage>
);
};

export default PathwayProgressPage;
Loading
Loading