diff --git a/webapp/components/analytics/system_analytics.jsx b/webapp/components/analytics/system_analytics.jsx
index a50a338124..244e1ff072 100644
--- a/webapp/components/analytics/system_analytics.jsx
+++ b/webapp/components/analytics/system_analytics.jsx
@@ -81,10 +81,23 @@ class SystemAnalytics extends React.Component {
render() {
const stats = this.state.stats;
+ let banner;
+ if (stats[StatTypes.TOTAL_POSTS] === -1) {
+ banner = (
+
+ }
+ />
+ );
+ }
+
let advancedCounts;
let advancedStats;
let advancedGraphs;
- let banner;
if (global.window.mm_license.IsLicensed === 'true') {
advancedCounts = (
@@ -169,6 +182,23 @@ class SystemAnalytics extends React.Component {
const channelTypeData = formatChannelDoughtnutData(stats[StatTypes.TOTAL_PUBLIC_CHANNELS], stats[StatTypes.TOTAL_PRIVATE_GROUPS], this.props.intl);
const postTypeData = formatPostDoughtnutData(stats[StatTypes.TOTAL_FILE_POSTS], stats[StatTypes.TOTAL_HASHTAG_POSTS], stats[StatTypes.TOTAL_POSTS], this.props.intl);
+ let postTypeGraph;
+ if (stats[StatTypes.TOTAL_POSTS] !== -1) {
+ postTypeGraph = (
+
+ }
+ data={postTypeData}
+ width='300'
+ height='225'
+ />
+ );
+ }
+
advancedGraphs = (
-
- }
- data={postTypeData}
- width='300'
- height='225'
- />
+ {postTypeGraph}
);
@@ -230,6 +250,66 @@ class SystemAnalytics extends React.Component {
const postCountsDay = formatPostsPerDayData(stats[StatTypes.POST_PER_DAY]);
const userCountsWithPostsDay = formatUsersWithPostsPerDayData(stats[StatTypes.USERS_WITH_POSTS_PER_DAY]);
+ let totalPostsCount;
+ let postTotalGraph;
+ let activeUserGraph;
+ if (stats[StatTypes.TOTAL_POSTS] !== -1) {
+ totalPostsCount = (
+
+ }
+ icon='fa-comment'
+ count={stats[StatTypes.TOTAL_POSTS]}
+ />
+ );
+
+ postTotalGraph = (
+
+
+ }
+ data={postCountsDay}
+ options={{
+ legend: {
+ display: false
+ }
+ }}
+ width='740'
+ height='225'
+ />
+
+ );
+
+ activeUserGraph = (
+
+
+ }
+ data={userCountsWithPostsDay}
+ options={{
+ legend: {
+ display: false
+ }
+ }}
+ width='740'
+ height='225'
+ />
+
+ );
+ }
+
return (
@@ -260,16 +340,7 @@ class SystemAnalytics extends React.Component {
icon='fa-users'
count={stats[StatTypes.TOTAL_TEAMS]}
/>
-
- }
- icon='fa-comment'
- count={stats[StatTypes.TOTAL_POSTS]}
- />
+ {totalPostsCount}
-
- }
- data={postCountsDay}
- options={{
- legend: {
- display: false
- }
- }}
- width='740'
- height='225'
- />
-
-
-
- }
- data={userCountsWithPostsDay}
- options={{
- legend: {
- display: false
- }
- }}
- width='740'
- height='225'
- />
-
+ {postTotalGraph}
+ {activeUserGraph}
);
}
diff --git a/webapp/components/analytics/team_analytics.jsx b/webapp/components/analytics/team_analytics.jsx
index 574a388d0a..66eb7e2db8 100644
--- a/webapp/components/analytics/team_analytics.jsx
+++ b/webapp/components/analytics/team_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 StatisticCount from './statistic_count.jsx';
import TableChart from './table_chart.jsx';
@@ -14,7 +15,7 @@ import Constants from 'utils/constants.jsx';
const StatTypes = Constants.StatTypes;
import {formatPostsPerDayData, formatUsersWithPostsPerDayData} from './system_analytics.jsx';
-import {FormattedMessage, FormattedDate} from 'react-intl';
+import {FormattedMessage, FormattedDate, FormattedHTMLMessage} from 'react-intl';
import React from 'react';
@@ -95,6 +96,79 @@ export default class TeamAnalytics extends React.Component {
const stats = this.state.stats;
const postCountsDay = formatPostsPerDayData(stats[StatTypes.POST_PER_DAY]);
const userCountsWithPostsDay = formatUsersWithPostsPerDayData(stats[StatTypes.USERS_WITH_POSTS_PER_DAY]);
+
+ let banner;
+ let totalPostsCount;
+ let postTotalGraph;
+ let userActiveGraph;
+ if (stats[StatTypes.TOTAL_POSTS] === -1) {
+ banner = (
+