Commit 8f78dfad authored by Chris Duarte's avatar Chris Duarte Committed by Harrison Healey
Browse files

Manage version configurations client versions (#7220)

* Add config values for client versions. Return client versions in ping response.

* Manage client version through System Console.

* Added client versions to diagnostics

* Added translations messages en.json file.

* Hide Client Versions on System Console.
parent ee9f035d
......@@ -277,6 +277,22 @@ export default class AdminSidebar extends React.Component {
);
}
const SHOW_CLIENT_VERSIONS = false;
let clientVersions = null;
if (SHOW_CLIENT_VERSIONS) {
clientVersions = (
<AdminSidebarSection
name='client_versions'
title={
<FormattedMessage
id='admin.sidebar.client_versions'
defaultMessage='Client Versions'
/>
}
/>
);
}
return (
<div className='admin-sidebar'>
<AdminSidebarHeader/>
......@@ -477,6 +493,7 @@ export default class AdminSidebar extends React.Component {
/>
}
/>
{clientVersions}
</AdminSidebarSection>
<AdminSidebarSection
name='notifications'
......
// Copyright (c) 2015 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 {FormattedMessage} from 'react-intl';
import SettingsGroup from './settings_group.jsx';
import TextSetting from './text_setting.jsx';
export default class ClientVersionsSettings extends AdminSettings {
constructor(props) {
super(props);
this.getConfigFromState = this.getConfigFromState.bind(this);
this.renderSettings = this.renderSettings.bind(this);
}
getConfigFromState(config) {
config.ClientRequirements.AndroidLatestVersion = this.state.androidLatestVersion;
config.ClientRequirements.AndroidMinVersion = this.state.androidMinVersion;
config.ClientRequirements.DesktopLatestVersion = this.state.desktopLatestVersion;
config.ClientRequirements.DesktopMinVersion = this.state.desktopMinVersion;
config.ClientRequirements.IosLatestVersion = this.state.iosLatestVersion;
config.ClientRequirements.IosMinVersion = this.state.iosMinVersion;
return config;
}
getStateFromConfig(config) {
return {
androidLatestVersion: config.ClientRequirements.AndroidLatestVersion,
androidMinVersion: config.ClientRequirements.AndroidMinVersion,
desktopLatestVersion: config.ClientRequirements.DesktopLatestVersion,
desktopMinVersion: config.ClientRequirements.DesktopMinVersion,
iosLatestVersion: config.ClientRequirements.IosLatestVersion,
iosMinVersion: config.ClientRequirements.IosMinVersion
};
}
renderTitle() {
return (
<h3>
<FormattedMessage
id='admin.security.client_versions'
defaultMessage='Client Versions'
/>
</h3>
);
}
renderSettings() {
return (
<SettingsGroup>
<TextSetting
id='androidLatestVersion'
label={
<FormattedMessage
id='admin.client_versions.androidLatestVersion'
defaultMessage='Latest Android Version'
/>
}
placeholder={Utils.localizeMessage('admin.client_versions.androidLatestVersion', 'X.X.X')}
helpText={
<FormattedMessage
id='admin.client_versions.androidLatestVersionHelp'
defaultMessage='The latest released Android version'
/>
}
value={this.state.androidLatestVersion}
onChange={this.handleChange}
/>
<TextSetting
id='androidMinVersion'
label={
<FormattedMessage
id='admin.client_versions.androidMinVersion'
defaultMessage='Minimum Android Version'
/>
}
placeholder={Utils.localizeMessage('admin.client_versions.androidMinVersion', 'X.X.X')}
helpText={
<FormattedMessage
id='admin.client_versions.androidMinVersionHelp'
defaultMessage='The minimum compliant Android version'
/>
}
value={this.state.androidMinVersion}
onChange={this.handleChange}
/>
<TextSetting
id='desktopLatestVersion'
label={
<FormattedMessage
id='admin.client_versions.desktopLatestVersion'
defaultMessage='Latest Desktop Version'
/>
}
placeholder={Utils.localizeMessage('admin.client_versions.desktopLatestVersion', 'X.X.X')}
helpText={
<FormattedMessage
id='admin.client_versions.desktopLatestVersionHelp'
defaultMessage='The latest released Desktop version'
/>
}
value={this.state.desktopLatestVersion}
onChange={this.handleChange}
/>
<TextSetting
id='desktopMinVersion'
label={
<FormattedMessage
id='admin.client_versions.desktopMinVersion'
defaultMessage='Minimum Destop Version'
/>
}
placeholder={Utils.localizeMessage('admin.client_versions.desktopMinVersion', 'X.X.X')}
helpText={
<FormattedMessage
id='admin.client_versions.desktopMinVersionHelp'
defaultMessage='The minimum compliant Desktop version'
/>
}
value={this.state.desktopMinVersion}
onChange={this.handleChange}
/>
<TextSetting
id='iosLatestVersion'
label={
<FormattedMessage
id='admin.client_versions.iosLatestVersion'
defaultMessage='Latest IOS Version'
/>
}
placeholder={Utils.localizeMessage('admin.client_versions.iosLatestVersion', 'X.X.X')}
helpText={
<FormattedMessage
id='admin.client_versions.iosLatestVersionHelp'
defaultMessage='The latest released IOS version'
/>
}
value={this.state.iosLatestVersion}
onChange={this.handleChange}
/>
<TextSetting
id='iosMinVersion'
label={
<FormattedMessage
id='admin.client_versions.iosMinVersion'
defaultMessage='Minimum IOS Version'
/>
}
placeholder={Utils.localizeMessage('admin.client_versions.iosMinVersion', 'X.X.X')}
helpText={
<FormattedMessage
id='admin.client_versions.iosMinVersionHelp'
defaultMessage='The minimum compliant IOS version'
/>
}
value={this.state.iosMinVersion}
onChange={this.handleChange}
/>
</SettingsGroup>
);
}
}
......@@ -150,6 +150,18 @@
"admin.authentication.oauth": "OAuth 2.0",
"admin.authentication.saml": "SAML 2.0",
"admin.banner.heading": "Note:",
"admin.client_versions.androidLatestVersion": "Latest Android Version",
"admin.client_versions.androidLatestVersionHelp": "The latest released Android version",
"admin.client_versions.androidMinVersion": "Minimum Android Version",
"admin.client_versions.androidMinVersionHelp": "The minimum compliant Android version",
"admin.client_versions.desktopLatestVersion": "Latest Desktop Version",
"admin.client_versions.desktopLatestVersionHelp": "The latest released Desktop version",
"admin.client_versions.desktopMinVersion": "Minimum Destop Version",
"admin.client_versions.desktopMinVersionHelp": "The minimum compliant Desktop version",
"admin.client_versions.iosLatestVersion": "Latest IOS Version",
"admin.client_versions.iosLatestVersionHelp": "The latest released IOS version",
"admin.client_versions.iosMinVersion": "Minimum IOS Version",
"admin.client_versions.iosMinVersionHelp": "The minimum compliant IOS version",
"admin.cluster.enableDescription": "When true, Mattermost will run in High Availability mode. Please see <a href=\"http://docs.mattermost.com/deployment/cluster.html\" target='_blank'>documentation</a> to learn more about configuring High Availability for Mattermost.",
"admin.cluster.enableTitle": "Enable High Availability Mode:",
"admin.cluster.interNodeListenAddressDesc": "The address the server will listen on for communicating with other servers.",
......@@ -858,6 +870,7 @@
"admin.sidebar.advanced": "Advanced",
"admin.sidebar.audits": "Compliance and Auditing",
"admin.sidebar.authentication": "Authentication",
"admin.sidebar.client_versions": "Client Versions",
"admin.sidebar.cluster": "High Availability",
"admin.sidebar.compliance": "Compliance",
"admin.sidebar.configuration": "Configuration",
......
......@@ -25,6 +25,7 @@ import MfaSettings from 'components/admin_console/mfa_settings.jsx';
import PublicLinkSettings from 'components/admin_console/public_link_settings.jsx';
import SessionSettings from 'components/admin_console/session_settings.jsx';
import ConnectionSettings from 'components/admin_console/connection_settings.jsx';
import ClientVersionsSettings from 'components/admin_console/client_versions_settings.jsx';
import EmailSettings from 'components/admin_console/email_settings.jsx';
import PushSettings from 'components/admin_console/push_settings.jsx';
import CustomIntegrationsSettings from 'components/admin_console/custom_integrations_settings.jsx';
......@@ -134,6 +135,10 @@ export default (
path='connections'
component={ConnectionSettings}
/>
<Route
path='client_versions'
component={ClientVersionsSettings}
/>
</Route>
<Route path='notifications'>
<IndexRedirect to='notifications_email'/>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment