Skip to content

Commit b28a951

Browse files
Merge branch 'master' into fc/hide-management
2 parents fac5cfe + 046345d commit b28a951

File tree

152 files changed

+8056
-873
lines changed

Some content is hidden

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

152 files changed

+8056
-873
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/input_control_vis/public/vis_controller.tsx

Lines changed: 22 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,10 @@
1818
*/
1919

2020
import React from 'react';
21+
import { isEqual } from 'lodash';
2122
import { render, unmountComponentAtNode } from 'react-dom';
2223

24+
import { Subscription } from 'rxjs';
2325
import { I18nStart } from 'kibana/public';
2426
import { InputControlVis } from './components/vis/input_control_vis';
2527
import { getControlFactory } from './control/control_factory';
@@ -34,11 +36,13 @@ import { VisParams, Vis } from '../../visualizations/public';
3436
export const createInputControlVisController = (deps: InputControlVisDependencies) => {
3537
return class InputControlVisController {
3638
private I18nContext?: I18nStart['Context'];
39+
private isLoaded = false;
3740

3841
controls: Array<RangeControl | ListControl>;
3942
queryBarUpdateHandler: () => void;
4043
filterManager: FilterManager;
4144
updateSubsciption: any;
45+
timeFilterSubscription: Subscription;
4246
visParams?: VisParams;
4347

4448
constructor(public el: Element, public vis: Vis) {
@@ -50,19 +54,32 @@ export const createInputControlVisController = (deps: InputControlVisDependencie
5054
this.updateSubsciption = this.filterManager
5155
.getUpdates$()
5256
.subscribe(this.queryBarUpdateHandler);
57+
this.timeFilterSubscription = deps.data.query.timefilter.timefilter
58+
.getTimeUpdate$()
59+
.subscribe(() => {
60+
if (this.visParams?.useTimeFilter) {
61+
this.isLoaded = false;
62+
}
63+
});
5364
}
5465

5566
async render(visData: any, visParams: VisParams) {
56-
this.visParams = visParams;
57-
this.controls = [];
58-
this.controls = await this.initControls();
59-
const [{ i18n }] = await deps.core.getStartServices();
60-
this.I18nContext = i18n.Context;
67+
if (!this.I18nContext) {
68+
const [{ i18n }] = await deps.core.getStartServices();
69+
this.I18nContext = i18n.Context;
70+
}
71+
if (!this.isLoaded || !isEqual(visParams, this.visParams)) {
72+
this.visParams = visParams;
73+
this.controls = [];
74+
this.controls = await this.initControls();
75+
this.isLoaded = true;
76+
}
6177
this.drawVis();
6278
}
6379

6480
destroy() {
6581
this.updateSubsciption.unsubscribe();
82+
this.timeFilterSubscription.unsubscribe();
6683
unmountComponentAtNode(this.el);
6784
this.controls.forEach((control) => control.destroy());
6885
}

x-pack/plugins/enterprise_search/public/applications/workplace_search/app_logic.test.ts

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,28 @@ describe('AppLogic', () => {
1616
});
1717

1818
const DEFAULT_VALUES = {
19+
account: {},
1920
hasInitialized: false,
21+
isFederatedAuth: true,
22+
organization: {},
23+
};
24+
25+
const expectedLogicValues = {
26+
account: {
27+
canCreateInvitations: true,
28+
canCreatePersonalSources: true,
29+
groups: ['Default', 'Cats'],
30+
id: 'some-id-string',
31+
isAdmin: true,
32+
isCurated: false,
33+
viewedOnboardingPage: true,
34+
},
35+
hasInitialized: true,
36+
isFederatedAuth: false,
37+
organization: {
38+
defaultOrgName: 'My Organization',
39+
name: 'ACME Donuts',
40+
},
2041
};
2142

2243
it('has expected default values', () => {
@@ -27,9 +48,7 @@ describe('AppLogic', () => {
2748
it('sets values based on passed props', () => {
2849
AppLogic.actions.initializeAppData(DEFAULT_INITIAL_APP_DATA);
2950

30-
expect(AppLogic.values).toEqual({
31-
hasInitialized: true,
32-
});
51+
expect(AppLogic.values).toEqual(expectedLogicValues);
3352
});
3453
});
3554
});

0 commit comments

Comments
 (0)