diff options
author | Maxime Quandalle <maxime@quandalle.com> | 2015-09-03 23:12:46 +0200 |
---|---|---|
committer | Maxime Quandalle <maxime@quandalle.com> | 2015-09-03 23:12:46 +0200 |
commit | b3851817ecd59b039f2c2228d08a1c6fd8e60d60 (patch) | |
tree | 82a50f69788d5c20632f3ec9c7d3e136502b93b4 /client/config/accounts.js | |
parent | 039cfe7edf8faf901069a94b3ca9b66f7973b26a (diff) | |
download | wekan-b3851817ecd59b039f2c2228d08a1c6fd8e60d60.tar.gz wekan-b3851817ecd59b039f2c2228d08a1c6fd8e60d60.tar.bz2 wekan-b3851817ecd59b039f2c2228d08a1c6fd8e60d60.zip |
Enforce a consistent ES6 coding style
Replace the old (and broken) jshint + jscsrc by eslint and configure
it to support some of the ES6 features.
The command `eslint` currently has one error which is a bug that was
discovered by its static analysis and should be fixed (usage of a
dead object).
Diffstat (limited to 'client/config/accounts.js')
-rw-r--r-- | client/config/accounts.js | 26 |
1 files changed, 12 insertions, 14 deletions
diff --git a/client/config/accounts.js b/client/config/accounts.js index a448d612..df0935f7 100644 --- a/client/config/accounts.js +++ b/client/config/accounts.js @@ -1,11 +1,11 @@ -var passwordField = AccountsTemplates.removeField('password'); -var emailField = AccountsTemplates.removeField('email'); +const passwordField = AccountsTemplates.removeField('password'); +const emailField = AccountsTemplates.removeField('email'); AccountsTemplates.addFields([{ _id: 'username', type: 'text', displayName: 'username', required: true, - minLength: 2 + minLength: 2, }, emailField, passwordField]); AccountsTemplates.configure({ @@ -15,36 +15,34 @@ AccountsTemplates.configure({ enablePasswordChange: true, sendVerificationEmail: true, showForgotPasswordLink: true, - onLogoutHook: function() { - var homePage = 'home'; + onLogoutHook() { + const homePage = 'home'; if (FlowRouter.getRouteName() === homePage) { FlowRouter.reload(); } else { FlowRouter.go(homePage); } - } + }, }); _.each(['signIn', 'signUp', 'resetPwd', 'forgotPwd', 'enrollAccount'], - function(routeName) { - AccountsTemplates.configureRoute(routeName); -}); + (routeName) => AccountsTemplates.configureRoute(routeName)); // We display the form to change the password in a popup window that already // have a title, so we unset the title automatically displayed by useraccounts. AccountsTemplates.configure({ texts: { title: { - changePwd: '' - } - } + changePwd: '', + }, + }, }); AccountsTemplates.configureRoute('changePwd', { - redirect: function() { + redirect() { // XXX We should emit a notification once we have a notification system. // Currently the user has no indication that his modification has been // applied. Popup.back(); - } + }, }); |