diff --git a/src/common/table.js b/src/common/table.js index dfaba74..6d75cfa 100644 --- a/src/common/table.js +++ b/src/common/table.js @@ -17,7 +17,7 @@ import React, { Component } from 'react'; import _ from 'lodash'; -import { Table, Button, FormControl, FormLabel, FormCheck, Tooltip, OverlayTrigger } from 'react-bootstrap'; +import { Table, Button, Form, Tooltip, OverlayTrigger } from 'react-bootstrap'; import { Link } from 'react-router-dom'; import Icon from './icon'; @@ -112,9 +112,11 @@ class CustomTable extends Component { cell.push(   - + {labelContent} - + ); } @@ -152,7 +154,7 @@ class CustomTable extends Component { : false; cell.push( - - {(this.state.editCell[0] === cellIndex && this.state.editCell[1] === rowIndex) ? ( - + {(this.state.editCell[0] === cellIndex && this.state.editCell[1] === rowIndex) ? + this.onClose(c)} onReset={() => this.resetState()} valid={this.valid}> -
- - Username - this.handleChange(e)} /> - - - - E-mail - this.handleChange(e)} /> - - - Old Password - this.handleChange(e)} /> - - - - New Password - this.handleChange(e)} /> - - - - Confirm New Password - this.handleChange(e)} /> - -
+
+ + Username + this.handleChange(e)} autocomplete="username" /> + + + + E-mail + this.handleChange(e)} autocomplete="email" /> + + + Old Password + this.handleChange(e)} autocomplete="current-password" /> + + + New Password + this.handleChange(e)} autocomplete="new-password" /> + + + Confirm New Password + this.handleChange(e)} autocomplete="new-password" /> + +
); } diff --git a/src/user/edit-user.js b/src/user/edit-user.js index a97b9de..ba49228 100644 --- a/src/user/edit-user.js +++ b/src/user/edit-user.js @@ -16,7 +16,7 @@ ******************************************************************************/ import React from 'react'; -import {FormGroup, FormControl, FormLabel, Col} from 'react-bootstrap'; +import { Form, Col } from 'react-bootstrap'; import Dialog from '../common/dialogs/dialog'; @@ -27,13 +27,13 @@ class EditUserDialog extends React.Component { super(props); this.state = { - username: '', - mail: '', - role: '', - id: '', + username: props.user.username, + mail: props.user.mail, + role: props.user.role, + id: props.user.id, + active: props.user.active, password: '', - active: '', - confirmpassword: '', + confirmPassword: '', oldPassword: '' } } @@ -94,8 +94,8 @@ class EditUserDialog extends React.Component { resetState() { this.setState({ - //username: this.props.user.username, - //mail: this.props.user.mail, + username: this.props.user.username, + mail: this.props.user.mail, role: this.props.user.role, id: this.props.user.id }); @@ -104,46 +104,44 @@ class EditUserDialog extends React.Component { render() { return ( this.onClose(c)} onReset={() => this.resetState()} valid={this.valid}> -
- - Username - this.handleChange(e)} /> - - - - E-mail - this.handleChange(e)} /> - - - Admin Password - this.handleChange(e)} /> - - - Password - this.handleChange(e)} /> - - - Confirm New Password - this.handleChange(e)} /> - - - Role - this.handleChange(e)}> + + + Username + this.handleChange(e)} /> + + + + E-mail + this.handleChange(e)} /> + + + Admin Password + this.handleChange(e)} /> + + + Password + this.handleChange(e)} /> + + + Confirm New Password + this.handleChange(e)} /> + + + Role + this.handleChange(e)}> - - - - - Active - this.handleChange(e)}> + + + + Active + this.handleChange(e)}> - - - -
+
+ + ); } diff --git a/src/user/new-user.js b/src/user/new-user.js index a8cd5a8..c10dc85 100644 --- a/src/user/new-user.js +++ b/src/user/new-user.js @@ -16,7 +16,7 @@ ******************************************************************************/ import React from 'react'; -import { FormGroup, FormControl, FormLabel, FormText, Col } from 'react-bootstrap'; +import { Form, Col } from 'react-bootstrap'; import Dialog from '../common/dialogs/dialog'; @@ -68,32 +68,32 @@ class NewUserDialog extends React.Component { render() { return ( this.onClose(c)} onReset={() => this.resetState()} valid={this.valid}> -
- - Username - this.handleChange(e)} /> - - Min 3 characters. - - - E-mail - this.handleChange(e)} /> - - - - Password - this.handleChange(e)} /> - - - - Role - this.handleChange(e)}> + + + Username + this.handleChange(e)} /> + + Min 3 characters. + + + E-mail + this.handleChange(e)} /> + + + + Password + this.handleChange(e)} /> + + + + Role + this.handleChange(e)}> - - -
+ + +
); } diff --git a/src/user/user.js b/src/user/user.js index 53b1627..ce4cc4c 100644 --- a/src/user/user.js +++ b/src/user/user.js @@ -17,7 +17,7 @@ import React, { Component } from 'react'; import { Container } from 'flux/utils'; -import {Button, Col, Row, FormGroup} from 'react-bootstrap'; +import { Button, Form, Row, Col } from 'react-bootstrap'; import AppDispatcher from '../common/app-dispatcher'; import UsersStore from './users-store'; @@ -101,35 +101,51 @@ class User extends Component { } render() { + let user = this.state.currentUser; return (
-

Your User Account

+

Account

- {this.state.currentUser !== undefined && this.state.currentUser !== null ? + {user ? + <> +
+ + Username + + + + + + E-mail + + + + + + Role + + + + + + Created at + + + + + +
-
- - - -
Username:
-
E-mail:
-
Role:
-
- -
{this.state.currentUser.username}
-
{this.state.currentUser.mail}
-
{this.state.currentUser.role}
- - - -
-
- - this.closeEditModal(data)} - user={this.state.currentUser} /> - - : "Loading user data..." + this.closeEditModal(data)} + user={this.state.currentUser} + /> + + :
}
);