From ad8a011bb9ff7938e787c3024ac5d93b5f4bd446 Mon Sep 17 00:00:00 2001 From: Dakshesh Jain <65905942+dakshesh14@users.noreply.github.com> Date: Mon, 11 Sep 2023 11:44:16 +0530 Subject: [PATCH] fix: issue activity (#2127) --- web/components/web-view/activity-message.tsx | 419 ++++++++++++++++++ web/components/web-view/index.ts | 1 + web/components/web-view/issue-activity.tsx | 21 +- .../web-view/issue-web-view-form.tsx | 2 +- web/components/web-view/web-view-modal.tsx | 2 +- web/layouts/web-view-layout/index.tsx | 5 +- 6 files changed, 435 insertions(+), 15 deletions(-) create mode 100644 web/components/web-view/activity-message.tsx diff --git a/web/components/web-view/activity-message.tsx b/web/components/web-view/activity-message.tsx new file mode 100644 index 000000000..956dfb904 --- /dev/null +++ b/web/components/web-view/activity-message.tsx @@ -0,0 +1,419 @@ +import { useRouter } from "next/router"; + +// icons +import { Icon, Tooltip } from "components/ui"; +import { Squares2X2Icon } from "@heroicons/react/24/outline"; +import { BlockedIcon, BlockerIcon } from "components/icons"; +// helpers +import { renderShortDateWithYearFormat } from "helpers/date-time.helper"; +import { capitalizeFirstLetter } from "helpers/string.helper"; +// types +import { IIssueActivity } from "types"; + +const IssueLink = ({ activity }: { activity: IIssueActivity }) => ( + + + +); + +const UserLink = ({ activity }: { activity: IIssueActivity }) => ( + +); + +const activityDetails: { + [key: string]: { + message: ( + activity: IIssueActivity, + showIssue: boolean, + workspaceSlug: string + ) => React.ReactNode; + icon: React.ReactNode; + }; +} = { + assignees: { + message: (activity, showIssue) => ( + <> + {activity.old_value === "" ? "added a new assignee " : "removed the assignee "} + + {showIssue && ( + <> + {" "} + to + + )} + . + + ), + icon: