Login component working

This commit is contained in:
John Lyon-Smith
2018-02-27 14:44:37 -08:00
parent 73b5cf6caa
commit c79df7722b
25 changed files with 112 additions and 321 deletions

View File

@@ -1,5 +1,5 @@
import React from 'react'
import { api } from '../helpers'
import { api } from 'src/API'
import PropTypes from 'prop-types'
import { MessageModal, WaitModal } from '../Modal'

View File

@@ -3,7 +3,7 @@ import PropTypes from 'prop-types'
import { regExpPattern } from 'regexp-pattern'
import { Text, Column, BoundInput, BoundButton } from 'ui'
import { MessageModal, WaitModal } from '../Modal'
import { api } from '../helpers'
import { api } from 'src/API'
import { FormBinder } from 'react-form-binder'
export class ForgotPassword extends React.Component {

View File

@@ -1,7 +1,7 @@
import React from 'react'
import PropTypes from 'prop-types'
import { regExpPattern } from 'regexp-pattern'
import { api } from '../helpers'
import { api } from 'src/API'
import { WaitModal, MessageModal } from '../Modal'
import { Image, Link, Text, Row, Column, BoundInput, BoundCheckbox, BoundButton } from 'ui'
import headerLogo from 'images/deighton.png'
@@ -54,7 +54,7 @@ export class Login extends React.Component {
return
}
let obj = this.state.binder.getValues()
let obj = this.state.binder.getModifiedFieldValues()
if (obj) {
this.setState({ waitModal: true })
@@ -75,7 +75,7 @@ export class Login extends React.Component {
elems[0].focus()
}
this.setState({
binder: new FormBinder({ email: this.state.binder.getField('email').value }, Login.bindings),
binder: new FormBinder({ email: this.state.binder.getFieldValue('email').value }, Login.bindings),
waitModal: false,
messageModal: { title: 'Login Error...', message: `Unable to login. ${error.message}` }
})
@@ -119,23 +119,22 @@ export class Login extends React.Component {
</Row.Item>
<Row.Item grow />
<Row.Item>
<BoundCheckbox label='Remember Me'
name='rememberMe' onChange={this.handleChange} binder={this.state.binder} />
<BoundCheckbox label='Remember Me' name='rememberMe' binder={this.state.binder} />
</Row.Item>
</Row>
</Column.Item>
<Column.Item>
<Column.Item height={20} />
<Column.Item height={40}>
<Row>
<Row.Item grow />
<Row.Item>
<br />
<BoundButton name='submit' content='Login' height={60} submit binder={this.state.binder} />
<BoundButton name='submit' width={100} content='Login' submit binder={this.state.binder} />
</Row.Item>
</Row>
</Column.Item>
<Column.Item height={20} />
<Column.Item>
<Text>
<br />
Please contact <Link to={`mailto:${versionInfo.supportEmail}`}>{versionInfo.supportEmail}</Link> to request login credentials.
</Text>
</Column.Item>

View File

@@ -1,6 +1,6 @@
import React from 'react'
import PropTypes from 'prop-types'
import { api } from '../helpers'
import { api } from 'src/API'
export class Logout extends React.Component {
static propTypes = {

View File

@@ -1,7 +1,7 @@
import React from 'react'
import { Route, Redirect } from 'react-router-dom'
import { PropTypes } from 'prop-types'
import { api } from '../helpers'
import { api } from 'src/API'
export class ProtectedRoute extends React.Component {
static propTypes = {

View File

@@ -2,7 +2,7 @@ import React from 'react'
import PropTypes from 'prop-types'
import { Text, Column, BoundInput, BoundButton } from 'ui'
import { MessageModal, WaitModal } from '../Modal'
import { api } from '../helpers'
import { api } from 'src/API'
import { FormBinder } from 'react-form-binder'
export class ResetPassword extends React.Component {