Naming Conventions

This commit is contained in:
okbel
2018-01-04 11:53:08 -03:00
parent 8c5040d88b
commit f04c3cc059
5 changed files with 10 additions and 10 deletions
+2 -2
View File
@@ -3,12 +3,12 @@ import * as actions from 'constants/userDetail';
export const viewUserDetail = (userId) => ({type: actions.VIEW_USER_DETAIL, userId});
export const hideUserDetail = () => ({type: actions.HIDE_USER_DETAIL});
export const changeUserDetailStatuses = (tab) => {
export const changeTab = (tab) => {
let statuses = null;
if (tab === 'rejected') {
statuses = ['REJECTED'];
}
return {type: actions.CHANGE_USER_DETAIL_STATUSES, tab, statuses};
return {type: actions.CHANGE_TAB_USER_DETAIL, tab, statuses};
};
export const clearUserDetailSelections = () => ({type: actions.CLEAR_USER_DETAIL_SELECTIONS});
@@ -64,7 +64,7 @@ class UserDetail extends React.Component {
}
changeTab = (tab) => {
this.props.changeStatus(tab);
this.props.changeTab(tab);
}
showSuspenUserDialog = () => this.props.showSuspendUserDialog({
@@ -329,7 +329,7 @@ UserDetail.propTypes = {
root: PropTypes.object.isRequired,
acceptComment: PropTypes.func.isRequired,
rejectComment: PropTypes.func.isRequired,
changeStatus: PropTypes.func.isRequired,
changeTab: PropTypes.func.isRequired,
toggleSelect: PropTypes.func.isRequired,
bulkAccept: PropTypes.func.isRequired,
bulkReject: PropTypes.func.isRequired,
@@ -1,6 +1,6 @@
export const VIEW_USER_DETAIL = 'VIEW_USER_DETAIL';
export const HIDE_USER_DETAIL = 'HIDE_USER_DETAIL';
export const CHANGE_USER_DETAIL_STATUSES = 'CHANGE_USER_DETAIL_STATUSES';
export const CHANGE_TAB_USER_DETAIL = 'CHANGE_TAB_USER_DETAIL';
export const SELECT_USER_DETAIL_COMMENT = 'SELECT_USER_DETAIL_COMMENT';
export const UNSELECT_USER_DETAIL_COMMENT = 'UNSELECT_USER_DETAIL_COMMENT';
export const CLEAR_USER_DETAIL_SELECTIONS = 'CLEAR_USER_DETAIL_SELECTIONS';
@@ -9,7 +9,7 @@ import {getDefinitionName, getSlotFragmentSpreads} from 'coral-framework/utils';
import {
viewUserDetail,
hideUserDetail,
changeUserDetailStatuses,
changeTab,
clearUserDetailSelections,
toggleSelectCommentInUserDetail,
toggleSelectAllCommentInUserDetail
@@ -117,7 +117,7 @@ class UserDetailContainer extends React.Component {
return <UserDetail
bulkReject={this.bulkReject}
bulkAccept={this.bulkAccept}
changeStatus={this.props.changeUserDetailStatuses}
changeTab={this.props.changeTab}
toggleSelect={this.props.toggleSelectCommentInUserDetail}
toggleSelectAll={this.props.toggleSelectAllCommentInUserDetail}
acceptComment={this.acceptComment}
@@ -129,7 +129,7 @@ class UserDetailContainer extends React.Component {
}
UserDetailContainer.propTypes = {
changeUserDetailStatuses: PropTypes.func,
changeTab: PropTypes.func,
toggleSelectCommentInUserDetail: PropTypes.func,
toggleSelectAllCommentInUserDetail: PropTypes.func,
data: PropTypes.object,
@@ -236,7 +236,7 @@ const mapDispatchToProps = (dispatch) => ({
...bindActionCreators({
showBanUserDialog,
showSuspendUserDialog,
changeUserDetailStatuses,
changeTab,
clearUserDetailSelections,
toggleSelectCommentInUserDetail,
viewUserDetail,
@@ -25,7 +25,7 @@ export default function banUserDialog(state = initialState, action) {
...state,
selectedCommentIds: [],
};
case actions.CHANGE_USER_DETAIL_STATUSES:
case actions.CHANGE_TAB_USER_DETAIL:
return {
...state,
activeTab: action.tab,