2023-11-03 14:50:05 +00:00
|
|
|
import { FC } from "react";
|
|
|
|
import { useRouter } from "next/router";
|
|
|
|
import { observer } from "mobx-react-lite";
|
|
|
|
// hooks
|
|
|
|
import { useMobxStore } from "lib/mobx/store-provider";
|
|
|
|
// components
|
|
|
|
import { ArchivedIssueQuickActions } from "components/issues";
|
|
|
|
// types
|
|
|
|
import { IIssue } from "types";
|
|
|
|
// constants
|
2023-11-23 09:17:04 +00:00
|
|
|
import { BaseListRoot } from "../base-list-root";
|
|
|
|
import { IProjectStore } from "store/project";
|
|
|
|
import { EIssueActions } from "../../types";
|
2023-11-03 14:50:05 +00:00
|
|
|
|
|
|
|
export const ArchivedIssueListLayout: FC = observer(() => {
|
|
|
|
const router = useRouter();
|
|
|
|
const { workspaceSlug, projectId } = router.query;
|
|
|
|
|
2023-11-23 09:17:04 +00:00
|
|
|
const { archivedIssues: archivedIssueStore, archivedIssueFilters: archivedIssueFiltersStore } = useMobxStore();
|
2023-11-03 14:50:05 +00:00
|
|
|
|
2023-11-23 09:17:04 +00:00
|
|
|
const issueActions = {
|
|
|
|
[EIssueActions.DELETE]: (group_by: string | null, issue: IIssue) => {
|
|
|
|
if (!workspaceSlug || !projectId) return;
|
2023-11-03 14:50:05 +00:00
|
|
|
|
2023-11-23 09:17:04 +00:00
|
|
|
archivedIssueStore.deleteArchivedIssue(group_by, null, issue);
|
|
|
|
},
|
2023-11-03 14:50:05 +00:00
|
|
|
};
|
|
|
|
|
2023-11-23 09:17:04 +00:00
|
|
|
const getProjects = (projectStore: IProjectStore) => {
|
|
|
|
if (!workspaceSlug) return null;
|
|
|
|
return projectStore?.projects[workspaceSlug.toString()] || null;
|
|
|
|
};
|
2023-11-03 14:50:05 +00:00
|
|
|
|
2023-11-23 09:17:04 +00:00
|
|
|
return null;
|
|
|
|
|
|
|
|
// return (
|
|
|
|
// <BaseListRoot
|
|
|
|
// issueFilterStore={archivedIssueFiltersStore}
|
|
|
|
// issueStore={archivedIssueStore}
|
|
|
|
// QuickActions={ArchivedIssueQuickActions}
|
|
|
|
// issueActions={issueActions}
|
|
|
|
// getProjects={getProjects}
|
|
|
|
// />
|
|
|
|
// );
|
2023-11-03 14:50:05 +00:00
|
|
|
});
|