fix: Undefined error when viewing query in Explore + visual fixes (#34869)

This commit is contained in:
Kamil Gabryjelski
2025-08-28 12:40:29 +02:00
committed by GitHub
parent 836540e8c9
commit 5566eb8dd6
7 changed files with 128 additions and 39 deletions

View File

@@ -40,11 +40,10 @@ const QueryLabel = styled.div`
`;
const QueryViewToggle = styled.div`
margin: 0 0 ${({ theme }) => theme.sizeUnit * 6}px 0;
display: flex;
`;
const TabButton = styled.div`
display: inline;
font-size: ${({ theme }) => theme.fontSizeSM}px;
padding: ${({ theme }) => theme.sizeUnit * 2}px
${({ theme }) => theme.sizeUnit * 4}px;
@@ -55,9 +54,7 @@ const TabButton = styled.div`
&:focus,
&:hover {
background: ${({ theme }) => theme.colorPrimaryBg};
border-bottom: none;
border-radius: ${({ theme }) => theme.borderRadius}px;
margin-bottom: ${({ theme }) => theme.sizeUnit * 2}px;
}
&:hover:not(.active) {
@@ -110,6 +107,7 @@ function QueryPreviewModal({
<Button
data-test="previous-query"
key="previous-query"
buttonStyle="secondary"
disabled={disablePrevious}
onClick={() => handleDataChange(true)}
>
@@ -118,6 +116,7 @@ function QueryPreviewModal({
<Button
data-test="next-query"
key="next-query"
buttonStyle="secondary"
disabled={disableNext}
onClick={() => handleDataChange(false)}
>
@@ -126,7 +125,6 @@ function QueryPreviewModal({
<Button
data-test="open-in-sql-lab"
key="open-in-sql-lab"
buttonStyle="primary"
onClick={() => openInSqlLab(id)}
>
{t('Open in SQL Lab')}

View File

@@ -34,7 +34,7 @@ const QueryTitle = styled.div`
const QueryLabel = styled.div`
color: ${({ theme }) => theme.colorTextLabel};
font-size: ${({ theme }) => theme.fontSize}px;
padding: 4px 0 16px 0;
padding-top: ${({ theme }) => theme.sizeUnit}px;
`;
const StyledModal = styled(Modal)`
@@ -89,6 +89,7 @@ const SavedQueryPreviewModal: FunctionComponent<
<Button
data-test="previous-saved-query"
key="previous-saved-query"
buttonStyle="secondary"
disabled={disablePrevious}
onClick={() => handleDataChange(true)}
>
@@ -97,6 +98,7 @@ const SavedQueryPreviewModal: FunctionComponent<
<Button
data-test="next-saved-query"
key="next-saved-query"
buttonStyle="secondary"
disabled={disableNext}
onClick={() => handleDataChange(false)}
>
@@ -105,7 +107,6 @@ const SavedQueryPreviewModal: FunctionComponent<
<Button
data-test="open-in-sql-lab"
key="open-in-sql-lab"
buttonStyle="primary"
onClick={({ metaKey }) =>
openInSqlLab(savedQuery.id, Boolean(metaKey))
}

View File

@@ -29,7 +29,6 @@ import copyTextToClipboard from 'src/utils/copy';
const SyntaxHighlighterWrapper = styled.div`
position: relative;
margin-top: -24px;
&:hover {
.copy-button {