mirror of
https://github.com/makeplane/plane
synced 2024-06-14 14:31:34 +00:00
fix: issue assignee multiple values (#1056)
* fix: issue assignee multiple values * chore: return first name and last name * dev: keys update and also send data when segmented
This commit is contained in:
parent
d99f85ce05
commit
c49b0d6151
@ -76,17 +76,21 @@ class AnalyticsEndpoint(BaseAPIView):
|
|||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
assignee_avatars = {}
|
assignee_details = {}
|
||||||
if x_axis in ["assignees__email"]:
|
if x_axis in ["assignees__email"] or segment in ["assignees__email"]:
|
||||||
assignee_avatars = Issue.objects.filter(
|
assignee_details = (
|
||||||
workspace__slug=slug, **filters
|
Issue.objects.filter(workspace__slug=slug, **filters, assignees__avatar__isnull=False)
|
||||||
).values("assignees__avatar")
|
.order_by("assignees__id")
|
||||||
|
.distinct("assignees__id")
|
||||||
|
.values("assignees__avatar", "assignees__email", "assignees__first_name", "assignees__last_name")
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
return Response(
|
return Response(
|
||||||
{
|
{
|
||||||
"total": total_issues,
|
"total": total_issues,
|
||||||
"distribution": distribution,
|
"distribution": distribution,
|
||||||
"extras": {"colors": colors, "assignee_avatars": assignee_avatars},
|
"extras": {"colors": colors, "assignee_details": assignee_details},
|
||||||
},
|
},
|
||||||
status=status.HTTP_200_OK,
|
status=status.HTTP_200_OK,
|
||||||
)
|
)
|
||||||
|
Loading…
Reference in New Issue
Block a user