Skip to content

Commit bfd1e55

Browse files
Merge branch 'master' into alert-list-reducer-fix
2 parents 051c879 + 1f87f3a commit bfd1e55

File tree

49 files changed

+706
-345
lines changed

Some content is hidden

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

49 files changed

+706
-345
lines changed

docs/canvas/canvas-elements.asciidoc

Lines changed: 31 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,9 @@ When you add elements to your workpad, you can:
2020
[[add-canvas-element]]
2121
=== Add elements to your workpad
2222

23-
Choose the elements to display on your workpad, then familiarize yourself with the element using the preconfigured demo data. By default, every element you add to a workpad uses demo data until you change the data source. The demo data includes a small sample data set that you can use to experiment with your element.
23+
Choose the elements to display on your workpad, then familiarize yourself with the element using the preconfigured demo data. By default, most elements use demo data until you change the data source. The demo data includes a small sample data set that you can use to experiment with your element.
24+
25+
To add a Canvas element:
2426

2527
. Click *Add element*.
2628

@@ -31,13 +33,26 @@ image::images/canvas-element-select.gif[Canvas elements]
3133

3234
. Play around with the default settings and see what the element can do.
3335

34-
TIP: Want to use a different element? You can delete the element by selecting it, clicking the *Element options* icon in the top right, then selecting *Delete*.
36+
To add a map:
37+
38+
. Click *Embed object*.
39+
40+
. Select the map you want to add to the workpad.
41+
+
42+
[role="screenshot"]
43+
image::images/canvas-map-embed.gif[]
44+
45+
NOTE: Demo data is only supported on Canvas elements. Maps do not support demo data.
46+
47+
Want to use a different element? You can delete the element by selecting it, clicking the *Element options* icon in the top right, then selecting *Delete*.
3548

3649
[float]
3750
[[connect-element-data]]
38-
=== Connect the element to your data
51+
=== Connect the Canvas element to your data
3952

40-
When you have finished using the demo data, connect the element to a data source.
53+
When you have finished using the demo data, connect the Canvas element to a data source.
54+
55+
NOTE: Maps do not support data sources. To change the map data, refer to <<maps, Elastic Maps>>.
4156

4257
. Make sure that the element is selected, then select *Data*.
4358

@@ -142,7 +157,7 @@ text.align: center;
142157
[[configure-auto-refresh-interval]]
143158
==== Change the data auto-refresh interval
144159

145-
Increase or decrease how often your data refreshes on your workpad.
160+
Increase or decrease how often your Canvas element data refreshes on your workpad.
146161

147162
. In the top left corner, click the *Control settings* icon.
148163

@@ -153,6 +168,17 @@ image::images/canvas-refresh-interval.png[Element data refresh interval]
153168

154169
TIP: To manually refresh the data, click the *Refresh data* icon.
155170

171+
[float]
172+
[[canvas-time-range]]
173+
==== Customize map time ranges
174+
175+
Configure the maps on your workpad for a specific time range.
176+
177+
From the panel menu, select *Customize time range* to expose a time filter dedicated to the map.
178+
179+
[role="screenshot"]
180+
image::images/canvas_map-time-filter.gif[]
181+
156182
[float]
157183
[[organize-element]]
158184
=== Organize the elements on your workpad

docs/images/canvas-map-embed.gif

894 KB
Loading
822 KB
Loading

src/plugins/data/public/autocomplete/autocomplete_service.ts

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,26 +18,23 @@
1818
*/
1919

2020
import { CoreSetup } from 'src/core/public';
21-
import { QuerySuggestionsGetFn } from './providers/query_suggestion_provider';
21+
import { QuerySuggestionGetFn } from './providers/query_suggestion_provider';
2222
import {
2323
setupValueSuggestionProvider,
2424
ValueSuggestionsGetFn,
2525
} from './providers/value_suggestion_provider';
2626

