-
Notifications
You must be signed in to change notification settings - Fork 253
Description
❌ This issue is not open for contribution. Visit Contributing guidelines to learn about the contributing process and how to find suitable issues.
Overview
Once the editor channel submission workflow is in place, the editor has everything they need to submit a channel. However, they do not have a way to get any updates about their submission. For this, we will build a Notifications page where editors can view the status updates of their submissions or submissions of the channels they are editors for. This issue will focus on implementing the backend filters necessary to support this new page.
Technical requirements
- For now, we won't be building a new notifications architecture in Studio, as we don't yet have enough use cases. So, we will focus just on getting updates on the Community Library Submissions, i.e., in this notifications page, for now, we will just query the
CommunityLibrarySubmissionViewsetendpoint. - The main problem of using this viewset is that we will use the
CommunityLibrarySubmissionmodel, which stores both "events": the creation and the resolution of the submission. Each with their own date- To support the filter by date, we will be taking some tradeoffs to optimize the query, but leaving some use cases unsupported. For this, we will always filter by a
date_updatedfield, which will be the same as thedate_createdif the submission is just created, and hasn't had any other updates, and will replace thedate_resolvedfield when the submission is approved or rejected. - So, we will update the
date_resolvedfield to bedate_updatedin theCommunityLibrarySubmissionmodel, which will be set to the timestamp of each update made on the submission. Look for all references todate_resolvedand update them accordingly. Add an index to this field. - Add new date filters:
date_updated__lteanddate_updated__gte. (For this, we will need to create a new filterset class, which would include thechannelfield too).
- To support the filter by date, we will be taking some tradeoffs to optimize the query, but leaving some use cases unsupported. For this, we will always filter by a
- Add a SearchFilter backend, and set the search fields to use the channel name. So users will be able to search by channel name.
- Add a
status__inmulti choice filter to filter by multiple submission statuses.- Also, add an index in the
statusfield on the Django model.
- Also, add an index in the
- Since now the editor will be able to see the admin name, move the resolved_by* fields logic to the
CommunityLibrarySubmissionViewSetMixinclass, so that it is shared between the admins and editors. - Update the pagination ordering field and the queryset ordering field to be
-date_updatedinstead.
Acceptance criteria
- New
date_updatedfield is created, replacing thedate_resolvedand the default ordering fields. - Frontend is now able to filter by
date_updateddate range,status__in,searchfilters. - Db indexes have been added to the
date_updatedandstatusfields. - Tests are added/updated according to the new specs.
Metadata
Metadata
Assignees
Labels
No labels
