This commit is contained in:
zmagod 2017-09-18 15:46:24 +02:00
parent f0a8275559
commit 015026926d
4 changed files with 6 additions and 12 deletions

View file

@ -1,5 +1,5 @@
import React, { Component } from "react";
import PropTypes, { bool, number, string, func } from "prop-types";
import { bool, number, string, func, shape } from "prop-types";
import { Modal, Button, Alert, Glyphicon } from "react-bootstrap";
import { FormattedMessage, FormattedHTMLMessage } from "react-intl";
@ -87,7 +87,7 @@ class RemoveUserModal extends Component {
RemoveUserModal.propTypes = {
showModal: bool.isRequired,
hideModal: func.isRequired,
userToRemove: PropTypes.shape({
userToRemove: shape({
userName: string.isRequired,
team_user_id: number.isRequired,
teamName: string.isRequired,

View file

@ -37,10 +37,7 @@ class UpdateTeamDescriptionModal extends Component {
}
getValidationState() {
if (this.state.errorMessage.length > 0) {
return "error";
}
return null;
return this.state.errorMessage.length > 0 ? "error" : null;
}
handleDescription(el) {

View file

@ -24,7 +24,7 @@ const StyledHelpBlock = styled(HelpBlock)`
class UpdateTeamNameModal extends Component {
constructor(props) {
super(props);
this.state = { errorMessage: "", name: props.team.name};
this.state = { errorMessage: "", name: props.team.name };
this.onCloseModal = this.onCloseModal.bind(this);
this.updateName = this.updateName.bind(this);
this.handleName = this.handleName.bind(this);
@ -37,10 +37,7 @@ class UpdateTeamNameModal extends Component {
}
getValidationState() {
if (this.state.errorMessage.length > 0) {
return "error";
}
return null;
return this.state.errorMessage.length > 0 ? "error" : null;
}
handleName(el) {

View file

@ -5,7 +5,7 @@ describe ClientApi::Teams::TeamsController, type: :controller do
before do
@user_one = User.first
@user_two = FactoryGirl.create(:user, email: 'sec_user@asdf.com')
@user_two = FactoryGirl.create :user, email: 'sec_user@asdf.com'
@team_one = FactoryGirl.create :team
@team_two = FactoryGirl.create :team, name: 'Team two'
FactoryGirl.create :user_team, team: @team_one, user: @user_one, role: 2