diff --git a/packages/server-admin-ui/package.json b/packages/server-admin-ui/package.json index 065711825..89bb7c7b9 100644 --- a/packages/server-admin-ui/package.json +++ b/packages/server-admin-ui/package.json @@ -1,6 +1,6 @@ { "name": "@signalk/server-admin-ui", - "version": "2.0.1", + "version": "2.0.2", "description": "Signal K server admin webapp", "author": "Scott Bender, Teppo Kurki", "contributors": [ diff --git a/packages/server-admin-ui/src/views/security/EnableSecurity.js b/packages/server-admin-ui/src/views/security/EnableSecurity.js index 7a434f851..4a26a6ddc 100644 --- a/packages/server-admin-ui/src/views/security/EnableSecurity.js +++ b/packages/server-admin-ui/src/views/security/EnableSecurity.js @@ -11,10 +11,10 @@ import { Input, InputGroup, InputGroupAddon, - HelpBlock, + InputGroupText, } from 'reactstrap' import { connect } from 'react-redux' -import { login, enableSecurity, fetchLoginStatus } from '../../actions' +import { enableSecurity, fetchLoginStatus } from '../../actions' import Login from './Login' class EnableSecurity extends Component { @@ -25,6 +25,7 @@ class EnableSecurity extends Component { errorMessage: null, } this.handleInputChange = this.handleInputChange.bind(this) + this.handleInputKeyUp = this.handleInputKeyUp.bind(this) this.handleClick = this.handleClick.bind(this) } @@ -48,6 +49,11 @@ class EnableSecurity extends Component { handleInputChange(event) { this.setState({ [event.target.name]: event.target.value }) } + handleInputKeyUp(event) { + if (event.key === 'Enter') { + this.handleClick() + } + } render() { return ( @@ -70,29 +76,35 @@ class EnableSecurity extends Component {
)} {!this.props.loginStatus.securityWasEnabled && ( -Sign In to your account
- {this.state.loginErrorMessage} -
+ {this.state.loginErrorMessage && ( ++ {this.state.loginErrorMessage} +
+ )} {!this.state.loginErrorMessage && this.props.loginStatus .allowNewUserRegistration && ( diff --git a/packages/server-admin-ui/src/views/security/Register.js b/packages/server-admin-ui/src/views/security/Register.js index 592998615..ee9045e90 100644 --- a/packages/server-admin-ui/src/views/security/Register.js +++ b/packages/server-admin-ui/src/views/security/Register.js @@ -7,10 +7,11 @@ import { CardBody, CardFooter, Button, + Form, Input, InputGroup, InputGroupAddon, - FormText, + InputGroupText, } from 'reactstrap' class Register extends Component { @@ -94,10 +95,12 @@ class Register extends Component { )} {!this.state.registrationSent && ( -+ {this.state.errorMessage} +
+ )} + )} {!this.state.registrationSent && (