Skip to content

Commit

Permalink
Merge branch 'master' into kiram15/ENT-9670
Browse files Browse the repository at this point in the history
  • Loading branch information
kiram15 committed Nov 20, 2024
2 parents 2805fd8 + 546f6fc commit 88785e2
Show file tree
Hide file tree
Showing 19 changed files with 918 additions and 804 deletions.
16 changes: 16 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,22 @@ Unreleased
--------
* feat: Creating enterprise customer members endpoint for admin portal

[4.33.0]
--------
* feat: Updated pagination for reporting configurations.

[4.32.3]
--------
* chore: Update python requirements.

[4.32.2]
--------
* fix: ensure admin_users in EnterpriseCustomerUserViewSet is correct.

[4.32.1]
--------
* feat: enable search filter on learner data transmission audit admin views for all integrated channels.

[4.32.0]
--------
* feat: create DefaultEnterpriseEnrollmentRealization objects in bulk enrollment API, when applicable.
Expand Down
11 changes: 10 additions & 1 deletion enterprise/api/v1/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -721,7 +721,7 @@ class Meta:
)

user = UserSerializer()
enterprise_customer = EnterpriseCustomerSerializer()
enterprise_customer = serializers.SerializerMethodField()
data_sharing_consent_records = serializers.SerializerMethodField()
groups = serializers.SerializerMethodField()
role_assignments = serializers.SerializerMethodField()
Expand Down Expand Up @@ -756,6 +756,15 @@ def __init__(self, instance=None, data=empty, **kwargs):
)
self.role_assignments_by_ecu_id = role_assignments_by_ecu_id

def get_enterprise_customer(self, obj):
"""
Return serialization of EnterpriseCustomer associated with the EnterpriseCustomerUser.
"""
return EnterpriseCustomerSerializer(
instance=obj.enterprise_customer,
context=self.context
).data

