Admin: optimistic awaiting-approval actions
This commit is contained in:
parent
a3f208c1be
commit
299c14adc8
|
@ -11,6 +11,7 @@ import { fetchUsers, deleteUsers, approveUsers } from 'soapbox/actions/admin';
|
||||||
|
|
||||||
const messages = defineMessages({
|
const messages = defineMessages({
|
||||||
heading: { id: 'column.admin.awaiting_approval', defaultMessage: 'Awaiting Approval' },
|
heading: { id: 'column.admin.awaiting_approval', defaultMessage: 'Awaiting Approval' },
|
||||||
|
emptyMessage: { id: 'admin.awaiting_approval.empty_message', defaultMessage: 'There is nobody waiting for approval. When a new user signs up, you can review them here.' },
|
||||||
});
|
});
|
||||||
|
|
||||||
const mapStateToProps = state => {
|
const mapStateToProps = state => {
|
||||||
|
@ -61,7 +62,7 @@ class AwaitingApproval extends ImmutablePureComponent {
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Column icon='user' heading={intl.formatMessage(messages.heading)} backBtnSlim>
|
<Column icon='user' heading={intl.formatMessage(messages.heading)} backBtnSlim>
|
||||||
<ScrollableList isLoading={isLoading} showLoading={isLoading} scrollKey='awaiting-approval'>
|
<ScrollableList isLoading={isLoading} showLoading={isLoading} scrollKey='awaiting-approval' emptyMessage={intl.formatMessage(messages.emptyMessage)}>
|
||||||
{users.map((user, i) => (
|
{users.map((user, i) => (
|
||||||
<div className='unapproved-account' key={user.get('id')}>
|
<div className='unapproved-account' key={user.get('id')}>
|
||||||
<div className='unapproved-account__bio'>
|
<div className='unapproved-account__bio'>
|
||||||
|
|
|
@ -1,7 +1,9 @@
|
||||||
import {
|
import {
|
||||||
ADMIN_REPORTS_FETCH_SUCCESS,
|
ADMIN_REPORTS_FETCH_SUCCESS,
|
||||||
ADMIN_USERS_FETCH_SUCCESS,
|
ADMIN_USERS_FETCH_SUCCESS,
|
||||||
|
ADMIN_USERS_DELETE_REQUEST,
|
||||||
ADMIN_USERS_DELETE_SUCCESS,
|
ADMIN_USERS_DELETE_SUCCESS,
|
||||||
|
ADMIN_USERS_APPROVE_REQUEST,
|
||||||
ADMIN_USERS_APPROVE_SUCCESS,
|
ADMIN_USERS_APPROVE_SUCCESS,
|
||||||
} from '../actions/admin';
|
} from '../actions/admin';
|
||||||
import {
|
import {
|
||||||
|
@ -59,8 +61,10 @@ export default function admin(state = initialState, action) {
|
||||||
}
|
}
|
||||||
case ADMIN_USERS_FETCH_SUCCESS:
|
case ADMIN_USERS_FETCH_SUCCESS:
|
||||||
return importUsers(state, action.data.users);
|
return importUsers(state, action.data.users);
|
||||||
|
case ADMIN_USERS_DELETE_REQUEST:
|
||||||
case ADMIN_USERS_DELETE_SUCCESS:
|
case ADMIN_USERS_DELETE_SUCCESS:
|
||||||
return deleteUsers(state, action.nicknames);
|
return deleteUsers(state, action.nicknames);
|
||||||
|
case ADMIN_USERS_APPROVE_REQUEST:
|
||||||
case ADMIN_USERS_APPROVE_SUCCESS:
|
case ADMIN_USERS_APPROVE_SUCCESS:
|
||||||
return approveUsers(state, action.users);
|
return approveUsers(state, action.users);
|
||||||
default:
|
default:
|
||||||
|
|
Loading…
Reference in New Issue