mirror of
https://github.com/makeplane/plane
synced 2024-06-14 14:31:34 +00:00
[WEB-643] chore: update issue activity tabs. (#4232)
* remove `updates` tab. * make `comments` as primary tab.
This commit is contained in:
parent
c50a0602f7
commit
f77d2d8c0a
@ -1,33 +0,0 @@
|
||||
import { FC } from "react";
|
||||
import { observer } from "mobx-react-lite";
|
||||
// hooks
|
||||
import { useIssueDetail } from "@/hooks/store";
|
||||
// components
|
||||
import { IssueActivityList } from "./activity-list";
|
||||
|
||||
type TIssueActivityRoot = {
|
||||
issueId: string;
|
||||
};
|
||||
|
||||
export const IssueActivityRoot: FC<TIssueActivityRoot> = observer((props) => {
|
||||
const { issueId } = props;
|
||||
// hooks
|
||||
const {
|
||||
activity: { getActivitiesByIssueId },
|
||||
} = useIssueDetail();
|
||||
|
||||
const activityIds = getActivitiesByIssueId(issueId);
|
||||
|
||||
if (!activityIds) return <></>;
|
||||
return (
|
||||
<div>
|
||||
{activityIds.map((activityId, index) => (
|
||||
<IssueActivityList
|
||||
key={activityId}
|
||||
activityId={activityId}
|
||||
ends={index === 0 ? "top" : index === activityIds.length - 1 ? "bottom" : undefined}
|
||||
/>
|
||||
))}
|
||||
</div>
|
||||
);
|
||||
});
|
@ -3,7 +3,6 @@ export * from "./root";
|
||||
export * from "./activity-comment-root";
|
||||
|
||||
// activity
|
||||
export * from "./activity/root";
|
||||
export * from "./activity/activity-list";
|
||||
|
||||
// issue comment
|
||||
|
@ -1,12 +1,12 @@
|
||||
import { FC, useMemo, useState } from "react";
|
||||
import { observer } from "mobx-react-lite";
|
||||
import { History, LucideIcon, MessageCircle, ListRestart } from "lucide-react";
|
||||
import { History, LucideIcon, MessageCircle } from "lucide-react";
|
||||
// types
|
||||
import { TIssueComment } from "@plane/types";
|
||||
// ui
|
||||
import { TOAST_TYPE, setToast } from "@plane/ui";
|
||||
// components
|
||||
import { IssueActivityCommentRoot, IssueActivityRoot, IssueCommentRoot, IssueCommentCreate } from "@/components/issues";
|
||||
import { IssueActivityCommentRoot, IssueCommentRoot, IssueCommentCreate } from "@/components/issues";
|
||||
// hooks
|
||||
import { useIssueDetail, useProject } from "@/hooks/store";
|
||||
|
||||
@ -17,24 +17,19 @@ type TIssueActivity = {
|
||||
disabled?: boolean;
|
||||
};
|
||||
|
||||
type TActivityTabs = "all" | "activity" | "comments";
|
||||
type TActivityTabs = "all" | "comments";
|
||||
|
||||
const activityTabs: { key: TActivityTabs; title: string; icon: LucideIcon }[] = [
|
||||
{
|
||||
key: "all",
|
||||
title: "All activity",
|
||||
icon: History,
|
||||
},
|
||||
{
|
||||
key: "activity",
|
||||
title: "Updates",
|
||||
icon: ListRestart,
|
||||
},
|
||||
{
|
||||
key: "comments",
|
||||
title: "Comments",
|
||||
icon: MessageCircle,
|
||||
},
|
||||
{
|
||||
key: "all",
|
||||
title: "All activity",
|
||||
icon: History,
|
||||
},
|
||||
];
|
||||
|
||||
export type TActivityOperations = {
|
||||
@ -49,7 +44,7 @@ export const IssueActivity: FC<TIssueActivity> = observer((props) => {
|
||||
const { createComment, updateComment, removeComment } = useIssueDetail();
|
||||
const { getProjectById } = useProject();
|
||||
// state
|
||||
const [activityTab, setActivityTab] = useState<TActivityTabs>("all");
|
||||
const [activityTab, setActivityTab] = useState<TActivityTabs>("comments");
|
||||
|
||||
const activityOperations: TActivityOperations = useMemo(
|
||||
() => ({
|
||||
@ -158,8 +153,6 @@ export const IssueActivity: FC<TIssueActivity> = observer((props) => {
|
||||
/>
|
||||
)}
|
||||
</div>
|
||||
) : activityTab === "activity" ? (
|
||||
<IssueActivityRoot issueId={issueId} />
|
||||
) : (
|
||||
<div className="space-y-3">
|
||||
<IssueCommentRoot
|
||||
|
Loading…
Reference in New Issue
Block a user