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.
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
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>
Created attachment 174448 [details] [review] Bug 38428: (QA follow-up) Squash QA script warning Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
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.
Nice one: 1 file changed, 38 insertions(+), 67 deletions(-)
Pushed for 24.11! Well done everyone, thank you!
Needs rebase for 24.05.x, no backport. Rebase if needed.