mirror of
https://github.com/wekan/wekan.git
synced 2025-12-28 13:18:49 +01:00
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).
This commit is contained in:
parent
039cfe7edf
commit
b3851817ec
60 changed files with 1604 additions and 1692 deletions
|
|
@ -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();
|
||||
}
|
||||
},
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue