Skip to content
Snippets Groups Projects
Unverified Commit cdf4a34e authored by Alexander Polyankin's avatar Alexander Polyankin Committed by GitHub
Browse files

Fix overflow issues with SQL errors (#27321)

parent 2351e7aa
No related branches found
No related tags found
No related merge requests found
......@@ -16,6 +16,7 @@ import {
QueryErrorTitle,
QueryErrorLink,
QueryErrorMessage,
QueryErrorContent,
} from "./VisualizationError.styled";
const EmailAdmin = () => {
......@@ -146,16 +147,18 @@ class VisualizationError extends Component {
}
return (
<QueryError className={className}>
<QueryErrorHeader>
<QueryErrorIcon name="warning" />
<QueryErrorTitle>{t`An error occurred in your query`}</QueryErrorTitle>
</QueryErrorHeader>
<QueryErrorMessage>{processedError}</QueryErrorMessage>
<QueryErrorLink
href={MetabaseSettings.learnUrl("debugging-sql/sql-syntax")}
>
{t`Learn how to debug SQL errors`}
</QueryErrorLink>
<QueryErrorContent>
<QueryErrorHeader>
<QueryErrorIcon name="warning" />
<QueryErrorTitle>{t`An error occurred in your query`}</QueryErrorTitle>
</QueryErrorHeader>
<QueryErrorMessage>{processedError}</QueryErrorMessage>
<QueryErrorLink
href={MetabaseSettings.learnUrl("debugging-sql/sql-syntax")}
>
{t`Learn how to debug SQL errors`}
</QueryErrorLink>
</QueryErrorContent>
</QueryError>
);
} else {
......
......@@ -5,17 +5,21 @@ import ExternalLink from "metabase/core/components/ExternalLink";
import { monospaceFontFamily } from "metabase/styled-components/theme";
export const QueryError = styled.div`
display: flex;
overflow: auto;
`;
export const QueryErrorContent = styled.div`
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
min-height: 100%;
`;
export const QueryErrorHeader = styled.div`
display: flex;
align-items: center;
margin-bottom: 1.5rem;
margin-bottom: 1rem;
`;
export const QueryErrorTitle = styled.div`
......@@ -44,15 +48,16 @@ export const QueryErrorMessage = styled.div`
border: 1px solid ${color("brand")};
border-radius: 0.5rem;
background-color: ${color("bg-light")};
overflow-wrap: break-word;
`;
export const QueryErrorLink = styled(ExternalLink)`
color: ${color("brand")};
margin: 1rem 0;
font-size: 0.75rem;
line-height: 1rem;
font-weight: bold;
text-decoration: none;
margin-top: 1.5rem;
&:hover {
text-decoration: underline;
......
......@@ -27,7 +27,7 @@ export const CodeText = styled.code`
font-size: 0.75rem;
line-height: 1.125rem;
white-space: pre;
word-break: break-all;
overflow-wrap: break-word;
`;
interface CodeCopyButtonProps {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment