diff options
author | Stas Vilchik <stas-vilchik@users.noreply.github.com> | 2017-03-17 09:10:48 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-03-17 09:10:48 +0100 |
commit | de4365079bad2df3bdee2133576dc913ffbf1ab2 (patch) | |
tree | a522ccb952f0d37f454e8188e13b3dec3f731912 /server/sonar-web/src/main/js/apps/settings/components/EmailForm.js | |
parent | 6a03df65cc0c91a26150ea172a2c480e07326ea1 (diff) | |
download | sonarqube-de4365079bad2df3bdee2133576dc913ffbf1ab2.tar.gz sonarqube-de4365079bad2df3bdee2133576dc913ffbf1ab2.zip |
format code using prettier (#1774)
Diffstat (limited to 'server/sonar-web/src/main/js/apps/settings/components/EmailForm.js')
-rw-r--r-- | server/sonar-web/src/main/js/apps/settings/components/EmailForm.js | 132 |
1 files changed, 69 insertions, 63 deletions
diff --git a/server/sonar-web/src/main/js/apps/settings/components/EmailForm.js b/server/sonar-web/src/main/js/apps/settings/components/EmailForm.js index ea88bfe84df..e923f635443 100644 --- a/server/sonar-web/src/main/js/apps/settings/components/EmailForm.js +++ b/server/sonar-web/src/main/js/apps/settings/components/EmailForm.js @@ -25,7 +25,7 @@ import { parseError } from '../../code/utils'; import { getCurrentUser } from '../../../store/rootReducer'; class EmailForm extends React.Component { - constructor (props) { + constructor(props) { super(props); this.state = { recipient: this.props.currentUser.email, @@ -37,7 +37,7 @@ class EmailForm extends React.Component { }; } - handleFormSubmit (e) { + handleFormSubmit(e) { e.preventDefault(); this.setState({ success: false, error: null, loading: true }); const { recipient, subject, message } = this.state; @@ -47,72 +47,78 @@ class EmailForm extends React.Component { ); } - render () { + render() { return ( - <div className="huge-spacer-top"> - <h3 className="spacer-bottom">{translate('email_configuration.test.title')}</h3> + <div className="huge-spacer-top"> + <h3 className="spacer-bottom">{translate('email_configuration.test.title')}</h3> - <form style={{ marginLeft: 201 }} onSubmit={e => this.handleFormSubmit(e)}> - {this.state.success && ( - <div className="modal-field"> - <div className="alert alert-success"> - {translateWithParameters('email_configuration.test.email_was_sent_to_x', this.state.recipient)} - </div> - </div> - )} - - {this.state.error != null && ( - <div className="modal-field"> - <div className="alert alert-danger"> - {this.state.error} - </div> - </div> - )} - - <div className="modal-field"> - <label htmlFor="test-email-to"> - {translate('email_configuration.test.to_address')} - <em className="mandatory">*</em> - </label> - <input - id="test-email-to" - type="email" - required={true} - value={this.state.recipient} - disabled={this.state.loading} - onChange={e => this.setState({ recipient: e.target.value })}/> - </div> + <form style={{ marginLeft: 201 }} onSubmit={e => this.handleFormSubmit(e)}> + {this.state.success && <div className="modal-field"> - <label htmlFor="test-email-subject"> - {translate('email_configuration.test.subject')} - </label> - <input - id="test-email-subject" - type="text" - value={this.state.subject} - disabled={this.state.loading} - onChange={e => this.setState({ subject: e.target.value })}/> - </div> - <div className="modal-field"> - <label htmlFor="test-email-message"> - {translate('email_configuration.test.message')} - <em className="mandatory">*</em> - </label> - <textarea - id="test-email-title" - required={true} - rows="5" - value={this.state.message} - disabled={this.state.loading} - onChange={e => this.setState({ message: e.target.value })}/> - </div> + <div className="alert alert-success"> + {translateWithParameters( + 'email_configuration.test.email_was_sent_to_x', + this.state.recipient + )} + </div> + </div>} + {this.state.error != null && <div className="modal-field"> - {this.state.loading && <i className="spacer-right spinner"/>} - <button disabled={this.state.loading}>{translate('email_configuration.test.send')}</button> - </div> - </form> - </div> + <div className="alert alert-danger"> + {this.state.error} + </div> + </div>} + + <div className="modal-field"> + <label htmlFor="test-email-to"> + {translate('email_configuration.test.to_address')} + <em className="mandatory">*</em> + </label> + <input + id="test-email-to" + type="email" + required={true} + value={this.state.recipient} + disabled={this.state.loading} + onChange={e => this.setState({ recipient: e.target.value })} + /> + </div> + <div className="modal-field"> + <label htmlFor="test-email-subject"> + {translate('email_configuration.test.subject')} + </label> + <input + id="test-email-subject" + type="text" + value={this.state.subject} + disabled={this.state.loading} + onChange={e => this.setState({ subject: e.target.value })} + /> + </div> + <div className="modal-field"> + <label htmlFor="test-email-message"> + {translate('email_configuration.test.message')} + <em className="mandatory">*</em> + </label> + <textarea + id="test-email-title" + required={true} + rows="5" + value={this.state.message} + disabled={this.state.loading} + onChange={e => this.setState({ message: e.target.value })} + /> + </div> + + <div className="modal-field"> + {this.state.loading && <i className="spacer-right spinner" />} + <button disabled={this.state.loading}> + {translate('email_configuration.test.send')} + </button> + </div> + </form> + </div> ); } } |