From ec41ae61b4d1c0c1d133ce399e2e0a4ebc5cf526 Mon Sep 17 00:00:00 2001 From: Bavisetti Narayan <72156168+NarayanBavisetti@users.noreply.github.com> Date: Wed, 18 Dec 2024 14:54:03 +0530 Subject: [PATCH 1/2] chore: removed the deleted votes and reaction (#6218) --- apiserver/plane/space/utils/grouper.py | 6 ++++-- apiserver/plane/space/views/issue.py | 14 ++++++++++++-- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/apiserver/plane/space/utils/grouper.py b/apiserver/plane/space/utils/grouper.py index 250b54e891..2740588422 100644 --- a/apiserver/plane/space/utils/grouper.py +++ b/apiserver/plane/space/utils/grouper.py @@ -91,6 +91,7 @@ def issue_on_results(issues, group_by, sub_group_by): Case( When( votes__isnull=False, + votes__deleted_at__isnull=True, then=JSONObject( vote=F("votes__vote"), actor_details=JSONObject( @@ -117,13 +118,14 @@ def issue_on_results(issues, group_by, sub_group_by): default=None, output_field=JSONField(), ), - filter=Q(votes__isnull=False), + filter=Q(votes__isnull=False,votes__deleted_at__isnull=True), distinct=True, ), reaction_items=ArrayAgg( Case( When( issue_reactions__isnull=False, + issue_reactions__deleted_at__isnull=True, then=JSONObject( reaction=F("issue_reactions__reaction"), actor_details=JSONObject( @@ -150,7 +152,7 @@ def issue_on_results(issues, group_by, sub_group_by): default=None, output_field=JSONField(), ), - filter=Q(issue_reactions__isnull=False), + filter=Q(issue_reactions__isnull=False, issue_reactions__deleted_at__isnull=True), distinct=True, ), ).values(*required_fields, "vote_items", "reaction_items") diff --git a/apiserver/plane/space/views/issue.py b/apiserver/plane/space/views/issue.py index a1ab332f91..699253ae52 100644 --- a/apiserver/plane/space/views/issue.py +++ b/apiserver/plane/space/views/issue.py @@ -701,6 +701,7 @@ class IssueRetrievePublicEndpoint(BaseAPIView): Case( When( votes__isnull=False, + votes__deleted_at__isnull=True, then=JSONObject( vote=F("votes__vote"), actor_details=JSONObject( @@ -732,7 +733,11 @@ class IssueRetrievePublicEndpoint(BaseAPIView): output_field=JSONField(), ), filter=Case( - When(votes__isnull=False, then=True), + When( + votes__isnull=False, + votes__deleted_at__isnull=True, + then=True, + ), default=False, output_field=JSONField(), ), @@ -742,6 +747,7 @@ class IssueRetrievePublicEndpoint(BaseAPIView): Case( When( issue_reactions__isnull=False, + issue_reactions__deleted_at__isnull=True, then=JSONObject( reaction=F("issue_reactions__reaction"), actor_details=JSONObject( @@ -775,7 +781,11 @@ class IssueRetrievePublicEndpoint(BaseAPIView): output_field=JSONField(), ), filter=Case( - When(issue_reactions__isnull=False, then=True), + When( + issue_reactions__isnull=False, + issue_reactions__deleted_at__isnull=True, + then=True, + ), default=False, output_field=JSONField(), ), From 881c744eb9fd48bc53bc16bbe76d62edcd064e8f Mon Sep 17 00:00:00 2001 From: sriram veeraghanta Date: Wed, 18 Dec 2024 14:57:59 +0530 Subject: [PATCH 2/2] fix: build errors --- web/ce/types/projects/index.ts | 1 + web/ce/types/projects/project-activity.ts | 25 +++++++++++++++++++++++ web/core/local-db/utils/utils.ts | 2 +- 3 files changed, 27 insertions(+), 1 deletion(-) create mode 100644 web/ce/types/projects/project-activity.ts diff --git a/web/ce/types/projects/index.ts b/web/ce/types/projects/index.ts index 244d8c4df3..9fb35777a3 100644 --- a/web/ce/types/projects/index.ts +++ b/web/ce/types/projects/index.ts @@ -1 +1,2 @@ export * from "./projects"; +export * from "./project-activity"; diff --git a/web/ce/types/projects/project-activity.ts b/web/ce/types/projects/project-activity.ts new file mode 100644 index 0000000000..ed75a6b9c8 --- /dev/null +++ b/web/ce/types/projects/project-activity.ts @@ -0,0 +1,25 @@ +export interface TProjectActivity { + id: string; + content: string; + createdAt: string; + updatedAt: string; + userId: string; + projectId: string; + created_at: string; + field: string; + verb: string; + actor_detail: { + display_name: string; + id: string; + }; + workspace_detail: { + slug: string; + }; + project_detail: { + name: string; + }; + new_value: string; + old_value: string; + project: string; + new_identifier?: string; +} diff --git a/web/core/local-db/utils/utils.ts b/web/core/local-db/utils/utils.ts index 6cd5f3033c..b0330e057a 100644 --- a/web/core/local-db/utils/utils.ts +++ b/web/core/local-db/utils/utils.ts @@ -174,7 +174,7 @@ export const clearOPFS = async (force = false) => { return; } // ts-ignore - for await (const entry of root.values()) { + for await (const entry of (root as any)?.values()) { if (entry.kind === "directory" && entry.name.startsWith(".ahp-")) { // A lock with the same name as the directory protects it from // being deleted.