New Queue names

This commit is contained in:
Belen Curcio
2017-07-28 11:16:49 -03:00
parent 5ce9c950b8
commit 0f41165751
3 changed files with 15 additions and 6 deletions
-1
View File
@@ -61,7 +61,6 @@ const routes = (
);
const AppRouter = () => <Router history={useBasename(() => browserHistory)({
basename: '/talk/'
})} routes={routes}/>;
export default AppRouter;
+12 -5
View File
@@ -1,7 +1,7 @@
import update from 'immutability-helper';
import * as notification from 'coral-admin/src/services/notification';
const queues = ['all', 'premod', 'flagged', 'accepted', 'rejected'];
const queues = ['all', 'premod', 'reported', 'approved', 'rejected', 'new'];
const limit = 10;
const ascending = (a, b) => {
@@ -66,21 +66,27 @@ function addCommentToQueue(root, queue, comment, sort) {
function getCommentQueues(comment) {
const queues = ['all'];
if (comment.status === 'ACCEPTED') {
queues.push('accepted');
}
else if (comment.status === 'REJECTED') {
queues.push('rejected');
}
else if (comment.status === 'PREMOD') {
queues.push('premod');
}
if (
else if (
['NONE', 'PREMOD'].indexOf(comment.status) >= 0
&& comment.actions && comment.actions.some((a) => a.__typename === 'FlagAction')
) {
queues.push('flagged');
}
else if (comment.status === 'PREMOD') {
queues.push('premod');
queues.push('new');
}
if (comment.status === 'NONE') {
queues.push('new');
}
return queues;
}
@@ -98,6 +104,7 @@ function getCommentQueues(comment) {
*/
export function handleCommentChange(root, comment, sort, notify) {
let next = root;
const nextQueues = getCommentQueues(comment);
let notificationShown = false;
@@ -154,6 +154,9 @@ class ModerationContainer extends Component {
case 'all':
variables.statuses = null;
break;
case 'new':
variables.statuses = ['NONE', 'PREMOD'];
break;
case 'approved':
variables.statuses = ['ACCEPTED'];
break;