From b828225b28dfe75b254e0c3deca3391d38ab66e0 Mon Sep 17 00:00:00 2001 From: "Zimin A.N." Date: Mon, 25 May 2026 14:59:57 +0300 Subject: [PATCH] =?UTF-8?q?fix(admin-ui):=20badge=20=D0=BD=D0=B0=20=C2=AB?= =?UTF-8?q?=D0=9C=D0=BE=D0=B8=C2=BB=20=D0=BD=D0=B5=20=D0=BE=D0=B1=D0=BD?= =?UTF-8?q?=D0=BE=D0=B2=D0=BB=D1=8F=D0=BB=D1=81=D1=8F=20+=20editor=20wider?= =?UTF-8?q?=20=D0=BD=D0=B0=20=D0=B4=D0=B5=D1=81=D0=BA=D1=82=D0=BE=D0=BF?= =?UTF-8?q?=D0=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 1. useApproveDraft/useRejectDraft теперь инвалидируют ['drafts'] key (my-drafts + by-dict lists). До этого инвалидировался только ['draft'] (single by id), поэтому after-approve "Мои" badge продолжал показывать pending-счётчик даже когда все драфты уже APPROVED — useMyDrafts отдавал стейл-кеш. useWithdrawDraft уже это делал, теперь подтянули approve/reject. 2. DictionaryEditorDialog: на десктопе (≥880px) modal теперь max-w 1400px вместо max-w-5xl (880px после маппинга в SIZE_CLASSES.xl). На <880px осталось w-[95vw] (compact mobile modal). На 1440p мониторе editor больше не выглядит вжатым, tabs+schema+preview помещаются без скролла. Override через panelClassName c `!` чтобы перебить SIZE_CLASSES. --- ordinis-admin-ui/src/api/mutations.ts | 6 ++++++ .../src/components/schema/DictionaryEditorDialog.tsx | 10 ++++++++-- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/ordinis-admin-ui/src/api/mutations.ts b/ordinis-admin-ui/src/api/mutations.ts index 9df50d5..ff95cbc 100644 --- a/ordinis-admin-ui/src/api/mutations.ts +++ b/ordinis-admin-ui/src/api/mutations.ts @@ -442,6 +442,10 @@ export const useApproveDraft = () => { qc.invalidateQueries({ queryKey: ['review-queue'] }) qc.invalidateQueries({ queryKey: ['records'] }) qc.invalidateQueries({ queryKey: ['draft'] }) + // ['drafts'] = my-drafts list + by-dict list. Без этого "Мои" tab + // badge продолжал показывать счётчик после approve (status + // pending → decided, но cached list не обновлялся). + qc.invalidateQueries({ queryKey: ['drafts'] }) }, }) } @@ -467,6 +471,8 @@ export const useRejectDraft = () => { onSuccess: () => { qc.invalidateQueries({ queryKey: ['review-queue'] }) qc.invalidateQueries({ queryKey: ['draft'] }) + // Та же причина что в useApproveDraft — "Мои" badge не обновлялся. + qc.invalidateQueries({ queryKey: ['drafts'] }) }, }) } diff --git a/ordinis-admin-ui/src/components/schema/DictionaryEditorDialog.tsx b/ordinis-admin-ui/src/components/schema/DictionaryEditorDialog.tsx index 2ca8916..2b48088 100644 --- a/ordinis-admin-ui/src/components/schema/DictionaryEditorDialog.tsx +++ b/ordinis-admin-ui/src/components/schema/DictionaryEditorDialog.tsx @@ -263,8 +263,14 @@ export const DictionaryEditorDialog = ({ open, mode, onClose, onSuccess }: Props isOpen={open} onClose={onClose} title={isEdit ? `${t('schema.action.edit')}: ${initial?.name}` : t('schema.action.create')} - maxWidth="max-w-5xl" - panelClassName="max-h-[calc(100vh-2rem)] my-4 flex flex-col" + // Desktop ≥880px — expanded (max-w 1400px, реально ~95vw на меньших + // десктопных широтах). Mobile <880px — наследует w-[95vw] от + // DialogContent (compact, full-width modal). Override через + // panelClassName c `!` чтобы перебить SIZE_CLASSES.xl (880px). + // Раньше maxWidth="max-w-5xl" → xl → 880px — на 1440p мониторе + // editor выглядел вжатым, форма с tabs не помещалась без скролла. + size="md" + panelClassName="max-h-[calc(100vh-2rem)] my-4 flex flex-col min-[880px]:!max-w-[1400px]" bodyClassName="overflow-y-auto flex-1" >