Skip to content

Commit

Permalink
fix: dashboard completed issues count (#6422)
Browse files Browse the repository at this point in the history
  • Loading branch information
NarayanBavisetti authored Jan 17, 2025
1 parent 62dd808 commit 26a9b7f
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 6 deletions.
5 changes: 4 additions & 1 deletion apiserver/plane/app/views/dashboard/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,10 +133,13 @@ def dashboard_overview_stats(self, request, slug):

completed_issues_count = (
Issue.issue_objects.filter(
(
Q(assignees__in=[request.user])
& Q(issue_assignee__deleted_at__isnull=True)
),
workspace__slug=slug,
project__project_projectmember__is_active=True,
project__project_projectmember__member=request.user,
assignees__in=[request.user],
state__group="completed",
)
.filter(
Expand Down
25 changes: 20 additions & 5 deletions apiserver/plane/app/views/workspace/user.py
Original file line number Diff line number Diff line change
Expand Up @@ -375,8 +375,11 @@ def get(self, request, slug, user_id):

state_distribution = (
Issue.issue_objects.filter(
(
Q(assignees__in=[user_id])
& Q(issue_assignee__deleted_at__isnull=True)
),
workspace__slug=slug,
assignees__in=[user_id],
project__project_projectmember__member=request.user,
project__project_projectmember__is_active=True,
)
Expand All @@ -391,8 +394,11 @@ def get(self, request, slug, user_id):

priority_distribution = (
Issue.issue_objects.filter(
(
Q(assignees__in=[user_id])
& Q(issue_assignee__deleted_at__isnull=True)
),
workspace__slug=slug,
assignees__in=[user_id],
project__project_projectmember__member=request.user,
project__project_projectmember__is_active=True,
)
Expand Down Expand Up @@ -426,8 +432,11 @@ def get(self, request, slug, user_id):

assigned_issues_count = (
Issue.issue_objects.filter(
(
Q(assignees__in=[user_id])
& Q(issue_assignee__deleted_at__isnull=True)
),
workspace__slug=slug,
assignees__in=[user_id],
project__project_projectmember__member=request.user,
project__project_projectmember__is_active=True,
)
Expand All @@ -438,8 +447,11 @@ def get(self, request, slug, user_id):
pending_issues_count = (
Issue.issue_objects.filter(
~Q(state__group__in=["completed", "cancelled"]),
(
Q(assignees__in=[user_id])
& Q(issue_assignee__deleted_at__isnull=True)
),
workspace__slug=slug,
assignees__in=[user_id],
project__project_projectmember__member=request.user,
project__project_projectmember__is_active=True,
)
Expand All @@ -449,8 +461,11 @@ def get(self, request, slug, user_id):

completed_issues_count = (
Issue.issue_objects.filter(
(
Q(assignees__in=[user_id])
& Q(issue_assignee__deleted_at__isnull=True)
),
workspace__slug=slug,
assignees__in=[user_id],
state__group="completed",
project__project_projectmember__member=request.user,
project__project_projectmember__is_active=True,
Expand Down

0 comments on commit 26a9b7f

Please sign in to comment.