From e15a3916bfcd89f61cc63ea5f5472474bad98f9b Mon Sep 17 00:00:00 2001 From: "Zimin A.N." Date: Mon, 11 May 2026 18:03:52 +0300 Subject: [PATCH] =?UTF-8?q?feat(editor):=20+=20=D0=AD=D0=BA=D1=81=D0=BF?= =?UTF-8?q?=D0=BE=D1=80=D1=82=20button=20=D0=B2=20InfoPanel=20per=20redesi?= =?UTF-8?q?gn=20dark=20theme=20screenshot?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit User dropped /Users/zimin/Downloads/Ordinis (3) — full project dump. Dark theme editor screenshot (uploads/draw-4b771386...png) показывает INFO PANEL c двумя buttons: - ↓ Экспорт… - ⟲ Time-travel… У нас был Time-travel + AOI — добавил Экспорт как third button. Implementation: - EditorInfoPanel.actions.onExport + exportPending props - DownloadSimpleIcon кнопка 'Экспорт…' - Wired к useBulkExportRecords mutation: * Selection не empty -> export selected * Selection empty -> export all filtered records - disabled когда mutation pending, label 'Экспорт…' Project dump reviewed: - design_handoff_dictionary_catalog — старый handoff, всё уже реализовано (List view MR !62, Hub MR earlier, Graph earlier) - patches/ — @nstart/ui patches, moot (мы dropped @nstart/ui MR !52) - redesign/ — уже синхронизированы colors MR !71, layout MR !69 - uploads/ — user-provided screenshots, main delta = Export button --- .../src/components/editor/EditorInfoPanel.tsx | 19 +++++++++++++++++-- .../src/routes/dictionaries.$name.tsx | 11 +++++++++++ 2 files changed, 28 insertions(+), 2 deletions(-) diff --git a/ordinis-admin-ui/src/components/editor/EditorInfoPanel.tsx b/ordinis-admin-ui/src/components/editor/EditorInfoPanel.tsx index 664808a..56e2417 100644 --- a/ordinis-admin-ui/src/components/editor/EditorInfoPanel.tsx +++ b/ordinis-admin-ui/src/components/editor/EditorInfoPanel.tsx @@ -1,7 +1,7 @@ import { useMemo } from 'react' import { Link } from '@tanstack/react-router' import { useTranslation } from 'react-i18next' -import { ClockCounterClockwiseIcon, MapTrifoldIcon } from '@phosphor-icons/react' +import { ClockCounterClockwiseIcon, MapTrifoldIcon, DownloadSimpleIcon } from '@phosphor-icons/react' import { Badge } from '@/ui' import { useDictionaryDependents } from '@/api/queries' import type { DictionaryDetail } from '@/api/client' @@ -25,13 +25,15 @@ import { cn } from '@/lib/utils' export type EditorInfoPanelProps = { detail: DictionaryDetail recordCount: number - /** Optional action buttons (Time-travel / AOI filter) — bottom of panel + /** Optional action buttons (Time-travel / AOI / Export) — bottom of panel * per redesign prototype. Toggle handlers come from route's state. */ actions?: { onTimeTravel?: () => void timeTravelActive?: boolean onAoi?: () => void aoiActive?: boolean + onExport?: () => void + exportPending?: boolean } } @@ -109,6 +111,19 @@ export function EditorInfoPanel({ detail, recordCount, actions }: EditorInfoPane {t('aoi.button', { defaultValue: 'AOI фильтр…' })} )} + {actions.onExport && ( + + )} )} diff --git a/ordinis-admin-ui/src/routes/dictionaries.$name.tsx b/ordinis-admin-ui/src/routes/dictionaries.$name.tsx index 416fabf..bbaa025 100644 --- a/ordinis-admin-ui/src/routes/dictionaries.$name.tsx +++ b/ordinis-admin-ui/src/routes/dictionaries.$name.tsx @@ -570,6 +570,17 @@ function DictionaryDetail() { timeTravelActive: Boolean(timeTravelAt), onAoi: () => setAoiOpen(true), aoiActive: Boolean(aoi), + onExport: () => { + // Export all visible records (filtered + paginated set OR full + // dictionary). Если selection непустой — exports selection, + // иначе — все filtered records. + const keys = + selection.size > 0 + ? Array.from(selection) + : filteredRecords.map((r) => r.businessKey) + if (keys.length > 0) bulkExportMut.mutate(keys) + }, + exportPending: bulkExportMut.isPending, }} /> )}