Browse Source

Merge branch 'devel'

Lauri Ojansivu 7 years ago
parent
commit
2bb80956dd

+ 12 - 0
CHANGELOG.md

@@ -1,3 +1,15 @@
+# v1.21 2018-07-18 Wekan release
+
+This release adds the following new features:
+
+- [Add logo from Wekan website to login logo](https://github.com/wekan/wekan/commit/4eed23afe06d5fab8d45ba3decc7c1d3b85efbd8).
+
+This release fixes the following bugs:
+
+- [Allow to resend invites](https://github.com/wekan/wekan/pull/1785).
+
+Thanks to GitHub users Akuket and xet7 for their contributions.
+
 # v1.20 2018-07-18 Wekan release
 # v1.20 2018-07-18 Wekan release
 
 
 This release fixes the following bugs:
 This release fixes the following bugs:

+ 1 - 0
client/components/settings/settingBody.js

@@ -101,6 +101,7 @@ BlazeComponent.extendComponent({
         // if (!err) {
         // if (!err) {
         //   TODO - show more info to user
         //   TODO - show more info to user
         // }
         // }
+
         this.setLoading(false);
         this.setLoading(false);
       });
       });
     }
     }

+ 21 - 8
models/settings.js

@@ -124,20 +124,33 @@ if (Meteor.isServer) {
     sendInvitation(emails, boards) {
     sendInvitation(emails, boards) {
       check(emails, [String]);
       check(emails, [String]);
       check(boards, [String]);
       check(boards, [String]);
+
       const user = Users.findOne(Meteor.userId());
       const user = Users.findOne(Meteor.userId());
       if(!user.isAdmin){
       if(!user.isAdmin){
         throw new Meteor.Error('not-allowed');
         throw new Meteor.Error('not-allowed');
       }
       }
       emails.forEach((email) => {
       emails.forEach((email) => {
         if (email && SimpleSchema.RegEx.Email.test(email)) {
         if (email && SimpleSchema.RegEx.Email.test(email)) {
-          const code = getRandomNum(100000, 999999);
-          InvitationCodes.insert({code, email, boardsToBeInvited: boards, createdAt: new Date(), authorId: Meteor.userId()}, function(err, _id){
-            if (!err && _id) {
-              sendInvitationEmail(_id);
-            } else {
-              throw new Meteor.Error('invitation-generated-fail', err.message);
-            }
-          });
+          // Checks if the email is already link to an account.
+          const userExist = Users.findOne({email});
+          if (userExist){
+            throw new Meteor.Error('user-exist', `The user with the email ${email} has already an account.`);
+          }
+          // Checks if the email is already link to an invitation.
+          const invitation = InvitationCodes.findOne({email});
+          if (invitation){
+            InvitationCodes.update(invitation, {$set : {boardsToBeInvited: boards}});
+            sendInvitationEmail(invitation._id);
+          }else {
+            const code = getRandomNum(100000, 999999);
+            InvitationCodes.insert({code, email, boardsToBeInvited: boards, createdAt: new Date(), authorId: Meteor.userId()}, function(err, _id){
+              if (!err && _id) {
+                sendInvitationEmail(_id);
+              } else {
+                throw new Meteor.Error('invitation-generated-fail', err.message);
+              }
+            });
+          }
         }
         }
       });
       });
     },
     },

+ 6 - 2
models/users.js

@@ -501,9 +501,13 @@ if (Meteor.isServer) {
     } else {
     } else {
       user.profile = {icode: options.profile.invitationcode};
       user.profile = {icode: options.profile.invitationcode};
       user.profile.boardView = 'board-view-lists';
       user.profile.boardView = 'board-view-lists';
-    }
 
 
-    return user;
+      // Deletes the invitation code after the user was created successfully.
+      setTimeout(Meteor.bindEnvironment(() => {
+        InvitationCodes.remove({'_id': invitationCode._id});
+      }), 200);
+      return user;
+    }
   });
   });
 }
 }
 
 

+ 1 - 1
package.json

@@ -1,6 +1,6 @@
 {
 {
   "name": "wekan",
   "name": "wekan",
-  "version": "1.20.0",
+  "version": "1.21.0",
   "description": "The open-source Trello-like kanban",
   "description": "The open-source Trello-like kanban",
   "private": true,
   "private": true,
   "scripts": {
   "scripts": {

BIN
public/old-wekan-logo.png


BIN
public/wekan-logo.png


+ 2 - 2
sandstorm-pkgdef.capnp

@@ -22,10 +22,10 @@ const pkgdef :Spk.PackageDefinition = (
     appTitle = (defaultText = "Wekan"),
     appTitle = (defaultText = "Wekan"),
     # The name of the app as it is displayed to the user.
     # The name of the app as it is displayed to the user.
 
 
-    appVersion = 105,
+    appVersion = 106,
     # Increment this for every release.
     # Increment this for every release.
 
 
-    appMarketingVersion = (defaultText = "1.20.0~2018-07-18"),
+    appMarketingVersion = (defaultText = "1.21.0~2018-07-18"),
     # Human-readable presentation of the app version.
     # Human-readable presentation of the app version.
 
 
     minUpgradableAppVersion = 0,
     minUpgradableAppVersion = 0,