()
| 646 | } |
| 647 | |
| 648 | private async deleteTask(): Promise<void> { |
| 649 | const confirmed = await showConfirmationModal(this.app, { |
| 650 | title: this.t("modals.taskEdit.deleteConfirmation.title"), |
| 651 | message: this.t("modals.taskEdit.deleteConfirmation.message", { |
| 652 | title: this.task.title, |
| 653 | }), |
| 654 | confirmText: this.t("modals.taskEdit.deleteConfirmation.confirm"), |
| 655 | cancelText: this.t("common.cancel"), |
| 656 | isDestructive: true, |
| 657 | }); |
| 658 | |
| 659 | if (!confirmed) { |
| 660 | return; |
| 661 | } |
| 662 | |
| 663 | try { |
| 664 | await this.plugin.taskService.deleteTask(this.task); |
| 665 | new Notice(this.t("modals.taskEdit.notices.deleteSuccess", { title: this.task.title })); |
| 666 | this.forceClose(); |
| 667 | } catch (error) { |
| 668 | const message = error instanceof Error ? error.message : String(error); |
| 669 | tasknotesLogger.error("Failed to delete task:", { |
| 670 | category: "persistence", |
| 671 | operation: "delete-task", |
| 672 | error: error, |
| 673 | }); |
| 674 | new Notice(this.t("modals.taskEdit.notices.deleteFailure", { message })); |
| 675 | } |
| 676 | } |
| 677 | |
| 678 | protected createActionButtons(container: HTMLElement): void { |
| 679 | createTaskModalActionButtons(this.getActionButtonContext(), { |
no test coverage detected