Skip to content
Closed
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -124,3 +124,4 @@ docker/*local*
# Jest test report
test-report.html
superset/static/stats/statistics.html
.aider*
2 changes: 2 additions & 0 deletions superset-frontend/src/components/ErrorBoundary/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ export interface ErrorBoundaryProps {
children: ReactNode;
onError?: (error: Error, info: ErrorInfo) => void;
showMessage?: boolean;
style?: React.CSSProperties;
}

interface ErrorBoundaryState {
Expand Down Expand Up @@ -59,6 +60,7 @@ export default class ErrorBoundary extends Component<
errorType={t('Unexpected error')}
message={firstLine}
descriptionDetails={info?.componentStack}
style={this.props.style}
/>
);
}
Expand Down
3 changes: 3 additions & 0 deletions superset-frontend/src/components/ErrorMessage/ErrorAlert.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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
style?: React.CSSProperties;
}

const ErrorAlert: React.FC<ErrorAlertProps> = ({
Expand All @@ -49,6 +50,7 @@ const ErrorAlert: React.FC<ErrorAlertProps> = ({
children,
closable = true,
showIcon = true,
style,
}) => {
const [isDescriptionVisible, setIsDescriptionVisible] = useState(
!descriptionDetailsCollapsed,
Expand Down Expand Up @@ -107,6 +109,7 @@ const ErrorAlert: React.FC<ErrorAlertProps> = ({
type={type}
showIcon
closable={closable}
style={style}
>
<strong>{errorType}</strong>
{message && (
Expand Down
10 changes: 3 additions & 7 deletions superset-frontend/src/views/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -83,13 +83,9 @@ const App = () => (
{routes.map(({ path, Component, props = {}, Fallback = Loading }) => (
<Route path={path} key={path}>
<Suspense fallback={<Fallback />}>
<Layout.Content>
<div style={{ padding: '16px' }}>

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that was the issue here ^^^

<ErrorBoundary>
<Component user={bootstrapData.user} {...props} />
</ErrorBoundary>
</div>
</Layout.Content>
<ErrorBoundary style={{ margin: '16px' }}>

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wanted to do theme.sizeUnit * 4 but theme isn't in context here so bailed and went for hard-coded

<Component user={bootstrapData.user} {...props} />
</ErrorBoundary>
</Suspense>
</Route>
))}
Expand Down