
❌ 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
CommunityLibrarySubmissionViewset endpoint.
- The main problem of using this viewset is that we will use the
CommunityLibrarySubmission model, 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_updated field, which will be the same as the date_created if the submission is just created, and hasn't had any other updates, and will replace the date_resolved field when the submission is approved or rejected.
- So, we will update the
date_resolved field to be date_updated in the CommunityLibrarySubmission model, which will be set to the timestamp of each update made on the submission. Look for all references to date_resolved and update them accordingly. Add an index to this field.
- Add new date filters:
date_updated__lte and date_updated__gte. (For this, we will need to create a new filterset class, which would include the channel field too).
- 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__in multi choice filter to filter by multiple submission statuses.
- Also, add an index in the
status field on the Django model.
- Since now the editor will be able to see the admin name, move the resolved_by* fields logic to the
CommunityLibrarySubmissionViewSetMixin class, so that it is shared between the admins and editors.
- Update the pagination ordering field and the queryset ordering field to be
-date_updated instead.
Acceptance criteria
❌ 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
CommunityLibrarySubmissionViewsetendpoint.CommunityLibrarySubmissionmodel, which stores both "events": the creation and the resolution of the submission. Each with their own datedate_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.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.date_updated__lteanddate_updated__gte. (For this, we will need to create a new filterset class, which would include thechannelfield too).status__inmulti choice filter to filter by multiple submission statuses.statusfield on the Django model.CommunityLibrarySubmissionViewSetMixinclass, so that it is shared between the admins and editors.-date_updatedinstead.Acceptance criteria
date_updatedfield is created, replacing thedate_resolvedand the default ordering fields.date_updateddate range,status__in,searchfilters.date_updatedandstatusfields.