diff options
Diffstat (limited to 'models/users.js')
-rw-r--r-- | models/users.js | 71 |
1 files changed, 18 insertions, 53 deletions
diff --git a/models/users.js b/models/users.js index 83a224ba..08b10eb5 100644 --- a/models/users.js +++ b/models/users.js @@ -119,13 +119,6 @@ Users.attachSchema( type: String, optional: true, }, - 'profile.showDesktopDragHandles': { - /** - * does the user want to hide system messages? - */ - type: Boolean, - optional: true, - }, 'profile.hiddenSystemMessages': { /** * does the user want to hide system messages? @@ -133,13 +126,6 @@ Users.attachSchema( type: Boolean, optional: true, }, - 'profile.hiddenMinicardLabelText': { - /** - * does the user want to hide minicard label texts? - */ - type: Boolean, - optional: true, - }, 'profile.initials': { /** * initials of the user @@ -198,6 +184,7 @@ Users.attachSchema( allowedValues: [ 'board-view-lists', 'board-view-swimlanes', + 'board-view-collapse', 'board-view-cal', ], }, @@ -395,10 +382,18 @@ Users.helpers({ } return ret; }, - hasSortBy() { - // if use doesn't have dragHandle, then we can let user to choose sort list by different order - return !this.hasShowDesktopDragHandles(); - }, + //hasSortBy() { + // if use doesn't have dragHandle, then we can let user to choose sort list by different order + //return this.hasShowDesktopDragHandles(); + // return false; + /* + if (typeof currentUser === 'undefined' || typeof currentUser === 'null') { + return false; + } else { + return this.hasShowDesktopDragHandles(); + } + */ + //}, getListSortBy() { return this._getListSortBy()[0]; }, @@ -419,21 +414,11 @@ Users.helpers({ return _.contains(notifications, activityId); }, - hasShowDesktopDragHandles() { - const profile = this.profile || {}; - return profile.showDesktopDragHandles || false; - }, - hasHiddenSystemMessages() { const profile = this.profile || {}; return profile.hiddenSystemMessages || false; }, - hasHiddenMinicardLabelText() { - const profile = this.profile || {}; - return profile.hiddenMinicardLabelText || false; - }, - getEmailBuffer() { const { emailBuffer = [] } = this.profile || {}; return emailBuffer; @@ -455,8 +440,11 @@ Users.helpers({ }, getLimitToShowCardsCount() { - const profile = this.profile || {}; - return profile.showCardsCountAt; + currentUser = Meteor.user(); + if (currentUser) { + const profile = this.profile || {}; + return profile.showCardsCountAt; + } }, getName() { @@ -536,13 +524,6 @@ Users.mutations({ }, }; }, - toggleDesktopHandles(value = false) { - return { - $set: { - 'profile.showDesktopDragHandles': !value, - }, - }; - }, toggleSystem(value = false) { return { @@ -552,14 +533,6 @@ Users.mutations({ }; }, - toggleLabelText(value = false) { - return { - $set: { - 'profile.hiddenMinicardLabelText': !value, - }, - }; - }, - addNotification(activityId) { return { $addToSet: { @@ -624,18 +597,10 @@ Meteor.methods({ check(value, String); Meteor.user().setListSortBy(value); }, - toggleDesktopDragHandles() { - const user = Meteor.user(); - user.toggleDesktopHandles(user.hasShowDesktopDragHandles()); - }, toggleSystemMessages() { 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); |