Bug 22811 - Add button to clear DataTables filtering
Summary: Add button to clear DataTables filtering
Status: RESOLVED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Templates (show other bugs)
Version: master
Hardware: All All
: P5 - low enhancement (vote)
Assignee: Owen Leonard
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks: 22888
  Show dependency treegraph
 
Reported: 2019-04-30 15:07 UTC by Owen Leonard
Modified: 2019-05-17 13:16 UTC (History)
3 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Small patch
Who signed the patch off:
Text to go in the release notes:
Version(s) released in:
19.05.00


Attachments
Screen grab showing clear button interaction (60.47 KB, image/gif)
2019-04-30 15:07 UTC, Owen Leonard
Details
Bug 22811: Add button to clear DataTables filtering (4.60 KB, patch)
2019-04-30 15:38 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 22811: Add button to clear DataTables filtering (4.66 KB, patch)
2019-04-30 17:01 UTC, Liz Rea
Details | Diff | Splinter Review
Bug 22811: Add button to clear DataTables filtering (4.72 KB, patch)
2019-05-01 09:21 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 Owen Leonard 2019-04-30 15:07:20 UTC
Created attachment 89136 [details]
Screen grab showing clear button interaction

I propose that we add a "Clear filter" button to the global DataTables configuration which will be displayed if the table has a search form.
Comment 1 Owen Leonard 2019-04-30 15:38:39 UTC
Created attachment 89138 [details] [review]
Bug 22811: Add button to clear DataTables filtering

This patch adds a "clear filter" button to the global
DataTables configuration. The button will appear if:

 - There is no custom DOM configuration applied to the DataTable
   instance.
 - The DataTable has the search form enabled.

The new button should be disabled by default. Entering a search term in
the form should enable it.

To test, apply the patch and clear your browser cache if necessary. View
various pages with various DataTables configurations and confirm that
everything looks correct and the new "Clear filter" button doesn't
appear when there is no DataTable search field. For example:

 - Administration -> Libraries
 - Administration -> Currencies
 - Reports -> Saved reports
 - Circulation -> Check out
 - Tools -> News
Comment 2 Liz Rea 2019-04-30 17:01:21 UTC
Created attachment 89143 [details] [review]
Bug 22811: Add button to clear DataTables filtering

This patch adds a "clear filter" button to the global
DataTables configuration. The button will appear if:

 - There is no custom DOM configuration applied to the DataTable
   instance.
 - The DataTable has the search form enabled.

The new button should be disabled by default. Entering a search term in
the form should enable it.

To test, apply the patch and clear your browser cache if necessary. View
various pages with various DataTables configurations and confirm that
everything looks correct and the new "Clear filter" button doesn't
appear when there is no DataTable search field. For example:

 - Administration -> Libraries
 - Administration -> Currencies
 - Reports -> Saved reports
 - Circulation -> Check out
 - Tools -> News

Signed-off-by: Liz Rea <wizzyrea@gmail.com>
Comment 3 Katrin Fischer 2019-05-01 09:21:01 UTC
Only thing maybe... I feel the buttons are a little big and the problem and I am sorry German translations will make it worse (why are our words so loooong?)
Comment 4 Katrin Fischer 2019-05-01 09:21:57 UTC
Created attachment 89160 [details] [review]
Bug 22811: Add button to clear DataTables filtering

This patch adds a "clear filter" button to the global
DataTables configuration. The button will appear if:

 - There is no custom DOM configuration applied to the DataTable
   instance.
 - The DataTable has the search form enabled.

The new button should be disabled by default. Entering a search term in
the form should enable it.

To test, apply the patch and clear your browser cache if necessary. View
various pages with various DataTables configurations and confirm that
everything looks correct and the new "Clear filter" button doesn't
appear when there is no DataTable search field. For example:

 - Administration -> Libraries
 - Administration -> Currencies
 - Reports -> Saved reports
 - Circulation -> Check out
 - Tools -> News

Signed-off-by: Liz Rea <wizzyrea@gmail.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 5 Nick Clemens 2019-05-09 19:33:24 UTC
Awesome work all!

Pushed to master for 19.05
Comment 6 Martin Renvoize 2019-05-16 14:37:21 UTC
Enhancement will not be backported to 18.11.x series.
Comment 7 Martin Renvoize 2019-05-17 13:16:55 UTC
Enhancement will not be backported to 18.11.x series.