mirror of
https://github.com/wekan/wekan.git
synced 2026-02-17 13:38:07 +01:00
Merge pull request #5490 from mfilser/master
change Meteor.user() to ReactiveCache.getCurrentUser()
This commit is contained in:
commit
b6ce81dc79
7 changed files with 10 additions and 13 deletions
|
|
@ -196,7 +196,7 @@ BlazeComponent.extendComponent({
|
||||||
},
|
},
|
||||||
|
|
||||||
listWidth() {
|
listWidth() {
|
||||||
const user = Meteor.user();
|
const user = ReactiveCache.getCurrentUser();
|
||||||
const list = Template.currentData();
|
const list = Template.currentData();
|
||||||
return user.getListWidth(list.boardId, list._id);
|
return user.getListWidth(list.boardId, list._id);
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -362,7 +362,7 @@ BlazeComponent.extendComponent({
|
||||||
listWidthValue() {
|
listWidthValue() {
|
||||||
const list = Template.currentData();
|
const list = Template.currentData();
|
||||||
const board = list.boardId;
|
const board = list.boardId;
|
||||||
return Meteor.user().getListWidth(board, list._id);
|
return ReactiveCache.getCurrentUser().getListWidth(board, list._id);
|
||||||
},
|
},
|
||||||
|
|
||||||
events() {
|
events() {
|
||||||
|
|
|
||||||
|
|
@ -224,7 +224,7 @@ BlazeComponent.extendComponent({
|
||||||
swimlaneHeightValue() {
|
swimlaneHeightValue() {
|
||||||
const swimlane = this.currentData();
|
const swimlane = this.currentData();
|
||||||
const board = swimlane.boardId;
|
const board = swimlane.boardId;
|
||||||
return Meteor.user().getSwimlaneHeight(board, swimlane._id);
|
return ReactiveCache.getCurrentUser().getSwimlaneHeight(board, swimlane._id);
|
||||||
},
|
},
|
||||||
|
|
||||||
events() {
|
events() {
|
||||||
|
|
|
||||||
|
|
@ -225,7 +225,7 @@ BlazeComponent.extendComponent({
|
||||||
},
|
},
|
||||||
|
|
||||||
swimlaneHeight() {
|
swimlaneHeight() {
|
||||||
const user = Meteor.user();
|
const user = ReactiveCache.getCurrentUser();
|
||||||
const swimlane = Template.currentData();
|
const swimlane = Template.currentData();
|
||||||
const height = user.getSwimlaneHeight(swimlane.boardId, swimlane._id);
|
const height = user.getSwimlaneHeight(swimlane.boardId, swimlane._id);
|
||||||
return height == -1 ? "auto" : (height + "px");
|
return height == -1 ? "auto" : (height + "px");
|
||||||
|
|
@ -288,7 +288,7 @@ BlazeComponent.extendComponent({
|
||||||
|
|
||||||
Template.swimlane.helpers({
|
Template.swimlane.helpers({
|
||||||
canSeeAddList() {
|
canSeeAddList() {
|
||||||
return Meteor.user().isBoardAdmin();
|
return ReactiveCache.getCurrentUser().isBoardAdmin();
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -325,7 +325,7 @@ Template.changeSettingsPopup.helpers({
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
startDayOfWeek() {
|
startDayOfWeek() {
|
||||||
currentUser = Meteor.user();
|
currentUser = ReactiveCache.getCurrentUser();
|
||||||
if (currentUser) {
|
if (currentUser) {
|
||||||
return currentUser.getStartDayOfWeek();
|
return currentUser.getStartDayOfWeek();
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -343,7 +343,7 @@ Template.changeSettingsPopup.events({
|
||||||
return ret;
|
return ret;
|
||||||
},
|
},
|
||||||
'click .js-toggle-desktop-drag-handles'() {
|
'click .js-toggle-desktop-drag-handles'() {
|
||||||
currentUser = Meteor.user();
|
const currentUser = ReactiveCache.getCurrentUser();
|
||||||
if (currentUser) {
|
if (currentUser) {
|
||||||
Meteor.call('toggleDesktopDragHandles');
|
Meteor.call('toggleDesktopDragHandles');
|
||||||
} else if (window.localStorage.getItem('showDesktopDragHandles')) {
|
} else if (window.localStorage.getItem('showDesktopDragHandles')) {
|
||||||
|
|
@ -375,7 +375,7 @@ Template.changeSettingsPopup.events({
|
||||||
templateInstance.$('#start-day-of-week').val(),
|
templateInstance.$('#start-day-of-week').val(),
|
||||||
10,
|
10,
|
||||||
);
|
);
|
||||||
const currentUser = Meteor.user();
|
const currentUser = ReactiveCache.getCurrentUser();
|
||||||
if (isNaN(minLimit) || minLimit < -1) {
|
if (isNaN(minLimit) || minLimit < -1) {
|
||||||
minLimit = -1;
|
minLimit = -1;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -128,9 +128,6 @@ ReactiveCacheServer = {
|
||||||
return ret;
|
return ret;
|
||||||
},
|
},
|
||||||
getUsers(selector = {}, options = {}, getQuery = false) {
|
getUsers(selector = {}, options = {}, getQuery = false) {
|
||||||
// getUsers(selector, options, getQuery) {
|
|
||||||
// let ret = Users.find(undefined, {});
|
|
||||||
// console.log("getUser count: ", ret.count())
|
|
||||||
let ret = Users.find(selector, options);
|
let ret = Users.find(selector, options);
|
||||||
if (getQuery !== true) {
|
if (getQuery !== true) {
|
||||||
ret = ret.fetch();
|
ret = ret.fetch();
|
||||||
|
|
|
||||||
|
|
@ -1248,14 +1248,14 @@ Meteor.methods({
|
||||||
check(boardId, String);
|
check(boardId, String);
|
||||||
check(listId, String);
|
check(listId, String);
|
||||||
check(width, Number);
|
check(width, Number);
|
||||||
const user = Meteor.user();
|
const user = ReactiveCache.getCurrentUser();
|
||||||
user.setListWidth(boardId, listId, width);
|
user.setListWidth(boardId, listId, width);
|
||||||
},
|
},
|
||||||
applySwimlaneHeight(boardId, swimlaneId, height) {
|
applySwimlaneHeight(boardId, swimlaneId, height) {
|
||||||
check(boardId, String);
|
check(boardId, String);
|
||||||
check(swimlaneId, String);
|
check(swimlaneId, String);
|
||||||
check(height, Number);
|
check(height, Number);
|
||||||
const user = Meteor.user();
|
const user = ReactiveCache.getCurrentUser();
|
||||||
user.setSwimlaneHeight(boardId, swimlaneId, height);
|
user.setSwimlaneHeight(boardId, swimlaneId, height);
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue