mirror of
https://github.com/apache/superset.git
synced 2026-04-21 00:54:44 +00:00
Fixing the build [that I broke]
This commit is contained in:
@@ -26,27 +26,6 @@ class SqlEditorTopToolbar extends React.Component {
|
||||
this.fetchSchemas();
|
||||
this.fetchTables();
|
||||
}
|
||||
getSql(table) {
|
||||
let cols = '';
|
||||
table.columns.forEach(function (col, i) {
|
||||
cols += col.name;
|
||||
if (i < table.columns.length - 1) {
|
||||
cols += ', ';
|
||||
}
|
||||
});
|
||||
return `SELECT ${cols}\nFROM ${table.name}`;
|
||||
}
|
||||
popTab(table) {
|
||||
const qe = {
|
||||
id: shortid.generate(),
|
||||
title: table.name,
|
||||
dbId: table.dbId,
|
||||
schema: table.schema,
|
||||
autorun: true,
|
||||
sql: this.getSql(table),
|
||||
};
|
||||
this.props.actions.addQueryEditor(qe);
|
||||
}
|
||||
fetchTables(dbId, schema) {
|
||||
const actualDbId = dbId || this.props.queryEditor.dbId;
|
||||
if (actualDbId) {
|
||||
@@ -166,7 +145,9 @@ class SqlEditorTopToolbar extends React.Component {
|
||||
</div>
|
||||
<hr />
|
||||
<div className="m-t-5">
|
||||
{tables.map((table) => <TableElement table={table} queryEditor={this.props.queryEditor} />)}
|
||||
{tables.map((table) => (
|
||||
<TableElement table={table} queryEditor={this.props.queryEditor} />
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
|
||||
@@ -7,6 +7,9 @@ import * as Actions from '../actions';
|
||||
import shortid from 'shortid';
|
||||
|
||||
class TableElement extends React.Component {
|
||||
setSelectStar() {
|
||||
this.props.actions.queryEditorSetSql(this.props.queryEditor, this.selectStar());
|
||||
}
|
||||
selectStar() {
|
||||
let cols = '';
|
||||
this.props.table.columns.forEach((col, i) => {
|
||||
@@ -17,9 +20,6 @@ class TableElement extends React.Component {
|
||||
});
|
||||
return `SELECT ${cols}\nFROM ${this.props.table.name}`;
|
||||
}
|
||||
setSelectStar () {
|
||||
this.props.actions.queryEditorSetSql(this.props.queryEditor, this.selectStar());
|
||||
}
|
||||
popSelectStar() {
|
||||
const qe = {
|
||||
id: shortid.generate(),
|
||||
|
||||
Reference in New Issue
Block a user