2019-05-21 23:34:48 +01:00
|
|
|
import React, { Component } from 'react';
|
|
|
|
|
2019-05-27 21:21:05 +01:00
|
|
|
import { SECURITY_SETTINGS_ENDPOINT } from '../constants/Endpoints';
|
2019-05-24 12:19:27 +01:00
|
|
|
import { restComponent } from '../components/RestComponent';
|
2019-08-09 18:21:28 +01:00
|
|
|
import LoadingNotification from '../components/LoadingNotification';
|
2019-05-26 19:09:34 +01:00
|
|
|
import SectionContent from '../components/SectionContent';
|
2019-08-09 18:21:28 +01:00
|
|
|
import ManageUsersForm from '../forms/ManageUsersForm';
|
2019-05-21 23:34:48 +01:00
|
|
|
|
|
|
|
class ManageUsers extends Component {
|
|
|
|
|
|
|
|
componentDidMount() {
|
2019-05-24 12:19:27 +01:00
|
|
|
this.props.loadData();
|
2019-05-21 23:34:48 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
render() {
|
2019-08-09 18:21:28 +01:00
|
|
|
const { fetched, errorMessage, data, saveData, loadData, setData, handleValueChange } = this.props;
|
2019-05-21 23:34:48 +01:00
|
|
|
return (
|
2019-07-06 23:56:30 +01:00
|
|
|
<SectionContent title="Manage Users" titleGutter>
|
2019-08-09 18:21:28 +01:00
|
|
|
<LoadingNotification
|
|
|
|
onReset={loadData}
|
|
|
|
fetched={fetched}
|
|
|
|
errorMessage={errorMessage}>
|
|
|
|
<ManageUsersForm
|
|
|
|
userData={data}
|
|
|
|
onSubmit={saveData}
|
|
|
|
onReset={loadData}
|
|
|
|
setData={setData}
|
|
|
|
handleValueChange={handleValueChange}
|
|
|
|
/>
|
|
|
|
</LoadingNotification>
|
2019-05-26 19:09:34 +01:00
|
|
|
</SectionContent>
|
2019-05-21 23:34:48 +01:00
|
|
|
)
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2019-05-27 21:21:05 +01:00
|
|
|
export default restComponent(SECURITY_SETTINGS_ENDPOINT, ManageUsers);
|