mirror of
https://github.com/wekan/wekan.git
synced 2026-02-05 08:01:49 +01:00
Main flow implemented
This commit is contained in:
parent
9b0eb0a9f1
commit
6828ccd7f1
9 changed files with 100 additions and 15 deletions
|
|
@ -43,14 +43,6 @@ Actions.helpers({
|
|||
|
||||
|
||||
|
||||
if (Meteor.isServer) {
|
||||
Meteor.startup(() => {
|
||||
const rules = Triggers.findOne({});
|
||||
if(!rules){
|
||||
Actions.insert({actionType: "moveCardToTop"});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -60,13 +60,13 @@ Activities.before.insert((userId, doc) => {
|
|||
|
||||
Activities.after.insert((userId, doc) => {
|
||||
const activity = Activities._transform(doc);
|
||||
const matchedTriggers = Triggers.find(activity);
|
||||
if(matchedTriggers.count() > 0){
|
||||
const card = activity.card();
|
||||
Cards.direct.update({_id: card._id},{$set: {title: "ciaooo"}});
|
||||
}
|
||||
RulesHelper.executeRules(activity);
|
||||
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
if (Meteor.isServer) {
|
||||
// For efficiency create indexes on the date of creation, and on the date of
|
||||
// creation in conjunction with the card or board id, as corresponding views
|
||||
|
|
|
|||
|
|
@ -82,7 +82,7 @@ Lists.helpers({
|
|||
};
|
||||
if (swimlaneId)
|
||||
selector.swimlaneId = swimlaneId;
|
||||
return Cards.find(Filter.mongoSelector(selector),
|
||||
return Cards.find(selector,
|
||||
{ sort: ['sort'] });
|
||||
},
|
||||
|
||||
|
|
|
|||
|
|
@ -21,6 +21,11 @@ Rules.mutations({
|
|||
},
|
||||
});
|
||||
|
||||
Rules.helpers({
|
||||
getAction(){
|
||||
return Actions.findOne({_id:this.actionId});
|
||||
},
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -21,6 +21,12 @@ Triggers.allow({
|
|||
|
||||
|
||||
Triggers.helpers({
|
||||
|
||||
|
||||
getRule(){
|
||||
return Rules.findOne({triggerId:this._id});
|
||||
},
|
||||
|
||||
fromList() {
|
||||
return Lists.findOne(this.fromId);
|
||||
},
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue