瀏覽代碼

Merge branch 'GhassenRjab-feature/fix-lint' into devel

Lauri Ojansivu 7 年之前
父節點
當前提交
1efa66b58c
共有 6 個文件被更改,包括 48 次插入25 次删除
  1. 3 1
      .eslintrc.json
  2. 11 0
      CHANGELOG.md
  3. 8 4
      client/components/main/layouts.js
  4. 10 4
      client/components/users/userHeader.js
  5. 13 13
      models/trelloCreator.js
  6. 3 3
      sandstorm.js

+ 3 - 1
.eslintrc.json

@@ -129,6 +129,8 @@
     "Integrations": true,
     "Integrations": true,
     "HTTP": true,
     "HTTP": true,
     "AccountSettings": true,
     "AccountSettings": true,
-    "Announcements": true
+    "Announcements": true,
+    "Swimlanes": true,
+    "Npm": true
   }
   }
 }
 }

+ 11 - 0
CHANGELOG.md

@@ -1,3 +1,14 @@
+# Upcoming Wekan release
+
+This release fixes the following bugs:
+
+- [Fix lint errors related to sandstorm](https://github.com/wekan/wekan/commit/0a16147470246c8f49bb918f5ddc7bb2e54fba14);
+- [Add Swimlanes to globals](https://github.com/wekan/wekan/commit/373e9782dcf87a9c1169b5d1f8175ce14e4898c9);
+- [Fix lint errors related to trello creator](https://github.com/wekan/wekan/commit/951a0db380d60f3d948ae38d50b85a54983a51de);
+- [Fix lint errors related to language names](https://github.com/wekan/wekan/commit/c0d33d97f2c8d4e9371a03d4ad3022df3ed64d3d).
+
+Thanks to GitHub user GhassenRjab for contributions.
+
 # v0.77 2018-02-23 Wekan release
 # v0.77 2018-02-23 Wekan release
 
 
 This release adds the following new features:
 This release adds the following new features:

+ 8 - 4
client/components/main/layouts.js

@@ -17,10 +17,14 @@ Template.userFormsLayout.onRendered(() => {
 Template.userFormsLayout.helpers({
 Template.userFormsLayout.helpers({
   languages() {
   languages() {
     return _.map(TAPi18n.getLanguages(), (lang, code) => {
     return _.map(TAPi18n.getLanguages(), (lang, code) => {
-      return {
-        tag: code,
-        name: lang.name === 'br' ? 'Brezhoneg' : lang.name === 'ig' ? 'Igbo' : lang.name,
-      };
+      const tag = code;
+      let name = lang.name;
+      if (lang.name === 'br') {
+        name = 'Brezhoneg';
+      } else if (lang.name === 'ig') {
+        name = 'Igbo';
+      }
+      return { tag, name };
     }).sort(function(a, b) {
     }).sort(function(a, b) {
       if (a.name === b.name) {
       if (a.name === b.name) {
         return 0;
         return 0;

+ 10 - 4
client/components/users/userHeader.js

@@ -114,10 +114,16 @@ Template.changePasswordPopup.onRendered(function () {
 Template.changeLanguagePopup.helpers({
 Template.changeLanguagePopup.helpers({
   languages() {
   languages() {
     return _.map(TAPi18n.getLanguages(), (lang, code) => {
     return _.map(TAPi18n.getLanguages(), (lang, code) => {
-      return {
-        tag: code,
-        name: lang.name === 'br' ? 'Brezhoneg' : lang.name === 'ig' ? 'Igbo' : lang.name,
-      };
+      // Same code in /client/components/main/layouts.js
+      // TODO : Make code reusable
+      const tag = code;
+      let name = lang.name;
+      if (lang.name === 'br') {
+        name = 'Brezhoneg';
+      } else if (lang.name === 'ig') {
+        name = 'Igbo';
+      }
+      return { tag, name };
     }).sort(function (a, b) {
     }).sort(function (a, b) {
       if (a.name === b.name) {
       if (a.name === b.name) {
         return 0;
         return 0;

+ 13 - 13
models/trelloCreator.js

@@ -401,19 +401,19 @@ export class TrelloCreator {
   }
   }
 
 
   createSwimlanes(boardId) {
   createSwimlanes(boardId) {
-      const swimlaneToCreate = {
-        archived: false,
-        boardId,
-        // We are being defensing here by providing a default date (now) if the
-        // creation date wasn't found on the action log. This happen on old
-        // Wekan boards (eg from 2013) that didn't log the 'createList' action
-        // we require.
-        createdAt: this._now(),
-        title: 'Default',
-      };
-      const swimlaneId = Swimlanes.direct.insert(swimlaneToCreate);
-      Swimlanes.direct.update(swimlaneId, {$set: {'updatedAt': this._now()}});
-      this.swimlane = swimlaneId;
+    const swimlaneToCreate = {
+      archived: false,
+      boardId,
+      // We are being defensing here by providing a default date (now) if the
+      // creation date wasn't found on the action log. This happen on old
+      // Wekan boards (eg from 2013) that didn't log the 'createList' action
+      // we require.
+      createdAt: this._now(),
+      title: 'Default',
+    };
+    const swimlaneId = Swimlanes.direct.insert(swimlaneToCreate);
+    Swimlanes.direct.update(swimlaneId, {$set: {'updatedAt': this._now()}});
+    this.swimlane = swimlaneId;
   }
   }
 
 
   createChecklists(trelloChecklists) {
   createChecklists(trelloChecklists) {

+ 3 - 3
sandstorm.js

@@ -22,9 +22,9 @@ const sandstormBoard = {
 
 
 if (isSandstorm && Meteor.isServer) {
 if (isSandstorm && Meteor.isServer) {
   const fs = require('fs');
   const fs = require('fs');
-  const pathParts = process.cwd().split("/");
-  var path = pathParts.join("/");
-  const Capnp = Npm.require(path + "../../../node_modules/capnp.js");
+  const pathParts = process.cwd().split('/');
+  const path = pathParts.join('/');
+  const Capnp = Npm.require(`${path}../../../node_modules/capnp.js`);
   const Package = Capnp.importSystem('sandstorm/package.capnp');
   const Package = Capnp.importSystem('sandstorm/package.capnp');
   const Powerbox = Capnp.importSystem('sandstorm/powerbox.capnp');
   const Powerbox = Capnp.importSystem('sandstorm/powerbox.capnp');
   const Identity = Capnp.importSystem('sandstorm/identity.capnp');
   const Identity = Capnp.importSystem('sandstorm/identity.capnp');