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 return payload
except Exception: except Exception:
current = str(req.status_code or "").strip() 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) changed_at = _to_iso(req.updated_at or req.created_at)
payload = { payload = {
"request_id": str(req.id), "request_id": str(req.id),
@ -546,7 +554,7 @@ def get_status_route_by_track(
"id": "current", "id": "current",
"from_status": None, "from_status": None,
"to_status": current or None, "to_status": current or None,
"to_status_name": current or None, "to_status_name": current_name or None,
"changed_at": changed_at, "changed_at": changed_at,
"important_date_at": _to_iso(req.important_date_at), "important_date_at": _to_iso(req.important_date_at),
"comment": None, "comment": None,
@ -556,7 +564,7 @@ def get_status_route_by_track(
"nodes": [ "nodes": [
{ {
"code": current or "", "code": current or "",
"name": current or "-", "name": current_name or "-",
"kind": "DEFAULT", "kind": "DEFAULT",
"state": "current", "state": "current",
"changed_at": changed_at, "changed_at": changed_at,

View file

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

View file

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

View file

@ -209,6 +209,11 @@
background: rgba(96, 126, 171, 0.15); 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 { .client-summary-dates {
display: inline-flex; display: inline-flex;
align-items: center; align-items: center;

View file

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