summaryrefslogtreecommitdiffstats
path: root/webapp/components/analytics
diff options
context:
space:
mode:
authorJoram Wilander <jwawilander@gmail.com>2016-05-30 09:59:53 -0400
committerHarrison Healey <harrisonmhealey@gmail.com>2016-05-30 09:59:53 -0400
commit0dfac9875ef6f5f20318a3ef542b11592da8480e (patch)
treecf093fb2974535a0a6ab929af5e9d23032fafb01 /webapp/components/analytics
parente4cb9141a456bbedc4f0e173bc1d912f33846043 (diff)
downloadchat-0dfac9875ef6f5f20318a3ef542b11592da8480e.tar.gz
chat-0dfac9875ef6f5f20318a3ef542b11592da8480e.tar.bz2
chat-0dfac9875ef6f5f20318a3ef542b11592da8480e.zip
Add license expiry messages (#3153)
Diffstat (limited to 'webapp/components/analytics')
-rw-r--r--webapp/components/analytics/system_analytics.jsx36
1 files changed, 35 insertions, 1 deletions
diff --git a/webapp/components/analytics/system_analytics.jsx b/webapp/components/analytics/system_analytics.jsx
index 8decf523d..5bd8b1d28 100644
--- a/webapp/components/analytics/system_analytics.jsx
+++ b/webapp/components/analytics/system_analytics.jsx
@@ -1,6 +1,7 @@
// Copyright (c) 2016 Mattermost, Inc. All Rights Reserved.
// See License.txt for license information.
+import Banner from 'components/admin_console/banner.jsx';
import LineChart from './line_chart.jsx';
import DoughnutChart from './doughnut_chart.jsx';
import StatisticCount from './statistic_count.jsx';
@@ -8,11 +9,12 @@ import StatisticCount from './statistic_count.jsx';
import AnalyticsStore from 'stores/analytics_store.jsx';
import * as Utils from 'utils/utils.jsx';
+import {isLicenseExpired, isLicenseExpiring, displayExpiryDate} from 'utils/license_utils.jsx';
import * as AsyncClient from 'utils/async_client.jsx';
import Constants from 'utils/constants.jsx';
const StatTypes = Constants.StatTypes;
-import {injectIntl, intlShape, defineMessages, FormattedMessage} from 'react-intl';
+import {injectIntl, intlShape, defineMessages, FormattedMessage, FormattedHTMLMessage} from 'react-intl';
const holders = defineMessages({
analyticsPublicChannels: {
@@ -81,6 +83,7 @@ class SystemAnalytics extends React.Component {
let advancedCounts;
let advancedGraphs;
+ let banner;
if (global.window.mm_license.IsLicensed === 'true') {
advancedCounts = (
<div className='row'>
@@ -156,6 +159,36 @@ class SystemAnalytics extends React.Component {
/>
</div>
);
+
+ if (isLicenseExpired()) {
+ banner = (
+ <Banner
+ description={
+ <FormattedHTMLMessage
+ id='analytics.system.expiredBanner'
+ defaultMessage='The Enterprise license expired on {date}. You have 15 days from this date to renew the license, please contact <a href="mailto:commercial@mattermost.com">commercial@mattermost.com</a>.'
+ values={{
+ date: displayExpiryDate()
+ }}
+ />
+ }
+ />
+ );
+ } else if (isLicenseExpiring()) {
+ banner = (
+ <Banner
+ description={
+ <FormattedHTMLMessage
+ id='analytics.system.expiringBanner'
+ defaultMessage='The Enterprise license is expiring on {date}. To renew your license, please contact <a href="mailto:commercial@mattermost.com">commercial@mattermost.com</a>.'
+ values={{
+ date: displayExpiryDate()
+ }}
+ />
+ }
+ />
+ );
+ }
}
const postCountsDay = formatPostsPerDayData(stats[StatTypes.POST_PER_DAY]);
@@ -169,6 +202,7 @@ class SystemAnalytics extends React.Component {
defaultMessage='System Statistics'
/>
</h3>
+ {banner}
<div className='row'>
<StatisticCount
title={