diff --git a/ordinis-admin-ui/src/api/queries.ts b/ordinis-admin-ui/src/api/queries.ts index 3832ad0..40cab57 100644 --- a/ordinis-admin-ui/src/api/queries.ts +++ b/ordinis-admin-ui/src/api/queries.ts @@ -502,7 +502,8 @@ export const useLiveRecord = (dict: string | undefined, businessKey: string | un }) export const useDictionaries = () => useQuery(dictionariesQuery) -export const useDictionaryDetail = (name: string) => useQuery(dictionaryDetailQuery(name)) +export const useDictionaryDetail = (name: string | undefined) => + useQuery({ ...dictionaryDetailQuery(name ?? ''), enabled: Boolean(name) }) export const useRecords = ( dictionaryName: string, scopeCsv: string, diff --git a/ordinis-admin-ui/src/components/editor/EditorInfoPanel.tsx b/ordinis-admin-ui/src/components/editor/EditorInfoPanel.tsx index 092b192..664808a 100644 --- a/ordinis-admin-ui/src/components/editor/EditorInfoPanel.tsx +++ b/ordinis-admin-ui/src/components/editor/EditorInfoPanel.tsx @@ -1,9 +1,11 @@ import { useMemo } from 'react' import { Link } from '@tanstack/react-router' import { useTranslation } from 'react-i18next' +import { ClockCounterClockwiseIcon, MapTrifoldIcon } from '@phosphor-icons/react' import { Badge } from '@/ui' import { useDictionaryDependents } from '@/api/queries' import type { DictionaryDetail } from '@/api/client' +import { cn } from '@/lib/utils' /** * EditorInfoPanel — left rail с dict metadata per handoff prototype Screen 2. @@ -23,9 +25,17 @@ import type { DictionaryDetail } from '@/api/client' export type EditorInfoPanelProps = { detail: DictionaryDetail recordCount: number + /** Optional action buttons (Time-travel / AOI filter) — bottom of panel + * per redesign prototype. Toggle handlers come from route's state. */ + actions?: { + onTimeTravel?: () => void + timeTravelActive?: boolean + onAoi?: () => void + aoiActive?: boolean + } } -export function EditorInfoPanel({ detail, recordCount }: EditorInfoPanelProps) { +export function EditorInfoPanel({ detail, recordCount, actions }: EditorInfoPanelProps) { const { t } = useTranslation() const { data: refByRaw } = useDictionaryDependents(detail.name) @@ -64,6 +74,44 @@ export function EditorInfoPanel({ detail, recordCount }: EditorInfoPanelProps) { + {/* Actions — bottom buttons per redesign prototype: Time-travel + AOI */} + {actions && ( +
+ {actions.onTimeTravel && ( + + )} + {actions.onAoi && ( + + )} +
+ )} + {/* Relations */} {(outgoingNames.length > 0 || incomingNames.length > 0) && (
void }) { )} - {/* Breadcrumb — left */} + {/* Breadcrumb — left. Editor route ('/dictionaries/$name') получает + * augmented breadcrumb с displayName + version (per redesign prototype). + * Остальные routes: regular path-based breadcrumb. */}