From a2d3908c4dadbef11ae82ff6ba5f9c01d412ccf7 Mon Sep 17 00:00:00 2001 From: Maxi Redigonda Date: Tue, 16 Oct 2018 12:13:02 -0300 Subject: [PATCH] Renamed showClosedTickets to closedTicketsShown and updated --- client/src/app-components/ticket-list.js | 12 +++++------- .../admin/panel/tickets/admin-panel-my-tickets.js | 13 ++++++------- 2 files changed, 11 insertions(+), 14 deletions(-) diff --git a/client/src/app-components/ticket-list.js b/client/src/app-components/ticket-list.js index 9739e4ce..3404ad0e 100644 --- a/client/src/app-components/ticket-list.js +++ b/client/src/app-components/ticket-list.js @@ -23,9 +23,8 @@ class TicketList extends React.Component { 'primary', 'secondary' ]), - showClosedTickets: React.PropTypes.bool, - filterClosedTickets: React.PropTypes.bool, - onShowClosedTicketsChange: React.PropTypes.func + closedTicketsShown: React.PropTypes.bool, + onClosedTicketsShownChange: React.PropTypes.func }; static defaultProps = { @@ -35,8 +34,7 @@ class TicketList extends React.Component { departments: [], ticketPath: '/dashboard/ticket/', type: 'primary', - showClosedTickets: false, - filterClosedTickets: false + closedTicketsShown: false }; state = { @@ -48,7 +46,7 @@ class TicketList extends React.Component {
{(this.props.type === 'secondary' && this.props.showDepartmentDropdown) ? this.renderDepartmentsDropDown() : null} - {this.props.filterClosedTickets ? this.renderFilterCheckbox() : null} + {this.props.onClosedTicketsShownChange ? this.renderFilterCheckbox() : null}
@@ -57,7 +55,7 @@ class TicketList extends React.Component { renderFilterCheckbox() { - return + return } renderDepartmentsDropDown() { diff --git a/client/src/app/admin/panel/tickets/admin-panel-my-tickets.js b/client/src/app/admin/panel/tickets/admin-panel-my-tickets.js index 35c47b26..82d18344 100644 --- a/client/src/app/admin/panel/tickets/admin-panel-my-tickets.js +++ b/client/src/app/admin/panel/tickets/admin-panel-my-tickets.js @@ -23,7 +23,7 @@ class AdminPanelMyTickets extends React.Component { }; state = { - showClosedTickets: false + closedTicketsShown: false }; componentDidMount() { @@ -54,20 +54,19 @@ class AdminPanelMyTickets extends React.Component { return { userId: this.props.userId, departments: this.props.departments, - tickets: this.state.showClosedTickets ? this.props.tickets : this.filterOpenedTickets(this.props.tickets), + tickets: this.state.closedTicketsShown ? this.props.tickets : this.filterOpenedTickets(this.props.tickets), type: 'secondary', loading: this.props.loading, ticketPath: '/admin/panel/tickets/view-ticket/', - filterClosedTickets: true, - showClosedTickets: this.state.showClosedTickets, - onShowClosedTicketsChange: this.onShowClosedTicketsChange.bind(this) + closedTicketsShown: this.state.closedTicketsShown, + onClosedTicketsShownChange: this.onClosedTicketsShownChange.bind(this) }; } - onShowClosedTicketsChange() { + onClosedTicketsShownChange() { this.setState(function(state) { return { - showClosedTickets: !state.showClosedTickets + closedTicketsShown: !state.closedTicketsShown }; }); }