()
| 37 | } |
| 38 | |
| 39 | private buildMenu(): void { |
| 40 | const { icsEvent, plugin, subscriptionName } = this.options; |
| 41 | |
| 42 | // Show details option |
| 43 | this.menu.addItem((item) => |
| 44 | item |
| 45 | .setTitle(this.t("contextMenus.ics.showDetails")) |
| 46 | .setIcon("info") |
| 47 | .onClick(() => { |
| 48 | const modal = new ICSEventInfoModal( |
| 49 | plugin.app, |
| 50 | plugin, |
| 51 | icsEvent, |
| 52 | subscriptionName |
| 53 | ); |
| 54 | modal.open(); |
| 55 | }) |
| 56 | ); |
| 57 | |
| 58 | this.menu.addSeparator(); |
| 59 | |
| 60 | // Create task from event |
| 61 | this.menu.addItem((item) => |
| 62 | item |
| 63 | .setTitle(this.t("contextMenus.ics.createTask")) |
| 64 | .setIcon("check-circle") |
| 65 | .onClick(async () => { |
| 66 | await this.createTaskFromEvent(); |
| 67 | }) |
| 68 | ); |
| 69 | |
| 70 | // Create note from event |
| 71 | this.menu.addItem((item) => |
| 72 | item |
| 73 | .setTitle(this.t("contextMenus.ics.createNote")) |
| 74 | .setIcon("file-plus") |
| 75 | .onClick(() => { |
| 76 | this.createNoteFromEvent(); |
| 77 | }) |
| 78 | ); |
| 79 | |
| 80 | // Link existing note |
| 81 | this.menu.addItem((item) => |
| 82 | item |
| 83 | .setTitle(this.t("contextMenus.ics.linkNote")) |
| 84 | .setIcon("link") |
| 85 | .onClick(() => { |
| 86 | void this.linkExistingNote(); |
| 87 | }) |
| 88 | ); |
| 89 | |
| 90 | this.menu.addSeparator(); |
| 91 | |
| 92 | // Copy title option |
| 93 | this.menu.addItem((item) => |
| 94 | item |
| 95 | .setTitle(this.t("contextMenus.ics.copyTitle")) |
| 96 | .setIcon("copy") |
no test coverage detected