mirror of
https://github.com/wekan/wekan.git
synced 2025-12-17 16:00:13 +01:00
Fixed rules conflicts
This commit is contained in:
parent
506b95107c
commit
d0735e1d8e
1 changed files with 9 additions and 2 deletions
|
|
@ -3,8 +3,10 @@ RulesHelper = {
|
||||||
const matchingRules = this.findMatchingRules(activity);
|
const matchingRules = this.findMatchingRules(activity);
|
||||||
for(let i = 0; i< matchingRules.length; i++){
|
for(let i = 0; i< matchingRules.length; i++){
|
||||||
const action = matchingRules[i].getAction();
|
const action = matchingRules[i].getAction();
|
||||||
|
if(action != undefined){
|
||||||
this.performAction(activity, action);
|
this.performAction(activity, action);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
},
|
},
|
||||||
findMatchingRules(activity){
|
findMatchingRules(activity){
|
||||||
const activityType = activity.activityType;
|
const activityType = activity.activityType;
|
||||||
|
|
@ -16,7 +18,12 @@ RulesHelper = {
|
||||||
const matchingTriggers = Triggers.find(matchingMap);
|
const matchingTriggers = Triggers.find(matchingMap);
|
||||||
const matchingRules = [];
|
const matchingRules = [];
|
||||||
matchingTriggers.forEach(function(trigger){
|
matchingTriggers.forEach(function(trigger){
|
||||||
|
const rule = trigger.getRule();
|
||||||
|
// Check that for some unknown reason there are some leftover triggers
|
||||||
|
// not connected to any rules
|
||||||
|
if(rule != undefined){
|
||||||
matchingRules.push(trigger.getRule());
|
matchingRules.push(trigger.getRule());
|
||||||
|
}
|
||||||
});
|
});
|
||||||
return matchingRules;
|
return matchingRules;
|
||||||
},
|
},
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue