Skip to content

Commit

Permalink
Fixing the build [that I broke]
Browse files Browse the repository at this point in the history
  • Loading branch information
mistercrunch committed Aug 31, 2016
1 parent 508feb2 commit 3f88949
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 25 deletions.
25 changes: 3 additions & 22 deletions caravel/assets/javascripts/SqlLab/components/SqlEditorLeft.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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>
);
Expand Down
6 changes: 3 additions & 3 deletions caravel/assets/javascripts/SqlLab/components/TableElement.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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) => {
Expand All @@ -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(),
Expand Down

0 comments on commit 3f88949

Please sign in to comment.