mirror of
https://github.com/wekan/wekan.git
synced 2026-01-26 19:26:09 +01:00
New change settings option and possibility to hide system messagaes
This commit is contained in:
parent
94cdcff79f
commit
8290dcb249
6 changed files with 61 additions and 13 deletions
|
|
@ -59,6 +59,10 @@ Users.attachSchema(new SimpleSchema({
|
|||
type: String,
|
||||
optional: true,
|
||||
},
|
||||
'profile.hiddenSystemMessages': {
|
||||
type: Boolean,
|
||||
optional: true
|
||||
},
|
||||
'profile.initials': {
|
||||
type: String,
|
||||
optional: true,
|
||||
|
|
@ -151,6 +155,11 @@ Users.helpers({
|
|||
return _.contains(notifications, activityId);
|
||||
},
|
||||
|
||||
hasHiddenSystemMessages() {
|
||||
const profile = this.profile || {};
|
||||
return profile.hiddenSystemMessages || false;
|
||||
},
|
||||
|
||||
getEmailBuffer() {
|
||||
const {emailBuffer = []} = this.profile;
|
||||
return emailBuffer;
|
||||
|
|
@ -231,6 +240,14 @@ Users.mutations({
|
|||
this.addTag(tag);
|
||||
},
|
||||
|
||||
toggleSystem(value = false) {
|
||||
return {
|
||||
$set: {
|
||||
'profile.hiddenSystemMessages': !value,
|
||||
},
|
||||
};
|
||||
},
|
||||
|
||||
addNotification(activityId) {
|
||||
return {
|
||||
$addToSet: {
|
||||
|
|
@ -278,6 +295,10 @@ Meteor.methods({
|
|||
Users.update(this.userId, {$set: { username }});
|
||||
}
|
||||
},
|
||||
toggleSystemMessages() {
|
||||
user = Meteor.user();
|
||||
user.toggleSystem(user.hasHiddenSystemMessages());
|
||||
},
|
||||
});
|
||||
|
||||
if (Meteor.isServer) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue