mirror of
https://github.com/wekan/wekan.git
synced 2026-01-04 00:28:49 +01:00
Fix Unable to delete Checklist. Added confirm delete to Checklist and Chekclist Item.
Thanks to C0rn3j and xet7 ! Fixes #6020
This commit is contained in:
parent
2d87ba18b3
commit
cf62807ad5
3 changed files with 40 additions and 19 deletions
|
|
@ -62,6 +62,10 @@ template(name="checklistDeletePopup")
|
|||
p {{_ 'confirm-checklist-delete-popup'}}
|
||||
button.js-confirm.negate.full(type="submit") {{_ 'delete'}}
|
||||
|
||||
template(name="checklistItemDeletePopup")
|
||||
p {{_ 'confirm-checklist-delete-popup'}}
|
||||
button.js-confirm.negate.full(type="submit") {{_ 'delete'}}
|
||||
|
||||
template(name="addChecklistItemForm")
|
||||
a(title="{{_ 'copy-text-to-clipboard'}}")
|
||||
span.copied-tooltip {{_ 'copied'}}
|
||||
|
|
@ -95,10 +99,13 @@ template(name="editChecklistItemForm")
|
|||
| ❌
|
||||
span(title=createdAt) {{ moment createdAt }}
|
||||
if canModifyCard
|
||||
a.js-delete-checklist-item {{_ "delete"}}...
|
||||
a.js-convert-checklist-item-to-card
|
||||
| 📋
|
||||
| {{_ 'convertChecklistItemToCardPopup-title'}}
|
||||
if $eq type 'item'
|
||||
a.js-delete-checklist-item {{_ "delete"}}...
|
||||
a.js-convert-checklist-item-to-card
|
||||
| 📋
|
||||
| {{_ 'convertChecklistItemToCardPopup-title'}}
|
||||
else
|
||||
a.js-delete-checklist {{_ "delete"}}...
|
||||
|
||||
template(name="checklistItems")
|
||||
if checklist.items.length
|
||||
|
|
|
|||
|
|
@ -157,14 +157,6 @@ BlazeComponent.extendComponent({
|
|||
textarea.focus();
|
||||
},
|
||||
|
||||
deleteItem() {
|
||||
const checklist = this.currentData().checklist;
|
||||
const item = this.currentData().item;
|
||||
if (checklist && item && item._id) {
|
||||
ChecklistItems.remove(item._id);
|
||||
}
|
||||
},
|
||||
|
||||
editChecklist(event) {
|
||||
event.preventDefault();
|
||||
const textarea = this.find('textarea.js-edit-checklist-item');
|
||||
|
|
@ -216,7 +208,25 @@ BlazeComponent.extendComponent({
|
|||
'submit .js-add-checklist-item': this.addChecklistItem,
|
||||
'submit .js-edit-checklist-item': this.editChecklistItem,
|
||||
'click .js-convert-checklist-item-to-card': Popup.open('convertChecklistItemToCard'),
|
||||
'click .js-delete-checklist-item': this.deleteItem,
|
||||
'click .js-delete-checklist-item'(event) {
|
||||
const item = this.currentData().item;
|
||||
const confirmFunc = Popup.afterConfirm('checklistItemDelete', function () {
|
||||
if (item && item._id) {
|
||||
ChecklistItems.remove(item._id);
|
||||
}
|
||||
});
|
||||
confirmFunc.call(this, event);
|
||||
},
|
||||
'click .js-delete-checklist'(event) {
|
||||
const checklist = this.currentData().checklist;
|
||||
const confirmFunc = Popup.afterConfirm('checklistDelete', function () {
|
||||
Popup.back(2);
|
||||
if (checklist && checklist._id) {
|
||||
Checklists.remove(checklist._id);
|
||||
}
|
||||
});
|
||||
confirmFunc.call(this, event);
|
||||
},
|
||||
'focus .js-add-checklist-item': this.focusChecklistItem,
|
||||
// add and delete checklist / checklist-item
|
||||
'click .js-open-inlined-form': this.closeAllInlinedForms,
|
||||
|
|
@ -303,13 +313,16 @@ BlazeComponent.extendComponent({
|
|||
events() {
|
||||
return [
|
||||
{
|
||||
'click .js-delete-checklist': Popup.afterConfirm('checklistDelete', function () {
|
||||
Popup.back(2);
|
||||
'click .js-delete-checklist'(event) {
|
||||
const checklist = this.data().checklist;
|
||||
if (checklist && checklist._id) {
|
||||
Checklists.remove(checklist._id);
|
||||
}
|
||||
}),
|
||||
const confirmFunc = Popup.afterConfirm('checklistDelete', function () {
|
||||
Popup.back(2);
|
||||
if (checklist && checklist._id) {
|
||||
Checklists.remove(checklist._id);
|
||||
}
|
||||
});
|
||||
confirmFunc.call(this, event);
|
||||
},
|
||||
'click .js-move-checklist': Popup.open('moveChecklist'),
|
||||
'click .js-copy-checklist': Popup.open('copyChecklist'),
|
||||
'click .js-hide-checked-checklist-items'(event) {
|
||||
|
|
|
|||
|
|
@ -345,6 +345,7 @@
|
|||
"confirm-checklist-delete-popup": "Are you sure you want to delete the checklist?",
|
||||
"subtaskDeletePopup-title": "Delete Subtask?",
|
||||
"checklistDeletePopup-title": "Delete Checklist?",
|
||||
"checklistItemDeletePopup-title": "Delete Checklist Item?",
|
||||
"copy-card-link-to-clipboard": "Copy card link to clipboard",
|
||||
"copy-text-to-clipboard": "Copy text to clipboard",
|
||||
"linkCardPopup-title": "Link Card",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue