Bug 23823 - Allow system preferences to be bookmarked
Summary: Allow system preferences to be bookmarked
Status: RESOLVED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: System Administration (show other bugs)
Version: master
Hardware: All All
: P5 - low enhancement (vote)
Assignee: Ivan Masár
QA Contact: Testopia
URL:
Keywords:
: 23388 (view as bug list)
Depends on:
Blocks:
 
Reported: 2019-10-16 11:16 UTC by Ivan Masár
Modified: 2020-11-16 21:43 UTC (History)
9 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Trivial patch
Text to go in the release notes:
Version(s) released in:
20.11.00


Attachments
screenshot (71.27 KB, image/png)
2019-10-16 11:16 UTC, Ivan Masár
Details
Bug 23823: Allow system preferences to be bookmarked (1.44 KB, patch)
2019-10-16 11:29 UTC, Ivan Masár
Details | Diff | Splinter Review
Bug 23823: Allow system preferences to be bookmarked (1.54 KB, patch)
2019-10-17 06:28 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 23823: (follow-up) Get rid of some tabs in favor of spaces (2.23 KB, patch)
2019-10-17 06:28 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 23823: (follow-up) Get rid of some tabs in favor of spaces (2.36 KB, patch)
2019-10-17 10:40 UTC, Ivan Masár
Details | Diff | Splinter Review
Bug 23823: (follow-up) minor visual fix (1.26 KB, patch)
2019-10-17 11:50 UTC, Ivan Masár
Details | Diff | Splinter Review
Bug 23823: (follow-up) minor visual fix (1.40 KB, patch)
2020-10-14 14:54 UTC, Séverine Queune
Details | Diff | Splinter Review
Bug 23823: Allow system preferences to be bookmarked (1.68 KB, patch)
2020-10-14 14:57 UTC, Séverine Queune
Details | Diff | Splinter Review
Bug 23823: (follow-up) Get rid of some tabs in favor of spaces (2.41 KB, patch)
2020-10-14 14:57 UTC, Séverine Queune
Details | Diff | Splinter Review
Bug 23823: (follow-up) minor visual fix (1.40 KB, patch)
2020-10-14 14:57 UTC, Séverine Queune
Details | Diff | Splinter Review
Bug 23823: Allow system preferences to be bookmarked (1.75 KB, patch)
2020-10-16 11:48 UTC, Nick Clemens
Details | Diff | Splinter Review
Bug 23823: (follow-up) Get rid of some tabs in favor of spaces (2.48 KB, patch)
2020-10-16 11:49 UTC, Nick Clemens
Details | Diff | Splinter Review
Bug 23823: (follow-up) minor visual fix (1.46 KB, patch)
2020-10-16 11:49 UTC, Nick Clemens
Details | Diff | Splinter Review
Bug 23823: (QA follow-up) Fix filter in link (1.34 KB, patch)
2020-10-16 11:49 UTC, Nick Clemens
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Ivan Masár 2019-10-16 11:16:15 UTC
Created attachment 94271 [details]
screenshot

Test plan:
1) Log in to Staff UI with superlibrarian permissions
2) Go to System Preferences /cgi-bin/koha/admin/preferences.pl
3) Next to each preference, there should now be a bookmark icon
4) The bookmark icon links to a search for the exact preference name
5) The link can be bookmarked for quick reference to the specific preference
Comment 1 Ivan Masár 2019-10-16 11:29:20 UTC
Created attachment 94272 [details] [review]
Bug 23823: Allow system preferences to be bookmarked

Test plan:
1) Log in to Staff UI with superlibrarian permissions
2) Go to System Preferences /cgi-bin/koha/admin/preferences.pl
3) Next to each preference, there should now be a bookmark icon
4) The bookmark icon links to a search for the exact preference name
5) The link can be bookmarked for quick reference to the specific
preference
Comment 2 Katrin Fischer 2019-10-17 06:28:09 UTC
Don't forget to change the status to 'Needs Signoff' once you have attached your patches for testing. You should also change the Assignee to yourself, once you have decided to work on something. Thx for the contribution!  :)
Comment 3 Katrin Fischer 2019-10-17 06:28:49 UTC
Created attachment 94361 [details] [review]
Bug 23823: Allow system preferences to be bookmarked

