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

View File

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

View File

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