Add confirmation to delete a checklist (#1775)

This commit is contained in:
Alex 2022-05-18 11:03:48 +07:00 committed by GitHub
parent 077f666619
commit beb009acab
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 29 additions and 11 deletions

View File

@ -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."
}
}

View File

@ -104,6 +104,8 @@
"SwitchToCards": "К карточкам",
"SearchArchive": "Поиск в архиве...",
"Size": "Размер",
"RemoveCover": "Удалить обложку"
"RemoveCover": "Удалить обложку",
"DeleteChecklist": "Удалить список задач",
"DeleteChecklistConfirm": "Удаление списка задач необратимо, и не будет возможности его вернуть."
}
}

View File

@ -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
)
}
}
)
}

View File

@ -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,