diff options
author | Thais Siqueira <thais.siqueira@gmail.com> | 2017-03-01 11:39:36 -0300 |
---|---|---|
committer | Thais Siqueira <thais.siqueira@gmail.com> | 2017-03-01 12:04:42 -0300 |
commit | 1a1999cc129fe4d9046a22146deca6838a6fb1d5 (patch) | |
tree | da453c45a5be5d09341b3210cb3f110bdaabd972 /web-ui | |
parent | d47933f85158a43d860b49ab32de92923e78c95c (diff) |
[#907] Puts autofocus on username field.
with @anikarni
Diffstat (limited to 'web-ui')
-rw-r--r-- | web-ui/config/loaders-webpack.js | 2 | ||||
-rw-r--r-- | web-ui/package.json | 1 | ||||
-rw-r--r-- | web-ui/src/common/input_field/input_field.js | 4 | ||||
-rw-r--r-- | web-ui/src/login/page.js | 2 | ||||
-rw-r--r-- | web-ui/webpack.test.config.js | 2 |
5 files changed, 6 insertions, 5 deletions
diff --git a/web-ui/config/loaders-webpack.js b/web-ui/config/loaders-webpack.js index f5237dff..9009f9fd 100644 --- a/web-ui/config/loaders-webpack.js +++ b/web-ui/config/loaders-webpack.js @@ -3,7 +3,7 @@ module.exports = [ test: /\.js$/, exclude: /(node_modules|bower_components)/, loader: 'babel', - query: { presets: ['es2015', 'react']} + query: { presets: ['es2015', 'react', 'stage-0']} }, { test: /\.scss|css$/, diff --git a/web-ui/package.json b/web-ui/package.json index a9cb9604..07449cf3 100644 --- a/web-ui/package.json +++ b/web-ui/package.json @@ -12,6 +12,7 @@ "babel-plugin-istanbul": "^3.1.2", "babel-preset-es2015": "^6.18.0", "babel-preset-react": "^6.22.0", + "babel-preset-stage-0": "^6.22.0", "bower": "1.7.9", "copy-webpack-plugin": "^4.0.1", "css-loader": "^0.26.1", diff --git a/web-ui/src/common/input_field/input_field.js b/web-ui/src/common/input_field/input_field.js index a92faeb9..332d5911 100644 --- a/web-ui/src/common/input_field/input_field.js +++ b/web-ui/src/common/input_field/input_field.js @@ -19,11 +19,11 @@ import React from 'react'; import './input_field.scss'; -const InputField = ({ label, name, type = 'text' }) => ( +const InputField = ({ label, name, type = 'text', ...other }) => ( <div className='input-field-group'> <input type={type} name={name} className='input-field' - autoFocus='' required + required {...other} /> <label className='input-field-label' htmlFor={name}>{label}</label> </div> diff --git a/web-ui/src/login/page.js b/web-ui/src/login/page.js index 6be240b2..621cf846 100644 --- a/web-ui/src/login/page.js +++ b/web-ui/src/login/page.js @@ -45,7 +45,7 @@ export const Page = ({ t, authError, error }) => ( {rightPanel(t, error)} <form className='standard' id='login_form' action='/login' method='post' noValidate > {errorMessage(t, authError)} - <InputField name='username' label={t('login.email')} /> + <InputField name='username' label={t('login.email')} autoFocus /> <InputField type='password' name='password' label={t('login.password')} /> <SubmitButton buttonText={t('login.submit')} /> </form> diff --git a/web-ui/webpack.test.config.js b/web-ui/webpack.test.config.js index e24e4540..3dc1b311 100644 --- a/web-ui/webpack.test.config.js +++ b/web-ui/webpack.test.config.js @@ -18,7 +18,7 @@ module.exports = { test: /\.js$/, exclude: /(node_modules|bower_components)/, loader: 'babel', - query: { presets: ['es2015', 'react']} + query: { presets: ['es2015', 'react', 'stage-0']} }, { test: /\.scss|css$/, |