mirror of
https://github.com/mattermost/mattermost.git
synced 2025-02-25 18:55:24 -06:00
Improved handling of invalid incoming and outgoing webhooks
This commit is contained in:
@@ -72,6 +72,7 @@ export default class AddIncomingWebhook extends React.Component {
|
||||
},
|
||||
(err) => {
|
||||
this.setState({
|
||||
saving: false,
|
||||
serverError: err.message
|
||||
});
|
||||
}
|
||||
@@ -125,6 +126,7 @@ export default class AddIncomingWebhook extends React.Component {
|
||||
<input
|
||||
id='displayName'
|
||||
type='text'
|
||||
maxLength='64'
|
||||
className='form-control'
|
||||
value={this.state.displayName}
|
||||
onChange={this.updateDisplayName}
|
||||
@@ -145,6 +147,7 @@ export default class AddIncomingWebhook extends React.Component {
|
||||
<input
|
||||
id='description'
|
||||
type='text'
|
||||
maxLength='128'
|
||||
className='form-control'
|
||||
value={this.state.description}
|
||||
onChange={this.updateDescription}
|
||||
|
||||
@@ -92,6 +92,7 @@ export default class AddOutgoingWebhook extends React.Component {
|
||||
},
|
||||
(err) => {
|
||||
this.setState({
|
||||
saving: false,
|
||||
serverError: err.message
|
||||
});
|
||||
}
|
||||
@@ -157,6 +158,7 @@ export default class AddOutgoingWebhook extends React.Component {
|
||||
<input
|
||||
id='displayName'
|
||||
type='text'
|
||||
maxLength='64'
|
||||
className='form-control'
|
||||
value={this.state.displayName}
|
||||
onChange={this.updateDisplayName}
|
||||
@@ -177,6 +179,7 @@ export default class AddOutgoingWebhook extends React.Component {
|
||||
<input
|
||||
id='description'
|
||||
type='text'
|
||||
maxLength='128'
|
||||
className='form-control'
|
||||
value={this.state.description}
|
||||
onChange={this.updateDescription}
|
||||
@@ -215,6 +218,7 @@ export default class AddOutgoingWebhook extends React.Component {
|
||||
<textarea
|
||||
id='triggerWords'
|
||||
rows='3'
|
||||
maxLength='1000'
|
||||
className='form-control'
|
||||
value={this.state.triggerWords}
|
||||
onChange={this.updateTriggerWords}
|
||||
@@ -235,6 +239,7 @@ export default class AddOutgoingWebhook extends React.Component {
|
||||
<textarea
|
||||
id='callbackUrls'
|
||||
rows='3'
|
||||
maxLength='1000'
|
||||
className='form-control'
|
||||
value={this.state.callbackUrls}
|
||||
onChange={this.updateCallbackUrls}
|
||||
|
||||
@@ -1182,10 +1182,10 @@ export function addIncomingHook(hook, success, error) {
|
||||
}
|
||||
},
|
||||
(err) => {
|
||||
dispatchError(err, 'addIncomingHook');
|
||||
|
||||
if (error) {
|
||||
error(err);
|
||||
} else {
|
||||
dispatchError(err, 'addIncomingHook');
|
||||
}
|
||||
}
|
||||
);
|
||||
@@ -1205,10 +1205,10 @@ export function addOutgoingHook(hook, success, error) {
|
||||
}
|
||||
},
|
||||
(err) => {
|
||||
dispatchError(err, 'addOutgoingHook');
|
||||
|
||||
if (error) {
|
||||
error(err);
|
||||
} else {
|
||||
dispatchError(err, 'addOutgoingHook');
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user