Allow resizing width of SQL Lab left bar / editor (#8099)

* wip

* Finish PR

* Remove annoying snap

* Fix lint

* Fix js tests
This commit is contained in:
Beto Dealmeida
2019-08-26 10:07:47 -07:00
committed by GitHub
parent 7ac1a290eb
commit ed3360b135
5 changed files with 76 additions and 45 deletions

View File

@@ -21,8 +21,8 @@ import { shallow } from 'enzyme';
import { defaultQueryEditor, initialState, queries, table } from './fixtures';
import {
SQL_EDITOR_GUTTER_HEIGHT,
SQL_EDITOR_GUTTER_MARGIN,
SQL_EDITOR_VERTICAL_GUTTER_HEIGHT,
SQL_EDITOR_VERTICAL_GUTTER_MARGIN,
SQL_TOOLBAR_HEIGHT,
} from '../../../src/SqlLab/constants';
import AceEditorWrapper from '../../../src/SqlLab/components/AceEditorWrapper';
@@ -73,8 +73,8 @@ describe('SqlEditor', () => {
const totalSize = parseFloat(wrapper.find(AceEditorWrapper).props().height)
+ wrapper.find(SouthPane).props().height
+ SQL_TOOLBAR_HEIGHT
+ (SQL_EDITOR_GUTTER_MARGIN * 2)
+ SQL_EDITOR_GUTTER_HEIGHT;
+ (SQL_EDITOR_VERTICAL_GUTTER_MARGIN * 2)
+ SQL_EDITOR_VERTICAL_GUTTER_HEIGHT;
expect(totalSize).toEqual(MOCKED_SQL_EDITOR_HEIGHT);
});
it('does not overflow the editor window after resizing', () => {
@@ -83,8 +83,8 @@ describe('SqlEditor', () => {
const totalSize = parseFloat(wrapper.find(AceEditorWrapper).props().height)
+ wrapper.find(SouthPane).props().height
+ SQL_TOOLBAR_HEIGHT
+ (SQL_EDITOR_GUTTER_MARGIN * 2)
+ SQL_EDITOR_GUTTER_HEIGHT;
+ (SQL_EDITOR_VERTICAL_GUTTER_MARGIN * 2)
+ SQL_EDITOR_VERTICAL_GUTTER_HEIGHT;
expect(totalSize).toEqual(450);
});
it('render a LimitControl with default limit', () => {