bb-plane-fork/web/ce/components/relations/activity.ts
rahulramesha 71589f93ca
[WEB-2442] fix : Timeline layout bugs (#5946)
* fix relation creation and removal for Issue relations

* fix Scrolling to block when the block is beyond current chart's limits

* fix dark mode for timeline layout

* use a hook to get the current relations available in the environment, instead of directly importing it

* Update relation activity for all the relations
2024-11-04 16:55:38 +05:30

20 lines
798 B
TypeScript

import { TIssueActivity } from "@plane/types";
export const getRelationActivityContent = (activity: TIssueActivity | undefined): string | undefined => {
if (!activity) return;
switch (activity.field) {
case "blocking":
return activity.old_value === "" ? `marked this issue is blocking issue ` : `removed the blocking issue `;
case "blocked_by":
return activity.old_value === ""
? `marked this issue is being blocked by `
: `removed this issue being blocked by issue `;
case "duplicate":
return activity.old_value === "" ? `marked this issue as duplicate of ` : `removed this issue as a duplicate of `;
case "relates_to":
activity.old_value === "" ? `marked that this issue relates to ` : `removed the relation from `;
}
return;
};