// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See License.txt for license information. import React from 'react'; import * as Utils from 'utils/utils.jsx'; import AdminSettings from './admin_settings.jsx'; import BooleanSetting from './boolean_setting.jsx'; import {FormattedMessage, FormattedHTMLMessage} from 'react-intl'; import SettingsGroup from './settings_group.jsx'; import TextSetting from './text_setting.jsx'; export default class DeveloperSettings extends AdminSettings { constructor(props) { super(props); this.getConfigFromState = this.getConfigFromState.bind(this); this.renderSettings = this.renderSettings.bind(this); } getConfigFromState(config) { config.ServiceSettings.EnableTesting = this.state.enableTesting; config.ServiceSettings.EnableDeveloper = this.state.enableDeveloper; config.ServiceSettings.AllowedUntrustedInternalConnections = this.state.allowedUntrustedInternalConnections; return config; } getStateFromConfig(config) { return { enableTesting: config.ServiceSettings.EnableTesting, enableDeveloper: config.ServiceSettings.EnableDeveloper, allowedUntrustedInternalConnections: config.ServiceSettings.AllowedUntrustedInternalConnections }; } renderTitle() { return ( ); } renderSettings() { return ( } helpText={ } value={this.state.enableTesting} onChange={this.handleChange} /> } helpText={ } value={this.state.enableDeveloper} onChange={this.handleChange} /> } placeholder={Utils.localizeMessage('admin.service.internalConnectionsEx', 'webhooks.internal.example.com 127.0.0.1 10.0.16.0/28')} helpText={ } value={this.state.allowedUntrustedInternalConnections} onChange={this.handleChange} /> ); } }