diff --git a/src/frontend/flask_app/templates/measure/task_execute.html b/src/frontend/flask_app/templates/measure/task_execute.html index 0e75aa6..35d0e0c 100644 --- a/src/frontend/flask_app/templates/measure/task_execute.html +++ b/src/frontend/flask_app/templates/measure/task_execute.html @@ -1249,8 +1249,10 @@ function taskExecute() { try { const resp = await fetch('{{ url_for("measure.api_current_production") }}'); if (!resp.ok) { - // #61: l'errore si mostra, non si ignora - this.productionError = '{{ _("Errore di comunicazione con il server") }}'; + // #61: si mostra il detail del server (es. 503 "Stazione non configurata"), + // che e' la causa vera; fallback generico se il corpo non e' JSON. + const errBody = await resp.json().catch(() => null); + this.productionError = (errBody && errBody.detail) || '{{ _("Errore di comunicazione con il server") }}'; return; } const run = await resp.json(); diff --git a/src/frontend/flask_app/tests/test_operator_flow_ui.py b/src/frontend/flask_app/tests/test_operator_flow_ui.py index a8beca0..3056bdc 100644 --- a/src/frontend/flask_app/tests/test_operator_flow_ui.py +++ b/src/frontend/flask_app/tests/test_operator_flow_ui.py @@ -181,6 +181,8 @@ def test_no_open_run_means_no_fermo_linea_and_no_fake_timer( html = _execute_page(logged_in_client, mock_api_client, monkeypatch) assert 'x-if="isMeasureTask && productionRun"' in html assert "!this.productionRun" in html + # #61: loadProductionRun mostra il detail del server, non solo il messaggio generico + assert "errBody.detail" in html assert "Nessuna produzione aperta su questa stazione" in html # il vecchio ripiego locale non c'e' piu' assert "this.startCountdownFrom(this.measurementIntervalMinutes * 60)" not in html.split( diff --git a/src/frontend/flask_app/translations/en/LC_MESSAGES/messages.po b/src/frontend/flask_app/translations/en/LC_MESSAGES/messages.po index 3fbb4c0..cc5fbef 100644 --- a/src/frontend/flask_app/translations/en/LC_MESSAGES/messages.po +++ b/src/frontend/flask_app/translations/en/LC_MESSAGES/messages.po @@ -1863,7 +1863,7 @@ msgstr "No description available" #: templates/measure/select_recipe.html:294 #: templates/measure/task_list.html:107 msgid "AVVIA ATTIVITÀ" -msgstr "START THE SEQUENCE" +msgstr "START ACTIVITY" # Maker - Task Editor #: templates/measure/select_recipe.html:302