Skip to content

Commit 21f022a

Browse files
authored
Merge branch 'master' into pwnage101/ENT-11570
2 parents 2c75baa + da9aa23 commit 21f022a

19 files changed

Lines changed: 332 additions & 1701 deletions

CHANGELOG.rst

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,14 @@ Unreleased
1818

1919
* nothing unreleased
2020

21+
[8.0.1] - 2026-04-27
22+
---------------------
23+
* feat: add DashboardContextEnricher pipeline step for student dashboard filter
24+
25+
[8.0.0] - 2026-04-22
26+
---------------------
27+
* feat!: Drop management commands that dependend on the snowflake-connector
28+
2129
[7.0.7] - 2026-04-24
2230
---------------------
2331
* fix: update social media links for email compatibility
@@ -28,12 +36,10 @@ Unreleased
2836

2937
[7.0.5] - 2026-04-21
3038
---------------------
31-
3239
* fix: restrict invite and delete enterprise admin endpoints to provisioning admin and enterprise admin roles only
3340

3441
[7.0.4] - 2026-04-15
3542
---------------------
36-
3743
* fix: [SAML Views] Accept an "enterprise_customer_uuid" query param (instead of "enterprise-id")
3844

3945
[7.0.3] - 2026-04-15

enterprise/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
Your project description goes here.
33
"""
44

5-
__version__ = "7.0.7"
5+
__version__ = "8.0.1"

enterprise/filters/dashboard.py

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
"""
2+
Pipeline steps for the student dashboard filter.
3+
"""
4+
from typing import Any
5+
6+
from openedx_filters.filters import PipelineStep
7+
8+
# These imports will be replaced with internal paths in epic 17 when enterprise_support is
9+
# migrated into edx-enterprise.
10+
try:
11+
from openedx.features.enterprise_support.api import (
12+
get_dashboard_consent_notification,
13+
get_enterprise_learner_portal_context,
14+
)
15+
from openedx.features.enterprise_support.utils import is_enterprise_learner
16+
except ImportError:
17+
get_dashboard_consent_notification = None
18+
get_enterprise_learner_portal_context = None
19+
is_enterprise_learner = None
20+
21+
22+
class DashboardContextEnricher(PipelineStep):
23+
"""
24+
Enrich the student dashboard context with enterprise-specific data.
25+
26+
Injects: enterprise_message, consent_required_courses, is_enterprise_user, and
27+
enterprise learner portal context keys.
28+
"""
29+
30+
def run_filter(self, context: dict[str, Any], template_name: str) -> dict[str, Any]: # pylint: disable=arguments-differ
31+
"""
32+
Inject enterprise data into the dashboard context.
33+
"""
34+
request = context.get('request')
35+
user = context.get('user')
36+
course_enrollments = context.get('course_enrollment_pairs', [])
37+
38+
if user is None:
39+
return {'context': context, 'template_name': template_name}
40+
41+
enterprise_message = get_dashboard_consent_notification(request, user, course_enrollments)
42+
43+
enterprise_learner_portal_context = get_enterprise_learner_portal_context(request)
44+
45+
context['enterprise_message'] = enterprise_message
46+
context['is_enterprise_user'] = is_enterprise_learner(user)
47+
context.update(enterprise_learner_portal_context)
48+
49+
return {'context': context, 'template_name': template_name}

0 commit comments

Comments
 (0)