Skip to content

fix: Issue-1403. Course sidebar not showing sections on pending courses #1679

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

Open
wants to merge 15 commits into
base: master
Choose a base branch
from

Conversation

wgu-jesse-stewart
Copy link

@wgu-jesse-stewart wgu-jesse-stewart commented Apr 17, 2025

Fixes #1403

Description

When Course Schedule > Course start date is set to a future date or when Course Requirements > Prerequisite course is set the Course outline is now shown on the front-end.

Expected behavior:
image

Actual behavior:
image

Cause

isDisplaySequenceLevel is default to true when the page loads which prevents the UI from displaying the sectionsIds list. I don't believe this is the desired behavior because const sequenceIds = sections[selectedSection || activeSectionId]?.sequenceIds || [] will always be an empty array because selectedSection || activeSectionId are not set unless the course has been started.

if we set the default value for isDisplaySequenceLevel to false, then the sectionsIds will display as expected. However, we need to be sure to set setDisplaySequenceLevel() if sequenceIds are available. This will ensure users that have started the course are given the correct navigation items.

image

Test coverage did not change.
image

@openedx-webhooks
Copy link

openedx-webhooks commented Apr 17, 2025

Thanks for the pull request, @wgu-jesse-stewart!

This repository is currently maintained by @openedx/committers-frontend-app-learning.

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 approval

If you haven't already, check this list to see if your contribution needs to go through the product review process.

  • If it does, you'll need to submit a product proposal for your contribution, and have it reviewed by the Product Working Group.
    • This process (including the steps you'll need to take) is documented here.
  • If it doesn't, simply proceed with the next step.
🔘 Provide context

To 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:

  • Dependencies

    This PR must be merged before / after / at the same time as ...

  • Blockers

    This PR is waiting for OEP-1234 to be accepted.

  • Timeline information

    This PR must be merged by XX date because ...

  • Partner information

    This is for a course on edx.org.

  • Supporting documentation
  • Relevant Open edX discussion forum threads
🔘 Get a green build

If one or more checks are failing, continue working on your changes until this is no longer the case and your build turns green.


Where 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:

  • The size and impact of the changes that it introduces
  • The need for product review
  • Maintenance status of the parent repository

💡 As a result it may take up to several weeks or months to complete a review and merge your PR.

@openedx-webhooks openedx-webhooks added the open-source-contribution PR author is not from Axim or 2U label Apr 17, 2025
@github-project-automation github-project-automation bot moved this to Needs Triage in Contributions Apr 17, 2025
@e0d e0d changed the title fix: Issue-1403. Course sidebar not showing sections on pending courses fix: Issue-1403. Course sidebar not showing sections on pending courses Apr 17, 2025
Copy link

codecov bot commented Apr 17, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 90.20%. Comparing base (24c9437) to head (aecf4a5).

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #1679   +/-   ##
=======================================
  Coverage   90.20%   90.20%           
=======================================
  Files         343      343           
  Lines        5747     5749    +2     
  Branches     1381     1382    +1     
=======================================
+ Hits         5184     5186    +2     
+ Misses        546      544    -2     
- Partials       17       19    +2     

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@e0d e0d changed the title fix: Issue-1403. Course sidebar not showing sections on pending courses fix: Issue-1403. Course sidebar not showing sections on pending courses Apr 17, 2025
@sarina sarina removed their request for review April 18, 2025 13:51
@sarina
Copy link
Contributor

sarina commented Apr 18, 2025

Hi @wgu-jesse-stewart - I'm not a frontend engineer so I'm not the person to request for review.

Generally reviews can take a bit of time, and we're under pressure for the Teak cut next Thursday so people may be short on time right now.

@sarina sarina removed the request for review from KristinAoki April 18, 2025 13:52
@sarina
Copy link
Contributor

sarina commented Apr 18, 2025

Also could you add a test for this change so that future changes don't revert the fix?

@wgu-jesse-stewart
Copy link
Author

Also could you add a test for this change so that future changes don't revert the fix?

I will look at the existing tests and see if they can be expanded. Right now we see 100% coverage, but we could possibly find a way to test for this specifically.

@wgu-jesse-stewart
Copy link
Author

This is ready for review

@itsjeyd
Copy link

itsjeyd commented Apr 24, 2025

@wgu-jesse-stewart, thank you for this contribution! Since it's a user-facing change, it will need to go through product review as a first step.

Please have a look at the instructions from the bot to get that process started.

@itsjeyd itsjeyd added the product review PR requires product review before merging label Apr 24, 2025
@itsjeyd itsjeyd moved this from Needs Triage to Waiting on Author in Contributions Apr 24, 2025
@wgu-jesse-stewart
Copy link
Author

I reviewed my own code and decided a more straightforward approach would be create a new method for resolvedSectionId.

const resolvedSectionId =
selectedSection ||
Object.keys(sections).find(sectionId =>
sections[sectionId].sequenceIds.includes(activeSequenceId)
);

@crathbun428
Copy link

@wgu-jesse-stewart - Happy to take a look/review if and when you get a moment to throw a screen recording of the fix on there for me. Thank you for taking on this bug fix!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
open-source-contribution PR author is not from Axim or 2U product review PR requires product review before merging
Projects
Status: Waiting on Author
Development

Successfully merging this pull request may close these issues.

Sidebar weird behavior when course is not completly live/scheduled
5 participants