mirror of
https://github.com/makeplane/plane
synced 2024-06-14 14:31:34 +00:00
a94c607031
* 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>
63 lines
1.9 KiB
TypeScript
63 lines
1.9 KiB
TypeScript
import React, { Fragment } from "react";
|
|
import { useRouter } from "next/router";
|
|
import { observer } from "mobx-react-lite";
|
|
import useSWR from "swr";
|
|
// mobx store
|
|
import { useIssues } from "hooks/store";
|
|
// components
|
|
import {
|
|
ArchivedIssueListLayout,
|
|
ArchivedIssueAppliedFiltersRoot,
|
|
ProjectArchivedEmptyState,
|
|
IssuePeekOverview,
|
|
} from "components/issues";
|
|
import { EIssuesStoreType } from "constants/issue";
|
|
// ui
|
|
import { ListLayoutLoader } from "components/ui";
|
|
|
|
export const ArchivedIssueLayoutRoot: React.FC = observer(() => {
|
|
// router
|
|
const router = useRouter();
|
|
const { workspaceSlug, projectId } = router.query;
|
|
// hooks
|
|
const { issues, issuesFilter } = useIssues(EIssuesStoreType.ARCHIVED);
|
|
|
|
useSWR(
|
|
workspaceSlug && projectId ? `ARCHIVED_ISSUES_${workspaceSlug.toString()}_${projectId.toString()}` : null,
|
|
async () => {
|
|
if (workspaceSlug && projectId) {
|
|
await issuesFilter?.fetchFilters(workspaceSlug.toString(), projectId.toString());
|
|
await issues?.fetchIssues(
|
|
workspaceSlug.toString(),
|
|
projectId.toString(),
|
|
issues?.groupedIssueIds ? "mutation" : "init-loader"
|
|
);
|
|
}
|
|
}
|
|
);
|
|
|
|
if (issues?.loader === "init-loader" || !issues?.groupedIssueIds) {
|
|
return <ListLayoutLoader />;
|
|
}
|
|
|
|
if (!workspaceSlug || !projectId) return <></>;
|
|
return (
|
|
<div className="relative flex h-full w-full flex-col overflow-hidden">
|
|
<ArchivedIssueAppliedFiltersRoot />
|
|
|
|
{issues?.groupedIssueIds?.length === 0 ? (
|
|
<div className="relative h-full w-full overflow-y-auto">
|
|
<ProjectArchivedEmptyState />
|
|
</div>
|
|
) : (
|
|
<Fragment>
|
|
<div className="relative h-full w-full overflow-auto">
|
|
<ArchivedIssueListLayout />
|
|
</div>
|
|
<IssuePeekOverview is_archived={true} />
|
|
</Fragment>
|
|
)}
|
|
</div>
|
|
);
|
|
});
|