Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WEB-2177] fix: handling the archived module ids in the issue list and issue detail endpoints #5343

Merged
merged 1 commit into from
Aug 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion apiserver/plane/app/views/inbox/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,8 @@ def get_queryset(self):
ArrayAgg(
"issue_module__module_id",
distinct=True,
filter=~Q(issue_module__module_id__isnull=True),
filter=~Q(issue_module__module_id__isnull=True)
& Q(issue_module__module__archived_at__isnull=True),
),
Value([], output_field=ArrayField(UUIDField())),
),
Expand Down
5 changes: 2 additions & 3 deletions apiserver/plane/app/views/issue/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@


class IssueListEndpoint(BaseAPIView):

permission_classes = [
ProjectEntityPermission,
]
Expand Down Expand Up @@ -438,7 +437,8 @@ def retrieve(self, request, slug, project_id, pk=None):
ArrayAgg(
"issue_module__module_id",
distinct=True,
filter=~Q(issue_module__module_id__isnull=True),
filter=~Q(issue_module__module_id__isnull=True)
& Q(issue_module__module__archived_at__isnull=True),
),
Value([], output_field=ArrayField(UUIDField())),
),
Expand Down Expand Up @@ -626,7 +626,6 @@ def delete(self, request, slug, project_id):
project_id=project_id,
is_active=True,
).exists():

return Response(
{"error": "Only admin can perform this action"},
status=status.HTTP_403_FORBIDDEN,
Expand Down
3 changes: 2 additions & 1 deletion apiserver/plane/app/views/view/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,8 @@ def get_queryset(self):
ArrayAgg(
"issue_module__module_id",
distinct=True,
filter=~Q(issue_module__module_id__isnull=True),
filter=~Q(issue_module__module_id__isnull=True)
& Q(issue_module__module__archived_at__isnull=True),
),
Value([], output_field=ArrayField(UUIDField())),
),
Expand Down
7 changes: 4 additions & 3 deletions apiserver/plane/utils/grouper.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@


def issue_queryset_grouper(queryset, group_by, sub_group_by):

FIELD_MAPPER = {
"label_ids": "labels__id",
"assignee_ids": "assignees__id",
Expand All @@ -30,7 +29,10 @@ def issue_queryset_grouper(queryset, group_by, sub_group_by):
"label_ids": ("labels__id", ~Q(labels__id__isnull=True)),
"module_ids": (
"issue_module__module_id",
~Q(issue_module__module_id__isnull=True),
(
~Q(issue_module__module_id__isnull=True)
& Q(issue_module__module__archived_at__isnull=True)
),
),
}
default_annotations = {
Expand All @@ -51,7 +53,6 @@ def issue_queryset_grouper(queryset, group_by, sub_group_by):


def issue_on_results(issues, group_by, sub_group_by):

FIELD_MAPPER = {
"labels__id": "label_ids",
"assignees__id": "assignee_ids",
Expand Down
Loading