[Logstash Pipeline Management] Fix bottom border of Pipeline Editor (#18834)

* Change pipeline editor markup so bottom border doesn't hide text on last line.

* Add constants for scroll margin size.

* Add comments to editor constants.

* Add PX units to constant names.
This commit is contained in:
Justin Kambic 2018-05-07 14:08:05 -04:00
parent 73f144f095
commit 733f625dea
8 changed files with 54 additions and 18 deletions

View file

@ -9,6 +9,6 @@ export const EDITOR = {
PATTERN_MAX_LINES: 10,
SAMPLE_DATA_MIN_LINES: 3,
SAMPLE_DATA_MAX_LINES: 50,
SCROLL_MARGIN_TOP: 4,
SCROLL_MARGIN_BOTTOM: 4,
SCROLL_MARGIN_TOP_PX: 4,
SCROLL_MARGIN_BOTTOM_PX: 4,
};

View file

@ -15,8 +15,8 @@ export function applyEditorOptions(editor, minLines, maxLines) {
* typing experience.
*/
editor.renderer.setScrollMargin(
EDITOR.SCROLL_MARGIN_TOP,
EDITOR.SCROLL_MARGIN_BOTTOM,
EDITOR.SCROLL_MARGIN_TOP_PX,
EDITOR.SCROLL_MARGIN_BOTTOM_PX,
0,
0
);

View file

@ -39,8 +39,8 @@ describe('applyEditorOptions', () => {
expect(setUseWrapMode.mock.calls[0][0]).toBe(true);
expect(setScrollMargin.mock.calls).toHaveLength(1);
expect(setScrollMargin.mock.calls[0][0]).toEqual(EDITOR.SCROLL_MARGIN_TOP);
expect(setScrollMargin.mock.calls[0][1]).toEqual(EDITOR.SCROLL_MARGIN_BOTTOM);
expect(setScrollMargin.mock.calls[0][0]).toEqual(EDITOR.SCROLL_MARGIN_TOP_PX);
expect(setScrollMargin.mock.calls[0][1]).toEqual(EDITOR.SCROLL_MARGIN_BOTTOM_PX);
expect(setScrollMargin.mock.calls[0][2]).toEqual(0);
expect(setScrollMargin.mock.calls[0][3]).toEqual(0);