[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
This commit is contained in:
rahulramesha 2024-11-04 16:55:38 +05:30 committed by GitHub
parent a1bfde6af9
commit 71589f93ca
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
22 changed files with 201 additions and 105 deletions

View file

@ -0,0 +1,20 @@
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;
};

View file

@ -3,6 +3,8 @@ import { RelatedIcon } from "@plane/ui";
import { TRelationObject } from "@/components/issues";
import { TIssueRelationTypes } from "../../types";
export * from "./activity";
export const ISSUE_RELATION_OPTIONS: Record<TIssueRelationTypes, TRelationObject> = {
relates_to: {
key: "relates_to",
@ -33,3 +35,5 @@ export const ISSUE_RELATION_OPTIONS: Record<TIssueRelationTypes, TRelationObject
placeholder: "None",
},
};
export const useTimeLineRelationOptions = () => ISSUE_RELATION_OPTIONS;