mirror of
https://github.com/makeplane/plane
synced 2024-06-14 14:31:34 +00:00
* fix: issue description fixes * chore: description html in the archive issue * chore: changed retrieve viewset * chore: implemented new issue title description components in inbox, issue-detail and fixed issue in archived store * chore: removed consoles and empty description update in issue detail * fix: draft issue empty state image --------- Co-authored-by: sriram veeraghanta <veeraghanta.sriram@gmail.com> Co-authored-by: NarayanBavisetti <narayan3119@gmail.com> Co-authored-by: Anmol Singh Bhatia <anmolsinghbhatia@plane.so>
73 lines
2.2 KiB
TypeScript
73 lines
2.2 KiB
TypeScript
import { FC, useCallback, useEffect, useState } from "react";
|
|
import { observer } from "mobx-react";
|
|
// store hooks
|
|
import { useIssueDetail, useProject, useUser } from "hooks/store";
|
|
// hooks
|
|
import useReloadConfirmations from "hooks/use-reload-confirmation";
|
|
// components
|
|
import { TIssueOperations } from "components/issues";
|
|
import { IssueReaction } from "../issue-detail/reactions";
|
|
import { IssueTitleInput } from "../title-input";
|
|
import { IssueDescriptionInput } from "../description-input";
|
|
import { debounce } from "lodash";
|
|
|
|
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, issueId, issueOperations, disabled, 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>
|
|
<IssueTitleInput
|
|
workspaceSlug={workspaceSlug}
|
|
projectId={issue.project_id}
|
|
issueId={issue.id}
|
|
setIsSubmitting={(value) => setIsSubmitting(value)}
|
|
issueOperations={issueOperations}
|
|
disabled={disabled}
|
|
value={issue.name}
|
|
/>
|
|
<IssueDescriptionInput
|
|
workspaceSlug={workspaceSlug}
|
|
projectId={issue.project_id}
|
|
issueId={issue.id}
|
|
setIsSubmitting={(value) => setIsSubmitting(value)}
|
|
issueOperations={issueOperations}
|
|
disabled={disabled}
|
|
value={issue.description_html}
|
|
/>
|
|
{currentUser && (
|
|
<IssueReaction
|
|
workspaceSlug={workspaceSlug}
|
|
projectId={issue.project_id}
|
|
issueId={issueId}
|
|
currentUser={currentUser}
|
|
/>
|
|
)}
|
|
</>
|
|
);
|
|
});
|