mirror of
https://github.com/wekan/wekan.git
synced 2026-02-25 01:14:06 +01:00
Import single card: map labels
This commit is contained in:
parent
432c1ebb5d
commit
68518f5497
2 changed files with 41 additions and 12 deletions
|
|
@ -92,6 +92,12 @@ Boards.helpers({
|
|||
return _.where(this.members, {isActive: true});
|
||||
},
|
||||
|
||||
getLabel(name, color) {
|
||||
return this.labels.find((current) => {
|
||||
return ((current.name === name) && (current.color === color));
|
||||
});
|
||||
},
|
||||
|
||||
labelIndex(labelId) {
|
||||
return _.indexOf(_.pluck(this.labels, '_id'), labelId);
|
||||
},
|
||||
|
|
@ -293,8 +299,8 @@ if (Meteor.isServer) {
|
|||
});
|
||||
});
|
||||
|
||||
// If the user remove one label from a board, we cant to remove reference of
|
||||
// this label in any card of this board.
|
||||
// If the user removes a label from a board, we have to remove references to
|
||||
// this label in all cards of the board.
|
||||
Boards.after.update((userId, doc, fieldNames, modifier) => {
|
||||
if (!_.contains(fieldNames, 'labels') ||
|
||||
!modifier.$pull ||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue