1
0
mirror of https://github.com/yldio/copilot.git synced 2024-11-28 14:10:04 +02:00

adding callback to add member dispatch function and allowing for member not on system to be created

This commit is contained in:
Alex Windett 2017-01-31 11:50:37 +00:00
parent 2c61693c21
commit 61db98e842
3 changed files with 11 additions and 4 deletions

View File

@ -46,7 +46,11 @@ const Invite = React.createClass({
parentIndex: this.props.parentIndex,
};
this.props.addMemember(data);
this.props.addMemember(data, () => {
this.setState({
selectValue: ''
});
});
},
render() {
@ -88,8 +92,9 @@ const Invite = React.createClass({
<Row>
<Column xs={12}>
<form onSubmit={this.handleSubmit}>
<Select
<Select.Creatable
onChange={handleSelectChange}
onNewOptionClick={handleSelectChange}
options={selectData}
placeholder="Enter an email address or password"
style={InputStyle}

View File

@ -44,7 +44,8 @@ const mapStateToProps = (state, {
});
const mapDispatchToProps = (dispatch) => ({
addMemember: (member) => dispatch(addMemberToOrg(member)),
addMemember: (member, callback) =>
dispatch(addMemberToOrg(member, callback)),
handleToggle: () => dispatch(orgHandleInviteToggle()),
handleStatusTooltip: (id) => dispatch(orgHandlePeopleStatusTooltip(id)),
handleRoleTooltip: (id) => dispatch(orgHandlePeopleRoleTooltip(id)),

View File

@ -44,7 +44,8 @@ const mapStateToProps = (state, {
});
const mapDispatchToProps = (dispatch) => ({
addMemember: (member) => dispatch(addMemberToProject(member)),
addMemember: (member, callback) =>
dispatch(addMemberToProject(member, callback)),
handleToggle: () => dispatch(projectHandleInviteToggle()),
handleStatusTooltip: (id) => dispatch(projectHandlePeopleStatusTooltip(id)),
handleRoleTooltip: (id) => dispatch(projectHandlePeopleRoleTooltip(id)),