From 349341400d97622e3f267ccbd24fd94e1209b296 Mon Sep 17 00:00:00 2001 From: Chi Vinh Le Date: Tue, 19 Dec 2017 20:39:41 +0100 Subject: [PATCH 1/3] Fix error when queue is empty --- client/coral-admin/src/routes/Moderation/graphql.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/client/coral-admin/src/routes/Moderation/graphql.js b/client/coral-admin/src/routes/Moderation/graphql.js index 5758315eb2..e4d7940ed7 100644 --- a/client/coral-admin/src/routes/Moderation/graphql.js +++ b/client/coral-admin/src/routes/Moderation/graphql.js @@ -152,6 +152,10 @@ export function cleanUpQueue(root, queue, sortOrder, queueConfig) { let nodes = root[queue].nodes; let hasNextPage = root[queue].hasNextPage; + if (!nodes.length) { + return root; + } + if (queueConfig) { nodes = root[queue].nodes.filter((comment) => commentBelongToQueue(queue, comment, queueConfig)); } From e8553c50352c9108bae6db29694d4e820db2a01b Mon Sep 17 00:00:00 2001 From: Chi Vinh Le Date: Tue, 19 Dec 2017 20:46:59 +0100 Subject: [PATCH 2/3] Revert debug code :-D --- client/coral-admin/src/routes/Moderation/graphql.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/client/coral-admin/src/routes/Moderation/graphql.js b/client/coral-admin/src/routes/Moderation/graphql.js index e4d7940ed7..86bc524b87 100644 --- a/client/coral-admin/src/routes/Moderation/graphql.js +++ b/client/coral-admin/src/routes/Moderation/graphql.js @@ -165,8 +165,8 @@ export function cleanUpQueue(root, queue, sortOrder, queueConfig) { sortOrder, ); - if (nodes.length > 2) { - nodes = nodes.slice(0, 2); + if (nodes.length > 100) { + nodes = nodes.slice(0, 100); hasNextPage = true; } From f27de815e6d5a87f041e8a0b3ebdd63b852129b1 Mon Sep 17 00:00:00 2001 From: Chi Vinh Le Date: Tue, 19 Dec 2017 20:48:59 +0100 Subject: [PATCH 3/3] Minor syntax issue --- test/e2e/specs/04_userStatus.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/e2e/specs/04_userStatus.js b/test/e2e/specs/04_userStatus.js index f4a4455f03..011f59056d 100644 --- a/test/e2e/specs/04_userStatus.js +++ b/test/e2e/specs/04_userStatus.js @@ -73,7 +73,7 @@ module.exports = { .waitForElementVisible('@usernameDialogSuspend') .click('@usernameDialogSuspend') .waitForElementVisible('@usernameDialogSuspensionMessage') - .click('@usernameDialogSuspend'), + .click('@usernameDialogSuspend'); community .waitForElementNotPresent('@flaggedUser');