mirror of
https://github.com/wekan/wekan.git
synced 2025-09-22 01:50:48 +02:00
Almost full circle
This commit is contained in:
parent
93cc7f0232
commit
9b0eb0a9f1
24 changed files with 492 additions and 165 deletions
|
@ -39,34 +39,7 @@ Triggers.helpers({
|
|||
return _.contains(this.labelIds, label._id);
|
||||
});
|
||||
return cardLabels;
|
||||
}});
|
||||
|
||||
|
||||
|
||||
if (Meteor.isServer) {
|
||||
Meteor.startup(() => {
|
||||
const rules = Triggers.findOne({});
|
||||
if(!rules){
|
||||
Triggers.insert({group: "cards", activityType: "moveCard","fromId":-1,"toId":-1 });
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
Activities.after.insert((userId, doc) => {
|
||||
const activity = Activities._transform(doc);
|
||||
const matchedTriggers = Triggers.find({activityType: activity.activityType,fromId:activity.oldListId,toId:activity.listId})
|
||||
if(matchedTriggers.count() > 0){
|
||||
const card = activity.card();
|
||||
const oldTitle = card.title;
|
||||
const fromListTitle = activity.oldList().title;
|
||||
Cards.direct.update({_id: card._id, listId: card.listId, boardId: card.boardId, archived: false},
|
||||
{$set: {title: "[From "+fromListTitle +"] "+ oldTitle}});
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
}});
|
||||
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue