Bug 32492 - Improve mark-up of OPAC messaging table to ease customization
Summary: Improve mark-up of OPAC messaging table to ease customization
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: OPAC (show other bugs)
Version: master
Hardware: All All
: P5 - low trivial (vote)
Assignee: Katrin Fischer
QA Contact: Testopia
URL:
Keywords: Academy
Depends on:
Blocks:
 
Reported: 2022-12-19 17:02 UTC by Katrin Fischer
Modified: 2023-12-28 20:42 UTC (History)
5 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Trivial patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
23.05.00,22.11.04,22.05.11,21.11.19


Attachments
Bug 32492: Add IDs to the rows of the patron messaging table in OPAC and staff interface (3.09 KB, patch)
2023-02-10 22:42 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 32492: Add IDs to the rows of the patron messaging table in OPAC and staff interface (3.14 KB, patch)
2023-02-13 13:39 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 32492: (follow-up) Add missing HTML filters (2.76 KB, patch)
2023-02-13 13:39 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 32492: Add IDs to the rows of the patron messaging table in OPAC and staff interface (3.14 KB, patch)
2023-02-23 10:31 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 32492: (follow-up) Add missing HTML filters (2.83 KB, patch)
2023-02-23 10:31 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 32492: Add IDs to the rows of the patron messaging table in OPAC and staff interface (3.22 KB, patch)
2023-02-23 10:46 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 32492: (follow-up) Add missing HTML filters (2.83 KB, patch)
2023-02-23 10:46 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 Katrin Fischer 2022-12-19 17:02:40 UTC
When looking at the messaging preferences table in the OPAC, it's really hard to customize. You can only use the row index or the translated descriptions when trying to select the correct line to add things to or when you want to hide unused messages.

It would be great if we could add classes with the code for each notice/message, so this is easier.
Comment 1 Katrin Fischer 2023-02-10 22:42:44 UTC
Created attachment 146525 [details] [review]
Bug 32492: Add IDs to the rows of the patron messaging table in OPAC and staff interface

Sometimes you want to hide notice from the messaging options
becaue the library is not using it. With this patch, we'll
have unique IDs on the <tr> to do so easily.

To test:
* Look at the messaging preferences
  * in the OPAC messaging tab
  * in the staff interface details tab
  * in the staff interface patron edit form
* Verify there are no classes or IDs on the rows or other elements
* Apply patch
* Verify there are nice IDs now on the table rows (tr elements)
  for each message.
Comment 2 Owen Leonard 2023-02-13 13:39:35 UTC
Created attachment 146580 [details] [review]
Bug 32492: Add IDs to the rows of the patron messaging table in OPAC and staff interface

Sometimes you want to hide notice from the messaging options
becaue the library is not using it. With this patch, we'll
have unique IDs on the <tr> to do so easily.

To test:
* Look at the messaging preferences
  * in the OPAC messaging tab
  * in the staff interface details tab
  * in the staff interface patron edit form
* Verify there are no classes or IDs on the rows or other elements
* Apply patch
* Verify there are nice IDs now on the table rows (tr elements)
  for each message.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Comment 3 Owen Leonard 2023-02-13 13:39:37 UTC
Created attachment 146581 [details] [review]
Bug 32492: (follow-up) Add missing HTML filters

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Comment 4 Katrin Fischer 2023-02-13 13:41:12 UTC
Thanks for the follow-up!
Comment 5 Jonathan Druart 2023-02-23 10:31:02 UTC
Created attachment 147217 [details] [review]
Bug 32492: Add IDs to the rows of the patron messaging table in OPAC and staff interface

Sometimes you want to hide notice from the messaging options
becaue the library is not using it. With this patch, we'll
have unique IDs on the <tr> to do so easily.

To test:
* Look at the messaging preferences
  * in the OPAC messaging tab
  * in the staff interface details tab
  * in the staff interface patron edit form
