From 880bc00666a3a1cc5b6dd242949fb15eb97a687c Mon Sep 17 00:00:00 2001 From: pablohashescobar Date: Thu, 29 Feb 2024 13:10:18 +0530 Subject: [PATCH] dev: ungrouped list --- apiserver/plane/app/views/cycle.py | 6 +++--- apiserver/plane/app/views/issue.py | 29 +++++++++++++++------------- apiserver/plane/app/views/module.py | 6 +++--- apiserver/plane/space/views/issue.py | 6 +++--- 4 files changed, 25 insertions(+), 22 deletions(-) diff --git a/apiserver/plane/app/views/cycle.py b/apiserver/plane/app/views/cycle.py index 70195dab1..0c85d4fd5 100644 --- a/apiserver/plane/app/views/cycle.py +++ b/apiserver/plane/app/views/cycle.py @@ -757,6 +757,9 @@ class CycleIssueViewSet(WebhookMixin, BaseViewSet): # Group by group_by = request.GET.get("group_by", False) + issue_queryset = issue_queryset_grouper( + queryset=issue_queryset, field=group_by + ) # List Paginate if not group_by: @@ -768,9 +771,6 @@ class CycleIssueViewSet(WebhookMixin, BaseViewSet): ), ) - issue_queryset = issue_queryset_grouper( - queryset=issue_queryset, field=group_by - ) # Group paginate return self.paginate( request=request, diff --git a/apiserver/plane/app/views/issue.py b/apiserver/plane/app/views/issue.py index a25d9ae63..f5e020a08 100644 --- a/apiserver/plane/app/views/issue.py +++ b/apiserver/plane/app/views/issue.py @@ -145,6 +145,9 @@ class IssueListEndpoint(BaseAPIView): # Group by group_by = request.GET.get("group_by", False) + issue_queryset = issue_queryset_grouper( + queryset=issue_queryset, field=group_by + ) # List Paginate if not group_by: @@ -156,9 +159,6 @@ class IssueListEndpoint(BaseAPIView): ), ) - issue_queryset = issue_queryset_grouper( - queryset=issue_queryset, field=group_by - ) # Group paginate return self.paginate( request=request, @@ -252,6 +252,11 @@ class IssueViewSet(WebhookMixin, BaseViewSet): # Group by group_by = request.GET.get("group_by", False) + + # issue queryset + issue_queryset = issue_queryset_grouper( + queryset=issue_queryset, field=group_by + ) # List Paginate if not group_by: @@ -263,9 +268,6 @@ class IssueViewSet(WebhookMixin, BaseViewSet): ), ) - issue_queryset = issue_queryset_grouper( - queryset=issue_queryset, field=group_by - ) # Group paginate return self.paginate( request=request, @@ -1091,7 +1093,6 @@ class IssueLinkViewSet(BaseViewSet): issue_link.delete() return Response(status=status.HTTP_204_NO_CONTENT) - class BulkCreateIssueLabelsEndpoint(BaseAPIView): def post(self, request, slug, project_id): label_data = request.data.get("label_data", []) @@ -1243,6 +1244,10 @@ class IssueArchiveViewSet(BaseViewSet): # Group by group_by = request.GET.get("group_by", False) + issue_queryset = issue_queryset_grouper( + queryset=issue_queryset, field=group_by + ) + # List Paginate if not group_by: return self.paginate( @@ -1253,9 +1258,6 @@ class IssueArchiveViewSet(BaseViewSet): ), ) - issue_queryset = issue_queryset_grouper( - queryset=issue_queryset, field=group_by - ) # Group paginate return self.paginate( request=request, @@ -1869,6 +1871,10 @@ class IssueDraftViewSet(BaseViewSet): # Group by group_by = request.GET.get("group_by", False) + issue_queryset = issue_queryset_grouper( + queryset=issue_queryset, field=group_by + ) + # List Paginate if not group_by: return self.paginate( @@ -1879,9 +1885,6 @@ class IssueDraftViewSet(BaseViewSet): ), ) - issue_queryset = issue_queryset_grouper( - queryset=issue_queryset, field=group_by - ) # Group paginate return self.paginate( request=request, diff --git a/apiserver/plane/app/views/module.py b/apiserver/plane/app/views/module.py index 43f3bcf32..97644bec8 100644 --- a/apiserver/plane/app/views/module.py +++ b/apiserver/plane/app/views/module.py @@ -491,6 +491,9 @@ class ModuleIssueViewSet(WebhookMixin, BaseViewSet): # Group by group_by = request.GET.get("group_by", False) + issue_queryset = issue_queryset_grouper( + queryset=issue_queryset, field=group_by + ) # List Paginate if not group_by: @@ -502,9 +505,6 @@ class ModuleIssueViewSet(WebhookMixin, BaseViewSet): ), ) - issue_queryset = issue_queryset_grouper( - queryset=issue_queryset, field=group_by - ) # Group paginate return self.paginate( request=request, diff --git a/apiserver/plane/space/views/issue.py b/apiserver/plane/space/views/issue.py index f4af50cbb..d58efff8e 100644 --- a/apiserver/plane/space/views/issue.py +++ b/apiserver/plane/space/views/issue.py @@ -569,6 +569,9 @@ class ProjectIssuesPublicEndpoint(BaseAPIView): # Group by group_by = request.GET.get("group_by", False) + issue_queryset = issue_queryset_grouper( + queryset=issue_queryset, field=group_by + ) # List Paginate if not group_by: @@ -580,9 +583,6 @@ class ProjectIssuesPublicEndpoint(BaseAPIView): ), ) - issue_queryset = issue_queryset_grouper( - queryset=issue_queryset, field=group_by - ) # Group paginate return self.paginate( request=request,