Bug 16726 - Text in Preferences search box does not clear
Summary: Text in Preferences search box does not clear
Status: Pushed to Stable
Alias: None
Product: Koha
Classification: Unclassified
Component: System Administration (show other bugs)
Version: unspecified
Hardware: All All
: P5 - low minor (vote)
Assignee: Aleisha Amohia
QA Contact: Nick Clemens
URL:
Whiteboard:
Keywords: Academy
Depends on:
Blocks:
 
Reported: 2016-06-13 17:46 UTC by Agnes Rivers-Moore
Modified: 2017-11-23 23:23 UTC (History)
9 users (show)

See Also:
Change sponsored?: 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 16726: Clear text in syspref searchbox after submitting (1.23 KB, patch)
2017-04-18 23:07 UTC, Aleisha Amohia
Details | Diff | Splinter Review
Bug 16726: Clear text in syspref searchbox after submitting (1.28 KB, patch)
2017-04-19 05:25 UTC, Dilan Johnpullé
Details | Diff | Splinter Review
Bug 16726: Clear text in syspref searchbox after submitting (2.21 KB, patch)
2017-06-07 02:10 UTC, Aleisha Amohia
Details | Diff | Splinter Review
Bug 16726: Putting text in h1 (1000 bytes, patch)
2017-06-27 04:15 UTC, Aleisha Amohia
Details | Diff | Splinter Review
Bug 16726: [FOLLOW-UP] Putting text in h1 (1012 bytes, patch)
2017-06-27 04:16 UTC, Aleisha Amohia
Details | Diff | Splinter Review
Bug 16726: [FOLLOW-UP] Putting text in h1 (1.19 KB, patch)
2017-07-07 00:46 UTC, Dilan Johnpullé
Details | Diff | Splinter Review
Bug 16726: Clear text in syspref searchbox after submitting (2.26 KB, patch)
2017-09-01 10:35 UTC, Nick Clemens
Details | Diff | Splinter Review
Bug 16726: [FOLLOW-UP] Putting text in h1 (1.25 KB, patch)
2017-09-01 10:35 UTC, Nick Clemens
Details | Diff | Splinter Review
Bug 16726: Do not display "You searched for:" if not needed (1.05 KB, patch)
2017-10-03 14:05 UTC, Jonathan Druart
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Agnes Rivers-Moore 2016-06-13 17:46:23 UTC
When in Administration - Preferences, using search box.
Enter search term, hit enter or click button to search. 
After search completes, the search box still shows the search text.
Once a search is done, the search box should clear as it does for checkout, catalogue, patron searches etc.
(Note that this is more annoying now that the search text also persists when switching to a different tab, like from Preferences to Checkout.)
Comment 1 Katrin Fischer 2016-06-15 05:51:55 UTC
Hm, I am not sure I agree. For example when you do a simple search in the OPAC we also keep the search term showing, as it allows you to check what you searched for and change your search if nothing was found etc. I like that feature of the system preference editor - as I can spot a typo that might have caused me finding nothing. If this was to be removed, it might be nice to show what was searched for in another way.
Comment 2 Agnes Rivers-Moore 2016-06-15 21:53:29 UTC
The system already does tell you what you searched for if there are no results in preferences. It says "No system preferences matched your search for: peter"
Comment 3 Agnes Rivers-Moore 2016-06-15 22:02:47 UTC
The behaviour of the preferences search box is not consistent with all the other search functions in the staff interface. They keep the text while you switch between tabs only before the search is run. 
I think it is unlikely that staff using Preferences would want to run the same search they have completed in any of the other functions.
That's just my opinion; other folks can decide whether this warrants any effort or not, now you know it exists.
Comment 4 Katrin Fischer 2016-06-15 22:59:40 UTC
Good points. I think I agree now :)
Comment 5 Jonathan Druart 2016-08-19 09:31:56 UTC
Note that you can use JS code to clean the search box.
Comment 6 Aleisha Amohia 2017-04-18 23:07:30 UTC Comment hidden (obsolete)
Comment 7 Dilan Johnpullé 2017-04-19 05:25:53 UTC Comment hidden (obsolete)
Comment 8 Dilan Johnpullé 2017-04-19 05:28:03 UTC
Works as intended and no issues were encountered when applying the patch.
Comment 9 Dilan Johnpullé 2017-04-19 05:29:23 UTC
Signed-off-by: Dilan Johnpulle <dilan@calyx.net.au>
Comment 10 Jonathan Druart 2017-04-19 12:43:32 UTC
Aleisha,
I talked about JS code previously to tell people that without any patches it is possible to clean the box easily.
But if we want to do it with a patch we can do it by removing the value of the input (in prefs-admin-search.inc).

