Compare commits

..
Author SHA1 Message Date
codex 2b604b21e4 Описать исправление справочника в версии 2.4.4
CI / test (pull_request) Successful in 10m58s
CI / Fingerprint diagnostics (production deployment temporarily disabled) (pull_request) Skipped
2026-11-27 14:49:51 +03:00
codex f493e92087 Проверять подтверждённые курсы по заголовку ДПО в XLSX
CI / test (pull_request) Successful in 11m16s
CI / Fingerprint diagnostics (production deployment temporarily disabled) (pull_request) Skipped
2026-11-27 14:37:27 +03:00
codex 7f3731452b Показывать ДПО в основном наборе колонок справочника
CI / test (pull_request) Failing after 6m54s
CI / Fingerprint diagnostics (production deployment temporarily disabled) (pull_request) Skipped
2026-11-27 14:29:11 +03:00
agent ec0bd18177 Merge pull request 'Назвать колонку пройденных курсов «ДПО» и уменьшить ширину' (#87) from fix/compact-dpo-column into main
CI / test (push) Successful in 11m14s
CI / Fingerprint diagnostics (production deployment temporarily disabled) (push) Skipped
Request Workers deployment / dispatch (push) Successful in 5s
2026-11-27 10:37:09 +00:00
codex 962c3963c1 Merge remote-tracking branch 'origin/main' into fix/compact-dpo-column
CI / test (pull_request) Successful in 10m53s
CI / Fingerprint diagnostics (production deployment temporarily disabled) (pull_request) Skipped
2026-11-27 13:16:30 +03:00
agent ea47efcf9d Merge pull request 'Исправить отображение подтверждённого списка ДПО' (#86) from fix/display-reviewed-courses into main
CI / test (push) Successful in 10m51s
CI / Fingerprint diagnostics (production deployment temporarily disabled) (push) Skipped
Request Workers deployment / dispatch (push) Successful in 4s
2026-11-27 10:04:24 +00:00
codex febddada12 Совместить правку колонки ДПО с обновлением карточки
CI / test (pull_request) Successful in 10m55s
CI / Fingerprint diagnostics (production deployment temporarily disabled) (pull_request) Skipped
2026-11-27 12:55:04 +03:00
codex 09079081e9 Обновить журнал изменений 2.4.2
CI / test (pull_request) Successful in 10m56s
CI / Fingerprint diagnostics (production deployment temporarily disabled) (pull_request) Skipped
2026-11-27 12:52:56 +03:00
codex 0bbf82004b Обновить журнал изменений 2.4.3 2026-11-27 12:45:25 +03:00
codex ed35996fd4 Сохранить пустое состояние профиля только с новостями
CI / test (pull_request) Successful in 11m0s
CI / Fingerprint diagnostics (production deployment temporarily disabled) (pull_request) Skipped
2026-11-27 12:31:07 +03:00
codex 520c1df4f3 Сократить заголовок и ширину колонки ДПО
CI / test (pull_request) Successful in 11m16s
CI / Fingerprint diagnostics (production deployment temporarily disabled) (pull_request) Skipped
2026-11-27 12:24:26 +03:00
codex efc310acad Показывать подтверждённые курсы ДПО после обновления профиля
CI / test (pull_request) Failing after 6m48s
CI / Fingerprint diagnostics (production deployment temporarily disabled) (pull_request) Skipped
2026-11-26 19:40:38 +03:00
agent b394650744 Merge pull request 'Убрать служебную сводку ДПО из карточки' (#85) from fix/dpo-card-summary into main
CI / test (push) Successful in 12m39s
CI / Fingerprint diagnostics (production deployment temporarily disabled) (push) Skipped
Request Workers deployment / dispatch (push) Successful in 17s
2026-11-26 15:59:06 +00:00
codex e1ae25601b Описать упрощение карточки ДПО в версии 2.4.1
CI / test (pull_request) Successful in 12m51s
CI / Fingerprint diagnostics (production deployment temporarily disabled) (pull_request) Skipped
2026-11-26 18:45:36 +03:00
codex fa3f6d824d Сохранить требование к версии pydantic-settings
CI / test (pull_request) Successful in 12m48s
CI / Fingerprint diagnostics (production deployment temporarily disabled) (pull_request) Skipped
2026-11-26 18:31:04 +03:00
codex 48604a7b2a Скрыть служебную сводку подтверждения ДПО в карточке
CI / Fingerprint diagnostics (production deployment temporarily disabled) (pull_request) Canceled after 0s
CI / test (pull_request) Canceled after 2m47s
2026-11-26 18:28:45 +03:00
agent 76f92b05e3 Merge pull request 'Подтверждение курсов ДПО в карточке сотрудника' (#84) from feature/confirm-dpo-courses into main
CI / test (push) Successful in 12m27s
CI / Fingerprint diagnostics (production deployment temporarily disabled) (push) Skipped
Request Workers deployment / dispatch (push) Successful in 26s
2026-11-25 16:47:52 +00:00
14 changed files with 120 additions and 38 deletions

No files matched your search

+16
View File
@@ -1,5 +1,21 @@
# Changelog
## 2.4.4
- В справочнике после должности по умолчанию видна колонка «ДПО». Сохранённый набор из ФИО, статуса, должности, преподаваемых курсов, даты обнаружения и профиля автоматически переходит на показ пройденных ДПО.
## 2.4.3
- В справочнике и XLSX колонка с числом пройденных курсов называется «ДПО» и занимает меньше места.
## 2.4.2
- Подтверждённые курсы ДПО остаются в карточке и редакторе после обновления профиля. Изменившиеся сведения источника доступны для сверки.
## 2.4.1
- В карточке сотрудника убрана служебная сводка подтверждения ДПО. Сохранённые курсы доступны в редакторе списка.
## 2.4.0
- Любой вошедший пользователь может подтвердить список ДПО в карточке сотрудника. Справочник и XLSX учитывают подтверждённое количество, включая ноль. Фильтр повышения квалификации учитывает вид и год подтверждённых курсов.
+2 -2
View File
@@ -35,13 +35,13 @@ DIRECTORY_COLUMNS = (
("address", "Адрес", "address"),
("academic_degree", "Учёная степень", "academic_degree_text"),
("publications_count", "Публикации", "publications_count"),
("courses_count", "Преподаваемые курсы", "courses_count"),
("dpo_count", "ДПО", "dpo_count"),
("news_count", "Новости", "news_count"),
("first_seen_at", "Впервые найден", "first_seen_display"),
("last_seen_at", "Последний раз найден", "last_seen_display"),
("dismissed_at", "Дата увольнения", "dismissed_display"),
("profile", "Профиль", "canonical_url"),
("dpo_count", "Количество ДПО", "dpo_count"),
("courses_count", "Преподаваемые курсы", "courses_count"),
)
_TRAINING_LABEL = "повышение квалификации"
+1 -1
View File
@@ -19,7 +19,7 @@ def directory_xlsx(employees: list[dict]) -> bytes:
(employee[key] or "Без имени") if key == "full_name" else employee[key]
for _, _, key in DIRECTORY_COLUMNS
])
for cell, width in zip(sheet[1], (34, 20, 48, 14, 28, 22, 34, 30, 14, 10, 10, 22, 24, 22, 46, 18)):
for cell, width in zip(sheet[1], (34, 20, 48, 14, 28, 22, 34, 30, 14, 10, 10, 22, 24, 22, 46, 10)):
cell.font = Font(bold=True)
sheet.column_dimensions[get_column_letter(cell.column)].width = width
sheet.freeze_panes = "A2"
+5
View File
@@ -796,6 +796,11 @@
vertical-align: top;
}
.directory-table [data-column="dpo_count"] {
width: 4rem;
white-space: nowrap;
}
.directory-table .badge {
white-space: nowrap;
}
+8 -2
View File
@@ -3,10 +3,11 @@
"full_name",
"status",
"positions",
"dpo_count",
"last_seen_at",
"profile",
];
const storageKey = "miem.directory.columns";
const storageKey = "miem.directory.columns.v2";
const columnPresets = {
review: ["full_name", "status", "academic_degree", "last_seen_at", "profile"],
contacts: ["full_name", "status", "email", "phone", "address", "profile"],
@@ -15,7 +16,12 @@
function readColumns() {
try {
const stored = JSON.parse(localStorage.getItem(storageKey) || "[]");
const current = localStorage.getItem(storageKey);
const stored = JSON.parse(current ?? localStorage.getItem("miem.directory.columns") ?? "[]");
if (current === null && Array.isArray(stored) && stored.length === columnDefaults.length &&
columnDefaults.every((key) => stored.includes(key === "dpo_count" ? "courses_count" : key))) {
return columnDefaults;
}
return Array.isArray(stored) && stored.length ? stored : columnDefaults;
} catch (_error) {
return columnDefaults;
+2 -2
View File
@@ -117,13 +117,13 @@
<td class="directory-table__cell" data-column="address">{{ employee.address or "" }}</td>
<td class="directory-table__cell" data-column="academic_degree">{{ employee.academic_degree_text }}</td>
<td class="directory-table__cell" data-column="publications_count">{{ employee.publications_count }}</td>
<td class="directory-table__cell" data-column="courses_count">{{ employee.courses_count }}</td>
<td class="directory-table__cell" data-column="dpo_count">{{ employee.dpo_count if employee.dpo_count is not none else "—" }}{% if employee.dpo_uncertain %} <a class="dpo-warning" href="/admin/employees/{{ employee.id }}#unresolved-dpo" title="Количество ДПО требует проверки" aria-label="Количество ДПО требует проверки"><span aria-hidden="true">⚠︎</span></a>{% endif %}</td>
<td class="directory-table__cell" data-column="news_count">{{ employee.news_count }}</td>
<td class="directory-table__cell" data-column="first_seen_at">{{ employee.first_seen_display }}</td>
<td class="directory-table__cell" data-column="last_seen_at">{{ employee.last_seen_display }}</td>
<td class="directory-table__cell" data-column="dismissed_at">{{ employee.dismissed_display }}</td>
<td class="directory-table__cell" data-column="profile"><a class="admin__link" href="{{ employee.canonical_url }}" target="_blank" rel="noopener">Внешний профиль</a></td>
<td class="directory-table__cell" data-column="dpo_count">{{ employee.dpo_count if employee.dpo_count is not none else "—" }}{% if employee.dpo_uncertain %} <a class="dpo-warning" href="/admin/employees/{{ employee.id }}#unresolved-dpo" title="Количество ДПО требует проверки" aria-label="Количество ДПО требует проверки"><span aria-hidden="true">⚠︎</span></a>{% endif %}</td>
<td class="directory-table__cell" data-column="courses_count">{{ employee.courses_count }}</td>
</tr>
{% else %}
<tr><td class="directory-table__empty" colspan="{{ directory_columns|length }}">
+3 -4
View File
@@ -125,9 +125,10 @@
</details>
{% endif %}
{% set profile_sections = employee_view.sections | rejectattr('type', 'in', ['news', 'additional_education']) | list %}
{% if profile_sections or not (employee_view.sections | selectattr('type', 'equalto', 'additional_education') | list) %}
<section class="employee-card__section">
<h3 class="employee-section__title">Разделы профиля</h3>
{% set profile_sections = employee_view.sections | rejectattr('type', 'equalto', 'news') | list %}
{% if profile_sections %}
<div class="employee-card__sections">
{% for section in profile_sections %}
@@ -216,9 +217,6 @@
</table>
</div>
{% else %}
{% if section.type == "additional_education" and section.list_items %}
<p class="employee-section__note">Распознано записей: {{ section.list_items | length }}</p>
{% endif %}
{% if section.paragraphs %}
{% for paragraph in section.paragraphs %}
<p class="employee-section__text">{{ paragraph }}</p>
@@ -247,6 +245,7 @@
<p class="employee-section__text">Разделы профиля не найдены.</p>
{% endif %}
</section>
{% endif %}
</section>
{% include "employee_dpo.html" %}
+18 -10
View File
@@ -11,18 +11,22 @@
</fieldset>
{% endmacro %}
<section class="panel" id="unresolved-dpo" tabindex="-1">
<h2 class="panel__title">Проверка ДПО</h2>
{% if review %}
<p>Подтверждено курсов: <strong>{{ review.courses | length }}</strong> · {{ review.updated_by }} · {{ review.updated_at | admin_datetime }}</p>
{% if review.courses %}<ol>{% for course in review.courses %}
<li>{{ course.title }} · {{ kinds[course.kind] }}{% if course.year %} · {{ course.year }}{% endif %}{% if course.evidence %} · {{ course.evidence }}{% endif %}</li>
{% endfor %}</ol>{% endif %}
{% endif %}
<h2 class="panel__title">Дополнительное профессиональное образование</h2>
{% if employee_view.dpo_courses %}
<ul class="employee-card__list">
{% for course in employee_view.dpo_courses %}
<li class="employee-card__list-item">{{ course.title }}{% if review %} · {{ kinds[course.kind] }}{% if course.year %} · {{ course.year }}{% endif %}{% if course.evidence %} · {{ course.evidence }}{% endif %}{% endif %}</li>
{% endfor %}
</ul>
{% elif review %}<p>Курсов ДПО нет.</p>
{% elif employee_view.dpo_uncertain %}<p>Отдельные курсы ДПО не распознаны.</p>
{% else %}<p>Сведения о курсах ДПО отсутствуют.</p>{% endif %}
{% if employee_view.dpo_uncertain %}
<h3>Количество ДПО требует проверки</h3>
{% if review %}<p>Сведения о ДПО изменились. В справочнике учтён последний подтверждённый список.</p>{% endif %}
{% endif %}
{% if employee_view.dpo_uncertain or review %}
<details><summary>Редактировать список ДПО</summary>
{% if employee_view.dpo_uncertain %}
{% for section in employee_view.sections if section.type == 'additional_education' %}
<h4>{{ section.title }} · сведения профиля</h4>
{% if not section.list_items %}<p>В разделе ДПО не удалось выделить отдельные записи.</p>{% endif %}
@@ -30,8 +34,12 @@
{% for text in section.unresolved %}<p>{{ text }}</p>{% endfor %}
{% for doc in section.unresolved_documents %}<p>{% if doc.url.startswith(('https://', 'http://')) %}<a class="admin__link" href="{{ doc.url }}">{{ doc.text }}</a>{% else %}{{ doc.text }}{% endif %}</p>{% endfor %}
{% endfor %}
{% endif %}
<details {% if employee_view.dpo_uncertain %}open{% endif %}><summary>Проверить список ДПО</summary>
{% endif %}
{% for section in employee_view.sections if section.type == 'additional_education' %}
{% for link in section.links %}
{% if link.url.startswith(('https://', 'http://')) %}<a class="admin__link" href="{{ link.url }}">{{ link.text }}</a>{% endif %}
{% endfor %}
{% endfor %}
<form data-dpo method="post" action="/admin/employees/{{ employee.id }}/dpo" data-source="{{ employee_view.dpo_source }}" data-revision="{{ review.revision if review else 0 }}">
<input type="hidden" name="csrf_token" value="{{ csrf_token }}">
<p>Оставьте по одной строке на каждое прохождение курса. Если удостоверение дублирует курс, перенесите его в основание и исключите лишнюю строку.</p>
+3 -3
View File
@@ -1,3 +1,3 @@
APP_VERSION = "2.4.0"
FRONTEND_VERSION = "2.4.0"
BACKEND_VERSION = "2.4.0"
APP_VERSION = "2.4.4"
FRONTEND_VERSION = "2.4.4"
BACKEND_VERSION = "2.4.4"
+1 -1
View File
@@ -1,6 +1,6 @@
[project]
name = "miem-workers"
version = "2.4.0"
version = "2.4.4"
description = "MIEM employees parser, admin API, and web admin"
requires-python = ">=3.11"
dependencies = [
+24 -5
View File
@@ -77,6 +77,23 @@ def main():
columns = page.get_by_role("button", name="Настроить колонки")
panel = page.locator(".directory__filter-panel")
dpo = page.get_by_role("columnheader", name="ДПО", exact=True)
taught = page.get_by_role("columnheader", name="Преподаваемые курсы")
expect(dpo).to_be_visible()
page.evaluate("""localStorage.setItem("miem.directory.columns", JSON.stringify(
["full_name", "status", "positions", "courses_count", "last_seen_at", "profile"]))""")
page.reload()
expect(dpo).to_be_visible()
expect(taught).to_have_count(0)
headers = page.get_by_role("columnheader").all_text_contents()
assert headers == ["ФИО", "Статус", "Должности", "ДПО", "Последний раз найден", "Профиль"]
columns.click()
page.get_by_label("Преподаваемые курсы", exact=True).check()
page.get_by_label("ДПО", exact=True).uncheck()
page.reload()
expect(taught).to_be_visible()
expect(dpo).to_have_count(0)
# Immediate filter feedback, actual disabled controls, inert links.
pps.check()
expect(overlay).to_be_visible()
@@ -168,11 +185,13 @@ def main():
full_name=f"Сотрудник {i}") for i in range(3, 27))
db.commit()
page.goto("http://miem.test/admin/directory?limit=25")
page.route("**/*offset=25*", lambda route: pending.append(route))
page.get_by_role("link", name="Вперед").click(no_wait_after=True)
expect(page.locator("[data-page-status]")).to_be_visible()
expect(overlay).to_be_visible()
fulfill(pending.pop())
# Observe the outgoing page before Chromium starts the navigation.
visible = page.get_by_role("link", name="Вперед").evaluate("""link => {
link.click();
return ["[data-page-status]", "[data-directory-loading]"].map(selector =>
document.querySelector(selector).getClientRects().length > 0);
}""")
assert visible == [True, True]
expect(summary).to_have_text("Показаны 26–26 из 26")
expect(overlay).to_be_hidden()
assert not errors, errors
+12 -1
View File
@@ -22,7 +22,7 @@ def test_health_returns_versions():
response = TestClient(app).get("/api/health")
assert response.status_code == 200
assert response.json()["backend_version"] == "2.4.0"
assert response.json()["backend_version"] == "2.4.4"
def test_api_employees_and_stats_require_admin_session():
@@ -168,6 +168,10 @@ def test_directory_export_uses_applied_filters_and_sort_across_pages(db_session)
status="dismissed" if number == 28 else "active",
current_data={
"hse_start_year": 2025 - number,
"sections": [
{"type": "courses_by_year", "courses": [{"title": "Физика"}]},
{"type": "additional_education", "education_format": 2, "items": ["Курс А", "Курс Б"]},
],
"positions": ["Инженер" if number == 29 else "Кафедра физики"],
"contacts": {"address": "=1+1", "phones": ["+7 123"]},
},
@@ -202,6 +206,13 @@ def test_directory_export_uses_applied_filters_and_sort_across_pages(db_session)
assert [cell.value for cell in sheet[1]] == [
cell.get_text(strip=True) for cell in page.select(".directory-table th")
]
assert page.select_one('th[data-column="dpo_count"]').get_text(strip=True) == "ДПО"
assert page.select_one('td[data-column="dpo_count"]').get_text(strip=True) == "2"
columns = {cell.value: cell for cell in sheet[1]}
dpo = columns["ДПО"]
assert sheet.cell(2, dpo.column).value == 2
assert sheet.cell(2, columns["Преподаваемые курсы"].column).value == 1
assert sheet.column_dimensions[dpo.column_letter].width == 10
assert sheet.max_column == 16
assert [cell.value for cell in sheet["A"][1:]] == [f"Export {number:02d}" for number in range(28)]
assert [cell.value for cell in sheet["A"][-3:]] == [
+1 -1
View File
@@ -230,7 +230,7 @@ def test_public_page_data_minimization_and_safe_links(db_session, export):
assert "javascript:" not in fragment.text and "private@example.org" not in fragment.text
assert "javascript:" not in response.text and "private@example.org" not in response.text
assert "/admin/employees/" not in response.text and "/admin/logout" not in response.text
assert "Backend 2.4.0 · Frontend 2.4.0" in response.text
assert "Backend 2.4.4 · Frontend 2.4.4" in response.text
assert "Вход в систему" in response.text
assert client.get("/admin/directory", follow_redirects=False).status_code in (302, 303, 401, 403)
assert "Сотрудники не найдены" in client.get("/admin/council?q=missing").text
+24 -6
View File
@@ -429,13 +429,13 @@ def test_postgres_concurrent_admin_demotions_keep_an_admin(accounts):
other.close()
def test_reader_confirms_dpo_and_changed_sources_require_review(accounts):
def test_reader_confirms_dpo_and_changed_sources_require_review(accounts, monkeypatch):
from io import BytesIO
from openpyxl import load_workbook
from app.services.admin_data import employee_detail_payload, list_employees_page
from app.services.directory_export import directory_xlsx
client, db, settings, _, user, employee = accounts
client, db, settings, admin, user, employee = accounts
headers = act_as(client, user, settings)
url = f"/admin/employees/{employee.id}/dpo"
title = "Работа с данными, повышение квалификации"
@@ -453,17 +453,35 @@ def test_reader_confirms_dpo_and_changed_sources_require_review(accounts):
assert client.post(url, json=payload).status_code == 403
assert client.post(url, json=payload, headers=headers).status_code == 200
assert client.post(url, json=payload, headers=headers).status_code == 409
panel = BeautifulSoup(client.get(url[:-4]).text, "html.parser").select_one("#unresolved-dpo")
assert "Подтверждено курсов" not in panel.get_text()
assert "Инженерная практика" in panel.select_one(":scope > ul").get_text()
assert title not in panel.get_text()
assert panel.select_one("summary").get_text() == "Редактировать список ДПО"
assert panel.select_one("[data-rows] input[name=title]")["value"] == "Инженерная практика"
assert not employee_detail_payload(employee)["dpo_uncertain"]
result = list_employees_page(db, training_since_year=2025)["employees"]
assert [row["dpo_count"] for row in result] == [1]
sheet = load_workbook(BytesIO(directory_xlsx(result))).active
assert sheet.cell(2, sheet.max_column).value == 1
dpo_column = next(cell.column for cell in sheet[1] if cell.value == "ДПО")
assert sheet.cell(2, dpo_column).value == 1
employee.current_data = {"sections": [section], "phone": "changed"}
db.commit()
assert not employee_detail_payload(employee)["dpo_uncertain"]
employee.current_data = {"sections": [{"type": "additional_education", "education_format": 2,
"items": ["Новый курс"]}]}
db.commit()
refreshed_section = {**section, "items": ["Новый курс"], "year_entries": []}
monkeypatch.setattr("app.services.crawler.parse_person_profile", lambda *args, **kwargs: {
"profile_type": "users", "profile_id": "employee", "source_url": employee.canonical_url,
"full_name": employee.full_name, "sections": [refreshed_section]})
refreshed = client.post(url[:-4] + "/refresh", headers=act_as(client, admin, settings))
assert refreshed.status_code == 200 and "refresh_status=success" in str(refreshed.url)
headers = act_as(client, user, settings)
card = BeautifulSoup(client.get(url[:-4]).text, "html.parser")
panel = card.select_one("#unresolved-dpo")
assert "Инженерная практика" in panel.select_one(":scope > ul").get_text()
assert "Новый курс" not in panel.select_one(":scope > ul").get_text()
assert "Новый курс" in panel.select_one("details").get_text()
assert not any("Новый курс" in item.get_text() for item in card.select("article.employee-section"))
assert panel.select_one("[data-rows] input[name=title]")["value"] == "Инженерная практика"
view = employee_detail_payload(employee)
assert view["dpo_uncertain"] and view["dpo_count"] == 1
payload.update(courses=[], revision=1, confirm_empty=True)