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 !
This commit is contained in:
Lauri Ojansivu 2019-11-18 22:23:49 +02:00
parent 2079a5bfa3
commit 96abe3c691
19 changed files with 459 additions and 175 deletions

View file

@ -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);