diff --git a/client/src/app-components/activity-row.js b/client/src/app-components/activity-row.js new file mode 100644 index 00000000..9529cd99 --- /dev/null +++ b/client/src/app-components/activity-row.js @@ -0,0 +1,69 @@ +import React from 'react'; +import {Link} from 'react-router'; + +import Icon from 'core-components/icon'; + +import i18n from 'lib-app/i18n'; + +class ActivityRow extends React.Component { + + static propTypes = { + type: React.PropTypes.oneOf([ + 'COMMENT', + 'ASSIGN', + 'UN_ASSIGN', + 'CLOSE', + 'RE_OPEN', + 'DEPARTMENT_CHANGED', + 'PRIORITY_CHANGED' + ]), + ticketNumber: React.PropTypes.string, + author: React.PropTypes.shape({ + name: React.PropTypes.string, + staff: React.PropTypes.bool, + id: React.PropTypes.string + }) + }; + + render() { + return ( +
+ + + + {this.props.author.name} + + + {i18n('ACTIVITY_' + this.props.type)} + + + #{this.props.ticketNumber} + + + +
+ ); + } + + getNameLinkDestination() { + return (this.props.author.staff ? '/admin/panel/staff/view-staff/' : '/admin/panel/users/view-user/') + this.props.author.id; + } + + getIconProps() { + const iconName = { + 'COMMENT': 'comment-o', + 'ASSIGN': 'user', + 'UN_ASSIGN': 'user-times', + 'CLOSE': 'lock', + 'RE_OPEN': 'unlock-alt', + 'DEPARTMENT_CHANGED': 'exchange', + 'PRIORITY_CHANGED': 'exclamation' + }; + + return { + name: iconName[this.props.type] + } + } +} + +export default ActivityRow; \ No newline at end of file diff --git a/client/src/app-components/activity-row.scss b/client/src/app-components/activity-row.scss new file mode 100644 index 00000000..866d2aca --- /dev/null +++ b/client/src/app-components/activity-row.scss @@ -0,0 +1,26 @@ +@import "../scss/vars"; + +.activity-row { + text-align: left; + font-size: $font-size--sm; + + &__icon { + margin: 0 10px; + } + + &__name-link { + + } + + &__message { + + } + + &__ticket-link { + + } +} + +.separator { + margin: 15px; +} \ No newline at end of file diff --git a/client/src/app/admin/panel/dashboard/admin-panel-activity.js b/client/src/app/admin/panel/dashboard/admin-panel-activity.js index 9b0cc102..5b58fe2c 100644 --- a/client/src/app/admin/panel/dashboard/admin-panel-activity.js +++ b/client/src/app/admin/panel/dashboard/admin-panel-activity.js @@ -1,14 +1,59 @@ import React from 'react'; +import Header from 'core-components/header'; + +import i18n from 'lib-app/i18n'; +import ActivityRow from 'app-components/activity-row'; + class AdminPanelActivity extends React.Component { render() { return (
- /admin/panel/activity +
+ + + +
); } + + getActivityRowProps() { + return { + "type": "COMMENT", + "ticketNumber": "683061", + "author": { + "name": "Tyrion Lannister", + "staff": false, + "id": "10" + } + } + } + + getActivityRowProps2() { + return { + "type": "RE_OPEN", + "ticketNumber": "683049", + "author": { + "name": "Emilia Clarke", + "staff": true, + "id": "1" + } + } + } + + getActivityRowProps3() { + return { + "type": "UN_ASSIGN", + "ticketNumber": "683049", + "author": { + "name": "Emilia Clarke", + "staff": true, + "id": "1" + } + } + } } export default AdminPanelActivity; \ No newline at end of file diff --git a/client/src/data/languages/en.js b/client/src/data/languages/en.js index 2fb72996..e5345eb0 100644 --- a/client/src/data/languages/en.js +++ b/client/src/data/languages/en.js @@ -119,6 +119,13 @@ export default { 'DELETE_STAFF_MEMBER': 'Delete staff member', 'MAINTENANCE_MODE': 'Maintenance mode', 'RECOVER_DEFAULT': 'Recover default', + 'ACTIVITY_COMMENT': ' commented ', + 'ACTIVITY_ASSIGN': ' assigned ', + 'ACTIVITY_UN_ASSIGN': ' unassigned ', + 'ACTIVITY_CLOSED': ' closed ', + 'ACTIVITY_RE_OPEN': ' reopened ', + 'ACTIVITY_DEPARTMENT_CHANGED': ' changed departments of ', + 'ACTIVITY_PRIORITY_CHANGED': ' changed priority of ', //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.',