diff --git a/admin-ui/.markdownlint-cli2.cjs b/admin-ui/.markdownlint-cli2.cjs index 7bff800cd8..5c33274984 100644 --- a/admin-ui/.markdownlint-cli2.cjs +++ b/admin-ui/.markdownlint-cli2.cjs @@ -10,6 +10,7 @@ module.exports = { 'dist', 'coverage', 'jans_config_api_orval', + 'jans_config_api', '.husky/_', '.claude', 'CHANGELOG.md', diff --git a/admin-ui/app/components/Accordion/AccordionIndicator.tsx b/admin-ui/app/components/Accordion/AccordionIndicator.tsx index 11460d713b..28e122f95e 100755 --- a/admin-ui/app/components/Accordion/AccordionIndicator.tsx +++ b/admin-ui/app/components/Accordion/AccordionIndicator.tsx @@ -1,12 +1,14 @@ -import React, { ReactNode } from 'react' +import React, { type ReactElement } from 'react' import clsx from 'clsx' import { Add, Remove } from '@/components/icons' import { Consumer } from './context' -interface AccordionIndicatorProps { - open?: ReactNode - closed?: ReactNode +type IndicatorElement = ReactElement<{ className?: string }> + +type AccordionIndicatorProps = { + open?: IndicatorElement + closed?: IndicatorElement className?: string } @@ -16,14 +18,11 @@ export const AccordionIndicator: React.FC = ({ className, }) => ( - {({ isOpen }) => - isOpen - ? React.cloneElement(open as React.ReactElement, { - className: clsx(className, (open as React.ReactElement).props.className), - }) - : React.cloneElement(closed as React.ReactElement, { - className: clsx(className, (closed as React.ReactElement).props.className), - }) - } + {({ isOpen }) => { + const indicator = isOpen ? open : closed + return React.cloneElement(indicator, { + className: clsx(className, indicator.props.className), + }) + }} ) diff --git a/admin-ui/app/components/App/AppMain.tsx b/admin-ui/app/components/App/AppMain.tsx index cbbe105b07..2fb4295ac0 100755 --- a/admin-ui/app/components/App/AppMain.tsx +++ b/admin-ui/app/components/App/AppMain.tsx @@ -1,12 +1,22 @@ import { BrowserRouter as Router } from 'react-router-dom' +import { ErrorBoundary } from 'react-error-boundary' import AuthenticatedRouteSelector from './AuthenticatedRouteSelector' +import GluuErrorScreen from 'Routes/Apps/Gluu/GluuErrorScreen' +import logUiCrash from '@/utils/logUiCrash' const basePath = process.env.BASE_PATH ?? '/admin' const AppMain = () => { return ( - + + logUiCrash(error instanceof Error ? error : new Error(String(error)), info.componentStack) + } + > + + ) } diff --git a/admin-ui/app/components/BootstrapWrappers/index.tsx b/admin-ui/app/components/BootstrapWrappers/index.tsx index d6e0a18396..d6c91ff015 100644 --- a/admin-ui/app/components/BootstrapWrappers/index.tsx +++ b/admin-ui/app/components/BootstrapWrappers/index.tsx @@ -134,10 +134,7 @@ export const Alert: React.FC = ({ ) } -export const Input = React.forwardRef< - HTMLInputElement | HTMLSelectElement | HTMLTextAreaElement, - InputProps ->(({ type = 'text', className, children, ...props }, ref) => { +export const Input = ({ ref, type = 'text', className, children, ...props }: InputProps) => { if (type === 'select') { return (