Bug 29575 - Add a JS render function equivalent of the patron-title.inc TT include
Summary: Add a JS render function equivalent of the patron-title.inc TT include
Status: Passed QA
Alias: None
Product: Koha
Classification: Unclassified
Component: Staff Client (show other bugs)
Version: master
Hardware: All All
: P5 - low enhancement (vote)
Assignee: Tomás Cohen Arazi
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks: 28854 28874 29275
  Show dependency treegraph
 
Reported: 2021-11-25 11:28 UTC by Martin Renvoize
Modified: 2021-11-26 13:18 UTC (History)
1 user (show)

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


Attachments
Bug 29575: Add $patron_to_html to render patron information in JS (2.57 KB, patch)
2021-11-25 11:43 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 29575: Add JSDoc documentation (1.32 KB, patch)
2021-11-25 11:43 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 27975: (follow-up) Patron fields can be empty strings (1.48 KB, patch)
2021-11-25 12:34 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 29575: (follow-up) Patron fields can be empty strings (1.43 KB, patch)
2021-11-25 12:36 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 29575: Add $patron_to_html to render patron information in JS (2.63 KB, patch)
2021-11-26 13:16 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 29575: (QA follow-up) Add JSDoc documentation (1.40 KB, patch)
2021-11-26 13:16 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 29575: (QA follow-up) Patron fields can be empty strings (1.50 KB, patch)
2021-11-26 13:16 UTC, Martin Renvoize
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Renvoize 2021-11-25 11:28:26 UTC
We need a re-usable function that will use the json patron object as returned from the API and render an equivalent to the TT patron-title.inc output.
Comment 1 Martin Renvoize 2021-11-25 11:29:23 UTC
Grabbing the code from bug 29275 by Tomas and submitting it here so we can depend on it in other bugs without requiring the whole of 29275 for backports.
Comment 2 Martin Renvoize 2021-11-25 11:43:09 UTC
Created attachment 127999 [details] [review]
Bug 29575: Add $patron_to_html to render patron information in JS

This patch adds a re-usable javascript render function that accepts a
Koha REST api Patron object and outputs the HTML representation.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Comment 3 Martin Renvoize 2021-11-25 11:43:13 UTC
Created attachment 128000 [details] [review]
Bug 29575: Add JSDoc documentation

This patch adds some basic documentation for the $patron_to_html
function the patchset introduces.
Comment 4 Martin Renvoize 2021-11-25 11:44:00 UTC
Grabbing SO from Victor on Bug 29275
Comment 5 Martin Renvoize 2021-11-25 12:34:37 UTC Comment hidden (obsolete)
Comment 6 Martin Renvoize 2021-11-25 12:36:22 UTC
Created attachment 128006 [details] [review]
Bug 29575: (follow-up) Patron fields can be empty strings

We need to account for empty strings as well as 'null' values in the
patron data structure.
Comment 7 Martin Renvoize 2021-11-26 13:16:40 UTC
Created attachment 128038 [details] [review]
Bug 29575: Add $patron_to_html to render patron information in JS

This patch adds a re-usable javascript render function that accepts a
Koha REST api Patron object and outputs the HTML representation.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 8 Martin Renvoize 2021-11-26 13:16:43 UTC
Created attachment 128039 [details] [review]
Bug 29575: (QA follow-up) Add JSDoc documentation

This patch adds some basic documentation for the $patron_to_html
function the patchset introduces.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 9 Martin Renvoize 2021-11-26 13:16:47 UTC
Created attachment 128040 [details] [review]
Bug 29575: (QA follow-up) Patron fields can be empty strings

We need to account for empty strings as well as 'null' values in the
patron data structure.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 10 Martin Renvoize 2021-11-26 13:18:14 UTC
I've tested this on a few of the dependant bugs, it's looking great and testing lead me to just these two minor QA follow-ups.

Passing QA :)