mirror of
https://github.com/makeplane/plane
synced 2024-06-14 14:31:34 +00:00
Merge branch 'feat/pagination' of github.com:makeplane/plane into feat/pagination
This commit is contained in:
commit
e3b5b5d65b
@ -819,7 +819,11 @@ class CycleIssueViewSet(WebhookMixin, BaseViewSet):
|
|||||||
# group and sub group pagination
|
# group and sub group pagination
|
||||||
return self.paginate(
|
return self.paginate(
|
||||||
request=request,
|
request=request,
|
||||||
order_by=order_by_param,
|
order_by=(
|
||||||
|
"priority_order"
|
||||||
|
if order_by_param in ["priority", "-priority"]
|
||||||
|
else order_by_param
|
||||||
|
),
|
||||||
queryset=issue_queryset,
|
queryset=issue_queryset,
|
||||||
on_results=lambda issues: issue_on_results(
|
on_results=lambda issues: issue_on_results(
|
||||||
group_by=group_by,
|
group_by=group_by,
|
||||||
@ -855,7 +859,11 @@ class CycleIssueViewSet(WebhookMixin, BaseViewSet):
|
|||||||
# Group paginate
|
# Group paginate
|
||||||
return self.paginate(
|
return self.paginate(
|
||||||
request=request,
|
request=request,
|
||||||
order_by=order_by_param,
|
order_by=(
|
||||||
|
"priority_order"
|
||||||
|
if order_by_param in ["priority", "-priority"]
|
||||||
|
else order_by_param
|
||||||
|
),
|
||||||
queryset=issue_queryset,
|
queryset=issue_queryset,
|
||||||
on_results=lambda issues: issue_on_results(
|
on_results=lambda issues: issue_on_results(
|
||||||
group_by=group_by,
|
group_by=group_by,
|
||||||
|
@ -142,7 +142,11 @@ class IssueArchiveViewSet(BaseViewSet):
|
|||||||
# group and sub group pagination
|
# group and sub group pagination
|
||||||
return self.paginate(
|
return self.paginate(
|
||||||
request=request,
|
request=request,
|
||||||
order_by=order_by_param,
|
order_by=(
|
||||||
|
"priority_order"
|
||||||
|
if order_by_param in ["priority", "-priority"]
|
||||||
|
else order_by_param
|
||||||
|
),
|
||||||
queryset=issue_queryset,
|
queryset=issue_queryset,
|
||||||
on_results=lambda issues: issue_on_results(
|
on_results=lambda issues: issue_on_results(
|
||||||
group_by=group_by,
|
group_by=group_by,
|
||||||
@ -178,7 +182,11 @@ class IssueArchiveViewSet(BaseViewSet):
|
|||||||
# Group paginate
|
# Group paginate
|
||||||
return self.paginate(
|
return self.paginate(
|
||||||
request=request,
|
request=request,
|
||||||
order_by=order_by_param,
|
order_by=(
|
||||||
|
"priority_order"
|
||||||
|
if order_by_param in ["priority", "-priority"]
|
||||||
|
else order_by_param
|
||||||
|
),
|
||||||
queryset=issue_queryset,
|
queryset=issue_queryset,
|
||||||
on_results=lambda issues: issue_on_results(
|
on_results=lambda issues: issue_on_results(
|
||||||
group_by=group_by,
|
group_by=group_by,
|
||||||
|
@ -142,7 +142,11 @@ class IssueListEndpoint(BaseAPIView):
|
|||||||
# group and sub group pagination
|
# group and sub group pagination
|
||||||
return self.paginate(
|
return self.paginate(
|
||||||
request=request,
|
request=request,
|
||||||
order_by=order_by_param,
|
order_by=(
|
||||||
|
"priority_order"
|
||||||
|
if order_by_param in ["priority", "-priority"]
|
||||||
|
else order_by_param
|
||||||
|
),
|
||||||
queryset=issue_queryset,
|
queryset=issue_queryset,
|
||||||
on_results=lambda issues: issue_on_results(
|
on_results=lambda issues: issue_on_results(
|
||||||
group_by=group_by,
|
group_by=group_by,
|
||||||
@ -178,7 +182,11 @@ class IssueListEndpoint(BaseAPIView):
|
|||||||
# Group paginate
|
# Group paginate
|
||||||
return self.paginate(
|
return self.paginate(
|
||||||
request=request,
|
request=request,
|
||||||
order_by=order_by_param,
|
order_by=(
|
||||||
|
"priority_order"
|
||||||
|
if order_by_param in ["priority", "-priority"]
|
||||||
|
else order_by_param
|
||||||
|
),
|
||||||
queryset=issue_queryset,
|
queryset=issue_queryset,
|
||||||
on_results=lambda issues: issue_on_results(
|
on_results=lambda issues: issue_on_results(
|
||||||
group_by=group_by,
|
group_by=group_by,
|
||||||
@ -308,7 +316,11 @@ class IssueViewSet(WebhookMixin, BaseViewSet):
|
|||||||
else:
|
else:
|
||||||
return self.paginate(
|
return self.paginate(
|
||||||
request=request,
|
request=request,
|
||||||
order_by=order_by_param,
|
order_by=(
|
||||||
|
"priority_order"
|
||||||
|
if order_by_param in ["priority", "-priority"]
|
||||||
|
else order_by_param
|
||||||
|
),
|
||||||
queryset=issue_queryset,
|
queryset=issue_queryset,
|
||||||
on_results=lambda issues: issue_on_results(
|
on_results=lambda issues: issue_on_results(
|
||||||
group_by=group_by,
|
group_by=group_by,
|
||||||
@ -343,7 +355,11 @@ class IssueViewSet(WebhookMixin, BaseViewSet):
|
|||||||
# Group paginate
|
# Group paginate
|
||||||
return self.paginate(
|
return self.paginate(
|
||||||
request=request,
|
request=request,
|
||||||
order_by=order_by_param,
|
order_by=(
|
||||||
|
"priority_order"
|
||||||
|
if order_by_param in ["priority", "-priority"]
|
||||||
|
else order_by_param
|
||||||
|
),
|
||||||
queryset=issue_queryset,
|
queryset=issue_queryset,
|
||||||
on_results=lambda issues: issue_on_results(
|
on_results=lambda issues: issue_on_results(
|
||||||
group_by=group_by,
|
group_by=group_by,
|
||||||
|
@ -129,7 +129,11 @@ class IssueDraftViewSet(BaseViewSet):
|
|||||||
# group and sub group pagination
|
# group and sub group pagination
|
||||||
return self.paginate(
|
return self.paginate(
|
||||||
request=request,
|
request=request,
|
||||||
order_by=order_by_param,
|
order_by=(
|
||||||
|
"priority_order"
|
||||||
|
if order_by_param in ["priority", "-priority"]
|
||||||
|
else order_by_param
|
||||||
|
),
|
||||||
queryset=issue_queryset,
|
queryset=issue_queryset,
|
||||||
on_results=lambda issues: issue_on_results(
|
on_results=lambda issues: issue_on_results(
|
||||||
group_by=group_by,
|
group_by=group_by,
|
||||||
@ -165,7 +169,11 @@ class IssueDraftViewSet(BaseViewSet):
|
|||||||
# Group paginate
|
# Group paginate
|
||||||
return self.paginate(
|
return self.paginate(
|
||||||
request=request,
|
request=request,
|
||||||
order_by=order_by_param,
|
order_by=(
|
||||||
|
"priority_order"
|
||||||
|
if order_by_param in ["priority", "-priority"]
|
||||||
|
else order_by_param
|
||||||
|
),
|
||||||
queryset=issue_queryset,
|
queryset=issue_queryset,
|
||||||
on_results=lambda issues: issue_on_results(
|
on_results=lambda issues: issue_on_results(
|
||||||
group_by=group_by,
|
group_by=group_by,
|
||||||
|
@ -543,7 +543,11 @@ class ModuleIssueViewSet(WebhookMixin, BaseViewSet):
|
|||||||
# group and sub group pagination
|
# group and sub group pagination
|
||||||
return self.paginate(
|
return self.paginate(
|
||||||
request=request,
|
request=request,
|
||||||
order_by=order_by_param,
|
order_by=(
|
||||||
|
"priority_order"
|
||||||
|
if order_by_param in ["priority", "-priority"]
|
||||||
|
else order_by_param
|
||||||
|
),
|
||||||
queryset=issue_queryset,
|
queryset=issue_queryset,
|
||||||
on_results=lambda issues: issue_on_results(
|
on_results=lambda issues: issue_on_results(
|
||||||
group_by=group_by,
|
group_by=group_by,
|
||||||
@ -579,7 +583,11 @@ class ModuleIssueViewSet(WebhookMixin, BaseViewSet):
|
|||||||
# Group paginate
|
# Group paginate
|
||||||
return self.paginate(
|
return self.paginate(
|
||||||
request=request,
|
request=request,
|
||||||
order_by=order_by_param,
|
order_by=(
|
||||||
|
"priority_order"
|
||||||
|
if order_by_param in ["priority", "-priority"]
|
||||||
|
else order_by_param
|
||||||
|
),
|
||||||
queryset=issue_queryset,
|
queryset=issue_queryset,
|
||||||
on_results=lambda issues: issue_on_results(
|
on_results=lambda issues: issue_on_results(
|
||||||
group_by=group_by,
|
group_by=group_by,
|
||||||
|
@ -188,7 +188,11 @@ class GlobalViewIssuesViewSet(BaseViewSet):
|
|||||||
# group and sub group pagination
|
# group and sub group pagination
|
||||||
return self.paginate(
|
return self.paginate(
|
||||||
request=request,
|
request=request,
|
||||||
order_by=order_by_param,
|
order_by=(
|
||||||
|
"priority_order"
|
||||||
|
if order_by_param in ["priority", "-priority"]
|
||||||
|
else order_by_param
|
||||||
|
),
|
||||||
queryset=issue_queryset,
|
queryset=issue_queryset,
|
||||||
on_results=lambda issues: issue_on_results(
|
on_results=lambda issues: issue_on_results(
|
||||||
group_by=group_by,
|
group_by=group_by,
|
||||||
@ -224,7 +228,11 @@ class GlobalViewIssuesViewSet(BaseViewSet):
|
|||||||
# Group paginate
|
# Group paginate
|
||||||
return self.paginate(
|
return self.paginate(
|
||||||
request=request,
|
request=request,
|
||||||
order_by=order_by_param,
|
order_by=(
|
||||||
|
"priority_order"
|
||||||
|
if order_by_param in ["priority", "-priority"]
|
||||||
|
else order_by_param
|
||||||
|
),
|
||||||
queryset=issue_queryset,
|
queryset=issue_queryset,
|
||||||
on_results=lambda issues: issue_on_results(
|
on_results=lambda issues: issue_on_results(
|
||||||
group_by=group_by,
|
group_by=group_by,
|
||||||
|
@ -592,7 +592,11 @@ class ProjectIssuesPublicEndpoint(BaseAPIView):
|
|||||||
# group and sub group pagination
|
# group and sub group pagination
|
||||||
return self.paginate(
|
return self.paginate(
|
||||||
request=request,
|
request=request,
|
||||||
order_by=order_by_param,
|
order_by=(
|
||||||
|
"priority_order"
|
||||||
|
if order_by_param in ["priority", "-priority"]
|
||||||
|
else order_by_param
|
||||||
|
),
|
||||||
queryset=issue_queryset,
|
queryset=issue_queryset,
|
||||||
on_results=lambda issues: issue_on_results(
|
on_results=lambda issues: issue_on_results(
|
||||||
group_by=group_by,
|
group_by=group_by,
|
||||||
@ -628,7 +632,11 @@ class ProjectIssuesPublicEndpoint(BaseAPIView):
|
|||||||
# Group paginate
|
# Group paginate
|
||||||
return self.paginate(
|
return self.paginate(
|
||||||
request=request,
|
request=request,
|
||||||
order_by=order_by_param,
|
order_by=(
|
||||||
|
"priority_order"
|
||||||
|
if order_by_param in ["priority", "-priority"]
|
||||||
|
else order_by_param
|
||||||
|
),
|
||||||
queryset=issue_queryset,
|
queryset=issue_queryset,
|
||||||
on_results=lambda issues: issue_on_results(
|
on_results=lambda issues: issue_on_results(
|
||||||
group_by=group_by,
|
group_by=group_by,
|
||||||
|
@ -26,8 +26,8 @@ def issue_queryset_grouper(queryset, group_by, sub_group_by):
|
|||||||
}
|
}
|
||||||
|
|
||||||
annotations_map = {
|
annotations_map = {
|
||||||
"label_ids": ("assignees__id", ~Q(assignees__id__isnull=True)),
|
"assignee_ids": ("assignees__id", ~Q(assignees__id__isnull=True)),
|
||||||
"assignee_ids": ("labels__id", ~Q(labels__id__isnull=True)),
|
"label_ids": ("labels__id", ~Q(labels__id__isnull=True)),
|
||||||
"module_ids": (
|
"module_ids": (
|
||||||
"issue_module__module_id",
|
"issue_module__module_id",
|
||||||
~Q(issue_module__module_id__isnull=True),
|
~Q(issue_module__module_id__isnull=True),
|
||||||
|
Loading…
Reference in New Issue
Block a user