-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: issue peek-overview delete functionality (#3134)
* fix: peek-overview delete issue * refactor: removed unused variables
- Loading branch information
1 parent
969a51f
commit 05e7afa
Showing
14 changed files
with
172 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,36 @@ | ||
import React from "react"; | ||
import { useRouter } from "next/router"; | ||
import { observer } from "mobx-react-lite"; | ||
// hooks | ||
import { useMobxStore } from "lib/mobx/store-provider"; | ||
// components | ||
import { BaseGanttRoot } from "./base-gantt-root"; | ||
// types | ||
import { EIssueActions } from "../types"; | ||
import { IIssue } from "types"; | ||
|
||
export const GanttLayout: React.FC = observer(() => { | ||
const { projectIssues: projectIssuesStore, projectIssuesFilter: projectIssueFiltersStore } = useMobxStore(); | ||
const router = useRouter(); | ||
const { workspaceSlug } = router.query; | ||
|
||
return <BaseGanttRoot issueFiltersStore={projectIssueFiltersStore} issueStore={projectIssuesStore} />; | ||
const issueActions = { | ||
[EIssueActions.UPDATE]: async (issue: IIssue) => { | ||
if (!workspaceSlug) return; | ||
|
||
await projectIssuesStore.updateIssue(workspaceSlug.toString(), issue.project, issue.id, issue); | ||
}, | ||
[EIssueActions.DELETE]: async (issue: IIssue) => { | ||
if (!workspaceSlug) return; | ||
|
||
await projectIssuesStore.removeIssue(workspaceSlug.toString(), issue.project, issue.id); | ||
}, | ||
}; | ||
return ( | ||
<BaseGanttRoot | ||
issueActions={issueActions} | ||
issueFiltersStore={projectIssueFiltersStore} | ||
issueStore={projectIssuesStore} | ||
/> | ||
); | ||
}); |
26 changes: 25 additions & 1 deletion
26
web/components/issues/issue-layouts/gantt/project-view-root.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,35 @@ | ||
import { observer } from "mobx-react-lite"; | ||
import { useRouter } from "next/router"; | ||
// mobx store | ||
import { useMobxStore } from "lib/mobx/store-provider"; | ||
// components | ||
import { BaseGanttRoot } from "./base-gantt-root"; | ||
// types | ||
import { EIssueActions } from "../types"; | ||
import { IIssue } from "types"; | ||
|
||
export const ProjectViewGanttLayout: React.FC = observer(() => { | ||
const { viewIssues: projectIssueViewStore, viewIssuesFilter: projectIssueViewFiltersStore } = useMobxStore(); | ||
const router = useRouter(); | ||
const { workspaceSlug } = router.query; | ||
|
||
return <BaseGanttRoot issueFiltersStore={projectIssueViewFiltersStore} issueStore={projectIssueViewStore} />; | ||
const issueActions = { | ||
[EIssueActions.UPDATE]: async (issue: IIssue) => { | ||
if (!workspaceSlug) return; | ||
|
||
await projectIssueViewStore.updateIssue(workspaceSlug.toString(), issue.project, issue.id, issue); | ||
}, | ||
[EIssueActions.DELETE]: async (issue: IIssue) => { | ||
if (!workspaceSlug) return; | ||
|
||
await projectIssueViewStore.removeIssue(workspaceSlug.toString(), issue.project, issue.id); | ||
}, | ||
}; | ||
return ( | ||
<BaseGanttRoot | ||
issueActions={issueActions} | ||
issueFiltersStore={projectIssueViewFiltersStore} | ||
issueStore={projectIssueViewStore} | ||
/> | ||
); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.