diff --git a/superset-frontend/packages/superset-ui-core/src/style/index.tsx b/superset-frontend/packages/superset-ui-core/src/style/index.tsx index c4964172b..d448b81e7 100644 --- a/superset-frontend/packages/superset-ui-core/src/style/index.tsx +++ b/superset-frontend/packages/superset-ui-core/src/style/index.tsx @@ -27,6 +27,7 @@ export { ThemeProvider, CacheProvider as EmotionCacheProvider, withTheme, + type SerializedStyles, } from '@emotion/react'; export { default as createEmotionCache } from '@emotion/cache'; diff --git a/superset-frontend/src/components/ErrorBoundary/index.tsx b/superset-frontend/src/components/ErrorBoundary/index.tsx index 2fec6a676..c7e60d577 100644 --- a/superset-frontend/src/components/ErrorBoundary/index.tsx +++ b/superset-frontend/src/components/ErrorBoundary/index.tsx @@ -24,6 +24,7 @@ export interface ErrorBoundaryProps { children: ReactNode; onError?: (error: Error, info: ErrorInfo) => void; showMessage?: boolean; + className?: string; } interface ErrorBoundaryState { @@ -51,14 +52,16 @@ export default class ErrorBoundary extends Component< render() { const { error, info } = this.state; + const { showMessage, className } = this.props; if (error) { const firstLine = error.toString().split('\n')[0]; - if (this.props.showMessage) { + if (showMessage) { return ( ); } diff --git a/superset-frontend/src/components/ErrorMessage/ErrorAlert.tsx b/superset-frontend/src/components/ErrorMessage/ErrorAlert.tsx index 50f21bf0f..4ad75eb21 100644 --- a/superset-frontend/src/components/ErrorMessage/ErrorAlert.tsx +++ b/superset-frontend/src/components/ErrorMessage/ErrorAlert.tsx @@ -35,6 +35,7 @@ export interface ErrorAlertProps { children?: React.ReactNode; // Additional content to show in the modal closable?: boolean; // Show close button, default true showIcon?: boolean; // Show icon, default true + className?: string; } const ErrorAlert: React.FC = ({ @@ -49,6 +50,7 @@ const ErrorAlert: React.FC = ({ children, closable = true, showIcon = true, + className, }) => { const [isDescriptionVisible, setIsDescriptionVisible] = useState( !descriptionDetailsCollapsed, @@ -66,7 +68,7 @@ const ErrorAlert: React.FC = ({ const color = type === 'warning' ? theme.colors.warning.base : theme.colors.error.base; return ( -
+
{icon} {errorType}
@@ -100,13 +102,13 @@ const ErrorAlert: React.FC = ({ )}
); - const renderAlert = (closable: boolean) => ( {errorType} {message && ( diff --git a/superset-frontend/src/views/App.tsx b/superset-frontend/src/views/App.tsx index 8b4c5e801..3d1cfc3e5 100644 --- a/superset-frontend/src/views/App.tsx +++ b/superset-frontend/src/views/App.tsx @@ -25,6 +25,7 @@ import { useLocation, } from 'react-router-dom'; import { bindActionCreators } from 'redux'; +import { css } from '@superset-ui/core'; import { GlobalStyles } from 'src/GlobalStyles'; import ErrorBoundary from 'src/components/ErrorBoundary'; import Loading from 'src/components/Loading'; @@ -83,12 +84,19 @@ const App = () => ( {routes.map(({ path, Component, props = {}, Fallback = Loading }) => ( }> - -
- - - -
+ + + +