-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: [assignments] backend support for "State" and "Recent action" c…
…olumns assignment serializer contains two additional keys: * actions: A list of all serialized actions for the assignment. * recent_action: dict, intended to power the "Recent action" column in the frontend display. Assignment list views are now sortable on two keys: * state: This is just the assignment internal state. * recent_action_time: This is a dynamic field defined as `coalesce(most recent reminder, assignment creation)` Example URLs ------------ Listing assignments sorted by state: /api/v1/assignment-configurations/{assignment_configuration_uuid}/admin/assignments/?ordering=state /api/v1/assignment-configurations/{assignment_configuration_uuid}/admin/assignments/?ordering=-state Listing assignments sorted by recent_action_time: /api/v1/assignment-configurations/{assignment_configuration_uuid}/admin/assignments/?ordering=recent_action_time /api/v1/assignment-configurations/{assignment_configuration_uuid}/admin/assignments/?ordering=-recent_action_time ENT-7780
- Loading branch information
Showing
5 changed files
with
217 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,16 @@ | ||
""" Constants for the api app. """ | ||
from enterprise_access.apps.content_assignments.constants import AssignmentActions | ||
|
||
LICENSE_UNASSIGNED_STATUS = 'unassigned' | ||
|
||
|
||
class RecentActionTypes(AssignmentActions): | ||
""" | ||
Types for recent_action. | ||
""" | ||
ASSIGNED = 'assigned' | ||
REMINDED = 'reminded' | ||
CHOICES = ( | ||
(ASSIGNED, 'Learner assigned content.'), | ||
(REMINDED, 'Learner sent reminder message.'), | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.