From 46359b4a1b6d49fe19e85a98784510f0f949d4de Mon Sep 17 00:00:00 2001 From: Chi Vinh Le Date: Tue, 24 Oct 2017 14:49:32 +0200 Subject: [PATCH 1/3] Show errors --- client/coral-admin/src/components/UserDetail.js | 4 ---- client/coral-admin/src/containers/UserDetail.js | 14 ++++---------- 2 files changed, 4 insertions(+), 14 deletions(-) diff --git a/client/coral-admin/src/components/UserDetail.js b/client/coral-admin/src/components/UserDetail.js index 1c6362791..140774eae 100644 --- a/client/coral-admin/src/components/UserDetail.js +++ b/client/coral-admin/src/components/UserDetail.js @@ -44,7 +44,6 @@ export default class UserDetail extends React.Component { this.props.data.refetch(); } catch (err) { - // TODO: handle error. console.error(err); this.props.notify('error', getErrorMessages(err)); } @@ -56,7 +55,6 @@ export default class UserDetail extends React.Component { this.props.data.refetch(); } catch (err) { - // TODO: handle error. console.error(err); this.props.notify('error', getErrorMessages(err)); } @@ -68,7 +66,6 @@ export default class UserDetail extends React.Component { this.props.data.refetch(); } catch (err) { - // TODO: handle error. console.error(err); this.props.notify('error', getErrorMessages(err)); } @@ -80,7 +77,6 @@ export default class UserDetail extends React.Component { this.props.data.refetch(); } catch (err) { - // TODO: handle error. console.error(err); this.props.notify('error', getErrorMessages(err)); } diff --git a/client/coral-admin/src/containers/UserDetail.js b/client/coral-admin/src/containers/UserDetail.js index 47d8e1c79..97021ec75 100644 --- a/client/coral-admin/src/containers/UserDetail.js +++ b/client/coral-admin/src/containers/UserDetail.js @@ -43,22 +43,16 @@ class UserDetailContainer extends React.Component { return this.props.setCommentStatus({commentId, status}); }); - try { - await Promise.all(changes); - this.props.clearUserDetailSelections(); // un-select everything - } catch (err) { - - // TODO: handle error. - console.error(err); - } + await Promise.all(changes); + this.props.clearUserDetailSelections(); // un-select everything } bulkReject = () => { - this.bulkSetCommentStatus('REJECTED'); + return this.bulkSetCommentStatus('REJECTED'); } bulkAccept = () => { - this.bulkSetCommentStatus('ACCEPTED'); + return this.bulkSetCommentStatus('ACCEPTED'); } acceptComment = ({commentId}) => { From 24ec898a15496d501111b5345e716e16c785461f Mon Sep 17 00:00:00 2001 From: Kim Gardner Date: Tue, 24 Oct 2017 14:14:26 +0100 Subject: [PATCH 2/3] Fix formatting --- docs/_docs/03-02-product-guide-commenter-features.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/_docs/03-02-product-guide-commenter-features.md b/docs/_docs/03-02-product-guide-commenter-features.md index b46c5f054..7f56880db 100644 --- a/docs/_docs/03-02-product-guide-commenter-features.md +++ b/docs/_docs/03-02-product-guide-commenter-features.md @@ -7,9 +7,9 @@ permalink: /commenter-features/ There are 2 ways that newsrooms can support signup/login functionality with Talk: -*Use Talk’s auth plugin out of the box (supports account registration with username and password, as well as features like forgot password) +* Use Talk’s auth plugin out of the box (supports account registration with username and password, as well as features like forgot password) -*Create their own auth plugin to integrate with your own auth systems +* Create their own auth plugin to integrate with your own auth systems We also provide a Facebook auth plugin that supports logging in with Facebook (you must provide your own Facebook App ID and Secret, which you can read more about here: [https://developers.facebook.com](https://developers.facebook.com){:target="_blank"}) From b7b9da9509e290694bf2d9e689cb9bdc28022767 Mon Sep 17 00:00:00 2001 From: Chi Vinh Le Date: Tue, 24 Oct 2017 15:16:45 +0200 Subject: [PATCH 3/3] Change fetchPolicy --- client/coral-admin/src/containers/UserDetail.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/client/coral-admin/src/containers/UserDetail.js b/client/coral-admin/src/containers/UserDetail.js index 97021ec75..3a458ff83 100644 --- a/client/coral-admin/src/containers/UserDetail.js +++ b/client/coral-admin/src/containers/UserDetail.js @@ -165,7 +165,8 @@ export const withUserDetailQuery = withQuery(gql` `, { options: ({userId, statuses}) => { return { - variables: {author_id: userId, statuses} + variables: {author_id: userId, statuses}, + fetchPolicy: 'network-only', }; }, skip: (ownProps) => !ownProps.userId,