Since 20.11, there is only one filter per column or one global filter on 'cgi-bin/koha/acqui/parcel.pl?invoiceid=X' when you want to receive shipments. With many shopping carts, it can be useful to filter by certain criteria, passed by column or/and by the "global" search input. But when we click receive and get redirected to 'cgi-bin/koha/acqui/orderreceive.pl?ordernumber=X&invoiceid=Y' after saving or canceling action, back to previous page, data table is still filtered but we cannot clear the input from the global search filter. There is a parameter for datatable which can be passed to false to avoid saving the state of the datatable but this is not a solution because it can be tedious to set again the desired filters. The problem is related to the fact that the state of the datatable is saved by a cookie, retrieved when loading this same datatable. But when initializing the "clear filter" button, the class disabled is added if the search is empty and the recovery of the cookie is not taken into account. This is a first correction proposal that I will submit and which corrects the problem on the other datatables which would have the same behavior.
Since 21.11, not 20.11 :)
Created attachment 142713 [details] [review] Bug 32016: Fix clear filter button behavior For example, if you filter by global search input a datatable which saves its previous state when you want to return to this datatable, the backup is recovered in a cookie but the "clear filter" button is disabled because for it the input is empty, the verification of the recovery of the cookie not being made. When loading I therefore added the verification of the cookie and if the search value is not empty then the button can be activated. Test plan: 1) Be sure to have some orders and baskets which can be received 2) Go to 'cgi-bin/koha/acqui/booksellers.pl' and click on 'Receive shipments' 3) Enter something in global search 4) Go to receive and cancel or save to be back on datatable 5) See that you cannot remove your previous input by the 'clear filter' button 6) Apply this patch 7) Repeat steps 3) and 4) 8) See that now you can remove your search Current status: NEW
Created attachment 142797 [details] [review] Bug 32016: Fix clear filter button behavior For example, if you filter by global search input a datatable which saves its previous state when you want to return to this datatable, the backup is recovered in a cookie but the "clear filter" button is disabled because for it the input is empty, the verification of the recovery of the cookie not being made. When loading I therefore added the verification of the cookie and if the search value is not empty then the button can be activated. Test plan: 1) Be sure to have some orders and baskets which can be received 2) Go to 'cgi-bin/koha/acqui/booksellers.pl' and click on 'Receive shipments' 3) Enter something in global search 4) Go to receive and cancel or save to be back on datatable 5) See that you cannot remove your previous input by the 'clear filter' button 6) Apply this patch 7) Repeat steps 3) and 4) 8) See that now you can remove your search Signed-off-by: David Nind <david@davidnind.com>
Changed assignee :)
Created attachment 142977 [details] [review] Bug 32016: Fix clear filter button behavior For example, if you filter by global search input a datatable which saves its previous state when you want to return to this datatable, the backup is recovered in a cookie but the "clear filter" button is disabled because for it the input is empty, the verification of the recovery of the cookie not being made. When loading I therefore added the verification of the cookie and if the search value is not empty then the button can be activated. Test plan: 1) Be sure to have some orders and baskets which can be received 2) Go to 'cgi-bin/koha/acqui/booksellers.pl' and click on 'Receive shipments' 3) Enter something in global search 4) Go to receive and cancel or save to be back on datatable 5) See that you cannot remove your previous input by the 'clear filter' button 6) Apply this patch 7) Repeat steps 3) and 4) 8) See that now you can remove your search Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Pushed to master for 22.11. Nice work everyone, thanks!
+ // table_dt.on('search', console.log); hum?
Created attachment 143347 [details] [review] Bug 32016: Remove debug console.log
(In reply to Jonathan Druart from comment #7) > + // table_dt.on('search', console.log); > > hum? .. My bad, I forgot it >_< thanks for your feedback
Follow-up pushed to master, thanks!
Backported to 22.05.x for upcoming 22.05.09
Pushed to 21.11.x for 21.11.16
Not backported to 21.05.x