Max Red - beautified code a little bit more replacing another for for another map [skip ci]

This commit is contained in:
ivan 2017-01-17 15:50:33 -03:00
parent fda6e798a0
commit f1c82dc384
4 changed files with 15 additions and 14 deletions

View File

@ -66,14 +66,15 @@ class StatsChart extends React.Component {
let months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];
let labels = [];
for (let i = 0; i < this.props.period; i++) {
if (!this.props.strokes.length){
labels.push('');
continue;
}
let firstList = this.props.strokes[0];
let idx = firstList.values[i].date.slice(4, 6) - 1;
labels.push( firstList.values[i].date.slice(6, 8) + ' ' + months[idx]);
if (!this.props.strokes.length) {
labels = Array.from('x'.repeat(this.props.period));
}
else {
labels = this.props.strokes[0].values.map((item) => {
let idx = item.date.slice(4, 6) - 1;
return item.date.slice(6, 8) + ' ' + months[idx];
});
}
return labels;

View File

@ -99,7 +99,7 @@ class AdminPanelMenu extends React.Component {
level: 1,
items: this.getItemsByFilteredByLevel([
{
name: i18n('TICKET_STATS'),
name: i18n('STATISTICS'),
path: '/admin/panel/stats',
level: 1
},

View File

@ -9,7 +9,7 @@ class AdminPanelStats extends React.Component {
render() {
return (
<div class="admin-panel-stats">
<Header title={i18n('TICKET_ACTIVITY')} description={i18n('TICKET_ACTIVITY_DESCRIPTION')}/>
<Header title={i18n('STATISTICS')} description={i18n('STATISTICS_DESCRIPTION')}/>
<Stats type="general"/>
</div>
);

View File

@ -36,7 +36,7 @@ export default {
'DASHBOARD': 'Dashboard',
'USERS': 'Users',
'SETTINGS': 'Settings',
'TICKET_STATS': 'Ticket Stats',
'STATISTICS': 'Statistics',
'LAST_ACTIVITY': 'Last Activity',
'MY_TICKETS': 'My Tickets',
'NEW_TICKETS': 'New Tickets',
@ -152,7 +152,7 @@ export default {
'ALL_NOTIFICATIONS': 'All notifications',
'VERIFY_SUCCESS': 'User verified',
'VERIFY_FAILED': 'Could not verify',
'TICKET_ACTIVITY': 'Ticket Activity',
'STATISTICS': 'Statistics',
'ACTIVITY': 'Activity',
@ -211,7 +211,7 @@ export default {
'ADD_ARTICLE_DESCRIPTION': 'Here you can add an article that will be available for every user. It will be added inside the category {category}.',
'LIST_ARTICLES_DESCRIPTION': 'This is a list of articles that includes information about our services.',
'ADD_TOPIC_DESCRIPTION': 'Here you can add a topic that works as a category for articles.',
'DELETE_ARTICLE_DESCRIPTION': 'You\'re going to delete this article for ever.',
'DELETE_ARTICLE_DESCRIPTION': 'You\'re going to delete this article forever.',
'STAFF_MEMBERS_DESCRIPTION': 'Here you can see who are your staff members.',
'ADD_STAFF_DESCRIPTION': 'Here you can add staff members to your teams.',
'EDIT_STAFF_DESCRIPTION': 'Here you can edit information about a staff member.',
@ -222,7 +222,7 @@ export default {
'SYSTEM_PREFERENCES_DESCRIPTION': 'Here you can edit the preferences of the system.',
'VERIFY_SUCCESS_DESCRIPTION': 'You user has been verified correctly. You can log in now.',
'VERIFY_FAILED_DESCRIPTION': 'The verification could not be done.',
'TICKET_ACTIVITY_DESCRIPTION': 'Here you can view ',
'STATISTICS_DESCRIPTION': 'Here you can view statistics related to tickets and signups.',
//ERRORS
'EMAIL_OR_PASSWORD': 'Email or password invalid',