|
@@ -2,19 +2,37 @@ import React, { Fragment } from 'react';
|
|
|
import PropTypes from 'prop-types';
|
|
import PropTypes from 'prop-types';
|
|
|
import { withTranslation } from 'react-i18next';
|
|
import { withTranslation } from 'react-i18next';
|
|
|
|
|
|
|
|
|
|
+import PaginationWrapper from '../../PaginationWrapper';
|
|
|
import InviteUserControl from './InviteUserControl';
|
|
import InviteUserControl from './InviteUserControl';
|
|
|
import UserTable from './UserTable';
|
|
import UserTable from './UserTable';
|
|
|
|
|
|
|
|
-import AppContainer from '../../../services/AppContainer';
|
|
|
|
|
import { createSubscribedElement } from '../../UnstatedUtils';
|
|
import { createSubscribedElement } from '../../UnstatedUtils';
|
|
|
|
|
+import AppContainer from '../../../services/AppContainer';
|
|
|
|
|
|
|
|
class UserPage extends React.Component {
|
|
class UserPage extends React.Component {
|
|
|
|
|
|
|
|
constructor(props) {
|
|
constructor(props) {
|
|
|
super();
|
|
super();
|
|
|
|
|
|
|
|
|
|
+ this.state = {
|
|
|
|
|
+ users: [],
|
|
|
|
|
+ activePage: 1,
|
|
|
|
|
+ pagingLimit: Infinity,
|
|
|
|
|
+ };
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // TODO unstatedContainerを作ってそこにリファクタすべき
|
|
|
|
|
+ componentDidMount() {
|
|
|
|
|
+ const jsonData = document.getElementById('admin-user-page');
|
|
|
|
|
+ const users = JSON.parse(jsonData.getAttribute('users'));
|
|
|
|
|
+
|
|
|
|
|
+ this.setState({
|
|
|
|
|
+ users,
|
|
|
|
|
+ });
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+
|
|
|
render() {
|
|
render() {
|
|
|
const { t } = this.props;
|
|
const { t } = this.props;
|
|
|
|
|
|
|
@@ -27,7 +45,16 @@ class UserPage extends React.Component {
|
|
|
{ t('user_management.external_account') }
|
|
{ t('user_management.external_account') }
|
|
|
</a>
|
|
</a>
|
|
|
</p>
|
|
</p>
|
|
|
- <UserTable />
|
|
|
|
|
|
|
+ <UserTable
|
|
|
|
|
+ users={this.state.users}
|
|
|
|
|
+ />
|
|
|
|
|
+ <PaginationWrapper
|
|
|
|
|
+ activePage={this.state.activePage}
|
|
|
|
|
+ changePage={this.handlePage}
|
|
|
|
|
+ totalItemsCount={this.state.totalUsers}
|
|
|
|
|
+ pagingLimit={this.state.pagingLimit}
|
|
|
|
|
+ >
|
|
|
|
|
+ </PaginationWrapper>
|
|
|
</Fragment>
|
|
</Fragment>
|
|
|
);
|
|
);
|
|
|
}
|
|
}
|
|
@@ -41,6 +68,7 @@ const UserPageWrapper = (props) => {
|
|
|
UserPage.propTypes = {
|
|
UserPage.propTypes = {
|
|
|
t: PropTypes.func.isRequired, // i18next
|
|
t: PropTypes.func.isRequired, // i18next
|
|
|
appContainer: PropTypes.instanceOf(AppContainer).isRequired,
|
|
appContainer: PropTypes.instanceOf(AppContainer).isRequired,
|
|
|
|
|
+
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
export default withTranslation()(UserPageWrapper);
|
|
export default withTranslation()(UserPageWrapper);
|