We have the ability to 'clean' a staged file but it would be great if there was a way to batch delete (or barring that delete one by one) old batches. Today I saw a system with over 1700 of these batches and there is really no need to keep that much stuff. I'm thinking checkboxes next to each batch and then a 'clean' and a 'delete' button at the top of the page and you can choose one or the other. I should make you clean it before you delete it - kind of like deleting all items before deleting the bib record. Just some ideas I have. Nicole
Created attachment 49609 [details] [review] Bug 9259: Ability to delete a staged file once it has been cleaned To test: 1) Go to Tools -> Staged MARC Management and clean a file. If you have no files to clean, go to 'Stage MARC for import' and upload one to clean following the necessary steps. 2) Confirm that once the file has been cleaned, the Action column now shows a Delete button. Confirm this button only shows for cleaned files. 3) Click the Delete button. 4) Confirm that clicking Cancel exits the pop-up message and does not delete the file. 5) Confirm that clicking OK refreshes the list of staged records and the one you just deleted is no longer on it (has been deleted). You can confirm this by checking for the file in mysql (SELECT * FROM import_batches WHERE import_batch_id = X;) Sponsored-by: Catalyst IT
Created attachment 49746 [details] [review] Bug 9259: Ability to delete a staged file once it has been cleaned To test: 1) Go to Tools -> Staged MARC Management and clean a file. If you have no files to clean, go to 'Stage MARC for import' and upload one to clean following the necessary steps. 2) Confirm that once the file has been cleaned, the Action column now shows a Delete button. Confirm this button only shows for cleaned files. 3) Click the Delete button. 4) Confirm that clicking Cancel exits the pop-up message and does not delete the file. 5) Confirm that clicking OK refreshes the list of staged records and the one you just deleted is no longer on it (has been deleted). You can confirm this by checking for the file in mysql (SELECT * FROM import_batches WHERE import_batch_id = X;) Sponsored-by: Catalyst IT Signed-off-by: Liz Rea <liz@catalyst.net.nz> Catalyst sign off, so needs another one but YAY this is great.
I wish we had a better icon for the "clean" button. One of the problems with using Font Awesome is that we're kinda stuck if we don't have just the right thing. I'm not sure what the rules are... Do the changes to C4/ImportBatch.pm require a test?
Yes, a new routine should be unit tested. - Aleisha, can you please take a look?
What about the eraser icon instead? http://fontawesome.io/icon/eraser/
(In reply to Owen Leonard from comment #5) > What about the eraser icon instead? > > http://fontawesome.io/icon/eraser/ Looks good to me!
(In reply to Katrin Fischer from comment #6) > (In reply to Owen Leonard from comment #5) > > What about the eraser icon instead? > > > > http://fontawesome.io/icon/eraser/ > > Looks good to me! Agreed, will continue with this asap!
Created attachment 53007 [details] [review] Bug 9259: Ability to delete a staged file once it has been cleaned To test: 1) Go to Tools -> Staged MARC Management and clean a file. If you have no files to clean, go to 'Stage MARC for import' and upload one to clean following the necessary steps. 2) Confirm that once the file has been cleaned, the Action column now shows a Delete button. Confirm this button only shows for cleaned files. 3) Click the Delete button. 4) Confirm that clicking Cancel exits the pop-up message and does not delete the file. 5) Confirm that clicking OK refreshes the list of staged records and the one you just deleted is no longer on it (has been deleted). You can confirm this by checking for the file in mysql (SELECT * FROM import_batches WHERE import_batch_id = X;) 6) Run prove -v t/db_dependent/ImportBatch.t (have written unit tests for CleanBatch and DeleteBatch) Sponsored-by: Catalyst IT Signed-off-by: Liz Rea <liz@catalyst.net.nz> Catalyst sign off, so needs another one but YAY this is great.
Created attachment 53116 [details] [review] Bug 9259: Ability to delete a staged file once it has been cleaned To test: 1) Go to Tools -> Staged MARC Management and clean a file. If you have no files to clean, go to 'Stage MARC for import' and upload one to clean following the necessary steps. 2) Confirm that once the file has been cleaned, the Action column now shows a Delete button. Confirm this button only shows for cleaned files. 3) Click the Delete button. 4) Confirm that clicking Cancel exits the pop-up message and does not delete the file. 5) Confirm that clicking OK refreshes the list of staged records and the one you just deleted is no longer on it (has been deleted). You can confirm this by checking for the file in mysql (SELECT * FROM import_batches WHERE import_batch_id = X;) 6) Run prove -v t/db_dependent/ImportBatch.t (have written unit tests for CleanBatch and DeleteBatch) Sponsored-by: Catalyst IT Signed-off-by: Liz Rea <liz@catalyst.net.nz> Catalyst sign off, so needs another one but YAY this is great. Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
This is great! I think missing form what was requested is the ability to do this to multiple batches at once (batches of import batches) I can open a new bug and retitle this one if that makes the most sense, unless you want to build that functionality in too?
(In reply to Nick Clemens from comment #10) > This is great! I think missing form what was requested is the ability to do > this to multiple batches at once (batches of import batches) > > I can open a new bug and retitle this one if that makes the most sense, > unless you want to build that functionality in too? Please file a new bug for that and I'll work on it. Would like to get this one tested and passed since it's been around for a while :)
Created attachment 53139 [details] [review] Bug 9259: Ability to delete a staged file once it has been cleaned To test: 1) Go to Tools -> Staged MARC Management and clean a file. If you have no files to clean, go to 'Stage MARC for import' and upload one to clean following the necessary steps. 2) Confirm that once the file has been cleaned, the Action column now shows a Delete button. Confirm this button only shows for cleaned files. 3) Click the Delete button. 4) Confirm that clicking Cancel exits the pop-up message and does not delete the file. 5) Confirm that clicking OK refreshes the list of staged records and the one you just deleted is no longer on it (has been deleted). You can confirm this by checking for the file in mysql (SELECT * FROM import_batches WHERE import_batch_id = X;) 6) Run prove -v t/db_dependent/ImportBatch.t (have written unit tests for CleanBatch and DeleteBatch) Sponsored-by: Catalyst IT Signed-off-by: Liz Rea <liz@catalyst.net.nz> Catalyst sign off, so needs another one but YAY this is great. Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Created attachment 53140 [details] [review] Bug 9259: Use is instead of is_deeply Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
To enhance: Maybe DeleteBatch should check if the batch has been cleaned before deleting it. Note that the patch is not perfect but follow the existing pattern of this module.
(In reply to Jonathan Druart from comment #14) > To enhance: > Maybe DeleteBatch should check if the batch has been cleaned before deleting > it. > I thought about this, but the DeleteBatch function can only be called if the status has been set to cleaned (the user can't see the button), so thought I could get away with skipping that :)
Pushed to master for 16.11, thanks Aleisha, Jonathan!
+1 Aleisha this is very, very great
Pushed in 16.05. Will be in 16.05.02.