diff --git a/superset/assets/src/SqlLab/components/CopyQueryTabUrl.jsx b/superset/assets/src/SqlLab/components/CopyQueryTabUrl.jsx
index fed7c28bbe9..e48fe1be8fe 100644
--- a/superset/assets/src/SqlLab/components/CopyQueryTabUrl.jsx
+++ b/superset/assets/src/SqlLab/components/CopyQueryTabUrl.jsx
@@ -27,10 +27,13 @@ export default class CopyQueryTabUrl extends React.PureComponent {
inMenu
copyNode={(
-
{t('share query')}
+
+
+
+
{t('Share query')}
)}
- tooltipText={t('copy URL to clipboard')}
+ tooltipText={t('Copy URL to clipboard')}
shouldShowText={false}
getText={this.getUrl.bind(this)}
/>
diff --git a/superset/assets/src/SqlLab/components/SouthPane.jsx b/superset/assets/src/SqlLab/components/SouthPane.jsx
index b55fdda422a..65d17f7768c 100644
--- a/superset/assets/src/SqlLab/components/SouthPane.jsx
+++ b/superset/assets/src/SqlLab/components/SouthPane.jsx
@@ -55,7 +55,7 @@ class SouthPane extends React.PureComponent {
}
const dataPreviewTabs = props.dataPreviewQueries.map(query => (
diff --git a/superset/assets/src/SqlLab/components/SqlEditorLeftBar.jsx b/superset/assets/src/SqlLab/components/SqlEditorLeftBar.jsx
index a255ca631b3..d20d494bcfb 100644
--- a/superset/assets/src/SqlLab/components/SqlEditorLeftBar.jsx
+++ b/superset/assets/src/SqlLab/components/SqlEditorLeftBar.jsx
@@ -2,7 +2,7 @@
/* eslint no-undef: 2 */
import React from 'react';
import PropTypes from 'prop-types';
-import { Button } from 'react-bootstrap';
+import { ControlLabel, Button } from 'react-bootstrap';
import Select from 'react-virtualized-select';
import createFilterOptions from 'react-select-fast-filter-options';
@@ -189,13 +189,25 @@ class SqlEditorLeftBar extends React.PureComponent {
onChange={this.changeSchema.bind(this)}
/>
+
+
+ {t('See table schema')}
+
+
+ ({this.state.tableOptions.length}
+ {t('in')}
+
+ {this.props.queryEditor.schema}
+ )
+
+
{this.props.queryEditor.schema &&
diff --git a/superset/assets/src/SqlLab/components/TableElement.jsx b/superset/assets/src/SqlLab/components/TableElement.jsx
index 624a0ed1c76..b1e53a9c740 100644
--- a/superset/assets/src/SqlLab/components/TableElement.jsx
+++ b/superset/assets/src/SqlLab/components/TableElement.jsx
@@ -165,10 +165,10 @@ class TableElement extends React.PureComponent {
className="table-name"
onClick={(e) => { this.toggleTable(e); }}
>
- {table.name}
-
+
+ `{table.name}`
@@ -197,11 +197,10 @@ class TableElement extends React.PureComponent {
>
{this.renderWell()}
-
+
{cols && cols.map(col => (
))}
-
@@ -217,7 +216,7 @@ class TableElement extends React.PureComponent {
transitionAppear
onExited={this.removeFromStore.bind(this)}
>
-
+
{this.renderHeader()}
{this.renderBody()}
diff --git a/superset/assets/src/SqlLab/components/TemplateParamsEditor.jsx b/superset/assets/src/SqlLab/components/TemplateParamsEditor.jsx
index d22b9abfaec..8a3387ad546 100644
--- a/superset/assets/src/SqlLab/components/TemplateParamsEditor.jsx
+++ b/superset/assets/src/SqlLab/components/TemplateParamsEditor.jsx
@@ -65,7 +65,7 @@ export default class TemplateParamsEditor extends React.Component {
(example:
{'{"my_table": "foo"}'}),
and they become available
in your SQL (example:
SELECT * FROM {'{{ my_table }}'} )
- by using
+ by using
li.active > a:focus {
padding-bottom: 8px;
}
+.nav-tabs .dropdown-toggle.btn .caret {
+ margin-top: -12px;
+}
+.nav-tabs .ddbtn-tab {
+ margin-left: 5px;
+ padding-right: 0;
+}
+.icon-container {
+ display: inline-block;
+ width: 30px;
+ text-align: center;
+}
.search-date-filter-container {
display: flex;
diff --git a/superset/assets/src/SqlLab/reducers.js b/superset/assets/src/SqlLab/reducers.js
index a55a0227210..ec880278f99 100644
--- a/superset/assets/src/SqlLab/reducers.js
+++ b/superset/assets/src/SqlLab/reducers.js
@@ -81,7 +81,7 @@ export const sqlLabReducer = function (state = {}, action) {
at.id = shortid.generate();
// for new table, associate Id of query for data preview
at.dataPreviewQueryId = null;
- let newState = addToArr(state, 'tables', at);
+ let newState = addToArr(state, 'tables', at, true);
if (action.query) {
newState = alterInArr(newState, 'tables', at, { dataPreviewQueryId: action.query.id });
}
diff --git a/superset/assets/src/reduxUtils.js b/superset/assets/src/reduxUtils.js
index 8b1062a8cab..4a8d944c4f9 100644
--- a/superset/assets/src/reduxUtils.js
+++ b/superset/assets/src/reduxUtils.js
@@ -54,13 +54,17 @@ export function getFromArr(arr, id) {
return obj;
}
-export function addToArr(state, arrKey, obj) {
+export function addToArr(state, arrKey, obj, prepend = false) {
const newObj = Object.assign({}, obj);
if (!newObj.id) {
newObj.id = shortid.generate();
}
const newState = {};
- newState[arrKey] = [...state[arrKey], newObj];
+ if (prepend) {
+ newState[arrKey] = [newObj, ...state[arrKey]];
+ } else {
+ newState[arrKey] = [...state[arrKey], newObj];
+ }
return Object.assign({}, state, newState);
}