Bug 14189 - Make text persist/populate hidden fields for the Staff searchbox
Summary: Make text persist/populate hidden fields for the Staff searchbox
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Staff Client (show other bugs)
Version: master
Hardware: All All
: P5 - low enhancement (vote)
Assignee: Eivin Giske Skaaren
QA Contact: Testopia
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 14190
  Show dependency treegraph
 
Reported: 2015-05-12 17:58 UTC by Eivin Giske Skaaren
Modified: 2016-12-05 21:22 UTC (History)
4 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
Added the functionality to most staff header search boxes (8.73 KB, patch)
2015-05-12 18:33 UTC, Eivin Giske Skaaren
Details | Diff | Splinter Review
Bug 14189 - Make text persist/populate hidden fields for the Staff searchbox (5.56 KB, patch)
2015-05-12 18:49 UTC, Eivin Giske Skaaren
Details | Diff | Splinter Review
Added the functionality to most staff header search boxes (8.73 KB, patch)
2015-05-12 18:49 UTC, Eivin Giske Skaaren
Details | Diff | Splinter Review
Made text persist when clicking the tabs under the searchbox (16.23 KB, patch)
2015-05-12 19:02 UTC, Eivin Giske Skaaren
Details | Diff | Splinter Review
Made text persist when clicking the tabs under the searchbox (16.27 KB, patch)
2015-05-12 19:17 UTC, Eivin Giske Skaaren
Details | Diff | Splinter Review
Made text persist when clicking the tabs under the searchbox (42.81 KB, patch)
2015-05-12 22:30 UTC, Eivin Giske Skaaren
Details | Diff | Splinter Review
Bug 14189 - [SIGNED-OFF] Made text persist when clicking the tabs under the searchbox (43.45 KB, patch)
2015-05-13 07:16 UTC, Magnus Enger
Details | Diff | Splinter Review
Bug 14189 refactor after failed QA. (31.68 KB, patch)
2015-05-24 14:48 UTC, Eivin Giske Skaaren
Details | Diff | Splinter Review
Bug 14189 - Made text persist when clicking the tabs under the searchbox (42.82 KB, patch)
2015-05-26 10:13 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 14189: Use keep_text for the authority header (3.42 KB, patch)
2015-05-26 10:13 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 14189: Use keep_text for the authority header (3.73 KB, patch)
2015-05-26 18:49 UTC, Eivin Giske Skaaren
Details | Diff | Splinter Review
Bug 14189 - Made text persist when clicking the tabs under the searchbox (43.03 KB, patch)
2015-05-27 13:40 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 14189: Use keep_text for the authority header (3.73 KB, patch)
2015-05-27 13:40 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 Eivin Giske Skaaren 2015-05-12 17:58:05 UTC
Sponsored by Halland County Library.

When clicking the tabs under the search box the currently typed value does not persist since hidden fields are used. 

Users of the system are interested in that the text is populated to the hidden fields so that they don't have to type it in again if they for example had the wrong tab selected when searching the first time.
Comment 1 Eivin Giske Skaaren 2015-05-12 18:33:47 UTC Comment hidden (obsolete)
Comment 2 Eivin Giske Skaaren 2015-05-12 18:49:28 UTC Comment hidden (obsolete)
Comment 3 Eivin Giske Skaaren 2015-05-12 18:49:53 UTC Comment hidden (obsolete)
Comment 4 Eivin Giske Skaaren 2015-05-12 19:02:18 UTC Comment hidden (obsolete)
Comment 5 Eivin Giske Skaaren 2015-05-12 19:17:15 UTC Comment hidden (obsolete)
Comment 6 Eivin Giske Skaaren 2015-05-12 22:30:01 UTC Comment hidden (obsolete)
Comment 7 Magnus Enger 2015-05-13 07:16:13 UTC Comment hidden (obsolete)
Comment 8 Eivin Giske Skaaren 2015-05-13 08:25:15 UTC
What Magnus discovered with the few places it is not implemented was done intentionally as it did not make sense from a UX perspective for example when there is 2 search boxes on one tab and 1 on the other.

It should work for most daily use cases where this would be helpful. 

The templates should probably at some point be refactored since there was some duplication of HTML, but that is not needed for this patch.
Comment 9 Jonathan Druart 2015-05-24 12:37:10 UTC
QA comments:

1/ The class name could be more specific to avoid further conflict ('query')
2/ Since a lot of patch will use keep_text JS function, maybe the include of searchbox-keep-text.inc could be done once in doc-head-close.inc
3/ What is the meaning of the different values of the clicked parameter (0, 1, 2)?
Please add comment.
4/ Is is intended not to use jQuery selectors in the keep_text JS function?

Marked as Failed QA.
Comment 10 Eivin Giske Skaaren 2015-05-24 14:48:20 UTC Comment hidden (obsolete)
Comment 11 Eivin Giske Skaaren 2015-05-24 15:02:12 UTC
Reactivated old patch as told on IRC by cait. 
I think only the last patch is needed to apply since that was the starting point for the refactor.
Comment 12 Jonathan Druart 2015-05-26 10:13:51 UTC Comment hidden (obsolete)
Comment 13 Jonathan Druart 2015-05-26 10:13:57 UTC Comment hidden (obsolete)
Comment 14 Jonathan Druart 2015-05-26 10:15:36 UTC
Elvin,

Thanks for your followup.
I have squashed the 2 first patches to avoid too many add/del lines in the same patch set (same lines were added in the 1st and removed in the 2nd).

Could you please test my patch for the authority header?
Comment 15 Eivin Giske Skaaren 2015-05-26 18:49:04 UTC Comment hidden (obsolete)
Comment 16 Jonathan Druart 2015-05-27 13:40:06 UTC
Created attachment 39587 [details] [review]
Bug 14189 - Made text persist when clicking the tabs under the searchbox

To test:
Apply the patch and see that the text now is there in the search
box when clicking the tabs: check in, check out etc..

(More files changed for persistent text in searchbox)

Sponsored-by: Halland County Library

Signed-off-by: Magnus Enger <magnus@enger.priv.no>
This is something I have wanted quite a few times over the years...

Tested by going to every main area of Koha, entering some random
text into the search box and then clicking on all the available tabs
to check that the entered text is carried over to all the boxes.

There are a couple of places where text is not carried over, but I
guess that might be because one of the boxes is structurally
different to the others. These are:
- "Vendor search" and "Orders search" in Acquisitions
- "Search subscriptions" in Serials

I have not looked at how this is implemented, just that it works as
it should.

Bug 14189 refactor after failed QA.

Signed-off-by: Jonathan Druart <jonathan.druart@koha-community.org>
Amended patch: replace tabs with spaces
Comment 17 Jonathan Druart 2015-05-27 13:40:11 UTC
Created attachment 39588 [details] [review]
Bug 14189: Use keep_text for the authority header

includes/authorities-search.inc already used the same behavior but with
another method.
For consistency it's better to have only 1 way to do that.

Test plan:
Go on the authority home page
Fill the input in the header and click on tab 'search all headings' and
'keyword search' and confirm that the text you have filled is kept.

I tested after applying the patch and the text is kept after removing the
part from authorities-search.inc. I also tried applying that jQuery solution
instead of my JS loop but could not get it to work for the other pages with
a reasonable ammount of effort.

Signed-off-by: Jonathan Druart <jonathan.druart@koha-community.org>
Signed-off-by: Eivin Giske Skaaren <eskaaren@yahoo.no>
Comment 18 Tomás Cohen Arazi 2015-07-08 17:42:00 UTC
Patches pushed to master.

Thanks Eivin and Jonathan!