This commit is contained in:
Zuev
2026-10-02 04:07:56 +03:00
parent 97bf3cc50a
commit fc5801d683
42 changed files with 1201 additions and 305 deletions

View File

@@ -1,4 +1,5 @@
import { useEffect, useRef, useState } from 'react';
import { CustomSelect } from '../../shared/ui/CustomSelect.jsx';
import { readUrlState, writeUrlState } from '../../../admin/js/url-state.js';
import { trackUxEvent } from '../../../telemetry.js';
@@ -83,6 +84,8 @@ export function SubjectsTab() {
}, []);
async function loadSubjects(nextState) {
stateRef.current = nextState;
setState(nextState);
const currentRequest = requestNumber.current + 1;
requestNumber.current = currentRequest;
setTableLoading(true);
@@ -267,7 +270,7 @@ export function SubjectsTab() {
</div>
<div className="form-group">
<label htmlFor="new-subject-department">Кафедра</label>
<select
<CustomSelect
id="new-subject-department"
required
value={createDepartmentId}
@@ -279,7 +282,7 @@ export function SubjectsTab() {
{departmentOptionLabel(department)}
</option>
))}
</select>
</CustomSelect>
</div>
<button type="submit" className="btn btn-md btn-primary">Добавить</button>
</div>
@@ -307,7 +310,7 @@ export function SubjectsTab() {
</div>
<div className="form-group">
<label htmlFor="subjects-department-filter">Кафедра</label>
<select
<CustomSelect
id="subjects-department-filter"
value={state.departmentId}
onChange={event => applyState({ departmentId: event.target.value, page: 0 })}
@@ -318,11 +321,11 @@ export function SubjectsTab() {
{department.departmentName || department.name || department.id}
</option>
))}
</select>
</CustomSelect>
</div>
<div className="form-group">
<label htmlFor="subjects-sort">Сортировка</label>
<select
<CustomSelect
id="subjects-sort"
value={state.sort}
onChange={event => applyState({ sort: event.target.value, page: 0 })}
@@ -330,7 +333,7 @@ export function SubjectsTab() {
{SUBJECT_SORT_OPTIONS.map(option => (
<option key={option.value} value={option.value}>{option.label}</option>
))}
</select>
</CustomSelect>
</div>
</div>
<div className="table-wrap">