mirror of
https://github.com/wekan/wekan.git
synced 2025-12-16 23:40:13 +01:00
Bug fix: Rules for moving from list/swimlane
Issue: 3703
This commit is contained in:
parent
769bb7a55d
commit
17ab5978ad
2 changed files with 22 additions and 9 deletions
|
|
@ -29,14 +29,26 @@ RulesHelper = {
|
|||
},
|
||||
buildMatchingFieldsMap(activity, matchingFields) {
|
||||
const matchingMap = { activityType: activity.activityType };
|
||||
for (let i = 0; i < matchingFields.length; i++) {
|
||||
matchingFields.forEach(field => {
|
||||
// Creating a matching map with the actual field of the activity
|
||||
// and with the wildcard (for example: trigger when a card is added
|
||||
// in any [*] board
|
||||
matchingMap[matchingFields[i]] = {
|
||||
$in: [activity[matchingFields[i]], '*'],
|
||||
let value = activity[field];
|
||||
if (field === 'oldListName') {
|
||||
const oldList = Lists.findOne({ _id: activity.oldListId });
|
||||
if (oldList) {
|
||||
value = oldList.title;
|
||||
}
|
||||
} else if (field === 'oldSwimlaneName') {
|
||||
const oldSwimlane = Swimlanes.findOne({ _id: activity.oldSwimlaneId });
|
||||
if (oldSwimlane) {
|
||||
value = oldSwimlane.title;
|
||||
}
|
||||
}
|
||||
matchingMap[field] = {
|
||||
$in: [value, '*'],
|
||||
};
|
||||
}
|
||||
});
|
||||
return matchingMap;
|
||||
},
|
||||
performAction(activity, action) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue