Skip to content

Commit e0b213d

Browse files
committed
Merge remote-tracking branch 'upstream/master' into task/endpointlist-actions
2 parents d1fbf41 + 0c678eb commit e0b213d

File tree

198 files changed

+4751
-1021
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

198 files changed

+4751
-1021
lines changed

docs/development/plugins/data/public/kibana-plugin-plugins-data-public.querystringinput.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,5 @@
77
<b>Signature:</b>
88

99
```typescript
10-
QueryStringInput: React.FC<Pick<Props, "query" | "prepend" | "size" | "className" | "placeholder" | "onChange" | "onBlur" | "onSubmit" | "indexPatterns" | "dataTestSubj" | "screenTitle" | "disableAutoFocus" | "persistedLog" | "bubbleSubmitEvent" | "languageSwitcherPopoverAnchorPosition" | "onChangeQueryInputFocus">>
10+
QueryStringInput: React.FC<Pick<Props, "query" | "prepend" | "size" | "className" | "placeholder" | "onChange" | "onBlur" | "onSubmit" | "isInvalid" | "indexPatterns" | "dataTestSubj" | "screenTitle" | "disableAutoFocus" | "persistedLog" | "bubbleSubmitEvent" | "languageSwitcherPopoverAnchorPosition" | "onChangeQueryInputFocus">>
1111
```

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@
6363
"uiFramework:createComponent": "cd packages/kbn-ui-framework && yarn createComponent",
6464
"uiFramework:documentComponent": "cd packages/kbn-ui-framework && yarn documentComponent",
6565
"kbn:watch": "node scripts/kibana --dev --logging.json=false",
66-
"build:types": "tsc --p tsconfig.types.json",
66+
"build:types": "rm -rf ./target/types && tsc --p tsconfig.types.json",
6767
"docs:acceptApiChanges": "node --max-old-space-size=6144 scripts/check_published_api_changes.js --accept",
6868
"kbn:bootstrap": "node scripts/build_ts_refs && node scripts/register_git_hook",
6969
"spec_to_console": "node scripts/spec_to_console",

