From 41ac30c090f083c8873116b2584669940e2edead Mon Sep 17 00:00:00 2001 From: Hermes Date: Tue, 29 Sep 2026 10:28:35 +0200 Subject: [PATCH] =?UTF-8?q?style(analytics):=20=D0=BC=D0=BE=D0=B1=D0=B8?= =?UTF-8?q?=D0=BB=D1=8C=D0=BD=D0=B0=D1=8F=20=D1=80=D0=B0=D1=81=D0=BA=D0=BB?= =?UTF-8?q?=D0=B0=D0=B4=D0=BA=D0=B0=20=D1=81=D0=BF=D0=B8=D1=81=D0=BA=D0=BE?= =?UTF-8?q?=D0=B2=20=D0=B2=D0=BE=D1=80=D0=BE=D0=BD=D0=BA=D0=B8=20=E2=80=94?= =?UTF-8?q?=20=D0=B1=D0=B5=D0=B7=20=D0=B3=D0=BE=D1=80=D0=B8=D0=B7=D0=BE?= =?UTF-8?q?=D0=BD=D1=82=D0=B0=D0=BB=D1=8C=D0=BD=D0=BE=D0=B9=20=D0=BF=D1=80?= =?UTF-8?q?=D0=BE=D0=BA=D1=80=D1=83=D1=82=D0=BA=D0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit На 390px таблицы «Не поднимают трубку» и «Открыли ссылку, но не подтвердили» уезжали вправо (статус и телефон не видны без прокрутки). На мобильном они раскладываются списком: телефон и число попыток в строку, город/тип/статус и дата — ниже мелким. В таблице попыток процент ответов уходит во вторую строку, чтобы колонка «Не взяли» влезла. Тест на мобильную раскладку (8 проверок). SW v125. --- public/service-worker.js | 2 +- .../admin/analytics/CommsFunnelBlock.jsx | 61 ++++++++++++++++++- .../admin/analytics/CommsFunnelBlock.test.jsx | 12 ++++ 3 files changed, 73 insertions(+), 2 deletions(-) diff --git a/public/service-worker.js b/public/service-worker.js index e646b7e..cad0fda 100644 --- a/public/service-worker.js +++ b/public/service-worker.js @@ -1,7 +1,7 @@ const isLocalhost = self.location.hostname === "localhost" || self.location.hostname === "127.0.0.1"; if (!isLocalhost) { - const STATIC_CACHE = "construction-delivery-static-v124"; + const STATIC_CACHE = "construction-delivery-static-v125"; const RUNTIME_CACHE = "construction-delivery-runtime-v119"; const APP_SHELL_URLS = ["/", "/client", "/index.html", "/manifest.webmanifest", "/icons/icon-192.png", "/icons/icon-512.png"]; diff --git a/src/components/admin/analytics/CommsFunnelBlock.jsx b/src/components/admin/analytics/CommsFunnelBlock.jsx index 1159462..49a0dd8 100644 --- a/src/components/admin/analytics/CommsFunnelBlock.jsx +++ b/src/components/admin/analytics/CommsFunnelBlock.jsx @@ -207,7 +207,10 @@ export const CommsFunnelBlock = ({ funnel, isLoading, mobile = false, periodLabe {a.attempt}-я {a.total} - {a.answered} ({a.answered_pct}%) + {a.answered} + {mobile + ?
{a.answered_pct}%
+ : ({a.answered_pct}%)} {a.confirmed} {a.no_answer} @@ -237,6 +240,34 @@ export const CommsFunnelBlock = ({ funnel, isLoading, mobile = false, periodLabe
Не поднимают трубку
+ {mobile ? ( + noAnswer.length === 0 ? ( +
+ Нет таких номеров за период +
+ ) : ( +
+ {noAnswer.map((n) => ( +
+
+ {n.phone} + + попыток: {n.attempts} + +
+
+ {n.town} · {KIND_LABELS[n.kind] || n.kind} · {STATUS_LABELS[n.status] || n.status || '—'} +
+
+ последний звонок {fmtDateTime(n.last_call)} +
+
+ ))} +
+ ) + ) : ( @@ -263,6 +294,7 @@ export const CommsFunnelBlock = ({ funnel, isLoading, mobile = false, periodLabe ))}
+ )} {/* ── Открыли ссылку, но не подтвердили ───────────────────────────── */} @@ -270,6 +302,32 @@ export const CommsFunnelBlock = ({ funnel, isLoading, mobile = false, periodLabe
Открыли ссылку, но не подтвердили
+ {mobile ? ( + openedNoConfirm.length === 0 ? ( +
+ Все, кто открыл ссылку, подтвердили +
+ ) : ( +
+ {openedNoConfirm.map((o) => ( +
+
+ {o.num} + открытий: {o.opens} +
+
+ {o.name} · {o.phone} +
+
+ последнее открытие {fmtDateTime(o.opened)} +
+
+ ))} +
+ ) + ) : ( @@ -294,6 +352,7 @@ export const CommsFunnelBlock = ({ funnel, isLoading, mobile = false, periodLabe ))}
+ )} ); diff --git a/src/components/admin/analytics/CommsFunnelBlock.test.jsx b/src/components/admin/analytics/CommsFunnelBlock.test.jsx index 6cb115c..68f0f54 100644 --- a/src/components/admin/analytics/CommsFunnelBlock.test.jsx +++ b/src/components/admin/analytics/CommsFunnelBlock.test.jsx @@ -97,6 +97,18 @@ describe("CommsFunnelBlock", () => { expect(empty).toContain("Подтверждений за период нет"); }); + it("на мобильном списки «не берут трубку» и «открыли без подтверждения» раскладываются без прокрутки", () => { + const m = renderToStaticMarkup(); + expect(m).toContain("попыток: 2"); + expect(m).toContain("Севастополь · самовывоз · В ручной работе"); + expect(m).toContain("последний звонок"); + expect(m).toContain("открытий: 14"); + expect(m).toContain("ЗАКАЗЧИК · 9788324113"); + // на мобильном процент по попыткам уходит во вторую строку, а не в скобках + expect(m).not.toContain("(65.6%)"); + expect(m).toContain("65.6%"); + }); + it("показывает заглушку загрузки, пока данных нет", () => { const loading = renderToStaticMarkup(); expect(loading).toContain("Воронка коммуникаций");