mirror of
https://github.com/apache/superset.git
synced 2026-04-20 08:34:37 +00:00
[hotfix] getting presto on track
This commit is contained in:
committed by
Maxime Beauchemin
parent
9f8eef498c
commit
508feb2bad
@@ -36,9 +36,6 @@ class SqlEditorTopToolbar extends React.Component {
|
||||
});
|
||||
return `SELECT ${cols}\nFROM ${table.name}`;
|
||||
}
|
||||
selectStar(table) {
|
||||
this.props.actions.queryEditorSetSql(this.props.queryEditor, this.getSql(table));
|
||||
}
|
||||
popTab(table) {
|
||||
const qe = {
|
||||
id: shortid.generate(),
|
||||
@@ -169,7 +166,7 @@ class SqlEditorTopToolbar extends React.Component {
|
||||
</div>
|
||||
<hr />
|
||||
<div className="m-t-5">
|
||||
{tables.map((table) => <TableElement table={table} />)}
|
||||
{tables.map((table) => <TableElement table={table} queryEditor={this.props.queryEditor} />)}
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
|
||||
@@ -15,13 +15,18 @@ class TableElement extends React.Component {
|
||||
cols += ', ';
|
||||
}
|
||||
});
|
||||
const sql = `SELECT ${cols}\nFROM ${this.props.table.name}`;
|
||||
return `SELECT ${cols}\nFROM ${this.props.table.name}`;
|
||||
}
|
||||
setSelectStar () {
|
||||
this.props.actions.queryEditorSetSql(this.props.queryEditor, this.selectStar());
|
||||
}
|
||||
popSelectStar() {
|
||||
const qe = {
|
||||
id: shortid.generate(),
|
||||
title: this.props.table.name,
|
||||
dbId: this.props.table.dbId,
|
||||
autorun: true,
|
||||
sql,
|
||||
sql: this.selectStar(),
|
||||
};
|
||||
this.props.actions.addQueryEditor(qe);
|
||||
}
|
||||
@@ -68,13 +73,13 @@ class TableElement extends React.Component {
|
||||
<ButtonGroup className="ws-el-controls pull-right">
|
||||
<Link
|
||||
className="fa fa-pencil m-l-2"
|
||||
onClick={this.selectStar.bind(this)}
|
||||
onClick={this.setSelectStar.bind(this)}
|
||||
tooltip="Run query in a new tab"
|
||||
href="#"
|
||||
/>
|
||||
<Link
|
||||
className="fa fa-plus-circle m-l-2"
|
||||
onClick={this.selectStar.bind(this)}
|
||||
onClick={this.popSelectStar.bind(this)}
|
||||
tooltip="Run query in a new tab"
|
||||
href="#"
|
||||
/>
|
||||
@@ -92,6 +97,7 @@ class TableElement extends React.Component {
|
||||
}
|
||||
TableElement.propTypes = {
|
||||
table: React.PropTypes.object,
|
||||
queryEditor: React.PropTypes.object,
|
||||
actions: React.PropTypes.object,
|
||||
};
|
||||
TableElement.defaultProps = {
|
||||
|
||||
Reference in New Issue
Block a user