38 lines
1.1 KiB
JavaScript
Raw Normal View History

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';
import { restComponent } from '../components/RestComponent';
2019-08-09 18:21:28 +01:00
import LoadingNotification from '../components/LoadingNotification';
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() {
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>
</SectionContent>
2019-05-21 23:34:48 +01:00
)
}
}
2019-05-27 21:21:05 +01:00
export default restComponent(SECURITY_SETTINGS_ENDPOINT, ManageUsers);