From 84810ba57dc71310187b2c1377fe1f7806e0895f Mon Sep 17 00:00:00 2001 From: ivan Date: Wed, 21 Dec 2016 18:55:12 -0300 Subject: [PATCH] Ivan - Improve TicketInfo style [skip ci] --- client/src/app-components/ticket-info.js | 27 ++++++++++++++++------- client/src/data/fixtures/user-fixtures.js | 17 ++------------ client/src/data/languages/en.js | 2 ++ 3 files changed, 23 insertions(+), 23 deletions(-) diff --git a/client/src/app-components/ticket-info.js b/client/src/app-components/ticket-info.js index 788bd423..0feaa64b 100644 --- a/client/src/app-components/ticket-info.js +++ b/client/src/app-components/ticket-info.js @@ -1,4 +1,6 @@ import React from 'react'; +import _ from 'lodash'; + import i18n from 'lib-app/i18n'; class TicketInfo extends React.Component { @@ -16,12 +18,12 @@ class TicketInfo extends React.Component { {this.props.ticket.content}
- Author: {this.props.ticket.author.name} + {i18n('AUTHOR')}: {this.props.ticket.author.name}
- Status: + {i18n('STATUS')}: {(this.props.ticket.closed) ? 'closed' : 'open'} @@ -29,7 +31,7 @@ class TicketInfo extends React.Component {
- Priority: + {i18n('PRIORITY')}: {this.props.ticket.priority} @@ -37,24 +39,25 @@ class TicketInfo extends React.Component {
- Owned: + {i18n('OWNED')}: - - none + + {(this.props.ticket.owner) ? i18n('YES') : i18n('NO')}
- Comments: + {i18n('COMMENTS')}: - 21 + {_.filter(this.props.ticket.events, event => event.type === 'COMMENT').length}
); } + getStatusClass() { if(this.props.ticket.closed) { return 'ticket-info__properties__badge-red'; @@ -63,6 +66,14 @@ class TicketInfo extends React.Component { } } + getOwnedClass() { + if(this.props.ticket.owner) { + return 'ticket-info__properties__badge-green'; + } else { + return 'ticket-info__properties__badge-red'; + } + } + getPriorityClass() { let priorityClasses = { 'low': 'ticket-info__properties__badge-green', diff --git a/client/src/data/fixtures/user-fixtures.js b/client/src/data/fixtures/user-fixtures.js index d611956b..c23622e3 100644 --- a/client/src/data/fixtures/user-fixtures.js +++ b/client/src/data/fixtures/user-fixtures.js @@ -368,7 +368,7 @@ module.exports = [ { ticketNumber: '445441', title: 'Problem with installation', - content: 'I had a problem with the installation of the php server', + content: 'In varius, tellus ut luctus vestibulum, orci erat commodo ligula, sit amet bibendum arcu libero sed magna. Suspendisse in ligula vitae ante placerat varius id in eros. Etiam commodo viverra nisi in ornare. Donec ullamcorper felis sapien, eu laoreet dolor tincidunt nec. Aliquam erat volutpat. Proin semper viverra purus eget facilisis. Proin fermentum et odio in elementum. Maecenas lacinia, massa consectetur gravida lacinia, nisl lectus tincidunt diam, ut viverra ipsum ex sit amet diam. Mauris ac massa turpis. Fusce ultrices venenatis vestibulum. In et nulla purus. Nullam porta vestibulum leo in dignissim. Duis id ullamcorper odio. Ut purus nulla, consequat lobortis volutpat quis, consequat et libero. Maecenas sit amet libero laoreet, dictum sapien at, hendrerit sapien.', department: { id: 2, name: 'Technical Issues' @@ -502,9 +502,7 @@ module.exports = [ name: 'Haskell Curry', email: 'haskell@lambda.com' }, - owner: { - name: 'Steve Jobs' - }, + owner: null, events: [ { type: 'ASSIGN', @@ -516,17 +514,6 @@ module.exports = [ staff: true } }, - { - type: 'COMMENT', - date: '201504090912', - content: 'Do you have apache installed? It generally happens if you dont have apache.', - author: { - name: 'Emilia Clarke', - email: 'jobs@steve.com', - profilePic: 'http://www.opensupports.com/profilepic.jpg', - staff: true - } - }, { type: 'UN_ASSIGN', date: '201504100924', diff --git a/client/src/data/languages/en.js b/client/src/data/languages/en.js index 07d8f8e5..79b287bd 100644 --- a/client/src/data/languages/en.js +++ b/client/src/data/languages/en.js @@ -30,6 +30,7 @@ export default { 'STAFF': 'Staff', 'CUSTOMER': 'Customer', 'YES': 'Yes', + 'NO': 'No', 'CANCEL': 'Cancel', 'MY_ACCOUNT': 'My Account', 'DASHBOARD': 'Dashboard', @@ -114,6 +115,7 @@ export default { 'ADD_DEPARTMENT': 'Add department', 'UPDATE_DEPARTMENT': 'Update department', 'TRANSFER_TICKETS_TO': 'Transfer tickets to', + 'COMMENTS': 'Comments', //VIEW DESCRIPTIONS 'CREATE_TICKET_DESCRIPTION': 'This is a form for creating tickets. Fill the form and send us your issues/doubts/suggestions. Our support system will answer it as soon as possible.',