+ );
+};
diff --git a/src/pathways/pathway-outline/course-outline/CourseSubsection.tsx b/src/pathways/pathway-outline/course-outline/CourseSubsection.tsx
new file mode 100644
index 0000000000..8d3ac8a804
--- /dev/null
+++ b/src/pathways/pathway-outline/course-outline/CourseSubsection.tsx
@@ -0,0 +1,37 @@
+import classNames from 'classnames';
+import { Link } from 'react-router-dom';
+import { useIntl } from '@openedx/frontend-base';
+import { Stack } from '@openedx/paragon';
+
+import { getSequenceUrl } from '@src/courseware/urls';
+import type { CourseSubsectionData } from '@src/pathways/data/types';
+
+import { CompletionIcon } from './CompletionIcon';
+import messages from './messages';
+
+export interface CourseSubsectionProps {
+ courseId: string;
+ subsection: CourseSubsectionData;
+ showSeparator?: boolean;
+}
+
+export const CourseSubsection = ({ courseId, subsection, showSeparator = false }: CourseSubsectionProps) => {
+ const intl = useIntl();
+
+ return (
+
+
+
+ {subsection.displayName}
+
+ {`, ${intl.formatMessage(subsection.complete ? messages.completedSubsection : messages.incompleteSubsection)}`}
+
+
+
+ );
+};
diff --git a/src/pathways/pathway-outline/course-outline/messages.ts b/src/pathways/pathway-outline/course-outline/messages.ts
new file mode 100644
index 0000000000..2de8027c68
--- /dev/null
+++ b/src/pathways/pathway-outline/course-outline/messages.ts
@@ -0,0 +1,36 @@
+import { defineMessages } from '@openedx/frontend-base';
+
+const messages = defineMessages({
+ loading: {
+ id: 'learning.pathways.outline.course-outline.loading',
+ defaultMessage: 'Loading course outline…',
+ description: 'Screen reader text while the sections of a course of the pathway are loading',
+ },
+ failure: {
+ id: 'learning.pathways.outline.course-outline.failure',
+ defaultMessage: 'There was an error loading the outline of this course.',
+ description: 'Shown when the sections of a course of the pathway fail to load',
+ },
+ completedSection: {
+ id: 'learning.pathways.outline.course-outline.section.completed',
+ defaultMessage: 'Completed section',
+ description: 'Screen reader text for a section of the course the learner has completed',
+ },
+ incompleteSection: {
+ id: 'learning.pathways.outline.course-outline.section.incomplete',
+ defaultMessage: 'Incomplete section',
+ description: 'Screen reader text for a section of the course the learner has not completed',
+ },
+ completedSubsection: {
+ id: 'learning.pathways.outline.course-outline.subsection.completed',
+ defaultMessage: 'Completed',
+ description: 'Screen reader text for a subsection of the course the learner has completed',
+ },
+ incompleteSubsection: {
+ id: 'learning.pathways.outline.course-outline.subsection.incomplete',
+ defaultMessage: 'Incomplete',
+ description: 'Screen reader text for a subsection of the course the learner has not completed',
+ },
+});
+
+export default messages;
diff --git a/src/pathways/pathway-outline/messages.ts b/src/pathways/pathway-outline/messages.ts
new file mode 100644
index 0000000000..a0c9058e63
--- /dev/null
+++ b/src/pathways/pathway-outline/messages.ts
@@ -0,0 +1,106 @@
+import { defineMessages } from '@openedx/frontend-base';
+import { PathwayItemType } from '@src/pathways/data/types';
+
+export const messages = defineMessages({
+ itemEnds: {
+ id: 'learning.pathways.outline.item.ends',
+ defaultMessage: 'Ends {date}',
+ description: 'Label that show when the item ends',
+ },
+ certificateAvailable: {
+ id: 'learning.pathways.outline.item.certificate-available',
+ defaultMessage: 'Certificate available',
+ description: 'Label that show if a certificate is available for the item',
+ },
+ // TODO: When the pathway includes items other than just the course, this message will need to be changed.
+ // For now, I’m leaving it as is for convenience.
+ completeMessage: {
+ id: 'learning.pathways.outline.complete-message',
+ defaultMessage: 'Complete {count, plural, one {this course} other {these # courses}} in any order',
+ description: 'Instruction to complete the courses of the pathway in any order',
+ },
+ overviewTitle: {
+ id: 'learning.pathways.outline.overview.title',
+ defaultMessage: '{categoryLabel} overview',
+ description: 'Title of the card that shows how many items of the pathway the learner has completed',
+ },
+ // TODO: Same as `completeMessage`, it must change when the pathway includes items other than courses.
+ overviewCompletedCount: {
+ id: 'learning.pathways.outline.overview.completed-count',
+ defaultMessage: '{completed} of {total, plural, one {# course} other {# courses}}',
+ description: 'How many courses of the pathway the learner has completed, below the progress donut',
+ },
+ overviewDetailsLink: {
+ id: 'learning.pathways.outline.overview.details-link',
+ defaultMessage: 'About this {categoryLabel}',
+ description: 'Link below the overview card to the catalog page that describes the pathway',
+ },
+ showItemOutline: {
+ id: 'learning.pathways.outline.item.show-outline',
+ defaultMessage: 'Show outline',
+ description: 'Accessible label of the button that shows the sections of an item of the pathway',
+ },
+ hideItemOutline: {
+ id: 'learning.pathways.outline.item.hide-outline',
+ defaultMessage: 'Hide outline',
+ description: 'Accessible label of the button that hides the sections of an item of the pathway',
+ },
+ resumeAlertTitle: {
+ id: 'learning.pathways.outline.resume.alert.title',
+ defaultMessage: 'Pick up where you left off',
+ description: 'Title of the alert that invites the learner to continue the pathway where they left off',
+ },
+ resumeAlertBtn: {
+ id: 'learning.pathways.outline.resume.alert.btn',
+ defaultMessage: 'Resume {category}',
+ description: 'Label of the button that takes the learner to where they left off in the pathway. {category} is the pathway category, e.g. Bootcamp',
+ },
+ achievementsAlertTitle: {
+ id: 'learning.pathways.outline.achievements.alert.title',
+ defaultMessage: 'Congratulations! You have achievements available.',
+ description: 'Title of the alert that tells the learner they have earned achievements in the pathway',
+ },
+ achievementsAlertBtn: {
+ id: 'learning.pathways.outline.achievements.alert.btn',
+ defaultMessage: 'View achievements',
+ description: 'Label of the button that takes the learner to the pathway achievements page',
+ },
+ 'itemStatusLabel-in-progress': {
+ id: 'learning.pathways.outline.item.in-progress',
+ defaultMessage: 'In progress',
+ description: 'Label for the in progress status of an item',
+ },
+ 'itemStatusLabel-not-passed': {
+ id: 'learning.pathways.outline.item.not-passed',
+ defaultMessage: 'Not passed',
+ description: 'Label for the not passed status of an item',
+ },
+ 'itemStatusLabel-passed': {
+ id: 'learning.pathways.outline.item.passed',
+ defaultMessage: 'Passed',
+ description: 'Label for the passed status of an item',
+ },
+});
+
+const courseItemMessages = defineMessages({
+ itemLabel: {
+ id: 'learning.pathways.outline.item.course',
+ defaultMessage: 'Course',
+ description: 'Label for a course item in pathways',
+ },
+ beginBtn: {
+ id: 'learning.pathways.outline.item.begin.btn',
+ defaultMessage: 'Begin course',
+ description: 'Label of the button to start the given course.',
+ },
+});
+
+export const getItemMessage = (type: PathwayItemType) => {
+ if (type === 'course') {
+ return courseItemMessages;
+ }
+ return {
+ itemLabel: {},
+ beginBtn: {},
+ };
+};
diff --git a/src/pathways/pathway-progress/AchievementsInfo.test.tsx b/src/pathways/pathway-progress/AchievementsInfo.test.tsx
new file mode 100644
index 0000000000..24a49c10ac
--- /dev/null
+++ b/src/pathways/pathway-progress/AchievementsInfo.test.tsx
@@ -0,0 +1,34 @@
+import { render, screen } from '@testing-library/react';
+import { MemoryRouter } from 'react-router-dom';
+import { IntlProvider } from '@openedx/frontend-base';
+
+import { AchievementsInfo } from './AchievementsInfo';
+
+const renderComponent = (hasAchievements: boolean) => render(
+
+
+
+
+ ,
+);
+
+describe('AchievementsInfo', () => {
+ it('links to the pathway achievements when the learner has some', () => {
+ renderComponent(true);
+
+ expect(screen.getByText('Achievements available')).toBeInTheDocument();
+ expect(screen.getByText(
+ "Showcase your certificates on LinkedIn, or your resume today. Access your Bootcamp's achievements below.",
+ )).toBeInTheDocument();
+ expect(screen.getByRole('link', { name: 'View achievements' }))
+ .toHaveAttribute('href', '/learning/pathway/pathway-1/achievements');
+ });
+
+ it('tells the learner there are no achievements yet, without a link', () => {
+ renderComponent(false);
+
+ expect(screen.getByText('No achievements earned')).toBeInTheDocument();
+ expect(screen.getByText('No certificates earned yet.')).toBeInTheDocument();
+ expect(screen.queryByRole('link')).not.toBeInTheDocument();
+ });
+});
diff --git a/src/pathways/pathway-progress/AchievementsInfo.tsx b/src/pathways/pathway-progress/AchievementsInfo.tsx
new file mode 100644
index 0000000000..345acb11e8
--- /dev/null
+++ b/src/pathways/pathway-progress/AchievementsInfo.tsx
@@ -0,0 +1,42 @@
+import { Link } from 'react-router-dom';
+
+import { FormattedMessage } from '@openedx/frontend-base';
+import { Button } from '@openedx/paragon';
+
+import { PATHWAY_TAB_SLUGS } from '../pathway-tabs/constants';
+import { getPathwayTabUrl } from '../urls';
+import messages from './messages';
+
+export interface AchievementsInfoProps {
+ pathwayId: string;
+ categoryLabel: string;
+ hasAchievements: boolean;
+}
+
+export const AchievementsInfo = ({ pathwayId, categoryLabel, hasAchievements }: AchievementsInfoProps) => {
+ const title = hasAchievements ? messages.achievementsInfoTitle : messages.achievementsInfoEmptyTitle;
+ const description = hasAchievements
+ ? messages.achievementsInfoDescription
+ : messages.achievementsInfoEmptyDescription;
+
+ return (
+
+
+
+
+
+
+
+ {hasAchievements && (
+
+ )}
+
+ );
+};
diff --git a/src/pathways/pathway-progress/PathwayGrades.test.tsx b/src/pathways/pathway-progress/PathwayGrades.test.tsx
new file mode 100644
index 0000000000..212c41de9c
--- /dev/null
+++ b/src/pathways/pathway-progress/PathwayGrades.test.tsx
@@ -0,0 +1,67 @@
+import { render, screen, within } from '@testing-library/react';
+import { MemoryRouter } from 'react-router-dom';
+import { IntlProvider } from '@openedx/frontend-base';
+
+import { dataEngineeringProgress } from '@src/pathways/data/__fixtures__/pathways';
+
+import { PathwayGrades } from './PathwayGrades';
+
+const { grades } = dataEngineeringProgress;
+
+const renderComponent = () => render(
+
+
+
+
+ ,
+);
+
+const getRow = (displayName: string) => screen.getByRole('row', { name: new RegExp(displayName) });
+
+describe('PathwayGrades', () => {
+ it('shows a row with the progress and grades of each course as percentages', () => {
+ renderComponent();
+
+ // The header row plus one row per grade.
+ expect(screen.getAllByRole('row')).toHaveLength(grades.length + 1);
+
+ const row = within(getRow('Data Pipelines'));
+ expect(row.getByText('40%')).toBeInTheDocument();
+ expect(row.getByText('70%')).toBeInTheDocument();
+ expect(row.getByText('30%')).toBeInTheDocument();
+ });
+
+ it('colors the current grade by whether it reaches the pass grade', () => {
+ renderComponent();
+
+ // 85% with a 70% pass grade
+ expect(within(getRow('Introduction to Data Engineering')).getByText('85%')).toHaveClass('text-success');
+ // 30% with a 70% pass grade
+ expect(within(getRow('Data Pipelines')).getByText('30%')).toHaveClass('text-danger');
+ });
+
+ it('shows no current grade for a course without progress', () => {
+ renderComponent();
+
+ const row = within(getRow('Stream Processing'));
+ expect(row.getByText('-')).toBeInTheDocument();
+ expect(row.queryByText('0%', { selector: '.text-danger' })).not.toBeInTheDocument();
+ });
+
+ it('names the column of the details links for assistive technologies only', () => {
+ renderComponent();
+
+ const header = screen.getByRole('columnheader', { name: 'Actions' });
+ expect(within(header).getByText('Actions')).toHaveClass('sr-only');
+ });
+
+ it('links each course to its grade details', () => {
+ renderComponent();
+
+ grades.forEach(({ displayName, detailsUrl }) => {
+ const link = within(getRow(displayName)).getByRole('link', { name: `View details for ${displayName}` });
+ expect(link).toHaveAttribute('href', detailsUrl);
+ expect(link).toHaveTextContent('View details');
+ });
+ });
+});
diff --git a/src/pathways/pathway-progress/PathwayGrades.tsx b/src/pathways/pathway-progress/PathwayGrades.tsx
new file mode 100644
index 0000000000..375cc99cbc
--- /dev/null
+++ b/src/pathways/pathway-progress/PathwayGrades.tsx
@@ -0,0 +1,88 @@
+import { FormattedMessage, useIntl } from '@openedx/frontend-base';
+import { DataTable } from '@openedx/paragon';
+
+import type { GradeData } from '@src/pathways/data/types';
+
+import { Link } from 'react-router-dom';
+import messages from './messages';
+import { PathwayProgressRing } from '../progress-ring/PathwayProgressRing';
+
+// The cells are defined outside of `PathwayGrades` so React does not remount them on every render.
+const PercentCell = ({ value }: { value: number }) => {
+ const intl = useIntl();
+ return <>{intl.formatNumber(value / 100, { style: 'percent' })}>;
+};
+
+const ProgressCell = ({ value }: { value: number }) => (
+
+
+
+
+);
+
+// Green when the course is passed, red otherwise
+const CurrentGradeCell = ({ value, row }: { value: number; row: { original: GradeData } }) => {
+ if (row.original.progress === 0) {
+ return <>->;
+ }
+
+ return (
+ = row.original.passGrade ? 'text-success' : 'text-danger'}>
+
+
+ );
+};
+
+// Every row shows the same link text, so the accessible name includes the course to tell them apart.
+const DetailsCell = ({ row }: { row: { original: GradeData } }) => {
+ const intl = useIntl();
+ return (
+
+
+
+ );
+};
+
+export const PathwayGrades = ({ grades }: { grades: GradeData[] }) => {
+ const intl = useIntl();
+
+ return (
+ {intl.formatMessage(messages.gradesActionsColumn)},
+ Cell: DetailsCell,
+ },
+ ]}
+ >
+
+
+ );
+};
diff --git a/src/pathways/pathway-progress/PathwayProgress.test.tsx b/src/pathways/pathway-progress/PathwayProgress.test.tsx
new file mode 100644
index 0000000000..8663282259
--- /dev/null
+++ b/src/pathways/pathway-progress/PathwayProgress.test.tsx
@@ -0,0 +1,48 @@
+import { IntlProvider } from '@openedx/frontend-base';
+import { render, screen } from '@testing-library/react';
+
+import { dataEngineeringProgress } from '../data/__fixtures__/pathways';
+import { AchievementsInfo } from './AchievementsInfo';
+import { PathwayCompletion } from './pathway-completion/PathwayCompletion';
+import { PathwayGrades } from './PathwayGrades';
+import { PathwayProgress } from './PathwayProgress';
+
+jest.mock('./AchievementsInfo', () => ({ AchievementsInfo: jest.fn(() => null) }));
+jest.mock('./pathway-completion/PathwayCompletion', () => ({ PathwayCompletion: jest.fn(() => null) }));
+jest.mock('./PathwayGrades', () => ({ PathwayGrades: jest.fn(() => null) }));
+
+const props = {
+ pathwayId: 'pathway-1',
+ categoryLabel: 'Bootcamp',
+ itemCount: dataEngineeringProgress.itemCount,
+ completedItemCount: dataEngineeringProgress.completedItemCount,
+ grades: dataEngineeringProgress.grades,
+ hasAchievements: true,
+};
+
+describe('PathwayProgress', () => {
+ beforeEach(() => {
+ jest.clearAllMocks();
+ });
+
+ it('shows the progress heading as the main one, and the grades heading beneath it', () => {
+ render();
+
+ expect(screen.getByRole('heading', { level: 1 })).toBeInTheDocument();
+ expect(screen.getByRole('heading', { level: 2 })).toHaveClass('h1');
+ });
+
+ it('hands the completion, the grades and the achievements their part of the progress', () => {
+ render();
+
+ expect(PathwayCompletion).toHaveBeenCalledWith(
+ { categoryLabel: 'Bootcamp', total: props.itemCount, completed: props.completedItemCount },
+ expect.anything(),
+ );
+ expect(PathwayGrades).toHaveBeenCalledWith({ grades: props.grades }, expect.anything());
+ expect(AchievementsInfo).toHaveBeenCalledWith(
+ { pathwayId: 'pathway-1', categoryLabel: 'Bootcamp', hasAchievements: true },
+ expect.anything(),
+ );
+ });
+});
diff --git a/src/pathways/pathway-progress/PathwayProgress.tsx b/src/pathways/pathway-progress/PathwayProgress.tsx
new file mode 100644
index 0000000000..3f0b831a06
--- /dev/null
+++ b/src/pathways/pathway-progress/PathwayProgress.tsx
@@ -0,0 +1,55 @@
+import { FormattedMessage } from '@openedx/frontend-base';
+import { Col, Row, Stack } from '@openedx/paragon';
+
+import type { GradeData } from '../data/types';
+import messages from './messages';
+import { AchievementsInfo } from './AchievementsInfo';
+import { PathwayCompletion } from './pathway-completion/PathwayCompletion';
+import { PathwayGrades } from './PathwayGrades';
+
+export interface PathwayProgressProps {
+ pathwayId: string;
+ categoryLabel: string;
+ itemCount: number;
+ completedItemCount: number;
+ grades: GradeData[];
+ hasAchievements: boolean;
+}
+
+export const PathwayProgress = ({
+ pathwayId,
+ categoryLabel,
+ itemCount,
+ completedItemCount,
+ grades,
+ hasAchievements,
+}: PathwayProgressProps) => (
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+);
diff --git a/src/pathways/pathway-progress/messages.ts b/src/pathways/pathway-progress/messages.ts
new file mode 100644
index 0000000000..e8086c93f0
--- /dev/null
+++ b/src/pathways/pathway-progress/messages.ts
@@ -0,0 +1,76 @@
+import { defineMessages } from '@openedx/frontend-base';
+
+const messages = defineMessages({
+ progressTitle: {
+ id: 'learning.pathways.progress.title',
+ defaultMessage: 'Your Progress',
+ description: 'Title of the progress section in the progress page',
+ },
+ gradesTitle: {
+ id: 'learning.pathways.progress.grades.title',
+ defaultMessage: 'Grades',
+ description: 'Title of the grades section in the progress page',
+ },
+ gradesCourseColumn: {
+ id: 'learning.pathways.progress.grades.table.course',
+ defaultMessage: 'Course',
+ description: 'Label for the Course column in the grades table',
+ },
+ gradesProgressColumn: {
+ id: 'learning.pathways.progress.grades.table.progress',
+ defaultMessage: 'Progress',
+ description: 'Label for the Progress column in the grades table',
+ },
+ gradesPassGradeColumn: {
+ id: 'learning.pathways.progress.grades.table.pass-grade',
+ defaultMessage: 'Pass Grade',
+ description: 'Label for the Pass Grade column in the grades table',
+ },
+ gradesCurrentGradeColumn: {
+ id: 'learning.pathways.progress.grades.table.current-grade',
+ defaultMessage: 'Current Grade',
+ description: 'Label for the Current Grade column in the grades table',
+ },
+ gradesActionsColumn: {
+ id: 'learning.pathways.progress.grades.table.actions',
+ defaultMessage: 'Actions',
+ description: 'Accessible label for the column of the grades table with the View details links. It is not shown on screen',
+ },
+ gradesViewDetails: {
+ id: 'learning.pathways.progress.grades.table.view-details',
+ defaultMessage: 'View details',
+ description: 'Label for the View details links in the grades table',
+ },
+ gradesViewDetailsFor: {
+ id: 'learning.pathways.progress.grades.table.view-details-for',
+ defaultMessage: 'View details for {courseName}',
+ description: 'Accessible label for the View details links in the grades table',
+ },
+ achievementsInfoEmptyTitle: {
+ id: 'learning.pathways.progress.achievements-info.empty.title',
+ defaultMessage: 'No achievements earned',
+ description: 'Title of the empty state of the achievements info card',
+ },
+ achievementsInfoEmptyDescription: {
+ id: 'learning.pathways.progress.achievements-info.empty.description',
+ defaultMessage: 'No certificates earned yet.',
+ description: 'Description of the empty state of the achievements info card',
+ },
+ achievementsInfoTitle: {
+ id: 'learning.pathways.progress.achievements-info.title',
+ defaultMessage: 'Achievements available',
+ description: 'Title of the achievements info card',
+ },
+ achievementsInfoDescription: {
+ id: 'learning.pathways.progress.achievements-info.description',
+ defaultMessage: "Showcase your certificates on LinkedIn, or your resume today. Access your {categoryLabel}'s achievements below.",
+ description: 'Description of the achievements info card',
+ },
+ achievementsInfoButton: {
+ id: 'learning.pathways.progress.achievements-info.button',
+ defaultMessage: 'View achievements',
+ description: 'Label of the button of the achievements info card',
+ },
+});
+
+export default messages;
diff --git a/src/pathways/pathway-progress/pathway-completion/PathwayCompletion.test.tsx b/src/pathways/pathway-progress/pathway-completion/PathwayCompletion.test.tsx
new file mode 100644
index 0000000000..70c6430964
--- /dev/null
+++ b/src/pathways/pathway-progress/pathway-completion/PathwayCompletion.test.tsx
@@ -0,0 +1,21 @@
+import { render, screen } from '@testing-library/react';
+import { IntlProvider } from '@openedx/frontend-base';
+
+import { PathwayCompletion } from './PathwayCompletion';
+
+const renderComponent = () => render(
+
+
+ ,
+);
+
+describe('PathwayCompletion', () => {
+ it('names the pathway category in its title and description', () => {
+ renderComponent();
+
+ expect(screen.getByRole('heading', { name: 'Bootcamp completion' })).toBeInTheDocument();
+ expect(
+ screen.getByText('This represents how many items you have completed in this Bootcamp.'),
+ ).toBeInTheDocument();
+ });
+});
diff --git a/src/pathways/pathway-progress/pathway-completion/PathwayCompletion.tsx b/src/pathways/pathway-progress/pathway-completion/PathwayCompletion.tsx
new file mode 100644
index 0000000000..882903fb63
--- /dev/null
+++ b/src/pathways/pathway-progress/pathway-completion/PathwayCompletion.tsx
@@ -0,0 +1,31 @@
+import { FormattedMessage } from '@openedx/frontend-base';
+import messages from './messages';
+import { PathwayProgressDonut } from '../../progress-donut/PathwayProgressDonut';
+
+export interface PathwayCompletionProps {
+ categoryLabel: string;
+ completed: number;
+ total: number;
+}
+
+export const PathwayCompletion = ({
+ categoryLabel,
+ completed,
+ total,
+}: PathwayCompletionProps) => (
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+);
diff --git a/src/pathways/pathway-progress/pathway-completion/messages.ts b/src/pathways/pathway-progress/pathway-completion/messages.ts
new file mode 100644
index 0000000000..d24c871bf6
--- /dev/null
+++ b/src/pathways/pathway-progress/pathway-completion/messages.ts
@@ -0,0 +1,16 @@
+import { defineMessages } from '@openedx/frontend-base';
+
+const messages = defineMessages({
+ completionTitle: {
+ id: 'learning.pathways.progress.completion.title',
+ defaultMessage: '{categoryLabel} completion',
+ description: 'Title of the Completion section',
+ },
+ completionDescription: {
+ id: 'learning.pathways.progress.completion.description',
+ defaultMessage: 'This represents how many items you have completed in this {categoryLabel}.',
+ description: 'Description of the Completion section',
+ },
+});
+
+export default messages;
diff --git a/src/pathways/pathway-tabs/PathwayTabLink.tsx b/src/pathways/pathway-tabs/PathwayTabLink.tsx
new file mode 100644
index 0000000000..ac9fa7d35b
--- /dev/null
+++ b/src/pathways/pathway-tabs/PathwayTabLink.tsx
@@ -0,0 +1,24 @@
+import classNames from 'classnames';
+import { Link } from 'react-router-dom';
+
+interface PathwayTabLinkProps {
+ slug: string;
+ activeTabSlug?: string;
+ url: string;
+ title: string;
+}
+
+export const PathwayTabLink = ({
+ slug, activeTabSlug, url, title,
+}: PathwayTabLinkProps) => {
+ const isActive = slug === activeTabSlug;
+ return (
+
+ {title}
+
+ );
+};
diff --git a/src/pathways/pathway-tabs/PathwayTabLinksList.test.tsx b/src/pathways/pathway-tabs/PathwayTabLinksList.test.tsx
new file mode 100644
index 0000000000..03842e6997
--- /dev/null
+++ b/src/pathways/pathway-tabs/PathwayTabLinksList.test.tsx
@@ -0,0 +1,35 @@
+import { render, screen } from '@testing-library/react';
+import { MemoryRouter } from 'react-router-dom';
+
+import { PathwayTabLinksList } from './PathwayTabLinksList';
+
+const tabs = [
+ { tabId: 'home', title: 'Home', url: '/pathway/pathway-1/home' },
+ { tabId: 'progress', title: 'Progress', url: '/pathway/pathway-1/progress' },
+ { tabId: 'achievements', title: 'Achievements', url: '/pathway/pathway-1/achievements' },
+];
+
+describe('PathwayTabLinksList', () => {
+ it('renders a link for each tab', () => {
+ render(, { wrapper: MemoryRouter });
+
+ expect(screen.getAllByRole('link')).toHaveLength(3);
+ expect(screen.getByRole('link', { name: 'Progress' })).toHaveAttribute('href', '/pathway/pathway-1/progress');
+ });
+
+ it('highlights only the active tab', () => {
+ render(, { wrapper: MemoryRouter });
+
+ expect(screen.getByRole('link', { name: 'Progress' })).toHaveClass('active');
+ expect(screen.getByRole('link', { name: 'Home' })).not.toHaveClass('active');
+ expect(screen.getByRole('link', { name: 'Achievements' })).not.toHaveClass('active');
+ });
+
+ it('marks only the active tab as the current page', () => {
+ render(, { wrapper: MemoryRouter });
+
+ expect(screen.getByRole('link', { name: 'Progress' })).toHaveAttribute('aria-current', 'page');
+ expect(screen.getByRole('link', { name: 'Home' })).not.toHaveAttribute('aria-current');
+ expect(screen.getByRole('link', { name: 'Achievements' })).not.toHaveAttribute('aria-current');
+ });
+});
diff --git a/src/pathways/pathway-tabs/PathwayTabLinksList.tsx b/src/pathways/pathway-tabs/PathwayTabLinksList.tsx
new file mode 100644
index 0000000000..395a29b5e6
--- /dev/null
+++ b/src/pathways/pathway-tabs/PathwayTabLinksList.tsx
@@ -0,0 +1,21 @@
+import { PathwayTabLink } from './PathwayTabLink';
+import type { PathwayTabMetadata } from './types';
+
+interface PathwayTabLinksListProps {
+ tabs: PathwayTabMetadata[];
+ activeTabSlug?: string;
+}
+
+export const PathwayTabLinksList = ({ tabs, activeTabSlug }: PathwayTabLinksListProps) => (
+ <>
+ {tabs.map(({ url, title, tabId }) => (
+
+ ))}
+ >
+);
diff --git a/src/pathways/pathway-tabs/PathwayTabsNavigation.test.tsx b/src/pathways/pathway-tabs/PathwayTabsNavigation.test.tsx
new file mode 100644
index 0000000000..819fbab277
--- /dev/null
+++ b/src/pathways/pathway-tabs/PathwayTabsNavigation.test.tsx
@@ -0,0 +1,28 @@
+import { render, screen } from '@testing-library/react';
+import { IntlProvider } from '@openedx/frontend-base';
+import { MemoryRouter } from 'react-router-dom';
+
+import { PathwayTabsNavigation } from './PathwayTabsNavigation';
+
+const tabs = [
+ { tabId: 'home', title: 'Home', url: '/pathway/pathway-1/home' },
+ { tabId: 'progress', title: 'Progress', url: '/pathway/pathway-1/progress' },
+];
+
+const renderComponent = (activeTabSlug?: string) => render(
+
+
+
+
+ ,
+);
+
+describe('PathwayTabsNavigation', () => {
+ it('renders the tab links inside a labelled navigation', () => {
+ renderComponent('home');
+
+ const navigation = screen.getByRole('navigation', { name: 'Pathway Material' });
+ expect(navigation).toContainElement(screen.getByRole('link', { name: 'Home' }));
+ expect(navigation).toContainElement(screen.getByRole('link', { name: 'Progress' }));
+ });
+});
diff --git a/src/pathways/pathway-tabs/PathwayTabsNavigation.tsx b/src/pathways/pathway-tabs/PathwayTabsNavigation.tsx
new file mode 100644
index 0000000000..d75c1b1994
--- /dev/null
+++ b/src/pathways/pathway-tabs/PathwayTabsNavigation.tsx
@@ -0,0 +1,28 @@
+import { useIntl } from '@openedx/frontend-base';
+import { Container } from '@openedx/paragon';
+
+import PathwayTabLinksSlot from '@src/slots/PathwayTabLinksSlot';
+import type { PathwayTabMetadata } from './types';
+import messages from './messages';
+
+export interface PathwayTabsNavigationProps {
+ tabs: PathwayTabMetadata[];
+ activeTabSlug?: string;
+}
+
+export const PathwayTabsNavigation = ({ tabs, activeTabSlug }: PathwayTabsNavigationProps) => {
+ const intl = useIntl();
+
+ return (
+
+ );
+};
diff --git a/src/pathways/pathway-tabs/constants.ts b/src/pathways/pathway-tabs/constants.ts
new file mode 100644
index 0000000000..9cdfdb56d2
--- /dev/null
+++ b/src/pathways/pathway-tabs/constants.ts
@@ -0,0 +1,5 @@
+export const PATHWAY_TAB_SLUGS = {
+ OUTLINE: 'outline',
+ PROGRESS: 'progress',
+ ACHIEVEMENTS: 'achievements',
+} as const;
diff --git a/src/pathways/pathway-tabs/hooks.test.tsx b/src/pathways/pathway-tabs/hooks.test.tsx
new file mode 100644
index 0000000000..28b31b06f8
--- /dev/null
+++ b/src/pathways/pathway-tabs/hooks.test.tsx
@@ -0,0 +1,32 @@
+import { renderHook } from '@testing-library/react';
+import { IntlProvider } from '@openedx/frontend-base';
+
+import { usePathwayTabs } from './hooks';
+
+const wrapper = ({ children }) => {children};
+
+describe('usePathwayTabs', () => {
+ it('returns the pathway tabs with their URLs', () => {
+ const { result } = renderHook(() => usePathwayTabs('pathway-1'), { wrapper });
+
+ expect(result.current).toEqual([
+ { tabId: 'outline', title: 'Outline', url: '/learning/pathway/pathway-1/outline' },
+ { tabId: 'progress', title: 'Progress', url: '/learning/pathway/pathway-1/progress' },
+ { tabId: 'achievements', title: 'Achievements', url: '/learning/pathway/pathway-1/achievements' },
+ ]);
+ });
+
+ it('uses the category label as the outline tab title', () => {
+ const { result } = renderHook(() => usePathwayTabs('pathway-1', 'Bootcamp'), { wrapper });
+
+ expect(result.current[0]).toEqual(
+ { tabId: 'outline', title: 'Bootcamp', url: '/learning/pathway/pathway-1/outline' },
+ );
+ });
+
+ it('returns no tabs without a pathway', () => {
+ const { result } = renderHook(() => usePathwayTabs(undefined), { wrapper });
+
+ expect(result.current).toEqual([]);
+ });
+});
diff --git a/src/pathways/pathway-tabs/hooks.ts b/src/pathways/pathway-tabs/hooks.ts
new file mode 100644
index 0000000000..e3a7d25276
--- /dev/null
+++ b/src/pathways/pathway-tabs/hooks.ts
@@ -0,0 +1,27 @@
+import { useMemo } from 'react';
+import { useIntl } from '@openedx/frontend-base';
+
+import { getPathwayTabUrl } from '../urls';
+import { PATHWAY_TAB_SLUGS } from './constants';
+import type { PathwayTabMetadata } from './types';
+import messages from './messages';
+
+const PATHWAY_TABS = [
+ { tabId: PATHWAY_TAB_SLUGS.OUTLINE, message: messages.home },
+ { tabId: PATHWAY_TAB_SLUGS.PROGRESS, message: messages.progress },
+ { tabId: PATHWAY_TAB_SLUGS.ACHIEVEMENTS, message: messages.achievements },
+];
+
+export const usePathwayTabs = (pathwayId?: string, categoryLabel?: string): PathwayTabMetadata[] => {
+ const intl = useIntl();
+ return useMemo(() => {
+ if (!pathwayId) {
+ return [];
+ }
+ return PATHWAY_TABS.map(({ tabId, message }) => ({
+ tabId,
+ title: (tabId === PATHWAY_TAB_SLUGS.OUTLINE && categoryLabel) || intl.formatMessage(message),
+ url: getPathwayTabUrl(pathwayId, tabId),
+ }));
+ }, [intl, pathwayId, categoryLabel]);
+};
diff --git a/src/pathways/pathway-tabs/messages.ts b/src/pathways/pathway-tabs/messages.ts
new file mode 100644
index 0000000000..69eb5e062c
--- /dev/null
+++ b/src/pathways/pathway-tabs/messages.ts
@@ -0,0 +1,26 @@
+import { defineMessages } from '@openedx/frontend-base';
+
+const messages = defineMessages({
+ pathwayMaterial: {
+ id: 'learning.pathways.tabs.navigation.label',
+ defaultMessage: 'Pathway Material',
+ description: 'The accessible label for pathway tabs navigation',
+ },
+ home: {
+ id: 'learning.pathways.tabs.home',
+ defaultMessage: 'Outline',
+ description: 'Title of the pathway tab that shows the pathway outline, used when the pathway has no category',
+ },
+ progress: {
+ id: 'learning.pathways.tabs.progress',
+ defaultMessage: 'Progress',
+ description: 'Title of the pathway tab that shows the learner progress in the pathway',
+ },
+ achievements: {
+ id: 'learning.pathways.tabs.achievements',
+ defaultMessage: 'Achievements',
+ description: 'Title of the pathway tab that shows the learner achievements in the pathway',
+ },
+});
+
+export default messages;
diff --git a/src/pathways/pathway-tabs/types.ts b/src/pathways/pathway-tabs/types.ts
new file mode 100644
index 0000000000..759fbf01df
--- /dev/null
+++ b/src/pathways/pathway-tabs/types.ts
@@ -0,0 +1,5 @@
+export interface PathwayTabMetadata {
+ tabId: string;
+ title: string;
+ url: string;
+}
diff --git a/src/pathways/pathways-achievements/CertificateCard.test.tsx b/src/pathways/pathways-achievements/CertificateCard.test.tsx
new file mode 100644
index 0000000000..05159ff121
--- /dev/null
+++ b/src/pathways/pathways-achievements/CertificateCard.test.tsx
@@ -0,0 +1,39 @@
+import { render, screen } from '@testing-library/react';
+import { IntlProvider } from '@openedx/frontend-base';
+
+import { dataEngineeringAchievements } from '@src/pathways/data/__fixtures__/pathways';
+
+import { CertificateCard } from './CertificateCard';
+
+const [pathwayCertificate, itemCertificate] = dataEngineeringAchievements;
+
+const renderComponent = (achievement: typeof pathwayCertificate) => render(
+
+
+ ,
+);
+
+describe('CertificateCard', () => {
+ it('shows the certificate details', () => {
+ renderComponent(itemCertificate);
+
+ expect(screen.getByText(itemCertificate.displayName)).toBeInTheDocument();
+ expect(screen.getByText(itemCertificate.providerName)).toBeInTheDocument();
+ expect(screen.getByText('Completed on Jul 2, 2026')).toBeInTheDocument();
+ expect(screen.getByText(itemCertificate.credentialId)).toBeInTheDocument();
+ expect(screen.getByRole('button', { name: 'View certificate' })).toBeInTheDocument();
+ });
+
+ it('names the pathway category in the certificate of the pathway itself', () => {
+ renderComponent(pathwayCertificate);
+
+ expect(screen.getByText('Bootcamp certificate')).toBeInTheDocument();
+ });
+
+ it('shows a generic label in the certificate of an item', () => {
+ renderComponent(itemCertificate);
+
+ expect(screen.getByText('Certificate')).toBeInTheDocument();
+ expect(screen.queryByText('Bootcamp certificate')).not.toBeInTheDocument();
+ });
+});
diff --git a/src/pathways/pathways-achievements/CertificateCard.tsx b/src/pathways/pathways-achievements/CertificateCard.tsx
new file mode 100644
index 0000000000..384012614a
--- /dev/null
+++ b/src/pathways/pathways-achievements/CertificateCard.tsx
@@ -0,0 +1,80 @@
+import classNames from 'classnames';
+import { Button, Icon, Stack } from '@openedx/paragon';
+import { Article } from '@openedx/paragon/icons';
+import { FormattedDate, FormattedMessage } from '@openedx/frontend-base';
+
+import type { PathwayAchievementData } from '@src/pathways/data/types';
+
+import messages from './messages';
+
+export interface CertificateCardProps extends PathwayAchievementData {
+ categoryLabel: string;
+}
+
+export const CertificateCard = ({
+ credentialId,
+ displayName,
+ providerName,
+ completedOn,
+ isOverarching,
+ categoryLabel,
+}: CertificateCardProps) => {
+ const subtitle = isOverarching ? messages.pathwayCertificate : messages.itemCertificate;
+
+ return (
+
+
+
+
+
+
+
+
+
+
+ );
+};
+
+export default PathwayInfo;
diff --git a/src/widgets/LearningHeader/README.md b/src/widgets/LearningHeader/README.md
index 9e3835b10f..9b10a5cffa 100644
--- a/src/widgets/LearningHeader/README.md
+++ b/src/widgets/LearningHeader/README.md
@@ -14,6 +14,18 @@ Renders the current course's organization and number on one line and its title b
The widget takes the course ID from the URL and reads the course metadata the course page has already loaded: it never fetches, and renders nothing until that metadata is there.
+## Pathway Info
+
+### Widget ID: `org.openedx.frontend.widget.learning.pathwayInfo.v1`
+
+### Slot ID (owned by the shell): `org.openedx.frontend.slot.header.primaryLinks.v1`
+
+### Props: none
+
+The pathway counterpart of the course info: renders the current pathway's provider on one line and its title beneath, next to the site logo. It shows on Learning's pathway routes only (condition: `org.openedx.frontend.role.pathway` active).
+
+The widget takes the pathway ID from the URL and reads the pathway the pathway page has already loaded: it never fetches, and renders nothing until that pathway is there.
+
## Help
### Widget ID: `org.openedx.frontend.widget.header.help.v1`
diff --git a/src/widgets/LearningHeader/app.test.tsx b/src/widgets/LearningHeader/app.test.tsx
index 08f389a609..5b0af49feb 100644
--- a/src/widgets/LearningHeader/app.test.tsx
+++ b/src/widgets/LearningHeader/app.test.tsx
@@ -5,12 +5,13 @@ import { screen } from '@testing-library/react';
import { type ReactElement } from 'react';
import {
- appId, dashboardRole, learningCourseRole, learningRole,
+ appId, dashboardRole, learningCourseRole, learningRole, pathwayRole,
} from '@src/constants';
import { render } from '@src/tests/render';
import CourseInfo from './CourseInfo';
-import learningHeaderApp, { courseInfoWidgetId, dashboardLinkWidgetId } from './app';
+import PathwayInfo from './PathwayInfo';
+import learningHeaderApp, { courseInfoWidgetId, dashboardLinkWidgetId, pathwayInfoWidgetId } from './app';
const siteConfig = getSiteConfig();
@@ -35,6 +36,16 @@ describe('learningHeaderApp', () => {
});
});
+ it('appends the pathway info widget to the primary links on pathway routes', () => {
+ expect(operation(pathwayInfoWidgetId)).toEqual({
+ slotId: 'org.openedx.frontend.slot.header.primaryLinks.v1',
+ id: pathwayInfoWidgetId,
+ op: WidgetOperationTypes.APPEND,
+ component: PathwayInfo,
+ condition: { active: [pathwayRole] },
+ });
+ });
+
it('adds the help button on Learning routes', () => {
expect(operation(helpWidgetId)).toMatchObject({
slotId: 'org.openedx.frontend.slot.header.secondaryLinks.v1',
diff --git a/src/widgets/LearningHeader/app.tsx b/src/widgets/LearningHeader/app.tsx
index b6daf18d5c..e9d39990f1 100644
--- a/src/widgets/LearningHeader/app.tsx
+++ b/src/widgets/LearningHeader/app.tsx
@@ -3,13 +3,15 @@ import {
} from '@openedx/frontend-base';
import {
- appId, dashboardRole, learningCourseRole, learningRole,
+ appId, dashboardRole, learningCourseRole, learningRole, pathwayRole,
} from '@src/constants';
import CourseInfo from './CourseInfo';
+import PathwayInfo from './PathwayInfo';
import messages from './messages';
export const courseInfoWidgetId = 'org.openedx.frontend.widget.learning.courseInfo.v1';
+export const pathwayInfoWidgetId = 'org.openedx.frontend.widget.learning.pathwayInfo.v1';
export const dashboardLinkWidgetId = 'org.openedx.frontend.widget.learning.headerLinkDashboard.v1';
const app: App = {
@@ -23,6 +25,13 @@ const app: App = {
// The query cache can still hold a Learning course after the learner moves to another app's course page.
condition: { active: [learningCourseRole] },
},
+ {
+ slotId: 'org.openedx.frontend.slot.header.primaryLinks.v1',
+ id: pathwayInfoWidgetId,
+ op: WidgetOperationTypes.APPEND,
+ component: PathwayInfo,
+ condition: { active: [pathwayRole] },
+ },
helpButtonSlotOperation({ appId, role: learningRole }),
{
slotId: 'org.openedx.frontend.slot.header.authenticatedMenu.v1',
diff --git a/src/widgets/LearningHeader/index.ts b/src/widgets/LearningHeader/index.ts
index 7242778d47..9b41f650ed 100644
--- a/src/widgets/LearningHeader/index.ts
+++ b/src/widgets/LearningHeader/index.ts
@@ -1 +1,3 @@
-export { default as learningHeaderApp, courseInfoWidgetId, dashboardLinkWidgetId } from './app';
+export {
+ default as learningHeaderApp, courseInfoWidgetId, dashboardLinkWidgetId, pathwayInfoWidgetId,
+} from './app';
diff --git a/src/widgets/README.md b/src/widgets/README.md
index a6e15d515b..16426532fd 100644
--- a/src/widgets/README.md
+++ b/src/widgets/README.md
@@ -11,8 +11,10 @@ Learning's app declares these in its `slots` (see `src/slots.tsx`), so every sit
| Widget | ID | Slot |
|---|---|---|
| [Course info](./LearningHeader/README.md#course-info) | `courseInfo` | the shell's header, `org.openedx.frontend.slot.header.primaryLinks.v1` |
+| [Pathway info](./LearningHeader/README.md#pathway-info) | `pathwayInfo` | the shell's header, `org.openedx.frontend.slot.header.primaryLinks.v1` |
| [Help](./LearningHeader/README.md#help) | `org.openedx.frontend.widget.header.help.v1` | the shell's header, `org.openedx.frontend.slot.header.secondaryLinks.v1` |
| [Dashboard menu item](./LearningHeader/README.md#dashboard) | `headerLinkDashboard` | the shell's header, `org.openedx.frontend.slot.header.authenticatedMenu.v1` |
+| [Course info strip](./CourseInfoStrip/README.md) | `courseInfoStrip` | the shell's header, `org.openedx.frontend.slot.header.masqueradeBar.v1` |
| [Courseware search](./CoursewareSearch/README.md) | `coursewareSearch` | the shell's course bar, `org.openedx.frontend.slot.header.courseNavigationBar.extraContent.v1` |
| [Discussions sidebar](./DiscussionsSidebar/README.md) | `discussionsSidebar` (exported as `discussionsSidebarWidgetId`) | Learning's [auxiliary sidebar](../slots/AuxiliarySidebarSlot/README.md) and [its trigger slot](../slots/AuxiliarySidebarTriggerSlot/README.md) |