packages/kbn-ui-framework/src/components/local_nav/_local_search.scss

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,6 @@
2626
border-radius: 0;
2727
border-left-width: 0;
2828
}
29-
30-
.kuiLocalSearchAssistedInput {
31-
display: flex;
32-
flex: 1 1 100%;
33-
position: relative;
34-
}
35-
3629
/**
3730
* 1. em used for right padding so documentation link and query string
3831
* won't overlap if the user increases their default browser font size

src/plugins/data/public/public.api.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1479,7 +1479,7 @@ export interface QueryStateChange extends QueryStateChangePartial {
14791479
// Warning: (ae-missing-release-tag) "QueryStringInput" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
14801480
//
14811481
// @public (undocumented)
1482-
export const QueryStringInput: React.FC<Pick<Props_3, "query" | "prepend" | "size" | "className" | "placeholder" | "onChange" | "onBlur" | "onSubmit" | "indexPatterns" | "dataTestSubj" | "screenTitle" | "disableAutoFocus" | "persistedLog" | "bubbleSubmitEvent" | "languageSwitcherPopoverAnchorPosition" | "onChangeQueryInputFocus">>;
1482+
export const QueryStringInput: React.FC<Pick<Props_3, "query" | "prepend" | "size" | "className" | "placeholder" | "onChange" | "onBlur" | "onSubmit" | "isInvalid" | "indexPatterns" | "dataTestSubj" | "screenTitle" | "disableAutoFocus" | "persistedLog" | "bubbleSubmitEvent" | "languageSwitcherPopoverAnchorPosition" | "onChangeQueryInputFocus">>;
14831483

14841484
// @public (undocumented)
14851485
export type QuerySuggestion = QuerySuggestionBasic | QuerySuggestionField;

src/plugins/data/public/ui/query_string_input/_query_bar.scss

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,30 +8,37 @@
88
border-right: none !important;
99
}
1010

11+
.kbnQueryBar__textareaWrap {
12+
overflow: visible !important; // Override EUI form control
13+
display: flex;
14+
flex: 1 1 100%;
15+
position: relative;
16+
}
17+
1118
.kbnQueryBar__textarea {
1219
z-index: $euiZContentMenu;
1320
resize: none !important; // When in the group, it will autosize
14-
height: $euiSizeXXL;
21+
height: $euiFormControlHeight;
1522
// Unlike most inputs within layout control groups, the text area still needs a border.
1623
// These adjusts help it sit above the control groups shadow to line up correctly.
17-
padding-top: $euiSizeS + 3px !important;
18-
transform: translateY(-2px);
19-
padding: $euiSizeS - 1px;
24+
padding: $euiSizeS;
25+
padding-top: $euiSizeS + 3px;
26+
transform: translateY(-1px) translateX(-1px);
2027

21-
&:not(:focus) {
28+
&:not(:focus):not(:invalid) {
2229
@include euiYScrollWithShadows;
30+
}
31+
32+
&:not(:focus) {
2333
white-space: nowrap;
2434
overflow-y: hidden;
2535
overflow-x: hidden;
26-
border: none;
27-
box-shadow: none;
2836
}
2937

3038
// When focused, let it scroll
3139
&:focus {
3240
overflow-x: auto;
3341
overflow-y: auto;
34-
width: calc(100% + 1px); // To overtake the group's fake border
3542
white-space: normal;
3643
}
3744
}

src/plugins/data/public/ui/query_string_input/query_string_input.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919

2020
import React, { Component, RefObject, createRef } from 'react';
2121
import { i18n } from '@kbn/i18n';
22+
2223
import classNames from 'classnames';
2324
import {
2425
EuiTextArea,
@@ -63,6 +64,7 @@ interface Props {
6364
dataTestSubj?: string;
6465
size?: SuggestionsListSize;
6566
className?: string;
67+
isInvalid?: boolean;
6668
}
6769

6870
interface State {
@@ -591,6 +593,7 @@ export class QueryStringInputUI extends Component<Props, State> {
591593
'euiFormControlLayout euiFormControlLayout--group kbnQueryBar__wrap',
592594
this.props.className
593595
);
596+
594597
return (
595598
<div className={className}>
596599
{this.props.prepend}
@@ -607,7 +610,7 @@ export class QueryStringInputUI extends Component<Props, State> {
607610
>
608611
<div
609612
role="search"
610-
className="euiFormControlLayout__childrenWrapper kuiLocalSearchAssistedInput"
613+
className="euiFormControlLayout__childrenWrapper kbnQueryBar__textareaWrap"
611614
ref={this.queryBarInputDivRefInstance}
612615
>
613616
<EuiTextArea
@@ -651,6 +654,7 @@ export class QueryStringInputUI extends Component<Props, State> {
651654
}
652655
role="textbox"
653656
data-test-subj={this.props.dataTestSubj || 'queryInput'}
657+
isInvalid={this.props.isInvalid}
654658
>
655659
{this.getQueryString()}
656660
</EuiTextArea>

src/plugins/data/public/ui/typeahead/constants.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,4 +33,4 @@ export const SUGGESTIONS_LIST_REQUIRED_BOTTOM_SPACE = 250;
3333
* A distance in px to display suggestions list right under the query input without a gap
3434
* @public
3535
*/
36-
export const SUGGESTIONS_LIST_REQUIRED_TOP_OFFSET = 2;
36+
export const SUGGESTIONS_LIST_REQUIRED_TOP_OFFSET = 1;

