Skip to content

Commit

Permalink
Adding alpha label to the SQL LAb navbar entry
Browse files Browse the repository at this point in the history
  • Loading branch information
mistercrunch committed Aug 30, 2016
1 parent 747b747 commit 14d59ec
Show file tree
Hide file tree
Showing 12 changed files with 48 additions and 190 deletions.
10 changes: 5 additions & 5 deletions caravel/assets/javascripts/SqlLab/components/SouthPane.jsx
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
import { Panel, Tab, Tabs } from 'react-bootstrap';
import { Alert, Panel, Tab, Tabs } from 'react-bootstrap';
import QueryHistory from './QueryHistory';
import ResultSet from './ResultSet';
import React from 'react';

const SouthPane = (props) => {
let results;
const SouthPane = function (props) {
let results = <div />;
if (props.latestQuery) {
if (props.latestQuery.state === 'running') {
results = (
<img className="loading" alt="Loading.." src="/static/assets/images/loading.gif" />
);
} else if (props.latestQuery.state === 'failed') {
results = <div className="alert alert-danger">{props.latestQuery.msg}</div>;
results = <Alert bsStyle="danger">{props.latestQuery.msg}</Alert>;
} else if (props.latestQuery.state === 'success') {
results = <ResultSet showControls query={props.latestQuery} />;
}
} else {
results = <div className="alert alert-info">Run a query to display results here</div>;
results = <Alert bsStyle="info">Run a query to display results here</Alert>;
}
return (
<Tabs bsStyle="tabs">
Expand Down
5 changes: 4 additions & 1 deletion caravel/assets/javascripts/SqlLab/components/SqlEditor.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -99,12 +99,15 @@ class SqlEditor extends React.Component {
}
},
error(err) {
let msg = '';
let msg;
try {
msg = err.responseJSON.error;
} catch (e) {
msg = (err.responseText) ? err.responseText : e;
}
if (typeof(msg) !== 'string') {
msg = JSON.stringify(msg);
}
that.props.actions.queryFailed(query, msg);
},
});
Expand Down
95 changes: 0 additions & 95 deletions caravel/assets/javascripts/sql.js

This file was deleted.

2 changes: 1 addition & 1 deletion caravel/assets/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
"react-bootstrap-table": "^2.3.8",
"react-dom": "^0.14.8",
"react-draggable": "^2.1.2",
"react-grid-layout": "^0.12.4",
"react-grid-layout": "^0.13.1",
"react-map-gl": "^1.0.0-beta-10",
"react-redux": "^4.4.5",
"react-resizable": "^1.3.3",
Expand Down
1 change: 0 additions & 1 deletion caravel/assets/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ const config = {
dashboard: APP_DIR + '/javascripts/dashboard/Dashboard.jsx',
explore: APP_DIR + '/javascripts/explore/explore.jsx',
welcome: APP_DIR + '/javascripts/welcome.js',
sql: APP_DIR + '/javascripts/sql.js',
standalone: APP_DIR + '/javascripts/standalone.js',
common: APP_DIR + '/javascripts/common.js',
sqllab: APP_DIR + '/javascripts/SqlLab/index.jsx',
Expand Down
2 changes: 2 additions & 0 deletions caravel/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,8 @@ class CeleryConfig(object):
CELERY_CONFIG = CeleryConfig
"""
CELERY_CONFIG = None
SQL_CELERY_DB_FILE_PATH = os.path.join(DATA_DIR, 'celery.db')
SQL_CELERY_RESULTS_DB_FILE_PATH = os.path.join(DATA_DIR, 'celery.db')

# The db id here results in selecting this one as a default in SQL Lab
DEFAULT_DB_ID = None
Expand Down
4 changes: 2 additions & 2 deletions caravel/migrations/versions/ad82a75afd82_add_query_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@ def upgrade():
sa.Column('progress', sa.Integer(), nullable=True),
sa.Column('rows', sa.Integer(), nullable=True),
sa.Column('error_message', sa.Text(), nullable=True),
sa.Column('start_time', sa.Numeric(precision=16, scale=6), nullable=True),
sa.Column('start_time', sa.Numeric(precision=20, scale=6), nullable=True),
sa.Column('changed_on', sa.DateTime(), nullable=True),
sa.Column('end_time', sa.Numeric(precision=16, scale=6), nullable=True),
sa.Column('end_time', sa.Numeric(precision=20, scale=6), nullable=True),
sa.ForeignKeyConstraint(['database_id'], [u'dbs.id'], ),
sa.ForeignKeyConstraint(['user_id'], [u'ab_user.id'], ),
sa.PrimaryKeyConstraint('id')
Expand Down
51 changes: 0 additions & 51 deletions caravel/templates/caravel/sql.html

This file was deleted.

2 changes: 1 addition & 1 deletion caravel/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,7 @@ def json_iso_dttm_ser(obj):


def datetime_to_epoch(dttm):
return time.mktime(dttm.timetuple()) + dttm.microsecond/1000000.0
return (dttm - EPOCH).total_seconds() * 1000


def now_as_float():
Expand Down
2 changes: 1 addition & 1 deletion caravel/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -1598,7 +1598,7 @@ class CssTemplateModelView(CaravelModelView, DeleteMixin):
category_icon='')

appbuilder.add_link(
"SQL Lab",
'SQL Lab <span class="label label-danger">alpha</span>',
href='/caravel/sqllab',
icon="fa-flask")

Expand Down
Loading

0 comments on commit 14d59ec

Please sign in to comment.