From 9d48cbbb8619972d36fa78827ea57abf51a5b282 Mon Sep 17 00:00:00 2001 From: ajugo Date: Wed, 31 Jan 2024 11:10:11 +0100 Subject: [PATCH] Improve error handling for label printing [SCI-10039] (#6997) --- app/assets/javascripts/sitewide/zebra_print.js | 4 +++- .../vue/repository_print_modal/container.vue | 14 ++++++++++++-- .../label_templates/repository_row_service.rb | 2 +- config/locales/en.yml | 1 + 4 files changed, 17 insertions(+), 4 deletions(-) diff --git a/app/assets/javascripts/sitewide/zebra_print.js b/app/assets/javascripts/sitewide/zebra_print.js index 25d94b5d1..b5dc1d20b 100644 --- a/app/assets/javascripts/sitewide/zebra_print.js +++ b/app/assets/javascripts/sitewide/zebra_print.js @@ -1,6 +1,6 @@ /* eslint-disable no-param-reassign */ /* eslint-disable no-undef */ -/* global I18n */ +/* global HelperModule I18n */ /* eslint-disable no-unused-vars, no-use-before-define */ /* config = { @@ -218,6 +218,8 @@ var zebraPrint = (function() { updateProgressModalData(progressModal, printData.printer_name, PRINTER_STATUS_ERROR, PRINTER_STATUS_ERROR); } }); + }).fail(() => { + HelperModule.flashAlertMsg(I18n.t('repository_row.modal_print_label.general_error'), 'danger'); }); } }; diff --git a/app/javascript/vue/repository_print_modal/container.vue b/app/javascript/vue/repository_print_modal/container.vue index bcd560ffb..4b437b0ab 100644 --- a/app/javascript/vue/repository_print_modal/container.vue +++ b/app/javascript/vue/repository_print_modal/container.vue @@ -91,6 +91,8 @@