From cdd348ab94b075cf3505b7e2dd84206dc3aede82 Mon Sep 17 00:00:00 2001 From: Krist Wongsuphasawat Date: Sun, 19 Aug 2018 22:43:00 -0700 Subject: [PATCH] Minor improvements to SQL Lab UI (#5662) * Remove "for" * add space * Separate control to select table from database and schema. * Adjust schema displays * Fix caret and arrow position in Select and Tab * Reduce space after caret in tab header * Use translator * Align icons in the pop-up menu in Sql Lab * Add new table in front of the list (so it will appear on top) * shorten message * reduce line --- .../src/SqlLab/components/CopyQueryTabUrl.jsx | 7 ++++-- .../src/SqlLab/components/SouthPane.jsx | 2 +- .../SqlLab/components/SqlEditorLeftBar.jsx | 16 +++++++++++-- .../SqlLab/components/TabbedSqlEditors.jsx | 24 ++++++++++++++----- .../src/SqlLab/components/TableElement.jsx | 9 ++++--- .../components/TemplateParamsEditor.jsx | 2 +- superset/assets/src/SqlLab/main.less | 23 ++++++++++++++++++ superset/assets/src/SqlLab/reducers.js | 2 +- superset/assets/src/reduxUtils.js | 8 +++++-- 9 files changed, 73 insertions(+), 20 deletions(-) diff --git a/superset/assets/src/SqlLab/components/CopyQueryTabUrl.jsx b/superset/assets/src/SqlLab/components/CopyQueryTabUrl.jsx index fed7c28bbe9a7..e48fe1be8feb7 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 b55fdda422a7f..65d17f7768c52 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 a255ca631b396..d20d494bcfb2a 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 &&