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

Multi-line kql bar #70140

Merged
merged 29 commits into from
Jul 8, 2020
Merged
Show file tree
Hide file tree
Changes from 8 commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
6ebe65b
Multiline kql bar
snide Jun 26, 2020
5fc0bc4
fix id
snide Jun 26, 2020
657f624
use visibility rather than display to hide stuff, cross fingers for t…
snide Jun 29, 2020
8117fcd
Merge remote-tracking branch 'upstream/master' into kql/multiline
snide Jun 29, 2020
4c227b2
another vis trick for tests
snide Jun 30, 2020
e94cc02
quasi fix tests, still some failures
snide Jun 30, 2020
9b8b57a
caroline feedback
snide Jun 30, 2020
5e4551a
fun!
snide Jun 30, 2020
de5401d
Merge remote-tracking branch 'upstream/master' into kql/multiline
snide Jul 1, 2020
a90b77b
fix for mouse
snide Jul 1, 2020
7ce67a9
fix test
XavierM Jul 1, 2020
5c98f58
Merge branch 'master' into kql/multiline
elasticmachine Jul 1, 2020
5c2e5ce
Merge branch 'master' of github.com:elastic/kibana into kql/multiline
XavierM Jul 2, 2020
00f297b
check api
XavierM Jul 2, 2020
156621f
Merge branch 'master' of github.com:elastic/kibana into kql/multiline
XavierM Jul 2, 2020
61b1087
Merge branch 'master' into kql/multiline
elasticmachine Jul 2, 2020
1b72ca4
fix unit test on query_string_input
XavierM Jul 2, 2020
8d686b0
Merge branch 'master' of github.com:elastic/kibana into kql/multiline
XavierM Jul 3, 2020
1c75023
Fix cypress test
XavierM Jul 3, 2020
7ee38c1
Merge branch 'master' of github.com:elastic/kibana into kql/multiline
XavierM Jul 3, 2020
98b256c
Merge branch 'master' into kql/multiline
elasticmachine Jul 5, 2020
9be2de5
Merge branch 'master' of github.com:elastic/kibana into kql/multiline
XavierM Jul 6, 2020
35cb802
handle the resize of the height of the textarea when the window have …
XavierM Jul 6, 2020
95683af
Merge branch 'master' of github.com:elastic/kibana into kql/multiline
XavierM Jul 6, 2020
8a0ba6b
Merge branch 'master' into kql/multiline
elasticmachine Jul 7, 2020
709caaf
Merge branch 'master' into kql/multiline
elasticmachine Jul 7, 2020
dc0cade
Merge branch 'master' of github.com:elastic/kibana into pr/70140
Jul 8, 2020
101b10e
Merge branch 'master' into kql/multiline
elasticmachine Jul 8, 2020
fc9852d
Merge branch 'master' into kql/multiline
elasticmachine Jul 8, 2020
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
44 changes: 44 additions & 0 deletions src/plugins/data/public/ui/query_string_input/_query_bar.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,41 @@
.kbnQueryBar__wrap {
max-width: 100%;
z-index: $euiZContentMenu;
}

// Uses the append style, but no bordering
.kqlQueryBar__languageSwitcherButton {
border-right: none !important;
}

.kbnQueryBar__textarea {
z-index: $euiZContentMenu;
resize: none !important; // When in the group, it will autosize
height: $euiSizeXXL;
// Unlike most inputs within layout control groups, the text area still needs a border.
// These adjusts help it sit above the control groups shadow to line up correctly.
padding-top: $euiSizeS + 3px !important;
transform: translateY(-2px);
padding: $euiSizeS - 1px;

&:not(:focus) {
@include euiYScrollWithShadows;
white-space: nowrap;
overflow-y: hidden;
overflow-x: hidden;
border: none;
box-shadow: none;
}

// When focused, let it scroll
&:focus {
overflow-x: auto;
overflow-y: auto;
width: calc(100% + 1px); // To overtake the group's fake border
white-space: normal;
XavierM marked this conversation as resolved.
Show resolved Hide resolved
}
}

@include euiBreakpoint('xs', 's') {
.kbnQueryBar--withDatePicker {
> :first-child {
Expand All @@ -16,5 +54,11 @@
// sass-lint:disable-block no-important
flex-grow: 0 !important;
flex-basis: auto !important;
margin-right: -$euiSizeXS !important;

&.kbnQueryBar__datePickerWrapper-isHidden {
width: 0;
overflow: hidden;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ export function QueryLanguageSwitcher(props: Props) {
<EuiButtonEmpty
size="xs"
onClick={() => setIsPopoverOpen(!isPopoverOpen)}
className="euiFormControlLayout__append"
className="euiFormControlLayout__append kqlQueryBar__languageSwitcherButton"
data-test-subj={'switchQueryLanguageButton'}
>
{props.language === 'lucene' ? luceneLabel : kqlLabel}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ interface Props {

export function QueryBarTopRow(props: Props) {
const [isDateRangeInvalid, setIsDateRangeInvalid] = useState(false);
const [isQueryInputFocused, setIsQueryInputFocused] = useState(false);

const kibana = useKibana<IDataPluginServices>();
const { uiSettings, notifications, storage, appName, docLinks } = kibana.services;
Expand Down Expand Up @@ -105,6 +106,10 @@ export function QueryBarTopRow(props: Props) {
});
}

function onChangeQueryInputFocus(isFocused: boolean) {
setIsQueryInputFocused(isFocused);
}

function onTimeChange({
start,
end,
Expand Down Expand Up @@ -180,6 +185,7 @@ export function QueryBarTopRow(props: Props) {
query={props.query!}
screenTitle={props.screenTitle}
onChange={onQueryChange}
onChangeQueryInputFocus={onChangeQueryInputFocus}
onSubmit={onInputSubmit}
persistedLog={persistedLog}
dataTestSubj={props.dataTestSubj}
Expand Down Expand Up @@ -264,8 +270,12 @@ export function QueryBarTopRow(props: Props) {
};
});

const wrapperClasses = classNames('kbnQueryBar__datePickerWrapper', {
'kbnQueryBar__datePickerWrapper-isHidden': isQueryInputFocused,
});

return (
<EuiFlexItem className="kbnQueryBar__datePickerWrapper">
<EuiFlexItem className={wrapperClasses}>
<EuiSuperDatePicker
start={props.dateRangeFrom}
end={props.dateRangeTo}
Expand All @@ -279,6 +289,7 @@ export function QueryBarTopRow(props: Props) {
commonlyUsedRanges={commonlyUsedRanges}
dateFormat={uiSettings!.get('dateFormat')}
isAutoRefreshOnly={props.showAutoRefreshOnly}
className="kbnQueryBar__datePicker"
/>
</EuiFlexItem>
);
Expand Down
Loading