[WEB-3461] fix: profile activity rendering issue (#7059)

* fix: profile activity

* fix: icon

* fix: handled conversion case

* fix: handled conversion case
This commit is contained in:
Akshita Goyal 2025-05-19 15:20:57 +05:30 committed by GitHub
parent 2d475491e9
commit 7e21618762
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 33 additions and 12 deletions

View file

@ -21,7 +21,7 @@ import {
UsersIcon,
} from "lucide-react";
import { IIssueActivity } from "@plane/types";
import { Tooltip, BlockedIcon, BlockerIcon, RelatedIcon, LayersIcon, DiceIcon, Intake } from "@plane/ui";
import { Tooltip, BlockedIcon, BlockerIcon, RelatedIcon, LayersIcon, DiceIcon, Intake, EpicIcon } from "@plane/ui";
// helpers
import { renderFormattedDate } from "@/helpers/date-time.helper";
import { generateWorkItemLink } from "@/helpers/issue.helper";
@ -271,6 +271,12 @@ const activityDetails: {
created <IssueLink activity={activity} />
</>
);
else if (activity.verb === "converted")
return (
<>
converted <IssueLink activity={activity} /> to an epic
</>
);
else
return (
<>
@ -280,6 +286,29 @@ const activityDetails: {
},
icon: <LayersIcon width={12} height={12} className="text-custom-text-200" aria-hidden="true" />,
},
epic: {
message: (activity) => {
if (activity.verb === "created")
return (
<>
created <IssueLink activity={activity} />
</>
);
else if (activity.verb === "converted")
return (
<>
converted <IssueLink activity={activity} /> to a work item
</>
);
else
return (
<>
deleted <IssueLink activity={activity} />
</>
);
},
icon: <EpicIcon width={12} height={12} className="text-custom-text-200" aria-hidden="true" />,
},
labels: {
message: (activity, showIssue, workspaceSlug) => {
if (activity.old_value === "")
@ -727,10 +756,11 @@ type ActivityMessageProps = {
export const ActivityMessage = ({ activity, showIssue = false }: ActivityMessageProps) => {
// router params
const { workspaceSlug } = useParams();
const activityField = activity.field ?? "issue";
return (
<>
{activityDetails[activity.field as keyof typeof activityDetails]?.message(
{activityDetails[activityField as keyof typeof activityDetails]?.message(
activity,
showIssue,
workspaceSlug ? workspaceSlug.toString() : (activity.workspace_detail?.slug ?? "")

View file

@ -113,16 +113,7 @@ export const ProfileActivityListPage: React.FC<Props> = observer((props) => {
</div>
);
const message =
activityItem.verb === "created" &&
!["cycles", "modules", "attachment", "link", "estimate"].includes(activityItem.field) &&
!activityItem.field ? (
<span>
created <IssueLink activity={activityItem} />
</span>
) : (
<ActivityMessage activity={activityItem} showIssue />
);
const message = <ActivityMessage activity={activityItem} showIssue />;
if ("field" in activityItem && activityItem.field !== "updated_by")
return (