Bug 40958 - Move patron_to_html (from js-patron-format.inc) to a standalone JS file
Summary: Move patron_to_html (from js-patron-format.inc) to a standalone JS file
Status: Pushed to main
Alias: None
Product: Koha
Classification: Unclassified
Component: Architecture, internals, and plumbing (show other bugs)
Version: unspecified
Hardware: All All
: P5 - low enhancement
Assignee: Jonathan Druart
QA Contact: Nick Clemens (kidclamp)
URL:
Keywords:
Depends on: 40699 41003
Blocks: 32176
  Show dependency treegraph
 
Reported: 2025-10-06 13:45 UTC by Jonathan Druart
Modified: 2025-10-31 21:30 UTC (History)
3 users (show)

See Also:
GIT URL:
Initiative type: ---
Sponsorship status: ---
Comma delimited list of Sponsors:
Crowdfunding goal: 0
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
25.11.00
Circulation function:


Attachments
Bug 40958: Move patron_to_html to a standalone JS file (18.01 KB, patch)
2025-10-06 13:48 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 40958: Move patron_to_html to a standalone JS file (18.07 KB, patch)
2025-10-07 15:31 UTC, Andrew Fuerste-Henry
Details | Diff | Splinter Review
Bug 40958: Remove remaining occurrence in course_reserves/course.tt (973 bytes, patch)
2025-10-09 09:08 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 40958: Move patron_to_html to a standalone JS file (18.13 KB, patch)
2025-10-31 10:49 UTC, Nick Clemens (kidclamp)
Details | Diff | Splinter Review
Bug 40958: Remove remaining occurrence in course_reserves/course.tt (1.01 KB, patch)
2025-10-31 10:49 UTC, Nick Clemens (kidclamp)
Details | Diff | Splinter Review
Bug 40958: (follow-up) Fix QA complaint about forbidden pattern (1.02 KB, patch)
2025-10-31 20:50 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Jonathan Druart 2025-10-06 13:45:13 UTC
We have to explicitly include the TT js-patron-format.inc in all the .tt files we are going to format a patron.

It's also hard to use from JS files, which is a bit ridiculous.
Comment 1 Jonathan Druart 2025-10-06 13:48:08 UTC
Created attachment 187476 [details] [review]
Bug 40958: Move patron_to_html to a standalone JS file

It will be easier to reuse patron_to_html

Test plan:
Search for patron and confirm that that patron are formatted correctly.
Global patron search and a couple of other places should be enough.
Comment 2 Andrew Fuerste-Henry 2025-10-07 15:31:29 UTC
Created attachment 187533 [details] [review]
Bug 40958: Move patron_to_html to a standalone JS file

It will be easier to reuse patron_to_html

Test plan:
Search for patron and confirm that that patron are formatted correctly.
Global patron search and a couple of other places should be enough.

Signed-off-by: Andrew Fuerste Henry <andrew@bywatersolutions.com>
Comment 3 Jonathan Druart 2025-10-09 09:08:13 UTC
Created attachment 187646 [details] [review]
Bug 40958: Remove remaining occurrence in course_reserves/course.tt

From bug 40699
Comment 4 Nick Clemens (kidclamp) 2025-10-31 10:49:50 UTC
Created attachment 188800 [details] [review]
Bug 40958: Move patron_to_html to a standalone JS file

It will be easier to reuse patron_to_html

Test plan:
Search for patron and confirm that that patron are formatted correctly.
Global patron search and a couple of other places should be enough.

Signed-off-by: Andrew Fuerste Henry <andrew@bywatersolutions.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Comment 5 Nick Clemens (kidclamp) 2025-10-31 10:49:52 UTC
Created attachment 188801 [details] [review]
Bug 40958: Remove remaining occurrence in course_reserves/course.tt

From bug 40699

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Comment 6 Nick Clemens (kidclamp) 2025-10-31 10:50:14 UTC
Ignoring this:
[FAIL] koha-tmpl/intranet-tmpl/prog/js/patron-format.js
   FAIL	  forbidden_patterns
		forbidden pattern: Use __("") instead of _("") (line 43)
		forbidden pattern: Use __("") instead of _("") (line 45)

Processing additional checks PASS!
Comment 7 Lucas Gass (lukeg) 2025-10-31 20:50:06 UTC
Created attachment 188866 [details] [review]
Bug 40958: (follow-up) Fix QA complaint about forbidden pattern
Comment 8 Lucas Gass (lukeg) 2025-10-31 21:30:11 UTC
Nice work everyone!

Pushed to main for 25.11