Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EUIFication: Grok Debugger #20027

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
985fa57
Move <kbn-dev-tools-app> Angular wrapper directive usage into route t…
ycombinator Jun 19, 2018
e2e26be
Move sole directive into new directives folder
ycombinator Jun 19, 2018
6ce6a20
WIP checkin: basic conversion to React components
ycombinator Jun 19, 2018
7b2aeff
Fix sample custom patterns indentation
ycombinator Jun 19, 2018
854907f
Remove custom CSS
ycombinator Jun 19, 2018
1c4bb50
Wrap button in EuiFormRow + define isSimulateDisabled
ycombinator Jun 19, 2018
4901a7c
Wire up simulate
ycombinator Jun 19, 2018
78a464e
Cleanup
ycombinator Jun 19, 2018
1ee7156
Ace formatting options
ycombinator Jun 20, 2018
3b006c0
Better styling
ycombinator Jun 20, 2018
fec1164
Adding spacing between custom patterns and simulate button
ycombinator Jun 20, 2018
6d15afa
Fixing form row widths
ycombinator Jun 20, 2018
62f7027
Removing form row around button
ycombinator Jun 20, 2018
823a027
Add indentation/newlines in structured output
ycombinator Jun 20, 2018
16e7b65
Error handling
ycombinator Jun 20, 2018
c72e89c
Use constants
ycombinator Jun 20, 2018
2919d13
Removing no-longer-used code
ycombinator Jun 20, 2018
b1c13ec
Implement syntax highlighting via custom mode
ycombinator Jun 20, 2018
c174ad0
Making functional tests pass
ycombinator Jun 21, 2018
259679d
Adding trailing comma back
ycombinator Jun 21, 2018
4e0d690
Removing fixed heights
ycombinator Jun 21, 2018
bcfadf0
Removing unnecessary styles
ycombinator Jun 21, 2018
30acfd2
Make Event Output form row full width as well
ycombinator Jun 22, 2018
2c158d0
Wrapping EuiCodeEditors in EuiPanels
ycombinator Jun 22, 2018
9e429df
Adding spacer before callout; making spacing around callout consistent
ycombinator Jun 22, 2018
61faa84
Clear out custom patterns from request if field is cleared out
ycombinator Jun 22, 2018
68e948f
Clear out simulation results before attempting simulation
ycombinator Jun 22, 2018
4eef208
Set state with untrimmed value
ycombinator Jun 22, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions x-pack/plugins/grokdebugger/common/constants/editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,4 @@ export const EDITOR = {
PATTERN_MAX_LINES: 10,
SAMPLE_DATA_MIN_LINES: 3,
SAMPLE_DATA_MAX_LINES: 50,
SCROLL_MARGIN_TOP_PX: 4,
SCROLL_MARGIN_BOTTOM_PX: 4,
};
32 changes: 0 additions & 32 deletions x-pack/plugins/grokdebugger/public/lib/ace/apply_editor_options.js

This file was deleted.

This file was deleted.

1 change: 0 additions & 1 deletion x-pack/plugins/grokdebugger/public/lib/ace/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,3 @@
*/

export { GrokMode } from './grok_mode';
export { applyEditorOptions } from './apply_editor_options';

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -4,47 +4,59 @@
* you may not use this file except in compliance with the Elastic License.
*/

import { uiModules } from 'ui/modules';
import { InitAfterBindingsWorkaround } from 'ui/compat';
import React from 'react';
import {
EuiAccordion,
EuiCallOut,
EuiCodeBlock,
EuiFormRow,
EuiPanel,
EuiCodeEditor,
EuiSpacer
} from '@elastic/eui';
import { EDITOR } from '../../../../../common/constants';
import { applyEditorOptions } from '../../../../lib/ace';
import template from './custom_patterns_input.html';
import './custom_patterns_input.less';
import 'ui/toggle_panel';
import 'ace';

