Skip to content

feat(AU-2375): Update breadcrumbs and outline navigation bar UI #1582

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Feb 27, 2025

Conversation

Rodra
Copy link
Contributor

@Rodra Rodra commented Feb 6, 2025

Description

Extend CourseOutlineSidebarTriggerSlot props to amplify plugin usage.

Copy link

codecov bot commented Feb 6, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 84.62%. Comparing base (3cbbb02) to head (fdbcb7e).
Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1582      +/-   ##
==========================================
+ Coverage   84.61%   84.62%   +0.01%     
==========================================
  Files         332      332              
  Lines        5661     5666       +5     
  Branches     1391     1394       +3     
==========================================
+ Hits         4790     4795       +5     
  Misses        852      852              
  Partials       19       19              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@Rodra
Copy link
Contributor Author

Rodra commented Feb 12, 2025

@openedx/committers-frontend-app-learning this PR is ready for review

@bradenmacdonald
Copy link
Contributor

I'll try to take a look by tomorrow.

Copy link
Contributor

@bradenmacdonald bradenmacdonald left a comment

Choose a reason for hiding this comment

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

Mostly looks good. Please just swap out courseId in favor of useContextId, and can you please update the slot README to list the new props?

@@ -161,7 +162,13 @@ const Sequence = ({
const defaultContent = (
<>
<div className="sequence-container d-inline-flex flex-row w-100">
<CourseOutlineSidebarTriggerSlot />
<CourseOutlineSidebarTriggerSlot
courseId={courseId}
Copy link
Contributor

Choose a reason for hiding this comment

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

Per a big discussion on #1496 , I think courseId should not be a prop, but instead any plugins that need it can get it with the useContextId hook. See the example code for ProgressTabCourseGradeSlot which shows this.

Ideally, isStaff would be likewise always available via a useIsStaff or useUser hook, but I don't think it's been implemented/standardized yet.

I think the other props are reasonable for this.

Copy link
Contributor Author

@Rodra Rodra Feb 24, 2025

Choose a reason for hiding this comment

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

Regarding your suggestion on using useContextId to get the courseId instead of passing it as a prop to my plugin, I have an issue when trying to use it from the view that's inserting that plugin. I used the hook as in here https://github.com/openedx/frontend-app-learning/pull/1496/files#diff-295513048177ffa3f1a1d414820290303766b7c74b29050d29aea1a08a59305cR19, looks like that hook is using the courseId saved in courseHome from redux store but that data seems to be available from the course home page. When using the Sequence/Unit view, the data is available in courseware and courseHome has null/undefined data. Is there a courseware hook that I could use or should I go back to use the courseId as prop ?

Screenshot 2025-02-24 at 12 23 48 PM Screenshot 2025-02-24 at 12 24 12 PM

Copy link
Contributor

Choose a reason for hiding this comment

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

Could you just update the useContextId hook, so that it falls back? Like this:

- export const useContextId = () => useSelector<RootState>(state => state.courseHome.courseId);
+ export const useContextId = () => useSelector<RootState>(state => state.courseware.courseId ?? state.courseHome.courseId);

Copy link
Contributor

@bradenmacdonald bradenmacdonald left a comment

Choose a reason for hiding this comment

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

LGTM!

@jristau1984
Copy link
Contributor

@bradenmacdonald can you merge this if you have no update requests? The Aurora team does not have merge rights. Thanks!

@KristinAoki
Copy link
Member

@jristau1984 I now have merge rights so I can merge it

@Rodra Rodra merged commit 46889c2 into openedx:master Feb 27, 2025
7 checks passed
@Rodra Rodra deleted the feat/AU-2375 branch February 28, 2025 18:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants