Bug 38428 - Simplify listing of items on stock rotation page
Summary: Simplify listing of items on stock rotation page
Status: RESOLVED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Tools (show other bugs)
Version: Main
Hardware: All All
: P5 - low normal
Assignee: Nick Clemens (kidclamp)
QA Contact: Martin Renvoize (ashimema)
URL:
Keywords: rel_24_05_candidate
Depends on:
Blocks:
 
Reported: 2024-11-12 18:32 UTC by Nick Clemens (kidclamp)
Modified: 2024-12-05 23:10 UTC (History)
2 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
24.11.00
Circulation function:


Attachments
Bug 38428: Use links for stock rotation action buttons (14.61 KB, patch)
2024-11-12 18:38 UTC, Nick Clemens (kidclamp)
Details | Diff | Splinter Review
Bug 38428: Use links for stock rotation action buttons (14.68 KB, patch)
2024-11-13 08:16 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 38428: (QA follow-up) Squash QA script warning (2.08 KB, patch)
2024-11-13 08:16 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Nick Clemens (kidclamp) 2024-11-12 18:32:27 UTC
The action buttons on the stock rotation items list are all currently forms, so there is a certain amount of repetition in the html, we also fetch the transfer for the item twice.
Comment 1 Nick Clemens (kidclamp) 2024-11-12 18:38:09 UTC
Created attachment 174436 [details] [review]
Bug 38428: Use links for stock rotation action buttons

This patch converts the action buttons on the stock rotation rota
manage items page to be links to avoid repeating form values (CSRF tokens, etc)

It moves the confirmation for removal from a rota to be a confirm and not a full page reload.

It also moves the fetch of a transfer into a shared variable.

Lastly, there is some chomping added to remove extra whitespace.

To test:
1 - Enable SotckRotation
2 - Create a rota
3 - Add some stages
4 - Add items to the rota
5 - Test the buttons to advance stage, add 'in demand' and remove
6 - Apply patch
7 - Confirm all buttons continue to function
8 - Sign off
Comment 2 Martin Renvoize (ashimema) 2024-11-13 08:16:35 UTC
Created attachment 174447 [details] [review]
Bug 38428: Use links for stock rotation action buttons

This patch converts the action buttons on the stock rotation rota
manage items page to be links to avoid repeating form values (CSRF tokens, etc)

It moves the confirmation for removal from a rota to be a confirm and not a full page reload.

It also moves the fetch of a transfer into a shared variable.

Lastly, there is some chomping added to remove extra whitespace.

To test:
1 - Enable SotckRotation
2 - Create a rota
3 - Add some stages
4 - Add items to the rota
5 - Test the buttons to advance stage, add 'in demand' and remove
6 - Apply patch
7 - Confirm all buttons continue to function
8 - Sign off

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 3 Martin Renvoize (ashimema) 2024-11-13 08:16:37 UTC
Created attachment 174448 [details] [review]
Bug 38428: (QA follow-up) Squash QA script warning

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 4 Martin Renvoize (ashimema) 2024-11-13 08:17:57 UTC
Wow.. thanks for this Nick.. of course prior to the CSRF stuff most of these were already just simple links.

This is quit an improvement and I'd go so far as to say it's an important regression fix.

Passing QA straight.. it's a simple change that works seamlessly.
Comment 5 Katrin Fischer 2024-11-18 16:16:09 UTC
Nice one:
 1 file changed, 38 insertions(+), 67 deletions(-)
Comment 6 Katrin Fischer 2024-11-18 16:46:04 UTC
Pushed for 24.11!

Well done everyone, thank you!
Comment 7 Lucas Gass (lukeg) 2024-12-05 23:10:05 UTC
Needs rebase for 24.05.x, no backport. Rebase if needed.