summaryrefslogtreecommitdiffstats
path: root/models
diff options
context:
space:
mode:
authorLauri Ojansivu <x@xet7.org>2019-04-06 09:00:13 +0300
committerLauri Ojansivu <x@xet7.org>2019-04-06 09:00:13 +0300
commitebfc8e5a1bd4cbc5cf6e37a913bc8eb231566050 (patch)
treeab0d1e0f879cb77d0058f472251e23fd21eb89af /models
parent972b9b6e9169b92c1a88bbc873313d7eead42f30 (diff)
downloadwekan-ebfc8e5a1bd4cbc5cf6e37a913bc8eb231566050.tar.gz
wekan-ebfc8e5a1bd4cbc5cf6e37a913bc8eb231566050.tar.bz2
wekan-ebfc8e5a1bd4cbc5cf6e37a913bc8eb231566050.zip
Fix lint errors.
Thanks to xet7 !
Diffstat (limited to 'models')
-rw-r--r--models/export.js2
-rw-r--r--models/import.js9
-rw-r--r--models/wekanCreator.js38
3 files changed, 24 insertions, 25 deletions
diff --git a/models/export.js b/models/export.js
index d402efe3..49aac828 100644
--- a/models/export.js
+++ b/models/export.js
@@ -30,7 +30,7 @@ if (Meteor.isServer) {
}
const exporter = new Exporter(boardId);
- if (true||exporter.canExport(user)) {
+ if (exporter.canExport(user)) {
JsonRoutes.sendResult(res, {
code: 200,
data: exporter.build(),
diff --git a/models/import.js b/models/import.js
index f7099282..ddc1a1d0 100644
--- a/models/import.js
+++ b/models/import.js
@@ -31,18 +31,17 @@ Meteor.methods({
});
Meteor.methods({
- cloneBoard(sourceBoardId,currentBoardId) {
+ cloneBoard(sourceBoardId, currentBoardId) {
check(sourceBoardId, String);
check(currentBoardId, Match.Maybe(String));
const exporter = new Exporter(sourceBoardId);
- let data = exporter.build();
- let addData = {};
+ const data = exporter.build();
+ const addData = {};
addData.membersMapping = wekanMembersMapper.getMembersToMap(data);
const creator = new WekanCreator(addData);
- data.title = data.title + " - " + TAPi18n.__('copy-tag');
+ data.title = `${data.title } - ${ TAPi18n.__('copy-tag')}`;
return creator.create(data, currentBoardId);
},
});
-
diff --git a/models/wekanCreator.js b/models/wekanCreator.js
index d0494a76..0f6a9d17 100644
--- a/models/wekanCreator.js
+++ b/models/wekanCreator.js
@@ -173,25 +173,25 @@ export class WekanCreator {
// we will work on the list itself (an ordered array of objects) when a
// mapping is done, we add a 'wekan' field to the object representing the
// imported member
- const membersToMap = data.members;
- const users = data.users;
- // auto-map based on username
- membersToMap.forEach((importedMember) => {
- importedMember.id = importedMember.userId;
- delete importedMember.userId;
- const user = users.filter((user) => {
- return user._id === importedMember.id;
- })[0];
- if (user.profile && user.profile.fullname) {
- importedMember.fullName = user.profile.fullname;
- }
- importedMember.username = user.username;
- const wekanUser = Users.findOne({ username: importedMember.username });
- if (wekanUser) {
- importedMember.wekanId = wekanUser._id;
- }
- });
- return membersToMap;
+ const membersToMap = data.members;
+ const users = data.users;
+ // auto-map based on username
+ membersToMap.forEach((importedMember) => {
+ importedMember.id = importedMember.userId;
+ delete importedMember.userId;
+ const user = users.filter((user) => {
+ return user._id === importedMember.id;
+ })[0];
+ if (user.profile && user.profile.fullname) {
+ importedMember.fullName = user.profile.fullname;
+ }
+ importedMember.username = user.username;
+ const wekanUser = Users.findOne({ username: importedMember.username });
+ if (wekanUser) {
+ importedMember.wekanId = wekanUser._id;
+ }
+ });
+ return membersToMap;
}
checkActions(wekanActions) {