Test plan:
1) Log in to Staff UI with superlibrarian permissions
2) Go to System Preferences /cgi-bin/koha/admin/preferences.pl
3) Next to each preference, there should now be a bookmark icon
4) The bookmark icon links to a search for the exact preference name
5) The link can be bookmarked for quick reference to the specific
preference

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 4 Katrin Fischer 2019-10-17 06:28:52 UTC
Created attachment 94362 [details] [review]
Bug 23823: (follow-up) Get rid of some tabs in favor of spaces

In the paragraph touched by this patch, there were some
whitespace issues. This patch does some tab to space
replacement and reindentation to make the code more readable.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 5 Martin Renvoize 2019-10-17 06:56:38 UTC
Hi Ivan,

Welcome to the team, it's great to have another new contributor.

I'm afraid the QA scripts throw up a minor error:

 FAIL   koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences.tt
   FAIL   filters
                wrong_html_filter at line 59 (                            <a href="/cgi-bin/koha/admin/preferences.pl?op=search&searchfield=[% NAME.name | html %]">)

It's should be simple enough to fix, you just need to replace the `| html` with `| uri` as the template variable is being used inside a url string here.

A quick followup with that change as it's own little patch would be perfect and then I can pass qa on this set.

Many thanks,

Martin
Comment 6 Martin Renvoize 2019-10-17 07:15:43 UTC
Secondary thought, I wonder if it might be 'nicer' to link to the preference in context (rather than individually displayed as a search result) using anchors instead?

Something along the lines of giving the `code` block an id of the preference code and then constructing the link following something like `/cgi-bin/koha/admin/preferences.pl?tab=accounting/#pref_code`.
Comment 7 Katrin Fischer 2019-10-17 08:18:42 UTC
(In reply to Martin Renvoize from comment #6)
> Secondary thought, I wonder if it might be 'nicer' to link to the preference
> in context (rather than individually displayed as a search result) using
> anchors instead?
> 
> Something along the lines of giving the `code` block an id of the preference
> code and then constructing the link following something like
> `/cgi-bin/koha/admin/preferences.pl?tab=accounting/#pref_code`.

Sorry for missing the filter - missed it when I fixed some tabs over spaces.
I feel this is a pragmatic solution that we could still extend later on.
Comment 8 Katrin Fischer 2019-10-17 08:24:29 UTC
Tbh, I also like the 'without context' approach here. you could modify the bookmark to make a more general search if you wanted some more to show. But it would make link in documentation etc. very clear and easy to follow without having to locate the right pref again on a page, where it might show at the top, or the middle, depending on length of the page.
Comment 9 Ivan Masár 2019-10-17 10:40:18 UTC
Created attachment 94366 [details] [review]
Bug 23823: (follow-up) Get rid of some tabs in favor of spaces

In the paragraph touched by this patch, there were some
whitespace issues. This patch does some tab to space
replacement and reindentation to make the code more readable.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Ivan Masár <helix84@centrum.sk>
Comment 10 Ivan Masár 2019-10-17 10:51:03 UTC
Thank you for review.

When I was originally looking for a way to bookmark sysprefs, I thought I will just bookmark the anchor like Martin suggested. There were no anchors, so I looked some more and found the search/filter, which worked for me. Now that I've been using it for a while I like it more for the same reason Katrin mentioned - if I know exactly what I'm looking for, I don't need to potentially look for it wherever it may land on screen.

That said, I see two ways to improve the current situation:
1) Since this is substring search, not exact search, bookmarking GoogleOpenIDConnect will also show GoogleOpenIDConnectAutoRegister and a few others. My intent was to link to one exact syspref. Is there a parameter to specify exact search?
2) If context is what's desired, we may add a bookmark icon for section anchors (e.g. anchor "Google OpenID Connect" on the Administration tab).
Comment 11 Ivan Masár 2019-10-17 10:55:26 UTC
Also, I just noticed there's systempreferences.pl (vs preferences.pl). Is this newer, older or something else entirely? (asking just in case I'm making changes to code to be deprecated)
Comment 12 Katrin Fischer 2019-10-17 11:05:26 UTC
One of them is used for local prefs that are not reflected in the YAML files and for that not searchable.
Comment 13 Katrin Fischer 2019-10-17 11:05:38 UTC
See tab "Local use"
Comment 14 Martin Renvoize 2019-10-17 11:46:24 UTC
It's just come to my attention that bug 23388 is attempting to do something similar to this already... just trying to work out how they sit in context.
Comment 15 Ivan Masár 2019-10-17 11:50:38 UTC
Created attachment 94367 [details] [review]
Bug 23823: (follow-up) minor visual fix

