diff options
author | Harrison Healey <harrisonmhealey@gmail.com> | 2016-01-28 10:34:58 -0500 |
---|---|---|
committer | Harrison Healey <harrisonmhealey@gmail.com> | 2016-01-28 10:34:58 -0500 |
commit | 91906c9c05fb9ec60863d5058127e4c259fd43cb (patch) | |
tree | eb4f463a50eafa4eecd89d2fcf4bb3f702ebdfd2 /web/react/components/admin_console/system_analytics.jsx | |
parent | f5364202b745ea4cac1dee6835f0340e6b71ebe4 (diff) | |
parent | c8ca70870f1e202eb5784839520199fdf0beaeec (diff) | |
download | chat-91906c9c05fb9ec60863d5058127e4c259fd43cb.tar.gz chat-91906c9c05fb9ec60863d5058127e4c259fd43cb.tar.bz2 chat-91906c9c05fb9ec60863d5058127e4c259fd43cb.zip |
Merge pull request #2002 from ZBoxApp/PLT-7-react
PLT-7: Refactoring frontend (chunk 2)
Diffstat (limited to 'web/react/components/admin_console/system_analytics.jsx')
-rw-r--r-- | web/react/components/admin_console/system_analytics.jsx | 29 |
1 files changed, 25 insertions, 4 deletions
diff --git a/web/react/components/admin_console/system_analytics.jsx b/web/react/components/admin_console/system_analytics.jsx index f54813a94..2dd833fb2 100644 --- a/web/react/components/admin_console/system_analytics.jsx +++ b/web/react/components/admin_console/system_analytics.jsx @@ -4,7 +4,24 @@ import Analytics from './analytics.jsx'; import * as Client from '../../utils/client.jsx'; -export default class SystemAnalytics extends React.Component { +import {injectIntl, intlShape, defineMessages} from 'mm-intl'; + +const labels = defineMessages({ + totalPosts: { + id: 'admin.system_analytics.totalPosts', + defaultMessage: 'Total Posts' + }, + activeUsers: { + id: 'admin.system_analytics.activeUsers', + defaultMessage: 'Active Users With Posts' + }, + title: { + id: 'admin.system_analytics.title', + defaultMessage: 'the System' + } +}); + +class SystemAnalytics extends React.Component { constructor(props) { super(props); @@ -29,6 +46,7 @@ export default class SystemAnalytics extends React.Component { } getData() { // should be moved to an action creator eventually + const {formatMessage} = this.props.intl; Client.getSystemAnalytics( 'standard', (data) => { @@ -63,7 +81,7 @@ export default class SystemAnalytics extends React.Component { var chartData = { labels: [], datasets: [{ - label: 'Total Posts', + label: formatMessage(labels.totalPosts), fillColor: 'rgba(151,187,205,0.2)', strokeColor: 'rgba(151,187,205,1)', pointColor: 'rgba(151,187,205,1)', @@ -97,7 +115,7 @@ export default class SystemAnalytics extends React.Component { var chartData = { labels: [], datasets: [{ - label: 'Active Users With Posts', + label: formatMessage(labels.activeUsers), fillColor: 'rgba(151,187,205,0.2)', strokeColor: 'rgba(151,187,205,1)', pointColor: 'rgba(151,187,205,1)', @@ -142,7 +160,7 @@ export default class SystemAnalytics extends React.Component { return ( <div> <Analytics - title={'the System'} + title={this.props.intl.formatMessage(labels.title)} channelOpenCount={this.state.channel_open_count} channelPrivateCount={this.state.channel_private_count} postCount={this.state.post_count} @@ -157,5 +175,8 @@ export default class SystemAnalytics extends React.Component { } SystemAnalytics.propTypes = { + intl: intlShape.isRequired, team: React.PropTypes.object }; + +export default injectIntl(SystemAnalytics);
\ No newline at end of file |