Bug 35477 - Adding non-existent items to the waiting list should display a warning
Summary: Adding non-existent items to the waiting list should display a warning
Status: RESOLVED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Preservation (show other bugs)
Version: Main
Hardware: All All
: P5 - low normal
Assignee: Jonathan Druart
QA Contact: Victor Grousset/tuxayo
URL:
Keywords:
Depends on: 30708
Blocks: 35940
  Show dependency treegraph
 
Reported: 2023-12-04 12:25 UTC by Katrin Fischer
Modified: 2024-01-30 13:29 UTC (History)
5 users (show)

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


Attachments
Bug 35477: Show a warning when non-existent items are added to the waiting list (2.88 KB, patch)
2023-12-05 13:23 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 35477: Show a warning when non-existent items are added to the waiting list (2.96 KB, patch)
2023-12-06 09:35 UTC, Matt Blenkinsop
Details | Diff | Splinter Review
Bug 35477: (QA follow-up): tidy up code (2.85 KB, patch)
2023-12-16 21:34 UTC, Victor Grousset/tuxayo
Details | Diff | Splinter Review
Bug 35477: Show a warning when non-existent items are added to the waiting list (3.00 KB, patch)
2024-01-01 21:41 UTC, Victor Grousset/tuxayo
Details | Diff | Splinter Review
Bug 35477: (QA follow-up): tidy up code (2.91 KB, patch)
2024-01-01 21:41 UTC, Victor Grousset/tuxayo
Details | Diff | Splinter Review
Bug 35477: Show a warning when non-existent items are added to the waiting list (3.50 KB, patch)
2024-01-04 13:23 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 2023-12-04 12:25:40 UTC
Might be me doing something wrong: 

I tried to add 3999900000611 to my created train in the preservation module, but I only get the "barcode not found, must be in waiting list". My waiting list is empty, adding the item there also fails.
Comment 1 Jonathan Druart 2023-12-04 14:12:47 UTC
Items can be added to a train if there are in the waiting list.

> My waiting list is empty, adding the item there also fails.

Which error do you get?
Comment 2 Katrin Fischer 2023-12-04 18:39:25 UTC
No error on the waiting list or only a very quick flicker and nothing in the console.
I believe I might have been missing one digit in my barcode, but then the error is missing.
Comment 3 Jonathan Druart 2023-12-05 13:19:53 UTC
It says "No items added".
Comment 4 Jonathan Druart 2023-12-05 13:23:33 UTC
Created attachment 159580 [details] [review]
Bug 35477: Show a warning when non-existent items are added to the waiting list

Only messages "X new items added" or "No items added" were displayed.
With this patch we will display:
A warning with "No items added"
A warning with "X new items added. Y items not found." when some items
have not been added
A messages "X new items added" when everything went well
Comment 5 Katrin Fischer 2023-12-05 20:25:00 UTC
Thank you!
Comment 6 Matt Blenkinsop 2023-12-06 09:35:25 UTC
Created attachment 159611 [details] [review]
Bug 35477: Show a warning when non-existent items are added to the waiting list

Only messages "X new items added" or "No items added" were displayed.
With this patch we will display:
A warning with "No items added"
A warning with "X new items added. Y items not found." when some items
have not been added
A messages "X new items added" when everything went well

Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
Comment 7 Victor Grousset/tuxayo 2023-12-16 21:34:25 UTC
Created attachment 159927 [details] [review]
Bug 35477: (QA follow-up): tidy up code
Comment 8 Victor Grousset/tuxayo 2023-12-16 21:41:10 UTC
When having on valid barcode and one invalid:

> 1 new items added. 1 items not found.

https://wiki.koha-community.org/wiki/Coding_Guidelines#JS5:_Enabling_translation_of_language_strings_in_linked_JavaScript
Guideline JS5 does not explicitly asks for handling plural and singular forms but it's included example handles them.

Should we consider it asks for handling plural and singular forms?


---


testing notes:
run `yarn build` before restarting the services.
Comment 9 Tomás Cohen Arazi (tcohen) 2023-12-18 11:20:35 UTC
What is the status of this?
Comment 10 Victor Grousset/tuxayo 2023-12-19 23:20:20 UTC
Do we consider that the JS5 guideline requires handling plural and singular forms?
Comment 11 Jonathan Druart 2023-12-20 07:34:59 UTC
Yes, it should. But this is a discussion for somewhere else.
Comment 12 Victor Grousset/tuxayo 2024-01-01 21:40:45 UTC
(In reply to Jonathan Druart from comment #11)
> But this is a discussion for somewhere else.

Ok, so it doesn't currently mandate it. So not failing QA for this. That was the thing that blocked me.
Comment 13 Victor Grousset/tuxayo 2024-01-01 21:41:08 UTC
Created attachment 160387 [details] [review]
Bug 35477: Show a warning when non-existent items are added to the waiting list

Only messages "X new items added" or "No items added" were displayed.
With this patch we will display:
A warning with "No items added"
A warning with "X new items added. Y items not found." when some items
have not been added
A messages "X new items added" when everything went well

Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Comment 14 Victor Grousset/tuxayo 2024-01-01 21:41:10 UTC
Created attachment 160388 [details] [review]
Bug 35477: (QA follow-up): tidy up code

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Comment 15 Victor Grousset/tuxayo 2024-01-01 21:42:18 UTC
Works, makes sense, QA script happy, code looks good, passing QA :)
Comment 16 Jonathan Druart 2024-01-04 13:23:11 UTC
Created attachment 160533 [details] [review]
Bug 35477: Show a warning when non-existent items are added to the waiting list

Only messages "X new items added" or "No items added" were displayed.
With this patch we will display:
A warning with "No items added"
A warning with "X new items added. Y items not found." when some items
have not been added
A messages "X new items added" when everything went well

Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Comment 17 Jonathan Druart 2024-01-04 13:23:25 UTC
Tidying inline.
Comment 18 Katrin Fischer 2024-01-04 15:53:43 UTC
Pushed for 24.05!

Well done everyone, thank you!
Comment 19 Fridolin Somers 2024-01-08 14:30:26 UTC
Pushed to 23.11.x for 23.11.02
Comment 20 Lucas Gass (lukeg) 2024-01-12 22:18:40 UTC
Missing 23.05.x dependencies, no backport.