def get_data_sharing_consent_records(self, obj):
"""
Return serialization of EnterpriseCustomerUser.data_sharing_consent_records property.
Expand Down
10 changes: 10 additions & 0 deletions enterprise/api/v1/views/enterprise_customer_reporting.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
from edx_rest_framework_extensions.auth.jwt.authentication import JwtAuthentication
from rest_framework import permissions, status
from rest_framework.authentication import SessionAuthentication
from rest_framework.pagination import PageNumberPagination
from rest_framework.response import Response
from rest_framework.status import HTTP_200_OK, HTTP_404_NOT_FOUND
from rest_framework.views import APIView
Expand All @@ -17,6 +18,14 @@
from enterprise.utils import get_enterprise_customer


class ExpandDefaultPageSize(PageNumberPagination):
"""
Expands page size for the API.
Used to populate large reporting configurations.
"""
page_size = 100


class EnterpriseCustomerReportingConfigurationViewSet(EnterpriseReadWriteModelViewSet):
"""
API views for the ``enterprise-customer-reporting`` API endpoint.
Expand All @@ -26,6 +35,7 @@ class EnterpriseCustomerReportingConfigurationViewSet(EnterpriseReadWriteModelVi
serializer_class = serializers.EnterpriseCustomerReportingConfigurationSerializer
lookup_field = 'uuid'
permission_classes = [permissions.IsAuthenticated]
pagination_class = ExpandDefaultPageSize

USER_ID_FILTER = 'enterprise_customer__enterprise_customer_users__user_id'
FIELDS = (
Expand Down
8 changes: 8 additions & 0 deletions integrated_channels/blackboard/admin/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,14 @@ class BlackboardLearnerDataTransmissionAuditAdmin(BaseLearnerDataTransmissionAud
"api_record",
)

search_fields = (
"blackboard_user_email",
"enterprise_course_enrollment_id",
"course_id",
"content_title",
"friendly_status_message"
)

list_per_page = 1000

class Meta:
Expand Down
8 changes: 8 additions & 0 deletions integrated_channels/canvas/admin/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,14 @@ class CanvasLearnerDataTransmissionAuditAdmin(BaseLearnerDataTransmissionAuditAd
"api_record",
)

search_fields = (
"canvas_user_email",
"enterprise_course_enrollment_id",
"course_id",
"content_title",
"friendly_status_message"
)

list_per_page = 1000

class Meta:
Expand Down
8 changes: 8 additions & 0 deletions integrated_channels/cornerstone/admin/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,14 @@ class CornerstoneLearnerDataTransmissionAuditAdmin(BaseLearnerDataTransmissionAu
"api_record",
)

search_fields = (
"user_email",
"enterprise_course_enrollment_id",
"course_id",
"content_title",
"friendly_status_message"
)

class Meta:
model = CornerstoneLearnerDataTransmissionAudit

Expand Down
8 changes: 8 additions & 0 deletions integrated_channels/degreed/admin/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,14 @@ class DegreedLearnerDataTransmissionAuditAdmin(BaseLearnerDataTransmissionAuditA
"api_record",
)

search_fields = (
"degreed_user_email",
"enterprise_course_enrollment_id",
"course_id",
"content_title",
"friendly_status_message"
)

list_per_page = 1000

class Meta:
Expand Down
8 changes: 8 additions & 0 deletions integrated_channels/degreed2/admin/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,14 @@ class Degreed2LearnerDataTransmissionAuditAdmin(BaseLearnerDataTransmissionAudit
"api_record",
)

search_fields = (
"degreed_user_email",
"enterprise_course_enrollment_id",
"course_id",
"content_title",
"friendly_status_message"
)

list_per_page = 1000

class Meta:
Expand Down
8 changes: 8 additions & 0 deletions integrated_channels/moodle/admin/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,14 @@ class MoodleLearnerDataTransmissionAuditAdmin(BaseLearnerDataTransmissionAuditAd
"api_record",
)

search_fields = (
"moodle_user_email",
"enterprise_course_enrollment_id",
"course_id",
"content_title",
"friendly_status_message"
)

list_per_page = 1000

class Meta:
Expand Down
8 changes: 8 additions & 0 deletions integrated_channels/sap_success_factors/admin/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,14 @@ class SapSuccessFactorsLearnerDataTransmissionAuditAdmin(
"api_record",
)

search_fields = (
"sapsf_user_id",
"enterprise_course_enrollment_id",
"course_id",
"content_title",
"friendly_status_message"
)

list_per_page = 1000

class Meta:
Expand Down
2 changes: 1 addition & 1 deletion requirements/celery53.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
amqp==5.2.0
amqp==5.3.1
billiard==4.2.1
celery==5.4.0
click==8.1.7
Expand Down
4 changes: 2 additions & 2 deletions requirements/ci.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ filelock==3.16.1
# via
# tox
# virtualenv
packaging==24.1
packaging==24.2
# via tox
platformdirs==4.3.6
# via virtualenv
Expand All @@ -22,7 +22,7 @@ six==1.16.0
# via tox
tox==3.28.0
# via
# -c requirements/constraints.txt
# -c /home/runner/work/edx-enterprise/edx-enterprise/requirements/constraints.txt
# -r requirements/ci.in
virtualenv==20.27.1
# via tox
8 changes: 0 additions & 8 deletions requirements/common_constraints.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
# Note: Changes to this file will automatically be used by other repos, referencing
# this file from Github directly. It does not require packaging in edx-lint.


# using LTS django version
Django<5.0

Expand All @@ -23,13 +22,6 @@ elasticsearch<7.14.0

# django-simple-history>3.0.0 adds indexing and causes a lot of migrations to be affected

# Cause: https://github.com/openedx/event-tracking/pull/290
# event-tracking 2.4.1 upgrades to pymongo 4.4.0 which is not supported on edx-platform.
# We will pin event-tracking to do not break existing installations
# This can be unpinned once https://github.com/openedx/edx-platform/issues/34586
# has been resolved and edx-platform is running with pymongo>=4.4.0
event-tracking<2.4.1

# Cause: https://github.com/openedx/edx-lint/issues/458
# This can be unpinned once https://github.com/openedx/edx-lint/issues/459 has been resolved.
pip<24.3
Loading

0 comments on commit 88785e2

Please sign in to comment.