@@ -18,7 +18,7 @@ import { connect } from 'react-redux'
1818import { hideModal } from 'actions/common'
1919import { fetchGroups , unloadGroups } from 'actions/groups'
2020import { fetchAccounts , unloadAccounts } from 'actions/accounts'
21- import { getTagsWithPage , fetchTicketTypes } from 'actions/tickets'
21+ import { getTagsWithPage , fetchTicketTypes , fetchTicketStatus } from 'actions/tickets'
2222
2323import BaseModal from 'containers/Modals/BaseModal'
2424import SingleSelect from 'components/SingleSelect'
@@ -37,6 +37,7 @@ class FilterTicketsModal extends React.Component {
3737this . props . fetchAccounts ( { page :0 , limit :- 1 , type :'agents' , showDeleted :false } )
3838this . props . getTagsWithPage ( { limit :- 1 } )
3939this . props . fetchTicketTypes ( )
40+ this . props . fetchTicketStatus ( )
4041}
4142
4243componentDidUpdate ( ) {
@@ -90,13 +91,8 @@ class FilterTicketsModal extends React.Component {
9091}
9192
9293render ( ) {
93- const statuses = [
94- { text :'New' , value :'0' } ,
95- { text :'Open' , value :'1' } ,
96- { text :'Pending' , value :'2' } ,
97- { text :'Closed' , value :'3' }
98- ]
99-
94+ const statuses = this . props . ticketStatuses . map ( s => ( { text :s . get ( 'name' ) , value :s . get ( 'uid' ) } ) ) . toArray ( )
95+
10096const tags = this . props . ticketTags
10197. map ( t => {
10298return { text :t . get ( 'name' ) , value :t . get ( '_id' ) }
@@ -222,15 +218,18 @@ FilterTicketsModal.propTypes = {
222218getTagsWithPage :PropTypes . func . isRequired ,
223219ticketTags :PropTypes . object . isRequired ,
224220fetchTicketTypes :PropTypes . func . isRequired ,
225- ticketTypes :PropTypes . object . isRequired
221+ ticketTypes :PropTypes . object . isRequired ,
222+ fetchTicketStatus :PropTypes . func . isRequired ,
223+ ticketStatuses :PropTypes . object . isRequired
226224}
227225
228226const mapStateToProps = state => ( {
229227viewdata :state . common . viewdata ,
230228groupsState :state . groupsState ,
231229accountsState :state . accountsState ,
232230ticketTags :state . tagsSettings . tags ,
233- ticketTypes :state . ticketsState . types
231+ ticketTypes :state . ticketsState . types ,
232+ ticketStatuses :state . ticketsState . ticketStatuses ,
234233} )
235234
236235export default connect ( mapStateToProps , {
@@ -240,5 +239,6 @@ export default connect(mapStateToProps, {
240239 fetchAccounts,
241240 unloadAccounts,
242241 getTagsWithPage,
243- fetchTicketTypes
242+ fetchTicketTypes,
243+ fetchTicketStatus
244244} ) ( FilterTicketsModal )