);
}
+
+ getProps() {
+ return {
+ departments: this.props.departments,
+ tickets: this.props.tickets,
+ type: 'secondary',
+ loading: this.props.loading,
+ ticketPath: '/admin/panel/tickets/view-ticket/'
+ };
+ }
}
-export default AdminPanelMyTickets;
\ No newline at end of file
+export default connect((store) => {
+ return {
+ departments: store.session.userDepartments,
+ tickets: store.adminData.myTickets,
+ loading: !store.adminData.myTicketsLoaded
+ };
+})(AdminPanelMyTickets);
diff --git a/client/src/app/admin/panel/tickets/admin-panel-new-tickets.js b/client/src/app/admin/panel/tickets/admin-panel-new-tickets.js
index 42d250a8..819e9b56 100644
--- a/client/src/app/admin/panel/tickets/admin-panel-new-tickets.js
+++ b/client/src/app/admin/panel/tickets/admin-panel-new-tickets.js
@@ -1,14 +1,47 @@
import React from 'react';
+import {connect} from 'react-redux';
+
+import i18n from 'lib-app/i18n';
+
+import AdminDataAction from 'actions/admin-data-actions';
+import Header from 'core-components/header';
+import TicketList from 'app-components/ticket-list';
class AdminPanelNewTickets extends React.Component {
+ static defaultProps = {
+ departments: [],
+ tickets: []
+ };
+
+ componentDidMount() {
+ this.props.dispatch(AdminDataAction.retrieveNewTickets());
+ }
+
render() {
return (
-
- /admin/panel/tickets/new-tickets
+
+
+
);
}
+
+ getProps() {
+ return {
+ departments: this.props.departments,
+ tickets: this.props.tickets,
+ type: 'secondary',
+ loading: this.props.loading,
+ ticketPath: '/admin/panel/tickets/view-ticket/'
+ };
+ }
}
-export default AdminPanelNewTickets;
\ No newline at end of file
+export default connect((store) => {
+ return {
+ departments: store.session.userDepartments,
+ tickets: store.adminData.newTickets,
+ loading: !store.adminData.newTicketsLoaded
+ };
+})(AdminPanelNewTickets);
diff --git a/client/src/core-components/table.scss b/client/src/core-components/table.scss
index 62dd409c..54a73615 100644
--- a/client/src/core-components/table.scss
+++ b/client/src/core-components/table.scss
@@ -51,6 +51,8 @@
&__loading-wrapper {
min-height: 200px;
+ position: relative;
+ background-color: $grey;
}
&__loading {
diff --git a/client/src/core-components/tooltip.scss b/client/src/core-components/tooltip.scss
index 50bd126d..bbe42bdb 100644
--- a/client/src/core-components/tooltip.scss
+++ b/client/src/core-components/tooltip.scss
@@ -17,6 +17,7 @@
background-color: #F7F7F7;
color: black;
padding: 10px;
+ z-index: 1000;
}
&__pointer {
diff --git a/client/src/data/fixtures/staff-fixtures.js b/client/src/data/fixtures/staff-fixtures.js
index ea6afbcd..4d1686cd 100644
--- a/client/src/data/fixtures/staff-fixtures.js
+++ b/client/src/data/fixtures/staff-fixtures.js
@@ -13,11 +13,576 @@ module.exports = [
staff: true,
departments: [
{id: 1, name: 'Sales Support'},
- {id: 2, name: 'Technical Issues'},
- {id: 3, name: 'System and Administration'}
+ {id: 2, name: 'Technical Issues'}
]
}
};
}
+ },
+ {
+ path: '/staff/get-tickets',
+ time: 300,
+ response: function () {
+ return {
+ status: 'success',
+ data: [
+ {
+ ticketNumber: '445441',
+ title: 'Problem with installation',
+ content: 'I had a problem with the installation of the php server',
+ department: {
+ id: 2,
+ name: 'Technical Issues'
+ },
+ date: '20160416',
+ file: 'http://www.opensupports.com/some_file.zip',
+ language: 'en',
+ unread: true,
+ closed: false,
+ priority: 'low',
+ author: {
+ id: 12,
+ name: 'Haskell Curry',
+ email: 'haskell@lambda.com'
+ },
+ owner: {
+ id: 15,
+ name: 'Steve Jobs',
+ email: 'steve@jobs.com'
+ },
+ events: [
+ {
+ type: 'ASSIGN',
+ date: '20150409',
+ author: {
+ name: 'Emilia Clarke',
+ email: 'jobs@steve.com',
+ profilePic: 'http://i65.tinypic.com/9bep95.jpg',
+ staff: true
+ }
+ },
+ {
+ type: 'COMMENT',
+ date: '20150409',
+ content: 'Do you have apache installed? It generally happens if you dont have apache.',
+ author: {
+ name: 'Emilia Clarke',
+ email: 'jobs@steve.com',
+ profilePic: 'http://i65.tinypic.com/9bep95.jpg',
+ staff: true
+ }
+ },
+ {
+ type: 'UN_ASSIGN',
+ date: '20150410',
+ author: {
+ name: 'Emilia Clarke',
+ email: 'jobs@steve.com',
+ profilePic: 'http://i65.tinypic.com/9bep95.jpg',
+ staff: true
+ }
+ },
+ {
+ type: 'DEPARTMENT_CHANGED',
+ date: '20150411',
+ content: 'System support',
+ author: {
+ name: 'Emilia Clarke',
+ email: 'jobs@steve.com',
+ profilePic: 'http://i65.tinypic.com/9bep95.jpg',
+ staff: true
+ }
+ },
+ {
+ type: 'COMMENT',
+ date: '20150412',
+ content: 'I have already installed apache, but the problem persists',
+ author: {
+ name: 'Haskell Curry',
+ steve: 'haskell@lambda.com',
+ staff: false
+ }
+ },
+ {
+ type: 'PRIORITY_CHANGED',
+ date: '20150413',
+ content: 'MEDIUM',
+ author: {
+ name: 'Emilia Clarke',
+ email: 'jobs@steve.com',
+ profilePic: 'http://i65.tinypic.com/9bep95.jpg',
+ staff: true
+ }
+ },
+ {
+ type: 'COMMENT',
+ date: '20150511',
+ content: 'Thanks!, I solved it by myself',
+ author: {
+ name: 'Haskell Curry',
+ steve: 'haskell@lambda.com',
+ staff: false
+ }
+ },
+ {
+ type: 'CLOSE',
+ date: '20150513',
+ author: {
+ name: 'Emilia Clarke',
+ email: 'jobs@steve.com',
+ profilePic: 'http://i65.tinypic.com/9bep95.jpg',
+ staff: true
+ }
+ },
+ {
+ type: 'RE_OPEN',
+ date: '20151018',
+ author: {
+ name: 'Haskell Curry',
+ email: 'haskell@lambda.com',
+ staff: false
+ }
+ }
+ ]
+ },
+ {
+ ticketNumber: '878552',
+ title: 'Lorem ipsum door',
+ content: 'I had a problem with the installation of the php server',
+ department: {
+ id: 2,
+ name: 'Technical Issues'
+ },
+ date: '20160415',
+ file: 'http://www.opensupports.com/some_file.zip',
+ language: 'en',
+ unread: false,
+ closed: false,
+ priority: 'medium',
+ author: {
+ name: 'Haskell Curry',
+ email: 'haskell@lambda.com'
+ },
+ owner: {
+ name: 'Steve Jobs'
+ },
+ events: [
+ {
+ type: 'ASSIGN',
+ date: '20150409',
+ author: {
+ name: 'Emilia Clarke',
+ email: 'jobs@steve.com',
+ profilePic: 'http://i65.tinypic.com/9bep95.jpg',
+ staff: true
+ }
+ },
+ {
+ type: 'COMMENT',
+ date: '20150409',
+ content: 'Do you have apache installed? It generally happens if you dont have apache.',
+ author: {
+ name: 'Emilia Clarke',
+ email: 'jobs@steve.com',
+ profilePic: 'http://i65.tinypic.com/9bep95.jpg',
+ staff: true
+ }
+ },
+ {
+ type: 'UN_ASSIGN',
+ date: '20150410',
+ author: {
+ name: 'Emilia Clarke',
+ email: 'jobs@steve.com',
+ profilePic: 'http://i65.tinypic.com/9bep95.jpg',
+ staff: true
+ }
+ },
+ {
+ type: 'DEPARTMENT_CHANGED',
+ date: '20150411',
+ content: 'System support',
+ author: {
+ name: 'Emilia Clarke',
+ email: 'jobs@steve.com',
+ profilePic: 'http://i65.tinypic.com/9bep95.jpg',
+ staff: true
+ }
+ },
+ {
+ type: 'COMMENT',
+ date: '20150412',
+ content: 'I have already installed apache, but the problem persists',
+ author: {
+ name: 'Haskell Curry',
+ steve: 'haskell@lambda.com',
+ staff: false
+ }
+ },
+ {
+ type: 'PRIORITY_CHANGED',
+ date: '20150413',
+ content: 'MEDIUM',
+ author: {
+ name: 'Emilia Clarke',
+ email: 'jobs@steve.com',
+ profilePic: 'http://i65.tinypic.com/9bep95.jpg',
+ staff: true
+ }
+ },
+ {
+ type: 'COMMENT',
+ date: '20150511',
+ content: 'Thanks!, I soved it by myself',
+ author: {
+ name: 'Haskell Curry',
+ steve: 'haskell@lambda.com',
+ staff: false
+ }
+ },
+ {
+ type: 'CLOSE',
+ date: '20150513',
+ author: {
+ name: 'Emilia Clarke',
+ email: 'jobs@steve.com',
+ profilePic: 'http://i65.tinypic.com/9bep95.jpg',
+ staff: true
+ }
+ },
+ {
+ type: 'RE_OPEN',
+ date: '20151018',
+ author: {
+ name: 'Haskell Curry',
+ email: 'haskell@lambda.com',
+ staff: false
+ }
+ }
+ ]
+ },
+ {
+ ticketNumber: '118551',
+ title: 'Lorem ipsum door',
+ content: 'I had a problem with the installation of the php server',
+ department: {
+ id: 2,
+ name: 'Technical Issues'
+ },
+ date: '20150409',
+ file: 'http://www.opensupports.com/some_file.zip',
+ language: 'en',
+ unread: false,
+ closed: false,
+ priority: 'high',
+ author: {
+ name: 'Haskell Curry',
+ email: 'haskell@lambda.com'
+ },
+ owner: {
+ name: 'Steve Jobs'
+ },
+ events: [
+ {
+ type: 'ASSIGN',
+ date: '20150409',
+ author: {
+ name: 'Emilia Clarke',
+ email: 'jobs@steve.com',
+ profilePic: 'http://i65.tinypic.com/9bep95.jpg',
+ staff: true
+ }
+ },
+ {
+ type: 'COMMENT',
+ date: '20150409',
+ content: 'Do you have apache installed? It generally happens if you dont have apache.',
+ author: {
+ name: 'Emilia Clarke',
+ email: 'jobs@steve.com',
+ profilePic: 'http://i65.tinypic.com/9bep95.jpg',
+ staff: true
+ }
+ },
+ {
+ type: 'UN_ASSIGN',
+ date: '20150410',
+ author: {
+ name: 'Emilia Clarke',
+ email: 'jobs@steve.com',
+ profilePic: 'http://i65.tinypic.com/9bep95.jpg',
+ staff: true
+ }
+ },
+ {
+ type: 'DEPARTMENT_CHANGED',
+ date: '20150411',
+ content: 'System support',
+ author: {
+ name: 'Emilia Clarke',
+ email: 'jobs@steve.com',
+ profilePic: 'http://i65.tinypic.com/9bep95.jpg',
+ staff: true
+ }
+ },
+ {
+ type: 'COMMENT',
+ date: '20150412',
+ content: 'I have already installed apache, but the problem persists',
+ author: {
+ name: 'Haskell Curry',
+ steve: 'haskell@lambda.com',
+ staff: false
+ }
+ },
+ {
+ type: 'PRIORITY_CHANGED',
+ date: '20150413',
+ content: 'MEDIUM',
+ author: {
+ name: 'Emilia Clarke',
+ email: 'jobs@steve.com',
+ profilePic: 'http://i65.tinypic.com/9bep95.jpg',
+ staff: true
+ }
+ },
+ {
+ type: 'COMMENT',
+ date: '20150511',
+ content: 'Thanks!, I soved it by myself',
+ author: {
+ name: 'Haskell Curry',
+ steve: 'haskell@lambda.com',
+ staff: false
+ }
+ },
+ {
+ type: 'CLOSE',
+ date: '20150513',
+ author: {
+ name: 'Emilia Clarke',
+ email: 'jobs@steve.com',
+ profilePic: 'http://i65.tinypic.com/9bep95.jpg',
+ staff: true
+ }
+ },
+ {
+ type: 'RE_OPEN',
+ date: '20151018',
+ author: {
+ name: 'Haskell Curry',
+ email: 'haskell@lambda.com',
+ staff: false
+ }
+ }
+ ]
+ },
+ {
+ ticketNumber: '445441',
+ title: 'Inscription ACM ICPC',
+ content: 'I had a problem with the installation of the php server',
+ department: {
+ id: 1,
+ name: 'Sales Support'
+ },
+ date: '20160416',
+ file: 'http://www.opensupports.com/some_file.zip',
+ language: 'en',
+ unread: false,
+ closed: false,
+ priority: 'low',
+ author: {
+ id: 12,
+ name: 'Haskell Curry',
+ email: 'haskell@lambda.com'
+ },
+ owner: {
+ id: 15,
+ name: 'Steve Jobs',
+ email: 'steve@jobs.com'
+ },
+ events: []
+ }
+ ]
+ }
+ }
+ },
+ {
+ path: '/staff/get-new-tickets',
+ time: 300,
+ response: function () {
+ return {
+ status: 'success',
+ data: [
+ {
+ ticketNumber: '445441',
+ title: 'Inscription ACM ICPC',
+ content: 'I had a problem with the installation of the php server',
+ department: {
+ id: 1,
+ name: 'Sales Support'
+ },
+ date: '20160416',
+ file: 'http://www.opensupports.com/some_file.zip',
+ language: 'en',
+ unread: true,
+ closed: false,
+ priority: 'low',
+ author: {
+ id: 12,
+ name: 'Haskell Curry',
+ email: 'haskell@lambda.com'
+ },
+ owner: {
+ id: 15,
+ name: 'Steve Jobs',
+ email: 'steve@jobs.com'
+ },
+ events: []
+ },
+ {
+ ticketNumber: '445441',
+ title: 'Inscription ACM ICPC',
+ content: 'I had a problem with the installation of the php server',
+ department: {
+ id: 1,
+ name: 'Sales Support'
+ },
+ date: '20160416',
+ file: 'http://www.opensupports.com/some_file.zip',
+ language: 'en',
+ unread: true,
+ closed: false,
+ priority: 'low',
+ author: {
+ id: 12,
+ name: 'Haskell Curry',
+ email: 'haskell@lambda.com'
+ },
+ owner: {
+ id: 15,
+ name: 'Steve Jobs',
+ email: 'steve@jobs.com'
+ },
+ events: []
+ },
+ {
+ ticketNumber: '445441',
+ title: 'Code jam is awesome',
+ content: 'I had a problem with the installation of the php server',
+ department: {
+ id: 2,
+ name: 'Technical Issues'
+ },
+ date: '20160416',
+ file: 'http://www.opensupports.com/some_file.zip',
+ language: 'en',
+ unread: true,
+ closed: false,
+ priority: 'low',
+ author: {
+ id: 12,
+ name: 'Haskell Curry',
+ email: 'haskell@lambda.com'
+ },
+ owner: {
+ id: 15,
+ name: 'Steve Jobs',
+ email: 'steve@jobs.com'
+ },
+ events: []
+ }
+ ]
+ }
+ }
+ },
+ {
+ path: '/staff/get-all-tickets',
+ time: 300,
+ response: function () {
+ return {
+ status: 'success',
+ data: [
+ {
+ ticketNumber: '445441',
+ title: 'Inscription ACM ICPC',
+ content: 'I had a problem with the installation of the php server',
+ department: {
+ id: 1,
+ name: 'Sales Support'
+ },
+ date: '20160416',
+ file: 'http://www.opensupports.com/some_file.zip',
+ language: 'en',
+ unread: true,
+ closed: false,
+ priority: 'low',
+ author: {
+ id: 12,
+ name: 'Haskell Curry',
+ email: 'haskell@lambda.com'
+ },
+ owner: {
+ id: 15,
+ name: 'Steve Jobs',
+ email: 'steve@jobs.com'
+ },
+ events: []
+ },
+ {
+ ticketNumber: '445441',
+ title: 'Inscription ACM ICPC',
+ content: 'I had a problem with the installation of the php server',
+ department: {
+ id: 1,
+ name: 'Sales Support'
+ },
+ date: '20160416',
+ file: 'http://www.opensupports.com/some_file.zip',
+ language: 'en',
+ unread: true,
+ closed: false,
+ priority: 'low',
+ author: {
+ id: 12,
+ name: 'Haskell Curry',
+ email: 'haskell@lambda.com'
+ },
+ owner: {
+ id: 15,
+ name: 'Steve Jobs',
+ email: 'steve@jobs.com'
+ },
+ events: []
+ },
+ {
+ ticketNumber: '445441',
+ title: 'Code jam is awesome',
+ content: 'I had a problem with the installation of the php server',
+ department: {
+ id: 2,
+ name: 'Technical Issues'
+ },
+ date: '20160416',
+ file: 'http://www.opensupports.com/some_file.zip',
+ language: 'en',
+ unread: true,
+ closed: false,
+ priority: 'low',
+ author: {
+ id: 12,
+ name: 'Haskell Curry',
+ email: 'haskell@lambda.com'
+ },
+ owner: {
+ id: 15,
+ name: 'Steve Jobs',
+ email: 'steve@jobs.com'
+ },
+ events: []
+ }
+ ]
+ }
+ }
}
];
\ No newline at end of file
diff --git a/client/src/data/languages/en.js b/client/src/data/languages/en.js
index 556666fc..e964ceec 100644
--- a/client/src/data/languages/en.js
+++ b/client/src/data/languages/en.js
@@ -74,6 +74,7 @@ export default {
'SELECT_CUSTOM_RESPONSE': 'Select a custom response...',
'WARNING': 'Warning',
'INFO': 'Information',
+ 'ALL_DEPARTMENTS': 'All Departments',
//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.',
@@ -83,6 +84,9 @@ export default {
'ACCOUNT_DESCRIPTION': 'All your tickets are stored in your accounts\'s profile. Keep track off all your tickets you send to our staff team.',
'SUPPORT_CENTER_DESCRIPTION': 'Welcome to our support center. You can contact us through a tickets system. Your tickets will be answered by our staff.',
'CUSTOM_RESPONSES_DESCRIPTION': 'Custom responses are automated responses for common problems',
+ 'MY_TICKETS_DESCRIPTION': 'Here you can view the tickets you are responsible for.',
+ 'NEW_TICKETS_DESCRIPTION': 'Here you can view all the new tickets that are not assigned by anyone.',
+ 'ALL_TICKETS_DESCRIPTION': 'Here you can view the tickets of the departments you are assigned.',
'TICKET_VIEW_DESCRIPTION': 'This ticket has been sent by a customer. Here you can respond or assign the ticket',
//ERRORS
diff --git a/client/src/reducers/admin-data-reducer.js b/client/src/reducers/admin-data-reducer.js
index 2aeb295b..6ed135ee 100644
--- a/client/src/reducers/admin-data-reducer.js
+++ b/client/src/reducers/admin-data-reducer.js
@@ -8,14 +8,26 @@ class AdminDataReducer extends Reducer {
getInitialState() {
return {
customResponses: [],
- customResponsesLoaded: false
+ customResponsesLoaded: false,
+ myTickets: [],
+ myTicketsLoaded: false,
+ newTickets: [],
+ newTicketsLoaded: false,
+ allTickets: [],
+ allTicketsLoaded: false
};
}
getTypeHandlers() {
return {
'CUSTOM_RESPONSES_FULFILLED': this.onCustomResponses,
- 'SESSION_CHECKED': this.onSessionChecked
+ 'SESSION_CHECKED': this.onSessionChecked,
+ 'MY_TICKETS_FULFILLED': this.onMyTicketsRetrieved,
+ 'MY_TICKETS_PENDING': this.onMyTicketsPending,
+ 'NEW_TICKETS_FULFILLED': this.onNewTicketsRetrieved,
+ 'NEW_TICKETS_PENDING': this.onNewTicketsPending,
+ 'ALL_TICKETS_FULFILLED': this.onAllTicketsRetrieved,
+ 'ALL_TICKETS_PENDING': this.onAllTicketsPending
};
}
@@ -36,6 +48,45 @@ class AdminDataReducer extends Reducer {
customResponsesLoaded: true
});
}
+
+ onMyTicketsRetrieved(state, payload) {
+ return _.extend({}, state, {
+ myTickets: payload.data,
+ myTicketsLoaded: true
+ })
+ }
+
+ onMyTicketsPending(state) {
+ return _.extend({}, state, {
+ myTicketsLoaded: false
+ })
+ }
+
+ onNewTicketsRetrieved(state, payload) {
+ return _.extend({}, state, {
+ newTickets: payload.data,
+ newTicketsLoaded: true
+ })
+ }
+
+ onNewTicketsPending(state) {
+ return _.extend({}, state, {
+ newTicketsLoaded: false
+ })
+ }
+
+ onAllTicketsRetrieved(state, payload) {
+ return _.extend({}, state, {
+ allTickets: payload.data,
+ allTicketsLoaded: true
+ })
+ }
+
+ onAllTicketsPending(state) {
+ return _.extend({}, state, {
+ allTicketsLoaded: false
+ })
+ }
}
export default AdminDataReducer.getInstance();
\ No newline at end of file