Compare commits

...

3 Commits

8 changed files with 20 additions and 15 deletions

View File

@@ -110,4 +110,4 @@ docker compose exec postgres pg_dump -U miem miem_workers > backup.sql
docker compose down
```
Версия сервиса: `0.2.3`. Админка всегда показывает версии backend и frontend в footer.
Версия сервиса: `0.2.5`. Админка всегда показывает версии backend и frontend в footer.

View File

@@ -59,7 +59,7 @@ def employee_detail_payload(employee: Employee) -> dict[str, Any]:
"emails": _clean_list(contacts.get("emails")),
"phones": _clean_list(contacts.get("phones")),
"address": contacts.get("address"),
"items": _normalize_contact_items(contacts.get("items")),
"contact_items": _normalize_contact_items(contacts.get("items")),
},
"external_ids": _normalize_external_ids(data.get("external_ids")),
"sections": [_normalize_section(section) for section in _as_list(data.get("sections"))],
@@ -121,7 +121,7 @@ def list_employees_page(
order = desc(sort_column) if direction == "desc" else sort_column
employees = db.scalars(base_stmt.order_by(order).limit(limit).offset(offset)).all()
return {
"items": [employee_display_payload(employee) for employee in employees],
"employees": [employee_display_payload(employee) for employee in employees],
"total": total,
"limit": limit,
"offset": offset,
@@ -243,7 +243,7 @@ def _normalize_section(section: Any) -> dict[str, Any]:
"type": section_type,
"raw_text": raw_text,
"paragraphs": paragraphs,
"items": items,
"list_items": items,
"links": _normalize_links(section.get("links")),
"year_entries": _normalize_year_entries(section.get("year_entries")),
"publications": _normalize_publications(section.get("publications")),

View File

@@ -56,7 +56,7 @@
</tr>
</thead>
<tbody>
{% for employee in page.items %}
{% for employee in page.employees %}
<tr class="directory-table__row" data-row-href="/admin/employees/{{ employee.id }}">
<td class="directory-table__cell" data-column="full_name">{{ employee.full_name or "No name" }}</td>
<td class="directory-table__cell" data-column="status"><span class="badge {% if employee.status == "dismissed" %}badge--dismissed{% endif %}">{{ employee.status }}</span></td>

View File

@@ -62,12 +62,12 @@
<dt class="employee-card__meta-label">Адрес</dt>
<dd class="employee-card__meta-value">{{ employee_view.contacts.address or "Не указано" }}</dd>
</div>
{% if employee_view.contacts.items %}
{% if employee_view.contacts.contact_items %}
<div class="employee-card__meta-item employee-card__meta-item--wide">
<dt class="employee-card__meta-label">Прочее</dt>
<dd class="employee-card__meta-value">
<ul class="employee-card__list">
{% for item in employee_view.contacts.items %}
{% for item in employee_view.contacts.contact_items %}
<li class="employee-card__list-item">{{ item }}</li>
{% endfor %}
</ul>
@@ -162,9 +162,9 @@
<p class="employee-section__text">{{ paragraph }}</p>
{% endfor %}
{% endif %}
{% if section.items %}
{% if section.list_items %}
<ul class="employee-card__list">
{% for item in section.items %}
{% for item in section.list_items %}
<li class="employee-card__list-item">{{ item }}</li>
{% endfor %}
</ul>

View File

@@ -1,3 +1,3 @@
APP_VERSION = "0.2.3"
FRONTEND_VERSION = "0.2.3"
BACKEND_VERSION = "0.2.3"
APP_VERSION = "0.2.5"
FRONTEND_VERSION = "0.2.5"
BACKEND_VERSION = "0.2.5"

View File

@@ -86,7 +86,7 @@ def test_employee_detail_payload_normalizes_human_readable_sections(db_session):
payload = employee_detail_payload(employee)
assert payload["contacts"]["emails"] == ["person@hse.ru"]
assert payload["contacts"]["items"] == ["consultation hours"]
assert payload["contacts"]["contact_items"] == ["consultation hours"]
assert payload["external_ids"][0]["system"] == "ORCID"
assert payload["sections"][0]["year_entries"][0]["text"] == "Master degree"
assert payload["sections"][1]["publications"][0]["title"] == "Paper"
@@ -111,6 +111,7 @@ def test_employee_payloads_tolerate_malformed_current_data(db_session):
assert display["positions"] == []
assert display["email_text"] == ""
assert detail["contacts"]["emails"] == []
assert detail["contacts"]["contact_items"] == []
assert detail["sections"] == []
@@ -142,7 +143,7 @@ def test_list_employees_page_filters_sorts_and_paginates(db_session):
page = list_employees_page(db_session, status="active", sort="full_name", direction="asc", limit=10)
assert page["total"] == 1
assert page["items"][0]["full_name"] == "Alpha"
assert page["employees"][0]["full_name"] == "Alpha"
def test_stats_payload_uses_latest_run_new_count(db_session):

View File

@@ -18,7 +18,7 @@ def test_health_returns_versions():
response = client.get("/api/health")
assert response.status_code == 200
assert response.json()["backend_version"] == "0.2.3"
assert response.json()["backend_version"] == "0.2.5"
def test_mcp_requires_token_and_lists_tools():

View File

@@ -7,6 +7,10 @@ def test_employee_detail_template_is_human_readable():
assert "Current data" not in template
assert "<pre class=\"code\"" not in template
assert ">Tabs<" not in template
assert "contacts.items" not in template
assert "contacts.contact_items" in template
assert "section.items" not in template
assert "section.list_items" in template
assert "Основная информация" in template
assert "Контакты" in template
assert "Разделы профиля" in template