Показывать ДПО после должности в справочнике #88
No files matched your search
@@ -1,5 +1,9 @@
|
||||
# Changelog
|
||||
|
||||
## 2.4.4
|
||||
|
||||
- В справочнике после должности по умолчанию видна колонка «ДПО». Сохранённый набор из ФИО, статуса, должности, преподаваемых курсов, даты обнаружения и профиля автоматически переходит на показ пройденных ДПО.
|
||||
|
||||
## 2.4.3
|
||||
|
||||
- В справочнике и XLSX колонка с числом пройденных курсов называется «ДПО» и занимает меньше места.
|
||||
|
||||
@@ -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 = "повышение квалификации"
|
||||
|
||||
+8
-2
@@ -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;
|
||||
|
||||
@@ -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
-3
@@ -1,3 +1,3 @@
|
||||
APP_VERSION = "2.4.3"
|
||||
FRONTEND_VERSION = "2.4.3"
|
||||
BACKEND_VERSION = "2.4.3"
|
||||
APP_VERSION = "2.4.4"
|
||||
FRONTEND_VERSION = "2.4.4"
|
||||
BACKEND_VERSION = "2.4.4"
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
[project]
|
||||
name = "miem-workers"
|
||||
version = "2.4.3"
|
||||
version = "2.4.4"
|
||||
description = "MIEM employees parser, admin API, and web admin"
|
||||
requires-python = ">=3.11"
|
||||
dependencies = [
|
||||
|
||||
@@ -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
|
||||
|
||||
+1
-1
@@ -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.3"
|
||||
assert response.json()["backend_version"] == "2.4.4"
|
||||
|
||||
|
||||
def test_api_employees_and_stats_require_admin_session():
|
||||
|
||||
@@ -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.3 · Frontend 2.4.3" 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
|
||||
|
||||
+2
-1
@@ -463,7 +463,8 @@ def test_reader_confirms_dpo_and_changed_sources_require_review(accounts, monkey
|
||||
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"]
|
||||
|
||||
Reference in new issue
Block a user