@@ -, +, @@ mapping - create a new search field, save, - you create a mapping using it (don't save), - check that you can't delete the search field. - delete all the mapping related to a search field (don't save) - check that you can delete this search field. --- .../en/modules/admin/searchengine/elasticsearch/mappings.tt | 10 ++++++++++ 1 file changed, 10 insertions(+) --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/searchengine/elasticsearch/mappings.tt +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/searchengine/elasticsearch/mappings.tt @@ -26,6 +26,11 @@ $(document).ready(function() { $("#tabs").tabs(); $('.delete').click(function() { + var line = $(this).closest("tr"); + var search_field_name = $(line).find('input[name="mapping_search_field_name"]').val(); + var search_field_line = $('input[name="search_field_name"][value="' + search_field_name + '"]').closest("tr"); + $(search_field_line).find('a.btn-default').removeClass('disabled'); + $(this).parents('tr').remove(); }); @@ -43,6 +48,11 @@ $('.delete').click(function() { $(this).parents('tr').remove(); }); + + var search_field_name = $(line).find('select[data-id="mapping_search_field_name"] option:selected').text(); + var search_field_line = $('input[name="search_field_name"][value="' + search_field_name + '"]').closest("tr"); + $(search_field_line).find('a.btn-default').addClass('disabled'); + clean_line(line); $(table).tableDnD( { --