mirror of
https://github.com/wekan/wekan.git
synced 2025-09-22 01:50:48 +02:00
Remove notification while copying board
1. It takes too long while server stops after 2 minutes (#5371). 2. It is useless, because when you copy a board, most of the time your users don't want to be notified of every copied cards.
This commit is contained in:
parent
db73fb4e37
commit
58f6acbc48
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