Bug 14029

Summary: Provide link to clear reports search filters
Product: Koha Reporter: Katrin Fischer <katrin.fischer>
Component: ReportsAssignee: Jonathan Druart <jonathan.druart>
Status: CLOSED FIXED QA Contact: Testopia <testopia>
Severity: enhancement    
Priority: P5 - low CC: david.roberts, jonathan.druart, tmisilo, tomascohen, veron
Version: Main   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: Small patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Attachments: Bug 14029: Provide 'clear' link to empty reports search filters
Bug 14029: Provide 'clear' link to empty reports search filters
[Signed-off] Bug 14029: Provide 'clear' link to empty reports search filters
[PATCH FOR TESTING] Bug 14029 Try to clear filter and reload page using a link only (comment #6)
[COUNTER-PATCH] Bug 14029: Provide 'clear' link to empty
[COUNTER-PATCH] Bug 14029: Provide 'clear' link to empty reports search filters
[Signed-off] Bug 14029: Provide 'clear' link to empty reports search filters
[PASSED QA] Bug 14029: Provide 'clear' link to empty reports search filters

Description Katrin Fischer 2015-04-20 19:57:29 UTC
The reports filters are very 'sticky' - we should provide a link to make clearing the form a 'one-click' thing.

To test:
- go to the reports module
- make sure you got some saved reports
- search your saved reports using the author, keyword and date filters
- see that there is a button to submit the form, but no link to clear it like
  on other pages
Comment 1 Katrin Fischer 2015-05-25 09:18:10 UTC Comment hidden (obsolete)
Comment 2 Marc Véron 2015-05-29 13:55:55 UTC
Hi Katrin,

After clearing the search form I would expect that the form reloads and shows all entries.

That's why I propose to the following change to add a submit to the reset function:

    $("#resetReportsFilter").click(function(e) {
        e.preventDefault();
        $("form[name='ReportsFilter']").find("input[type=text]").val("");
        $("form[name='ReportsFilter']").submit();
    });

What do you think about?

Marc
Comment 3 Katrin Fischer 2015-05-31 13:43:13 UTC Comment hidden (obsolete)
Comment 4 Katrin Fischer 2015-05-31 13:43:39 UTC
Hi Marc, thx for the suggestion! I included the additional line in the patch with a comment - hope that's ok?
Comment 5 Marc Véron 2015-06-01 06:36:06 UTC Comment hidden (obsolete)
Comment 6 Jonathan Druart 2015-06-03 16:55:27 UTC
No JS needed here, the link could point to
reports/guided_reports.pl?phase=Use+saved

It should do the trick.
Comment 7 Marc Véron 2015-06-04 13:57:09 UTC Comment hidden (obsolete)
Comment 8 Jonathan Druart 2015-06-04 14:29:10 UTC Comment hidden (obsolete)
Comment 9 Jonathan Druart 2015-06-04 14:29:45 UTC
(In reply to Marc Véron from comment #7)
> Created attachment 39856 [details] [review] [review]
> [PATCH FOR TESTING] Bug 14029 Try to clear filter and reload page using a
> link only (comment #6)

Ha yes, the filters are stored in the session!
What about my counter-patch?
Comment 10 Jonathan Druart 2015-06-04 14:30:32 UTC Comment hidden (obsolete)
Comment 11 Marc Véron 2015-06-04 14:37:41 UTC Comment hidden (obsolete)
Comment 12 Katrin Fischer 2015-06-06 11:25:53 UTC
Created attachment 39933 [details] [review]
[PASSED QA] Bug 14029: Provide 'clear' link to empty reports search filters

Patch adds a 'clear' link next to the 'Apply filters' button to
empty out the form fields.

To test:
- go to the reports module
- make sure you have some saved reports
- search your saved reports using the author, keyword and date filters
- verify searching works as expected
- verify the new 'clear' link works as expected

Tested couner patch, followed test plan, works as expected. QA tools ok.
Signed-off-by: Marc Véron <veron@veron.ch>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 13 Tomás Cohen Arazi 2015-06-11 16:10:20 UTC
Patch pushed to master.

Thanks Jonathan!
Comment 14 Katrin Fischer 2016-03-29 06:03:02 UTC
*** Bug 11172 has been marked as a duplicate of this bug. ***