feat(editor): editor prestatii unificat in modal - un select, un rand de chips (PRD 5.23)
Inlocuieste cele 3 controale de asociere cod RAR cu un singur rand de chips + un singur select care adauga instant la change. Stare = un hidden chips_state JSON versionat; post_form_chips redus la 2 actiuni (add/remove). Optgroup Sugestii (fuzzy/k-NN) + optiune "Nu se declara la RAR" in select, cu tinta implicita evidentiata si placeholder care o numeste. exclus persistat prin payload_json (treapta noua de precedenta in resolve_prestatii, round-trip complet). Siguranta: itemii exclusi sunt scosi din payload la momentul trimiterii (worker split_prestatii_excluse inainte de build_rar_payload + filtru defensiv), ca sa nu ajunga NICIODATA la RAR ca codPrestatie:null. Suita: 1680 passed, 1 skipped. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -280,8 +280,8 @@ def test_optional_nu_forteaza(client):
|
||||
def test_fara_select_vechi_redundant(client):
|
||||
"""Detaliu needs_data NU mai contine <select name='cod_prestatie'>.
|
||||
|
||||
Formularul editabil foloseste NUMAI chips (hidden inputs cod_prestatie),
|
||||
fara vechiul select dublu. Chips functioneaza ca singura sursa de cod_prestatie.
|
||||
Formularul editabil foloseste NUMAI chips (stare in hidden name='chips_state',
|
||||
JSON versionat, PRD 5.23), fara vechiul select dublu.
|
||||
|
||||
Nota: <select name="cod_prestatie"> RAMANE in formularul /repune pentru starea error.
|
||||
"""
|
||||
@@ -302,15 +302,14 @@ def test_fara_select_vechi_redundant(client):
|
||||
assert resp.status_code == 200
|
||||
html = resp.text
|
||||
|
||||
# Chipurile trebuie sa fie prezente (hidden input cu name="cod_prestatie")
|
||||
has_chip_hidden = (
|
||||
re.search(r'<input[^>]+type=["\']hidden["\'][^>]+name=["\']cod_prestatie["\']', html) or
|
||||
re.search(r'<input[^>]+name=["\']cod_prestatie["\'][^>]+type=["\']hidden["\']', html)
|
||||
)
|
||||
# Chipurile trebuie sa fie prezente (hidden input cu name="chips_state", JSON versionat)
|
||||
has_chip_hidden = re.search(r'<input[^>]+type=["\']hidden["\'][^>]+name=["\']chips_state["\']', html)
|
||||
assert has_chip_hidden, (
|
||||
"Chips: trebuie sa existe input hidden cu name='cod_prestatie' (din _chips_prestatii.html). "
|
||||
"Chips: trebuie sa existe input hidden cu name='chips_state' (din _chips_prestatii.html). "
|
||||
f"html[:600]={html[:600]}"
|
||||
)
|
||||
# Cod-ul OE-1 trebuie sa apara in stare (JSON), nu ca input separat
|
||||
assert "OE-1" in html, f"OE-1 trebuie sa apara in chips_state. html[:600]={html[:600]}"
|
||||
|
||||
# Vechiul <select name="cod_prestatie"> NU trebuie sa existe in sectiunea editabila.
|
||||
# (needs_data nu are formular /repune, deci niciun select cu name="cod_prestatie" legal)
|
||||
|
||||
Reference in New Issue
Block a user