* Verify there are no classes or IDs on the rows or other elements
* Apply patch
* Verify there are nice IDs now on the table rows (tr elements)
  for each message.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Comment 6 Jonathan Druart 2023-02-23 10:31:04 UTC
Created attachment 147218 [details] [review]
Bug 32492: (follow-up) Add missing HTML filters

Signed-off-by: Owen Leonard <oleonard@myacpl.org>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 7 Jonathan Druart 2023-02-23 10:46:50 UTC
Created attachment 147220 [details] [review]
Bug 32492: Add IDs to the rows of the patron messaging table in OPAC and staff interface

Sometimes you want to hide notice from the messaging options
becaue the library is not using it. With this patch, we'll
have unique IDs on the <tr> to do so easily.

To test:
* Look at the messaging preferences
  * in the OPAC messaging tab
  * in the staff interface details tab
  * in the staff interface patron edit form
* Verify there are no classes or IDs on the rows or other elements
* Apply patch
* Verify there are nice IDs now on the table rows (tr elements)
  for each message.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 8 Jonathan Druart 2023-02-23 10:46:52 UTC
Created attachment 147221 [details] [review]
Bug 32492: (follow-up) Add missing HTML filters

Signed-off-by: Owen Leonard <oleonard@myacpl.org>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 9 Tomás Cohen Arazi 2023-03-06 17:46:58 UTC
Pushed to master for 23.05.

Nice work everyone, thanks!
Comment 10 Matt Blenkinsop 2023-03-09 09:40:13 UTC
Enhancement - not backporting to 22.11.x. 
Setting to Needs documenting. 
Nice work everyone!
Comment 11 Katrin Fischer 2023-03-09 10:20:07 UTC
Can I make a case for this being tiny enough for backporting? It would save me some rather bad jQuery (I have to use the descriptions now, but that means I need to account for all languages installed)
Comment 12 Martin Renvoize 2023-03-09 10:24:50 UTC
Yeah, striking the right balance is hard.. I'd go with 'missing id' being a 'minor bug' personally.. but it's all opinion.

I think I'd be happy to backport this one, there are no obvious changes or side effects for end users and it gives the power admin the ability to do a little more with IntranetUserJS/CSS with ease.
Comment 13 Katrin Fischer 2023-03-09 10:25:38 UTC
Maybe to explain a bit more: When you are using ILL there are a lot of new messaging options showing up now, also the hold reminder ones that require additional setup, not all libraries will want to use all notices and not all backends are implementing all of them. So there is a need to be able to hide some and until we have a proper configuration option for this, the ids will be super helpful. An easy fix for an existing problem.
Comment 14 Matt Blenkinsop 2023-03-09 11:48:07 UTC
The court has ruled and this can be backported ;) pushing to stable now
Comment 15 Katrin Fischer 2023-03-09 11:57:26 UTC
Does that make me the lawyer of the defence? ;) Thank you!
Comment 16 Matt Blenkinsop 2023-03-09 12:03:24 UTC
Nice work everyone!

Pushed to stable for 22.11.x
Comment 17 Lucas Gass 2023-03-14 20:18:34 UTC
Shouldn't this have an html filter?

<tr id="[% messaging_preference.message_name _ "_message" | lower %]
Comment 18 Lucas Gass 2023-03-14 20:19:34 UTC
(In reply to Lucas Gass from comment #17)
> Shouldn't this have an html filter?
> 
> <tr id="[% messaging_preference.message_name _ "_message" | lower %]

There is a follow-up, sorry.
Comment 19 Lucas Gass 2023-03-14 20:21:07 UTC
Backported to 22.05.x for upcoming 22.05.11
Comment 20 Arthur Suzuki 2023-03-30 07:48:24 UTC
applied to 21.11 for 21.11.19
Comment 21 wainuiwitikapark 2023-04-27 05:54:11 UTC
Not backported to 21.05.x