2023-11-23 09:17:04 +00:00
|
|
|
import { FC } from "react";
|
2023-10-20 11:37:46 +00:00
|
|
|
import { useRouter } from "next/router";
|
2023-10-17 10:53:54 +00:00
|
|
|
import { observer } from "mobx-react-lite";
|
2023-10-20 11:37:46 +00:00
|
|
|
// mobx store
|
|
|
|
import { useMobxStore } from "lib/mobx/store-provider";
|
2023-10-17 10:53:54 +00:00
|
|
|
// components
|
2023-10-20 11:37:46 +00:00
|
|
|
import { ProjectIssueQuickActions } from "components/issues";
|
|
|
|
// types
|
|
|
|
import { IIssue } from "types";
|
2023-11-23 09:17:04 +00:00
|
|
|
import { EIssueActions } from "../../types";
|
|
|
|
import { IProjectStore } from "store/project";
|
|
|
|
//components
|
|
|
|
import { BaseListRoot } from "../base-list-root";
|
2023-10-17 10:53:54 +00:00
|
|
|
|
|
|
|
export const ProfileIssuesListLayout: FC = observer(() => {
|
|
|
|
const {
|
|
|
|
profileIssueFilters: profileIssueFiltersStore,
|
2023-10-20 11:37:46 +00:00
|
|
|
profileIssues: profileIssuesStore,
|
|
|
|
issueDetail: issueDetailStore,
|
|
|
|
} = useMobxStore();
|
|
|
|
|
|
|
|
const router = useRouter();
|
|
|
|
const { workspaceSlug } = router.query;
|
2023-10-17 10:53:54 +00:00
|
|
|
|
2023-11-23 09:17:04 +00:00
|
|
|
const issueActions = {
|
|
|
|
[EIssueActions.UPDATE]: (group_by: string | null, issue: IIssue) => {
|
2023-10-20 11:37:46 +00:00
|
|
|
if (!workspaceSlug) return;
|
|
|
|
|
2023-11-23 09:17:04 +00:00
|
|
|
profileIssuesStore.updateIssueStructure(group_by, null, issue);
|
|
|
|
issueDetailStore.updateIssue(workspaceSlug.toString(), issue.project, issue.id, issue);
|
|
|
|
},
|
|
|
|
[EIssueActions.DELETE]: (group_by: string | null, issue: IIssue) => {
|
|
|
|
profileIssuesStore.deleteIssue(group_by, null, issue);
|
2023-10-20 11:37:46 +00:00
|
|
|
},
|
2023-11-23 09:17:04 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
const getProjects = (projectStore: IProjectStore) => projectStore?.workspaceProjects || null;
|
2023-10-17 10:53:54 +00:00
|
|
|
|
2023-11-23 09:17:04 +00:00
|
|
|
return null;
|
2023-10-17 10:53:54 +00:00
|
|
|
|
2023-11-23 09:17:04 +00:00
|
|
|
// return (
|
|
|
|
// <BaseListRoot
|
|
|
|
// issueFilterStore={profileIssueFiltersStore}
|
|
|
|
// issueStore={profileIssuesStore}
|
|
|
|
// QuickActions={ProjectIssueQuickActions}
|
|
|
|
// issueActions={issueActions}
|
|
|
|
// getProjects={getProjects}
|
|
|
|
// />
|
|
|
|
// );
|
2023-10-17 10:53:54 +00:00
|
|
|
});
|