fix projects unconected test

This commit is contained in:
Sérgio Ramos 2017-02-07 15:49:07 +00:00
parent 3d50f4201d
commit b29433c2e0
3 changed files with 9 additions and 19 deletions

View File

@ -14,7 +14,6 @@ const buttonStyle = {
}; };
const People = (props) => { const People = (props) => {
const { const {
UI = {}, UI = {},
handleToggle, handleToggle,

View File

@ -25,14 +25,11 @@ const {
projectRemoveMember, projectRemoveMember,
} = actions; } = actions;
const People = (props) => { const People = (props) => (
<Section {...props}>
return ( <PeopleSection {...props} />
<Section {...props}> </Section>
<PeopleSection {...props} /> );
</Section>
);
};
const mapStateToProps = (state, { const mapStateToProps = (state, {
params = {} params = {}

View File

@ -26,8 +26,7 @@ const {
const Projects = (props) => { const Projects = (props) => {
const { const {
org = {}, org = {},
projects = [], projects = []
router
} = props; } = props;
const empty = projects.length ? null : ( const empty = projects.length ? null : (
@ -45,15 +44,12 @@ const Projects = (props) => {
</li> </li>
)); ));
const onCreateProject = (evt) =>
router.transitionTo(`/${org.id}/new-project`);
return ( return (
<div> <div>
{empty} {empty}
<Row> <Row>
<Column xs={12}> <Column xs={12}>
<Button onClick={onCreateProject}> <Button href={`/${org.id}/new-project`}>
<FormattedMessage id='create-new' /> <FormattedMessage id='create-new' />
</Button> </Button>
</Column> </Column>
@ -69,8 +65,7 @@ const Projects = (props) => {
Projects.propTypes = { Projects.propTypes = {
org: PropTypes.org, org: PropTypes.org,
projects: React.PropTypes.arrayOf(PropTypes.project), projects: React.PropTypes.arrayOf(PropTypes.project)
router: React.PropTypes.object
}; };
const mapStateToProps = (state, { const mapStateToProps = (state, {
@ -79,8 +74,7 @@ const mapStateToProps = (state, {
} }
}) => ({ }) => ({
org: orgByIdSelector(match.params.org)(state), org: orgByIdSelector(match.params.org)(state),
projects: projectsByOrgIdSelector(match.params.org)(state), projects: projectsByOrgIdSelector(match.params.org)(state)
router: state.app.router
}); });
module.exports = connect( module.exports = connect(