( task: TaskInfo, plugin: TaskNotesPlugin, mode: "add" | "remove" )
| 1467 | } |
| 1468 | |
| 1469 | private async openTagInput( |
| 1470 | task: TaskInfo, |
| 1471 | plugin: TaskNotesPlugin, |
| 1472 | mode: "add" | "remove" |
| 1473 | ): Promise<void> { |
| 1474 | const input = await showTextInputModal(plugin.app, { |
| 1475 | title: |
| 1476 | mode === "add" |
| 1477 | ? this.t("contextMenus.task.addTag") |
| 1478 | : this.t("contextMenus.task.removeTagInput"), |
| 1479 | placeholder: this.t("contextMenus.task.tagPlaceholder"), |
| 1480 | confirmText: this.t("common.confirm"), |
| 1481 | cancelText: this.t("common.cancel"), |
| 1482 | onInputReady: (inputEl) => { |
| 1483 | new TagSuggest(plugin.app, inputEl, plugin); |
| 1484 | }, |
| 1485 | }); |
| 1486 | |
| 1487 | const tags = parseTaskTagInput(input); |
| 1488 | if (tags.length === 0) return; |
| 1489 | |
| 1490 | const nextTags = |
| 1491 | mode === "add" ? addTagsToList(task.tags, tags) : removeTagsFromList(task.tags, tags); |
| 1492 | await this.updateTaskTags(task, plugin, nextTags); |
| 1493 | } |
| 1494 | |
| 1495 | private async updateTaskTags( |
| 1496 | task: TaskInfo, |
no test coverage detected