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

[BD-32] feat: add filter before course home rendering process starts #29995

Closed

Conversation

mariajgrimaldi
Copy link
Member

@mariajgrimaldi mariajgrimaldi commented Mar 1, 2022

Description

As part of the Hooks Extension Framework implementation plan, this PR adds a filter before the course home rendering process starts.

Supporting information

Testing instructions

  1. Install openedx-filters library:
pip install git+https://github.com/eduNEXT/openedx-filters.git@MJG/template-exceptions#egg=openedx_filters==0.6.0_alpha

We are currently using this version because implements some convenient exceptions for template interactions.
2. Implement your pipeline steps in your favorite plugin. We created some as illustration in openedx-filters-samples. We'll be using those in this example.
3. Install openedx-filters-samples

pip install -e git+https://github.com/eduNEXT/openedx-filters-samples.git@master#egg=openedx_filters_samples
  1. Configure your filters:
    With this configuration, you won't be able to:
  • Render the course home. Instead, an error will be raised or a different template will be rendered (if you define its path here)
OPEN_EDX_FILTERS_CONFIG = {
     "org.openedx.learning.course_home.render.started.v1": {
            "fail_silently": False,
            "pipeline": [
                "openedx_filters_samples.samples.pipeline.StopCourseHomeRendering",
            ]
    },
}

And with this one, you'll be able to modify course updates text.

OPEN_EDX_FILTERS_CONFIG = {
     "org.openedx.learning.course_home.render.started.v1": {
            "fail_silently": False,
            "pipeline": [
                "openedx_filters_samples.samples.pipeline.ModifyUpdatesFromCourse",
            ]
    },
}

If you want to redirect to your custom course home, then:

OPEN_EDX_FILTERS_CONFIG = {
     "org.openedx.learning.course_home.render.started.v1": {
            "fail_silently": False,
            "pipeline": [
                "openedx_filters_samples.samples.pipeline.RedirectCourseHomeRendering",
            ]
    },
}

@openedx-webhooks openedx-webhooks added blended PR is managed through 2U's blended developmnt program waiting on author PR author needs to resolve review requests, answer questions, fix tests, etc. labels Mar 1, 2022
@openedx-webhooks
Copy link

openedx-webhooks commented Mar 1, 2022

Thanks for the pull request, @mariajgrimaldi! I've created BLENDED-1119 to keep track of it in Jira. More details are on the BD-32 project page.

When this pull request is ready, tag your edX technical lead.

@mariajgrimaldi mariajgrimaldi force-pushed the MJG/course-home-render-filter branch from 273fcf9 to 7304c37 Compare March 2, 2022 12:23
@mariajgrimaldi mariajgrimaldi marked this pull request as ready for review March 2, 2022 12:43
@mariajgrimaldi mariajgrimaldi changed the title [WIP] [BD-32] feat: add filter before course home rendering process starts [BD-32] feat: add filter before course home rendering process starts Mar 2, 2022
@openedx-webhooks openedx-webhooks added needs triage and removed waiting on author PR author needs to resolve review requests, answer questions, fix tests, etc. labels Mar 2, 2022
@mariajgrimaldi mariajgrimaldi force-pushed the MJG/course-home-render-filter branch from 7304c37 to 063270e Compare March 2, 2022 17:20
@mariajgrimaldi
Copy link
Member Author

Closing this PR in favor of PR #29996

@openedx-webhooks
Copy link

@mariajgrimaldi Even though your pull request wasn’t merged, please take a moment to answer a two question survey so we can improve your experience in the future.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blended PR is managed through 2U's blended developmnt program rejected
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants