From 4b837dbe9dbc6ea8da60ef59738a31702e7bf2e2 Mon Sep 17 00:00:00 2001 From: Zanz2 Date: Fri, 27 Oct 2017 00:17:42 +0200 Subject: [PATCH] Forgot flash fail messagges, now added them for file too big and general error --- app/views/protocols/protocolsio_import_create.js.erb | 5 +++-- app/views/protocols/protocolsio_import_save.js.erb | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/app/views/protocols/protocolsio_import_create.js.erb b/app/views/protocols/protocolsio_import_create.js.erb index ba20d05c3..b9dbd0cd5 100644 --- a/app/views/protocols/protocolsio_import_create.js.erb +++ b/app/views/protocols/protocolsio_import_create.js.erb @@ -1,7 +1,8 @@ <% if @protocolsio_too_big %> -alert('<%= I18n.t('my_modules.protocols.load_from_file_size_error', - size: Constants::FILE_MAX_SIZE_MB ) %>'); +$('#modal-import-json-protocol').modal('hide'); +HelperModule.flashAlertMsg(' <%= t('my_modules.protocols.load_from_file_size_error', + size: Constants::FILE_MAX_SIZE_MB ) %>','danger'); <% else %> $('#modal-import-json-protocol').modal('hide'); <% if remotipart_submitted? %> <%# a workaround to a bug with remotipart, that caused alot of headache, courtesy of github.com/dhampik %> diff --git a/app/views/protocols/protocolsio_import_save.js.erb b/app/views/protocols/protocolsio_import_save.js.erb index 6fa532567..5566d0f54 100644 --- a/app/views/protocols/protocolsio_import_save.js.erb +++ b/app/views/protocols/protocolsio_import_save.js.erb @@ -1,6 +1,7 @@ <% if @protocolsio_general_error %> - alert('<%= t('my_modules.protocols.load_from_file_protocol_general_error', - max: Constants::NAME_MAX_LENGTH, min: Constants::NAME_MIN_LENGTH) %>'); +$('#modal-import-json-protocol-preview').modal('hide'); + HelperModule.flashAlertMsg(' <%= t('my_modules.protocols.load_from_file_protocol_general_error', + max: Constants::NAME_MAX_LENGTH, min: Constants::NAME_MIN_LENGTH) %>', 'danger'); <% else %> $('#modal-import-json-protocol-preview').modal('hide'); $('#protocols_io_form').trigger("reset");