2019-05-21 23:34:48 +01:00
|
|
|
import React, { Component } from 'react';
|
|
|
|
|
2019-05-24 12:19:27 +01:00
|
|
|
import { USERS_ENDPOINT } from '../constants/Endpoints';
|
|
|
|
import { restComponent } from '../components/RestComponent';
|
2019-05-21 23:34:48 +01:00
|
|
|
import ManageUsersForm from '../forms/ManageUsersForm';
|
2019-05-26 19:09:34 +01:00
|
|
|
import SectionContent from '../components/SectionContent';
|
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() {
|
|
|
|
const { data, fetched, errorMessage } = this.props;
|
|
|
|
return (
|
2019-05-26 19:09:34 +01:00
|
|
|
<SectionContent title="Manage Users">
|
|
|
|
<ManageUsersForm
|
|
|
|
userData={data}
|
|
|
|
userDataFetched={fetched}
|
|
|
|
errorMessage={errorMessage}
|
|
|
|
onSubmit={this.props.saveData}
|
|
|
|
onReset={this.props.loadData}
|
|
|
|
setData={this.props.setData}
|
|
|
|
handleValueChange={this.props.handleValueChange}
|
|
|
|
/>
|
|
|
|
</SectionContent>
|
2019-05-21 23:34:48 +01:00
|
|
|
)
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
export default restComponent(USERS_ENDPOINT, ManageUsers);
|