
❌ This issue is not open for contribution. Visit Contributing guidelines to learn about the contributing process and how to find suitable issues.

Overview
As part of this issue, we will adapt our AdminChannelViewSet to support new fields and filters on the frontend, enabling the display of community library status for each channel and allowing filtering by Community Library-related channels to support #5251.
Technical requirements
For the new requirements, we will need to modify the AdminChannelViewSet to support the following:
- Return the ID and status of the most recent submission for each channel.
- One way to achieve this is to return two new fields in the
values viewset list: last_submission_id and last_submission_status. These fields could be annotated in the get_queryset method here with the help of a Common Table Expression (CTE) or a Subquery.
- Add a new boolean filter
community_library_needs_review that will filter for channels whose most recent Community Library submissions are either PENDING or REJECTED.
- We can use the
last_submission_status value annotated in the previous step.
- (We can also use a
community_library_status filter that accepts multiple statuses, and then in the frontend send the related statuses)
- Add a new boolean filter
community_library_live that will filter for channels that have at least one related Community Library Submission with status="LIVE".
- Add a new boolean filter
has_community_library_submission that will filter for channels that have at least one related Community Library Submission. If set to false, it will show channels that don't have any related community library submissions.
- Add relevant unit tests to the Channel viewset CRUDTestCase.
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
As part of this issue, we will adapt our AdminChannelViewSet to support new fields and filters on the frontend, enabling the display of community library status for each channel and allowing filtering by Community Library-related channels to support #5251.
Technical requirements
For the new requirements, we will need to modify the
AdminChannelViewSetto support the following:valuesviewset list:last_submission_idandlast_submission_status. These fields could be annotated in theget_querysetmethod here with the help of a Common Table Expression (CTE) or a Subquery.community_library_needs_reviewthat will filter for channels whose most recent Community Library submissions are eitherPENDINGorREJECTED.last_submission_statusvalue annotated in the previous step.community_library_statusfilter that accepts multiple statuses, and then in the frontend send the related statuses)community_library_livethat will filter for channels that have at least one related Community Library Submission withstatus="LIVE".has_community_library_submissionthat will filter for channels that have at least one related Community Library Submission. If set to false, it will show channels that don't have any related community library submissions.Acceptance criteria
AdminChannelViewSet.needs_review,live, andhas_community_library_submissionhave been added.