diff --git a/plugins/board-assets/lang/en.json b/plugins/board-assets/lang/en.json index a9c62e12d5..a5deca3637 100644 --- a/plugins/board-assets/lang/en.json +++ b/plugins/board-assets/lang/en.json @@ -104,6 +104,8 @@ "SwitchToCards": "Switch to cards", "SearchArchive": "Search archive...", "Size": "Size", - "RemoveCover": "Remove cover" + "RemoveCover": "Remove cover", + "DeleteChecklist": "Delete checklist", + "DeleteChecklistConfirm": "Deleting a checklist is permanent and there is no way to get it back." } } diff --git a/plugins/board-assets/lang/ru.json b/plugins/board-assets/lang/ru.json index 0307a87a04..ae8148b410 100644 --- a/plugins/board-assets/lang/ru.json +++ b/plugins/board-assets/lang/ru.json @@ -104,6 +104,8 @@ "SwitchToCards": "К карточкам", "SearchArchive": "Поиск в архиве...", "Size": "Размер", - "RemoveCover": "Удалить обложку" + "RemoveCover": "Удалить обложку", + "DeleteChecklist": "Удалить список задач", + "DeleteChecklistConfirm": "Удаление списка задач необратимо, и не будет возможности его вернуть." } } diff --git a/plugins/board-resources/src/components/editor/CardChecklist.svelte b/plugins/board-resources/src/components/editor/CardChecklist.svelte index 0776c6da8f..1c63d69ddf 100644 --- a/plugins/board-resources/src/components/editor/CardChecklist.svelte +++ b/plugins/board-resources/src/components/editor/CardChecklist.svelte @@ -14,7 +14,7 @@ --> <script lang="ts"> import { Ref } from '@anticrm/core' - import { createQuery, getClient } from '@anticrm/presentation' + import { createQuery, getClient, MessageBox } from '@anticrm/presentation' import type { TodoItem } from '@anticrm/task' import task from '@anticrm/task' import { Button, CheckBox, TextAreaEditor, Icon, IconMoreH, Progress, showPopup } from '@anticrm/ui' @@ -39,13 +39,25 @@ if (!value) { return } - client.removeCollection( - value._class, - value.space, - value._id, - value.attachedTo, - value.attachedToClass, - value.collection + showPopup( + MessageBox, + { + label: board.string.DeleteChecklist, + message: board.string.DeleteChecklistConfirm + }, + undefined, + (result?: boolean) => { + if (result === true) { + client.removeCollection( + value._class, + value.space, + value._id, + value.attachedTo, + value.attachedToClass, + value.collection + ) + } + } ) } diff --git a/plugins/board-resources/src/plugin.ts b/plugins/board-resources/src/plugin.ts index 1dbbdb3b87..bdce511ded 100644 --- a/plugins/board-resources/src/plugin.ts +++ b/plugins/board-resources/src/plugin.ts @@ -125,7 +125,9 @@ export default mergeIds(boardId, board, { SwitchToCards: '' as IntlString, SearchArchive: '' as IntlString, Size: '' as IntlString, - RemoveCover: '' as IntlString + RemoveCover: '' as IntlString, + DeleteChecklist: '' as IntlString, + DeleteChecklistConfirm: '' as IntlString }, component: { EditCard: '' as AnyComponent,