Bug 14029 - Provide link to clear reports search filters
Summary: Provide link to clear reports search filters
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Reports (show other bugs)
Version: master
Hardware: All All
: P5 - low enhancement (vote)
Assignee: Jonathan Druart
QA Contact: Testopia
URL:
Whiteboard:
Keywords:
: 11172 (view as bug list)
Depends on:
Blocks:
 
Reported: 2015-04-20 19:57 UTC by Katrin Fischer
Modified: 2016-12-05 21:23 UTC (History)
5 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Small patch
Bot Control: ---
When did the bot last check this:
Who signed the patch off:
Text to go in the release notes:


Attachments
Bug 14029: Provide 'clear' link to empty reports search filters (2.20 KB, patch)
2015-05-25 09:18 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 14029: Provide 'clear' link to empty reports search filters (2.49 KB, patch)
2015-05-31 13:43 UTC, Katrin Fischer
Details | Diff | Splinter Review
[Signed-off] Bug 14029: Provide 'clear' link to empty reports search filters (2.59 KB, patch)
2015-06-01 06:36 UTC, Marc Véron
Details | Diff | Splinter Review
[PATCH FOR TESTING] Bug 14029 Try to clear filter and reload page using a link only (comment #6) (1.33 KB, patch)
2015-06-04 13:57 UTC, Marc Véron
Details | Diff | Splinter Review
[COUNTER-PATCH] Bug 14029: Provide 'clear' link to empty (2.05 KB, patch)
2015-06-04 14:29 UTC, Jonathan Druart
Details | Diff | Splinter Review
[COUNTER-PATCH] Bug 14029: Provide 'clear' link to empty reports search filters (2.07 KB, patch)
2015-06-04 14:30 UTC, Jonathan Druart
Details | Diff | Splinter Review
[Signed-off] Bug 14029: Provide 'clear' link to empty reports search filters (2.29 KB, patch)
2015-06-04 14:37 UTC, Marc Véron
Details | Diff | Splinter Review
[PASSED QA] Bug 14029: Provide 'clear' link to empty reports search filters (2.34 KB, patch)
2015-06-06 11:25 UTC, Katrin Fischer
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
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. ***