From f6b92fc953544f1461ba672dc2ae9b4150c0a342 Mon Sep 17 00:00:00 2001
From: Dakshesh Jain <65905942+dakshesh14@users.noreply.github.com>
Date: Tue, 19 Sep 2023 12:58:00 +0530
Subject: [PATCH] fix: activity not coming for blocking/blocked, 'related to'
and duplicate (#2189)
* fix: activity not coming for duplicate, relatesd to and for blocked/blocking
refactor: mutation logic to use relation id instead of issue id
* fix: mutation logic and changed keys to be aligned with api
* fix: build error
---
web/components/core/activity.tsx | 43 ++++++++++++++++++-
.../issues/sidebar-select/blocked.tsx | 8 ++--
.../issues/sidebar-select/blocker.tsx | 9 ++--
.../issues/sidebar-select/duplicate.tsx | 38 ++++++++--------
.../issues/sidebar-select/relates-to.tsx | 38 ++++++++--------
web/components/issues/sidebar.tsx | 38 +++++++---------
web/components/web-view/activity-message.tsx | 35 ++++++++++++++-
.../web-view/issue-properties-detail.tsx | 10 ++---
web/services/issues.service.ts | 1 +
web/types/issues.d.ts | 20 +++------
10 files changed, 142 insertions(+), 98 deletions(-)
diff --git a/web/components/core/activity.tsx b/web/components/core/activity.tsx
index 4a20c15e8..7c2798e7a 100644
--- a/web/components/core/activity.tsx
+++ b/web/components/core/activity.tsx
@@ -2,8 +2,9 @@ import { useRouter } from "next/router";
// icons
import { Icon, Tooltip } from "components/ui";
+import { CopyPlus } from "lucide-react";
import { Squares2X2Icon } from "@heroicons/react/24/outline";
-import { BlockedIcon, BlockerIcon } from "components/icons";
+import { BlockedIcon, BlockerIcon, RelatedIcon } from "components/icons";
// helpers
import { renderShortDateWithYearFormat } from "helpers/date-time.helper";
import { capitalizeFirstLetter } from "helpers/string.helper";
@@ -157,7 +158,7 @@ const activityDetails: {
},
icon: ,
},
- blocks: {
+ blocked_by: {
message: (activity) => {
if (activity.old_value === "")
return (
@@ -176,6 +177,44 @@ const activityDetails: {
},
icon: ,
},
+ duplicate: {
+ message: (activity) => {
+ if (activity.old_value === "")
+ return (
+ <>
+ marked this issue as duplicate of{" "}
+ {activity.new_value}.
+ >
+ );
+ else
+ return (
+ <>
+ removed this issue as a duplicate of{" "}
+ {activity.old_value}.
+ >
+ );
+ },
+ icon: ,
+ },
+ relates_to: {
+ message: (activity) => {
+ if (activity.old_value === "")
+ return (
+ <>
+ marked that this issue relates to{" "}
+ {activity.new_value}.
+ >
+ );
+ else
+ return (
+ <>
+ removed the relation from{" "}
+ {activity.old_value}.
+ >
+ );
+ },
+ icon: ,
+ },
cycles: {
message: (activity, showIssue, workspaceSlug) => {
if (activity.verb === "created")
diff --git a/web/components/issues/sidebar-select/blocked.tsx b/web/components/issues/sidebar-select/blocked.tsx
index 9554a83ba..d7e448377 100644
--- a/web/components/issues/sidebar-select/blocked.tsx
+++ b/web/components/issues/sidebar-select/blocked.tsx
@@ -73,7 +73,7 @@ export const SidebarBlockedSelect: React.FC = ({
...selectedIssues.map((issue) => ({
issue: issueId as string,
relation_type: "blocked_by" as const,
- related_issue_detail: issue.blocked_issue_detail,
+ issue_detail: issue.blocked_issue_detail,
related_issue: issue.blocked_issue_detail.id,
})),
],
@@ -111,17 +111,17 @@ export const SidebarBlockedSelect: React.FC = ({
{blockedByIssue && blockedByIssue.length > 0
? blockedByIssue.map((relation) => (
- {`${relation.related_issue_detail?.project_detail.identifier}-${relation.related_issue_detail?.sequence_id}`}
+ {`${relation.issue_detail?.project_detail.identifier}-${relation.issue_detail?.sequence_id}`}