Merge pull request #1725 from mattermost/fix-console-err
Adding error bar message when console error detected
Этот коммит содержится в:
@@ -10,6 +10,7 @@
|
|||||||
"EnablePostUsernameOverride": false,
|
"EnablePostUsernameOverride": false,
|
||||||
"EnablePostIconOverride": false,
|
"EnablePostIconOverride": false,
|
||||||
"EnableTesting": false,
|
"EnableTesting": false,
|
||||||
|
"EnableDeveloper": false,
|
||||||
"EnableSecurityFixAlert": true
|
"EnableSecurityFixAlert": true
|
||||||
},
|
},
|
||||||
"TeamSettings": {
|
"TeamSettings": {
|
||||||
|
|||||||
@@ -10,6 +10,7 @@
|
|||||||
"EnablePostUsernameOverride": false,
|
"EnablePostUsernameOverride": false,
|
||||||
"EnablePostIconOverride": false,
|
"EnablePostIconOverride": false,
|
||||||
"EnableTesting": false,
|
"EnableTesting": false,
|
||||||
|
"EnableDeveloper": false,
|
||||||
"EnableSecurityFixAlert": true
|
"EnableSecurityFixAlert": true
|
||||||
},
|
},
|
||||||
"TeamSettings": {
|
"TeamSettings": {
|
||||||
|
|||||||
@@ -10,6 +10,7 @@
|
|||||||
"EnablePostUsernameOverride": false,
|
"EnablePostUsernameOverride": false,
|
||||||
"EnablePostIconOverride": false,
|
"EnablePostIconOverride": false,
|
||||||
"EnableTesting": false,
|
"EnableTesting": false,
|
||||||
|
"EnableDeveloper": false,
|
||||||
"EnableSecurityFixAlert": true
|
"EnableSecurityFixAlert": true
|
||||||
},
|
},
|
||||||
"TeamSettings": {
|
"TeamSettings": {
|
||||||
|
|||||||
@@ -33,6 +33,7 @@ type ServiceSettings struct {
|
|||||||
EnablePostUsernameOverride bool
|
EnablePostUsernameOverride bool
|
||||||
EnablePostIconOverride bool
|
EnablePostIconOverride bool
|
||||||
EnableTesting bool
|
EnableTesting bool
|
||||||
|
EnableDeveloper *bool
|
||||||
EnableSecurityFixAlert *bool
|
EnableSecurityFixAlert *bool
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -191,6 +192,11 @@ func (o *Config) SetDefaults() {
|
|||||||
o.EmailSettings.PasswordResetSalt = NewRandomString(32)
|
o.EmailSettings.PasswordResetSalt = NewRandomString(32)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if o.ServiceSettings.EnableDeveloper == nil {
|
||||||
|
o.ServiceSettings.EnableDeveloper = new(bool)
|
||||||
|
*o.ServiceSettings.EnableDeveloper = false
|
||||||
|
}
|
||||||
|
|
||||||
if o.ServiceSettings.EnableSecurityFixAlert == nil {
|
if o.ServiceSettings.EnableSecurityFixAlert == nil {
|
||||||
o.ServiceSettings.EnableSecurityFixAlert = new(bool)
|
o.ServiceSettings.EnableSecurityFixAlert = new(bool)
|
||||||
*o.ServiceSettings.EnableSecurityFixAlert = true
|
*o.ServiceSettings.EnableSecurityFixAlert = true
|
||||||
|
|||||||
@@ -195,6 +195,7 @@ func getClientConfig(c *model.Config) map[string]string {
|
|||||||
props["EnableOutgoingWebhooks"] = strconv.FormatBool(c.ServiceSettings.EnableOutgoingWebhooks)
|
props["EnableOutgoingWebhooks"] = strconv.FormatBool(c.ServiceSettings.EnableOutgoingWebhooks)
|
||||||
props["EnablePostUsernameOverride"] = strconv.FormatBool(c.ServiceSettings.EnablePostUsernameOverride)
|
props["EnablePostUsernameOverride"] = strconv.FormatBool(c.ServiceSettings.EnablePostUsernameOverride)
|
||||||
props["EnablePostIconOverride"] = strconv.FormatBool(c.ServiceSettings.EnablePostIconOverride)
|
props["EnablePostIconOverride"] = strconv.FormatBool(c.ServiceSettings.EnablePostIconOverride)
|
||||||
|
props["EnableDeveloper"] = strconv.FormatBool(*c.ServiceSettings.EnableDeveloper)
|
||||||
|
|
||||||
props["SendEmailNotifications"] = strconv.FormatBool(c.EmailSettings.SendEmailNotifications)
|
props["SendEmailNotifications"] = strconv.FormatBool(c.EmailSettings.SendEmailNotifications)
|
||||||
props["EnableSignUpWithEmail"] = strconv.FormatBool(c.EmailSettings.EnableSignUpWithEmail)
|
props["EnableSignUpWithEmail"] = strconv.FormatBool(c.EmailSettings.EnableSignUpWithEmail)
|
||||||
|
|||||||
@@ -40,6 +40,7 @@ export default class ServiceSettings extends React.Component {
|
|||||||
config.ServiceSettings.EnablePostUsernameOverride = ReactDOM.findDOMNode(this.refs.EnablePostUsernameOverride).checked;
|
config.ServiceSettings.EnablePostUsernameOverride = ReactDOM.findDOMNode(this.refs.EnablePostUsernameOverride).checked;
|
||||||
config.ServiceSettings.EnablePostIconOverride = ReactDOM.findDOMNode(this.refs.EnablePostIconOverride).checked;
|
config.ServiceSettings.EnablePostIconOverride = ReactDOM.findDOMNode(this.refs.EnablePostIconOverride).checked;
|
||||||
config.ServiceSettings.EnableTesting = ReactDOM.findDOMNode(this.refs.EnableTesting).checked;
|
config.ServiceSettings.EnableTesting = ReactDOM.findDOMNode(this.refs.EnableTesting).checked;
|
||||||
|
config.ServiceSettings.EnableDeveloper = ReactDOM.findDOMNode(this.refs.EnableDeveloper).checked;
|
||||||
config.ServiceSettings.EnableSecurityFixAlert = ReactDOM.findDOMNode(this.refs.EnableSecurityFixAlert).checked;
|
config.ServiceSettings.EnableSecurityFixAlert = ReactDOM.findDOMNode(this.refs.EnableSecurityFixAlert).checked;
|
||||||
|
|
||||||
//config.ServiceSettings.EnableOAuthServiceProvider = ReactDOM.findDOMNode(this.refs.EnableOAuthServiceProvider).checked;
|
//config.ServiceSettings.EnableOAuthServiceProvider = ReactDOM.findDOMNode(this.refs.EnableOAuthServiceProvider).checked;
|
||||||
@@ -340,6 +341,39 @@ export default class ServiceSettings extends React.Component {
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div className='form-group'>
|
||||||
|
<label
|
||||||
|
className='control-label col-sm-4'
|
||||||
|
htmlFor='EnableDeveloper'
|
||||||
|
>
|
||||||
|
{'Enable Developer Mode: '}
|
||||||
|
</label>
|
||||||
|
<div className='col-sm-8'>
|
||||||
|
<label className='radio-inline'>
|
||||||
|
<input
|
||||||
|
type='radio'
|
||||||
|
name='EnableDeveloper'
|
||||||
|
value='true'
|
||||||
|
ref='EnableDeveloper'
|
||||||
|
defaultChecked={this.props.config.ServiceSettings.EnableDeveloper}
|
||||||
|
onChange={this.handleChange}
|
||||||
|
/>
|
||||||
|
{'true'}
|
||||||
|
</label>
|
||||||
|
<label className='radio-inline'>
|
||||||
|
<input
|
||||||
|
type='radio'
|
||||||
|
name='EnableDeveloper'
|
||||||
|
value='false'
|
||||||
|
defaultChecked={!this.props.config.ServiceSettings.EnableDeveloper}
|
||||||
|
onChange={this.handleChange}
|
||||||
|
/>
|
||||||
|
{'false'}
|
||||||
|
</label>
|
||||||
|
<p className='help-text'>{'(Developer Option) When true, extra information around errors will be displayed in the UI.'}</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div className='form-group'>
|
<div className='form-group'>
|
||||||
<label
|
<label
|
||||||
className='control-label col-sm-4'
|
className='control-label col-sm-4'
|
||||||
|
|||||||
@@ -63,3 +63,4 @@ ErrorStore.dispatchToken = AppDispatcher.register((payload) => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
export default ErrorStore;
|
export default ErrorStore;
|
||||||
|
window.ErrorStore = ErrorStore;
|
||||||
|
|||||||
@@ -85,6 +85,11 @@
|
|||||||
type: 'POST',
|
type: 'POST',
|
||||||
data: JSON.stringify(l)
|
data: JSON.stringify(l)
|
||||||
});
|
});
|
||||||
|
|
||||||
|
if (window.mm_config.EnableDeveloper === 'true') {
|
||||||
|
window.ErrorStore.storeLastError('DEVELOPER MODE: A javascript error has occured. Please use the javascript console to capture and report the error (row: ' + line + ' col: ' + column + ').');
|
||||||
|
window.ErrorStore.emitChange();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|||||||
Ссылка в новой задаче
Block a user