Bug 32121 - Show an alert when adding a checked out item to an item bundle
Summary: Show an alert when adding a checked out item to an item bundle
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Circulation (show other bugs)
Version: Main
Hardware: All All
: P5 - low normal (vote)
Assignee: Julian Maurice
QA Contact: Kyle M Hall
URL:
Keywords:
Depends on: 28854
Blocks: 32802 33025 33021 33447
  Show dependency treegraph
 
Reported: 2022-11-07 13:37 UTC by Julian Maurice
Modified: 2023-12-28 20:43 UTC (History)
7 users (show)

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


Attachments
Bug 32121: Show an alert when adding a checked out item to an item bundle (13.42 KB, patch)
2022-11-07 13:39 UTC, Julian Maurice
Details | Diff | Splinter Review
Bug 32121: Show an alert when adding a checked out item to an item bundle (13.33 KB, patch)
2023-02-02 16:19 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 32121: (QA follow-up) Use error_code rather than key (5.75 KB, patch)
2023-02-02 16:19 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 32121: Show an alert when adding a checked out item to an item bundle (13.33 KB, patch)
2023-03-24 12:44 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 32121: (QA follow-up) Use error_code rather than key (5.75 KB, patch)
2023-03-24 12:44 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 32121: (QA follow-up): Fix unit tests count (677 bytes, patch)
2023-03-24 14:31 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 32121: Show an alert when adding a checked out item to an item bundle (13.38 KB, patch)
2023-03-24 14:45 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 32121: (QA follow-up) Use error_code rather than key (5.81 KB, patch)
2023-03-24 14:45 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 32121: (QA follow-up): Fix unit tests count (732 bytes, patch)
2023-03-24 14:45 UTC, Kyle M Hall
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Julian Maurice 2022-11-07 13:37:56 UTC

    
Comment 1 Julian Maurice 2022-11-07 13:39:03 UTC
Created attachment 143367 [details] [review]
Bug 32121: Show an alert when adding a checked out item to an item bundle

When trying to add a checked out item to an item bundle, an alert
message will show up, giving the user a chance to return the item
immediately before adding it to the bundle

Test plan:
1. Create an item bundle (see bug 28854 comment 458)
2. Create a biblio with one item and check out this item.
3. Try to add the checked out item to the bundle
   You should see a message saying that the item is checked out. Next to
   this message should be a button "Check in and add to bundle".
4. Click on the button. There should be a message saying that the item
   was added to the bundle.
5. Close the modal window and verify that the item was correctly
   returned and added to the bundle
Comment 2 Martin Renvoize 2023-02-02 16:19:51 UTC
Created attachment 146017 [details] [review]
Bug 32121: Show an alert when adding a checked out item to an item bundle

When trying to add a checked out item to an item bundle, an alert
message will show up, giving the user a chance to return the item
immediately before adding it to the bundle

Test plan:
1. Create an item bundle (see bug 28854 comment 458)
2. Create a biblio with one item and check out this item.
3. Try to add the checked out item to the bundle
   You should see a message saying that the item is checked out. Next to
   this message should be a button "Check in and add to bundle".
4. Click on the button. There should be a message saying that the item
   was added to the bundle.
5. Close the modal window and verify that the item was correctly
   returned and added to the bundle

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 3 Martin Renvoize 2023-02-02 16:19:56 UTC
Created attachment 146018 [details] [review]
Bug 32121: (QA follow-up) Use error_code rather than key

We semi-recently introduced error_code into our error object to allow
for translation and code paths for different errors without having to
rely on long description string matches.

This QA follow-up converts the existing match and new 'key' fields
introduced in this patchset to use the updated 'error_code' key.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 4 Martin Renvoize 2023-02-02 16:26:34 UTC
Sorry I didn't spot this earlier.. great piece of functionality; Had to do a minor rebase to get it to apply clean, nothing too scary.

I added a follow-up to convert from 'key' to 'error_code' as that's the direction we're headed I believe.

