Skip to content
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

fix: limit the course runs in course page to the ones in catalog #7

Merged

Conversation

tecoholic
Copy link
Member

@tecoholic tecoholic commented Jan 18, 2025

By default, the course detail page lists all the available course runs of a course for the learner to enroll. However, this exposes course runs that are not included in a enterprise catalog to the learners. In this commit, the course runs are filtered to allow only the runs mentioned in the catalog to be shown to the learner.

Internal-ref: https://tasks.opencraft.com/browse/BB-9491

Before

image

After

image

Testing Instructions

  1. Setup the enterprise stack using the instructions from feat: allow enrolling learners on invitation only courses edx-enterprise#20
  2. Create a course with at least 2 course re-runs
  3. In the LMS Admin, create an Enterprise Catalog Query with {"key": ["<COURSE ID of Rerun>"]}
  4. Sync the content in course-discovery, and enteprirse-catalog. (Algolia is nice, but no needed to test the changes in this PR). Make sure all the course runs in course-discovery have "Professional only" Seats with a non-zero price value.
  5. Checkout the target branch of this PR
  6. Add a webpack.dev.config.js
    const { getBaseConfig } = require('@edx/frontend-build');
    
    const config = getBaseConfig('webpack-dev');
    
    config.devServer.allowedHosts = "all";
    
    module.exports = config;
  7. Run npm start
  8. Make sure you devstack tutor domain is mapped to localhost (for example 12.0.0.1 maps to apps.local.edly.io in /etc/hosts`.
  9. Without Algolia setup - visit the learner portal at http://<tutor-app-domain>:8734/test-enterprise/course/<short-course-id>. short-course-id is just the first 2 parts without the course run identified. For example in course-v1:edX+DemoCourse+2025_T1 the short ID would be edx+DemoCourse.
  10. With Algolia setup - visit the learner portal's search page and select the course of the rerun added in the enterprise-catalog
  11. The course detail page should show "Enroll" buttons or info boxes for as many valid course-runs.
  12. Now switch to the PR branch. The enroll buttons should be reduced just one - this will target the course re-run included in the enterprise's catalog.

By default, the course detail page lists all the available course runs
of a course for the learner to enroll. However, this exposes course runs
that are not included in a enterprise catalog to the learners. In this
commit, the course runs are filtered to allow only the runs mentioned
in the catalog to be shown to the learner.

Internal-ref: https://tasks.opencraft.com/browse/BB-9491
@tecoholic tecoholic changed the base branch from agrendalath/BB-8825-custom-ui-redwood to tecoholic/BB-8825-custom-ui January 18, 2025 09:44
Copy link
Member

@Agrendalath Agrendalath left a comment

Choose a reason for hiding this comment

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

👍

  • I tested this: verified that the course runs are filtered correctly.
  • I read through the code
  • I checked for accessibility issues: n/a
  • Includes documentation: n/a
  • Added to the Code Drift project board (for backports): n/a

@Agrendalath Agrendalath merged commit 2fe7dd9 into tecoholic/BB-8825-custom-ui Jan 18, 2025
2 of 3 checks passed
@Agrendalath Agrendalath deleted the tecoholic/BB-9491-limit-corurse-runs branch January 18, 2025 14:52
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.

2 participants