fix minor error seting list search ticket feature

This commit is contained in:
Guillermo Giuliana 2020-01-22 16:27:01 -03:00
parent fe31163a8a
commit e7aed6979f
1 changed files with 15 additions and 9 deletions

View File

@ -11,21 +11,27 @@ import Message from 'core-components/message';
class AdminPanelSearchTickets extends React.Component { class AdminPanelSearchTickets extends React.Component {
render() { render() {
let title = (window.customTicketList ? window.customTicketList[this.props.location.query.custom*1]['title'] : i18n('CUSTOM_LIST'));
return ( return (
<div className="admin-panel-all-tickets"> <div className="admin-panel-all-tickets">
<Header title={title} description={i18n('SEARCH_TICKETS_DESCRIPTION')} /> <Header title={this.getList().title} description={i18n('SEARCH_TICKETS_DESCRIPTION')} />
{(this.props.error) ? <Message type="error">{i18n('ERROR_RETRIEVING_TICKETS')}</Message> : <TicketQueryList customList ={this.getFilters()}/>} {(this.props.error) ? <Message type="error">{i18n('ERROR_RETRIEVING_TICKETS')}</Message> : <TicketQueryList customList ={this.getList().filters}/>}
</div> </div>
); );
} }
getFilters() { getList() {
let customList = (window.customTicketList && window.customTicketList[this.props.location.query.custom*1]) ? window.customTicketList[this.props.location.query.custom*1] : null if (
return { window.customTicketList &&
...customList this.props.location.query.custom &&
}; window.customTicketList[this.props.location.query.custom*1]
){
return window.customTicketList[this.props.location.query.custom*1];
} else {
return {
'title' : i18n('CUSTOM_LIST'),
'filters' : []
};
}
} }
} }