From 3ff35f849b5b784801806e18b2b9498b414bbd59 Mon Sep 17 00:00:00 2001 From: Luis Aleixo Date: Wed, 28 Sep 2022 11:18:34 +0200 Subject: [PATCH] added DOM element for ARVE API authentication error --- caimira/apps/calculator/static/js/form.js | 5 +++-- caimira/apps/templates/cern/calculator.form.html.j2 | 3 ++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/caimira/apps/calculator/static/js/form.js b/caimira/apps/calculator/static/js/form.js index cfd23c64..45656c78 100644 --- a/caimira/apps/calculator/static/js/form.js +++ b/caimira/apps/calculator/static/js/form.js @@ -332,8 +332,9 @@ function show_sensors_data(url) { } }, error: function(_, _, errorThrown) { - if (errorThrown != 'Unauthorized') alert(errorThrown); - else alert('Unauthorized - Something went wrong during the ARVE API authentication process.'); + $("#arve_api_error_message").val(errorThrown).show(); + $('#DIVsensors_data').hide(); + $('#arve_sensor_yes').prop('disabled', true) } }); } diff --git a/caimira/apps/templates/cern/calculator.form.html.j2 b/caimira/apps/templates/cern/calculator.form.html.j2 index 7a2f418a..4e5ae90a 100644 --- a/caimira/apps/templates/cern/calculator.form.html.j2 +++ b/caimira/apps/templates/cern/calculator.form.html.j2 @@ -15,7 +15,8 @@ -