mirror of
https://github.com/makeplane/plane
synced 2024-06-14 14:31:34 +00:00
fix: delete issues in spreadsheet doesn't work (#2718)
Co-authored-by: Aaryan Khandelwal <65252264+aaryan610@users.noreply.github.com>
This commit is contained in:
parent
ced5bfd930
commit
2abc5eb68c
@ -41,6 +41,18 @@ export const ProjectSpreadsheetLayout: React.FC = observer(() => {
|
|||||||
[issueFilterStore, projectId, workspaceSlug]
|
[issueFilterStore, projectId, workspaceSlug]
|
||||||
);
|
);
|
||||||
|
|
||||||
|
const handleIssueAction = async (issue: IIssue, action: "copy" | "delete" | "edit") => {
|
||||||
|
if (!workspaceSlug || !projectId || !user) return;
|
||||||
|
|
||||||
|
if (action === "delete") {
|
||||||
|
issueDetailStore.deleteIssue(workspaceSlug.toString(), projectId.toString(), issue.id);
|
||||||
|
issueStore.removeIssueFromStructure(null, null, issue);
|
||||||
|
} else if (action === "edit") {
|
||||||
|
issueDetailStore.updateIssue(workspaceSlug.toString(), projectId.toString(), issue.id, issue);
|
||||||
|
issueStore.updateIssueStructure(null, null, issue);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
const handleUpdateIssue = useCallback(
|
const handleUpdateIssue = useCallback(
|
||||||
(issue: IIssue, data: Partial<IIssue>) => {
|
(issue: IIssue, data: Partial<IIssue>) => {
|
||||||
if (!workspaceSlug || !projectId || !user) return;
|
if (!workspaceSlug || !projectId || !user) return;
|
||||||
@ -65,7 +77,7 @@ export const ProjectSpreadsheetLayout: React.FC = observer(() => {
|
|||||||
members={projectMembers?.map((m) => m.member)}
|
members={projectMembers?.map((m) => m.member)}
|
||||||
labels={projectLabels || undefined}
|
labels={projectLabels || undefined}
|
||||||
states={projectId ? projectStateStore.states?.[projectId.toString()] : undefined}
|
states={projectId ? projectStateStore.states?.[projectId.toString()] : undefined}
|
||||||
handleIssueAction={() => {}}
|
handleIssueAction={handleIssueAction}
|
||||||
handleUpdateIssue={handleUpdateIssue}
|
handleUpdateIssue={handleUpdateIssue}
|
||||||
disableUserActions={false}
|
disableUserActions={false}
|
||||||
enableQuickCreateIssue
|
enableQuickCreateIssue
|
||||||
|
@ -46,8 +46,6 @@ export const SpreadsheetView: React.FC<Props> = observer((props) => {
|
|||||||
issueId: string;
|
issueId: string;
|
||||||
} | null>(null);
|
} | null>(null);
|
||||||
|
|
||||||
const [isInlineCreateIssueFormOpen, setIsInlineCreateIssueFormOpen] = useState(false);
|
|
||||||
|
|
||||||
const [isScrolled, setIsScrolled] = useState(false);
|
const [isScrolled, setIsScrolled] = useState(false);
|
||||||
|
|
||||||
const containerRef = useRef<HTMLDivElement | null>(null);
|
const containerRef = useRef<HTMLDivElement | null>(null);
|
||||||
|
Loading…
Reference in New Issue
Block a user