From ed85bbc9bfb747b663b377641c955b8911b6919c Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Thu, 18 Nov 2021 18:47:32 +0000 Subject: [PATCH] Bug 27904: Improve display in creating profile for staging MARC records for import This patch updates the Stage MARC records for import page, in particular the format of the part of the form for saving or removing a profile. The page moves these controls into their own fieldset so that it is clear they are separate from the "Stage for import" button. The "Remove" control now includes the name of the profile which will be removed. To test, apply the patch and go to Tools -> Stage MARC for import. - Upload a file of records. - Make some changes to the settings and options. - At the bottom of the form you should see a "Save profile" fieldset. - Confirm that the "Save profile" button becomes enabled if you type something in the field (or paste something, or select something from form history). - Confirm that the profile is saved correctly by re-uploading a MARC file and selecting your newly added/edited profile and confirming that the values are set as expected. - In the "Save profile" section there should be a "Remove" link styled with a Bootstrap "trash" icon: "Remove profile: " - Confirm that profile deletion still works correctly. - Confirm that the "Remove" link is updated correctly when you make a selection from the "Profile" dropdown at the top of the form: - Choosing "Do not use profile" should change the "Remove" link to drop the name of the profile and disable the link. - Choosing different profiles should update the name in the "Remove" link. Signed-off-by: Barbara Johnson --- .../en/modules/tools/stage-marc-import.tt | 20 +++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/stage-marc-import.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/stage-marc-import.tt index 7877265d90..39ef0fa4f1 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/stage-marc-import.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/stage-marc-import.tt @@ -237,11 +237,21 @@ + +
+ Save profile +
    +
  1. + + + + +
  2. +
+
+
- - -
Job progress:
0%
@@ -306,10 +316,12 @@ $("#parse_itemsyes").prop("checked", true).change(); $("#item_action").val('always_add').change(); $("#profile_name").val('').keyup(); + $("#del_profile span").text( _("Remove profile") ); } else { const profile = $('option:selected', this).data('profile'); $("#profile_id").val(profile.profile_id); $("#mod_profile, #del_profile").prop("disabled", null); + $("#del_profile span").text( _("Remove profile") + ": " + profile.name ); $("#comments").val(profile.comments); $("#record_type").val(profile.record_type).change(); $("#encoding").val(profile.encoding).change(); @@ -324,7 +336,7 @@ } }); - $("#profile_name").keyup(function(){ + $("#profile_name").on("change keyup", function(){ $("#add_profile").prop("disabled", this.value.trim()==''); }); -- 2.20.1