loadProductionRun mostra il detail del server; START ACTIVITY in inglese (#61 #62)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-07 12:26:33 +02:00
parent 27dc5e77af
commit 2d03577165
3 changed files with 7 additions and 3 deletions
@@ -1249,8 +1249,10 @@ function taskExecute() {
try { try {
const resp = await fetch('{{ url_for("measure.api_current_production") }}'); const resp = await fetch('{{ url_for("measure.api_current_production") }}');
if (!resp.ok) { if (!resp.ok) {
// #61: l'errore si mostra, non si ignora // #61: si mostra il detail del server (es. 503 "Stazione non configurata"),
this.productionError = '{{ _("Errore di comunicazione con il server") }}'; // 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; return;
} }
const run = await resp.json(); const run = await resp.json();
@@ -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) html = _execute_page(logged_in_client, mock_api_client, monkeypatch)
assert 'x-if="isMeasureTask && productionRun"' in html assert 'x-if="isMeasureTask && productionRun"' in html
assert "!this.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 assert "Nessuna produzione aperta su questa stazione" in html
# il vecchio ripiego locale non c'e' piu' # il vecchio ripiego locale non c'e' piu'
assert "this.startCountdownFrom(this.measurementIntervalMinutes * 60)" not in html.split( assert "this.startCountdownFrom(this.measurementIntervalMinutes * 60)" not in html.split(
@@ -1863,7 +1863,7 @@ msgstr "No description available"
#: templates/measure/select_recipe.html:294 #: templates/measure/select_recipe.html:294
#: templates/measure/task_list.html:107 #: templates/measure/task_list.html:107
msgid "AVVIA ATTIVITÀ" msgid "AVVIA ATTIVITÀ"
msgstr "START THE SEQUENCE" msgstr "START ACTIVITY"
# Maker - Task Editor # Maker - Task Editor
#: templates/measure/select_recipe.html:302 #: templates/measure/select_recipe.html:302