From 61b9e7a161257b3096b0d9ebefd867baf4a9ce39 Mon Sep 17 00:00:00 2001
From: Anmol Singh Bhatia <121005188+anmolsinghbhatia@users.noreply.github.com>
Date: Tue, 11 Apr 2023 18:14:36 +0530
Subject: [PATCH] feat: issue activity logs (#782)
* feat: attachment, link and estimate activity log added in issue detail page
* feat: attachment, link and estimate activity log added in profile activity section
---
apps/app/components/core/feeds.tsx | 32 ++++++++++++++++++++++++-
apps/app/components/issues/activity.tsx | 32 ++++++++++++++++++++++++-
2 files changed, 62 insertions(+), 2 deletions(-)
diff --git a/apps/app/components/core/feeds.tsx b/apps/app/components/core/feeds.tsx
index f30c8e5d4..1a8e6ca24 100644
--- a/apps/app/components/core/feeds.tsx
+++ b/apps/app/components/core/feeds.tsx
@@ -8,6 +8,9 @@ import {
ChartBarIcon,
ChatBubbleBottomCenterTextIcon,
ChatBubbleLeftEllipsisIcon,
+ LinkIcon,
+ PaperClipIcon,
+ PlayIcon,
RectangleGroupIcon,
Squares2X2Icon,
TrashIcon,
@@ -82,6 +85,18 @@ const activityDetails: {
message: "deleted the issue.",
icon: ,
},
+ estimate: {
+ message: "updated the estimate",
+ icon: ,
+ },
+ link: {
+ message: "updated the link",
+ icon: ,
+ },
+ attachment: {
+ message: "updated the attachment",
+ icon: ,
+ },
};
export const Feeds: React.FC = ({ activities }) => (
@@ -117,13 +132,22 @@ export const Feeds: React.FC = ({ activities }) => (
: "removed the priority";
} else if (activity.field === "description") {
action = "updated the";
+ } else if (activity.field === "attachment") {
+ action = `${activity.verb} the`;
+ } else if (activity.field === "link") {
+ action = `${activity.verb} the`;
+ } else if (activity.field === "estimate") {
+ action = "updated the";
}
// for values that are after the action clause
let value: any = activity.new_value ? activity.new_value : activity.old_value;
if (
activity.verb === "created" &&
activity.field !== "cycles" &&
- activity.field !== "modules"
+ activity.field !== "modules" &&
+ activity.field !== "attachment" &&
+ activity.field !== "link" &&
+ activity.field !== "estimate"
) {
const { workspace_detail, project, issue } = activity;
value = (
@@ -160,6 +184,12 @@ export const Feeds: React.FC = ({ activities }) => (
value = renderShortNumericDateFormat(date as string);
} else if (activity.field === "description") {
value = "description";
+ } else if (activity.field === "attachment") {
+ value = "attachment";
+ } else if (activity.field === "link") {
+ value = "link";
+ } else if (activity.field === "estimate") {
+ value = "estimate";
}
if (activity.field === "comment") {
diff --git a/apps/app/components/issues/activity.tsx b/apps/app/components/issues/activity.tsx
index 1d8f66e09..f06ec625a 100644
--- a/apps/app/components/issues/activity.tsx
+++ b/apps/app/components/issues/activity.tsx
@@ -8,6 +8,9 @@ import {
CalendarDaysIcon,
ChartBarIcon,
ChatBubbleBottomCenterTextIcon,
+ LinkIcon,
+ PaperClipIcon,
+ PlayIcon,
RectangleGroupIcon,
Squares2X2Icon,
UserIcon,
@@ -84,6 +87,18 @@ const activityDetails: {
message: "set the parent to",
icon: ,
},
+ estimate: {
+ message: "updated the estimate",
+ icon: ,
+ },
+ link: {
+ message: "updated the link",
+ icon: ,
+ },
+ attachment: {
+ message: "updated the attachment",
+ icon: ,
+ },
};
type Props = {};
@@ -204,13 +219,22 @@ export const IssueActivitySection: React.FC = () => {
: "removed the priority";
} else if (activityItem.field === "description") {
action = "updated the";
+ } else if (activityItem.field === "attachment") {
+ action = `${activityItem.verb} the`;
+ } else if (activityItem.field === "link") {
+ action = `${activityItem.verb} the`;
+ } else if (activityItem.field === "estimate") {
+ action = "updated the";
}
// for values that are after the action clause
let value: any = activityItem.new_value ? activityItem.new_value : activityItem.old_value;
if (
activityItem.verb === "created" &&
activityItem.field !== "cycles" &&
- activityItem.field !== "modules"
+ activityItem.field !== "modules" &&
+ activityItem.field !== "attachment" &&
+ activityItem.field !== "link" &&
+ activityItem.field !== "estimate"
) {
value = created this issue.;
} else if (activityItem.field === "state") {
@@ -250,6 +274,12 @@ export const IssueActivitySection: React.FC = () => {
value = renderShortNumericDateFormat(date as string);
} else if (activityItem.field === "description") {
value = "description";
+ } else if (activityItem.field === "attachment") {
+ value = "attachment";
+ } else if (activityItem.field === "link") {
+ value = "link";
+ } else if (activityItem.field === "estimate") {
+ value = "estimate";
}
if ("field" in activityItem && activityItem.field !== "updated_by") {