From bfc3012e6a059dc89b69b41ab3fe1fc43f1406f5 Mon Sep 17 00:00:00 2001 From: it33 Date: Sat, 9 Jan 2016 21:39:19 -0800 Subject: Documenting how Preview Mode turns off --- web/react/components/admin_console/email_settings.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'web/react/components/admin_console') diff --git a/web/react/components/admin_console/email_settings.jsx b/web/react/components/admin_console/email_settings.jsx index 91d73dccd..48727e616 100644 --- a/web/react/components/admin_console/email_settings.jsx +++ b/web/react/components/admin_console/email_settings.jsx @@ -254,7 +254,7 @@ export default class EmailSettings extends React.Component { /> {'false'} -

{'Typically set to true in production. When true, Mattermost attempts to send email notifications. Developers may set this field to false to skip email setup for faster development.'}

+

{'Typically set to true in production. When true, Mattermost attempts to send email notifications. Developers may set this field to false to skip email setup for faster development.\nSetting this to true removes the Preview Mode banner after logging out and logging back in.'}

-- cgit v1.2.3-1-g7c22 From bf1f0d03191165b5735e1a4f5850971b507ec513 Mon Sep 17 00:00:00 2001 From: it33 Date: Sat, 9 Jan 2016 21:43:42 -0800 Subject: Update email_settings.jsx --- web/react/components/admin_console/email_settings.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'web/react/components/admin_console') diff --git a/web/react/components/admin_console/email_settings.jsx b/web/react/components/admin_console/email_settings.jsx index 48727e616..6aec3c7b1 100644 --- a/web/react/components/admin_console/email_settings.jsx +++ b/web/react/components/admin_console/email_settings.jsx @@ -254,7 +254,7 @@ export default class EmailSettings extends React.Component { /> {'false'} -

{'Typically set to true in production. When true, Mattermost attempts to send email notifications. Developers may set this field to false to skip email setup for faster development.\nSetting this to true removes the Preview Mode banner after logging out and logging back in.'}

+

{'Typically set to true in production. When true, Mattermost attempts to send email notifications. Developers may set this field to false to skip email setup for faster development.\nSetting this to true removes the Preview Mode banner (requires logging out and logging back in after setting is changed).'}

-- cgit v1.2.3-1-g7c22 From fff7143a3175458d5a938cc91973ba475dc45456 Mon Sep 17 00:00:00 2001 From: Reed Garmsen Date: Mon, 11 Jan 2016 09:42:11 -0800 Subject: Changed statistics to show usernames with an email tooltip --- .../components/admin_console/team_analytics.jsx | 44 ++++++++++++++++++++-- 1 file changed, 40 insertions(+), 4 deletions(-) (limited to 'web/react/components/admin_console') diff --git a/web/react/components/admin_console/team_analytics.jsx b/web/react/components/admin_console/team_analytics.jsx index e28699d3c..fe7230946 100644 --- a/web/react/components/admin_console/team_analytics.jsx +++ b/web/react/components/admin_console/team_analytics.jsx @@ -3,8 +3,12 @@ import * as Client from '../../utils/client.jsx'; import * as Utils from '../../utils/utils.jsx'; +import Constants from '../../utils/constants.jsx'; import LineChart from './line_chart.jsx'; +var Tooltip = ReactBootstrap.Tooltip; +var OverlayTrigger = ReactBootstrap.OverlayTrigger; + export default class TeamAnalytics extends React.Component { constructor(props) { super(props); @@ -314,9 +318,25 @@ export default class TeamAnalytics extends React.Component { { this.state.recent_active_users.map((user) => { + const tooltip = ( + + {user.email} + + ); + return ( - - {user.email} + + + + + + {Utils.displayDateTime(user.last_activity_at)} ); @@ -347,9 +367,25 @@ export default class TeamAnalytics extends React.Component { { this.state.newly_created_users.map((user) => { + const tooltip = ( + + {user.email} + + ); + return ( - - {user.email} + + + + + + {Utils.displayDateTime(user.create_at)} ); -- cgit v1.2.3-1-g7c22 From 22f714bd029a25230b4e1caeb12e7fce512834d2 Mon Sep 17 00:00:00 2001 From: it33 Date: Mon, 11 Jan 2016 11:22:13 -0800 Subject: Adding push-test.mattermost.com --- web/react/components/admin_console/email_settings.jsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'web/react/components/admin_console') diff --git a/web/react/components/admin_console/email_settings.jsx b/web/react/components/admin_console/email_settings.jsx index 91d73dccd..193fd4147 100644 --- a/web/react/components/admin_console/email_settings.jsx +++ b/web/react/components/admin_console/email_settings.jsx @@ -581,12 +581,12 @@ export default class EmailSettings extends React.Component { className='form-control' id='PushNotificationServer' ref='PushNotificationServer' - placeholder='E.g.: "https://push.mattermost.com"' + placeholder='E.g.: "https://push-test.mattermost.com"' defaultValue={this.props.config.EmailSettings.PushNotificationServer} onChange={this.handleChange} disabled={!this.state.sendPushNotifications} /> -

{'Location of Mattermost push notification service you can set up behind your firewall using https://github.com/mattermost/push-proxy. For testing you can use https://push.mattermost.com, which connects to the sample Mattermost iOS app in the public Apple AppStore. Please do not use test service for production deployments.'}

+

{'Location of Mattermost push notification service you can set up behind your firewall using https://github.com/mattermost/push-proxy. For testing you can use https://push-test.mattermost.com, which connects to the sample Mattermost iOS app in the public Apple AppStore. Please do not use test service for production deployments.'}

-- cgit v1.2.3-1-g7c22 From 9110dd54a15f3d0fcf6f60936e01d816b667b93c Mon Sep 17 00:00:00 2001 From: JoramWilander Date: Mon, 4 Jan 2016 12:44:22 -0500 Subject: Added license validation and settings --- .../components/admin_console/admin_controller.jsx | 3 + .../components/admin_console/admin_sidebar.jsx | 32 +++ .../components/admin_console/ldap_settings.jsx | 32 ++- .../components/admin_console/license_settings.jsx | 232 +++++++++++++++++++++ 4 files changed, 297 insertions(+), 2 deletions(-) create mode 100644 web/react/components/admin_console/license_settings.jsx (limited to 'web/react/components/admin_console') diff --git a/web/react/components/admin_console/admin_controller.jsx b/web/react/components/admin_console/admin_controller.jsx index 32b2e9bb7..0f85c238d 100644 --- a/web/react/components/admin_console/admin_controller.jsx +++ b/web/react/components/admin_console/admin_controller.jsx @@ -22,6 +22,7 @@ import LegalAndSupportSettingsTab from './legal_and_support_settings.jsx'; import TeamUsersTab from './team_users.jsx'; import TeamAnalyticsTab from './team_analytics.jsx'; import LdapSettingsTab from './ldap_settings.jsx'; +import LicenseSettingsTab from './license_settings.jsx'; export default class AdminController extends React.Component { constructor(props) { @@ -154,6 +155,8 @@ export default class AdminController extends React.Component { tab = ; } else if (this.state.selected === 'ldap_settings') { tab = ; + } else if (this.state.selected === 'license') { + tab = ; } else if (this.state.selected === 'team_users') { if (this.state.teams) { tab = ; diff --git a/web/react/components/admin_console/admin_sidebar.jsx b/web/react/components/admin_console/admin_sidebar.jsx index 1279f4d22..5a5eaa055 100644 --- a/web/react/components/admin_console/admin_sidebar.jsx +++ b/web/react/components/admin_console/admin_sidebar.jsx @@ -155,6 +155,36 @@ export default class AdminSidebar extends React.Component { } } + let ldapSettings; + let licenseSettings; + if (global.window.mm_config.BuildEnterpriseReady === 'true') { + if (global.window.mm_license.IsLicensed === 'true') { + ldapSettings = ( +
  • + + {'LDAP Settings'} + +
  • + ); + } + + licenseSettings = ( +
  • + + {'Edition and License'} + +
  • + ); + } + return (
    @@ -252,6 +282,7 @@ export default class AdminSidebar extends React.Component { {'GitLab Settings'} + {ldapSettings}
    • + {licenseSettings}
    • + const licenseEnabled = global.window.mm_license.IsLicensed === 'true' && global.window.mm_license.LDAP === 'true'; + + let bannerContent; + if (licenseEnabled) { + bannerContent = (

      {'Note:'}

      {'If a user attribute changes on the LDAP server it will be updated the next time the user enters their credentials to log in to Mattermost. This includes if a user is made inactive or removed from an LDAP server. Synchronization with LDAP servers is planned in a future release.'}

      + ); + } else { + bannerContent = ( +
      + ); + } + + return ( +
      + {bannerContent}

      {'LDAP Settings'}

      {'true'} diff --git a/web/react/components/admin_console/license_settings.jsx b/web/react/components/admin_console/license_settings.jsx new file mode 100644 index 000000000..d49056601 --- /dev/null +++ b/web/react/components/admin_console/license_settings.jsx @@ -0,0 +1,232 @@ +// Copyright (c) 2015 Mattermost, Inc. All Rights Reserved. +// See License.txt for license information. + +import * as Utils from '../../utils/utils.jsx'; +import * as Client from '../../utils/client.jsx'; + +export default class LicenseSettings extends React.Component { + constructor(props) { + super(props); + + this.handleChange = this.handleChange.bind(this); + this.handleSubmit = this.handleSubmit.bind(this); + this.handleRemove = this.handleRemove.bind(this); + + this.state = { + fileSelected: false, + serverError: null + }; + } + + handleChange() { + const element = $(ReactDOM.findDOMNode(this.refs.fileInput)); + if (element.prop('files').length > 0) { + this.setState({fileSelected: true}); + } + } + + handleSubmit(e) { + e.preventDefault(); + + const element = $(ReactDOM.findDOMNode(this.refs.fileInput)); + if (element.prop('files').length === 0) { + return; + } + const file = element.prop('files')[0]; + + $('#upload-button').button('loading'); + + const formData = new FormData(); + formData.append('license', file, file.name); + + Client.uploadLicenseFile(formData, + () => { + Utils.clearFileInput(element[0]); + $('#upload-button').button('reset'); + window.location.reload(true); + }, + (serverError) => { + this.setState({serverError}); + } + ); + } + + handleRemove(e) { + e.preventDefault(); + + $('#remove-button').button('loading'); + + Client.removeLicenseFile( + () => { + $('#remove-button').button('reset'); + window.location.reload(true); + }, + (serverError) => { + $('#remove-button').button('reset'); + this.setState({serverError}); + } + ); + } + + render() { + var serverError = ''; + if (this.state.serverError) { + serverError =
      ; + } + + var btnClass = 'btn'; + if (this.state.fileSelected) { + btnClass = 'btn btn-primary'; + } + + let edition; + let licenseType; + let licenseKey; + + if (global.window.mm_license.IsLicensed === 'true') { + edition = 'Mattermost Enterprise Edition. Designed for enterprise-scale communication.'; + licenseType = ( +
      +

      + {'This compiled release of Mattermost platform is provided under a '} + + {'commercial license'} + + {' from Mattermost, Inc. based on your subscription level and is subject to the '} + + {'Terms of Service.'} + +

      +

      {'Your subscription details are as follows:'}

      + {'Name: ' + global.window.mm_license.Name} +
      + {'Company or organization name: ' + global.window.mm_license.Company} +
      + {'Number of users: ' + global.window.mm_license.Users} +
      + {`License issued: ${Utils.displayDate(parseInt(global.window.mm_license.IssuedAt, 10))} ${Utils.displayTime(parseInt(global.window.mm_license.IssuedAt, 10), true)}`} +
      + {'Start date of license: ' + Utils.displayDate(parseInt(global.window.mm_license.StartsAt, 10))} +
      + {'Expiry date of license: ' + Utils.displayDate(parseInt(global.window.mm_license.ExpiresAt, 10))} +
      + {'LDAP: ' + global.window.mm_license.LDAP} +
      +
      + ); + + licenseKey = ( +
      + +
      +
      +

      + {'If you’re migrating servers you may need to remove your license key from this server in order to install it on a new server. To start, '} + + {'disable all Enterprise Edition features on this server'} + + {'. This will enable the ability to remove the license key and downgrade this server from Enterprise Edition to Team Edition.'} +

      +
      + ); + } else { + edition = 'Mattermost Team Edition. Designed for teams from 5 to 50 users.'; + + licenseType = ( + +

      {'This compiled release of Mattermost platform is offered under an MIT license.'}

      +

      {'See MIT-COMPILED-LICENSE.txt in your root install directory for details. See NOTICES.txt for information about open source software used in this system.'}

      +
      + ); + + licenseKey = ( +
      + + {serverError} + +
      +
      +

      + {'Upload a license key for Mattermost Enterprise Edition to upgrade this server. '} + + {'Visit us online'} + + {' to learn more about the benefits of Enterprise Edition or to purchase a key.'} +

      +
      + ); + } + + return ( +
      +

      {'Edition and License'}

      + +
      + +
      + {edition} +
      +
      +
      + +
      + {licenseType} +
      +
      +
      + + {licenseKey} +
      + +
      + ); + } +} -- cgit v1.2.3-1-g7c22 From 22c522178ce5a4b9e9533d91dd77518a2899f2b0 Mon Sep 17 00:00:00 2001 From: JoramWilander Date: Wed, 13 Jan 2016 12:56:35 -0500 Subject: Fix error message --- web/react/components/admin_console/license_settings.jsx | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'web/react/components/admin_console') diff --git a/web/react/components/admin_console/license_settings.jsx b/web/react/components/admin_console/license_settings.jsx index d49056601..ba953f3bd 100644 --- a/web/react/components/admin_console/license_settings.jsx +++ b/web/react/components/admin_console/license_settings.jsx @@ -43,10 +43,13 @@ export default class LicenseSettings extends React.Component { () => { Utils.clearFileInput(element[0]); $('#upload-button').button('reset'); + this.setState({serverError: null}); window.location.reload(true); }, - (serverError) => { - this.setState({serverError}); + (error) => { + Utils.clearFileInput(element[0]); + $('#upload-button').button('reset'); + this.setState({serverError: error.message}); } ); } @@ -59,11 +62,12 @@ export default class LicenseSettings extends React.Component { Client.removeLicenseFile( () => { $('#remove-button').button('reset'); + this.setState({serverError: null}); window.location.reload(true); }, - (serverError) => { + (error) => { $('#remove-button').button('reset'); - this.setState({serverError}); + this.setState({serverError: error.message}); } ); } @@ -164,7 +168,6 @@ export default class LicenseSettings extends React.Component { accept='.mattermost-license' onChange={this.handleChange} /> - {serverError}