diff --git a/client/containers/ProjectGroups/GroupList/GroupList.js b/client/containers/ProjectGroups/GroupList/GroupList.js index 1c9979f2..8b67323a 100644 --- a/client/containers/ProjectGroups/GroupList/GroupList.js +++ b/client/containers/ProjectGroups/GroupList/GroupList.js @@ -1,7 +1,7 @@ import React, { Component } from 'react' import PropTypes from 'prop-types' import { connect } from 'react-redux' -import { Button, Icon, Modal, Input, message, Menu } from 'antd' +import { Button, Icon, Modal, Input, message, Menu, Row, Col } from 'antd' import { autobind } from 'core-decorators'; import axios from 'axios'; @@ -10,7 +10,8 @@ const Search = Input.Search; import { fetchGroupList, setCurrGroup, - addGroup + addGroup, + fetchProjectList } from '../../../actions/group.js' import './GroupList.scss' @@ -23,7 +24,8 @@ import './GroupList.scss' { fetchGroupList, setCurrGroup, - addGroup + addGroup, + fetchProjectList } ) export default class GroupList extends Component { @@ -32,7 +34,8 @@ export default class GroupList extends Component { groupList: PropTypes.array, currGroup: PropTypes.object, fetchGroupList: PropTypes.func, - setCurrGroup: PropTypes.func + setCurrGroup: PropTypes.func, + fetchProjectList: PropTypes.func } state = { @@ -88,6 +91,14 @@ export default class GroupList extends Component { this.setState({newGroupDesc: e.target.value}); } + @autobind + selectGroup(e) { + const groupId = e.key; + const currGroup = this.props.groupList.find((group) => { return +group._id === +groupId }); + this.props.setCurrGroup(currGroup); + // this.props.fetchProjectList(groupId); + } + render () { const { groupList, currGroup } = this.props; @@ -107,10 +118,15 @@ export default class GroupList extends Component { -