forked from github/plane
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
51e17643a2
commit
779ef2a4aa
@ -41,6 +41,18 @@ export const ProjectSpreadsheetLayout: React.FC = observer(() => {
|
||||
[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(
|
||||
(issue: IIssue, data: Partial<IIssue>) => {
|
||||
if (!workspaceSlug || !projectId || !user) return;
|
||||
@ -65,7 +77,7 @@ export const ProjectSpreadsheetLayout: React.FC = observer(() => {
|
||||
members={projectMembers?.map((m) => m.member)}
|
||||
labels={projectLabels || undefined}
|
||||
states={projectId ? projectStateStore.states?.[projectId.toString()] : undefined}
|
||||
handleIssueAction={() => {}}
|
||||
handleIssueAction={handleIssueAction}
|
||||
handleUpdateIssue={handleUpdateIssue}
|
||||
disableUserActions={false}
|
||||
enableQuickCreateIssue
|
||||
|
@ -46,8 +46,6 @@ export const SpreadsheetView: React.FC<Props> = observer((props) => {
|
||||
issueId: string;
|
||||
} | null>(null);
|
||||
|
||||
const [isInlineCreateIssueFormOpen, setIsInlineCreateIssueFormOpen] = useState(false);
|
||||
|
||||
const [isScrolled, setIsScrolled] = useState(false);
|
||||
|
||||
const containerRef = useRef<HTMLDivElement | null>(null);
|
||||
|
Loading…
Reference in New Issue
Block a user