From 3db7cc437b640959b24690769c5b01859538d1a3 Mon Sep 17 00:00:00 2001 From: zmagod Date: Thu, 10 May 2018 13:52:01 +0200 Subject: [PATCH] fixes error message for invalid file type [fixes SCI-2337] --- .../javascripts/repositories/repository_datatable.js.erb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/assets/javascripts/repositories/repository_datatable.js.erb b/app/assets/javascripts/repositories/repository_datatable.js.erb index 9e9eaf408..35bdd6a03 100644 --- a/app/assets/javascripts/repositories/repository_datatable.js.erb +++ b/app/assets/javascripts/repositories/repository_datatable.js.erb @@ -781,9 +781,10 @@ var RepositoryDatatable = (function(global) { $.each(val, function(key, val) { var input = $(selectedRecord).find('input[name=' + key + ']'); if (input) { + var message = Array.isArray(val.data) ? val.data[0] : val.data; input.closest('.form-group').addClass('has-error'); input.parent().append("" + - val.data[0] + '
'); + message + '
'); } }); });