π₯π₯π₯ Open-source Jira, Linear, Monday, and ClickUp alternative. Plane is a modern project management platform to manage tasks, sprints, docs, and triage.
TypeScript boardsbug-trackerdjangodockerganttissue-trackerjirajira-alternativekanbanlinearpostgresqlproduct-managementproject-managementproject-planningpythonreactredistypesciptvitework-management
[WEB-1034] fix: inbox issue user activity (#4251)
Anmol Singh Bhatia9659da5b315d
diff --git a/web/components/core/activity.tsx b/web/components/core/activity.tsxindex 31a796949c..629e9908d7 100644--- a/web/components/core/activity.tsx+++ b/web/components/core/activity.tsx@@ -17,6 +17,7 @@ import {SignalMediumIcon,MessageSquareIcon,UsersIcon,+ Inbox,} from "lucide-react";import { IIssueActivity } from "@plane/types";import { Tooltip, BlockedIcon, BlockerIcon, RelatedIcon, LayersIcon, DiceIcon } from "@plane/ui";@@ -112,6 +113,40 @@ const EstimatePoint = observer((props: { point: string }) => {);});+const inboxActivityMessage = {+ declined: {+ showIssue: "declined issue",+ noIssue: "declined this issue from inbox.",+ },+ snoozed: {+ showIssue: "snoozed issue",+ noIssue: "snoozed this issue.",+ },+ accepted: {+ showIssue: "accepted issue",+ noIssue: "accepted this issue from inbox.",+ },+ markedDuplicate: {+ showIssue: "declined issue",+ noIssue: "declined this issue from inbox by marking a duplicate issue.",+ },+};++const getInboxUserActivityMessage = (activity: IIssueActivity, showIssue: boolean) => {+ switch (activity.verb) {+ case "-1":+ return showIssue ? inboxActivityMessage.declined.showIssue : inboxActivityMessage.declined.noIssue;+ case "0":+ return showIssue ? inboxActivityMessage.snoozed.showIssue : inboxActivityMessage.snoozed.noIssue;+ case "1":+ return showIssue ? inboxActivityMessage.accepted.showIssue : inboxActivityMessage.accepted.noIssue;+ case "2":+ return showIssue ? inboxActivityMessage.markedDuplicate.showIssue : inboxActivityMessage.markedDuplicate.noIssue;+ default:+ return "updated inbox issue status.";+ }+};+const activityDetails: {[key: string]: {message: (activity: IIssueActivity, showIssue: boolean, workspaceSlug: string) => React.ReactNode;@@ -658,8 +693,7 @@ const activityDetails: {<span className="font-medium text-custom-text-100">{renderFormattedDate(activity.new_value)}</span>{showIssue && (<>- {" "}- for <IssueLink activity={activity} />+ <IssueLink activity={activity} /></>)}</>@@ -667,6 +701,20 @@ const activityDetails: {},icon: <Calendar size={12} color="#6b7280" aria-hidden="true" />,},+ inbox: {+ message: (activity, showIssue) => (+ <>+ {getInboxUserActivityMessage(activity, showIssue)}+ {showIssue && (+ <>+ {" "}+ <IssueLink activity={activity} />+ </>+ )}+ </>+ ),+ icon: <Inbox size={12} color="#6b7280" aria-hidden="true" />,+ },};export const ActivityIcon = ({ activity }: { activity: IIssueActivity }) => (diff --git a/web/store/label.store.ts b/web/store/label.store.tsindex 3f343f9a4d..e6b95da90e 100644--- a/web/store/label.store.ts+++ b/web/store/label.store.ts@@ -96,7 +96,7 @@ export class LabelStore implements ILabelStore {const workspaceSlug = this.rootStore.app.router.workspaceSlug || "";if (!projectId || !(this.fetchedMap[projectId] || this.fetchedMap[workspaceSlug])) return;return sortBy(- Object.values(this.labelMap).filter((label) => label.project_id === projectId),+ Object.values(this.labelMap).filter((label) => label?.project_id === projectId),"sort_order");}@@ -113,7 +113,7 @@ export class LabelStore implements ILabelStore {const workspaceSlug = this.rootStore.app.router.workspaceSlug || "";if (!projectId || !(this.fetchedMap[projectId] || this.fetchedMap[workspaceSlug])) return;return sortBy(- Object.values(this.labelMap).filter((label) => label.project_id === projectId),+ Object.values(this.labelMap).filter((label) => label?.project_id === projectId),"sort_order");});