const app = uiModules.get('xpack/grokdebugger');
export function CustomPatternsInput({ value, onChange }) {
const sampleCustomPatterns = `POSTFIX_QUEUEID [0-9A-F]{10,11}
MSG message-id=<%{GREEDYDATA}>`;

app.directive('customPatternsInput', function () {
return {
restrict: 'E',
template: template,
scope: {
onChange: '='
},
bindToController: true,
controllerAs: 'customPatternsInput',
controller: class CustomPatternsInputController extends InitAfterBindingsWorkaround {
initAfterBindings($scope) {
this.isCollapsed = {
action: true
};
$scope.$watch('customPatternsInput.customPatterns', () => {
this.onChange(this.customPatterns);
});
$scope.aceLoaded = (editor) => {
this.editor = editor;
applyEditorOptions(editor, EDITOR.PATTERN_MIN_LINES, EDITOR.PATTERN_MAX_LINES);
};
}
return (
<EuiAccordion
id="customPatternsInput"
buttonContent="Custom Patterns"
data-test-subj="btnToggleCustomPatternsInput"
>

onSectionToggle = (sectionId) => {
this.isCollapsed[sectionId] = !this.isCollapsed[sectionId];
}
<EuiSpacer size="m" />

isSectionCollapsed = (sectionId) => {
return this.isCollapsed[sectionId];
}
}
};
});
<EuiCallOut
title="Enter one custom pattern per line. For example:"
>
<EuiCodeBlock>
{ sampleCustomPatterns }
</EuiCodeBlock>
</EuiCallOut>

<EuiSpacer size="m" />

<EuiFormRow
fullWidth
data-test-subj="aceCustomPatternsInput"
>
<EuiPanel paddingSize="s">
<EuiCodeEditor
width="100%"
value={value}
onChange={onChange}
setOptions={{
highlightActiveLine: false,
highlightGutterLine: false,
minLines: EDITOR.PATTERN_MIN_LINES,
maxLines: EDITOR.PATTERN_MAX_LINES,
}}
/>
</EuiPanel>
</EuiFormRow>
</EuiAccordion>
);
}

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@
* you may not use this file except in compliance with the Elastic License.
*/

import './custom_patterns_input';
export { CustomPatternsInput } from './custom_patterns_input';

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -4,34 +4,34 @@
* you may not use this file except in compliance with the Elastic License.
*/

import { uiModules } from 'ui/modules';
import React from 'react';
import {
EuiFormRow,
EuiPanel,
EuiCodeEditor
} from '@elastic/eui';
import { EDITOR } from '../../../../../common/constants';
import { applyEditorOptions } from '../../../../lib/ace';
import template from './event_input.html';
import './event_input.less';
import 'ace';

const app = uiModules.get('xpack/grokdebugger');

app.directive('eventInput', function () {
return {
restrict: 'E',
template: template,
scope: {
onChange: '='
},
bindToController: true,
controllerAs: 'eventInput',
controller: class EventInputController {
constructor($scope) {
$scope.$watch('eventInput.rawEvent', (newRawEvent) => {
this.onChange(newRawEvent);
});
$scope.aceLoaded = (editor) => {
this.editor = editor;
applyEditorOptions(editor, EDITOR.SAMPLE_DATA_MIN_LINES, EDITOR.SAMPLE_DATA_MAX_LINES);
};
}
}
};
});
export function EventInput({ value, onChange }) {
return (
<EuiFormRow
label="Sample Data"
fullWidth
data-test-subj="aceEventInput"
>
<EuiPanel paddingSize="s">
<EuiCodeEditor
width="100%"
value={value}
onChange={onChange}
setOptions={{
highlightActiveLine: false,
highlightGutterLine: false,
minLines: EDITOR.SAMPLE_DATA_MIN_LINES,
maxLines: EDITOR.SAMPLE_DATA_MAX_LINES
}}
/>
</EuiPanel>
</EuiFormRow>
);
}

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@
* you may not use this file except in compliance with the Elastic License.
*/

import './event_input';
export { EventInput } from './event_input';

This file was deleted.

Loading