summaryrefslogtreecommitdiffstats
path: root/models
diff options
context:
space:
mode:
authorLauri Ojansivu <x@xet7.org>2019-11-18 22:23:49 +0200
committerLauri Ojansivu <x@xet7.org>2019-11-18 22:23:49 +0200
commit96abe3c6914ce37d9fb44da8fda375e40ad65c9e (patch)
tree8798733b85ca4613a199270bf1577feafc8d183d /models
parent2079a5bfa392fbabf63613051e0fa5808fc91be4 (diff)
downloadwekan-96abe3c6914ce37d9fb44da8fda375e40ad65c9e.tar.gz
wekan-96abe3c6914ce37d9fb44da8fda375e40ad65c9e.tar.bz2
wekan-96abe3c6914ce37d9fb44da8fda375e40ad65c9e.zip
New feature: Now there is popup selection of Lists/Swimlanes/Calendar/Roles.
New feature, not set visible yet, because switching to it does not work properly yet: Collapsible Swimlanes #2804 Fix: Public board now loads correctly. When you select one of Lists/Swimlanes/Calendar view and reload webbrowser page, it can change view. Closes #2311 Fix: List sorting commented out. Closes #2800 Fix: Errors hasHiddenMinicardText, hasShowDragHandles, showSort, hasSortBy, profile, FirefoxAndroid/IE11/Vivaldi/Chromium browsers not working by using cookies instead of database. More details at https://github.com/wekan/wekan/issues/2643#issuecomment-554907955 Note: Cookie changes are not always immediate, if there is no effect, you may need to reload webbrowser page. Closes #2643 . Thanks to xet7 !
Diffstat (limited to 'models')
-rw-r--r--models/boards.js8
-rw-r--r--models/swimlanes.js8
-rw-r--r--models/users.js71
3 files changed, 30 insertions, 57 deletions
diff --git a/models/boards.js b/models/boards.js
index 85a7558c..857aa963 100644
--- a/models/boards.js
+++ b/models/boards.js
@@ -409,8 +409,12 @@ Boards.helpers({
},
lists() {
- const enabled = Meteor.user().hasSortBy();
- return enabled ? this.newestLists() : this.draggableLists();
+ //currentUser = Meteor.user();
+ //if (currentUser) {
+ // enabled = Meteor.user().hasSortBy();
+ //}
+ //return enabled ? this.newestLists() : this.draggableLists();
+ return this.draggableLists();
},
newestLists() {
diff --git a/models/swimlanes.js b/models/swimlanes.js
index 831f1eff..aa7016f7 100644
--- a/models/swimlanes.js
+++ b/models/swimlanes.js
@@ -174,8 +174,12 @@ Swimlanes.helpers({
},
lists() {
- const enabled = Meteor.user().hasSortBy();
- return enabled ? this.newestLists() : this.draggableLists();
+ //currentUser = Meteor.user();
+ //if (currentUser) {
+ // enabled = Meteor.user().hasSortBy();
+ //}
+ //return enabled ? this.newestLists() : this.draggableLists();
+ return this.draggableLists();
},
newestLists() {
// sorted lists from newest to the oldest, by its creation date or its cards' last modification date
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);