Skip to content
Snippets Groups Projects
Commit f8a1e446 authored by Tom Robinson's avatar Tom Robinson Committed by GitHub
Browse files

Merge pull request #3479 from metabase/show-single-sql-db-in-editor

Show db name in SQL editor if you have a single DB. 
parents 807be058 96bc7edc
No related merge requests found
......@@ -199,9 +199,9 @@ export default class NativeQueryEditor extends Component {
let modeInfo = getModeInfo(this.props.query, this.props.databases);
// we only render a db selector if there are actually multiple to choose from
let dataSelectors = [];
if (this.state.showEditor && this.props.nativeDatabases && (this.props.nativeDatabases.length > 1 || modeInfo.requiresTable)) {
if (this.state.showEditor && this.props.nativeDatabases) {
// we only render a db selector if there are actually multiple to choose from
if (this.props.nativeDatabases.length > 1) {
dataSelectors.push(
<div key="db_selector" className="GuiBuilder-section GuiBuilder-data flex align-center">
......@@ -213,6 +213,10 @@ export default class NativeQueryEditor extends Component {
/>
</div>
)
} else {
dataSelectors.push(
<span className="p2 text-bold text-grey">{this.props.nativeDatabases[0].name}</span>
);
}
if (modeInfo.requiresTable) {
let databases = this.props.nativeDatabases,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment