summaryrefslogtreecommitdiffstats
path: root/models
diff options
context:
space:
mode:
authorLauri Ojansivu <x@xet7.org>2020-04-08 23:16:48 +0300
committerLauri Ojansivu <x@xet7.org>2020-04-08 23:16:48 +0300
commit5ebb47cb0ec7272894a37d99579ede872251f55c (patch)
treeceb4d44c91c0b90d4e2a2e29274117c86fbb8f0a /models
parent115701fa653067f05ad53677d4398d25e89402b6 (diff)
downloadwekan-5ebb47cb0ec7272894a37d99579ede872251f55c.tar.gz
wekan-5ebb47cb0ec7272894a37d99579ede872251f55c.tar.bz2
wekan-5ebb47cb0ec7272894a37d99579ede872251f55c.zip
Add setting default NOTIFICATION_TRAY_AFTER_READ_DAYS_BEFORE_REMOVE=2
to all Wekan platforms https://github.com/wekan/wekan/pull/2998 Thanks to xet7 !
Diffstat (limited to 'models')
-rw-r--r--models/cards.js62
-rw-r--r--models/users.js3
2 files changed, 33 insertions, 32 deletions
diff --git a/models/cards.js b/models/cards.js
index 1ee4ba68..94b174bb 100644
--- a/models/cards.js
+++ b/models/cards.js
@@ -334,8 +334,8 @@ Cards.attachSchema(
'vote.end': {
type: Date,
optional: true,
- defaultValue: null
- }
+ defaultValue: null,
+ },
}),
);
@@ -728,7 +728,7 @@ Cards.helpers({
parentString(sep) {
return this.parentList()
- .map(function (elem) {
+ .map(function(elem) {
return elem.title;
})
.join(sep);
@@ -1449,11 +1449,11 @@ Cards.mutations({
$set: {
vote: {
question,
- positive:[],
- negative:[]
+ positive: [],
+ negative: [],
},
- }
- }
+ },
+ };
},
unsetVote() {
return {
@@ -1467,32 +1467,32 @@ Cards.mutations({
case true:
// vote for it
return {
- $pull:{
- "vote.negative": userId
+ $pull: {
+ 'vote.negative': userId,
},
$addToSet: {
- "vote.positive": userId
- }
- }
+ 'vote.positive': userId,
+ },
+ };
case false:
// vote against
return {
- $pull:{
- "vote.positive": userId
+ $pull: {
+ 'vote.positive': userId,
},
$addToSet: {
- "vote.negative" : userId
- }
- }
+ 'vote.negative': userId,
+ },
+ };
default:
// Remove votes
return {
- $pull:{
- "vote.positive": userId,
- "vote.negative" : userId
+ $pull: {
+ 'vote.positive': userId,
+ 'vote.negative': userId,
},
- }
+ };
}
},
});
@@ -1897,7 +1897,7 @@ if (Meteor.isServer) {
});
//New activity for card moves
- Cards.after.update(function (userId, doc, fieldNames) {
+ Cards.after.update(function(userId, doc, fieldNames) {
const oldListId = this.previous.listId;
const oldSwimlaneId = this.previous.swimlaneId;
const oldBoardId = this.previous.boardId;
@@ -1943,7 +1943,7 @@ if (Meteor.isServer) {
// change list modifiedAt, when user modified the key values in timingaction array, if it's endAt, put the modifiedAt of list back to one year ago for sorting purpose
const modifiedAt = new Date(
new Date(value).getTime() -
- (action === 'endAt' ? 365 * 24 * 3600 * 1e3 : 0),
+ (action === 'endAt' ? 365 * 24 * 3600 * 1e3 : 0),
); // set it as 1 year before
const boardId = list.boardId;
Lists.direct.update(
@@ -1997,7 +1997,7 @@ if (Meteor.isServer) {
JsonRoutes.add(
'GET',
'/api/boards/:boardId/swimlanes/:swimlaneId/cards',
- function (req, res) {
+ function(req, res) {
const paramBoardId = req.params.boardId;
const paramSwimlaneId = req.params.swimlaneId;
Authentication.checkBoardAccess(req.userId, paramBoardId);
@@ -2007,7 +2007,7 @@ if (Meteor.isServer) {
boardId: paramBoardId,
swimlaneId: paramSwimlaneId,
archived: false,
- }).map(function (doc) {
+ }).map(function(doc) {
return {
_id: doc._id,
title: doc.title,
@@ -2031,7 +2031,7 @@ if (Meteor.isServer) {
* title: string,
* description: string}]
*/
- JsonRoutes.add('GET', '/api/boards/:boardId/lists/:listId/cards', function (
+ JsonRoutes.add('GET', '/api/boards/:boardId/lists/:listId/cards', function(
req,
res,
) {
@@ -2044,7 +2044,7 @@ if (Meteor.isServer) {
boardId: paramBoardId,
listId: paramListId,
archived: false,
- }).map(function (doc) {
+ }).map(function(doc) {
return {
_id: doc._id,
title: doc.title,
@@ -2066,7 +2066,7 @@ if (Meteor.isServer) {
JsonRoutes.add(
'GET',
'/api/boards/:boardId/lists/:listId/cards/:cardId',
- function (req, res) {
+ function(req, res) {
const paramBoardId = req.params.boardId;
const paramListId = req.params.listId;
const paramCardId = req.params.cardId;
@@ -2098,7 +2098,7 @@ if (Meteor.isServer) {
* @param {string} [assignees] the array of maximum one ID of assignee of the new card
* @return_type {_id: string}
*/
- JsonRoutes.add('POST', '/api/boards/:boardId/lists/:listId/cards', function (
+ JsonRoutes.add('POST', '/api/boards/:boardId/lists/:listId/cards', function(
req,
res,
) {
@@ -2205,7 +2205,7 @@ if (Meteor.isServer) {
JsonRoutes.add(
'PUT',
'/api/boards/:boardId/lists/:listId/cards/:cardId',
- function (req, res) {
+ function(req, res) {
Authentication.checkUserId(req.userId);
const paramBoardId = req.params.boardId;
const paramCardId = req.params.cardId;
@@ -2504,7 +2504,7 @@ if (Meteor.isServer) {
JsonRoutes.add(
'DELETE',
'/api/boards/:boardId/lists/:listId/cards/:cardId',
- function (req, res) {
+ function(req, res) {
Authentication.checkUserId(req.userId);
const paramBoardId = req.params.boardId;
const paramListId = req.params.listId;
diff --git a/models/users.js b/models/users.js
index 9b2a5465..8a05a0d2 100644
--- a/models/users.js
+++ b/models/users.js
@@ -931,7 +931,8 @@ if (Meteor.isServer) {
const addCronJob = _.debounce(
Meteor.bindEnvironment(function notificationCleanupDebounced() {
// passed in the removeAge has to be a number standing for the number of days after a notification is read before we remove it
- const envRemoveAge = process.env.NOTIFICATION_REMOVAL_AGE;
+ const envRemoveAge =
+ process.env.NOTIFICATION_TRAY_AFTER_READ_DAYS_BEFORE_REMOVE;
// default notifications will be removed 2 days after they are read
const defaultRemoveAge = 2;
const removeAge = parseInt(envRemoveAge, 10) || defaultRemoveAge;