Skip to content

Commit

Permalink
Merge branch 'main' into chart_expressions-xy-extended_layers
Browse files Browse the repository at this point in the history
  • Loading branch information
kibanamachine authored May 2, 2022
2 parents 320983a + 19ab0f1 commit 59ee004
Show file tree
Hide file tree
Showing 1,173 changed files with 9,251 additions and 7,934 deletions.
2 changes: 1 addition & 1 deletion .buildkite/scripts/steps/storybooks/build_and_upload.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ const STORYBOOKS = [
'custom_integrations',
'dashboard_enhanced',
'dashboard',
'data_enhanced',
'data',
'embeddable',
'expression_error',
'expression_image',
Expand Down
1 change: 0 additions & 1 deletion .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,6 @@
/src/plugins/inspector/ @elastic/kibana-app-services
/src/plugins/unified_search/ @elastic/kibana-app-services
/x-pack/examples/ui_actions_enhanced_examples/ @elastic/kibana-app-services
/x-pack/plugins/data_enhanced/ @elastic/kibana-app-services
/x-pack/plugins/embeddable_enhanced/ @elastic/kibana-app-services
/x-pack/plugins/ui_actions_enhanced/ @elastic/kibana-app-services
/x-pack/plugins/runtime_fields @elastic/kibana-app-services
Expand Down
2 changes: 1 addition & 1 deletion dev_docs/tutorials/data/search.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ export const myEnhancedSearchStrategyProvider = (
await ese.cancel(id, options, deps);
},
extend: async (id, keepAlive, options, deps) => {
// async search results are not stored indefinitely. By default, they expire after 7 days (or as defined by xpack.data_enhanced.search.sessions.defaultExpiration setting in kibana.yml).
// async search results are not stored indefinitely. By default, they expire after 7 days (or as defined by data.search.sessions.defaultExpiration setting in kibana.yml).
// call the extend method of the async strategy you are using or implement your own extend function.
await ese.extend(id, options, deps);
},
Expand Down
4 changes: 0 additions & 4 deletions docs/developer/plugin-list.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -412,10 +412,6 @@ The plugin exposes the static DefaultEditorController class to consume.
|Adds drilldown capabilities to dashboard. Owned by the Kibana App team.
|{kib-repo}blob/{branch}/x-pack/plugins/data_enhanced/README.md[dataEnhanced]
|The data_enhanced plugin is the x-pack counterpart to the src/plguins/data plugin.
|{kib-repo}blob/{branch}/x-pack/plugins/data_visualizer/README.md[dataVisualizer]
|The data_visualizer plugin enables you to explore the fields in your data.
Expand Down
6 changes: 0 additions & 6 deletions docs/maps/import-geospatial-data.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -96,12 +96,6 @@ To open an existing index for drawing:

. Click *Add layer*.

. Set *Scaling* to *Limit results to 10,000*.

. In **Filtering**:
** Clear the *Apply global search to layer data* checkbox.
** If your data view contains a default time field, clear the *Apply global time to layer data* checkbox.

. Click *Save & close*.

. In the legend, click the layer name and select *Edit features*.
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@
"deep-freeze-strict": "^1.1.1",
"deepmerge": "^4.2.2",
"del": "^5.1.0",
"elastic-apm-node": "^3.31.0",
"elastic-apm-node": "^3.32.0",
"email-addresses": "^5.0.0",
"execa": "^4.0.2",
"exit-hook": "^2.2.0",
Expand Down
3 changes: 1 addition & 2 deletions packages/kbn-optimizer/limits.yml
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,7 @@ pageLoadAssetSize:
fieldFormats: 65209
kibanaReact: 74422
share: 71239
uiActions: 35121
dataEnhanced: 24980
uiActions: 35121
embeddable: 87309
embeddableEnhanced: 22107
uiActionsEnhanced: 38494
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,13 @@ kibana_vars=(
csp.report_to
data.autocomplete.valueSuggestions.terminateAfter
data.autocomplete.valueSuggestions.timeout
data.search.sessions.defaultExpiration
data.search.sessions.enabled
data.search.sessions.maxUpdateRetries
data.search.sessions.notTouchedInProgressTimeout
data.search.sessions.notTouchedTimeout
data.search.sessions.pageSize
data.search.sessions.trackingInterval
unifiedSearch.autocomplete.valueSuggestions.terminateAfter
unifiedSearch.autocomplete.valueSuggestions.timeout
unifiedSearch.autocomplete.querySuggestions.enabled
Expand Down
2 changes: 1 addition & 1 deletion src/dev/storybook/aliases.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export const storybookAliases = {
custom_integrations: 'src/plugins/custom_integrations/storybook',
dashboard_enhanced: 'x-pack/plugins/dashboard_enhanced/.storybook',
dashboard: 'src/plugins/dashboard/.storybook',
data_enhanced: 'x-pack/plugins/data_enhanced/.storybook',
data: 'src/plugins/data/.storybook',
discover: 'src/plugins/discover/.storybook',
embeddable: 'src/plugins/embeddable/.storybook',
expression_error: 'src/plugins/expression_error/.storybook',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import * as InputMode from '../../models/legacy_core_editor/mode/input';
const inputMode = new InputMode.Mode();
import * as editor from '../../models/legacy_core_editor';
import { applyCurrentSettings } from '../editor/legacy/console_editor/apply_editor_settings';
import { formatRequestBodyDoc } from '../../../lib/utils';

interface Props {
settings: DevToolsSettings;
Expand All @@ -41,7 +42,9 @@ export function HistoryViewer({ settings, req }: Props) {
if (viewerRef.current) {
const { current: viewer } = viewerRef;
if (req) {
const s = req.method + ' ' + req.endpoint + '\n' + (req.data || '');
const indent = true;
const formattedData = req.data ? formatRequestBodyDoc([req.data], indent).data : '';
const s = req.method + ' ' + req.endpoint + '\n' + formattedData;
viewer.update(s, inputMode);
viewer.clearSelection();
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import RowParser from '../../../lib/row_parser';
import { ESRequest } from '../../../types';
import { SenseEditor } from '../../models/sense_editor';
import { formatRequestBodyDoc } from '../../../lib/utils';

export function restoreRequestFromHistory(editor: SenseEditor, req: ESRequest) {
const coreEditor = editor.getCoreEditor();
Expand All @@ -32,7 +33,9 @@ export function restoreRequestFromHistory(editor: SenseEditor, req: ESRequest) {

let s = prefix + req.method + ' ' + req.endpoint;
if (req.data) {
s += '\n' + req.data;
const indent = true;
const formattedData = formatRequestBodyDoc([req.data], indent);
s += '\n' + formattedData.data;
}

s += suffix;
Expand Down
9 changes: 9 additions & 0 deletions src/plugins/data/.storybook/main.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0 and the Server Side Public License, v 1; you may not use this file except
* in compliance with, at your election, the Elastic License 2.0 or the Server
* Side Public License, v 1.
*/

module.exports = require('@kbn/storybook').defaultConfig;
31 changes: 16 additions & 15 deletions src/plugins/data/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,6 @@

import { schema, TypeOf } from '@kbn/config-schema';

export const configSchema = schema.object({
search: schema.object({
aggs: schema.object({
shardDelay: schema.object({
// Whether or not to register the shard_delay (which is only available in snapshot versions
// of Elasticsearch) agg type/expression function to make it available in the UI for either
// functional or manual testing
enabled: schema.boolean({ defaultValue: false }),
}),
}),
}),
});

export type ConfigSchema = TypeOf<typeof configSchema>;

export const searchSessionsConfigSchema = schema.object({
/**
* Turns the feature on \ off (incl. removing indicator and management screens)
Expand Down Expand Up @@ -90,4 +75,20 @@ export const searchSessionsConfigSchema = schema.object({
}),
});

export const configSchema = schema.object({
search: schema.object({
aggs: schema.object({
shardDelay: schema.object({
// Whether or not to register the shard_delay (which is only available in snapshot versions
// of Elasticsearch) agg type/expression function to make it available in the UI for either
// functional or manual testing
enabled: schema.boolean({ defaultValue: false }),
}),
}),
sessions: searchSessionsConfigSchema,
}),
});

export type ConfigSchema = TypeOf<typeof configSchema>;

export type SearchSessionsConfigSchema = TypeOf<typeof searchSessionsConfigSchema>;
12 changes: 11 additions & 1 deletion src/plugins/data/kibana.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,17 @@
"version": "kibana",
"server": true,
"ui": true,
"requiredPlugins": ["bfetch", "expressions", "uiActions", "share", "inspector", "fieldFormats", "dataViews"],
"requiredPlugins": [
"bfetch",
"expressions",
"uiActions",
"share",
"inspector",
"fieldFormats",
"dataViews",
"screenshotMode",
"management"
],
"serviceFolders": ["search", "query", "ui"],
"optionalPlugins": ["usageCollection", "taskManager", "security"],
"extraPublicDirs": ["common"],
Expand Down
10 changes: 8 additions & 2 deletions src/plugins/data/public/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ export class DataPublicPlugin
usageCollection,
inspector,
fieldFormats,
management,
}: DataSetupDependencies
): DataPublicPluginSetup {
const startServices = createStartServicesGetter(core.getStartServices);
Expand All @@ -84,6 +85,7 @@ export class DataPublicPlugin
usageCollection,
expressions,
nowProvider: this.nowProvider,
management,
});

const queryService = this.queryService.setup({
Expand Down Expand Up @@ -117,7 +119,7 @@ export class DataPublicPlugin

public start(
core: CoreStart,
{ uiActions, fieldFormats, dataViews }: DataStartDependencies
{ uiActions, fieldFormats, dataViews, screenshotMode }: DataStartDependencies
): DataPublicPluginStart {
const { uiSettings, notifications, overlays } = core;
setNotifications(notifications);
Expand All @@ -131,7 +133,11 @@ export class DataPublicPlugin
uiSettings,
});

const search = this.searchService.start(core, { fieldFormats, indexPatterns: dataViews });
const search = this.searchService.start(core, {
fieldFormats,
indexPatterns: dataViews,
screenshotMode,
});
setSearchService(search);

uiActions.addTriggerAction(
Expand Down
14 changes: 13 additions & 1 deletion src/plugins/data/public/search/search_service.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,16 @@ import { CoreSetup, CoreStart } from '@kbn/core/public';

import { SearchService, SearchServiceSetupDependencies } from './search_service';
import { bfetchPluginMock } from '@kbn/bfetch-plugin/public/mocks';
import { managementPluginMock } from '@kbn/management-plugin/public/mocks';
import { screenshotModePluginMock } from '@kbn/screenshot-mode-plugin/public/mocks';

describe('Search service', () => {
let searchService: SearchService;
let mockCoreSetup: MockedKeys<CoreSetup>;
let mockCoreStart: MockedKeys<CoreStart>;
const initializerContext = coreMock.createPluginInitializerContext();
initializerContext.config.get = jest.fn().mockReturnValue({
search: { aggs: { shardDelay: { enabled: false } } },
search: { aggs: { shardDelay: { enabled: false } }, sessions: { enabled: true } },
});

beforeEach(() => {
Expand All @@ -35,6 +37,7 @@ describe('Search service', () => {
packageInfo: { version: '8' },
bfetch,
expressions: { registerFunction: jest.fn(), registerType: jest.fn() },
management: managementPluginMock.createSetupContract(),
} as unknown as SearchServiceSetupDependencies);
expect(setup).toHaveProperty('aggs');
expect(setup).toHaveProperty('usageCollector');
Expand All @@ -45,9 +48,18 @@ describe('Search service', () => {

describe('start()', () => {
it('exposes proper contract', async () => {
const bfetch = bfetchPluginMock.createSetupContract();
searchService.setup(mockCoreSetup, {
packageInfo: { version: '8' },
bfetch,
expressions: { registerFunction: jest.fn(), registerType: jest.fn() },
management: managementPluginMock.createSetupContract(),
} as unknown as SearchServiceSetupDependencies);

const start = searchService.start(mockCoreStart, {
fieldFormats: {},
indexPatterns: {},
screenshotMode: screenshotModePluginMock.createStartContract(),
} as any);
expect(start).toHaveProperty('aggs');
expect(start).toHaveProperty('search');
Expand Down
Loading

0 comments on commit 59ee004

Please sign in to comment.