Skip to content

Conversation

@holaontiveros
Copy link
Contributor

Description

Currently when the ENABLE_COMPLETION_TRACKING_SWITCH waffle switch is disabled the frontend doesn't take it into account and still displays completion for anything that was already completed.

This PR adds the ENABLE_COMPLETION_TRACKING_SWITCH to sidebar toggles api so the frontend can leverage it.

Screenshots

before:
image

after:
image

(right side of the screen to see network response for the API that changed)

flag disabled
image

flag enabled
image

Supporting information

fixes #1692

Testing instructions

Either use the API:

GET http://local.openedx.io:8000/courses/course-v1:demo+D01+2025_T1/courseware-navigation-sidebar/toggles/

or access a course on the MFE and look for the toggles API request

Deadline

None

Other information

Include anything else that will help reviewers and consumers understand the change.

@openedx-webhooks openedx-webhooks added the open-source-contribution PR author is not from Axim or 2U label May 26, 2025
@openedx-webhooks
Copy link

Thanks for the pull request, @holaontiveros!

This repository is currently maintained by @openedx/wg-maintenance-edx-platform.

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.

@jacobo-dominguez-wgu jacobo-dominguez-wgu added the mao-onboarding Reviewing this will help onboard devs from an Axim mission-aligned organization (MAO). label May 27, 2025
@holaontiveros holaontiveros requested a review from Copilot May 27, 2025 16:02
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds a completion tracking switch in the toggles API to enable the frontend to correctly display completion tracking based on a feature flag. Key changes include:

  • Importing and adding ENABLE_COMPLETION_TRACKING_SWITCH in the sidebar toggles API in views.py.
  • Updating tests in test_views.py to verify API responses for both enabled and disabled states of the new switch.

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
lms/djangoapps/courseware/views/views.py Updated the toggles API to include the completion tracking status flag.
lms/djangoapps/courseware/tests/test_views.py Added tests to validate the new completion tracking flag under different toggle configurations.
Comments suppressed due to low confidence (1)

lms/djangoapps/courseware/tests/test_views.py:3800

  • [nitpick] Consider renaming the test function to use 'completion_tracking' instead of 'completion_track' for consistency with the API field name 'enable_completion_tracking'.
def test_courseware_mfe_navigation_sidebar_enabled_aux_disabled_completion_track_disabled(self):

return JsonResponse({
"enable_navigation_sidebar": COURSEWARE_MICROFRONTEND_ENABLE_NAVIGATION_SIDEBAR.is_enabled(course_key),
"always_open_auxiliary_sidebar": COURSEWARE_MICROFRONTEND_ALWAYS_OPEN_AUXILIARY_SIDEBAR.is_enabled(course_key),
# Add completion tracking status for the sidebar use while a global place for switches is put in place
Copy link

Copilot AI May 27, 2025

Choose a reason for hiding this comment

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

Consider clarifying the comment to better explain that the new completion tracking flag is a temporary solution pending a global switch management implementation.

Copilot uses AI. Check for mistakes.
Copy link
Member

Choose a reason for hiding this comment

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

shush copilot

@mphilbrick211 mphilbrick211 added the needs reviewer assigned PR needs to be (re-)assigned a new reviewer label May 27, 2025
@mphilbrick211 mphilbrick211 moved this from Needs Triage to Ready for Review in Contributions May 27, 2025
@e0d
Copy link
Contributor

e0d commented May 29, 2025

Your branch is behind the base. I've pulled in changes from master as a merge commit which will update your branch and cause the tests to be re-run.

@holaontiveros
Copy link
Contributor Author

Your branch is behind the base. I've pulled in changes from master as a merge commit which will update your branch and cause the tests to be re-run.

Thank you, and I just did again, it gets out of sync really quick

@holaontiveros holaontiveros requested a review from a team May 30, 2025 19:27
Copy link
Member

@kdmccormick kdmccormick left a comment

Choose a reason for hiding this comment

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

Thank you!

@kdmccormick kdmccormick merged commit 800b8b6 into openedx:master Jun 2, 2025
49 checks passed
@openedx-webhooks openedx-webhooks removed the needs reviewer assigned PR needs to be (re-)assigned a new reviewer label Jun 2, 2025
@github-project-automation github-project-automation bot moved this from Ready for Review to Done in Contributions Jun 2, 2025
@kdmccormick
Copy link
Member

Thanks for the commit and helpful screenshots @holaontiveros !

One small thing -- the links you've provided (in Supporting Info and Other Info) are incorrect. Is it possible you're trying to link to issues/PRs in another repository?

@holaontiveros
Copy link
Contributor Author

Thanks for the commit and helpful screenshots @holaontiveros !

One small thing -- the links you've provided (in Supporting Info and Other Info) are incorrect. Is it possible you're trying to link to issues/PRs in another repository?

Yes I was! because I copy an pasted from my other PR, sorry for that

@holaontiveros holaontiveros deleted the feat/OEXCOM-97-completion-tracking-to-api branch June 2, 2025 16:02
@edx-pipeline-bot
Copy link
Contributor

2U Release Notice: This PR has been deployed to the edX staging environment in preparation for a release to production.

@edx-pipeline-bot
Copy link
Contributor

2U Release Notice: This PR has been deployed to the edX production environment.

1 similar comment
@edx-pipeline-bot
Copy link
Contributor

2U Release Notice: This PR has been deployed to the edX production environment.

@edx-pipeline-bot
Copy link
Contributor

2U Release Notice: This PR has been deployed to the edX staging environment in preparation for a release to production.

@edx-pipeline-bot
Copy link
Contributor

2U Release Notice: This PR has been deployed to the edX production environment.

1 similar comment
@edx-pipeline-bot
Copy link
Contributor

2U Release Notice: This PR has been deployed to the edX production environment.

@edx-pipeline-bot
Copy link
Contributor

2U Release Notice: This PR has been deployed to the edX staging environment in preparation for a release to production.

@edx-pipeline-bot
Copy link
Contributor

2U Release Notice: This PR has been deployed to the edX production environment.

marlonkeating pushed a commit that referenced this pull request Jul 15, 2025
Currently when the ENABLE_COMPLETION_TRACKING_SWITCH waffle switch is disabled
the frontend doesn't take it into account and still displays completion for
anything that was already completed.

This PR adds the ENABLE_COMPLETION_TRACKING_SWITCH to sidebar toggles api so
the frontend can leverage it.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

mao-onboarding Reviewing this will help onboard devs from an Axim mission-aligned organization (MAO). open-source-contribution PR author is not from Axim or 2U

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

7 participants