fix user UI 3

This commit is contained in:
TronoSfera 2026-03-02 22:16:19 +03:00
parent be36c2d232
commit 8f29417b6b
5 changed files with 52 additions and 23 deletions

View file

@ -533,6 +533,14 @@ def get_status_route_by_track(
return payload
except Exception:
current = str(req.status_code or "").strip()
current_name = current
if current:
try:
status_row = db.query(Status).filter(Status.code == current).first()
except SQLAlchemyError:
status_row = None
if status_row is not None:
current_name = str(status_row.name or current)
changed_at = _to_iso(req.updated_at or req.created_at)
payload = {
"request_id": str(req.id),
@ -546,7 +554,7 @@ def get_status_route_by_track(
"id": "current",
"from_status": None,
"to_status": current or None,
"to_status_name": current or None,
"to_status_name": current_name or None,
"changed_at": changed_at,
"important_date_at": _to_iso(req.important_date_at),
"comment": None,
@ -556,7 +564,7 @@ def get_status_route_by_track(
"nodes": [
{
"code": current or "",
"name": current or "-",
"name": current_name or "-",
"kind": "DEFAULT",
"state": "current",
"changed_at": changed_at,

View file

@ -1549,6 +1549,11 @@
margin: 0;
}
.request-card-head-spacer {
min-height: 1rem;
margin: -0.1rem 0 0.55rem;
}
.request-card-head-actions {
display: inline-flex;
align-items: center;

View file

@ -175,6 +175,7 @@ export function RequestWorkspace({
const canSeeRate = viewerRoleCode !== "CLIENT";
const canSeeCreatedUpdatedInCard = viewerRoleCode !== "CLIENT";
const showTopicStatusInCard = viewerRoleCode !== "CLIENT";
const showContactsInCard = viewerRoleCode !== "CLIENT";
const safeMessages = Array.isArray(messages) ? messages : [];
const safeAttachments = Array.isArray(attachments) ? attachments : [];
const safeStatusHistory = Array.isArray(statusHistory) ? statusHistory : [];
@ -1250,6 +1251,7 @@ export function RequestWorkspace({
</button>
</div>
</div>
<div className="request-card-head-spacer" aria-hidden="true" />
{loading ? (
<p className="muted">Загрузка...</p>
) : row ? (
@ -1289,24 +1291,28 @@ export function RequestWorkspace({
{row.description ? String(row.description) : "Описание не заполнено"}
</span>
</div>
<div className="request-field">
<span className="request-field-label">Клиент</span>
<span
className={"request-field-value" + (clientHasPhone ? " has-tooltip request-contact-value" : "")}
data-tooltip={clientHasPhone ? clientPhone : undefined}
>
{clientLabel}
</span>
</div>
<div className="request-field">
<span className="request-field-label">Юрист</span>
<span
className={"request-field-value" + (lawyerHasPhone ? " has-tooltip request-contact-value" : "")}
data-tooltip={lawyerHasPhone ? lawyerPhone : undefined}
>
{lawyerLabel}
</span>
</div>
{showContactsInCard ? (
<>
<div className="request-field">
<span className="request-field-label">Клиент</span>
<span
className={"request-field-value" + (clientHasPhone ? " has-tooltip request-contact-value" : "")}
data-tooltip={clientHasPhone ? clientPhone : undefined}
>
{clientLabel}
</span>
</div>
<div className="request-field">
<span className="request-field-label">Юрист</span>
<span
className={"request-field-value" + (lawyerHasPhone ? " has-tooltip request-contact-value" : "")}
data-tooltip={lawyerHasPhone ? lawyerPhone : undefined}
>
{lawyerLabel}
</span>
</div>
</>
) : null}
{canSeeCreatedUpdatedInCard ? (
<>
<div className="request-field">
@ -1326,7 +1332,9 @@ export function RequestWorkspace({
<ol className="request-route-list" id="request-status-route">
{routeNodes.map((node, index) => {
const state = String(node?.state || "pending");
const name = String(node?.name || statusLabel(node?.code));
const code = String(node?.code || "").trim();
const rawName = String(node?.name || "").trim();
const name = rawName && rawName !== code ? rawName : statusLabel(code || rawName);
const note = String(node?.note || "").trim();
const changedAtSource = String(node?.changed_at || "").trim() || (index === 0 ? String(row?.created_at || "").trim() : "");
const changedAt = changedAtSource ? fmtDate(changedAtSource) : "";

View file

@ -209,6 +209,11 @@
background: rgba(96, 126, 171, 0.15);
}
.client-summary-chip-lawyer {
border-color: rgba(123, 165, 132, 0.34);
background: rgba(74, 124, 86, 0.16);
}
.client-summary-dates {
display: inline-flex;
align-items: center;

View file

@ -923,9 +923,9 @@ import { detectAttachmentPreviewKind, fmtShortDateTime, statusLabel } from "./ad
<div>
<div className="client-title-row">
<img className="brand-mark" src="/brand-mark.svg" alt="" width="24" height="24" />
<h1>Кабинет клиента</h1>
<h1>Личный кабинет * Представление клиента</h1>
</div>
<p className="muted">Работа с заявками: статусы, чат, файлы и обращения.</p>
<p className="muted">Мы рады помочь Вам</p>
</div>
<button
className="icon-btn workspace-head-icon"
@ -969,6 +969,9 @@ import { detectAttachmentPreviewKind, fmtShortDateTime, statusLabel } from "./ad
<span className="client-summary-chip client-summary-chip-topic">
Тема: <span id="cabinet-request-topic">{summary ? String(summary.topic_name || summary.topic_code || "-") : "-"}</span>
</span>
<span className="client-summary-chip client-summary-chip-lawyer">
Юрист: <span>{summary ? String(summary.assigned_lawyer_name || summary.assigned_lawyer_id || "Не назначен") : "-"}</span>
</span>
</div>
<div className="client-summary-dates">
<span>