better query view initial state (#10431)

This commit is contained in:
Vadim Ogievetsky 2020-09-24 09:49:58 -07:00 committed by GitHub
parent dad69481f0
commit 89160c2f9b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 22 additions and 2 deletions

View File

@ -99,6 +99,17 @@ $nav-width: 250px;
width: 100%;
height: 100%;
}
.init-state {
background: #232d35;
text-align: center;
p {
position: relative;
top: 38%;
font-size: 14px;
}
}
}
}

View File

@ -16,7 +16,7 @@
* limitations under the License.
*/
import { Intent, Switch, Tooltip } from '@blueprintjs/core';
import { Code, Intent, Switch, Tooltip } from '@blueprintjs/core';
import axios from 'axios';
import classNames from 'classnames';
import { QueryResult, QueryRunner, SqlQuery } from 'druid-query-toolkit';
@ -295,9 +295,11 @@ export class QueryView extends React.PureComponent<QueryViewProps, QueryViewStat
}
componentDidMount(): void {
const { liveQueryMode, queryString } = this.state;
this.metadataQueryManager.runQuery(null);
if (this.state.liveQueryMode !== 'off') {
if (liveQueryMode !== 'off' && queryString) {
this.handleRun();
}
}
@ -522,6 +524,13 @@ export class QueryView extends React.PureComponent<QueryViewProps, QueryViewStat
}}
/>
)}
{queryResultState.isInit() && (
<div className="init-state">
<p>
Enter a query and click <Code>Run</Code>
</p>
</div>
)}
</div>
</SplitterLayout>
);