diff options
author | Lauri Ojansivu <x@xet7.org> | 2020-05-14 01:06:46 +0300 |
---|---|---|
committer | Lauri Ojansivu <x@xet7.org> | 2020-05-14 01:06:46 +0300 |
commit | 9c6cd51ca720502cc993451505f95a43ef16a707 (patch) | |
tree | 697e686168f41fef0da5903722bbda98e17d0ff0 /client/components/cards/cardDetails.js | |
parent | 2f33e3a76be0c58d07e628a48d8d32db46e6127c (diff) | |
parent | ea74a34d72fb0f33909858a640dbcd3a5fda5b7f (diff) | |
download | wekan-9c6cd51ca720502cc993451505f95a43ef16a707.tar.gz wekan-9c6cd51ca720502cc993451505f95a43ef16a707.tar.bz2 wekan-9c6cd51ca720502cc993451505f95a43ef16a707.zip |
Merge branch 'marc1006-fixes'
Diffstat (limited to 'client/components/cards/cardDetails.js')
-rw-r--r-- | client/components/cards/cardDetails.js | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/client/components/cards/cardDetails.js b/client/components/cards/cardDetails.js index 7dcadfe3..441068b0 100644 --- a/client/components/cards/cardDetails.js +++ b/client/components/cards/cardDetails.js @@ -956,7 +956,23 @@ 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: Maybe later we can list where the linked cards are. + // Now here is popup with a hint that the card cannot be deleted + // as there are linked cards. + // Related: + // client/components/lists/listHeader.js about line 248 + // https://github.com/wekan/wekan/issues/2785 + const message = `${TAPi18n.__( + 'delete-linked-card-before-this-card', + )} linkedId: ${ + this._id + } at client/components/cards/cardDetails.js and https://github.com/wekan/wekan/issues/2785`; + alert(message); + } Utils.goBoardId(this.boardId); }), 'change .js-field-parent-board'(event) { |