summaryrefslogtreecommitdiffstats
path: root/models/users.js
diff options
context:
space:
mode:
authorLauri Ojansivu <x@xet7.org>2019-08-07 18:11:34 +0300
committerLauri Ojansivu <x@xet7.org>2019-08-07 18:11:34 +0300
commitf7e0b837d394d55d66d451c34f43fa8afd357e5b (patch)
tree66501aac3b02ea6d83e6ad1a1b13958c5da56522 /models/users.js
parent9e60b414388ec8d5dcb64c638077351b2e2c3bed (diff)
downloadwekan-f7e0b837d394d55d66d451c34f43fa8afd357e5b.tar.gz
wekan-f7e0b837d394d55d66d451c34f43fa8afd357e5b.tar.bz2
wekan-f7e0b837d394d55d66d451c34f43fa8afd357e5b.zip
Hide minicard label text: per user checkbox setting at sidebar.
Thanks to xet7 ! Closes #1466, closes #2561
Diffstat (limited to 'models/users.js')
-rw-r--r--models/users.js26
1 files changed, 25 insertions, 1 deletions
diff --git a/models/users.js b/models/users.js
index 0af82fa6..46e56ad6 100644
--- a/models/users.js
+++ b/models/users.js
@@ -109,7 +109,14 @@ Users.attachSchema(
},
'profile.hiddenSystemMessages': {
/**
- * does the user wants to hide system messages?
+ * does the user want to hide system messages?
+ */
+ type: Boolean,
+ optional: true,
+ },
+ 'profile.hiddenMinicardLabelText': {
+ /**
+ * does the user want to hide minicard label texts?
*/
type: Boolean,
optional: true,
@@ -359,6 +366,11 @@ Users.helpers({
return profile.hiddenSystemMessages || false;
},
+ hasHiddenMinicardLabelText() {
+ const profile = this.profile || {};
+ return profile.hiddenMinicardLabelText || false;
+ },
+
getEmailBuffer() {
const { emailBuffer = [] } = this.profile || {};
return emailBuffer;
@@ -462,6 +474,14 @@ Users.mutations({
};
},
+ toggleLabelText(value = false) {
+ return {
+ $set: {
+ 'profile.hiddenMinicardLabelText': !value,
+ },
+ };
+ },
+
addNotification(activityId) {
return {
$addToSet: {
@@ -525,6 +545,10 @@ Meteor.methods({
const user = Meteor.user();
user.toggleSystem(user.hasHiddenSystemMessages());
},
+ toggleMinicardLabelText() {
+ const user = Meteor.user();
+ user.toggleLabelText(user.hasHiddenMinicardLabelText());
+ },
changeLimitToShowCardsCount(limit) {
check(limit, Number);
Meteor.user().setShowCardsCountAt(limit);