Fix user form

* fix issue with checkbox on user form
* use consistent style for const char pointers
* use unique hostname by default
This commit is contained in:
rjwats
2020-11-21 23:40:31 +00:00
committed by GitHub
parent 7aed5c0eb2
commit 6e22893051
5 changed files with 15 additions and 18 deletions

View File

@ -13,7 +13,7 @@ import SaveIcon from '@material-ui/icons/Save';
import PersonAddIcon from '@material-ui/icons/PersonAdd';
import { withAuthenticatedContext, AuthenticatedContextProps } from '../authentication';
import { RestFormProps, FormActions, FormButton } from '../components';
import { RestFormProps, FormActions, FormButton, extractEventValue } from '../components';
import UserForm from './UserForm';
import { SecuritySettings, User } from './types';
@ -93,13 +93,9 @@ class ManageUsersForm extends React.Component<ManageUsersFormProps, ManageUsersF
};
handleUserValueChange = (name: keyof User) => (event: React.ChangeEvent<HTMLInputElement>) => {
this.setState({ user: { ...this.state.user!, [name]: event.target.value } });
this.setState({ user: { ...this.state.user!, [name]: extractEventValue(event) } });
};
handleUserCheckboxChange = (name: keyof User) => (event: React.ChangeEvent<HTMLInputElement>) => {
this.setState({ user: { ...this.state.user!, [name]: event.target.checked } });
}
onSubmit = () => {
this.props.saveData();
this.props.authenticatedContext.refresh();