mirror of
https://github.com/makeplane/plane
synced 2024-06-14 14:31:34 +00:00
chore: add issue activity/ comments to peek-overview.
* imporve `showAccessIdentifier` logic.
This commit is contained in:
parent
b8b90032c9
commit
b03aaa7e4b
@ -2,7 +2,7 @@ import { FC, useMemo, useState } from "react";
|
|||||||
import { observer } from "mobx-react-lite";
|
import { observer } from "mobx-react-lite";
|
||||||
import { History, LucideIcon, MessageSquare, Network } from "lucide-react";
|
import { History, LucideIcon, MessageSquare, Network } from "lucide-react";
|
||||||
// hooks
|
// hooks
|
||||||
import { useIssueDetail } from "hooks/store";
|
import { useIssueDetail, useProject } from "hooks/store";
|
||||||
import useToast from "hooks/use-toast";
|
import useToast from "hooks/use-toast";
|
||||||
// components
|
// components
|
||||||
import { IssueActivityCommentRoot, IssueActivityRoot, IssueCommentRoot, IssueCommentCreate } from "./";
|
import { IssueActivityCommentRoot, IssueActivityRoot, IssueCommentRoot, IssueCommentCreate } from "./";
|
||||||
@ -14,7 +14,6 @@ type TIssueActivity = {
|
|||||||
projectId: string;
|
projectId: string;
|
||||||
issueId: string;
|
issueId: string;
|
||||||
disabled: boolean;
|
disabled: boolean;
|
||||||
showAccessSpecifier?: boolean;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
type TActivityTabs = "all" | "activity" | "comments";
|
type TActivityTabs = "all" | "activity" | "comments";
|
||||||
@ -44,10 +43,11 @@ export type TActivityOperations = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
export const IssueActivity: FC<TIssueActivity> = observer((props) => {
|
export const IssueActivity: FC<TIssueActivity> = observer((props) => {
|
||||||
const { workspaceSlug, projectId, issueId, disabled, showAccessSpecifier } = props;
|
const { workspaceSlug, projectId, issueId, disabled } = props;
|
||||||
// hooks
|
// hooks
|
||||||
const { createComment, updateComment, removeComment } = useIssueDetail();
|
const { createComment, updateComment, removeComment } = useIssueDetail();
|
||||||
const { setToastAlert } = useToast();
|
const { setToastAlert } = useToast();
|
||||||
|
const { getProjectById } = useProject();
|
||||||
// state
|
// state
|
||||||
const [activityTab, setActivityTab] = useState<TActivityTabs>("all");
|
const [activityTab, setActivityTab] = useState<TActivityTabs>("all");
|
||||||
|
|
||||||
@ -108,6 +108,9 @@ export const IssueActivity: FC<TIssueActivity> = observer((props) => {
|
|||||||
[workspaceSlug, projectId, issueId, createComment, updateComment, removeComment, setToastAlert]
|
[workspaceSlug, projectId, issueId, createComment, updateComment, removeComment, setToastAlert]
|
||||||
);
|
);
|
||||||
|
|
||||||
|
const project = getProjectById(projectId);
|
||||||
|
if (!project) return <></>;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="space-y-3 pt-3">
|
<div className="space-y-3 pt-3">
|
||||||
{/* header */}
|
{/* header */}
|
||||||
@ -142,14 +145,14 @@ export const IssueActivity: FC<TIssueActivity> = observer((props) => {
|
|||||||
workspaceSlug={workspaceSlug}
|
workspaceSlug={workspaceSlug}
|
||||||
issueId={issueId}
|
issueId={issueId}
|
||||||
activityOperations={activityOperations}
|
activityOperations={activityOperations}
|
||||||
showAccessSpecifier={showAccessSpecifier}
|
showAccessSpecifier={project.is_deployed}
|
||||||
/>
|
/>
|
||||||
{!disabled && (
|
{!disabled && (
|
||||||
<IssueCommentCreate
|
<IssueCommentCreate
|
||||||
workspaceSlug={workspaceSlug}
|
workspaceSlug={workspaceSlug}
|
||||||
activityOperations={activityOperations}
|
activityOperations={activityOperations}
|
||||||
disabled={disabled}
|
disabled={disabled}
|
||||||
showAccessSpecifier={showAccessSpecifier}
|
showAccessSpecifier={project.is_deployed}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
@ -161,14 +164,14 @@ export const IssueActivity: FC<TIssueActivity> = observer((props) => {
|
|||||||
workspaceSlug={workspaceSlug}
|
workspaceSlug={workspaceSlug}
|
||||||
issueId={issueId}
|
issueId={issueId}
|
||||||
activityOperations={activityOperations}
|
activityOperations={activityOperations}
|
||||||
showAccessSpecifier={showAccessSpecifier}
|
showAccessSpecifier={project.is_deployed}
|
||||||
/>
|
/>
|
||||||
{!disabled && (
|
{!disabled && (
|
||||||
<IssueCommentCreate
|
<IssueCommentCreate
|
||||||
workspaceSlug={workspaceSlug}
|
workspaceSlug={workspaceSlug}
|
||||||
activityOperations={activityOperations}
|
activityOperations={activityOperations}
|
||||||
disabled={disabled}
|
disabled={disabled}
|
||||||
showAccessSpecifier={showAccessSpecifier}
|
showAccessSpecifier={project.is_deployed}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import { useState } from "react";
|
import { useState } from "react";
|
||||||
import { observer } from "mobx-react-lite";
|
import { observer } from "mobx-react-lite";
|
||||||
// hooks
|
// hooks
|
||||||
import { useIssueDetail, useProject, useProjectState, useUser } from "hooks/store";
|
import { useIssueDetail, useProjectState, useUser } from "hooks/store";
|
||||||
// components
|
// components
|
||||||
import { IssueDescriptionForm, IssueAttachmentRoot, IssueUpdateStatus } from "components/issues";
|
import { IssueDescriptionForm, IssueAttachmentRoot, IssueUpdateStatus } from "components/issues";
|
||||||
import { IssueParentDetail } from "./parent";
|
import { IssueParentDetail } from "./parent";
|
||||||
@ -32,14 +32,10 @@ export const IssueMainContent: React.FC<Props> = observer((props) => {
|
|||||||
const {
|
const {
|
||||||
issue: { getIssueById },
|
issue: { getIssueById },
|
||||||
} = useIssueDetail();
|
} = useIssueDetail();
|
||||||
const { getProjectById } = useProject();
|
|
||||||
|
|
||||||
const issue = getIssueById(issueId);
|
const issue = getIssueById(issueId);
|
||||||
if (!issue) return <></>;
|
if (!issue) return <></>;
|
||||||
|
|
||||||
const project = getProjectById(projectId);
|
|
||||||
if (!project) return <></>;
|
|
||||||
|
|
||||||
const currentIssueState = projectStates?.find((s) => s.id === issue.state_id);
|
const currentIssueState = projectStates?.find((s) => s.id === issue.state_id);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
@ -109,7 +105,6 @@ export const IssueMainContent: React.FC<Props> = observer((props) => {
|
|||||||
projectId={projectId}
|
projectId={projectId}
|
||||||
issueId={issueId}
|
issueId={issueId}
|
||||||
disabled={!is_editable}
|
disabled={!is_editable}
|
||||||
showAccessSpecifier={project.is_deployed}
|
|
||||||
/>
|
/>
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
|
@ -12,13 +12,13 @@ import useToast from "hooks/use-toast";
|
|||||||
import {
|
import {
|
||||||
DeleteArchivedIssueModal,
|
DeleteArchivedIssueModal,
|
||||||
DeleteIssueModal,
|
DeleteIssueModal,
|
||||||
IssueActivity,
|
|
||||||
IssueSubscription,
|
IssueSubscription,
|
||||||
IssueUpdateStatus,
|
IssueUpdateStatus,
|
||||||
PeekOverviewIssueDetails,
|
PeekOverviewIssueDetails,
|
||||||
PeekOverviewProperties,
|
PeekOverviewProperties,
|
||||||
TIssueOperations,
|
TIssueOperations,
|
||||||
} from "components/issues";
|
} from "components/issues";
|
||||||
|
import { IssueActivity } from "../issue-detail/issue-activity";
|
||||||
// ui
|
// ui
|
||||||
import { CenterPanelIcon, CustomSelect, FullScreenPanelIcon, SidePanelIcon, Spinner } from "@plane/ui";
|
import { CenterPanelIcon, CustomSelect, FullScreenPanelIcon, SidePanelIcon, Spinner } from "@plane/ui";
|
||||||
// helpers
|
// helpers
|
||||||
@ -237,19 +237,12 @@ export const IssueView: FC<IIssueView> = observer((props) => {
|
|||||||
disabled={disabled}
|
disabled={disabled}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
{/* <IssueActivity
|
<IssueActivity
|
||||||
workspaceSlug={workspaceSlug}
|
workspaceSlug={workspaceSlug}
|
||||||
projectId={projectId}
|
projectId={projectId}
|
||||||
issueId={issueId}
|
issueId={issueId}
|
||||||
user={currentUser}
|
disabled={disabled}
|
||||||
issueActivity={issueActivity}
|
/>
|
||||||
issueCommentCreate={issueCommentCreate}
|
|
||||||
issueCommentUpdate={issueCommentUpdate}
|
|
||||||
issueCommentRemove={issueCommentRemove}
|
|
||||||
issueCommentReactionCreate={issueCommentReactionCreate}
|
|
||||||
issueCommentReactionRemove={issueCommentReactionRemove}
|
|
||||||
showCommentAccessSpecifier={showCommentAccessSpecifier}
|
|
||||||
/> */}
|
|
||||||
</div>
|
</div>
|
||||||
) : (
|
) : (
|
||||||
<div className={`flex h-full w-full overflow-auto ${is_archived ? "opacity-60" : ""}`}>
|
<div className={`flex h-full w-full overflow-auto ${is_archived ? "opacity-60" : ""}`}>
|
||||||
@ -266,19 +259,12 @@ export const IssueView: FC<IIssueView> = observer((props) => {
|
|||||||
setIsSubmitting={(value) => setIsSubmitting(value)}
|
setIsSubmitting={(value) => setIsSubmitting(value)}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
{/* <IssueActivity
|
<IssueActivity
|
||||||
workspaceSlug={workspaceSlug}
|
workspaceSlug={workspaceSlug}
|
||||||
projectId={projectId}
|
projectId={projectId}
|
||||||
issueId={issueId}
|
issueId={issueId}
|
||||||
user={currentUser}
|
disabled={disabled}
|
||||||
issueActivity={issueActivity}
|
/>
|
||||||
issueCommentCreate={issueCommentCreate}
|
|
||||||
issueCommentUpdate={issueCommentUpdate}
|
|
||||||
issueCommentRemove={issueCommentRemove}
|
|
||||||
issueCommentReactionCreate={issueCommentReactionCreate}
|
|
||||||
issueCommentReactionRemove={issueCommentReactionRemove}
|
|
||||||
showCommentAccessSpecifier={showCommentAccessSpecifier}
|
|
||||||
/> */}
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div
|
<div
|
||||||
|
Loading…
Reference in New Issue
Block a user