Bug 23019: Add profiles to stage-import-batch and magnage-import-batch pages
authorAgustin Moyano <agustinmoyano@theke.io>
Fri, 15 May 2020 14:09:49 +0000 (11:09 -0300)
committerJonathan Druart <jonathan.druart@bugs.koha-community.org>
Wed, 11 Nov 2020 14:55:49 +0000 (15:55 +0100)
commit8b3a1085587d3275a95a5a1a4a84591e6f3ed034
tree09acf4a2a6c3de7581273c1b1cdd0ce62ad65e46
parent4685b3de0b7433f338a617713fac66562fb3a53c
Bug 23019: Add profiles to stage-import-batch and magnage-import-batch pages

This patch adds the logic and the needed UI elements to be able to pre-load an import profile. It also displays which profile was used to stage an import in staged import manager.

To test:
1. Apply all patches
2. Updatedatabase
3. Go to Stage MARC records for Import tool in admin, and upload a file with MARC records.
CHECK => after uploading, there is a fieldset with the legend “Profile settings”
              => inside the fieldset there is a select labeled “Pre fill values with profile”. The only value it has is “Do not use profile”.

4. Change some settings, and set “profile 1” as profile name and click on “Add profile”
SUCCESS => The select now has the new profile selected

5. Change profile select to “Do not use profile”
SUCCESS => Default values are now displayed in the form

6. Reload the page and upload the file again
SUCCESS => the select still has the profile recently added

7. Select the profile, change some parameter in the form and set the profile name to “profile 2”, and click add profile
SUCCESS => there are two profiles now, and if you toggle between them, the parameter changes

8. Select profile 1, change one parameter and click on update profile
SUCCESS => if you toggle that profile with the other, the new parameter of the value is shown when you select profile 1

9. Select profile 2, change some parameter and click Add profile (leaving the name as profile 2)
SUCCESS => the page complains there is another profile with the same name, and asks if you want to replace it.

10. Click on accept
SUCCESS => profile 2 now has the new value in the parameter

11. Select profile 2 and change the name to profile 1
SUCCESS => the page complains there is another profile with that name, and asks if you want to replace it

12. Click on accept
SUCCESS => in profile select there is only one profile called profile 1 that has the values of profile 2

13. Select profile 1 and click remove profile
SUCCESS => there is no profile in profile select.

14. Create a profile and click on “Stage for import”
15. Go to Staged MARC management page
SUCCESS => Improt should have the name of the profile in profile column, and when you click on the file name, there should be the name of the profile in the details.

16. prove t/db_dependent/ImportBatch.t t/db_dependent/api/v1/import_batch_profiles.t
17. Sign off

Signed-off-by: Abbey Holt <aholt@dubuque.lib.ia.us>
Signed-off-by: Abbey Holt <aholt@dubuque.lib.ia.us>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
17 files changed:
C4/ImportBatch.pm
Koha/ImportBatch.pm [new file with mode: 0644]
Koha/ImportBatchProfile.pm [new file with mode: 0644]
Koha/ImportBatchProfiles.pm [new file with mode: 0644]
Koha/ImportBatches.pm [new file with mode: 0644]
Koha/REST/V1/ImportBatchProfiles.pm [new file with mode: 0644]
api/v1/swagger/definitions.json
api/v1/swagger/definitions/import-batch-profile.json [new file with mode: 0644]
api/v1/swagger/definitions/import-batch-profiles.json [new file with mode: 0644]
api/v1/swagger/parameters.json
api/v1/swagger/parameters/import-batch-profile.json [new file with mode: 0644]
api/v1/swagger/paths.json
api/v1/swagger/paths/import-batch-profiles.json [new file with mode: 0644]
koha-tmpl/intranet-tmpl/prog/en/modules/tools/manage-marc-import.tt
koha-tmpl/intranet-tmpl/prog/en/modules/tools/stage-marc-import.tt
tools/manage-marc-import.pl
tools/stage-marc-import.pl