diff --git a/ordinis-admin-ui/src/auth/AuthBadge.tsx b/ordinis-admin-ui/src/auth/AuthBadge.tsx index a8a0736..e12d656 100644 --- a/ordinis-admin-ui/src/auth/AuthBadge.tsx +++ b/ordinis-admin-ui/src/auth/AuthBadge.tsx @@ -1,6 +1,6 @@ import { useAuth } from 'react-oidc-context' import { useTranslation } from 'react-i18next' -import { Button, IconButton } from '@/ui' +import { IconButton } from '@/ui' import { SignInIcon, SignOutIcon, UserIcon } from '@phosphor-icons/react' /** @@ -24,27 +24,30 @@ export function AuthBadge() { if (auth.error) { // Не валим UI — просто кнопка для повтора login. return ( - + ) } if (!auth.isAuthenticated) { + // Compact sign-in button matching TopBar control style (h-8, surface bg). + // Previously Button variant="primary" — слишком крупно, выбивалось из + // toolbar style per user feedback ("кнопка Войти слишком большая"). return ( - + ) } diff --git a/ordinis-admin-ui/src/auth/RequireAuth.tsx b/ordinis-admin-ui/src/auth/RequireAuth.tsx index 3b7b41f..7e9167c 100644 --- a/ordinis-admin-ui/src/auth/RequireAuth.tsx +++ b/ordinis-admin-ui/src/auth/RequireAuth.tsx @@ -53,18 +53,13 @@ export function RequireAuth({ children }: { children: ReactNode }) { ) } - // Keycloak unreachable / OIDC discovery failed — показываем ошибку, но НЕ - // блокируем UI (guest mode всё равно работает на read-api без JWT). Юзер - // может видеть PUBLIC данные пока Keycloak вернётся в строй. + // Keycloak unreachable / OIDC discovery failed — раньше показывали amber + // banner вверху страницы, но per user feedback ("Авторизация недоступна: + // Failed to fetch.?") это noise: anonymous mode работает без auth, error + // banner лишь пугает. Тихо рендерим children в guest mode — AuthBadge + // в TopBar показывает Sign in для retry. if (auth.error && !auth.isAuthenticated) { - return ( - <> -
- Авторизация недоступна: {auth.error.message}. Доступен просмотр публичных данных. -
- {children} - - ) + return <>{children} } // ВАЖНО: НЕ блокируем UI пока {@code auth.isLoading=true}. Initial OIDC diff --git a/ordinis-admin-ui/src/components/editor/EditorInfoPanel.tsx b/ordinis-admin-ui/src/components/editor/EditorInfoPanel.tsx index d32f2f6..671017a 100644 --- a/ordinis-admin-ui/src/components/editor/EditorInfoPanel.tsx +++ b/ordinis-admin-ui/src/components/editor/EditorInfoPanel.tsx @@ -41,9 +41,13 @@ export type EditorInfoPanelProps = { onExport?: () => void exportPending?: boolean } + /** Optional banner slot — WorkflowBanner / status notices живут в + * left panel per user feedback ("плашки пусть в левой панели будут"). + * Renders at top of panel before scope chip. */ + banner?: React.ReactNode } -export function EditorInfoPanel({ detail, recordCount, actions }: EditorInfoPanelProps) { +export function EditorInfoPanel({ detail, recordCount, actions, banner }: EditorInfoPanelProps) { const { t } = useTranslation() const { data: refByRaw } = useDictionaryDependents(detail.name) @@ -51,7 +55,13 @@ export function EditorInfoPanel({ detail, recordCount, actions }: EditorInfoPane const incomingDeps: SchemaDependent[] = useMemo(() => refByRaw ?? [], [refByRaw]) return ( -