src/plugins/data/public/ui/typeahead/suggestions_component.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,7 @@ export class SuggestionsComponent extends Component<Props> {
154154
const StyledSuggestionsListDiv = styled.div`
155155
${(props: { queryBarRect: DOMRect; verticalListPosition: string }) => `
156156
position: absolute;
157+
z-index: 4001;
157158
left: ${props.queryBarRect.left}px;
158159
width: ${props.queryBarRect.width}px;
159160
${props.verticalListPosition}`}

src/plugins/es_ui_shared/public/request/use_request.test.helpers.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ export const createUseRequestHelpers = (): UseRequestHelpers => {
106106
};
107107

108108
const TestComponent = ({ requestConfig }: { requestConfig: UseRequestConfig }) => {
109-
const { isInitialRequest, isLoading, error, data, sendRequest } = useRequest(
109+
const { isInitialRequest, isLoading, error, data, resendRequest } = useRequest(
110110
httpClient as HttpSetup,
111111
requestConfig
112112
);
@@ -115,7 +115,7 @@ export const createUseRequestHelpers = (): UseRequestHelpers => {
115115
hookResult.isLoading = isLoading;
116116
hookResult.error = error;
117117
hookResult.data = data;
118-
hookResult.sendRequest = sendRequest;
118+
hookResult.resendRequest = resendRequest;
119119

120120
return null;
121121
};

src/plugins/es_ui_shared/public/request/use_request.test.ts

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ describe('useRequest hook', () => {
102102
setupSuccessRequest();
103103
expect(hookResult.isInitialRequest).toBe(true);
104104

105-
hookResult.sendRequest();
105+
hookResult.resendRequest();
106106
await completeRequest();
107107
expect(hookResult.isInitialRequest).toBe(false);
108108
});
@@ -148,7 +148,7 @@ describe('useRequest hook', () => {
148148
expect(hookResult.error).toBe(getErrorResponse().error);
149149

150150
act(() => {
151-
hookResult.sendRequest();
151+
hookResult.resendRequest();
152152
});
153153
expect(hookResult.isLoading).toBe(true);
154154
expect(hookResult.error).toBe(getErrorResponse().error);
@@ -183,7 +183,7 @@ describe('useRequest hook', () => {
183183
expect(hookResult.data).toBe(getSuccessResponse().data);
184184

185185
act(() => {
186-
hookResult.sendRequest();
186+
hookResult.resendRequest();
187187
});
188188
expect(hookResult.isLoading).toBe(true);
189189
expect(hookResult.data).toBe(getSuccessResponse().data);
@@ -215,7 +215,7 @@ describe('useRequest hook', () => {
215215
});
216216

217217
describe('callbacks', () => {
218-
describe('sendRequest', () => {
218+
describe('resendRequest', () => {
219219
it('sends the request', async () => {
220220
const { setupSuccessRequest, completeRequest, hookResult, getSendRequestSpy } = helpers;
221221
setupSuccessRequest();
@@ -224,7 +224,7 @@ describe('useRequest hook', () => {
224224
expect(getSendRequestSpy().callCount).toBe(1);
225225

226226
await act(async () => {
227-
hookResult.sendRequest();
227+
hookResult.resendRequest();
228228
await completeRequest();
229229
});
230230
expect(getSendRequestSpy().callCount).toBe(2);
@@ -239,17 +239,17 @@ describe('useRequest hook', () => {
239239
await advanceTime(REQUEST_TIME);
240240
expect(getSendRequestSpy().callCount).toBe(1);
241241
act(() => {
242-
hookResult.sendRequest();
242+
hookResult.resendRequest();
243243
});
244244

245245
// The manual request resolves, and we'll send yet another one...
246246
await advanceTime(REQUEST_TIME);
247247
expect(getSendRequestSpy().callCount).toBe(2);
248248
act(() => {
249-
hookResult.sendRequest();
249+
hookResult.resendRequest();
250250
});
251251

252-
// At this point, we've moved forward 3s. The poll is set at 2s. If sendRequest didn't
252+
// At this point, we've moved forward 3s. The poll is set at 2s. If resendRequest didn't
253253
// reset the poll, the request call count would be 4, not 3.
254254
await advanceTime(REQUEST_TIME);
255255
expect(getSendRequestSpy().callCount).toBe(3);
@@ -291,14 +291,14 @@ describe('useRequest hook', () => {
291291
const HALF_REQUEST_TIME = REQUEST_TIME * 0.5;
292292
setupSuccessRequest({ pollIntervalMs: REQUEST_TIME });
293293

294-
// Before the original request resolves, we make a manual sendRequest call.
294+
// Before the original request resolves, we make a manual resendRequest call.
295295
await advanceTime(HALF_REQUEST_TIME);
296296
expect(getSendRequestSpy().callCount).toBe(0);
297297
act(() => {
298-
hookResult.sendRequest();
298+
hookResult.resendRequest();
299299
});
300300

301-
// The original quest resolves but it's been marked as outdated by the the manual sendRequest
301+
// The original quest resolves but it's been marked as outdated by the the manual resendRequest
302302
// call "interrupts", so data is left undefined.
303303
await advanceTime(HALF_REQUEST_TIME);
304304
expect(getSendRequestSpy().callCount).toBe(1);

0 commit comments

Comments
 (0)