We may want to add something on the screen to tell the user on what we search for. I'd like to get opinions on that, Owen maybe?
Comment 11 Owen Leonard 2017-04-20 14:16:48 UTC
(In reply to Jonathan Druart from comment #10)

I agree that it is inconsistent that the preference search leaves the search term in the search box.

> We may want to add something on the screen to tell the user on what we
> search for.

I agree. I think this patch should include that as well.
Comment 12 Aleisha Amohia 2017-06-07 02:10:50 UTC
Created attachment 64072 [details] [review]
Bug 16726: Clear text in syspref searchbox after submitting

To test:
1) Go to Admin -> search for a system preference
2) Notice your search stays in the search box (this is inconsistent with
    search behaviour across Koha)
3) Apply patch and refresh page
4) Make another search
5) Confirm search still works as expected and search terms have been
cleared from search box
6) Confirm search terms show at the top of the results

Sponsored-by: Catalyst IT
Comment 13 Owen Leonard 2017-06-07 12:32:07 UTC
I think the "you searched for" text should be in a <h1></h1>.
Comment 14 Aleisha Amohia 2017-06-27 04:15:53 UTC
Created attachment 64668 [details] [review]
Bug 16726: Putting text in h1

See Comment 13
Comment 15 Aleisha Amohia 2017-06-27 04:16:27 UTC
Created attachment 64669 [details] [review]
Bug 16726: [FOLLOW-UP] Putting text in h1

See Comment 13
Comment 16 Dilan Johnpullé 2017-07-07 00:46:09 UTC
Created attachment 64876 [details] [review]
Bug 16726: [FOLLOW-UP] Putting text in h1

Works as outlined in test plan, search terms now appear at top as h1 as well

Signed-off-by: Dilan Johnpullé <dilan@calyx.net.au>
Comment 17 Nick Clemens 2017-07-21 11:44:15 UTC
This works fine for me, but the h1 looks too large, it is confusing with the results. h3 is more consistent, but that is styled as expand/collapse on this page.

How about below:
<div class="dialog">You searched for: <strong>[% searchfield | html %]</strong></div>
Comment 18 Owen Leonard 2017-07-31 16:23:12 UTC
I would prefer the heading to follow the format of catalog search results, "X result(s) found for 'term'"

If that's not possible I think this patch is fine. I don't think the message dialog is the right solution.
Comment 19 Nick Clemens 2017-09-01 10:35:08 UTC
Created attachment 66699 [details] [review]
Bug 16726: Clear text in syspref searchbox after submitting

To test:
1) Go to Admin -> search for a system preference
2) Notice your search stays in the search box (this is inconsistent with
    search behaviour across Koha)
3) Apply patch and refresh page
4) Make another search
5) Confirm search still works as expected and search terms have been
cleared from search box
6) Confirm search terms show at the top of the results

Sponsored-by: Catalyst IT

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Comment 20 Nick Clemens 2017-09-01 10:35:11 UTC
Created attachment 66700 [details] [review]
Bug 16726: [FOLLOW-UP] Putting text in h1

Works as outlined in test plan, search terms now appear at top as h1 as well

Signed-off-by: Dilan Johnpullé <dilan@calyx.net.au>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Comment 21 Jonathan Druart 2017-09-01 14:57:24 UTC
It does not look good to me: https://pageshot.net/kN7OYETHoEC4WTSQ/pro.kohadev.org

Does someone has something else to suggest? Maybe we should style a bit h1, or h2?
Comment 22 Jonathan Druart 2017-09-01 15:00:03 UTC
11:57 < Joubu> does it look good for you?
11:58 < oleonard> Yes
Comment 23 Jonathan Druart 2017-09-01 16:04:37 UTC
Pushed to master for 17.11, thanks to everybody involved!
Comment 24 Fridolin SOMERS 2017-10-03 08:34:33 UTC
Ah, when showing a preferences tab, the text still appears :
"You searched for: "
I think one should check if "searchfield" is defined.
Comment 25 Jonathan Druart 2017-10-03 14:05:46 UTC
Created attachment 67551 [details] [review]
Bug 16726: Do not display "You searched for:" if not needed

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 26 Jonathan Druart 2017-10-03 14:07:12 UTC
(In reply to Fridolin SOMERS from comment #24)
> Ah, when showing a preferences tab, the text still appears :
> "You searched for: "
> I think one should check if "searchfield" is defined.

Good catch, last patch pushed to master!
Comment 27 Fridolin SOMERS 2017-10-27 12:45:38 UTC
Pushed to 17.05.x, will be in 17.05.06.
Comment 28 Katrin Fischer 2017-10-29 18:43:41 UTC
These patches have been pushed to 16.11.x and will be in 16.11.14.
Comment 29 Mason James 2017-11-23 23:23:23 UTC
Pushed to 16.05.x, for 16.05.19 release