Skip to content

Commit

Permalink
fix(sqllab): Handle long table names in SQL Lab (apache#10518)
Browse files Browse the repository at this point in the history
* widen the autocomplete menu for table names

* display the full table name in a tooltip

* license

* Update superset-frontend/src/SqlLab/components/AceEditorWrapper/index.tsx

Co-authored-by: Evan Rusackas <evan@preset.io>

* src importing

* move autocomplete width css to main.less

* use html title attribute instead of tooltip

Co-authored-by: Evan Rusackas <evan@preset.io>
  • Loading branch information
2 people authored and Ofeknielsen committed Oct 5, 2020
1 parent e4075af commit dae2749
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
6 changes: 3 additions & 3 deletions superset-frontend/src/SqlLab/components/AceEditorWrapper.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,14 @@ import 'brace/mode/sql';
import 'brace/theme/github';
import 'brace/ext/language_tools';
import ace from 'brace';
import { areArraysShallowEqual } from '../../reduxUtils';
import sqlKeywords from '../utils/sqlKeywords';
import { areArraysShallowEqual } from 'src/reduxUtils';
import sqlKeywords from 'src/SqlLab/utils/sqlKeywords';
import {
SCHEMA_AUTOCOMPLETE_SCORE,
TABLE_AUTOCOMPLETE_SCORE,
COLUMN_AUTOCOMPLETE_SCORE,
SQL_FUNCTIONS_AUTOCOMPLETE_SCORE,
} from '../constants';
} from 'src/SqlLab/constants';

const langTools = ace.acequire('ace/ext/language_tools');

Expand Down
4 changes: 4 additions & 0 deletions superset-frontend/src/SqlLab/main.less
Original file line number Diff line number Diff line change
Expand Up @@ -421,6 +421,10 @@ div.tablePopover {
border: 1px solid @gray-light;
font-feature-settings: @font-feature-settings;
font-family: @font-family-monospace;

&.ace_autocomplete {
width: 520px;
}
}

.Select__menu-outer {
Expand Down
4 changes: 2 additions & 2 deletions superset-frontend/src/components/TableSelector.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ export default class TableSelector extends React.PureComponent {

renderDatabaseOption(db) {
return (
<span>
<span title={db.database_name}>
<Label bsStyle="default" className="m-r-5">
{db.backend}
</Label>
Expand All @@ -257,7 +257,7 @@ export default class TableSelector extends React.PureComponent {

renderTableOption(option) {
return (
<span className="TableLabel">
<span className="TableLabel" title={option.label}>
<span className="m-r-5">
<small className="text-muted">
<i
Expand Down

0 comments on commit dae2749

Please sign in to comment.