Skip to content

Commit

Permalink
fix(sqllab): tracking url and error alert padding (apache#20937)
Browse files Browse the repository at this point in the history
(cherry picked from commit ac58582)
  • Loading branch information
ktmud authored and jinghua-qa committed Aug 8, 2022
1 parent 21e3f74 commit f32e5d5
Showing 1 changed file with 8 additions and 9 deletions.
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 @@ -445,7 +444,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 @@ -455,7 +454,7 @@ export default class ResultSet extends React.PureComponent<
source="sqllab"
/>
{trackingUrl}
</ResultSetErrorMessage>
</ResultlessStyles>
);
}
if (query.state === 'success' && query.ctas) {
Expand Down Expand Up @@ -586,7 +585,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 @@ -596,7 +595,7 @@ export default class ResultSet extends React.PureComponent<
</div>
<div>{query.progress !== 100 && progressBar}</div>
{trackingUrl && <div>{trackingUrl}</div>}
</Styles>
</ResultlessStyles>
);
}
}

0 comments on commit f32e5d5

Please sign in to comment.