Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(sqllab): tracking url and error alert padding #20937

Merged
merged 1 commit into from
Aug 2, 2022
Merged
Changes from all 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
17 changes: 8 additions & 9 deletions superset-frontend/src/SqlLab/components/ResultSet/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,12 @@ interface ResultSetState {
alertIsOpen: boolean;
}

const Styles = styled.div`
const ResultlessStyles = styled.div`
position: relative;
minheight: 100px;
[role='alert'] {
margin-top: ${({ theme }) => theme.gridUnit * 2}px;
}
.sql-result-track-job {
margin-top: ${({ theme }) => theme.gridUnit * 2}px;
}
Expand Down Expand Up @@ -113,10 +116,6 @@ const ResultSetButtons = styled.div`
padding-right: ${({ theme }) => 2 * theme.gridUnit}px;
`;

const ResultSetErrorMessage = styled.div`
padding-top: ${({ theme }) => 4 * theme.gridUnit}px;
`;

export default class ResultSet extends React.PureComponent<
ResultSetProps,
ResultSetState
Expand Down Expand Up @@ -448,7 +447,7 @@ export default class ResultSet extends React.PureComponent<
}
if (query.state === 'failed') {
return (
<ResultSetErrorMessage>
<ResultlessStyles>
<ErrorMessageWithStackTrace
title={t('Database error')}
error={query?.errors?.[0]}
Expand All @@ -458,7 +457,7 @@ export default class ResultSet extends React.PureComponent<
source="sqllab"
/>
{trackingUrl}
</ResultSetErrorMessage>
</ResultlessStyles>
);
}
if (query.state === 'success' && query.ctas) {
Expand Down Expand Up @@ -589,7 +588,7 @@ export default class ResultSet extends React.PureComponent<
: null;

return (
<Styles>
<ResultlessStyles>
<div>{!progressBar && <Loading position="normal" />}</div>
{/* show loading bar whenever progress bar is completed but needs time to render */}
<div>{query.progress === 100 && <Loading position="normal" />}</div>
Expand All @@ -599,7 +598,7 @@ export default class ResultSet extends React.PureComponent<
</div>
<div>{query.progress !== 100 && progressBar}</div>
{trackingUrl && <div>{trackingUrl}</div>}
</Styles>
</ResultlessStyles>
);
}
}