From 8c5040d88bd8608945e6f45a3673fd073934b1c3 Mon Sep 17 00:00:00 2001 From: okbel Date: Thu, 4 Jan 2018 11:49:10 -0300 Subject: [PATCH] Naming conventions --- client/coral-admin/src/components/UserDetail.js | 13 +++++++------ client/coral-admin/src/containers/UserDetail.js | 4 ++-- .../src/routes/Community/components/People.js | 16 ++++++++-------- .../src/routes/Community/containers/People.js | 8 ++++---- client/coral-framework/graphql/mutations.js | 4 ++-- 5 files changed, 23 insertions(+), 22 deletions(-) diff --git a/client/coral-admin/src/components/UserDetail.js b/client/coral-admin/src/components/UserDetail.js index 7616b913b..44f7aaed0 100644 --- a/client/coral-admin/src/components/UserDetail.js +++ b/client/coral-admin/src/components/UserDetail.js @@ -119,10 +119,11 @@ class UserDetail extends React.Component { viewUserDetail, loadMore, toggleSelectAll, - unBanUser, - unSuspendUser, + unbanUser, + unsuspendUser, } = this.props; + // if totalComments is 0, you're dividing by zero let rejectedPercent = (rejectedComments / totalComments) * 100; if (rejectedPercent === Infinity || isNaN(rejectedPercent)) { @@ -150,7 +151,7 @@ class UserDetail extends React.Component { label={this.getActionMenuLabel()}> {suspended ? unSuspendUser({id: user.id})}> + onClick={() => unsuspendUser({id: user.id})}> Remove Suspension : } {banned ? unBanUser({id: user.id})}> + onClick={() => unbanUser({id: user.id})}> Remove Ban : { - this.props.unSuspendUser(input); + unsuspendUser = (input) => { + this.props.unsuspendUser(input); } - unBanUser = (input) => { - this.props.unBanUser(input); + unbanUser = (input) => { + this.props.unbanUser(input); } showBanUserDialog = (input) => { @@ -122,7 +122,7 @@ class People extends React.Component { label={this.getActionMenuLabel(user)} > {isSuspended(user) ? this.unSuspendUser({id: user.id})}> + onClick={() => this.unsuspendUser({id: user.id})}> Remove Suspension : this.showSuspendUserDialog({ @@ -133,7 +133,7 @@ class People extends React.Component { } {isBanned(user) ? this.unBanUser({id: user.id})}> + onClick={() => this.unbanUser({id: user.id})}> Remove Ban : this.showBanUserDialog({ @@ -180,8 +180,8 @@ People.propTypes = { onSearchChange: PropTypes.func.isRequired, setUserRole: PropTypes.func.isRequired, viewUserDetail: PropTypes.func.isRequired, - unBanUser: PropTypes.func.isRequired, - unSuspendUser: PropTypes.func.isRequired, + unbanUser: PropTypes.func.isRequired, + unsuspendUser: PropTypes.func.isRequired, showSuspendUserDialog: PropTypes.func, showBanUserDialog: PropTypes.func, loadMore: PropTypes.func.isRequired, diff --git a/client/coral-admin/src/routes/Community/containers/People.js b/client/coral-admin/src/routes/Community/containers/People.js index b9f672428..789332c36 100644 --- a/client/coral-admin/src/routes/Community/containers/People.js +++ b/client/coral-admin/src/routes/Community/containers/People.js @@ -95,8 +95,8 @@ class PeopleContainer extends React.Component { setUserRole={this.setUserRole} showSuspendUserDialog={this.props.showSuspendUserDialog} showBanUserDialog={this.props.showBanUserDialog} - unBanUser={this.props.unBanUser} - unSuspendUser={this.props.unSuspendUser} + unbanUser={this.props.unbanUser} + unsuspendUser={this.props.unsuspendUser} data={this.props.data} root={this.props.root} users={this.props.root.users} @@ -108,8 +108,8 @@ class PeopleContainer extends React.Component { PeopleContainer.propTypes = { community: PropTypes.object, setUserRole: PropTypes.func.isRequired, - unBanUser: PropTypes.func.isRequired, - unSuspendUser: PropTypes.func.isRequired, + unbanUser: PropTypes.func.isRequired, + unsuspendUser: PropTypes.func.isRequired, viewUserDetail: PropTypes.func.isRequired, showSuspendUserDialog: PropTypes.func, showBanUserDialog: PropTypes.func, diff --git a/client/coral-framework/graphql/mutations.js b/client/coral-framework/graphql/mutations.js index 80d28d784..ab70dbd95 100644 --- a/client/coral-framework/graphql/mutations.js +++ b/client/coral-framework/graphql/mutations.js @@ -186,7 +186,7 @@ export const withUnSuspendUser = withMutation( } `, { props: ({mutate}) => ({ - unSuspendUser: (input) => { + unsuspendUser: (input) => { return mutate({ variables: { input, @@ -282,7 +282,7 @@ export const withUnBanUser = withMutation( } `, { props: ({mutate}) => ({ - unBanUser: (input) => { + unbanUser: (input) => { return mutate({ variables: { input,