mirror of
https://git.rwth-aachen.de/acs/public/villas/web/
synced 2025-03-09 00:00:01 +01:00
see and edit active state of user
This commit is contained in:
parent
b8f8294a8b
commit
e4877f4eb8
2 changed files with 19 additions and 3 deletions
|
@ -35,7 +35,8 @@ class EditUserDialog extends React.Component {
|
|||
mail: '',
|
||||
role: '',
|
||||
id: '',
|
||||
password: ''
|
||||
password: '',
|
||||
active: ''
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -56,7 +57,8 @@ class EditUserDialog extends React.Component {
|
|||
var username = true;
|
||||
var role = true;
|
||||
var mail = true;
|
||||
var pw = true
|
||||
var pw = true;
|
||||
var active = true;
|
||||
|
||||
if (this.state.username === '') {
|
||||
username = false;
|
||||
|
@ -74,8 +76,12 @@ class EditUserDialog extends React.Component {
|
|||
pw = false;
|
||||
}
|
||||
|
||||
if(this.state.active === ''){
|
||||
active = false;
|
||||
}
|
||||
|
||||
// form is valid if any of the fields contain somethig
|
||||
this.valid = username || role || mail || pw;
|
||||
this.valid = username || role || mail || pw || active;
|
||||
|
||||
}
|
||||
|
||||
|
@ -113,6 +119,15 @@ class EditUserDialog extends React.Component {
|
|||
<option key='3' value='Guest'>Guest</option>
|
||||
</FormControl>
|
||||
</FormGroup>
|
||||
|
||||
<FormGroup as={Col} controlId="active">
|
||||
<FormLabel>Active</FormLabel>
|
||||
<FormControl as="select" placeholder="Select Active state" value={this.state.active} onChange={(e) => this.handleChange(e)}>
|
||||
<option key='1' value='yes'>Yes</option>
|
||||
<option key='2' value='no'>No</option>
|
||||
</FormControl>
|
||||
</FormGroup>
|
||||
|
||||
</form>
|
||||
</Dialog>
|
||||
);
|
||||
|
|
|
@ -126,6 +126,7 @@ class Users extends Component {
|
|||
<TableColumn title='ID' width='150' dataKey='id' />
|
||||
<TableColumn title='E-mail' dataKey='mail' />
|
||||
<TableColumn title='Role' dataKey='role' modifier={(role) => this.getHumanRoleName(role)} />
|
||||
<TableColumn title='Active' dataKey='active' />
|
||||
<TableColumn width='70' editButton deleteButton onEdit={index => this.setState({ editModal: true, modalData: this.state.users[index] })} onDelete={index => this.setState({ deleteModal: true, modalData: this.state.users[index] })} />
|
||||
</Table>
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue