forked from github/plane
fix: default analytic estimate points and sorting for custom analytics (#1066)
This commit is contained in:
parent
ab695a309f
commit
27626fb16f
@ -261,11 +261,13 @@ class DefaultAnalyticsEndpoint(BaseAPIView):
|
|||||||
)
|
)
|
||||||
|
|
||||||
open_estimate_sum = (
|
open_estimate_sum = (
|
||||||
Issue.objects.filter(
|
queryset.filter(
|
||||||
state__group__in=["backlog", "unstarted", "started"]
|
state__group__in=["backlog", "unstarted", "started"]
|
||||||
).aggregate(open_estimate_sum=Sum("estimate_point"))
|
).aggregate(open_estimate_sum=Sum("estimate_point"))
|
||||||
)["open_estimate_sum"]
|
)["open_estimate_sum"]
|
||||||
total_estimate_sum = Issue.objects.aggregate(
|
print(open_estimate_sum)
|
||||||
|
|
||||||
|
total_estimate_sum = queryset.aggregate(
|
||||||
total_estimate_sum=Sum("estimate_point")
|
total_estimate_sum=Sum("estimate_point")
|
||||||
)["total_estimate_sum"]
|
)["total_estimate_sum"]
|
||||||
|
|
||||||
|
@ -72,5 +72,5 @@ def build_graph_plot(queryset, x_axis, y_axis, segment=None):
|
|||||||
order = ["low", "medium", "high", "urgent", "None"]
|
order = ["low", "medium", "high", "urgent", "None"]
|
||||||
sorted_data = {key: grouped_data[key] for key in order if key in grouped_data}
|
sorted_data = {key: grouped_data[key] for key in order if key in grouped_data}
|
||||||
else:
|
else:
|
||||||
sorted_data = dict(sorted(grouped_data.items(), key=lambda x: (x[0] is "None", x[0])))
|
sorted_data = dict(sorted(grouped_data.items(), key=lambda x: (x[0] == "None", x[0])))
|
||||||
return sorted_data
|
return sorted_data
|
||||||
|
Loading…
Reference in New Issue
Block a user