Skip to content

Commit

Permalink
fix repo form submission (#4616)
Browse files Browse the repository at this point in the history
  • Loading branch information
macqueen committed Nov 29, 2016
1 parent 73f5520 commit b652132
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/sentry/static/sentry/app/views/organizationRepositories.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class AddRepositoryLink extends PluginComponentBase {

['onOpen',
'onCancel',
'onSubmit',
'formSubmit',
'changeField'].map(method => this[method] = this[method].bind(this));
}

Expand All @@ -43,6 +43,13 @@ class AddRepositoryLink extends PluginComponentBase {
this.setState({isModalOpen: false});
}

formSubmit(ev) {
// since this doesn't use the Form component, wrap onSubmit
// in a function that calls preventDefault
ev.preventDefault();
this.onSubmit();
}

onSubmit() {
// TODO(dcramer): set form saving state
this.setState({
Expand Down Expand Up @@ -79,7 +86,7 @@ class AddRepositoryLink extends PluginComponentBase {
let errors = this.state.error.errors || {};
let provider = this.props.provider;
return (
<form onSubmit={this.onSubmit}>
<form onSubmit={this.formSubmit}>
{errors.__all__ &&
<div className="alert alert-error alert-block" key="_errors">
<p>{errors.__all__}</p>
Expand Down

0 comments on commit b652132

Please sign in to comment.