diff options
author | Marc Hartmayer <hello@hartmayer.com> | 2020-04-30 01:03:37 +0200 |
---|---|---|
committer | Marc Hartmayer <hello@hartmayer.com> | 2020-04-30 01:59:44 +0200 |
commit | b740381a7248e1e059cecedcf6cd6824abb792b3 (patch) | |
tree | 8076a31bee3e2d84e078f78016ba7fc6247a9a75 /client/components/cards/cardDetails.js | |
parent | 2691f033cbd072864cf79e95d131a93449d3c84d (diff) | |
download | wekan-b740381a7248e1e059cecedcf6cd6824abb792b3.tar.gz wekan-b740381a7248e1e059cecedcf6cd6824abb792b3.tar.bz2 wekan-b740381a7248e1e059cecedcf6cd6824abb792b3.zip |
Refuse to delete a card as long as there is link to it
This fixes https://github.com/wekan/wekan/issues/2785.
Diffstat (limited to 'client/components/cards/cardDetails.js')
-rw-r--r-- | client/components/cards/cardDetails.js | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/client/components/cards/cardDetails.js b/client/components/cards/cardDetails.js index 271fbe2f..e8e36178 100644 --- a/client/components/cards/cardDetails.js +++ b/client/components/cards/cardDetails.js @@ -967,7 +967,12 @@ BlazeComponent.extendComponent({ }, 'click .js-delete': Popup.afterConfirm('cardDelete', function() { Popup.close(); - Cards.remove(this._id); + // verify that there are no linked cards + if (Cards.find({ linkedId: this._id }).count() === 0) { + Cards.remove(this._id); + } else { + // TODO popup... + } Utils.goBoardId(this.boardId); }), 'change .js-field-parent-board'(event) { |