2727
export class AutocompleteService {
28-
private readonly querySuggestionProviders: Map<string, QuerySuggestionsGetFn> = new Map();
28+
private readonly querySuggestionProviders: Map<string, QuerySuggestionGetFn> = new Map();
2929
private getValueSuggestions?: ValueSuggestionsGetFn;
3030

31-
private addQuerySuggestionProvider = (
32-
language: string,
33-
provider: QuerySuggestionsGetFn
34-
): void => {
31+
private addQuerySuggestionProvider = (language: string, provider: QuerySuggestionGetFn): void => {
3532
if (language && provider) {
3633
this.querySuggestionProviders.set(language, provider);
3734
}
3835
};
3936

40-
private getQuerySuggestions: QuerySuggestionsGetFn = args => {
37+
private getQuerySuggestions: QuerySuggestionGetFn = args => {
4138
const { language } = args;
4239
const provider = this.querySuggestionProviders.get(language);
4340

src/plugins/data/public/autocomplete/index.ts

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,14 @@
1616
* specific language governing permissions and limitations
1717
* under the License.
1818
*/
19-
import * as autocomplete from './static';
20-
export { AutocompleteService, AutocompleteSetup, AutocompleteStart } from './autocomplete_service';
2119

22-
export { autocomplete };
20+
export {
21+
QuerySuggestion,
22+
QuerySuggestionTypes,
23+
QuerySuggestionGetFn,
24+
QuerySuggestionGetFnArgs,
25+
QuerySuggestionBasic,
26+
QuerySuggestionField,
27+
} from './providers/query_suggestion_provider';
28+
29+
export { AutocompleteService, AutocompleteSetup, AutocompleteStart } from './autocomplete_service';

src/plugins/data/public/autocomplete/providers/query_suggestion_provider.ts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -19,20 +19,20 @@
1919

2020
import { IFieldType, IIndexPattern } from '../../../common/index_patterns';
2121

22-
export enum QuerySuggestionsTypes {
22+
export enum QuerySuggestionTypes {
2323
Field = 'field',
2424
Value = 'value',
2525
Operator = 'operator',
2626
Conjunction = 'conjunction',
2727
RecentSearch = 'recentSearch',
2828
}
2929

30-
export type QuerySuggestionsGetFn = (
31-
args: QuerySuggestionsGetFnArgs
30+
export type QuerySuggestionGetFn = (
31+
args: QuerySuggestionGetFnArgs
3232
) => Promise<QuerySuggestion[]> | undefined;
3333

3434
/** @public **/
35-
export interface QuerySuggestionsGetFnArgs {
35+
export interface QuerySuggestionGetFnArgs {
3636
language: string;
3737
indexPatterns: IIndexPattern[];
3838
query: string;
@@ -43,8 +43,8 @@ export interface QuerySuggestionsGetFnArgs {
4343
}
4444

4545
/** @public **/
46-
export interface BasicQuerySuggestion {
47-
type: QuerySuggestionsTypes;
46+
export interface QuerySuggestionBasic {
47+
type: QuerySuggestionTypes;
4848
description?: string | JSX.Element;
4949
end: number;
5050
start: number;
@@ -53,10 +53,10 @@ export interface BasicQuerySuggestion {
5353
}
5454

5555
/** @public **/
56-
export interface FieldQuerySuggestion extends BasicQuerySuggestion {
57-
type: QuerySuggestionsTypes.Field;
56+
export interface QuerySuggestionField extends QuerySuggestionBasic {
57+
type: QuerySuggestionTypes.Field;
5858
field: IFieldType;
5959
}
6060

6161
/** @public **/
62-
export type QuerySuggestion = BasicQuerySuggestion | FieldQuerySuggestion;
62+
export type QuerySuggestion = QuerySuggestionBasic | QuerySuggestionField;

src/plugins/data/public/autocomplete/static.ts

Lines changed: 0 additions & 27 deletions
This file was deleted.

src/plugins/data/public/index.ts

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,17 @@ export {
104104
FieldFormatConfig,
105105
FieldFormatId,
106106
} from '../common';
107-
export { autocomplete } from './autocomplete';
107+
108+
export {
109+
QuerySuggestion,
110+
QuerySuggestionTypes,
111+
QuerySuggestionGetFn,
112+
QuerySuggestionGetFnArgs,
113+
QuerySuggestionBasic,
114+
QuerySuggestionField,
115+
} from './autocomplete';
116+
117+
export * from './field_formats';
108118
export * from './index_patterns';
109119
export * from './search';
110120
export * from './query';

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

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ import { InjectedIntl, injectI18n, FormattedMessage } from '@kbn/i18n/react';
3535
import { debounce, compact, isEqual } from 'lodash';
3636
import { Toast } from 'src/core/public';
3737
import {
38-
autocomplete,
3938
IDataPluginServices,
4039
IIndexPattern,
4140
PersistedLog,
@@ -46,6 +45,8 @@ import {
4645
getQueryLog,
4746
Query,
4847
} from '../..';
48+
import { QuerySuggestion, QuerySuggestionTypes } from '../../autocomplete';
49+
4950
import { withKibana, KibanaReactContextValue, toMountPoint } from '../../../../kibana_react/public';
5051
import { fetchIndexPatterns } from './fetch_index_patterns';
5152
import { QueryLanguageSwitcher } from './language_switcher';
@@ -70,7 +71,7 @@ interface Props {
7071
interface State {
7172
isSuggestionsVisible: boolean;
7273
index: number | null;
73-
suggestions: autocomplete.QuerySuggestion[];
74+
suggestions: QuerySuggestion[];
7475
suggestionLimit: number;
7576
selectionStart: number | null;
7677
selectionEnd: number | null;
@@ -191,7 +192,7 @@ export class QueryStringInputUI extends Component<Props, State> {
191192
const text = toUser(recentSearch);
192193
const start = 0;
193194
const end = query.length;
194-
return { type: autocomplete.QuerySuggestionsTypes.RecentSearch, text, start, end };
195+
return { type: QuerySuggestionTypes.RecentSearch, text, start, end };
195196
});
196197
};
197198

@@ -317,7 +318,7 @@ export class QueryStringInputUI extends Component<Props, State> {
317318
}
318319
};
319320

320-
private selectSuggestion = (suggestion: autocomplete.QuerySuggestion) => {
321+
private selectSuggestion = (suggestion: QuerySuggestion) => {
321322
if (!this.inputRef) {
322323
return;
323324
}
@@ -341,13 +342,13 @@ export class QueryStringInputUI extends Component<Props, State> {
341342
selectionEnd: start + (cursorIndex ? cursorIndex : text.length),
342343
});
343344

344-
if (type === autocomplete.QuerySuggestionsTypes.RecentSearch) {
345+
if (type === QuerySuggestionTypes.RecentSearch) {
345346
this.setState({ isSuggestionsVisible: false, index: null });
346347
this.onSubmit({ query: newQueryString, language: this.props.query.language });
347348
}
348349
};
349350

350-
private handleNestedFieldSyntaxNotification = (suggestion: autocomplete.QuerySuggestion) => {
351+
private handleNestedFieldSyntaxNotification = (suggestion: QuerySuggestion) => {
351352
if (
352353
'field' in suggestion &&
353354
suggestion.field.subType &&
@@ -449,7 +450,7 @@ export class QueryStringInputUI extends Component<Props, State> {
449450
}
450451
};
451452

452-
private onClickSuggestion = (suggestion: autocomplete.QuerySuggestion) => {
453+
private onClickSuggestion = (suggestion: QuerySuggestion) => {
453454
if (!this.inputRef) {
454455
return;
455456
}

src/plugins/data/public/ui/typeahead/suggestion_component.test.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,19 +19,19 @@
1919

2020
import { mount, shallow } from 'enzyme';
2121
import React from 'react';
22-
import { autocomplete } from '../..';
22+
import { QuerySuggestion, QuerySuggestionTypes } from '../../autocomplete';
2323
import { SuggestionComponent } from './suggestion_component';
2424

2525
const noop = () => {
2626
return;
2727
};
2828

29-
const mockSuggestion: autocomplete.QuerySuggestion = {
29+
const mockSuggestion: QuerySuggestion = {
3030
description: 'This is not a helpful suggestion',
3131
end: 0,
3232
start: 42,
3333
text: 'as promised, not helpful',
34-
type: autocomplete.QuerySuggestionsTypes.Value,
34+
type: QuerySuggestionTypes.Value,
3535
};
3636

3737
describe('SuggestionComponent', () => {

0 commit comments

Comments
 (0)