forked from github/plane
0fb43c6fc5
* chore: removed issue description from issue list * fix: issue description handling on peekoverview --------- Co-authored-by: sriram veeraghanta <veeraghanta.sriram@gmail.com>
59 lines
1.8 KiB
TypeScript
59 lines
1.8 KiB
TypeScript
import { FC } from "react";
|
|
// hooks
|
|
import { useIssueDetail, useProject, useUser } from "hooks/store";
|
|
// components
|
|
import { IssueDescriptionForm, TIssueOperations } from "components/issues";
|
|
import { IssueReaction } from "../issue-detail/reactions";
|
|
import { observer } from "mobx-react";
|
|
|
|
interface IPeekOverviewIssueDetails {
|
|
workspaceSlug: string;
|
|
projectId: string;
|
|
issueId: string;
|
|
issueOperations: TIssueOperations;
|
|
disabled: boolean;
|
|
isSubmitting: "submitting" | "submitted" | "saved";
|
|
setIsSubmitting: (value: "submitting" | "submitted" | "saved") => void;
|
|
}
|
|
|
|
export const PeekOverviewIssueDetails: FC<IPeekOverviewIssueDetails> = observer((props) => {
|
|
const { workspaceSlug, projectId, issueId, issueOperations, disabled, isSubmitting, setIsSubmitting } = props;
|
|
// store hooks
|
|
const { getProjectById } = useProject();
|
|
const { currentUser } = useUser();
|
|
const {
|
|
issue: { getIssueById },
|
|
} = useIssueDetail();
|
|
|
|
// derived values
|
|
const issue = getIssueById(issueId);
|
|
if (!issue) return <></>;
|
|
const projectDetails = getProjectById(issue?.project_id);
|
|
|
|
return (
|
|
<>
|
|
<span className="text-base font-medium text-custom-text-400">
|
|
{projectDetails?.identifier}-{issue?.sequence_id}
|
|
</span>
|
|
<IssueDescriptionForm
|
|
workspaceSlug={workspaceSlug}
|
|
projectId={projectId}
|
|
issueId={issueId}
|
|
setIsSubmitting={(value) => setIsSubmitting(value)}
|
|
isSubmitting={isSubmitting}
|
|
issue={issue}
|
|
issueOperations={issueOperations}
|
|
disabled={disabled}
|
|
/>
|
|
{currentUser && (
|
|
<IssueReaction
|
|
workspaceSlug={workspaceSlug}
|
|
projectId={projectId}
|
|
issueId={issueId}
|
|
currentUser={currentUser}
|
|
/>
|
|
)}
|
|
</>
|
|
);
|
|
});
|