mirror of
https://github.com/opensupports/opensupports.git
synced 2025-07-28 16:24:42 +02:00
Adapts frontend to match new backend merged path get-all-tickets
This commit is contained in:
parent
ac11db5505
commit
d3fc148920
@ -25,7 +25,7 @@ class AdminPanelAllTickets extends React.Component {
|
|||||||
};
|
};
|
||||||
|
|
||||||
componentDidMount() {
|
componentDidMount() {
|
||||||
this.props.dispatch(AdminDataAction.retrieveAllTickets());
|
this.updateTicketList();
|
||||||
}
|
}
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
@ -42,6 +42,14 @@ class AdminPanelAllTickets extends React.Component {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
updateTicketList() {
|
||||||
|
this.props.dispatch(AdminDataAction.retrieveAllTickets(
|
||||||
|
this.state.page,
|
||||||
|
this.state.query,
|
||||||
|
this.state.closedTicketsShown*1
|
||||||
|
));
|
||||||
|
}
|
||||||
|
|
||||||
getTicketListProps() {
|
getTicketListProps() {
|
||||||
return {
|
return {
|
||||||
userId: this.props.userId,
|
userId: this.props.userId,
|
||||||
@ -65,28 +73,20 @@ class AdminPanelAllTickets extends React.Component {
|
|||||||
closedTicketsShown: !state.closedTicketsShown
|
closedTicketsShown: !state.closedTicketsShown
|
||||||
};
|
};
|
||||||
}, () => {
|
}, () => {
|
||||||
this.props.dispatch(AdminDataAction.retrieveAllTickets(this.state.page, this.state.closedTicketsShown * 1));
|
this.updateTicketList();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
onSearch(query) {
|
onSearch(query) {
|
||||||
this.setState({query, page: 1});
|
this.setState({query, page: 1}, () => {
|
||||||
|
this.updateTicketList();
|
||||||
if(query) {
|
});
|
||||||
this.props.dispatch(AdminDataAction.searchTickets(query));
|
|
||||||
} else {
|
|
||||||
this.props.dispatch(AdminDataAction.retrieveAllTickets());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
onPageChange(event) {
|
onPageChange(event) {
|
||||||
this.setState({page: event.target.value});
|
this.setState({page: event.target.value}, () => {
|
||||||
|
this.updateTicketList();
|
||||||
if(this.state.query) {
|
});
|
||||||
this.props.dispatch(AdminDataAction.searchTickets(this.state.query, event.target.value));
|
|
||||||
} else {
|
|
||||||
this.props.dispatch(AdminDataAction.retrieveAllTickets(event.target.value));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user