@@ -20,7 +20,7 @@ import React from 'react';
2020import PropTypes from 'prop-types' ;
2121import { bindActionCreators } from 'redux' ;
2222import { connect } from 'react-redux' ;
23- import { t } from '@superset-ui/core' ;
23+ import { css , styled , t } from '@superset-ui/core' ;
2424import throttle from 'lodash/throttle' ;
2525import ToastContainer from 'src/components/MessageToasts/ToastContainer' ;
2626import {
@@ -32,6 +32,69 @@ import * as Actions from 'src/SqlLab/actions/sqlLab';
3232import TabbedSqlEditors from '../TabbedSqlEditors' ;
3333import QueryAutoRefresh from '../QueryAutoRefresh' ;
3434
35+ const SqlLabStyles = styled . div `
36+ ${ ( { theme } ) => css `
37+ &.SqlLab {
38+ position: absolute;
39+ top: 0;
40+ right: 0;
41+ bottom: 0;
42+ left: 0;
43+ padding: 0 ${ theme . gridUnit * 2 } px;
44+
45+ pre {
46+ padding: 0 !important;
47+ margin: 0;
48+ border: none;
49+ font-size: ${ theme . typography . sizes . s } px;
50+ background: transparent !important;
51+ }
52+
53+ .north-pane {
54+ display: flex;
55+ flex-direction: column;
56+ }
57+
58+ .ace_editor {
59+ flex-grow: 1;
60+ }
61+
62+ .ace_content {
63+ height: 100%;
64+ }
65+
66+ .ant-tabs-content-holder {
67+ /* This is needed for Safari */
68+ height: 100%;
69+ }
70+
71+ .ant-tabs-content {
72+ height: 100%;
73+ position: relative;
74+ background-color: ${ theme . colors . grayscale . light5 } ;
75+ overflow-x: auto;
76+ overflow-y: auto;
77+
78+ > .ant-tabs-tabpane {
79+ position: absolute;
80+ top: 0;
81+ right: 0;
82+ bottom: 0;
83+ left: 0;
84+ }
85+ }
86+
87+ .ResultsModal .ant-modal-body {
88+ min-height: ${ theme . gridUnit * 140 } px;
89+ }
90+
91+ .ant-modal-body {
92+ overflow: auto;
93+ }
94+ }
95+ ` } ;
96+ ` ;
97+
3598class App extends React . PureComponent {
3699 constructor ( props ) {
37100 super ( props ) ;
@@ -99,15 +162,15 @@ class App extends React.PureComponent {
99162 return window . location . replace ( '/superset/sqllab/history/' ) ;
100163 }
101164 return (
102- < div className = "App SqlLab" >
165+ < SqlLabStyles className = "App SqlLab" >
103166 < QueryAutoRefresh
104167 queries = { queries }
105168 refreshQueries = { actions ?. refreshQueries }
106169 queriesLastUpdate = { queriesLastUpdate }
107170 />
108171 < TabbedSqlEditors />
109172 < ToastContainer />
110- </ div >
173+ </ SqlLabStyles >
111174 ) ;
112175 }
113176}
0 commit comments