I also far prefer your construction of the result alerts.. makes my code look very amateurish!

Regarding choice of 409 vs 400 i'm never sure which to use.. perhaps 409 for 'resolvable conflicts' that trigger the option to resend with a condition and 400 for unresolvable one's where we show a harder error and no inline resolution option?

Finally.. tests.. I think we perhaps need some API tests to prevent regressions from creeping in with your addition of a new param on the endpoint?.. I'll leave that one for the QA person.
Comment 5 Kyle M Hall 2023-03-24 12:44:39 UTC
Created attachment 148659 [details] [review]
Bug 32121: Show an alert when adding a checked out item to an item bundle

When trying to add a checked out item to an item bundle, an alert
message will show up, giving the user a chance to return the item
immediately before adding it to the bundle

Test plan:
1. Create an item bundle (see bug 28854 comment 458)
2. Create a biblio with one item and check out this item.
3. Try to add the checked out item to the bundle
   You should see a message saying that the item is checked out. Next to
   this message should be a button "Check in and add to bundle".
4. Click on the button. There should be a message saying that the item
   was added to the bundle.
5. Close the modal window and verify that the item was correctly
   returned and added to the bundle

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 6 Kyle M Hall 2023-03-24 12:44:46 UTC
Created attachment 148660 [details] [review]
Bug 32121: (QA follow-up) Use error_code rather than key

We semi-recently introduced error_code into our error object to allow
for translation and code paths for different errors without having to
rely on long description string matches.

This QA follow-up converts the existing match and new 'key' fields
introduced in this patchset to use the updated 'error_code' key.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 7 Kyle M Hall 2023-03-24 14:31:34 UTC
Created attachment 148664 [details] [review]
Bug 32121: (QA follow-up): Fix unit tests count
Comment 8 Kyle M Hall 2023-03-24 14:45:46 UTC
Created attachment 148667 [details] [review]
Bug 32121: Show an alert when adding a checked out item to an item bundle

When trying to add a checked out item to an item bundle, an alert
message will show up, giving the user a chance to return the item
immediately before adding it to the bundle

Test plan:
1. Create an item bundle (see bug 28854 comment 458)
2. Create a biblio with one item and check out this item.
3. Try to add the checked out item to the bundle
   You should see a message saying that the item is checked out. Next to
   this message should be a button "Check in and add to bundle".
4. Click on the button. There should be a message saying that the item
   was added to the bundle.
5. Close the modal window and verify that the item was correctly
   returned and added to the bundle

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Comment 9 Kyle M Hall 2023-03-24 14:45:55 UTC
Created attachment 148668 [details] [review]
Bug 32121: (QA follow-up) Use error_code rather than key

We semi-recently introduced error_code into our error object to allow
for translation and code paths for different errors without having to
rely on long description string matches.

This QA follow-up converts the existing match and new 'key' fields
introduced in this patchset to use the updated 'error_code' key.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Comment 10 Kyle M Hall 2023-03-24 14:45:58 UTC
Created attachment 148669 [details] [review]
Bug 32121: (QA follow-up): Fix unit tests count

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Comment 11 Tomás Cohen Arazi 2023-03-27 10:47:24 UTC
Pushed to master for 23.05.

Nice work everyone, thanks!
Comment 12 Matt Blenkinsop 2023-04-11 10:49:41 UTC
Enhancement - not backporting to 22.11.x

Nice work everyone!
Comment 13 Martin Renvoize 2023-05-10 14:27:36 UTC
We've opted to upgrade this to bugfix and backport it now (some parts of it are needed for subsequent bugfixes that we want)
Comment 14 Jacob O'Mara 2023-05-10 15:00:40 UTC
Nice work, thanks everyone!

Pushed to 22.11.x for the next release.
Comment 15 Lucas Gass 2023-05-15 21:02:54 UTC
Missing dependencies for 22.05.x, no backport