Do not allow a line break between the bookmark icon and syspref name.
Comment 16 Ivan Masár 2019-10-17 12:00:07 UTC
@Martin: I see that bug 23388 provides the previously mentioned alternate solution via anchor links. Nice to see that I'm not the only one who had the same need (I haven't seen the other bug before).
Comment 17 Owen Leonard 2019-10-17 12:12:49 UTC
I've posted a work-in-progress patch to Bug 23388. If anyone is interested in testing I'd love to get some feedback.
Comment 18 Séverine Queune 2020-10-14 14:54:38 UTC
Created attachment 111625 [details] [review]
Bug 23823: (follow-up) minor visual fix

Do not allow a line break between the bookmark icon and syspref name.

Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>
Comment 19 Séverine Queune 2020-10-14 14:57:28 UTC
Created attachment 111626 [details] [review]
Bug 23823: Allow system preferences to be bookmarked

Test plan:
1) Log in to Staff UI with superlibrarian permissions
2) Go to System Preferences /cgi-bin/koha/admin/preferences.pl
3) Next to each preference, there should now be a bookmark icon
4) The bookmark icon links to a search for the exact preference name
5) The link can be bookmarked for quick reference to the specific
preference

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>
Comment 20 Séverine Queune 2020-10-14 14:57:40 UTC
Created attachment 111627 [details] [review]
Bug 23823: (follow-up) Get rid of some tabs in favor of spaces

In the paragraph touched by this patch, there were some
whitespace issues. This patch does some tab to space
replacement and reindentation to make the code more readable.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Ivan Masár <helix84@centrum.sk>
Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>
Comment 21 Séverine Queune 2020-10-14 14:57:46 UTC
Created attachment 111628 [details] [review]
Bug 23823: (follow-up) minor visual fix

Do not allow a line break between the bookmark icon and syspref name.

Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>
Comment 22 Séverine Queune 2020-10-14 14:58:52 UTC
Sorry for the first bad sign off, forgot to check the number of attachments...
Hope it won't be a problem for QA.
Comment 23 Nick Clemens 2020-10-15 15:12:30 UTC
Owen, can you take a look here and let me know if you approve? It works for me, but I think maybe it has the same issues you didn't like on 23388
Comment 24 Owen Leonard 2020-10-16 11:30:00 UTC
(In reply to Nick Clemens from comment #23)
> It works for
> me, but I think maybe it has the same issues you didn't like on 23388

No, the issues I had with how Bug 23388 was working aren't relevant to this patch. I think this one works well.
Comment 25 Nick Clemens 2020-10-16 11:48:55 UTC
Created attachment 111864 [details] [review]
Bug 23823: Allow system preferences to be bookmarked

Test plan:
1) Log in to Staff UI with superlibrarian permissions
2) Go to System Preferences /cgi-bin/koha/admin/preferences.pl
3) Next to each preference, there should now be a bookmark icon
4) The bookmark icon links to a search for the exact preference name
5) The link can be bookmarked for quick reference to the specific
preference

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Comment 26 Nick Clemens 2020-10-16 11:49:02 UTC
Created attachment 111865 [details] [review]
Bug 23823: (follow-up) Get rid of some tabs in favor of spaces

In the paragraph touched by this patch, there were some
whitespace issues. This patch does some tab to space
replacement and reindentation to make the code more readable.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Ivan Masár <helix84@centrum.sk>
Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Comment 27 Nick Clemens 2020-10-16 11:49:10 UTC
Created attachment 111866 [details] [review]
Bug 23823: (follow-up) minor visual fix

Do not allow a line break between the bookmark icon and syspref name.

Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Comment 28 Nick Clemens 2020-10-16 11:49:15 UTC
Created attachment 111867 [details] [review]
Bug 23823: (QA follow-up) Fix filter in link

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Comment 29 Nick Clemens 2020-10-16 11:52:17 UTC
*** Bug 23388 has been marked as a duplicate of this bug. ***
Comment 30 David Cook 2020-10-19 01:11:13 UTC
This looks very useful.

Great to see a Koha patch from you, Ivan!

For those that don't know, Ivan (helix84) has been contributing to DSpace for quite a few years now. 

Hopefully we'll see more patches :D.
Comment 31 Jonathan Druart 2020-11-04 16:33:48 UTC
Pushed to master for 20.11, thanks to everybody involved!
Comment 32 Jonathan Druart 2020-11-04 16:35:36 UTC
Congratulations for your first patch pushed, Ivan!
Comment 33 Lucas Gass 2020-11-16 21:42:45 UTC
enhancement will not be backported to 20.05.x