Skip to content

feat: replace enterprise_support with DashboardRenderStarted filter#264

Open
kiram15 wants to merge 1 commit intorelease-ulmofrom
kiram15/ENT-11563-1
Open

feat: replace enterprise_support with DashboardRenderStarted filter#264
kiram15 wants to merge 1 commit intorelease-ulmofrom
kiram15/ENT-11563-1

Conversation

@kiram15
Copy link
Copy Markdown

@kiram15 kiram15 commented May 5, 2026

Description

Removes the direct imports of get_dashboard_consent_notification, get_enterprise_learner_portal_context, and is_enterprise_learner from the student dashboard view and lets the DashboardRenderStarted filter pipeline handle enterprise context enrichment instead. Adds 'request' to the context dict so pipeline steps (e.g. DashboardContextEnricher
in edx-enterprise) can access it.

Supporting information

ENT-11569

Related openedx-platform PR

Testing instructions

Please provide detailed step-by-step instructions for testing this change.

Deadline

"None" if there's no rush, or provide a specific date or event (and reason) if there is one.

Other information

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

  • Does this change depend on other changes elsewhere?
  • Any special concerns or limitations? For example: deprecations, migrations, security, or accessibility.
  • If your database migration can't be rolled back easily.

Copilot AI review requested due to automatic review settings May 5, 2026 06:33
Copy link
Copy Markdown

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 shifts enterprise-related learner dashboard context enrichment out of the student_dashboard view and into the DashboardRenderStarted openedx-filters pipeline, enabling integrations (e.g., edx-enterprise) to inject enterprise context via configured pipeline steps.

Changes:

  • Upgraded openedx-filters to 3.3.0 in edx requirement pins.
  • Removed direct enterprise_support imports/usages from the learner dashboard view; added request to the dashboard context for pipeline steps.
  • Introduced default OPEN_EDX_FILTERS_CONFIG in LMS common settings and added YAML-merge behavior in production settings; added a test for request presence in filter context.

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
requirements/edx/base.txt Bumps openedx-filters pin to 3.3.0.
requirements/edx/development.txt Keeps dev requirements aligned with the new openedx-filters version.
requirements/edx/testing.txt Keeps test requirements aligned with the new openedx-filters version.
requirements/edx/doc.txt Keeps doc requirements aligned with the new openedx-filters version.
lms/envs/common.py Adds default OPEN_EDX_FILTERS_CONFIG entry for the dashboard render filter.
lms/envs/production.py Merges YAML-provided OPEN_EDX_FILTERS_CONFIG into defaults (append pipeline, override fail_silently).
common/djangoapps/student/views/dashboard.py Removes enterprise_support view logic and passes request through dashboard context for filter steps.
common/djangoapps/student/tests/test_filters.py Adds a pipeline-step-based test intended to validate request availability for dashboard filter enrichment.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread lms/envs/common.py
Comment on lines +3721 to +3726
# .. setting_name: OPEN_EDX_FILTERS_CONFIG
# .. setting_default: {}
# .. setting_description: Configuration dict for openedx-filters pipeline steps.
# Keys are filter type strings; values are dicts with 'fail_silently' (bool) and
# 'pipeline' (list of dotted-path strings to PipelineStep subclasses).
OPEN_EDX_FILTERS_CONFIG = {
Comment thread lms/envs/production.py
Comment on lines +522 to +533
# Merge OPEN_EDX_FILTERS_CONFIG from YAML into the default defined in common.py.
# Pipeline steps from YAML are appended after steps defined in common.py.
# The fail_silently value from YAML takes precedence over the one in common.py.
for _filter_type, _filter_config in _YAML_TOKENS.get('OPEN_EDX_FILTERS_CONFIG', {}).items():
if _filter_type in OPEN_EDX_FILTERS_CONFIG:
OPEN_EDX_FILTERS_CONFIG[_filter_type]['pipeline'].extend(
_filter_config.get('pipeline', [])
)
if 'fail_silently' in _filter_config:
OPEN_EDX_FILTERS_CONFIG[_filter_type]['fail_silently'] = _filter_config['fail_silently']
else:
OPEN_EDX_FILTERS_CONFIG[_filter_type] = _filter_config
Comment on lines +500 to +504
- The dashboard renders successfully (HTTP 200).
"""
response = self.client.get(self.dashboard_url)

self.assertEqual(response.status_code, 200)
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