mirror of
https://github.com/wekan/wekan.git
synced 2025-12-16 23:40:13 +01:00
Merge pull request #5412 from e-gaulue/e-gaulue-patch-1
Remove notification while copying board
This commit is contained in:
commit
ae9963c1f7
1 changed files with 14 additions and 0 deletions
|
|
@ -640,11 +640,19 @@ Boards.attachSchema(
|
||||||
Boards.helpers({
|
Boards.helpers({
|
||||||
copy() {
|
copy() {
|
||||||
const oldId = this._id;
|
const oldId = this._id;
|
||||||
|
const oldWatchers = this.watchers ? this.watchers.slice() : [];
|
||||||
delete this._id;
|
delete this._id;
|
||||||
delete this.slug;
|
delete this.slug;
|
||||||
this.title = this.copyTitle();
|
this.title = this.copyTitle();
|
||||||
const _id = Boards.insert(this);
|
const _id = Boards.insert(this);
|
||||||
|
|
||||||
|
// Temporary remove watchers to disable notifications
|
||||||
|
Boards.update(_id, {
|
||||||
|
$set: {
|
||||||
|
watchers: []
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
// Copy all swimlanes in board
|
// Copy all swimlanes in board
|
||||||
ReactiveCache.getSwimlanes({
|
ReactiveCache.getSwimlanes({
|
||||||
boardId: oldId,
|
boardId: oldId,
|
||||||
|
|
@ -695,6 +703,12 @@ Boards.helpers({
|
||||||
rule.triggerId = triggersMap[rule.triggerId];
|
rule.triggerId = triggersMap[rule.triggerId];
|
||||||
Rules.insert(rule);
|
Rules.insert(rule);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// Re-set Watchers to reenable notification
|
||||||
|
Boards.update(_id, {
|
||||||
|
$set: { watchers: oldWatchers }
|
||||||
|
});
|
||||||
|
|
||||||
return _id;
|
return _id;
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue