summaryrefslogtreecommitdiffstats
path: root/client/components/lists/listBody.js
diff options
context:
space:
mode:
author蔡仲明 (Romulus Urakagi Tsai) <urakagi@gmail.com>2019-11-21 11:25:56 +0800
committerGitHub <noreply@github.com>2019-11-21 11:25:56 +0800
commit3e0bedd8c7a6dec97352212adb1cbde1ade44190 (patch)
tree651ff30d25ddb0416444370368d699e597c142d7 /client/components/lists/listBody.js
parent9bbeb73db1cd0ce1caaaca8dfb14ea92131bbf9d (diff)
parent4f5de87cc4c2281bd576548693de7c94e6a988c6 (diff)
downloadwekan-3e0bedd8c7a6dec97352212adb1cbde1ade44190.tar.gz
wekan-3e0bedd8c7a6dec97352212adb1cbde1ade44190.tar.bz2
wekan-3e0bedd8c7a6dec97352212adb1cbde1ade44190.zip
Merge pull request #1 from wekan/master
Update master
Diffstat (limited to 'client/components/lists/listBody.js')
-rw-r--r--client/components/lists/listBody.js46
1 files changed, 27 insertions, 19 deletions
diff --git a/client/components/lists/listBody.js b/client/components/lists/listBody.js
index a1a4c11a..b0974705 100644
--- a/client/components/lists/listBody.js
+++ b/client/components/lists/listBody.js
@@ -48,7 +48,6 @@ BlazeComponent.extendComponent({
const board = this.data().board();
let linkedId = '';
let swimlaneId = '';
- const boardView = (Meteor.user().profile || {}).boardView;
let cardType = 'cardType-card';
if (title) {
if (board.isTemplatesBoard()) {
@@ -71,14 +70,14 @@ BlazeComponent.extendComponent({
});
cardType = 'cardType-linkedBoard';
}
- } else if (boardView === 'board-view-swimlanes')
+ } else if (Utils.boardView() === 'board-view-swimlanes')
swimlaneId = this.parentComponent()
.parentComponent()
.data()._id;
else if (
- boardView === 'board-view-lists' ||
- boardView === 'board-view-cal' ||
- !boardView
+ Utils.boardView() === 'board-view-lists' ||
+ Utils.boardView() === 'board-view-cal' ||
+ !Utils.boardView
)
swimlaneId = board.getDefaultSwimline()._id;
@@ -157,9 +156,8 @@ BlazeComponent.extendComponent({
},
idOrNull(swimlaneId) {
- const currentUser = Meteor.user();
if (
- (currentUser.profile || {}).boardView === 'board-view-swimlanes' ||
+ Utils.boardView() === 'board-view-swimlanes' ||
this.data()
.board()
.isTemplatesBoard()
@@ -397,10 +395,9 @@ BlazeComponent.extendComponent({
'.js-swimlane',
);
this.swimlaneId = '';
- const boardView = (Meteor.user().profile || {}).boardView;
- if (boardView === 'board-view-swimlanes')
+ if (Utils.boardView() === 'board-view-swimlanes')
this.swimlaneId = Blaze.getData(swimlane[0])._id;
- else if (boardView === 'board-view-lists' || !boardView)
+ else if (Utils.boardView() === 'board-view-lists' || !Utils.boardView)
this.swimlaneId = Swimlanes.findOne({ boardId: this.boardId })._id;
},
@@ -580,7 +577,7 @@ BlazeComponent.extendComponent({
const swimlane = $(Popup._getTopStack().openerElement).parents(
'.js-swimlane',
);
- if ((Meteor.user().profile || {}).boardView === 'board-view-swimlanes')
+ if (Utils.boardView() === 'board-view-swimlanes')
this.swimlaneId = Blaze.getData(swimlane[0])._id;
else this.swimlaneId = Swimlanes.findOne({ boardId: this.boardId })._id;
// List where to insert card
@@ -701,15 +698,26 @@ BlazeComponent.extendComponent({
this.listId = this.parentComponent().data()._id;
this.swimlaneId = '';
- let user = Meteor.user();
- if (user) {
- const boardView = (Meteor.user().profile || {}).boardView;
- if (boardView === 'board-view-swimlanes') {
- this.swimlaneId = this.parentComponent()
- .parentComponent()
- .parentComponent()
- .data()._id;
+ const isSandstorm =
+ Meteor.settings &&
+ Meteor.settings.public &&
+ Meteor.settings.public.sandstorm;
+
+ if (isSandstorm) {
+ const user = Meteor.user();
+ if (user) {
+ if (Utils.boardView() === 'board-view-swimlanes') {
+ this.swimlaneId = this.parentComponent()
+ .parentComponent()
+ .parentComponent()
+ .data()._id;
+ }
}
+ } else if (Utils.boardView() === 'board-view-swimlanes') {
+ this.swimlaneId = this.parentComponent()
+ .parentComponent()
+ .parentComponent()
+ .data()._id;
}
},