fix(5.11): tabel trimiteri stabil — bug status=None, pills in bara de filtre, nudge "Date noi" in loc de poll 15s, logo ROMFAST marit
- Fix bug: campul hidden de filtru randa literal "None" (status_filtru None +
Jinja default('')) -> poll-ul trimitea status=None -> tabel gol. status or "".
- Pills de stare mutate din bara de status in bara de filtre (filtreazaStare scrie
campul hidden + re-trimite form-ul; filtrul persista la reincarcari). Re-randate
OOB cu contoare proaspete la fiecare reincarcare a tabelului.
- Polling redesign: tabelul nu se mai reincarca singur (fara every 15s). Poller usor
JSON (/_fragments/trimiteri-versiune) detecteaza schimbari -> nudge "Date noi —
Reincarca". Reincarcarea (nudge / actiune) pastreaza filtrul+pagina. Scroll/selectia
nu se mai pierd. Poll-guard eliminat (nu mai exista poll periodic de pauzat).
- Logo ROMFAST 32px -> 60px (ca pe romfast.ro), header min-height 92px, 44px pe mobil.
Regresie: 896 passed, 1 deselected.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -84,25 +84,24 @@ def test_pill_per_categorie_cu_numar(client):
|
||||
_ins(acct, status="sent", vin="WVIN_SE1_001", nr="BSE1")
|
||||
_login(client, "pill1@test.com")
|
||||
|
||||
resp = client.get("/_fragments/status")
|
||||
# Pill-urile traiesc in bara de filtre din sectiunea Trimiteri.
|
||||
resp = client.get("/?tab=acasa")
|
||||
assert resp.status_code == 200
|
||||
body = resp.text
|
||||
|
||||
# Pill-urile sunt elemente <button> (nu <span onclick>)
|
||||
# Pill-urile sunt elemente <button>
|
||||
assert "<button" in body, "Pill-urile trebuie sa fie elemente <button>"
|
||||
|
||||
# Fiecare categorie problemativa apare ca pill
|
||||
assert "needs_data" in body, "Pill needs_data trebuie sa apara"
|
||||
assert "needs_mapping" in body, "Pill needs_mapping trebuie sa apara"
|
||||
assert "error" in body, "Pill error trebuie sa apara (hx-get sau text)"
|
||||
assert 'data-status="needs_data"' in body, "Pill needs_data trebuie sa apara"
|
||||
assert 'data-status="needs_mapping"' in body, "Pill needs_mapping trebuie sa apara"
|
||||
assert 'data-status="error"' in body, "Pill error trebuie sa apara"
|
||||
|
||||
# Contoarele sunt afisate in pill-uri
|
||||
assert ">2<" in body or "2<" in body, "Contorul 2 pt needs_data trebuie vizibil in pill"
|
||||
|
||||
# Starea 'sent' nu produce pill (nu e categorie de problema)
|
||||
# (nu exista un pill cu status=sent in bara de status)
|
||||
pill_sent_count = body.count("status=sent")
|
||||
assert pill_sent_count == 0, "Nu trebuie pill pentru sent in bara de status"
|
||||
assert 'data-status="sent"' not in body, "Nu trebuie pill pentru sent"
|
||||
|
||||
|
||||
def test_pill_click_seteaza_status(client):
|
||||
@@ -113,21 +112,21 @@ def test_pill_click_seteaza_status(client):
|
||||
_ins(acct, status="error", vin="WVIN_ER2_001", nr="BER_P2a")
|
||||
_login(client, "pill2@test.com")
|
||||
|
||||
resp = client.get("/_fragments/status")
|
||||
resp = client.get("/?tab=acasa")
|
||||
assert resp.status_code == 200
|
||||
body = resp.text
|
||||
|
||||
# Fiecare pill are atribut hx-get cu parametrul status corespunzator
|
||||
assert "status=needs_data" in body, "Pill needs_data trebuie sa aiba ?status=needs_data in hx-get"
|
||||
assert "status=needs_mapping" in body, "Pill needs_mapping trebuie sa aiba ?status=needs_mapping in hx-get"
|
||||
assert "status=error" in body, "Pill error trebuie sa aiba ?status=error in hx-get"
|
||||
# Fiecare pill scrie campul de filtru prin filtreazaStare(this, 'X')
|
||||
assert "filtreazaStare(this, 'needs_data')" in body, "Pill needs_data trebuie sa apeleze filtreazaStare cu needs_data"
|
||||
assert "filtreazaStare(this, 'needs_mapping')" in body, "Pill needs_mapping trebuie sa apeleze filtreazaStare cu needs_mapping"
|
||||
assert "filtreazaStare(this, 'error')" in body, "Pill error trebuie sa apeleze filtreazaStare cu error"
|
||||
|
||||
# Pill-urile au aria-pressed pentru accesibilitate (WCAG)
|
||||
assert "aria-pressed" in body, "Pill-urile trebuie sa aiba atribut aria-pressed"
|
||||
|
||||
# Target-ul este tabelul de trimiteri
|
||||
assert "submissions-wrap" in body or "_fragments/submissions" in body, (
|
||||
"Pill-urile trebuie sa targeteze #submissions-wrap sau sa apeleze /_fragments/submissions"
|
||||
# Filtrarea trece prin form-ul care targeteaza tabelul de trimiteri
|
||||
assert "submissions-wrap" in body and "_fragments/submissions" in body, (
|
||||
"Form-ul de filtre trebuie sa targeteze #submissions-wrap prin /_fragments/submissions"
|
||||
)
|
||||
|
||||
|
||||
@@ -161,7 +160,7 @@ def test_pill_needs_mapping_culoare_warn(client):
|
||||
_ins(acct, status="needs_mapping", vin="WVIN_NM_WARN0001", nr="BNMW1")
|
||||
_login(client, "warn@test.com")
|
||||
|
||||
resp = client.get("/_fragments/status")
|
||||
resp = client.get("/?tab=acasa")
|
||||
assert resp.status_code == 200
|
||||
body = resp.text
|
||||
|
||||
@@ -169,4 +168,4 @@ def test_pill_needs_mapping_culoare_warn(client):
|
||||
assert "var(--warn)" in body, (
|
||||
"Pill needs_mapping trebuie sa foloseasca var(--warn) conform DESIGN.md §Componente"
|
||||
)
|
||||
assert "status=needs_mapping" in body, "Pill needs_mapping trebuie sa fie prezent in bara"
|
||||
assert 'data-status="needs_mapping"' in body, "Pill needs_mapping trebuie sa fie prezent in bara de filtre"
|
||||
|
||||
Reference in New Issue
Block a user