summaryrefslogtreecommitdiffstats
path: root/client
diff options
context:
space:
mode:
authorLauri Ojansivu <x@xet7.org>2019-11-26 02:29:36 +0200
committerLauri Ojansivu <x@xet7.org>2019-11-26 02:29:36 +0200
commit8898862d36b1f0fe8e7d7bdc80064e5106894d29 (patch)
treea00cd41e7893d16ae7291f3d3fbd8d7a15639066 /client
parent2cc35077409886847870fa554449fd668c2353bf (diff)
downloadwekan-8898862d36b1f0fe8e7d7bdc80064e5106894d29.tar.gz
wekan-8898862d36b1f0fe8e7d7bdc80064e5106894d29.tar.bz2
wekan-8898862d36b1f0fe8e7d7bdc80064e5106894d29.zip
Fix lint errors.
Diffstat (limited to 'client')
-rw-r--r--client/components/boards/boardBody.js35
-rw-r--r--client/components/boards/boardHeader.js12
-rw-r--r--client/components/cards/minicard.js8
-rw-r--r--client/components/lists/list.js23
-rw-r--r--client/components/lists/listHeader.js22
-rw-r--r--client/components/sidebar/sidebar.js6
-rw-r--r--client/components/swimlanes/swimlaneHeader.js4
-rw-r--r--client/components/swimlanes/swimlanes.js50
-rw-r--r--client/components/users/userHeader.js13
-rw-r--r--client/lib/utils.js9
10 files changed, 68 insertions, 114 deletions
diff --git a/client/components/boards/boardBody.js b/client/components/boards/boardBody.js
index 41b6f4ef..55b8c0a1 100644
--- a/client/components/boards/boardBody.js
+++ b/client/components/boards/boardBody.js
@@ -1,3 +1,5 @@
+import { Cookies } from 'meteor/ostrio:cookies';
+const cookies = new Cookies();
const subManager = new SubsManager();
const { calculateIndex, enableClickOnTouch } = Utils;
const swimlaneWhileSortingHeight = 150;
@@ -192,9 +194,6 @@ BlazeComponent.extendComponent({
// ugly touch event hotfix
enableClickOnTouch('.js-swimlane:not(.placeholder)');
- import { Cookies } from 'meteor/ostrio:cookies';
- const cookies = new Cookies();
-
this.autorun(() => {
let showDesktopDragHandles = false;
currentUser = Meteor.user();
@@ -207,8 +206,8 @@ BlazeComponent.extendComponent({
showDesktopDragHandles = false;
}
if (
- Utils.isMiniScreen()
- || (!Utils.isMiniScreen() && showDesktopDragHandles)
+ Utils.isMiniScreen() ||
+ (!Utils.isMiniScreen() && showDesktopDragHandles)
) {
$swimlanesDom.sortable({
handle: '.js-swimlane-header-handle',
@@ -225,9 +224,9 @@ BlazeComponent.extendComponent({
function userIsMember() {
return (
- Meteor.user()
- && Meteor.user().isBoardMember()
- && !Meteor.user().isCommentOnly()
+ Meteor.user() &&
+ Meteor.user().isBoardMember() &&
+ !Meteor.user().isCommentOnly()
);
}
@@ -244,8 +243,6 @@ BlazeComponent.extendComponent({
if (currentUser) {
return (currentUser.profile || {}).boardView === 'board-view-swimlanes';
} else {
- import { Cookies } from 'meteor/ostrio:cookies';
- const cookies = new Cookies();
return cookies.get('boardView') === 'board-view-swimlanes';
}
},
@@ -255,8 +252,6 @@ BlazeComponent.extendComponent({
if (currentUser) {
return (currentUser.profile || {}).boardView === 'board-view-lists';
} else {
- import { Cookies } from 'meteor/ostrio:cookies';
- const cookies = new Cookies();
return cookies.get('boardView') === 'board-view-lists';
}
},
@@ -266,8 +261,6 @@ BlazeComponent.extendComponent({
if (currentUser) {
return (currentUser.profile || {}).boardView === 'board-view-cal';
} else {
- import { Cookies } from 'meteor/ostrio:cookies';
- const cookies = new Cookies();
return cookies.get('boardView') === 'board-view-cal';
}
},
@@ -306,16 +299,16 @@ BlazeComponent.extendComponent({
scrollLeft(position = 0) {
const swimlanes = this.$('.js-swimlanes');
- swimlanes
- && swimlanes.animate({
+ swimlanes &&
+ swimlanes.animate({
scrollLeft: position,
});
},
scrollTop(position = 0) {
const swimlanes = this.$('.js-swimlanes');
- swimlanes
- && swimlanes.animate({
+ swimlanes &&
+ swimlanes.animate({
scrollTop: position,
});
},
@@ -359,8 +352,8 @@ BlazeComponent.extendComponent({
end = end || card.endAt;
title = title || card.title;
const className =
- (extraCls ? `${extraCls} ` : '')
- + (card.color ? `calendar-event-${card.color}` : '');
+ (extraCls ? `${extraCls} ` : '') +
+ (card.color ? `calendar-event-${card.color}` : '');
events.push({
id: card._id,
title,
@@ -430,8 +423,6 @@ BlazeComponent.extendComponent({
if (currentUser) {
return (currentUser.profile || {}).boardView === 'board-view-cal';
} else {
- import { Cookies } from 'meteor/ostrio:cookies';
- const cookies = new Cookies();
return cookies.get('boardView') === 'board-view-cal';
}
},
diff --git a/client/components/boards/boardHeader.js b/client/components/boards/boardHeader.js
index ffbb9b72..eea43bd3 100644
--- a/client/components/boards/boardHeader.js
+++ b/client/components/boards/boardHeader.js
@@ -175,15 +175,6 @@ Template.boardHeaderBar.helpers({
boardView() {
return Utils.boardView();
},
- //collapseSwimlane() {
- // import { Cookies } from 'meteor/ostrio:cookies';
- // const cookies = new Cookies();
- // if (cookies.has('collapseSwimlane')) {
- // return true;
- // } else {
- // return false;
- // }
- //},
});
Template.boardChangeViewPopup.events({
@@ -195,9 +186,6 @@ Template.boardChangeViewPopup.events({
Utils.setBoardView('board-view-swimlanes');
Popup.close();
},
- //'click .js-open-collapse-view'() {
- // Utils.setBoardView('board-view-collapse');
- //Popup.close();
'click .js-open-cal-view'() {
Utils.setBoardView('board-view-cal');
Popup.close();
diff --git a/client/components/cards/minicard.js b/client/components/cards/minicard.js
index a9f92dec..1ea608f5 100644
--- a/client/components/cards/minicard.js
+++ b/client/components/cards/minicard.js
@@ -1,3 +1,5 @@
+import { Cookies } from 'meteor/ostrio:cookies';
+const cookies = new Cookies();
// Template.cards.events({
// 'click .member': Popup.open('cardMember')
// });
@@ -18,8 +20,6 @@ BlazeComponent.extendComponent({
},
{
'click .js-toggle-minicard-label-text'() {
- import { Cookies } from 'meteor/ostrio:cookies';
- const cookies = new Cookies();
if (cookies.has('hiddenMinicardLabelText')) {
cookies.remove('hiddenMinicardLabelText'); //true
} else {
@@ -37,8 +37,6 @@ Template.minicard.helpers({
if (currentUser) {
return (currentUser.profile || {}).showDesktopDragHandles;
} else {
- import { Cookies } from 'meteor/ostrio:cookies';
- const cookies = new Cookies();
if (cookies.has('showDesktopDragHandles')) {
return true;
} else {
@@ -51,8 +49,6 @@ Template.minicard.helpers({
if (currentUser) {
return (currentUser.profile || {}).hiddenMinicardLabelText;
} else {
- import { Cookies } from 'meteor/ostrio:cookies';
- const cookies = new Cookies();
if (cookies.has('hiddenMinicardLabelText')) {
return true;
} else {
diff --git a/client/components/lists/list.js b/client/components/lists/list.js
index e58ea430..89d51e85 100644
--- a/client/components/lists/list.js
+++ b/client/components/lists/list.js
@@ -1,3 +1,5 @@
+import { Cookies } from 'meteor/ostrio:cookies';
+const cookies = new Cookies();
const { calculateIndex, enableClickOnTouch } = Utils;
BlazeComponent.extendComponent({
@@ -22,9 +24,9 @@ BlazeComponent.extendComponent({
function userIsMember() {
return (
- Meteor.user()
- && Meteor.user().isBoardMember()
- && !Meteor.user().isCommentOnly()
+ Meteor.user() &&
+ Meteor.user().isBoardMember() &&
+ !Meteor.user().isCommentOnly()
);
}
@@ -74,14 +76,14 @@ BlazeComponent.extendComponent({
const currentBoard = Boards.findOne(Session.get('currentBoard'));
let swimlaneId = '';
if (
- Utils.boardView() === 'board-view-swimlanes'
- || currentBoard.isTemplatesBoard()
+ Utils.boardView() === 'board-view-swimlanes' ||
+ currentBoard.isTemplatesBoard()
)
swimlaneId = Blaze.getData(ui.item.parents('.swimlane').get(0))._id;
else if (
- Utils.boardView() === 'board-view-lists'
- || Utils.boardView() === 'board-view-cal'
- || !Utils.boardView
+ Utils.boardView() === 'board-view-lists' ||
+ Utils.boardView() === 'board-view-cal' ||
+ !Utils.boardView
)
swimlaneId = currentBoard.getDefaultSwimline()._id;
@@ -115,9 +117,6 @@ BlazeComponent.extendComponent({
// ugly touch event hotfix
enableClickOnTouch(itemsSelector);
- import { Cookies } from 'meteor/ostrio:cookies';
- const cookies = new Cookies();
-
this.autorun(() => {
let showDesktopDragHandles = false;
currentUser = Meteor.user();
@@ -178,8 +177,6 @@ Template.list.helpers({
if (currentUser) {
return (currentUser.profile || {}).showDesktopDragHandles;
} else {
- import { Cookies } from 'meteor/ostrio:cookies';
- const cookies = new Cookies();
if (cookies.has('showDesktopDragHandles')) {
return true;
} else {
diff --git a/client/components/lists/listHeader.js b/client/components/lists/listHeader.js
index 34322fa9..570cc30f 100644
--- a/client/components/lists/listHeader.js
+++ b/client/components/lists/listHeader.js
@@ -1,3 +1,5 @@
+import { Cookies } from 'meteor/ostrio:cookies';
+const cookies = new Cookies();
let listsColors;
Meteor.startup(() => {
listsColors = Lists.simpleSchema()._schema.color.allowedValues;
@@ -7,9 +9,9 @@ BlazeComponent.extendComponent({
canSeeAddCard() {
const list = Template.currentData();
return (
- !list.getWipLimit('enabled')
- || list.getWipLimit('soft')
- || !this.reachedWipLimit()
+ !list.getWipLimit('enabled') ||
+ list.getWipLimit('soft') ||
+ !this.reachedWipLimit()
);
},
@@ -66,8 +68,8 @@ BlazeComponent.extendComponent({
reachedWipLimit() {
const list = Template.currentData();
return (
- list.getWipLimit('enabled')
- && list.getWipLimit('value') <= list.cards().count()
+ list.getWipLimit('enabled') &&
+ list.getWipLimit('value') <= list.cards().count()
);
},
@@ -108,8 +110,6 @@ Template.listHeader.helpers({
if (currentUser) {
return (currentUser.profile || {}).showDesktopDragHandles;
} else {
- import { Cookies } from 'meteor/ostrio:cookies';
- const cookies = new Cookies();
if (cookies.has('showDesktopDragHandles')) {
return true;
} else {
@@ -177,8 +177,8 @@ BlazeComponent.extendComponent({
const list = Template.currentData();
if (
- list.getWipLimit('soft')
- && list.getWipLimit('value') < list.cards().count()
+ list.getWipLimit('soft') &&
+ list.getWipLimit('value') < list.cards().count()
) {
list.setWipLimit(list.cards().count());
}
@@ -189,8 +189,8 @@ BlazeComponent.extendComponent({
const list = Template.currentData();
// Prevent user from using previously stored wipLimit.value if it is less than the current number of cards in the list
if (
- !list.getWipLimit('enabled')
- && list.getWipLimit('value') < list.cards().count()
+ !list.getWipLimit('enabled') &&
+ list.getWipLimit('value') < list.cards().count()
) {
list.setWipLimit(list.cards().count());
}
diff --git a/client/components/sidebar/sidebar.js b/client/components/sidebar/sidebar.js
index 6bb22f39..caf36020 100644
--- a/client/components/sidebar/sidebar.js
+++ b/client/components/sidebar/sidebar.js
@@ -1,3 +1,5 @@
+import { Cookies } from 'meteor/ostrio:cookies';
+const cookies = new Cookies();
Sidebar = null;
const defaultView = 'home';
@@ -111,8 +113,6 @@ BlazeComponent.extendComponent({
if (currentUser) {
Meteor.call('toggleMinicardLabelText');
} else {
- import { Cookies } from 'meteor/ostrio:cookies';
- const cookies = new Cookies();
if (cookies.has('hiddenMinicardLabelText')) {
cookies.remove('hiddenMinicardLabelText');
} else {
@@ -136,8 +136,6 @@ Template.homeSidebar.helpers({
if (currentUser) {
return (currentUser.profile || {}).hiddenMinicardLabelText;
} else {
- import { Cookies } from 'meteor/ostrio:cookies';
- const cookies = new Cookies();
if (cookies.has('hiddenMinicardLabelText')) {
return true;
} else {
diff --git a/client/components/swimlanes/swimlaneHeader.js b/client/components/swimlanes/swimlaneHeader.js
index 69971b05..fbc45351 100644
--- a/client/components/swimlanes/swimlaneHeader.js
+++ b/client/components/swimlanes/swimlaneHeader.js
@@ -1,3 +1,5 @@
+import { Cookies } from 'meteor/ostrio:cookies';
+const cookies = new Cookies();
const { calculateIndexData } = Utils;
let swimlaneColors;
@@ -34,8 +36,6 @@ Template.swimlaneHeader.helpers({
if (currentUser) {
return (currentUser.profile || {}).showDesktopDragHandles;
} else {
- import { Cookies } from 'meteor/ostrio:cookies';
- const cookies = new Cookies();
if (cookies.has('showDesktopDragHandles')) {
return true;
} else {
diff --git a/client/components/swimlanes/swimlanes.js b/client/components/swimlanes/swimlanes.js
index 9bc093be..8687a0e8 100644
--- a/client/components/swimlanes/swimlanes.js
+++ b/client/components/swimlanes/swimlanes.js
@@ -1,10 +1,12 @@
+import { Cookies } from 'meteor/ostrio:cookies';
+const cookies = new Cookies();
const { calculateIndex, enableClickOnTouch } = Utils;
function currentListIsInThisSwimlane(swimlaneId) {
const currentList = Lists.findOne(Session.get('currentList'));
return (
- currentList
- && (currentList.swimlaneId === swimlaneId || currentList.swimlaneId === '')
+ currentList &&
+ (currentList.swimlaneId === swimlaneId || currentList.swimlaneId === '')
);
}
@@ -12,14 +14,14 @@ function currentCardIsInThisList(listId, swimlaneId) {
const currentCard = Cards.findOne(Session.get('currentCard'));
const currentUser = Meteor.user();
if (
- currentUser
- && currentUser.profile
- && Utils.boardView() === 'board-view-swimlanes'
+ currentUser &&
+ currentUser.profile &&
+ Utils.boardView() === 'board-view-swimlanes'
)
return (
- currentCard
- && currentCard.listId === listId
- && currentCard.swimlaneId === swimlaneId
+ currentCard &&
+ currentCard.listId === listId &&
+ currentCard.swimlaneId === swimlaneId
);
// Default view: board-view-lists
else return currentCard && currentCard.listId === listId;
@@ -90,9 +92,9 @@ function initSortable(boardComponent, $listsDom) {
function userIsMember() {
return (
- Meteor.user()
- && Meteor.user().isBoardMember()
- && !Meteor.user().isCommentOnly()
+ Meteor.user() &&
+ Meteor.user().isBoardMember() &&
+ !Meteor.user().isCommentOnly()
);
}
@@ -103,8 +105,6 @@ function initSortable(boardComponent, $listsDom) {
showDesktopDragHandles = (currentUser.profile || {})
.showDesktopDragHandles;
} else {
- import { Cookies } from 'meteor/ostrio:cookies';
- const cookies = new Cookies();
if (cookies.has('showDesktopDragHandles')) {
showDesktopDragHandles = true;
} else {
@@ -147,8 +147,6 @@ BlazeComponent.extendComponent({
initSortable(boardComponent, $listsDom);
- import { Cookies } from 'meteor/ostrio:cookies';
- const cookies = new Cookies();
if (cookies.has('collapseSwimlane')) {
// Minimize swimlanes start https://www.w3schools.com/howto/howto_js_accordion.asp
const acc = document.getElementsByClassName('accordion');
@@ -203,8 +201,6 @@ BlazeComponent.extendComponent({
showDesktopDragHandles = (currentUser.profile || {})
.showDesktopDragHandles;
} else {
- import { Cookies } from 'meteor/ostrio:cookies';
- const cookies = new Cookies();
if (cookies.has('showDesktopDragHandles')) {
showDesktopDragHandles = true;
} else {
@@ -213,15 +209,15 @@ BlazeComponent.extendComponent({
}
const noDragInside = ['a', 'input', 'textarea', 'p'].concat(
- Utils.isMiniScreen()
- || (!Utils.isMiniScreen() && showDesktopDragHandles)
+ Utils.isMiniScreen() ||
+ (!Utils.isMiniScreen() && showDesktopDragHandles)
? ['.js-list-handle', '.js-swimlane-header-handle']
: ['.js-list-header'],
);
if (
- $(evt.target).closest(noDragInside.join(',')).length === 0
- && this.$('.swimlane').prop('clientHeight') > evt.offsetY
+ $(evt.target).closest(noDragInside.join(',')).length === 0 &&
+ this.$('.swimlane').prop('clientHeight') > evt.offsetY
) {
this._isDragging = true;
this._lastDragPositionX = evt.clientX;
@@ -255,8 +251,8 @@ BlazeComponent.extendComponent({
onCreated() {
this.currentBoard = Boards.findOne(Session.get('currentBoard'));
this.isListTemplatesSwimlane =
- this.currentBoard.isTemplatesBoard()
- && this.currentData().isListTemplatesSwimlane();
+ this.currentBoard.isTemplatesBoard() &&
+ this.currentData().isListTemplatesSwimlane();
this.currentSwimlane = this.currentData();
},
@@ -299,8 +295,6 @@ Template.swimlane.helpers({
if (currentUser) {
return (currentUser.profile || {}).showDesktopDragHandles;
} else {
- import { Cookies } from 'meteor/ostrio:cookies';
- const cookies = new Cookies();
if (cookies.has('showDesktopDragHandles')) {
return true;
} else {
@@ -310,9 +304,9 @@ Template.swimlane.helpers({
},
canSeeAddList() {
return (
- Meteor.user()
- && Meteor.user().isBoardMember()
- && !Meteor.user().isCommentOnly()
+ Meteor.user() &&
+ Meteor.user().isBoardMember() &&
+ !Meteor.user().isCommentOnly()
);
},
});
diff --git a/client/components/users/userHeader.js b/client/components/users/userHeader.js
index 1f0e3ef0..e0c6218e 100644
--- a/client/components/users/userHeader.js
+++ b/client/components/users/userHeader.js
@@ -1,3 +1,6 @@
+import { Cookies } from 'meteor/ostrio:cookies';
+const cookies = new Cookies();
+
Template.headerUserBar.events({
'click .js-open-header-member-menu': Popup.open('memberMenu'),
'click .js-change-avatar': Popup.open('changeAvatar'),
@@ -178,8 +181,6 @@ Template.changeSettingsPopup.helpers({
if (currentUser) {
return (currentUser.profile || {}).showDesktopDragHandles;
} else {
- import { Cookies } from 'meteor/ostrio:cookies';
- const cookies = new Cookies();
if (cookies.has('showDesktopDragHandles')) {
return true;
} else {
@@ -192,8 +193,6 @@ Template.changeSettingsPopup.helpers({
if (currentUser) {
return (currentUser.profile || {}).hasHiddenSystemMessages;
} else {
- import { Cookies } from 'meteor/ostrio:cookies';
- const cookies = new Cookies();
if (cookies.has('hasHiddenSystemMessages')) {
return true;
} else {
@@ -219,8 +218,6 @@ Template.changeSettingsPopup.events({
if (currentUser) {
Meteor.call('toggleDesktopDragHandles');
} else {
- import { Cookies } from 'meteor/ostrio:cookies';
- const cookies = new Cookies();
if (cookies.has('showDesktopDragHandles')) {
cookies.remove('showDesktopDragHandles');
} else {
@@ -233,8 +230,6 @@ Template.changeSettingsPopup.events({
if (currentUser) {
Meteor.call('toggleSystemMessages');
} else {
- import { Cookies } from 'meteor/ostrio:cookies';
- const cookies = new Cookies();
if (cookies.has('hasHiddenSystemMessages')) {
cookies.remove('hasHiddenSystemMessages');
} else {
@@ -253,8 +248,6 @@ Template.changeSettingsPopup.events({
if (currentUser) {
Meteor.call('changeLimitToShowCardsCount', minLimit);
} else {
- import { Cookies } from 'meteor/ostrio:cookies';
- const cookies = new Cookies();
cookies.set('limitToShowCardsCount', minLimit);
}
Popup.back();
diff --git a/client/lib/utils.js b/client/lib/utils.js
index c90dd749..aca45528 100644
--- a/client/lib/utils.js
+++ b/client/lib/utils.js
@@ -1,7 +1,8 @@
+import { Cookies } from 'meteor/ostrio:cookies';
+const cookies = new Cookies();
+
Utils = {
setBoardView(view) {
- import { Cookies } from 'meteor/ostrio:cookies';
- const cookies = new Cookies();
currentUser = Meteor.user();
if (currentUser) {
Meteor.user().setBoardView(view);
@@ -18,8 +19,6 @@ Utils = {
},
unsetBoardView() {
- import { Cookies } from 'meteor/ostrio:cookies';
- const cookies = new Cookies();
cookies.remove('boardView');
cookies.remove('collapseSwimlane');
},
@@ -29,8 +28,6 @@ Utils = {
if (currentUser) {
return (currentUser.profile || {}).boardView;
} else {
- import { Cookies } from 'meteor/ostrio:cookies';
- const cookies = new Cookies();
if (cookies.get('boardView') === 'board-view-lists') {
return 'board-view-lists';
} else if (