[WEB-3856]chore: refactor work item activity (#6923)

* chore: refactor work item activity

* chore: added estimate render for notifications
This commit is contained in:
Vamsi Krishna 2025-04-15 16:35:28 +05:30 committed by GitHub
parent a4bca0c39c
commit c401b26dd4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 25 additions and 13 deletions

View file

@ -4,7 +4,6 @@ import { Triangle } from "lucide-react";
// hooks
import { useIssueDetail } from "@/hooks/store";
// components
import { renderEstimate } from "@/plane-web/components/issues/issue-details";
import { IssueActivityBlockComponent, IssueLink } from "./";
type TIssueEstimateActivity = { activityId: string; showIssue?: boolean; ends: "top" | "bottom" | undefined };
@ -27,10 +26,8 @@ export const IssueEstimateActivity: FC<TIssueEstimateActivity> = observer((props
ends={ends}
>
<>
{activity.new_value ? `set the estimate to ` : `removed the estimate `}
{activity.new_value
? renderEstimate(activity, activity.new_value)
: renderEstimate(activity, activity?.old_value || "")}
{activity.new_value ? `set the estimate point to ` : `removed the estimate point`}
{activity.new_value ? activity.new_value : activity?.old_value}
{showIssue && (activity.new_value ? ` to ` : ` from `)}
{showIssue && <IssueLink activityId={activityId} />}.
</>

View file

@ -5,7 +5,7 @@ import { getValidKeysFromObject } from "@/helpers/array.helper";
// hooks
import { useIssueDetail } from "@/hooks/store";
// plane web components
import { IssueTypeActivity } from "@/plane-web/components/issues/issue-details";
import { IssueTypeActivity, AdditionalActivityRoot } from "@/plane-web/components/issues/issue-details";
import { useTimeLineRelationOptions } from "@/plane-web/components/relations";
// local components
import {
@ -61,6 +61,7 @@ export const IssueActivityItem: FC<TIssueActivityItem> = observer((props) => {
case "priority":
return <IssuePriorityActivity {...componentDefaultProps} showIssue={false} />;
case "estimate_point":
case "estimate_categories":
return <IssueEstimateActivity {...componentDefaultProps} showIssue={false} />;
case "parent":
return <IssueParentActivity {...componentDefaultProps} showIssue={false} />;
@ -88,6 +89,6 @@ export const IssueActivityItem: FC<TIssueActivityItem> = observer((props) => {
case "type":
return <IssueTypeActivity {...componentDefaultProps} />;
default:
return <></>;
return <AdditionalActivityRoot {...componentDefaultProps} field={activityField} />;
}
});