PLT-3753 Added Segment analytics (#3972)

Этот коммит содержится в:
David Lu
2016-09-06 18:51:27 -04:00
коммит произвёл enahum
родитель 47d77d2589
Коммит 51501f920c
44 изменённых файлов: 2704 добавлений и 41 удалений

Просмотреть файл

@@ -20,15 +20,12 @@ export default class ExternalServiceSettings extends AdminSettings {
}
getConfigFromState(config) {
config.ServiceSettings.SegmentDeveloperKey = this.state.segmentDeveloperKey;
config.ServiceSettings.GoogleDeveloperKey = this.state.googleDeveloperKey;
return config;
}
getStateFromConfig(config) {
return {
segmentDeveloperKey: config.ServiceSettings.SegmentDeveloperKey,
googleDeveloperKey: config.ServiceSettings.GoogleDeveloperKey
};
}
@@ -47,24 +44,6 @@ export default class ExternalServiceSettings extends AdminSettings {
renderSettings() {
return (
<SettingsGroup>
<TextSetting
id='segmentDeveloperKey'
label={
<FormattedMessage
id='admin.service.segmentTitle'
defaultMessage='Segment Write Key:'
/>
}
placeholder={Utils.localizeMessage('admin.service.segmentExample', 'Ex "g3fgGOXJAQ43QV7rAh6iwQCkV4cA1Gs"')}
helpText={
<FormattedMessage
id='admin.service.segmentDescription'
defaultMessage='Segment.com is an online service that can be optionally used to track detailed system statistics. You can obtain a key by signing-up for a free account at Segment.com.'
/>
}
value={this.state.segmentDeveloperKey}
onChange={this.handleChange}
/>
<TextSetting
id='googleDeveloperKey'
label={

Просмотреть файл

@@ -8,7 +8,7 @@ import * as Utils from 'utils/utils.jsx';
import AdminSettings from './admin_settings.jsx';
import BooleanSetting from './boolean_setting.jsx';
import DropdownSetting from './dropdown_setting.jsx';
import {FormattedMessage} from 'react-intl';
import {FormattedMessage, FormattedHTMLMessage} from 'react-intl';
import SettingsGroup from './settings_group.jsx';
import TextSetting from './text_setting.jsx';
@@ -29,6 +29,7 @@ export default class LogSettings extends AdminSettings {
config.LogSettings.FileLocation = this.state.fileLocation;
config.LogSettings.FileFormat = this.state.fileFormat;
config.LogSettings.EnableWebhookDebugging = this.state.enableWebhookDebugging;
config.LogSettings.EnableDiagnostics = this.state.enableDiagnostics;
return config;
}
@@ -41,7 +42,8 @@ export default class LogSettings extends AdminSettings {
fileLevel: config.LogSettings.FileLevel,
fileLocation: config.LogSettings.FileLocation,
fileFormat: config.LogSettings.FileFormat,
enableWebhookDebugging: config.LogSettings.EnableWebhookDebugging
enableWebhookDebugging: config.LogSettings.EnableWebhookDebugging,
enableDiagnostics: config.LogSettings.EnableDiagnostics
};
}
@@ -187,6 +189,23 @@ export default class LogSettings extends AdminSettings {
value={this.state.enableWebhookDebugging}
onChange={this.handleChange}
/>
<BooleanSetting
id='enableDiagnostics'
label={
<FormattedMessage
id='admin.log.enableDiagnostics'
defaultMessage='Enable Diagnostics and Error Reporting:'
/>
}
helpText={
<FormattedHTMLMessage
id='admin.log.enableDiagnosticsDescription'
defaultMessage='Enable this feature to improve the quality and performance of Mattermost by sending error reporting and diagnostic information to Mattermost, Inc. Read our <a href="https://about.mattermost.com/default-privacy-policy/" target="_blank">privacy policy</a> to learn more.'
/>
}
value={this.state.enableDiagnostics}
onChange={this.handleChange}
/>
</SettingsGroup>
);
}