From 1bc60b01157308504cee599a78591cb0043c859b Mon Sep 17 00:00:00 2001 From: Ahmad Bamieh Date: Mon, 25 Oct 2021 17:30:35 +0300 Subject: [PATCH 01/23] [Telemetry] add missing content-type to headers (#116120) --- src/plugins/telemetry/server/fetcher.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/plugins/telemetry/server/fetcher.ts b/src/plugins/telemetry/server/fetcher.ts index 02ac428b07667..97180f351986e 100644 --- a/src/plugins/telemetry/server/fetcher.ts +++ b/src/plugins/telemetry/server/fetcher.ts @@ -230,6 +230,7 @@ export class FetcherTask { method: 'post', body: stats, headers: { + 'Content-Type': 'application/json', 'X-Elastic-Stack-Version': this.currentKibanaVersion, 'X-Elastic-Cluster-ID': clusterUuid, 'X-Elastic-Content-Encoding': PAYLOAD_CONTENT_ENCODING, From 1527535fcd85489f16b4d91e4888b95f8f9cf32f Mon Sep 17 00:00:00 2001 From: Pablo Machado Date: Mon, 25 Oct 2021 16:58:47 +0200 Subject: [PATCH 02/23] Update alert count table to display rules with long names (#115920) Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> --- .../components/alerts_kpis/alerts_count_panel/alerts_count.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/x-pack/plugins/security_solution/public/detections/components/alerts_kpis/alerts_count_panel/alerts_count.tsx b/x-pack/plugins/security_solution/public/detections/components/alerts_kpis/alerts_count_panel/alerts_count.tsx index f64e279fb2755..d6b1afea98592 100644 --- a/x-pack/plugins/security_solution/public/detections/components/alerts_kpis/alerts_count_panel/alerts_count.tsx +++ b/x-pack/plugins/security_solution/public/detections/components/alerts_kpis/alerts_count_panel/alerts_count.tsx @@ -35,7 +35,7 @@ const getAlertsCountTableColumns = ( { field: 'key', name: selectedStackByOption, - truncateText: true, + truncateText: false, render: function DraggableStackOptionField(value: string) { return ( Date: Mon, 25 Oct 2021 16:25:44 +0100 Subject: [PATCH 03/23] skip flaky suite (#116078) --- .../apps/ml/data_frame_analytics/feature_importance.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/x-pack/test/functional/apps/ml/data_frame_analytics/feature_importance.ts b/x-pack/test/functional/apps/ml/data_frame_analytics/feature_importance.ts index 8561487dff7cb..3faee67c01a53 100644 --- a/x-pack/test/functional/apps/ml/data_frame_analytics/feature_importance.ts +++ b/x-pack/test/functional/apps/ml/data_frame_analytics/feature_importance.ts @@ -14,7 +14,8 @@ export default function ({ getService }: FtrProviderContext) { const esArchiver = getService('esArchiver'); const ml = getService('ml'); - describe('total feature importance panel and decision path popover', function () { + // FLAKY: https://github.com/elastic/kibana/issues/116078 + describe.skip('total feature importance panel and decision path popover', function () { const testDataList: Array<{ suiteTitle: string; archive: string; From 414a1fbf0d35513a089742f1dc494e8223b7b815 Mon Sep 17 00:00:00 2001 From: Julia Bardi <90178898+juliaElastic@users.noreply.github.com> Date: Mon, 25 Oct 2021 17:26:45 +0200 Subject: [PATCH 04/23] [Fleet] added package upgrade info logs (#116093) * added package upgrade info logs * using log meta * logging out meta object as well --- .../server/services/package_policy.test.ts | 6 +++ .../fleet/server/services/package_policy.ts | 51 ++++++++++++++++++- 2 files changed, 56 insertions(+), 1 deletion(-) diff --git a/x-pack/plugins/fleet/server/services/package_policy.test.ts b/x-pack/plugins/fleet/server/services/package_policy.test.ts index c25a1db753c73..46747762213f1 100644 --- a/x-pack/plugins/fleet/server/services/package_policy.test.ts +++ b/x-pack/plugins/fleet/server/services/package_policy.test.ts @@ -578,6 +578,12 @@ describe('Package policy service', () => { }); describe('update', () => { + beforeEach(() => { + appContextService.start(createAppContextStartContractMock()); + }); + afterEach(() => { + appContextService.stop(); + }); it('should fail to update on version conflict', async () => { const savedObjectsClient = savedObjectsClientMock.create(); savedObjectsClient.get.mockResolvedValue({ diff --git a/x-pack/plugins/fleet/server/services/package_policy.ts b/x-pack/plugins/fleet/server/services/package_policy.ts index fa9df22eb5e8c..c03ccfc43ebd8 100644 --- a/x-pack/plugins/fleet/server/services/package_policy.ts +++ b/x-pack/plugins/fleet/server/services/package_policy.ts @@ -9,7 +9,7 @@ import { omit, partition } from 'lodash'; import { i18n } from '@kbn/i18n'; import semverLte from 'semver/functions/lte'; import { getFlattenedObject } from '@kbn/std'; -import type { KibanaRequest } from 'src/core/server'; +import type { KibanaRequest, LogMeta } from 'src/core/server'; import type { ElasticsearchClient, RequestHandlerContext, @@ -84,6 +84,17 @@ export const DATA_STREAM_ALLOWED_INDEX_PRIVILEGES = new Set([ 'read_cross_cluster', ]); +interface PackagePolicyUpgradeLogMeta extends LogMeta { + package_policy_upgrade: { + package_name: string; + current_version: string; + new_version: string; + status: 'success' | 'failure'; + error?: any[]; + dryRun?: boolean; + }; +} + class PackagePolicyService { public async create( soClient: SavedObjectsClientContract, @@ -432,6 +443,23 @@ class PackagePolicyService { pkgName: packagePolicy.package.name, currentVersion: packagePolicy.package.version, }); + + const upgradeMeta: PackagePolicyUpgradeLogMeta = { + package_policy_upgrade: { + package_name: packagePolicy.package.name, + new_version: packagePolicy.package.version, + current_version: 'unknown', + status: 'success', + dryRun: false, + }, + }; + + appContextService + .getLogger() + .info( + `Package policy successfully upgraded ${JSON.stringify(upgradeMeta)}`, + upgradeMeta + ); } return newPolicy; @@ -661,6 +689,27 @@ class PackagePolicyService { const hasErrors = 'errors' in updatedPackagePolicy; + if (packagePolicy.package.version !== packageInfo.version) { + const upgradeMeta: PackagePolicyUpgradeLogMeta = { + package_policy_upgrade: { + package_name: packageInfo.name, + current_version: packagePolicy.package.version, + new_version: packageInfo.version, + status: hasErrors ? 'failure' : 'success', + error: hasErrors ? updatedPackagePolicy.errors : undefined, + dryRun: true, + }, + }; + appContextService + .getLogger() + .info( + `Package policy upgrade dry run ${ + hasErrors ? 'resulted in errors' : 'ran successfully' + } ${JSON.stringify(upgradeMeta)}`, + upgradeMeta + ); + } + return { name: updatedPackagePolicy.name, diff: [packagePolicy, updatedPackagePolicy], From 80bb1ad8dac3a7d5c28897629e8c34c14d384816 Mon Sep 17 00:00:00 2001 From: Esteban Beltran Date: Mon, 25 Oct 2021 17:48:36 +0200 Subject: [PATCH 05/23] [Security Solution] Replace badge with health indicator in endpoint details flyout (#115901) --- .../components/endpoint_details_tabs.tsx | 2 +- .../view/details/endpoint_details_content.tsx | 50 ++++++--------- .../pages/endpoint_hosts/view/index.test.tsx | 61 +++++++------------ 3 files changed, 41 insertions(+), 72 deletions(-) diff --git a/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/view/details/components/endpoint_details_tabs.tsx b/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/view/details/components/endpoint_details_tabs.tsx index 8f044959f4c90..adae21b55a637 100644 --- a/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/view/details/components/endpoint_details_tabs.tsx +++ b/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/view/details/components/endpoint_details_tabs.tsx @@ -62,7 +62,7 @@ export const EndpointDetailsFlyoutTabs = memo( const selectedTab = useMemo(() => tabs.find((tab) => tab.id === show), [tabs, show]); const renderTabs = tabs.map((tab) => ( - + )); return ( diff --git a/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/view/details/endpoint_details_content.tsx b/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/view/details/endpoint_details_content.tsx index cc1cad52eb21c..cb920bdbd1b03 100644 --- a/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/view/details/endpoint_details_content.tsx +++ b/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/view/details/endpoint_details_content.tsx @@ -13,8 +13,9 @@ import { EuiText, EuiFlexGroup, EuiFlexItem, - EuiBadge, EuiSpacer, + EuiLink, + EuiHealth, } from '@elastic/eui'; import React, { memo, useMemo } from 'react'; import { FormattedMessage } from '@kbn/i18n/react'; @@ -30,7 +31,6 @@ import { getEndpointDetailsPath } from '../../../../common/routing'; import { EndpointPolicyLink } from '../components/endpoint_policy_link'; import { OutOfDate } from '../components/out_of_date'; import { EndpointAgentStatus } from '../components/endpoint_agent_status'; -import { useAppUrl } from '../../../../../common/lib/kibana/hooks'; const HostIds = styled(EuiListGroupItem)` margin-top: 0; @@ -53,9 +53,8 @@ export const EndpointDetailsContent = memo( const policyStatus = useEndpointSelector( policyResponseStatus ) as keyof typeof POLICY_STATUS_TO_BADGE_COLOR; - const { getAppUrl } = useAppUrl(); - const [policyResponseUri, policyResponseRoutePath] = useMemo(() => { + const policyResponseRoutePath = useMemo(() => { // eslint-disable-next-line @typescript-eslint/naming-convention const { selected_endpoint, show, ...currentUrlParams } = queryParams; const path = getEndpointDetailsPath({ @@ -63,8 +62,8 @@ export const EndpointDetailsContent = memo( ...currentUrlParams, selected_endpoint: details.agent.id, }); - return [getAppUrl({ path }), path]; - }, [details.agent.id, getAppUrl, queryParams]); + return path; + }, [details.agent.id, queryParams]); const policyStatusClickHandler = useNavigateByRouterEventHandler(policyResponseRoutePath); @@ -142,26 +141,20 @@ export const EndpointDetailsContent = memo( defaultMessage: 'Policy Status', }), description: ( - // https://github.com/elastic/eui/issues/4530 - // @ts-ignore - - - - - + + + + + + ), }, { @@ -185,14 +178,7 @@ export const EndpointDetailsContent = memo( ), }, ]; - }, [ - details, - hostStatus, - policyResponseUri, - policyStatus, - policyStatusClickHandler, - policyInfo, - ]); + }, [details, hostStatus, policyStatus, policyStatusClickHandler, policyInfo]); return ( <> diff --git a/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/view/index.test.tsx b/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/view/index.test.tsx index 727c2e8a35024..45dcf5f7a0f7d 100644 --- a/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/view/index.test.tsx +++ b/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/view/index.test.tsx @@ -167,7 +167,7 @@ describe('when on the endpoint list page', () => { it('should NOT display timeline', async () => { const renderResult = render(); - const timelineFlyout = await renderResult.queryByTestId('flyoutOverlay'); + const timelineFlyout = renderResult.queryByTestId('flyoutOverlay'); expect(timelineFlyout).toBeNull(); }); @@ -460,7 +460,7 @@ describe('when on the endpoint list page', () => { const outOfDates = await renderResult.findAllByTestId('rowPolicyOutOfDate'); expect(outOfDates).toHaveLength(4); - outOfDates.forEach((item, index) => { + outOfDates.forEach((item) => { expect(item.textContent).toEqual('Out-of-date'); expect(item.querySelector(`[data-euiicon-type][color=warning]`)).not.toBeNull(); }); @@ -512,8 +512,8 @@ describe('when on the endpoint list page', () => { // FLAKY: https://github.com/elastic/kibana/issues/75721 describe.skip('when polling on Endpoint List', () => { - beforeEach(async () => { - await reactTestingLibrary.act(() => { + beforeEach(() => { + reactTestingLibrary.act(() => { const hostListData = mockEndpointResultList({ total: 4 }).hosts; setEndpointListApiMockImplementation(coreStart.http, { @@ -703,8 +703,8 @@ describe('when on the endpoint list page', () => { it('should show the flyout and footer', async () => { const renderResult = await renderAndWaitForData(); - await expect(renderResult.findByTestId('endpointDetailsFlyout')).not.toBeNull(); - await expect(renderResult.queryByTestId('endpointDetailsFlyoutFooter')).not.toBeNull(); + expect(renderResult.getByTestId('endpointDetailsFlyout')).not.toBeNull(); + expect(renderResult.getByTestId('endpointDetailsFlyoutFooter')).not.toBeNull(); }); it('should display policy name value as a link', async () => { @@ -738,15 +738,6 @@ describe('when on the endpoint list page', () => { ); }); - it('should display policy status value as a link', async () => { - const renderResult = await renderAndWaitForData(); - const policyStatusLink = await renderResult.findByTestId('policyStatusValue'); - expect(policyStatusLink).not.toBeNull(); - expect(policyStatusLink.getAttribute('href')).toEqual( - `${APP_PATH}${MANAGEMENT_PATH}/endpoints?page_index=0&page_size=10&selected_endpoint=1&show=policy_response` - ); - }); - it('should update the URL when policy status link is clicked', async () => { const renderResult = await renderAndWaitForData(); const policyStatusLink = await renderResult.findByTestId('policyStatusValue'); @@ -763,10 +754,8 @@ describe('when on the endpoint list page', () => { it('should display Success overall policy status', async () => { const renderResult = await renderAndWaitForData(); const policyStatusBadge = await renderResult.findByTestId('policyStatusValue'); + expect(renderResult.getByTestId('policyStatusValue-success')).toBeTruthy(); expect(policyStatusBadge.textContent).toEqual('Success'); - expect(policyStatusBadge.getAttribute('style')).toMatch( - /background-color\: rgb\(109\, 204\, 177\)\;/ - ); }); it('should display Warning overall policy status', async () => { @@ -774,9 +763,7 @@ describe('when on the endpoint list page', () => { const renderResult = await renderAndWaitForData(); const policyStatusBadge = await renderResult.findByTestId('policyStatusValue'); expect(policyStatusBadge.textContent).toEqual('Warning'); - expect(policyStatusBadge.getAttribute('style')).toMatch( - /background-color\: rgb\(241\, 216\, 111\)\;/ - ); + expect(renderResult.getByTestId('policyStatusValue-warning')).toBeTruthy(); }); it('should display Failed overall policy status', async () => { @@ -784,9 +771,7 @@ describe('when on the endpoint list page', () => { const renderResult = await renderAndWaitForData(); const policyStatusBadge = await renderResult.findByTestId('policyStatusValue'); expect(policyStatusBadge.textContent).toEqual('Failed'); - expect(policyStatusBadge.getAttribute('style')).toMatch( - /background-color\: rgb\(255\, 126\, 98\)\;/ - ); + expect(renderResult.getByTestId('policyStatusValue-failure')).toBeTruthy(); }); it('should display Unknown overall policy status', async () => { @@ -794,9 +779,7 @@ describe('when on the endpoint list page', () => { const renderResult = await renderAndWaitForData(); const policyStatusBadge = await renderResult.findByTestId('policyStatusValue'); expect(policyStatusBadge.textContent).toEqual('Unknown'); - expect(policyStatusBadge.getAttribute('style')).toMatch( - /background-color\: rgb\(211\, 218\, 230\)\;/ - ); + expect(renderResult.getByTestId('policyStatusValue-')).toBeTruthy(); }); it('should show the Take Action button', async () => { @@ -898,7 +881,7 @@ describe('when on the endpoint list page', () => { await reactTestingLibrary.act(async () => { await middlewareSpy.waitForAction('serverReturnedEndpointList'); }); - const hostNameLinks = await renderResult.getAllByTestId('hostnameCellLink'); + const hostNameLinks = renderResult.getAllByTestId('hostnameCellLink'); reactTestingLibrary.fireEvent.click(hostNameLinks[0]); }); @@ -913,7 +896,7 @@ describe('when on the endpoint list page', () => { reactTestingLibrary.act(() => { dispatchEndpointDetailsActivityLogChanged('success', getMockData()); }); - const endpointDetailsFlyout = await renderResult.queryByTestId('endpointDetailsFlyoutBody'); + const endpointDetailsFlyout = renderResult.queryByTestId('endpointDetailsFlyoutBody'); expect(endpointDetailsFlyout).not.toBeNull(); }); @@ -926,7 +909,7 @@ describe('when on the endpoint list page', () => { reactTestingLibrary.act(() => { dispatchEndpointDetailsActivityLogChanged('success', getMockData()); }); - const logEntries = await renderResult.queryAllByTestId('timelineEntry'); + const logEntries = renderResult.queryAllByTestId('timelineEntry'); expect(logEntries.length).toEqual(3); expect(`${logEntries[0]} .euiCommentTimeline__icon--update`).not.toBe(null); expect(`${logEntries[1]} .euiCommentTimeline__icon--regular`).not.toBe(null); @@ -944,7 +927,7 @@ describe('when on the endpoint list page', () => { getMockData({ hasLogsEndpointActionResponses: true }) ); }); - const logEntries = await renderResult.queryAllByTestId('timelineEntry'); + const logEntries = renderResult.queryAllByTestId('timelineEntry'); expect(logEntries.length).toEqual(4); expect(`${logEntries[0]} .euiCommentTimeline__icon--update`).not.toBe(null); expect(`${logEntries[1]} .euiCommentTimeline__icon--update`).not.toBe(null); @@ -960,7 +943,7 @@ describe('when on the endpoint list page', () => { reactTestingLibrary.act(() => { dispatchEndpointDetailsActivityLogChanged('failed', getMockData()); }); - const emptyState = await renderResult.queryByTestId('activityLogEmpty'); + const emptyState = renderResult.queryByTestId('activityLogEmpty'); expect(emptyState).not.toBe(null); }); @@ -980,10 +963,10 @@ describe('when on the endpoint list page', () => { }); }); - const emptyState = await renderResult.queryByTestId('activityLogEmpty'); + const emptyState = renderResult.queryByTestId('activityLogEmpty'); expect(emptyState).toBe(null); - const superDatePicker = await renderResult.queryByTestId('activityLogSuperDatePicker'); + const superDatePicker = renderResult.queryByTestId('activityLogSuperDatePicker'); expect(superDatePicker).not.toBe(null); }); @@ -1002,7 +985,7 @@ describe('when on the endpoint list page', () => { reactTestingLibrary.act(() => { dispatchEndpointDetailsActivityLogChanged('success', getMockData()); }); - const logEntries = await renderResult.queryAllByTestId('timelineEntry'); + const logEntries = renderResult.queryAllByTestId('timelineEntry'); expect(logEntries.length).toEqual(3); }); @@ -1047,7 +1030,7 @@ describe('when on the endpoint list page', () => { reactTestingLibrary.act(() => { dispatchEndpointDetailsActivityLogChanged('success', getMockData()); }); - const commentTexts = await renderResult.queryAllByTestId('activityLogCommentText'); + const commentTexts = renderResult.queryAllByTestId('activityLogCommentText'); expect(commentTexts.length).toEqual(1); expect(commentTexts[0].textContent).toEqual('some comment'); expect(commentTexts[0].parentElement?.parentElement?.className).toContain( @@ -1081,7 +1064,7 @@ describe('when on the endpoint list page', () => { afterEach(reactTestingLibrary.cleanup); it('should hide the host details panel', async () => { - const endpointDetailsFlyout = await renderResult.queryByTestId('endpointDetailsFlyoutBody'); + const endpointDetailsFlyout = renderResult.queryByTestId('endpointDetailsFlyoutBody'); expect(endpointDetailsFlyout).toBeNull(); }); @@ -1328,8 +1311,8 @@ describe('when on the endpoint list page', () => { ).toBe(true); }); - it('should NOT show the flyout footer', async () => { - await expect(renderResult.queryByTestId('endpointDetailsFlyoutFooter')).toBeNull(); + it('should NOT show the flyout footer', () => { + expect(renderResult.queryByTestId('endpointDetailsFlyoutFooter')).toBeNull(); }); }); }); From 4cc94c5a45e616b23e34aaac8dab28033edff3ec Mon Sep 17 00:00:00 2001 From: James Gowdy Date: Mon, 25 Oct 2021 16:54:32 +0100 Subject: [PATCH 06/23] [ML] Fixing index data visualizer not available when no ML nodes available (#115972) Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> --- .../routing/routes/datavisualizer/index_based.tsx | 7 ------- .../application/routing/routes/new_job/index_or_search.tsx | 7 ------- 2 files changed, 14 deletions(-) diff --git a/x-pack/plugins/ml/public/application/routing/routes/datavisualizer/index_based.tsx b/x-pack/plugins/ml/public/application/routing/routes/datavisualizer/index_based.tsx index b9e866d2e00d0..04543a28ab3e6 100644 --- a/x-pack/plugins/ml/public/application/routing/routes/datavisualizer/index_based.tsx +++ b/x-pack/plugins/ml/public/application/routing/routes/datavisualizer/index_based.tsx @@ -19,10 +19,7 @@ import { IndexDataVisualizerPage as Page } from '../../../datavisualizer/index_b import { checkBasicLicense } from '../../../license'; import { checkGetJobsCapabilitiesResolver } from '../../../capabilities/check_capabilities'; import { loadIndexPatterns } from '../../../util/index_utils'; -import { checkMlNodesAvailable } from '../../../ml_nodes_check'; import { getBreadcrumbWithUrlForApp } from '../../breadcrumbs'; -import { ML_PAGES } from '../../../../../common/constants/locator'; -import { useCreateAndNavigateToMlLink } from '../../../contexts/kibana/use_create_url'; export const indexBasedRouteFactory = ( navigateToPath: NavigateToPath, @@ -44,16 +41,12 @@ export const indexBasedRouteFactory = ( const PageWrapper: FC = ({ location, deps }) => { const { redirectToMlAccessDeniedPage } = deps; - const redirectToJobsManagementPage = useCreateAndNavigateToMlLink( - ML_PAGES.ANOMALY_DETECTION_JOBS_MANAGE - ); const { index, savedSearchId }: Record = parse(location.search, { sort: false }); const { context } = useResolver(index, savedSearchId, deps.config, { checkBasicLicense, loadIndexPatterns: () => loadIndexPatterns(deps.indexPatterns), checkGetJobsCapabilities: () => checkGetJobsCapabilitiesResolver(redirectToMlAccessDeniedPage), - checkMlNodesAvailable: () => checkMlNodesAvailable(redirectToJobsManagementPage), }); return ( diff --git a/x-pack/plugins/ml/public/application/routing/routes/new_job/index_or_search.tsx b/x-pack/plugins/ml/public/application/routing/routes/new_job/index_or_search.tsx index 8500d85d5580a..53057cb16c132 100644 --- a/x-pack/plugins/ml/public/application/routing/routes/new_job/index_or_search.tsx +++ b/x-pack/plugins/ml/public/application/routing/routes/new_job/index_or_search.tsx @@ -19,9 +19,6 @@ import { getBreadcrumbWithUrlForApp } from '../../breadcrumbs'; import { checkBasicLicense } from '../../../license'; import { loadIndexPatterns } from '../../../util/index_utils'; import { checkGetJobsCapabilitiesResolver } from '../../../capabilities/check_capabilities'; -import { checkMlNodesAvailable } from '../../../ml_nodes_check'; -import { ML_PAGES } from '../../../../../common/constants/locator'; -import { useCreateAndNavigateToMlLink } from '../../../contexts/kibana/use_create_url'; enum MODE { NEW_JOB, @@ -85,9 +82,6 @@ const PageWrapper: FC = ({ nextStepPath, deps, mode }) = } = useMlKibana(); const { redirectToMlAccessDeniedPage } = deps; - const redirectToJobsManagementPage = useCreateAndNavigateToMlLink( - ML_PAGES.ANOMALY_DETECTION_JOBS_MANAGE - ); const newJobResolvers = { ...basicResolvers(deps), @@ -98,7 +92,6 @@ const PageWrapper: FC = ({ nextStepPath, deps, mode }) = checkBasicLicense, loadIndexPatterns: () => loadIndexPatterns(deps.indexPatterns), checkGetJobsCapabilities: () => checkGetJobsCapabilitiesResolver(redirectToMlAccessDeniedPage), - checkMlNodesAvailable: () => checkMlNodesAvailable(redirectToJobsManagementPage), }; const { context } = useResolver( From d91bc28846762f916c5c8cc5faa4e6f6a61107f3 Mon Sep 17 00:00:00 2001 From: Jason Rhodes Date: Mon, 25 Oct 2021 12:04:57 -0400 Subject: [PATCH 07/23] Conditionally sets ignore_throttled only when search:includeFrozen is true (#115451) Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> --- .../framework/kibana_framework_adapter.ts | 62 ++++++++++--------- 1 file changed, 33 insertions(+), 29 deletions(-) diff --git a/x-pack/plugins/infra/server/lib/adapters/framework/kibana_framework_adapter.ts b/x-pack/plugins/infra/server/lib/adapters/framework/kibana_framework_adapter.ts index 4576a2e8452ac..b1ea0ce21b3c1 100644 --- a/x-pack/plugins/infra/server/lib/adapters/framework/kibana_framework_adapter.ts +++ b/x-pack/plugins/infra/server/lib/adapters/framework/kibana_framework_adapter.ts @@ -5,37 +5,41 @@ * 2.0. */ +import { estypes } from '@elastic/elasticsearch'; import { IndicesExistsAlias, IndicesGet, MlGetBuckets, } from '@elastic/elasticsearch/api/requestParams'; import { TransportRequestParams } from '@elastic/elasticsearch/lib/Transport'; -import { estypes } from '@elastic/elasticsearch'; -import { SavedObjectsClientContract, ElasticsearchClient } from 'src/core/server'; -import { - InfraRouteConfig, - InfraServerPluginSetupDeps, - CallWithRequestParams, - InfraDatabaseSearchResponse, - InfraDatabaseMultiResponse, - InfraDatabaseFieldCapsResponse, - InfraDatabaseGetIndicesResponse, - InfraDatabaseGetIndicesAliasResponse, -} from './adapter_types'; -import { TSVBMetricModel } from '../../../../common/inventory_models/types'; +import { ElasticsearchClient, SavedObjectsClientContract } from 'src/core/server'; import { CoreSetup, IRouter, KibanaRequest, + RequestHandler, RouteMethod, } from '../../../../../../../src/core/server'; -import { RequestHandler } from '../../../../../../../src/core/server'; -import { InfraConfig } from '../../../plugin'; -import type { InfraPluginRequestHandlerContext } from '../../../types'; import { UI_SETTINGS } from '../../../../../../../src/plugins/data/server'; import { TimeseriesVisData } from '../../../../../../../src/plugins/vis_types/timeseries/server'; -import { InfraServerPluginStartDeps } from './adapter_types'; +import { TSVBMetricModel } from '../../../../common/inventory_models/types'; +import { InfraConfig } from '../../../plugin'; +import type { InfraPluginRequestHandlerContext } from '../../../types'; +import { + CallWithRequestParams, + InfraDatabaseFieldCapsResponse, + InfraDatabaseGetIndicesAliasResponse, + InfraDatabaseGetIndicesResponse, + InfraDatabaseMultiResponse, + InfraDatabaseSearchResponse, + InfraRouteConfig, + InfraServerPluginSetupDeps, + InfraServerPluginStartDeps, +} from './adapter_types'; + +interface FrozenIndexParams { + ignore_throttled?: boolean; +} export class KibanaFramework { public router: IRouter; @@ -133,7 +137,7 @@ export class KibanaFramework { ) { const { elasticsearch, uiSettings } = requestContext.core; - const includeFrozen = await uiSettings.client.get(UI_SETTINGS.SEARCH_INCLUDE_FROZEN); + const includeFrozen = await uiSettings.client.get(UI_SETTINGS.SEARCH_INCLUDE_FROZEN); if (endpoint === 'msearch') { const maxConcurrentShardRequests = await uiSettings.client.get( UI_SETTINGS.COURIER_MAX_CONCURRENT_SHARD_REQUESTS @@ -143,11 +147,17 @@ export class KibanaFramework { } } - const frozenIndicesParams = ['search', 'msearch'].includes(endpoint) - ? { - ignore_throttled: !includeFrozen, - } - : {}; + // Only set the "ignore_throttled" value (to false) if the Kibana setting + // for "search:includeFrozen" is true (i.e. don't ignore throttled indices, a triple negative!) + // More information: + // - https://github.com/elastic/kibana/issues/113197 + // - https://github.com/elastic/elasticsearch/pull/77479 + // + // NOTE: these params only need to be spread onto the search and msearch calls below + const frozenIndicesParams: FrozenIndexParams = {}; + if (includeFrozen) { + frozenIndicesParams.ignore_throttled = false; + } let apiResult; switch (endpoint) { @@ -166,37 +176,31 @@ export class KibanaFramework { case 'fieldCaps': apiResult = elasticsearch.client.asCurrentUser.fieldCaps({ ...params, - ...frozenIndicesParams, }); break; case 'indices.existsAlias': apiResult = elasticsearch.client.asCurrentUser.indices.existsAlias({ ...params, - ...frozenIndicesParams, } as IndicesExistsAlias); break; case 'indices.getAlias': apiResult = elasticsearch.client.asCurrentUser.indices.getAlias({ ...params, - ...frozenIndicesParams, }); break; case 'indices.get': apiResult = elasticsearch.client.asCurrentUser.indices.get({ ...params, - ...frozenIndicesParams, } as IndicesGet); break; case 'transport.request': apiResult = elasticsearch.client.asCurrentUser.transport.request({ ...params, - ...frozenIndicesParams, } as TransportRequestParams); break; case 'ml.getBuckets': apiResult = elasticsearch.client.asCurrentUser.ml.getBuckets({ ...params, - ...frozenIndicesParams, } as MlGetBuckets); break; } From 1e718a557211e1eda5fd1282c171c43daebff3fe Mon Sep 17 00:00:00 2001 From: Matthew Kime Date: Mon, 25 Oct 2021 11:10:16 -0500 Subject: [PATCH 08/23] [data views] Make data view saved objects share capable (#114408) --- .../server/saved_objects/data_views.ts | 3 +- .../apis/saved_objects_management/find.ts | 2 +- .../saved_objects_management/relationships.ts | 4 +- .../saved_objects/spaces/data.json | 23 ++++--- .../common/suites/copy_to_space.ts | 15 +++-- .../suites/resolve_copy_to_space_conflicts.ts | 67 ++++++++++--------- .../apis/resolve_copy_to_space_conflicts.ts | 5 +- 7 files changed, 67 insertions(+), 52 deletions(-) diff --git a/src/plugins/data_views/server/saved_objects/data_views.ts b/src/plugins/data_views/server/saved_objects/data_views.ts index 5bb85a9bb6e98..ca7592732c3ee 100644 --- a/src/plugins/data_views/server/saved_objects/data_views.ts +++ b/src/plugins/data_views/server/saved_objects/data_views.ts @@ -13,7 +13,8 @@ import { DATA_VIEW_SAVED_OBJECT_TYPE } from '../../common'; export const dataViewSavedObjectType: SavedObjectsType = { name: DATA_VIEW_SAVED_OBJECT_TYPE, hidden: false, - namespaceType: 'single', + namespaceType: 'multiple-isolated', + convertToMultiNamespaceTypeVersion: '8.0.0', management: { displayName: 'Data view', icon: 'indexPatternApp', diff --git a/test/api_integration/apis/saved_objects_management/find.ts b/test/api_integration/apis/saved_objects_management/find.ts index 0b744b7991b38..ea7f297dfeb08 100644 --- a/test/api_integration/apis/saved_objects_management/find.ts +++ b/test/api_integration/apis/saved_objects_management/find.ts @@ -249,7 +249,7 @@ export default function ({ getService }: FtrProviderContext) { path: '/app/management/kibana/dataViews/dataView/8963ca30-3224-11e8-a572-ffca06da1357', uiCapabilitiesPath: 'management.kibana.indexPatterns', }, - namespaceType: 'single', + namespaceType: 'multiple-isolated', }); })); }); diff --git a/test/api_integration/apis/saved_objects_management/relationships.ts b/test/api_integration/apis/saved_objects_management/relationships.ts index 518ec29947016..838bc05346dda 100644 --- a/test/api_integration/apis/saved_objects_management/relationships.ts +++ b/test/api_integration/apis/saved_objects_management/relationships.ts @@ -91,7 +91,7 @@ export default function ({ getService }: FtrProviderContext) { path: '/app/management/kibana/dataViews/dataView/8963ca30-3224-11e8-a572-ffca06da1357', uiCapabilitiesPath: 'management.kibana.indexPatterns', }, - namespaceType: 'single', + namespaceType: 'multiple-isolated', hiddenType: false, }, }, @@ -132,7 +132,7 @@ export default function ({ getService }: FtrProviderContext) { path: '/app/management/kibana/dataViews/dataView/8963ca30-3224-11e8-a572-ffca06da1357', uiCapabilitiesPath: 'management.kibana.indexPatterns', }, - namespaceType: 'single', + namespaceType: 'multiple-isolated', hiddenType: false, }, relationship: 'child', diff --git a/x-pack/test/spaces_api_integration/common/fixtures/es_archiver/saved_objects/spaces/data.json b/x-pack/test/spaces_api_integration/common/fixtures/es_archiver/saved_objects/spaces/data.json index 3b2a87d924e88..c1525409cfa3f 100644 --- a/x-pack/test/spaces_api_integration/common/fixtures/es_archiver/saved_objects/spaces/data.json +++ b/x-pack/test/spaces_api_integration/common/fixtures/es_archiver/saved_objects/spaces/data.json @@ -153,7 +153,7 @@ "references": [ { "type": "index-pattern", - "id": "cts_ip_1", + "id": "cts_ip_1_default", "name": "CTS IP 1" } ], @@ -182,7 +182,7 @@ "references": [ { "type": "index-pattern", - "id": "cts_ip_1", + "id": "cts_ip_1_default", "name": "CTS IP 1" } ], @@ -212,7 +212,7 @@ "references": [ { "type": "index-pattern", - "id": "cts_ip_1", + "id": "cts_ip_1_default", "name": "CTS IP 1" } ], @@ -276,7 +276,7 @@ "references": [ { "type": "index-pattern", - "id": "cts_ip_1", + "id": "cts_ip_1_space_1", "name": "CTS IP 1" } ], @@ -305,7 +305,7 @@ "references": [ { "type": "index-pattern", - "id": "cts_ip_1", + "id": "cts_ip_1_space_1", "name": "CTS IP 1" } ], @@ -335,7 +335,7 @@ "references": [ { "type": "index-pattern", - "id": "cts_ip_1", + "id": "cts_ip_1_space_1", "name": "CTS IP 1" } ], @@ -350,15 +350,17 @@ { "type": "_doc", "value": { - "id": "index-pattern:cts_ip_1", + "id": "index-pattern:cts_ip_1_default", "index": ".kibana", "source": { + "originId": "cts_ip_1", "index-pattern": { "title": "Copy to Space index pattern 1 from default space" }, "references": [], "type": "index-pattern", - "updated_at": "2017-09-21T18:49:16.270Z" + "updated_at": "2017-09-21T18:49:16.270Z", + "namespaces": ["default"] }, "type": "_doc" } @@ -367,16 +369,17 @@ { "type": "_doc", "value": { - "id": "space_1:index-pattern:cts_ip_1", + "id": "index-pattern:cts_ip_1_space_1", "index": ".kibana", "source": { + "originId": "cts_ip_1", "index-pattern": { "title": "Copy to Space index pattern 1 from space_1 space" }, "references": [], "type": "index-pattern", "updated_at": "2017-09-21T18:49:16.270Z", - "namespace": "space_1" + "namespaces": ["space_1"] }, "type": "_doc" } diff --git a/x-pack/test/spaces_api_integration/common/suites/copy_to_space.ts b/x-pack/test/spaces_api_integration/common/suites/copy_to_space.ts index 3a3f0f889c91c..23136838f3002 100644 --- a/x-pack/test/spaces_api_integration/common/suites/copy_to_space.ts +++ b/x-pack/test/spaces_api_integration/common/suites/copy_to_space.ts @@ -183,6 +183,8 @@ export function copyToSpaceTestSuiteFactory( const destination = getDestinationWithoutConflicts(); const result = resp.body as CopyResponse; + const indexPatternDestinationId = result[destination].successResults![0].destinationId; + expect(indexPatternDestinationId).to.match(UUID_PATTERN); // this was copied to space 2 and hit an unresolvable conflict, so the object ID was regenerated silently / the destinationId is a UUID const vis1DestinationId = result[destination].successResults![1].destinationId; expect(vis1DestinationId).to.match(UUID_PATTERN); // this was copied to space 2 and hit an unresolvable conflict, so the object ID was regenerated silently / the destinationId is a UUID const vis2DestinationId = result[destination].successResults![2].destinationId; @@ -196,12 +198,13 @@ export function copyToSpaceTestSuiteFactory( successCount: 5, successResults: [ { - id: 'cts_ip_1', + id: `cts_ip_1_${spaceId}`, type: 'index-pattern', meta: { icon: 'indexPatternApp', title: `Copy to Space index pattern 1 from ${spaceId} space`, }, + destinationId: indexPatternDestinationId, }, { id: `cts_vis_1_${spaceId}`, @@ -321,13 +324,14 @@ export function copyToSpaceTestSuiteFactory( successCount: 5, successResults: [ { - id: 'cts_ip_1', + id: `cts_ip_1_${spaceId}`, type: 'index-pattern', meta: { icon: 'indexPatternApp', title: `Copy to Space index pattern 1 from ${spaceId} space`, }, overwrite: true, + destinationId: `cts_ip_1_${destination}`, // this conflicted with another index pattern in the destination space because of a shared originId }, { id: `cts_vis_1_${spaceId}`, @@ -409,8 +413,11 @@ export function copyToSpaceTestSuiteFactory( }, }, { - error: { type: 'conflict' }, - id: 'cts_ip_1', + error: { + type: 'conflict', + destinationId: `cts_ip_1_${destination}`, // this conflicted with another index pattern in the destination space because of a shared originId + }, + id: `cts_ip_1_${spaceId}`, title: `Copy to Space index pattern 1 from ${spaceId} space`, type: 'index-pattern', meta: { diff --git a/x-pack/test/spaces_api_integration/common/suites/resolve_copy_to_space_conflicts.ts b/x-pack/test/spaces_api_integration/common/suites/resolve_copy_to_space_conflicts.ts index b190a37965b0b..72130743b69d9 100644 --- a/x-pack/test/spaces_api_integration/common/suites/resolve_copy_to_space_conflicts.ts +++ b/x-pack/test/spaces_api_integration/common/suites/resolve_copy_to_space_conflicts.ts @@ -82,8 +82,18 @@ export function resolveCopyToSpaceConflictsSuite( expect(result).to.eql({ [destination]: { success: true, - successCount: 1, + successCount: 2, successResults: [ + { + id: `cts_ip_1_${sourceSpaceId}`, + type: 'index-pattern', + meta: { + title: `Copy to Space index pattern 1 from ${sourceSpaceId} space`, + icon: 'indexPatternApp', + }, + destinationId: `cts_ip_1_${destination}`, // this conflicted with another index pattern in the destination space because of a shared originId + overwrite: true, + }, { id: `cts_vis_3_${sourceSpaceId}`, type: 'visualization', @@ -146,6 +156,19 @@ export function resolveCopyToSpaceConflictsSuite( success: false, successCount: 0, errors: [ + { + error: { + type: 'conflict', + destinationId: `cts_ip_1_${destination}`, // this conflicted with another index pattern in the destination space because of a shared originId + }, + id: `cts_ip_1_${sourceSpaceId}`, + title: `Copy to Space index pattern 1 from ${sourceSpaceId} space`, + meta: { + title: `Copy to Space index pattern 1 from ${sourceSpaceId} space`, + icon: 'indexPatternApp', + }, + type: 'index-pattern', + }, { error: { type: 'conflict', @@ -231,35 +254,7 @@ export function resolveCopyToSpaceConflictsSuite( { statusCode: 403, error: 'Forbidden', - message: 'Unable to bulk_get index-pattern', - }, - ], - }, - } as CopyResponse); - - // Query ES to ensure that nothing was copied - const [dashboard, visualization] = await getObjectsAtSpace(destination); - expect(dashboard.attributes.title).to.eql( - `This is the ${destination} test space CTS dashboard` - ); - expect(visualization.attributes.title).to.eql(`CTS vis 3 from ${destination} space`); - }; - - const createExpectReadonlyAtSpaceWithReferencesResult = - (spaceId: string = DEFAULT_SPACE_ID) => - async (resp: TestResponse) => { - const destination = getDestinationSpace(spaceId); - - const result = resp.body as CopyResponse; - expect(result).to.eql({ - [destination]: { - success: false, - successCount: 0, - errors: [ - { - statusCode: 403, - error: 'Forbidden', - message: 'Unable to bulk_create visualization', + message: 'Unable to bulk_create index-pattern,visualization', }, ], }, @@ -449,6 +444,7 @@ export function resolveCopyToSpaceConflictsSuite( const dashboardObject = { type: 'dashboard', id: 'cts_dashboard' }; const visualizationObject = { type: 'visualization', id: `cts_vis_3_${spaceId}` }; + const indexPatternObject = { type: 'index-pattern', id: `cts_ip_1_${spaceId}` }; it(`should return ${tests.withReferencesNotOverwriting.statusCode} when not overwriting, with references`, async () => { const destination = getDestinationSpace(spaceId); @@ -462,6 +458,11 @@ export function resolveCopyToSpaceConflictsSuite( createNewCopies: false, retries: { [destination]: [ + { + ...indexPatternObject, + destinationId: `cts_ip_1_${destination}`, + overwrite: false, + }, { ...visualizationObject, destinationId: `cts_vis_3_${destination}`, @@ -486,6 +487,11 @@ export function resolveCopyToSpaceConflictsSuite( createNewCopies: false, retries: { [destination]: [ + { + ...indexPatternObject, + destinationId: `cts_ip_1_${destination}`, + overwrite: true, + }, { ...visualizationObject, destinationId: `cts_vis_3_${destination}`, @@ -589,7 +595,6 @@ export function resolveCopyToSpaceConflictsSuite( createExpectNonOverriddenResponseWithReferences, createExpectNonOverriddenResponseWithoutReferences, createExpectUnauthorizedAtSpaceWithReferencesResult, - createExpectReadonlyAtSpaceWithReferencesResult, createExpectUnauthorizedAtSpaceWithoutReferencesResult, createMultiNamespaceTestCases, originSpaces: ['default', 'space_1'], diff --git a/x-pack/test/spaces_api_integration/security_and_spaces/apis/resolve_copy_to_space_conflicts.ts b/x-pack/test/spaces_api_integration/security_and_spaces/apis/resolve_copy_to_space_conflicts.ts index efc7827cf8b9a..1b39cd5d77302 100644 --- a/x-pack/test/spaces_api_integration/security_and_spaces/apis/resolve_copy_to_space_conflicts.ts +++ b/x-pack/test/spaces_api_integration/security_and_spaces/apis/resolve_copy_to_space_conflicts.ts @@ -24,7 +24,6 @@ export default function resolveCopyToSpaceConflictsTestSuite({ getService }: Ftr createExpectOverriddenResponseWithoutReferences, expectRouteForbiddenResponse, createExpectUnauthorizedAtSpaceWithReferencesResult, - createExpectReadonlyAtSpaceWithReferencesResult, createExpectUnauthorizedAtSpaceWithoutReferencesResult, createMultiNamespaceTestCases, NON_EXISTENT_SPACE_ID, @@ -122,11 +121,11 @@ export default function resolveCopyToSpaceConflictsTestSuite({ getService }: Ftr tests: { withReferencesNotOverwriting: { statusCode: 200, - response: createExpectReadonlyAtSpaceWithReferencesResult(spaceId), + response: createExpectUnauthorizedAtSpaceWithReferencesResult(spaceId), }, withReferencesOverwriting: { statusCode: 200, - response: createExpectReadonlyAtSpaceWithReferencesResult(spaceId), + response: createExpectUnauthorizedAtSpaceWithReferencesResult(spaceId), }, withoutReferencesOverwriting: { statusCode: 200, From 33fd1bdff0556e899e37e6885b3c11f7c4bc33ac Mon Sep 17 00:00:00 2001 From: Thomas Neirynck Date: Mon, 25 Oct 2021 12:41:04 -0400 Subject: [PATCH 09/23] [Maps] Use ES mvt (#114553) * tmp * tmp * tmp * tmp * tmp * use es naming * typo * organize files for clarity * plugin for hits * tmp * initial styling * more boilerplate * tmp * temp * add size support * remove junk * tooltip * edits * too many features * rename for clarity * typing * tooltip improvements * icon * callouts * align count handling * typechecks * i18n * tmp * type fixes * linting * convert to ts and disable option * readd test dependencies * typescheck * update yarn lock * fix typecheck * update snapshot * fix snapshot * fix snapshot * fix snapshot * fix snapshot * fix test * fix tests * fix test * add key * fix integration test * move test * use centroid placement * more text fixes * more test fixes * Remove top terms aggregations when switching to super fine resolution (#114667) * [Maps] MVT metrics * remove js file * updateSourceProps * i18n cleanup * mvt labels * remove isPointsOnly from IVectorSource interface * move get_centroid_featues to vector_layer since its no longer used in server * labels * warn users when selecting scaling type that does not support term joins * clean up scaling_form * remove IField.isCountable method * move pluck code from common to dynamic_style_property * move convert_to_geojson to es_geo_grid_source folder * remove getMbFeatureIdPropertyName from IVectorLayer * clean up cleanTooltipStateForLayer * use euiWarningColor for too many features outline * update jest snapshots and eslint fixes * update docs for incomplete data changes * move tooManyFeatures MB layer definition from VectorLayer to TiledVectorLayer, clean up VectorSource interface * remove commented out filter in tooltip_control add api docs for getMbLayerIds and getMbTooltipLayerIds * revert changing getSourceTooltipContent to getSourceTooltipConfigFromGeoJson * replace DEFAULT_MAX_RESULT_WINDOW with loading maxResultWindow as data request * clean up * eslint * remove unused constants from Kibana MVT implemenation and tooManyFeaturesImage * add better should method for tiled_vector_layer.getCustomIconAndTooltipContent jest test * fix tooltips not being displayed for super-fine clusters and grids * fix check in getFeatureId for es_Search_sources only * eslint, remove __kbn_metadata_feature__ filter from mapbox style expects * remove geoFieldType paramter for tile API * remove searchSessionId from MVT url since its no longer used * tslint * vector tile scaling option copy update * fix getTile and getGridTile API integration tests * remove size from _mvt request body, size provided in query * eslint, fix test expect * stablize jest test * track total hits for _mvt request * track total hits take 2 * align vector tile copy * eslint * revert change to EsSearchSource._loadTooltipProperties with regards to handling undefined _index. MVT now provides _index * clean up * only send metric aggregations to mvt/getGridTile endpoint * update snapshot, update getGridTile URLs in tests * update request URL for getGridTile * eslint Co-authored-by: Nathan Reese Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> --- docs/maps/vector-layer.asciidoc | 4 +- package.json | 2 +- x-pack/plugins/maps/common/constants.ts | 10 +- .../layer_descriptor_types.ts | 17 +- .../maps/common/elasticsearch_util/index.ts | 1 - .../maps/common/get_geometry_counts.ts | 45 -- .../maps/common/pluck_category_field_meta.ts | 46 -- .../maps/common/pluck_range_field_meta.ts | 34 -- .../public/actions/data_request_actions.ts | 21 +- .../maps/public/actions/layer_actions.ts | 32 +- .../maps/public/actions/map_actions.ts | 4 +- .../maps/public/actions/tooltip_actions.ts | 15 +- .../public/classes/fields/agg/agg_field.ts | 4 + .../classes/fields/agg/count_agg_field.ts | 4 + .../fields/agg/top_term_percentage_field.ts | 4 + .../maps/public/classes/fields/field.ts | 5 + .../maps/public/classes/layers/layer.tsx | 16 +- .../tiled_vector_layer.test.tsx.snap | 14 +- .../tiled_vector_layer.test.tsx | 4 +- .../tiled_vector_layer/tiled_vector_layer.tsx | 202 +++++-- .../vector_layer/assign_feature_ids.test.ts | 17 +- .../layers/vector_layer/assign_feature_ids.ts | 18 +- .../get_centroid_features.test.ts | 29 - .../vector_layer}/get_centroid_features.ts | 7 +- .../classes/layers/vector_layer/index.ts | 1 + .../classes/layers/vector_layer/utils.tsx | 2 +- .../layers/vector_layer/vector_layer.tsx | 101 ++-- .../sources/es_agg_source/es_agg_source.ts | 8 +- .../resolution_editor.test.tsx.snap | 136 ++--- .../update_source_editor.test.tsx.snap | 9 +- .../convert_to_geojson.d.ts | 2 +- .../es_geo_grid_source}/convert_to_geojson.js | 11 +- .../convert_to_geojson.test.ts | 2 +- .../es_geo_grid_source.test.ts | 21 +- .../es_geo_grid_source/es_geo_grid_source.tsx | 38 +- .../es_geo_grid_source/resolution_editor.js | 61 -- .../resolution_editor.test.tsx | 2 +- .../es_geo_grid_source/resolution_editor.tsx | 161 ++++++ .../update_source_editor.test.tsx | 9 +- ...rce_editor.js => update_source_editor.tsx} | 78 ++- .../es_search_source/create_source_editor.js | 2 + .../es_search_source/es_search_source.test.ts | 20 +- .../es_search_source/es_search_source.tsx | 31 +- .../es_search_source/update_source_editor.js | 4 + .../__snapshots__/scaling_form.test.tsx.snap | 24 +- .../util/scaling_form.test.tsx | 2 + .../es_search_source/util/scaling_form.tsx | 134 +++-- .../classes/sources/es_source/es_source.ts | 2 +- .../mvt_field_config_editor.test.tsx.snap | 5 - .../mvt_field_config_editor.tsx | 6 +- .../mvt_single_layer_vector_source.tsx | 4 + .../maps/public/classes/sources/source.ts | 11 +- .../sources/vector_source/vector_source.tsx | 7 +- .../vector_style_editor.test.tsx.snap | 540 ------------------ .../components/vector_style_editor.test.tsx | 46 +- .../vector/components/vector_style_editor.tsx | 20 +- .../properties/dynamic_color_property.tsx | 6 +- .../properties/dynamic_icon_property.tsx | 4 +- .../properties/dynamic_size_property.tsx | 4 +- .../properties/dynamic_style_property.tsx | 121 ++-- .../classes/styles/vector/vector_style.tsx | 61 +- .../classes/util/geo_tile_utils.test.ts} | 0 .../classes/util}/geo_tile_utils.ts | 6 +- .../classes/util/mb_filter_expressions.ts | 21 +- .../edit_layer_panel.test.tsx.snap | 4 + .../edit_layer_panel.test.tsx | 10 +- .../edit_layer_panel/edit_layer_panel.tsx | 23 +- .../edit_layer_panel/index.ts | 12 +- .../join_editor/join_editor.tsx | 2 - .../draw_feature_control.tsx | 7 +- .../connected_components/mb_map/mb_map.tsx | 9 - .../tooltip_control/tooltip_control.test.tsx | 13 + .../tooltip_control/tooltip_control.tsx | 31 +- .../maps/server/kibana_server_services.ts | 3 + .../plugins/maps/server/mvt/get_grid_tile.ts | 64 +++ x-pack/plugins/maps/server/mvt/get_tile.ts | 437 +------------- x-pack/plugins/maps/server/mvt/mvt_routes.ts | 37 +- x-pack/plugins/maps/server/mvt/util.ts | 75 --- .../apis/maps/get_grid_tile.js | 109 ++-- .../api_integration/apis/maps/get_tile.js | 78 +-- .../functional/apps/maps/mapbox_styles.js | 28 - .../test/functional/apps/maps/mvt_scaling.js | 31 +- .../functional/apps/maps/mvt_super_fine.js | 6 +- 83 files changed, 1201 insertions(+), 2056 deletions(-) delete mode 100644 x-pack/plugins/maps/common/get_geometry_counts.ts delete mode 100644 x-pack/plugins/maps/common/pluck_category_field_meta.ts delete mode 100644 x-pack/plugins/maps/common/pluck_range_field_meta.ts rename x-pack/plugins/maps/{common => public/classes/layers/vector_layer}/get_centroid_features.test.ts (93%) rename x-pack/plugins/maps/{common => public/classes/layers/vector_layer}/get_centroid_features.ts (94%) rename x-pack/plugins/maps/{common/elasticsearch_util => public/classes/sources/es_geo_grid_source}/convert_to_geojson.d.ts (89%) rename x-pack/plugins/maps/{common/elasticsearch_util => public/classes/sources/es_geo_grid_source}/convert_to_geojson.js (89%) rename x-pack/plugins/maps/{common/elasticsearch_util => public/classes/sources/es_geo_grid_source}/convert_to_geojson.test.ts (98%) delete mode 100644 x-pack/plugins/maps/public/classes/sources/es_geo_grid_source/resolution_editor.js create mode 100644 x-pack/plugins/maps/public/classes/sources/es_geo_grid_source/resolution_editor.tsx rename x-pack/plugins/maps/public/classes/sources/es_geo_grid_source/{update_source_editor.js => update_source_editor.tsx} (61%) rename x-pack/plugins/maps/{common/geo_tile_utils.test.js => public/classes/util/geo_tile_utils.test.ts} (100%) rename x-pack/plugins/maps/{common => public/classes/util}/geo_tile_utils.ts (95%) create mode 100644 x-pack/plugins/maps/server/mvt/get_grid_tile.ts delete mode 100644 x-pack/plugins/maps/server/mvt/util.ts diff --git a/docs/maps/vector-layer.asciidoc b/docs/maps/vector-layer.asciidoc index 7191197c27dbe..f70e4d59796cc 100644 --- a/docs/maps/vector-layer.asciidoc +++ b/docs/maps/vector-layer.asciidoc @@ -27,9 +27,9 @@ Results exceeding `index.max_result_window` are not displayed. * *Show clusters when results exceed 10,000* When results exceed `index.max_result_window`, the layer uses {ref}/search-aggregations-bucket-geotilegrid-aggregation.html[GeoTile grid aggregation] to group your documents into clusters and displays metrics for each cluster. When results are less then `index.max_result_window`, the layer displays features from individual documents. -* *Use vector tiles.* Vector tiles partition your map into 6 to 8 tiles. +* *Use vector tiles.* Vector tiles partition your map into tiles. Each tile request is limited to the `index.max_result_window` index setting. -Tiles exceeding `index.max_result_window` have a visual indicator when there are too many features to display. +When a tile exceeds `index.max_result_window`, results exceeding `index.max_result_window` are not contained in the tile and a dashed rectangle outlining the bounding box containing all geo values within the tile is displayed. *EMS Boundaries*:: Administrative boundaries from https://www.elastic.co/elastic-maps-service[Elastic Maps Service]. diff --git a/package.json b/package.json index e6b17783197bc..177b70efd4cc7 100644 --- a/package.json +++ b/package.json @@ -166,7 +166,6 @@ "@mapbox/geojson-rewind": "^0.5.0", "@mapbox/mapbox-gl-draw": "1.3.0", "@mapbox/mapbox-gl-rtl-text": "0.2.3", - "@mapbox/vector-tile": "1.3.1", "@reduxjs/toolkit": "^1.6.1", "@slack/webhook": "^5.0.4", "@turf/along": "6.0.1", @@ -460,6 +459,7 @@ "@kbn/test": "link:bazel-bin/packages/kbn-test", "@kbn/test-subj-selector": "link:bazel-bin/packages/kbn-test-subj-selector", "@loaders.gl/polyfills": "^2.3.5", + "@mapbox/vector-tile": "1.3.1", "@microsoft/api-documenter": "7.7.2", "@microsoft/api-extractor": "7.7.0", "@octokit/rest": "^16.35.0", diff --git a/x-pack/plugins/maps/common/constants.ts b/x-pack/plugins/maps/common/constants.ts index b6b3e636fffeb..42c5b70514000 100644 --- a/x-pack/plugins/maps/common/constants.ts +++ b/x-pack/plugins/maps/common/constants.ts @@ -47,14 +47,7 @@ export const CHECK_IS_DRAWING_INDEX = `/${GIS_API_PATH}/checkIsDrawingIndex`; export const MVT_GETTILE_API_PATH = 'mvt/getTile'; export const MVT_GETGRIDTILE_API_PATH = 'mvt/getGridTile'; -export const MVT_SOURCE_LAYER_NAME = 'source_layer'; -// Identifies vector tile "too many features" feature. -// "too many features" feature is a box showing area that contains too many features for single ES search response -export const KBN_METADATA_FEATURE = '__kbn_metadata_feature__'; -export const KBN_FEATURE_COUNT = '__kbn_feature_count__'; -export const KBN_IS_TILE_COMPLETE = '__kbn_is_tile_complete__'; -export const KBN_VECTOR_SHAPE_TYPE_COUNTS = '__kbn_vector_shape_type_counts__'; -export const KBN_TOO_MANY_FEATURES_IMAGE_ID = '__kbn_too_many_features_image_id__'; + // Identifies centroid feature. // Centroids are a single point for representing lines, multiLines, polygons, and multiPolygons export const KBN_IS_CENTROID_FEATURE = '__kbn_is_centroid_feature__'; @@ -119,7 +112,6 @@ export const DEFAULT_MAX_RESULT_WINDOW = 10000; export const DEFAULT_MAX_INNER_RESULT_WINDOW = 100; export const DEFAULT_MAX_BUCKETS_LIMIT = 65535; -export const FEATURE_ID_PROPERTY_NAME = '__kbn__feature_id__'; export const FEATURE_VISIBLE_PROPERTY_NAME = '__kbn_isvisibleduetojoin__'; export const MB_SOURCE_ID_LAYER_ID_PREFIX_DELIMITER = '_'; diff --git a/x-pack/plugins/maps/common/descriptor_types/layer_descriptor_types.ts b/x-pack/plugins/maps/common/descriptor_types/layer_descriptor_types.ts index 244ebc59efd17..8f681cc9de70d 100644 --- a/x-pack/plugins/maps/common/descriptor_types/layer_descriptor_types.ts +++ b/x-pack/plugins/maps/common/descriptor_types/layer_descriptor_types.ts @@ -10,21 +10,13 @@ import { Query } from 'src/plugins/data/public'; import { Feature } from 'geojson'; import { - FieldMeta, HeatmapStyleDescriptor, StyleDescriptor, VectorStyleDescriptor, } from './style_property_descriptor_types'; import { DataRequestDescriptor } from './data_request_descriptor_types'; import { AbstractSourceDescriptor, TermJoinSourceDescriptor } from './source_descriptor_types'; -import { VectorShapeTypeCounts } from '../get_geometry_counts'; -import { - KBN_FEATURE_COUNT, - KBN_IS_TILE_COMPLETE, - KBN_METADATA_FEATURE, - KBN_VECTOR_SHAPE_TYPE_COUNTS, - LAYER_TYPE, -} from '../constants'; +import { LAYER_TYPE } from '../constants'; export type Attribution = { label: string; @@ -38,11 +30,8 @@ export type JoinDescriptor = { export type TileMetaFeature = Feature & { properties: { - [KBN_METADATA_FEATURE]: true; - [KBN_IS_TILE_COMPLETE]: boolean; - [KBN_FEATURE_COUNT]: number; - [KBN_VECTOR_SHAPE_TYPE_COUNTS]: VectorShapeTypeCounts; - fieldMeta?: FieldMeta; + 'hits.total.relation': string; + 'hits.total.value': number; }; }; diff --git a/x-pack/plugins/maps/common/elasticsearch_util/index.ts b/x-pack/plugins/maps/common/elasticsearch_util/index.ts index 7073a4201f7a5..6febb237cdda7 100644 --- a/x-pack/plugins/maps/common/elasticsearch_util/index.ts +++ b/x-pack/plugins/maps/common/elasticsearch_util/index.ts @@ -6,7 +6,6 @@ */ export * from './es_agg_utils'; -export * from './convert_to_geojson'; export * from './elasticsearch_geo_utils'; export * from './spatial_filter_utils'; export * from './types'; diff --git a/x-pack/plugins/maps/common/get_geometry_counts.ts b/x-pack/plugins/maps/common/get_geometry_counts.ts deleted file mode 100644 index 2a3368560c762..0000000000000 --- a/x-pack/plugins/maps/common/get_geometry_counts.ts +++ /dev/null @@ -1,45 +0,0 @@ -/* - * 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; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import { Feature } from 'geojson'; -import { GEO_JSON_TYPE, VECTOR_SHAPE_TYPE } from './constants'; - -export interface VectorShapeTypeCounts { - [VECTOR_SHAPE_TYPE.POINT]: number; - [VECTOR_SHAPE_TYPE.LINE]: number; - [VECTOR_SHAPE_TYPE.POLYGON]: number; -} - -export function countVectorShapeTypes(features: Feature[]): VectorShapeTypeCounts { - const vectorShapeTypeCounts: VectorShapeTypeCounts = { - [VECTOR_SHAPE_TYPE.POINT]: 0, - [VECTOR_SHAPE_TYPE.LINE]: 0, - [VECTOR_SHAPE_TYPE.POLYGON]: 0, - }; - - for (let i = 0; i < features.length; i++) { - const feature: Feature = features[i]; - if ( - feature.geometry.type === GEO_JSON_TYPE.POINT || - feature.geometry.type === GEO_JSON_TYPE.MULTI_POINT - ) { - vectorShapeTypeCounts[VECTOR_SHAPE_TYPE.POINT] += 1; - } else if ( - feature.geometry.type === GEO_JSON_TYPE.LINE_STRING || - feature.geometry.type === GEO_JSON_TYPE.MULTI_LINE_STRING - ) { - vectorShapeTypeCounts[VECTOR_SHAPE_TYPE.LINE] += 1; - } else if ( - feature.geometry.type === GEO_JSON_TYPE.POLYGON || - feature.geometry.type === GEO_JSON_TYPE.MULTI_POLYGON - ) { - vectorShapeTypeCounts[VECTOR_SHAPE_TYPE.POLYGON] += 1; - } - } - - return vectorShapeTypeCounts; -} diff --git a/x-pack/plugins/maps/common/pluck_category_field_meta.ts b/x-pack/plugins/maps/common/pluck_category_field_meta.ts deleted file mode 100644 index c71316f864a84..0000000000000 --- a/x-pack/plugins/maps/common/pluck_category_field_meta.ts +++ /dev/null @@ -1,46 +0,0 @@ -/* - * 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; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import { Feature } from 'geojson'; -import { CategoryFieldMeta } from './descriptor_types'; - -export function pluckCategoryFieldMeta( - features: Feature[], - name: string, - size: number -): CategoryFieldMeta | null { - const counts = new Map(); - for (let i = 0; i < features.length; i++) { - const feature = features[i]; - const term = feature.properties ? feature.properties[name] : undefined; - // properties object may be sparse, so need to check if the field is effectively present - if (typeof term !== undefined) { - if (counts.has(term)) { - counts.set(term, counts.get(term) + 1); - } else { - counts.set(term, 1); - } - } - } - - return trimCategories(counts, size); -} - -export function trimCategories(counts: Map, size: number): CategoryFieldMeta { - const ordered = []; - for (const [key, value] of counts) { - ordered.push({ key, count: value }); - } - - ordered.sort((a, b) => { - return b.count - a.count; - }); - const truncated = ordered.slice(0, size); - return { - categories: truncated, - } as CategoryFieldMeta; -} diff --git a/x-pack/plugins/maps/common/pluck_range_field_meta.ts b/x-pack/plugins/maps/common/pluck_range_field_meta.ts deleted file mode 100644 index b0bf03896892f..0000000000000 --- a/x-pack/plugins/maps/common/pluck_range_field_meta.ts +++ /dev/null @@ -1,34 +0,0 @@ -/* - * 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; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import { Feature } from 'geojson'; -import { RangeFieldMeta } from './descriptor_types'; - -export function pluckRangeFieldMeta( - features: Feature[], - name: string, - parseValue: (rawValue: unknown) => number -): RangeFieldMeta | null { - let min = Infinity; - let max = -Infinity; - for (let i = 0; i < features.length; i++) { - const feature = features[i]; - const newValue = feature.properties ? parseValue(feature.properties[name]) : NaN; - if (!isNaN(newValue)) { - min = Math.min(min, newValue); - max = Math.max(max, newValue); - } - } - - return min === Infinity || max === -Infinity - ? null - : ({ - min, - max, - delta: max - min, - } as RangeFieldMeta); -} diff --git a/x-pack/plugins/maps/public/actions/data_request_actions.ts b/x-pack/plugins/maps/public/actions/data_request_actions.ts index b912e8c52e680..c1a6d05cc0577 100644 --- a/x-pack/plugins/maps/public/actions/data_request_actions.ts +++ b/x-pack/plugins/maps/public/actions/data_request_actions.ts @@ -282,10 +282,10 @@ function endDataLoad( if (dataId === SOURCE_DATA_REQUEST_ID) { const features = data && 'features' in data ? (data as FeatureCollection).features : []; + const layer = getLayerById(layerId, getState()); const eventHandlers = getEventHandlers(getState()); if (eventHandlers && eventHandlers.onDataLoadEnd) { - const layer = getLayerById(layerId, getState()); const resultMeta: ResultMeta = {}; if (layer && layer.getType() === LAYER_TYPE.VECTOR) { const featuresWithoutCentroids = features.filter((feature) => { @@ -301,7 +301,9 @@ function endDataLoad( }); } - dispatch(updateTooltipStateForLayer(layerId, features)); + if (layer) { + dispatch(updateTooltipStateForLayer(layer, features)); + } } dispatch({ @@ -344,7 +346,10 @@ function onDataLoadError( }); } - dispatch(updateTooltipStateForLayer(layerId)); + const layer = getLayerById(layerId, getState()); + if (layer) { + dispatch(updateTooltipStateForLayer(layer)); + } } dispatch({ @@ -359,7 +364,10 @@ function onDataLoadError( } export function updateSourceDataRequest(layerId: string, newData: object) { - return (dispatch: ThunkDispatch) => { + return ( + dispatch: ThunkDispatch, + getState: () => MapStoreState + ) => { dispatch({ type: UPDATE_SOURCE_DATA_REQUEST, dataId: SOURCE_DATA_REQUEST_ID, @@ -368,7 +376,10 @@ export function updateSourceDataRequest(layerId: string, newData: object) { }); if ('features' in newData) { - dispatch(updateTooltipStateForLayer(layerId, (newData as FeatureCollection).features)); + const layer = getLayerById(layerId, getState()); + if (layer) { + dispatch(updateTooltipStateForLayer(layer, (newData as FeatureCollection).features)); + } } dispatch(updateStyleMeta(layerId)); diff --git a/x-pack/plugins/maps/public/actions/layer_actions.ts b/x-pack/plugins/maps/public/actions/layer_actions.ts index 9e937d86515e2..c9254df40bcf1 100644 --- a/x-pack/plugins/maps/public/actions/layer_actions.ts +++ b/x-pack/plugins/maps/public/actions/layer_actions.ts @@ -51,6 +51,7 @@ import { } from '../../common/descriptor_types'; import { ILayer } from '../classes/layers/layer'; import { IVectorLayer } from '../classes/layers/vector_layer'; +import { OnSourceChangeArgs } from '../classes/sources/source'; import { DRAW_MODE, LAYER_STYLE_TYPE, LAYER_TYPE } from '../../common/constants'; import { IVectorStyle } from '../classes/styles/vector/vector_style'; import { notifyLicensedFeatureUsage } from '../licensed_features'; @@ -217,7 +218,7 @@ export function setLayerVisibility(layerId: string, makeVisible: boolean) { } if (!makeVisible) { - dispatch(updateTooltipStateForLayer(layerId)); + dispatch(updateTooltipStateForLayer(layer)); } dispatch({ @@ -323,18 +324,17 @@ function updateMetricsProp(layerId: string, value: unknown) { ) => { const layer = getLayerById(layerId, getState()); const previousFields = await (layer as IVectorLayer).getFields(); - await dispatch({ + dispatch({ type: UPDATE_SOURCE_PROP, layerId, propName: 'metrics', value, }); await dispatch(updateStyleProperties(layerId, previousFields as IESAggField[])); - dispatch(syncDataForLayerId(layerId, false)); }; } -export function updateSourceProp( +function updateSourcePropWithoutSync( layerId: string, propName: string, value: unknown, @@ -356,6 +356,28 @@ export function updateSourceProp( if (newLayerType) { dispatch(updateLayerType(layerId, newLayerType)); } + }; +} + +export function updateSourceProp( + layerId: string, + propName: string, + value: unknown, + newLayerType?: LAYER_TYPE +) { + return async (dispatch: ThunkDispatch) => { + await dispatch(updateSourcePropWithoutSync(layerId, propName, value, newLayerType)); + dispatch(syncDataForLayerId(layerId, false)); + }; +} + +export function updateSourceProps(layerId: string, sourcePropChanges: OnSourceChangeArgs[]) { + return async (dispatch: ThunkDispatch) => { + // Using for loop to ensure update completes before starting next update + for (let i = 0; i < sourcePropChanges.length; i++) { + const { propName, value, newLayerType } = sourcePropChanges[i]; + await dispatch(updateSourcePropWithoutSync(layerId, propName, value, newLayerType)); + } dispatch(syncDataForLayerId(layerId, false)); }; } @@ -504,7 +526,7 @@ function removeLayerFromLayerList(layerId: string) { layerGettingRemoved.getInFlightRequestTokens().forEach((requestToken) => { dispatch(cancelRequest(requestToken)); }); - dispatch(updateTooltipStateForLayer(layerId)); + dispatch(updateTooltipStateForLayer(layerGettingRemoved)); layerGettingRemoved.destroy(); dispatch({ type: REMOVE_LAYER, diff --git a/x-pack/plugins/maps/public/actions/map_actions.ts b/x-pack/plugins/maps/public/actions/map_actions.ts index cf1e22ab90f88..d921f9748f65c 100644 --- a/x-pack/plugins/maps/public/actions/map_actions.ts +++ b/x-pack/plugins/maps/public/actions/map_actions.ts @@ -63,7 +63,7 @@ import { INITIAL_LOCATION } from '../../common/constants'; import { updateTooltipStateForLayer } from './tooltip_actions'; import { VectorLayer } from '../classes/layers/vector_layer'; import { SET_DRAW_MODE } from './ui_actions'; -import { expandToTileBoundaries } from '../../common/geo_tile_utils'; +import { expandToTileBoundaries } from '../classes/util/geo_tile_utils'; import { getToasts } from '../kibana_services'; export function setMapInitError(errorMessage: string) { @@ -171,7 +171,7 @@ export function mapExtentChanged(mapExtentState: MapExtentState) { if (prevZoom !== nextZoom) { getLayerList(getState()).map((layer) => { if (!layer.showAtZoomLevel(nextZoom)) { - dispatch(updateTooltipStateForLayer(layer.getId())); + dispatch(updateTooltipStateForLayer(layer)); } }); } diff --git a/x-pack/plugins/maps/public/actions/tooltip_actions.ts b/x-pack/plugins/maps/public/actions/tooltip_actions.ts index 67b6842caeb46..30213510c8be4 100644 --- a/x-pack/plugins/maps/public/actions/tooltip_actions.ts +++ b/x-pack/plugins/maps/public/actions/tooltip_actions.ts @@ -10,9 +10,11 @@ import { Dispatch } from 'redux'; import { Feature } from 'geojson'; import { getOpenTooltips } from '../selectors/map_selectors'; import { SET_OPEN_TOOLTIPS } from './map_action_constants'; -import { FEATURE_ID_PROPERTY_NAME, FEATURE_VISIBLE_PROPERTY_NAME } from '../../common/constants'; +import { FEATURE_VISIBLE_PROPERTY_NAME } from '../../common/constants'; import { TooltipFeature, TooltipState } from '../../common/descriptor_types'; import { MapStoreState } from '../reducers/store'; +import { ILayer } from '../classes/layers/layer'; +import { IVectorLayer, getFeatureId, isVectorLayer } from '../classes/layers/vector_layer'; export function closeOnClickTooltip(tooltipId: string) { return (dispatch: Dispatch, getState: () => MapStoreState) => { @@ -62,13 +64,17 @@ export function openOnHoverTooltip(tooltipState: TooltipState) { }; } -export function updateTooltipStateForLayer(layerId: string, layerFeatures: Feature[] = []) { +export function updateTooltipStateForLayer(layer: ILayer, layerFeatures: Feature[] = []) { return (dispatch: Dispatch, getState: () => MapStoreState) => { + if (!isVectorLayer(layer)) { + return; + } + const openTooltips = getOpenTooltips(getState()) .map((tooltipState) => { const nextFeatures: TooltipFeature[] = []; tooltipState.features.forEach((tooltipFeature) => { - if (tooltipFeature.layerId !== layerId) { + if (tooltipFeature.layerId !== layer.getId()) { // feature from another layer, keep it nextFeatures.push(tooltipFeature); } @@ -79,7 +85,8 @@ export function updateTooltipStateForLayer(layerId: string, layerFeatures: Featu ? layerFeature.properties![FEATURE_VISIBLE_PROPERTY_NAME] : true; return ( - isVisible && layerFeature.properties![FEATURE_ID_PROPERTY_NAME] === tooltipFeature.id + isVisible && + getFeatureId(layerFeature, (layer as IVectorLayer).getSource()) === tooltipFeature.id ); }); diff --git a/x-pack/plugins/maps/public/classes/fields/agg/agg_field.ts b/x-pack/plugins/maps/public/classes/fields/agg/agg_field.ts index 70d5cea6e4620..acfe6a9055eb6 100644 --- a/x-pack/plugins/maps/public/classes/fields/agg/agg_field.ts +++ b/x-pack/plugins/maps/public/classes/fields/agg/agg_field.ts @@ -34,6 +34,10 @@ export class AggField extends CountAggField { return !!this._esDocField; } + getMbFieldName(): string { + return this._source.isMvt() ? this.getName() + '.value' : this.getName(); + } + supportsFieldMeta(): boolean { // count and sum aggregations are not within field bounds so they do not support field meta. return !isMetricCountable(this._getAggType()); diff --git a/x-pack/plugins/maps/public/classes/fields/agg/count_agg_field.ts b/x-pack/plugins/maps/public/classes/fields/agg/count_agg_field.ts index 3bd26666005a6..b303dbc342bb2 100644 --- a/x-pack/plugins/maps/public/classes/fields/agg/count_agg_field.ts +++ b/x-pack/plugins/maps/public/classes/fields/agg/count_agg_field.ts @@ -43,6 +43,10 @@ export class CountAggField implements IESAggField { return this._source.getAggKey(this._getAggType(), this.getRootName()); } + getMbFieldName(): string { + return this._source.isMvt() ? '_count' : this.getName(); + } + getRootName(): string { return ''; } diff --git a/x-pack/plugins/maps/public/classes/fields/agg/top_term_percentage_field.ts b/x-pack/plugins/maps/public/classes/fields/agg/top_term_percentage_field.ts index f6cdcf43fe343..227084bfe0cad 100644 --- a/x-pack/plugins/maps/public/classes/fields/agg/top_term_percentage_field.ts +++ b/x-pack/plugins/maps/public/classes/fields/agg/top_term_percentage_field.ts @@ -23,6 +23,10 @@ export class TopTermPercentageField implements IESAggField { return this._topTermAggField.getSource(); } + getMbFieldName(): string { + return this.getName(); + } + getOrigin(): FIELD_ORIGIN { return this._topTermAggField.getOrigin(); } diff --git a/x-pack/plugins/maps/public/classes/fields/field.ts b/x-pack/plugins/maps/public/classes/fields/field.ts index 586f9f74da8ac..014d75caf90b6 100644 --- a/x-pack/plugins/maps/public/classes/fields/field.ts +++ b/x-pack/plugins/maps/public/classes/fields/field.ts @@ -11,6 +11,7 @@ import { ITooltipProperty, TooltipProperty } from '../tooltips/tooltip_property' export interface IField { getName(): string; + getMbFieldName(): string; getRootName(): string; canValueBeFormatted(): boolean; getLabel(): Promise; @@ -50,6 +51,10 @@ export class AbstractField implements IField { return this._fieldName; } + getMbFieldName(): string { + return this.getName(); + } + getRootName(): string { return this.getName(); } diff --git a/x-pack/plugins/maps/public/classes/layers/layer.tsx b/x-pack/plugins/maps/public/classes/layers/layer.tsx index e1043a33f28ad..051115a072608 100644 --- a/x-pack/plugins/maps/public/classes/layers/layer.tsx +++ b/x-pack/plugins/maps/public/classes/layers/layer.tsx @@ -63,13 +63,18 @@ export interface ILayer { getStyleForEditing(): IStyle; getCurrentStyle(): IStyle; getImmutableSourceProperties(): Promise; - renderSourceSettingsEditor({ onChange }: SourceEditorArgs): ReactElement | null; + renderSourceSettingsEditor(sourceEditorArgs: SourceEditorArgs): ReactElement | null; isLayerLoading(): boolean; isLoadingBounds(): boolean; isFilteredByGlobalTime(): Promise; hasErrors(): boolean; getErrors(): string; + + /* + * ILayer.getMbLayerIds returns a list of all mapbox layers assoicated with this layer. + */ getMbLayerIds(): string[]; + ownsMbLayerId(mbLayerId: string): boolean; ownsMbSourceId(mbSourceId: string): boolean; syncLayerWithMB(mbMap: MbMap, timeslice?: Timeslice): void; @@ -77,7 +82,7 @@ export interface ILayer { isInitialDataLoadComplete(): boolean; getIndexPatternIds(): string[]; getQueryableIndexPatternIds(): string[]; - getType(): LAYER_TYPE | undefined; + getType(): LAYER_TYPE; isVisible(): boolean; cloneDescriptor(): Promise; renderStyleEditor( @@ -325,9 +330,8 @@ export class AbstractLayer implements ILayer { return await source.getImmutableProperties(); } - renderSourceSettingsEditor({ onChange }: SourceEditorArgs) { - const source = this.getSourceForEditing(); - return source.renderSourceSettingsEditor({ onChange, currentLayerType: this._descriptor.type }); + renderSourceSettingsEditor(sourceEditorArgs: SourceEditorArgs) { + return this.getSourceForEditing().renderSourceSettingsEditor(sourceEditorArgs); } getPrevRequestToken(dataId: string): symbol | undefined { @@ -437,7 +441,7 @@ export class AbstractLayer implements ILayer { mbMap.setLayoutProperty(mbLayerId, 'visibility', this.isVisible() ? 'visible' : 'none'); } - getType(): LAYER_TYPE | undefined { + getType(): LAYER_TYPE { return this._descriptor.type as LAYER_TYPE; } diff --git a/x-pack/plugins/maps/public/classes/layers/tiled_vector_layer/__snapshots__/tiled_vector_layer.test.tsx.snap b/x-pack/plugins/maps/public/classes/layers/tiled_vector_layer/__snapshots__/tiled_vector_layer.test.tsx.snap index d3b96936a85a1..8b4911342f841 100644 --- a/x-pack/plugins/maps/public/classes/layers/tiled_vector_layer/__snapshots__/tiled_vector_layer.test.tsx.snap +++ b/x-pack/plugins/maps/public/classes/layers/tiled_vector_layer/__snapshots__/tiled_vector_layer.test.tsx.snap @@ -1,9 +1,13 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`icon should use no data icon 1`] = ` - `; diff --git a/x-pack/plugins/maps/public/classes/layers/tiled_vector_layer/tiled_vector_layer.test.tsx b/x-pack/plugins/maps/public/classes/layers/tiled_vector_layer/tiled_vector_layer.test.tsx index e1f134cdf2a85..fd78ea2ebde59 100644 --- a/x-pack/plugins/maps/public/classes/layers/tiled_vector_layer/tiled_vector_layer.test.tsx +++ b/x-pack/plugins/maps/public/classes/layers/tiled_vector_layer/tiled_vector_layer.test.tsx @@ -95,8 +95,8 @@ describe('visiblity', () => { }); }); -describe('icon', () => { - it('should use no data icon', async () => { +describe('getCustomIconAndTooltipContent', () => { + it('Layers with non-elasticsearch sources should display icon', async () => { const layer: TiledVectorLayer = createLayer({}, {}); const iconAndTooltipContent = layer.getCustomIconAndTooltipContent(); diff --git a/x-pack/plugins/maps/public/classes/layers/tiled_vector_layer/tiled_vector_layer.tsx b/x-pack/plugins/maps/public/classes/layers/tiled_vector_layer/tiled_vector_layer.tsx index 9b5298685865a..ece57af7b54ce 100644 --- a/x-pack/plugins/maps/public/classes/layers/tiled_vector_layer/tiled_vector_layer.tsx +++ b/x-pack/plugins/maps/public/classes/layers/tiled_vector_layer/tiled_vector_layer.tsx @@ -7,39 +7,44 @@ import type { Map as MbMap, + AnyLayer as MbLayer, GeoJSONSource as MbGeoJSONSource, VectorSource as MbVectorSource, } from '@kbn/mapbox-gl'; import { Feature } from 'geojson'; +import { i18n } from '@kbn/i18n'; import uuid from 'uuid/v4'; import { parse as parseUrl } from 'url'; -import { i18n } from '@kbn/i18n'; +import { euiThemeVars } from '@kbn/ui-shared-deps-src/theme'; import { IVectorStyle, VectorStyle } from '../../styles/vector/vector_style'; +import { LAYER_TYPE, SOURCE_DATA_REQUEST_ID, SOURCE_TYPES } from '../../../../common/constants'; import { - KBN_FEATURE_COUNT, - KBN_IS_TILE_COMPLETE, - KBN_METADATA_FEATURE, - LAYER_TYPE, - SOURCE_DATA_REQUEST_ID, -} from '../../../../common/constants'; -import { + NO_RESULTS_ICON_AND_TOOLTIPCONTENT, VectorLayer, VectorLayerArguments, - NO_RESULTS_ICON_AND_TOOLTIPCONTENT, } from '../vector_layer'; import { ITiledSingleLayerVectorSource } from '../../sources/tiled_single_layer_vector_source'; import { DataRequestContext } from '../../../actions'; import { - Timeslice, StyleMetaDescriptor, + TileMetaFeature, + Timeslice, VectorLayerDescriptor, VectorSourceRequestMeta, - TileMetaFeature, } from '../../../../common/descriptor_types'; import { MVTSingleLayerVectorSourceConfig } from '../../sources/mvt_single_layer_vector_source/types'; +import { ESSearchSource } from '../../sources/es_search_source'; import { canSkipSourceUpdate } from '../../util/can_skip_fetch'; import { CustomIconAndTooltipContent } from '../layer'; +const ES_MVT_META_LAYER_NAME = 'meta'; +const ES_MVT_HITS_TOTAL_RELATION = 'hits.total.relation'; +const ES_MVT_HITS_TOTAL_VALUE = 'hits.total.value'; +const MAX_RESULT_WINDOW_DATA_REQUEST_ID = 'maxResultWindow'; + +/* + * MVT vector layer + */ export class TiledVectorLayer extends VectorLayer { static type = LAYER_TYPE.TILED_VECTOR; @@ -70,13 +75,46 @@ export class TiledVectorLayer extends VectorLayer { } getCustomIconAndTooltipContent(): CustomIconAndTooltipContent { - const tileMetas = this._getMetaFromTiles(); - if (!tileMetas.length) { + const icon = this.getCurrentStyle().getIcon(); + if (!this.getSource().isESSource()) { + // Only ES-sources can have a special meta-tile, not 3rd party vector tile sources + return { + icon, + tooltipContent: null, + areResultsTrimmed: false, + }; + } + + // + // TODO ES MVT specific - move to es_tiled_vector_layer implementation + // + + const tileMetaFeatures = this._getMetaFromTiles(); + if (!tileMetaFeatures.length) { return NO_RESULTS_ICON_AND_TOOLTIPCONTENT; } - const totalFeaturesCount: number = tileMetas.reduce((acc: number, tileMeta: Feature) => { - const count = tileMeta && tileMeta.properties ? tileMeta.properties[KBN_FEATURE_COUNT] : 0; + if (this.getSource().getType() !== SOURCE_TYPES.ES_SEARCH) { + // aggregation ES sources are never trimmed + return { + icon, + tooltipContent: null, + areResultsTrimmed: false, + }; + } + + const maxResultWindow = this._getMaxResultWindow(); + if (maxResultWindow === undefined) { + return { + icon, + tooltipContent: null, + areResultsTrimmed: false, + }; + } + + const totalFeaturesCount: number = tileMetaFeatures.reduce((acc: number, tileMeta: Feature) => { + const count = + tileMeta && tileMeta.properties ? tileMeta.properties[ES_MVT_HITS_TOTAL_VALUE] : 0; return count + acc; }, 0); @@ -84,12 +122,16 @@ export class TiledVectorLayer extends VectorLayer { return NO_RESULTS_ICON_AND_TOOLTIPCONTENT; } - const isIncomplete: boolean = tileMetas.some((tileMeta: Feature) => { - return !tileMeta?.properties?.[KBN_IS_TILE_COMPLETE]; + const isIncomplete: boolean = tileMetaFeatures.some((tileMeta: TileMetaFeature) => { + if (tileMeta?.properties?.[ES_MVT_HITS_TOTAL_RELATION] === 'gte') { + return tileMeta?.properties?.[ES_MVT_HITS_TOTAL_VALUE] >= maxResultWindow + 1; + } else { + return false; + } }); return { - icon: this.getCurrentStyle().getIcon(), + icon, tooltipContent: isIncomplete ? i18n.translate('xpack.maps.tiles.resultsTrimmedMsg', { defaultMessage: `Results limited to {count} documents.`, @@ -107,6 +149,27 @@ export class TiledVectorLayer extends VectorLayer { }; } + _getMaxResultWindow(): number | undefined { + const dataRequest = this.getDataRequest(MAX_RESULT_WINDOW_DATA_REQUEST_ID); + if (!dataRequest) { + return; + } + const data = dataRequest.getData() as { maxResultWindow: number } | undefined; + return data ? data.maxResultWindow : undefined; + } + + async _syncMaxResultWindow({ startLoading, stopLoading }: DataRequestContext) { + const prevDataRequest = this.getDataRequest(MAX_RESULT_WINDOW_DATA_REQUEST_ID); + if (prevDataRequest) { + return; + } + + const requestToken = Symbol(`${this.getId()}-${MAX_RESULT_WINDOW_DATA_REQUEST_ID}`); + startLoading(MAX_RESULT_WINDOW_DATA_REQUEST_ID, requestToken); + const maxResultWindow = await (this.getSource() as ESSearchSource).getMaxResultWindow(); + stopLoading(MAX_RESULT_WINDOW_DATA_REQUEST_ID, requestToken, { maxResultWindow }); + } + async _syncMVTUrlTemplate({ startLoading, stopLoading, @@ -141,6 +204,7 @@ export class TiledVectorLayer extends VectorLayer { }, }); const canSkip = noChangesInSourceState && noChangesInSearchState; + if (canSkip) { return null; } @@ -180,6 +244,9 @@ export class TiledVectorLayer extends VectorLayer { } async syncData(syncContext: DataRequestContext) { + if (this.getSource().getType() === SOURCE_TYPES.ES_SEARCH) { + await this._syncMaxResultWindow(syncContext); + } await this._syncSourceStyleMeta(syncContext, this._source, this._style as IVectorStyle); await this._syncSourceFormatters(syncContext, this._source, this._style as IVectorStyle); await this._syncMVTUrlTemplate(syncContext); @@ -213,10 +280,18 @@ export class TiledVectorLayer extends VectorLayer { }); } + getMbLayerIds() { + return [...super.getMbLayerIds(), this._getMbTooManyFeaturesLayerId()]; + } + ownsMbSourceId(mbSourceId: string): boolean { return this._getMbSourceId() === mbSourceId; } + _getMbTooManyFeaturesLayerId() { + return this.makeMbLayerId('toomanyfeatures'); + } + _syncStylePropertiesWithMb(mbMap: MbMap) { // @ts-ignore const mbSource = mbMap.getSource(this._getMbSourceId()); @@ -236,10 +311,52 @@ export class TiledVectorLayer extends VectorLayer { this._setMbPointsProperties(mbMap, sourceMeta.layerName); this._setMbLinePolygonProperties(mbMap, sourceMeta.layerName); - this._setMbCentroidProperties(mbMap, sourceMeta.layerName); + this._setMbLabelProperties(mbMap, sourceMeta.layerName); + this._syncTooManyFeaturesProperties(mbMap); + } + + // TODO ES MVT specific - move to es_tiled_vector_layer implementation + _syncTooManyFeaturesProperties(mbMap: MbMap) { + if (this.getSource().getType() !== SOURCE_TYPES.ES_SEARCH) { + return; + } + + const maxResultWindow = this._getMaxResultWindow(); + if (maxResultWindow === undefined) { + return; + } + + const tooManyFeaturesLayerId = this._getMbTooManyFeaturesLayerId(); + + if (!mbMap.getLayer(tooManyFeaturesLayerId)) { + const mbTooManyFeaturesLayer: MbLayer = { + id: tooManyFeaturesLayerId, + type: 'line', + source: this.getId(), + paint: {}, + }; + mbTooManyFeaturesLayer['source-layer'] = ES_MVT_META_LAYER_NAME; + mbMap.addLayer(mbTooManyFeaturesLayer); + mbMap.setFilter(tooManyFeaturesLayerId, [ + 'all', + ['==', ['get', ES_MVT_HITS_TOTAL_RELATION], 'gte'], + ['>=', ['get', ES_MVT_HITS_TOTAL_VALUE], maxResultWindow + 1], + ]); + mbMap.setPaintProperty(tooManyFeaturesLayerId, 'line-color', euiThemeVars.euiColorWarning); + mbMap.setPaintProperty(tooManyFeaturesLayerId, 'line-width', 3); + mbMap.setPaintProperty(tooManyFeaturesLayerId, 'line-dasharray', [2, 1]); + mbMap.setPaintProperty(tooManyFeaturesLayerId, 'line-opacity', this.getAlpha()); + } + + this.syncVisibilityWithMb(mbMap, tooManyFeaturesLayerId); + mbMap.setLayerZoomRange(tooManyFeaturesLayerId, this.getMinZoom(), this.getMaxZoom()); } queryTileMetaFeatures(mbMap: MbMap): TileMetaFeature[] | null { + if (!this.getSource().isESSource()) { + return null; + } + // @ts-ignore const mbSource = mbMap.getSource(this._getMbSourceId()); if (!mbSource) { @@ -259,26 +376,38 @@ export class TiledVectorLayer extends VectorLayer { // querySourceFeatures can return duplicated features when features cross tile boundaries. // Tile meta will never have duplicated features since by there nature, tile meta is a feature contained within a single tile const mbFeatures = mbMap.querySourceFeatures(this._getMbSourceId(), { - sourceLayer: sourceMeta.layerName, - filter: ['==', ['get', KBN_METADATA_FEATURE], true], + sourceLayer: ES_MVT_META_LAYER_NAME, }); - const metaFeatures: TileMetaFeature[] = mbFeatures.map((mbFeature: Feature) => { + const metaFeatures: Array = ( + mbFeatures as unknown as TileMetaFeature[] + ).map((mbFeature: TileMetaFeature | null) => { const parsedProperties: Record = {}; - for (const key in mbFeature.properties) { - if (mbFeature.properties.hasOwnProperty(key)) { - parsedProperties[key] = JSON.parse(mbFeature.properties[key]); // mvt properties cannot be nested geojson + for (const key in mbFeature?.properties) { + if (mbFeature?.properties.hasOwnProperty(key)) { + parsedProperties[key] = + typeof mbFeature.properties[key] === 'string' || + typeof mbFeature.properties[key] === 'number' || + typeof mbFeature.properties[key] === 'boolean' + ? mbFeature.properties[key] + : JSON.parse(mbFeature.properties[key]); // mvt properties cannot be nested geojson } } - return { - type: 'Feature', - id: mbFeature.id, - geometry: mbFeature.geometry, - properties: parsedProperties, - } as TileMetaFeature; + + try { + return { + type: 'Feature', + id: mbFeature?.id, + geometry: mbFeature?.geometry, // this getter might throw with non-conforming geometries + properties: parsedProperties, + } as TileMetaFeature; + } catch (e) { + return null; + } }); - return metaFeatures as TileMetaFeature[]; + const filtered = metaFeatures.filter((f) => f !== null); + return filtered as TileMetaFeature[]; } _requiresPrevSourceCleanup(mbMap: MbMap): boolean { @@ -317,8 +446,13 @@ export class TiledVectorLayer extends VectorLayer { const mbLayer = mbMap.getLayer(layerIds[i]); // The mapbox type in the spec is specified with `source-layer` // but the programmable JS-object uses camelcase `sourceLayer` - // @ts-expect-error - if (mbLayer && mbLayer.sourceLayer !== tiledSourceMeta.layerName) { + if ( + mbLayer && + // @ts-expect-error + mbLayer.sourceLayer !== tiledSourceMeta.layerName && + // @ts-expect-error + mbLayer.sourceLayer !== ES_MVT_META_LAYER_NAME + ) { // If the source-pointer of one of the layers is stale, they will all be stale. // In this case, all the mb-layers need to be removed and re-added. return true; diff --git a/x-pack/plugins/maps/public/classes/layers/vector_layer/assign_feature_ids.test.ts b/x-pack/plugins/maps/public/classes/layers/vector_layer/assign_feature_ids.test.ts index 137d443b39b91..2250e86da0ec2 100644 --- a/x-pack/plugins/maps/public/classes/layers/vector_layer/assign_feature_ids.test.ts +++ b/x-pack/plugins/maps/public/classes/layers/vector_layer/assign_feature_ids.test.ts @@ -5,8 +5,7 @@ * 2.0. */ -import { assignFeatureIds } from './assign_feature_ids'; -import { FEATURE_ID_PROPERTY_NAME } from '../../../../common/constants'; +import { assignFeatureIds, GEOJSON_FEATURE_ID_PROPERTY_NAME } from './assign_feature_ids'; import { FeatureCollection, Feature, Point } from 'geojson'; const featureId = 'myFeature1'; @@ -34,7 +33,7 @@ test('should provide unique id when feature.id is not provided', () => { expect(typeof feature1.id).toBe('number'); expect(typeof feature2.id).toBe('number'); // @ts-ignore - expect(feature1.id).toBe(feature1.properties[FEATURE_ID_PROPERTY_NAME]); + expect(feature1.id).toBe(feature1.properties[GEOJSON_FEATURE_ID_PROPERTY_NAME]); expect(feature1.id).not.toBe(feature2.id); }); @@ -53,9 +52,9 @@ test('should preserve feature id when provided', () => { const feature1 = updatedFeatureCollection.features[0]; expect(typeof feature1.id).toBe('number'); // @ts-ignore - expect(feature1.id).not.toBe(feature1.properties[FEATURE_ID_PROPERTY_NAME]); + expect(feature1.id).not.toBe(feature1.properties[GEOJSON_FEATURE_ID_PROPERTY_NAME]); // @ts-ignore - expect(feature1.properties[FEATURE_ID_PROPERTY_NAME]).toBe(featureId); + expect(feature1.properties[GEOJSON_FEATURE_ID_PROPERTY_NAME]).toBe(featureId); }); test('should preserve feature id for falsy value', () => { @@ -73,9 +72,9 @@ test('should preserve feature id for falsy value', () => { const feature1 = updatedFeatureCollection.features[0]; expect(typeof feature1.id).toBe('number'); // @ts-ignore - expect(feature1.id).not.toBe(feature1.properties[FEATURE_ID_PROPERTY_NAME]); + expect(feature1.id).not.toBe(feature1.properties[GEOJSON_FEATURE_ID_PROPERTY_NAME]); // @ts-ignore - expect(feature1.properties[FEATURE_ID_PROPERTY_NAME]).toBe(0); + expect(feature1.properties[GEOJSON_FEATURE_ID_PROPERTY_NAME]).toBe(0); }); test('should not modify original feature properties', () => { @@ -94,6 +93,6 @@ test('should not modify original feature properties', () => { const updatedFeatureCollection = assignFeatureIds(featureCollection); const feature1 = updatedFeatureCollection.features[0]; // @ts-ignore - expect(feature1.properties[FEATURE_ID_PROPERTY_NAME]).toBe(featureId); - expect(featureProperties).not.toHaveProperty(FEATURE_ID_PROPERTY_NAME); + expect(feature1.properties[GEOJSON_FEATURE_ID_PROPERTY_NAME]).toBe(featureId); + expect(featureProperties).not.toHaveProperty(GEOJSON_FEATURE_ID_PROPERTY_NAME); }); diff --git a/x-pack/plugins/maps/public/classes/layers/vector_layer/assign_feature_ids.ts b/x-pack/plugins/maps/public/classes/layers/vector_layer/assign_feature_ids.ts index c40c8299ad04c..53ce15439e815 100644 --- a/x-pack/plugins/maps/public/classes/layers/vector_layer/assign_feature_ids.ts +++ b/x-pack/plugins/maps/public/classes/layers/vector_layer/assign_feature_ids.ts @@ -7,7 +7,11 @@ import _ from 'lodash'; import { FeatureCollection, Feature } from 'geojson'; -import { FEATURE_ID_PROPERTY_NAME } from '../../../../common/constants'; +import { SOURCE_TYPES } from '../../../../common/constants'; +import { IVectorSource } from '../../sources/vector_source'; + +export const GEOJSON_FEATURE_ID_PROPERTY_NAME = '__kbn__feature_id__'; +export const ES_MVT_FEATURE_ID_PROPERTY_NAME = '_id'; let idCounter = 0; @@ -43,7 +47,7 @@ export function assignFeatureIds(featureCollection: FeatureCollection): FeatureC geometry: feature.geometry, // do not copy geometry, this object can be massive properties: { // preserve feature id provided by source so features can be referenced across fetches - [FEATURE_ID_PROPERTY_NAME]: feature.id == null ? numericId : feature.id, + [GEOJSON_FEATURE_ID_PROPERTY_NAME]: feature.id == null ? numericId : feature.id, // create new object for properties so original is not polluted with kibana internal props ...feature.properties, }, @@ -56,3 +60,13 @@ export function assignFeatureIds(featureCollection: FeatureCollection): FeatureC features, }; } + +export function getFeatureId(feature: Feature, source: IVectorSource): string | number | undefined { + if (!source.isMvt()) { + return feature.properties?.[GEOJSON_FEATURE_ID_PROPERTY_NAME]; + } + + return source.getType() === SOURCE_TYPES.ES_SEARCH + ? feature.properties?.[ES_MVT_FEATURE_ID_PROPERTY_NAME] + : feature.id; +} diff --git a/x-pack/plugins/maps/common/get_centroid_features.test.ts b/x-pack/plugins/maps/public/classes/layers/vector_layer/get_centroid_features.test.ts similarity index 93% rename from x-pack/plugins/maps/common/get_centroid_features.test.ts rename to x-pack/plugins/maps/public/classes/layers/vector_layer/get_centroid_features.test.ts index 0fac9dc3a355f..2b8d03a2c3f8c 100644 --- a/x-pack/plugins/maps/common/get_centroid_features.test.ts +++ b/x-pack/plugins/maps/public/classes/layers/vector_layer/get_centroid_features.test.ts @@ -44,35 +44,6 @@ test('should not create centroid feature for point and multipoint', () => { expect(centroidFeatures.length).toBe(0); }); -test('should not create centroid for the metadata polygon', () => { - const polygonFeature: Feature = { - type: 'Feature', - geometry: { - type: 'Polygon', - coordinates: [ - [ - [35, 10], - [45, 45], - [15, 40], - [10, 20], - [35, 10], - ], - ], - }, - properties: { - __kbn_metadata_feature__: true, - prop0: 'value0', - prop1: 0.0, - }, - }; - const featureCollection: FeatureCollection = { - type: 'FeatureCollection', - features: [polygonFeature], - }; - const centroidFeatures = getCentroidFeatures(featureCollection); - expect(centroidFeatures.length).toBe(0); -}); - test('should create centroid feature for line (even number of points)', () => { const lineFeature: Feature = { type: 'Feature', diff --git a/x-pack/plugins/maps/common/get_centroid_features.ts b/x-pack/plugins/maps/public/classes/layers/vector_layer/get_centroid_features.ts similarity index 94% rename from x-pack/plugins/maps/common/get_centroid_features.ts rename to x-pack/plugins/maps/public/classes/layers/vector_layer/get_centroid_features.ts index 8aaeb56576a84..6afe61f8a16b9 100644 --- a/x-pack/plugins/maps/common/get_centroid_features.ts +++ b/x-pack/plugins/maps/public/classes/layers/vector_layer/get_centroid_features.ts @@ -21,18 +21,13 @@ import turfArea from '@turf/area'; import turfCenterOfMass from '@turf/center-of-mass'; import turfLength from '@turf/length'; import { lineString, polygon } from '@turf/helpers'; -import { GEO_JSON_TYPE, KBN_IS_CENTROID_FEATURE, KBN_METADATA_FEATURE } from './constants'; +import { GEO_JSON_TYPE, KBN_IS_CENTROID_FEATURE } from '../../../../common/constants'; export function getCentroidFeatures(featureCollection: FeatureCollection): Feature[] { const centroids = []; for (let i = 0; i < featureCollection.features.length; i++) { const feature = featureCollection.features[i]; - // do not add centroid for kibana added features - if (feature.properties?.[KBN_METADATA_FEATURE]) { - continue; - } - const centroid = getCentroid(feature); if (centroid) { centroids.push(centroid); diff --git a/x-pack/plugins/maps/public/classes/layers/vector_layer/index.ts b/x-pack/plugins/maps/public/classes/layers/vector_layer/index.ts index cb964f77613da..80d83996d8fd6 100644 --- a/x-pack/plugins/maps/public/classes/layers/vector_layer/index.ts +++ b/x-pack/plugins/maps/public/classes/layers/vector_layer/index.ts @@ -13,3 +13,4 @@ export { VectorLayerArguments, NO_RESULTS_ICON_AND_TOOLTIPCONTENT, } from './vector_layer'; +export { getFeatureId } from './assign_feature_ids'; diff --git a/x-pack/plugins/maps/public/classes/layers/vector_layer/utils.tsx b/x-pack/plugins/maps/public/classes/layers/vector_layer/utils.tsx index 8e4eb349036ea..cc30f30fe9898 100644 --- a/x-pack/plugins/maps/public/classes/layers/vector_layer/utils.tsx +++ b/x-pack/plugins/maps/public/classes/layers/vector_layer/utils.tsx @@ -24,7 +24,7 @@ import { DataRequestContext } from '../../../actions'; import { IVectorSource } from '../../sources/vector_source'; import { DataRequestAbortError } from '../../util/data_request'; import { DataRequest } from '../../util/data_request'; -import { getCentroidFeatures } from '../../../../common/get_centroid_features'; +import { getCentroidFeatures } from './get_centroid_features'; import { canSkipSourceUpdate } from '../../util/can_skip_fetch'; import { assignFeatureIds } from './assign_feature_ids'; diff --git a/x-pack/plugins/maps/public/classes/layers/vector_layer/vector_layer.tsx b/x-pack/plugins/maps/public/classes/layers/vector_layer/vector_layer.tsx index 3faf92715451c..cd1b644e9cfba 100644 --- a/x-pack/plugins/maps/public/classes/layers/vector_layer/vector_layer.tsx +++ b/x-pack/plugins/maps/public/classes/layers/vector_layer/vector_layer.tsx @@ -21,20 +21,16 @@ import { AbstractLayer } from '../layer'; import { IVectorStyle, VectorStyle } from '../../styles/vector/vector_style'; import { AGG_TYPE, - FEATURE_ID_PROPERTY_NAME, SOURCE_META_DATA_REQUEST_ID, SOURCE_FORMATTERS_DATA_REQUEST_ID, FEATURE_VISIBLE_PROPERTY_NAME, EMPTY_FEATURE_COLLECTION, - KBN_METADATA_FEATURE, LAYER_TYPE, FIELD_ORIGIN, - KBN_TOO_MANY_FEATURES_IMAGE_ID, FieldFormatter, SOURCE_TYPES, STYLE_TYPE, SUPPORTS_FEATURE_EDITING_REQUEST_ID, - KBN_IS_TILE_COMPLETE, VECTOR_STYLES, } from '../../../../common/constants'; import { JoinTooltipProperty } from '../../tooltips/join_tooltip_property'; @@ -46,7 +42,7 @@ import { } from '../../util/can_skip_fetch'; import { getFeatureCollectionBounds } from '../../util/get_feature_collection_bounds'; import { - getCentroidFilterExpression, + getLabelFilterExpression, getFillFilterExpression, getLineFilterExpression, getPointFilterExpression, @@ -80,6 +76,7 @@ import { addGeoJsonMbSource, getVectorSourceBounds, syncVectorSource } from './u import { JoinState, performInnerJoins } from './perform_inner_joins'; import { buildVectorRequestMeta } from '../build_vector_request_meta'; import { getJoinAggKey } from '../../../../common/get_agg_key'; +import { getFeatureId } from './assign_feature_ids'; export function isVectorLayer(layer: ILayer) { return (layer as IVectorLayer).canShowTooltip !== undefined; @@ -93,6 +90,12 @@ export interface VectorLayerArguments { } export interface IVectorLayer extends ILayer { + /* + * IVectorLayer.getMbLayerIds returns a list of mapbox layers assoicated with this layer for identifing features with tooltips. + * Must return ILayer.getMbLayerIds or a subset of ILayer.getMbLayerIds. + */ + getMbTooltipLayerIds(): string[]; + getFields(): Promise; getStyleEditorFields(): Promise; getJoins(): InnerJoin[]; @@ -118,6 +121,9 @@ export const NO_RESULTS_ICON_AND_TOOLTIPCONTENT = { }), }; +/* + * Geojson vector layer + */ export class VectorLayer extends AbstractLayer implements IVectorLayer { static type = LAYER_TYPE.VECTOR; @@ -589,6 +595,7 @@ export class VectorLayer extends AbstractLayer implements IVectorLayer { timeFilters: nextMeta.timeFilters, searchSessionId: dataFilters.searchSessionId, }); + stopLoading(dataRequestId, requestToken, styleMeta, nextMeta); } catch (error) { if (!(error instanceof DataRequestAbortError)) { @@ -774,6 +781,9 @@ export class VectorLayer extends AbstractLayer implements IVectorLayer { } _getSourceFeatureCollection() { + if (this.getSource().isMvt()) { + return null; + } const sourceDataRequest = this.getSourceDataRequest(); return sourceDataRequest ? (sourceDataRequest.getData() as FeatureCollection) : null; } @@ -946,7 +956,6 @@ export class VectorLayer extends AbstractLayer implements IVectorLayer { const sourceId = this.getId(); const fillLayerId = this._getMbPolygonLayerId(); const lineLayerId = this._getMbLineLayerId(); - const tooManyFeaturesLayerId = this._getMbTooManyFeaturesLayerId(); const hasJoins = this.hasJoins(); if (!mbMap.getLayer(fillLayerId)) { @@ -973,29 +982,6 @@ export class VectorLayer extends AbstractLayer implements IVectorLayer { } mbMap.addLayer(mbLayer); } - if (!mbMap.getLayer(tooManyFeaturesLayerId)) { - const mbLayer: MbLayer = { - id: tooManyFeaturesLayerId, - type: 'fill', - source: sourceId, - paint: {}, - }; - if (mvtSourceLayer) { - mbLayer['source-layer'] = mvtSourceLayer; - } - mbMap.addLayer(mbLayer); - mbMap.setFilter(tooManyFeaturesLayerId, [ - 'all', - ['==', ['get', KBN_METADATA_FEATURE], true], - ['==', ['get', KBN_IS_TILE_COMPLETE], false], - ]); - mbMap.setPaintProperty( - tooManyFeaturesLayerId, - 'fill-pattern', - KBN_TOO_MANY_FEATURES_IMAGE_ID - ); - mbMap.setPaintProperty(tooManyFeaturesLayerId, 'fill-opacity', this.getAlpha()); - } this.getCurrentStyle().setMBPaintProperties({ alpha: this.getAlpha(), @@ -1017,21 +1003,18 @@ export class VectorLayer extends AbstractLayer implements IVectorLayer { if (!_.isEqual(lineFilterExpr, mbMap.getFilter(lineLayerId))) { mbMap.setFilter(lineLayerId, lineFilterExpr); } - - this.syncVisibilityWithMb(mbMap, tooManyFeaturesLayerId); - mbMap.setLayerZoomRange(tooManyFeaturesLayerId, this.getMinZoom(), this.getMaxZoom()); } - _setMbCentroidProperties( + _setMbLabelProperties( mbMap: MbMap, mvtSourceLayer?: string, timesliceMaskConfig?: TimesliceMaskConfig ) { - const centroidLayerId = this._getMbCentroidLayerId(); - const centroidLayer = mbMap.getLayer(centroidLayerId); - if (!centroidLayer) { + const labelLayerId = this._getMbLabelLayerId(); + const labelLayer = mbMap.getLayer(labelLayerId); + if (!labelLayer) { const mbLayer: MbLayer = { - id: centroidLayerId, + id: labelLayerId, type: 'symbol', source: this.getId(), }; @@ -1041,27 +1024,32 @@ export class VectorLayer extends AbstractLayer implements IVectorLayer { mbMap.addLayer(mbLayer); } - const filterExpr = getCentroidFilterExpression(this.hasJoins(), timesliceMaskConfig); - if (!_.isEqual(filterExpr, mbMap.getFilter(centroidLayerId))) { - mbMap.setFilter(centroidLayerId, filterExpr); + const isSourceGeoJson = !this.getSource().isMvt(); + const filterExpr = getLabelFilterExpression( + this.hasJoins(), + isSourceGeoJson, + timesliceMaskConfig + ); + if (!_.isEqual(filterExpr, mbMap.getFilter(labelLayerId))) { + mbMap.setFilter(labelLayerId, filterExpr); } this.getCurrentStyle().setMBPropertiesForLabelText({ alpha: this.getAlpha(), mbMap, - textLayerId: centroidLayerId, + textLayerId: labelLayerId, }); - this.syncVisibilityWithMb(mbMap, centroidLayerId); - mbMap.setLayerZoomRange(centroidLayerId, this.getMinZoom(), this.getMaxZoom()); + this.syncVisibilityWithMb(mbMap, labelLayerId); + mbMap.setLayerZoomRange(labelLayerId, this.getMinZoom(), this.getMaxZoom()); } _syncStylePropertiesWithMb(mbMap: MbMap, timeslice?: Timeslice) { const timesliceMaskConfig = this._getTimesliceMaskConfig(timeslice); this._setMbPointsProperties(mbMap, undefined, timesliceMaskConfig); this._setMbLinePolygonProperties(mbMap, undefined, timesliceMaskConfig); - // centroid layers added after polygon layers to ensure they are on top of polygon layers - this._setMbCentroidProperties(mbMap, undefined, timesliceMaskConfig); + // label layers added after geometry layers to ensure they are on top + this._setMbLabelProperties(mbMap, undefined, timesliceMaskConfig); } _getTimesliceMaskConfig(timeslice?: Timeslice): TimesliceMaskConfig | undefined { @@ -1092,8 +1080,12 @@ export class VectorLayer extends AbstractLayer implements IVectorLayer { return this.makeMbLayerId('text'); } - _getMbCentroidLayerId() { - return this.makeMbLayerId('centroid'); + // _getMbTextLayerId is labels for Points and MultiPoints + // _getMbLabelLayerId is labels for not Points and MultiPoints + // _getMbLabelLayerId used to be called _getMbCentroidLayerId + // TODO merge textLayer and labelLayer into single layer + _getMbLabelLayerId() { + return this.makeMbLayerId('label'); } _getMbSymbolLayerId() { @@ -1108,22 +1100,21 @@ export class VectorLayer extends AbstractLayer implements IVectorLayer { return this.makeMbLayerId('fill'); } - _getMbTooManyFeaturesLayerId() { - return this.makeMbLayerId('toomanyfeatures'); - } - - getMbLayerIds() { + getMbTooltipLayerIds() { return [ this._getMbPointLayerId(), this._getMbTextLayerId(), - this._getMbCentroidLayerId(), + this._getMbLabelLayerId(), this._getMbSymbolLayerId(), this._getMbLineLayerId(), this._getMbPolygonLayerId(), - this._getMbTooManyFeaturesLayerId(), ]; } + getMbLayerIds() { + return this.getMbTooltipLayerIds(); + } + ownsMbLayerId(mbLayerId: string) { return this.getMbLayerIds().includes(mbLayerId); } @@ -1170,7 +1161,7 @@ export class VectorLayer extends AbstractLayer implements IVectorLayer { } const targetFeature = featureCollection.features.find((feature) => { - return feature.properties?.[FEATURE_ID_PROPERTY_NAME] === id; + return getFeatureId(feature, this.getSource()) === id; }); return targetFeature ? targetFeature : null; } diff --git a/x-pack/plugins/maps/public/classes/sources/es_agg_source/es_agg_source.ts b/x-pack/plugins/maps/public/classes/sources/es_agg_source/es_agg_source.ts index 78bc2592182d8..dc9637c7a7637 100644 --- a/x-pack/plugins/maps/public/classes/sources/es_agg_source/es_agg_source.ts +++ b/x-pack/plugins/maps/public/classes/sources/es_agg_source/es_agg_source.ts @@ -134,14 +134,14 @@ export abstract class AbstractESAggSource extends AbstractESSource implements IE return valueAggsDsl; } - async getTooltipProperties(properties: GeoJsonProperties): Promise { + async getTooltipProperties(mbProperties: GeoJsonProperties): Promise { const metricFields = await this.getFields(); const promises: Array> = []; metricFields.forEach((metricField) => { let value; - for (const key in properties) { - if (properties.hasOwnProperty(key) && metricField.getName() === key) { - value = properties[key]; + for (const key in mbProperties) { + if (mbProperties.hasOwnProperty(key) && metricField.getMbFieldName() === key) { + value = mbProperties[key]; break; } } diff --git a/x-pack/plugins/maps/public/classes/sources/es_geo_grid_source/__snapshots__/resolution_editor.test.tsx.snap b/x-pack/plugins/maps/public/classes/sources/es_geo_grid_source/__snapshots__/resolution_editor.test.tsx.snap index ca9775594a9d7..6a1dbf9e1590b 100644 --- a/x-pack/plugins/maps/public/classes/sources/es_geo_grid_source/__snapshots__/resolution_editor.test.tsx.snap +++ b/x-pack/plugins/maps/public/classes/sources/es_geo_grid_source/__snapshots__/resolution_editor.test.tsx.snap @@ -1,73 +1,77 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`resolution editor should add super-fine option 1`] = ` - - - + + + + + `; exports[`resolution editor should omit super-fine option 1`] = ` - - - + + + + + `; diff --git a/x-pack/plugins/maps/public/classes/sources/es_geo_grid_source/__snapshots__/update_source_editor.test.tsx.snap b/x-pack/plugins/maps/public/classes/sources/es_geo_grid_source/__snapshots__/update_source_editor.test.tsx.snap index dfce6b36396a7..0d4467792e636 100644 --- a/x-pack/plugins/maps/public/classes/sources/es_geo_grid_source/__snapshots__/update_source_editor.test.tsx.snap +++ b/x-pack/plugins/maps/public/classes/sources/es_geo_grid_source/__snapshots__/update_source_editor.test.tsx.snap @@ -19,9 +19,9 @@ exports[`source editor geo_grid_source default vector layer config should allow /> @@ -45,6 +45,7 @@ exports[`source editor geo_grid_source default vector layer config should allow /> @@ -79,7 +80,8 @@ exports[`source editor geo_grid_source should put limitations based on heatmap-r /> diff --git a/x-pack/plugins/maps/common/elasticsearch_util/convert_to_geojson.d.ts b/x-pack/plugins/maps/public/classes/sources/es_geo_grid_source/convert_to_geojson.d.ts similarity index 89% rename from x-pack/plugins/maps/common/elasticsearch_util/convert_to_geojson.d.ts rename to x-pack/plugins/maps/public/classes/sources/es_geo_grid_source/convert_to_geojson.d.ts index 3bb2e165fa740..9452620447259 100644 --- a/x-pack/plugins/maps/common/elasticsearch_util/convert_to_geojson.d.ts +++ b/x-pack/plugins/maps/public/classes/sources/es_geo_grid_source/convert_to_geojson.d.ts @@ -6,7 +6,7 @@ */ import { Feature } from 'geojson'; -import { RENDER_AS } from '../constants'; +import { RENDER_AS } from '../../../../common/constants'; export function convertCompositeRespToGeoJson(esResponse: any, renderAs: RENDER_AS): Feature[]; export function convertRegularRespToGeoJson(esResponse: any, renderAs: RENDER_AS): Feature[]; diff --git a/x-pack/plugins/maps/common/elasticsearch_util/convert_to_geojson.js b/x-pack/plugins/maps/public/classes/sources/es_geo_grid_source/convert_to_geojson.js similarity index 89% rename from x-pack/plugins/maps/common/elasticsearch_util/convert_to_geojson.js rename to x-pack/plugins/maps/public/classes/sources/es_geo_grid_source/convert_to_geojson.js index f416847941a8a..87fb0d53efa62 100644 --- a/x-pack/plugins/maps/common/elasticsearch_util/convert_to_geojson.js +++ b/x-pack/plugins/maps/public/classes/sources/es_geo_grid_source/convert_to_geojson.js @@ -6,10 +6,13 @@ */ import _ from 'lodash'; -import { RENDER_AS, GEOTILE_GRID_AGG_NAME, GEOCENTROID_AGG_NAME } from '../constants'; -import { getTileBoundingBox } from '../geo_tile_utils'; -import { extractPropertiesFromBucket } from './es_agg_utils'; -import { clamp } from './elasticsearch_geo_utils'; +import { + RENDER_AS, + GEOTILE_GRID_AGG_NAME, + GEOCENTROID_AGG_NAME, +} from '../../../../common/constants'; +import { getTileBoundingBox } from '../../util/geo_tile_utils'; +import { clamp, extractPropertiesFromBucket } from '../../../../common/elasticsearch_util'; const GRID_BUCKET_KEYS_TO_IGNORE = ['key', GEOCENTROID_AGG_NAME]; diff --git a/x-pack/plugins/maps/common/elasticsearch_util/convert_to_geojson.test.ts b/x-pack/plugins/maps/public/classes/sources/es_geo_grid_source/convert_to_geojson.test.ts similarity index 98% rename from x-pack/plugins/maps/common/elasticsearch_util/convert_to_geojson.test.ts rename to x-pack/plugins/maps/public/classes/sources/es_geo_grid_source/convert_to_geojson.test.ts index 2dc96038d931d..d6de17bef710b 100644 --- a/x-pack/plugins/maps/common/elasticsearch_util/convert_to_geojson.test.ts +++ b/x-pack/plugins/maps/public/classes/sources/es_geo_grid_source/convert_to_geojson.test.ts @@ -7,7 +7,7 @@ // @ts-ignore import { convertCompositeRespToGeoJson, convertRegularRespToGeoJson } from './convert_to_geojson'; -import { RENDER_AS } from '../constants'; +import { RENDER_AS } from '../../../../common/constants'; describe('convertCompositeRespToGeoJson', () => { const esResponse = { diff --git a/x-pack/plugins/maps/public/classes/sources/es_geo_grid_source/es_geo_grid_source.test.ts b/x-pack/plugins/maps/public/classes/sources/es_geo_grid_source/es_geo_grid_source.test.ts index 41d5715e47b8e..8eebf01a550dd 100644 --- a/x-pack/plugins/maps/public/classes/sources/es_geo_grid_source/es_geo_grid_source.test.ts +++ b/x-pack/plugins/maps/public/classes/sources/es_geo_grid_source/es_geo_grid_source.test.ts @@ -296,7 +296,7 @@ describe('ESGeoGridSource', () => { ); it('getLayerName', () => { - expect(mvtGeogridSource.getLayerName()).toBe('source_layer'); + expect(mvtGeogridSource.getLayerName()).toBe('aggs'); }); it('getMinZoom', () => { @@ -312,28 +312,13 @@ describe('ESGeoGridSource', () => { vectorSourceRequestMeta ); - expect(urlTemplateWithMeta.layerName).toBe('source_layer'); + expect(urlTemplateWithMeta.layerName).toBe('aggs'); expect(urlTemplateWithMeta.minSourceZoom).toBe(0); expect(urlTemplateWithMeta.maxSourceZoom).toBe(24); expect(urlTemplateWithMeta.urlTemplate).toEqual( - "rootdir/api/maps/mvt/getGridTile/{z}/{x}/{y}.pbf?geometryFieldName=bar&index=undefined&requestBody=(foobar:ES_DSL_PLACEHOLDER,params:('0':('0':index,'1':(fields:())),'1':('0':size,'1':0),'2':('0':filter,'1':!()),'3':('0':query),'4':('0':index,'1':(fields:())),'5':('0':query,'1':(language:KQL,query:'')),'6':('0':aggs,'1':(gridSplit:(aggs:(gridCentroid:(geo_centroid:(field:bar))),geotile_grid:(bounds:!n,field:bar,precision:!n,shard_size:65535,size:65535))))))&requestType=heatmap&geoFieldType=geo_point" + "rootdir/api/maps/mvt/getGridTile/{z}/{x}/{y}.pbf?geometryFieldName=bar&index=undefined&requestBody=(foobar:ES_DSL_PLACEHOLDER,params:('0':('0':index,'1':(fields:())),'1':('0':size,'1':0),'2':('0':filter,'1':!()),'3':('0':query),'4':('0':index,'1':(fields:())),'5':('0':query,'1':(language:KQL,query:'')),'6':('0':aggs,'1':())))&requestType=heatmap" ); }); - - it('should include searchSourceId in urlTemplateWithMeta', async () => { - const urlTemplateWithMeta = await mvtGeogridSource.getUrlTemplateWithMeta({ - ...vectorSourceRequestMeta, - searchSessionId: '1', - }); - - expect( - urlTemplateWithMeta.urlTemplate.startsWith( - "rootdir/api/maps/mvt/getGridTile/{z}/{x}/{y}.pbf?geometryFieldName=bar&index=undefined&requestBody=(foobar:ES_DSL_PLACEHOLDER,params:('0':('0':index,'1':(fields:())),'1':('0':size,'1':0),'2':('0':filter,'1':!()),'3':('0':query),'4':('0':index,'1':(fields:())),'5':('0':query,'1':(language:KQL,query:'')),'6':('0':aggs,'1':(gridSplit:(aggs:(gridCentroid:(geo_centroid:(field:bar))),geotile_grid:(bounds:!n,field:bar,precision:!n,shard_size:65535,size:65535))))))&requestType=heatmap&geoFieldType=geo_point&searchSessionId=1" - ) - ).toBe(true); - - expect(urlTemplateWithMeta.urlTemplate.endsWith('&searchSessionId=1')).toBe(true); - }); }); describe('Gold+ usage', () => { diff --git a/x-pack/plugins/maps/public/classes/sources/es_geo_grid_source/es_geo_grid_source.tsx b/x-pack/plugins/maps/public/classes/sources/es_geo_grid_source/es_geo_grid_source.tsx index 7bd1e4dfd75f3..d038c139a1667 100644 --- a/x-pack/plugins/maps/public/classes/sources/es_geo_grid_source/es_geo_grid_source.tsx +++ b/x-pack/plugins/maps/public/classes/sources/es_geo_grid_source/es_geo_grid_source.tsx @@ -11,12 +11,8 @@ import { i18n } from '@kbn/i18n'; import rison from 'rison-node'; import { Feature } from 'geojson'; import type { estypes } from '@elastic/elasticsearch'; -import { - convertCompositeRespToGeoJson, - convertRegularRespToGeoJson, - makeESBbox, -} from '../../../../common/elasticsearch_util'; -// @ts-expect-error +import { makeESBbox } from '../../../../common/elasticsearch_util'; +import { convertCompositeRespToGeoJson, convertRegularRespToGeoJson } from './convert_to_geojson'; import { UpdateSourceEditor } from './update_source_editor'; import { DEFAULT_MAX_BUCKETS_LIMIT, @@ -26,7 +22,6 @@ import { GIS_API_PATH, GRID_RESOLUTION, MVT_GETGRIDTILE_API_PATH, - MVT_SOURCE_LAYER_NAME, MVT_TOKEN_PARAM_NAME, RENDER_AS, SOURCE_TYPES, @@ -55,6 +50,8 @@ import { ITiledSingleLayerMvtParams } from '../tiled_single_layer_vector_source/ type ESGeoGridSourceSyncMeta = Pick; +const ES_MVT_AGGS_LAYER_NAME = 'aggs'; + export const MAX_GEOTILE_LEVEL = 29; export const clustersTitle = i18n.translate('xpack.maps.source.esGridClustersTitle', { @@ -140,6 +137,10 @@ export class ESGeoGridSource extends AbstractESAggSource implements ITiledSingle ]; } + isMvt() { + return this._descriptor.resolution === GRID_RESOLUTION.SUPER_FINE; + } + getFieldNames() { return this.getMetricFields().map((esAggMetricField) => esAggMetricField.getName()); } @@ -305,8 +306,8 @@ export class ESGeoGridSource extends AbstractESAggSource implements ITiledSingle _addNonCompositeAggsToSearchSource( searchSource: ISearchSource, indexPattern: IndexPattern, - precision: number | null, - bufferedExtent?: MapExtent | null + precision: number, + bufferedExtent?: MapExtent ) { searchSource.setField('aggs', { [GEOTILE_GRID_AGG_NAME]: { @@ -419,7 +420,7 @@ export class ESGeoGridSource extends AbstractESAggSource implements ITiledSingle } getLayerName(): string { - return MVT_SOURCE_LAYER_NAME; + return ES_MVT_AGGS_LAYER_NAME; } async getUrlTemplateWithMeta( @@ -427,14 +428,7 @@ export class ESGeoGridSource extends AbstractESAggSource implements ITiledSingle ): Promise { const indexPattern = await this.getIndexPattern(); const searchSource = await this.makeSearchSource(searchFilters, 0); - - this._addNonCompositeAggsToSearchSource( - searchSource, - indexPattern, - null, // needs to be set server-side - null // needs to be stripped server-side - ); - + searchSource.setField('aggs', this.getValueAggsDsl(indexPattern)); const dsl = searchSource.getSearchRequestBody(); const risonDsl = rison.encode(dsl); @@ -443,22 +437,18 @@ export class ESGeoGridSource extends AbstractESAggSource implements ITiledSingle `/${GIS_API_PATH}/${MVT_GETGRIDTILE_API_PATH}/{z}/{x}/{y}.pbf` ); - const geoField = await this._getGeoField(); const urlTemplate = `${mvtUrlServicePath}\ ?geometryFieldName=${this._descriptor.geoField}\ &index=${indexPattern.title}\ &requestBody=${risonDsl}\ -&requestType=${this._descriptor.requestType}\ -&geoFieldType=${geoField.type}`; +&requestType=${this._descriptor.requestType}`; return { refreshTokenParamName: MVT_TOKEN_PARAM_NAME, layerName: this.getLayerName(), minSourceZoom: this.getMinZoom(), maxSourceZoom: this.getMaxZoom(), - urlTemplate: searchFilters.searchSessionId - ? urlTemplate + `&searchSessionId=${searchFilters.searchSessionId}` - : urlTemplate, + urlTemplate, }; } diff --git a/x-pack/plugins/maps/public/classes/sources/es_geo_grid_source/resolution_editor.js b/x-pack/plugins/maps/public/classes/sources/es_geo_grid_source/resolution_editor.js deleted file mode 100644 index 52f4e4c9b7b88..0000000000000 --- a/x-pack/plugins/maps/public/classes/sources/es_geo_grid_source/resolution_editor.js +++ /dev/null @@ -1,61 +0,0 @@ -/* - * 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; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import React from 'react'; -import { GRID_RESOLUTION } from '../../../../common/constants'; -import { EuiSelect, EuiFormRow } from '@elastic/eui'; -import { i18n } from '@kbn/i18n'; - -const BASE_OPTIONS = [ - { - value: GRID_RESOLUTION.COARSE, - text: i18n.translate('xpack.maps.source.esGrid.coarseDropdownOption', { - defaultMessage: 'coarse', - }), - }, - { - value: GRID_RESOLUTION.FINE, - text: i18n.translate('xpack.maps.source.esGrid.fineDropdownOption', { - defaultMessage: 'fine', - }), - }, - { - value: GRID_RESOLUTION.MOST_FINE, - text: i18n.translate('xpack.maps.source.esGrid.finestDropdownOption', { - defaultMessage: 'finest', - }), - }, -]; - -export function ResolutionEditor({ resolution, onChange, includeSuperFine }) { - const options = [...BASE_OPTIONS]; - - if (includeSuperFine) { - options.push({ - value: GRID_RESOLUTION.SUPER_FINE, - text: i18n.translate('xpack.maps.source.esGrid.superFineDropDownOption', { - defaultMessage: 'super fine (beta)', - }), - }); - } - - return ( - - onChange(e.target.value)} - compressed - /> - - ); -} diff --git a/x-pack/plugins/maps/public/classes/sources/es_geo_grid_source/resolution_editor.test.tsx b/x-pack/plugins/maps/public/classes/sources/es_geo_grid_source/resolution_editor.test.tsx index 0066160402fa3..a642bbe41449f 100644 --- a/x-pack/plugins/maps/public/classes/sources/es_geo_grid_source/resolution_editor.test.tsx +++ b/x-pack/plugins/maps/public/classes/sources/es_geo_grid_source/resolution_editor.test.tsx @@ -8,7 +8,6 @@ import React from 'react'; import { shallow } from 'enzyme'; -// @ts-expect-error import { ResolutionEditor } from './resolution_editor'; import { GRID_RESOLUTION } from '../../../../common/constants'; @@ -16,6 +15,7 @@ const defaultProps = { resolution: GRID_RESOLUTION.COARSE, onChange: () => {}, includeSuperFine: false, + metrics: [], }; describe('resolution editor', () => { diff --git a/x-pack/plugins/maps/public/classes/sources/es_geo_grid_source/resolution_editor.tsx b/x-pack/plugins/maps/public/classes/sources/es_geo_grid_source/resolution_editor.tsx new file mode 100644 index 0000000000000..55ce46e121273 --- /dev/null +++ b/x-pack/plugins/maps/public/classes/sources/es_geo_grid_source/resolution_editor.tsx @@ -0,0 +1,161 @@ +/* + * 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; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import React, { ChangeEvent, Component } from 'react'; +import { EuiConfirmModal, EuiSelect, EuiFormRow } from '@elastic/eui'; +import { FormattedMessage } from '@kbn/i18n/react'; +import { i18n } from '@kbn/i18n'; +import { AggDescriptor } from '../../../../common/descriptor_types'; +import { AGG_TYPE, GRID_RESOLUTION } from '../../../../common/constants'; + +const BASE_OPTIONS = [ + { + value: GRID_RESOLUTION.COARSE, + text: i18n.translate('xpack.maps.source.esGrid.coarseDropdownOption', { + defaultMessage: 'coarse', + }), + }, + { + value: GRID_RESOLUTION.FINE, + text: i18n.translate('xpack.maps.source.esGrid.fineDropdownOption', { + defaultMessage: 'fine', + }), + }, + { + value: GRID_RESOLUTION.MOST_FINE, + text: i18n.translate('xpack.maps.source.esGrid.finestDropdownOption', { + defaultMessage: 'finest', + }), + }, +]; + +function isUnsupportedVectorTileMetric(metric: AggDescriptor) { + return metric.type === AGG_TYPE.TERMS; +} + +interface Props { + includeSuperFine: boolean; + resolution: GRID_RESOLUTION; + onChange: (resolution: GRID_RESOLUTION, metrics: AggDescriptor[]) => void; + metrics: AggDescriptor[]; +} + +interface State { + showModal: boolean; +} + +export class ResolutionEditor extends Component { + private readonly _options = [...BASE_OPTIONS]; + + constructor(props: Props) { + super(props); + + this.state = { + showModal: false, + }; + + if (props.includeSuperFine) { + this._options.push({ + value: GRID_RESOLUTION.SUPER_FINE, + text: i18n.translate('xpack.maps.source.esGrid.superFineDropDownOption', { + defaultMessage: 'super fine', + }), + }); + } + } + + _onResolutionChange = (e: ChangeEvent) => { + const resolution = e.target.value as GRID_RESOLUTION; + if (resolution === GRID_RESOLUTION.SUPER_FINE) { + const hasUnsupportedMetrics = this.props.metrics.find(isUnsupportedVectorTileMetric); + if (hasUnsupportedMetrics) { + this.setState({ showModal: true }); + return; + } + } + + this.props.onChange(resolution, this.props.metrics); + }; + + _closeModal = () => { + this.setState({ + showModal: false, + }); + }; + + _acceptModal = () => { + this._closeModal(); + const supportedMetrics = this.props.metrics.filter((metric) => { + return !isUnsupportedVectorTileMetric(metric); + }); + this.props.onChange( + GRID_RESOLUTION.SUPER_FINE, + supportedMetrics.length ? supportedMetrics : [{ type: AGG_TYPE.COUNT }] + ); + }; + + _renderModal() { + return this.state.showModal ? ( + +

+ +

+
+ ) : null; + } + + render() { + const helpText = + this.props.resolution === GRID_RESOLUTION.SUPER_FINE + ? i18n.translate('xpack.maps.source.esGrid.superFineHelpText', { + defaultMessage: 'Super fine grid resolution uses vector tiles.', + }) + : undefined; + return ( + <> + {this._renderModal()} + + + + + ); + } +} diff --git a/x-pack/plugins/maps/public/classes/sources/es_geo_grid_source/update_source_editor.test.tsx b/x-pack/plugins/maps/public/classes/sources/es_geo_grid_source/update_source_editor.test.tsx index 18a263143afea..9dab6698b73f0 100644 --- a/x-pack/plugins/maps/public/classes/sources/es_geo_grid_source/update_source_editor.test.tsx +++ b/x-pack/plugins/maps/public/classes/sources/es_geo_grid_source/update_source_editor.test.tsx @@ -8,14 +8,19 @@ import React from 'react'; import { shallow } from 'enzyme'; -// @ts-expect-error import { UpdateSourceEditor } from './update_source_editor'; import { GRID_RESOLUTION, LAYER_TYPE, RENDER_AS } from '../../../../common/constants'; +jest.mock('uuid/v4', () => { + return function () { + return '12345'; + }; +}); + const defaultProps = { currentLayerType: LAYER_TYPE.VECTOR, indexPatternId: 'foobar', - onChange: () => {}, + onChange: async () => {}, metrics: [], renderAs: RENDER_AS.POINT, resolution: GRID_RESOLUTION.COARSE, diff --git a/x-pack/plugins/maps/public/classes/sources/es_geo_grid_source/update_source_editor.js b/x-pack/plugins/maps/public/classes/sources/es_geo_grid_source/update_source_editor.tsx similarity index 61% rename from x-pack/plugins/maps/public/classes/sources/es_geo_grid_source/update_source_editor.js rename to x-pack/plugins/maps/public/classes/sources/es_geo_grid_source/update_source_editor.tsx index c2a0935c23719..03b5e1fe3c794 100644 --- a/x-pack/plugins/maps/public/classes/sources/es_geo_grid_source/update_source_editor.js +++ b/x-pack/plugins/maps/public/classes/sources/es_geo_grid_source/update_source_editor.tsx @@ -7,20 +7,40 @@ import React, { Fragment, Component } from 'react'; +import uuid from 'uuid/v4'; +import { FormattedMessage } from '@kbn/i18n/react'; +import { EuiPanel, EuiSpacer, EuiComboBoxOptionOption, EuiTitle } from '@elastic/eui'; import { getDataViewNotFoundMessage } from '../../../../common/i18n_getters'; -import { GRID_RESOLUTION, LAYER_TYPE } from '../../../../common/constants'; +import { AGG_TYPE, GRID_RESOLUTION, LAYER_TYPE, RENDER_AS } from '../../../../common/constants'; import { MetricsEditor } from '../../../components/metrics_editor'; import { getIndexPatternService } from '../../../kibana_services'; import { ResolutionEditor } from './resolution_editor'; -import { FormattedMessage } from '@kbn/i18n/react'; -import { EuiPanel, EuiSpacer, EuiTitle } from '@elastic/eui'; import { isMetricCountable } from '../../util/is_metric_countable'; -import { indexPatterns } from '../../../../../../../src/plugins/data/public'; +import { IndexPatternField, indexPatterns } from '../../../../../../../src/plugins/data/public'; import { RenderAsSelect } from './render_as_select'; +import { AggDescriptor } from '../../../../common/descriptor_types'; +import { OnSourceChangeArgs } from '../source'; + +interface Props { + currentLayerType?: string; + indexPatternId: string; + onChange: (...args: OnSourceChangeArgs[]) => Promise; + metrics: AggDescriptor[]; + renderAs: RENDER_AS; + resolution: GRID_RESOLUTION; +} -export class UpdateSourceEditor extends Component { - state = { - fields: null, +interface State { + metricsEditorKey: string; + fields: IndexPatternField[]; + loadError?: string; +} + +export class UpdateSourceEditor extends Component { + private _isMounted?: boolean; + state: State = { + fields: [], + metricsEditorKey: uuid(), }; componentDidMount() { @@ -54,11 +74,11 @@ export class UpdateSourceEditor extends Component { }); } - _onMetricsChange = (metrics) => { + _onMetricsChange = (metrics: AggDescriptor[]) => { this.props.onChange({ propName: 'metrics', value: metrics }); }; - _onResolutionChange = (resolution) => { + _onResolutionChange = async (resolution: GRID_RESOLUTION, metrics: AggDescriptor[]) => { let newLayerType; if ( this.props.currentLayerType === LAYER_TYPE.VECTOR || @@ -76,22 +96,36 @@ export class UpdateSourceEditor extends Component { throw new Error('Unexpected layer-type'); } - this.props.onChange({ propName: 'resolution', value: resolution, newLayerType }); + await this.props.onChange( + { propName: 'metrics', value: metrics }, + { propName: 'resolution', value: resolution, newLayerType } + ); + + // Metrics editor persists metrics in state. + // Reset metricsEditorKey to force new instance and new internal state with latest metrics + this.setState({ metricsEditorKey: uuid() }); }; - _onRequestTypeSelect = (requestType) => { + _onRequestTypeSelect = (requestType: RENDER_AS) => { this.props.onChange({ propName: 'requestType', value: requestType }); }; + _getMetricsFilter() { + if (this.props.currentLayerType === LAYER_TYPE.HEATMAP) { + return (metric: EuiComboBoxOptionOption) => { + // these are countable metrics, where blending heatmap color blobs make sense + return metric.value ? isMetricCountable(metric.value) : false; + }; + } + + if (this.props.resolution === GRID_RESOLUTION.SUPER_FINE) { + return (metric: EuiComboBoxOptionOption) => { + return metric.value !== AGG_TYPE.TERMS; + }; + } + } + _renderMetricsPanel() { - const metricsFilter = - this.props.currentLayerType === LAYER_TYPE.HEATMAP - ? (metric) => { - //these are countable metrics, where blending heatmap color blobs make sense - return isMetricCountable(metric.value); - } - : null; - const allowMultipleMetrics = this.props.currentLayerType !== LAYER_TYPE.HEATMAP; return ( @@ -101,8 +135,9 @@ export class UpdateSourceEditor extends Component { {}} /> ); diff --git a/x-pack/plugins/maps/public/classes/sources/es_search_source/es_search_source.test.ts b/x-pack/plugins/maps/public/classes/sources/es_search_source/es_search_source.test.ts index 6359abd06d3be..aad377ef53649 100644 --- a/x-pack/plugins/maps/public/classes/sources/es_search_source/es_search_source.test.ts +++ b/x-pack/plugins/maps/public/classes/sources/es_search_source/es_search_source.test.ts @@ -31,7 +31,7 @@ describe('ESSearchSource', () => { const esSearchSource = new ESSearchSource(mockDescriptor); expect(esSearchSource.getMinZoom()).toBe(0); expect(esSearchSource.getMaxZoom()).toBe(24); - expect(esSearchSource.getLayerName()).toBe('source_layer'); + expect(esSearchSource.getLayerName()).toBe('hits'); }); describe('getUrlTemplateWithMeta', () => { @@ -117,21 +117,7 @@ describe('ESSearchSource', () => { }); const urlTemplateWithMeta = await esSearchSource.getUrlTemplateWithMeta(searchFilters); expect(urlTemplateWithMeta.urlTemplate).toBe( - `rootdir/api/maps/mvt/getTile/{z}/{x}/{y}.pbf?geometryFieldName=bar&index=foobar-title-*&requestBody=(foobar:ES_DSL_PLACEHOLDER,params:('0':('0':index,'1':(fields:(),title:'foobar-title-*')),'1':('0':size,'1':1000),'2':('0':filter,'1':!()),'3':('0':query),'4':('0':index,'1':(fields:(),title:'foobar-title-*')),'5':('0':query,'1':(language:KQL,query:'tooltipField: foobar')),'6':('0':fieldsFromSource,'1':!(tooltipField,styleField)),'7':('0':source,'1':!(tooltipField,styleField))))&geoFieldType=geo_shape` - ); - }); - - it('should include searchSourceId in urlTemplateWithMeta', async () => { - const esSearchSource = new ESSearchSource({ - geoField: geoFieldName, - indexPatternId: 'ipId', - }); - const urlTemplateWithMeta = await esSearchSource.getUrlTemplateWithMeta({ - ...searchFilters, - searchSessionId: '1', - }); - expect(urlTemplateWithMeta.urlTemplate).toBe( - `rootdir/api/maps/mvt/getTile/{z}/{x}/{y}.pbf?geometryFieldName=bar&index=foobar-title-*&requestBody=(foobar:ES_DSL_PLACEHOLDER,params:('0':('0':index,'1':(fields:(),title:'foobar-title-*')),'1':('0':size,'1':1000),'2':('0':filter,'1':!()),'3':('0':query),'4':('0':index,'1':(fields:(),title:'foobar-title-*')),'5':('0':query,'1':(language:KQL,query:'tooltipField: foobar')),'6':('0':fieldsFromSource,'1':!(tooltipField,styleField)),'7':('0':source,'1':!(tooltipField,styleField))))&geoFieldType=geo_shape&searchSessionId=1` + `rootdir/api/maps/mvt/getTile/{z}/{x}/{y}.pbf?geometryFieldName=bar&index=foobar-title-*&requestBody=(foobar:ES_DSL_PLACEHOLDER,params:('0':('0':index,'1':(fields:(),title:'foobar-title-*')),'1':('0':size,'1':1000),'2':('0':filter,'1':!()),'3':('0':query),'4':('0':index,'1':(fields:(),title:'foobar-title-*')),'5':('0':query,'1':(language:KQL,query:'tooltipField: foobar')),'6':('0':fieldsFromSource,'1':!(tooltipField,styleField)),'7':('0':source,'1':!(tooltipField,styleField))))` ); }); }); @@ -162,7 +148,7 @@ describe('ESSearchSource', () => { scalingType: SCALING_TYPES.MVT, }); expect(esSearchSource.getJoinsDisabledReason()).toBe( - 'Joins are not supported when scaling by mvt vector tiles' + 'Joins are not supported when scaling by vector tiles' ); }); }); diff --git a/x-pack/plugins/maps/public/classes/sources/es_search_source/es_search_source.tsx b/x-pack/plugins/maps/public/classes/sources/es_search_source/es_search_source.tsx index 75ec128f5a8aa..31cc07d03549a 100644 --- a/x-pack/plugins/maps/public/classes/sources/es_search_source/es_search_source.tsx +++ b/x-pack/plugins/maps/public/classes/sources/es_search_source/es_search_source.tsx @@ -9,8 +9,8 @@ import _ from 'lodash'; import React, { ReactElement } from 'react'; import rison from 'rison-node'; import { i18n } from '@kbn/i18n'; -import type { Filter, IndexPatternField, IndexPattern } from 'src/plugins/data/public'; import { GeoJsonProperties, Geometry, Position } from 'geojson'; +import type { Filter, IndexPatternField, IndexPattern } from 'src/plugins/data/public'; import { esFilters } from '../../../../../../../src/plugins/data/public'; import { AbstractESSource } from '../es_source'; import { @@ -35,7 +35,6 @@ import { FIELD_ORIGIN, GIS_API_PATH, MVT_GETTILE_API_PATH, - MVT_SOURCE_LAYER_NAME, MVT_TOKEN_PARAM_NAME, SCALING_TYPES, SOURCE_TYPES, @@ -54,14 +53,17 @@ import { VectorSourceRequestMeta, } from '../../../../common/descriptor_types'; import { Adapters } from '../../../../../../../src/plugins/inspector/common/adapters'; -import { TimeRange } from '../../../../../../../src/plugins/data/common'; +import { + SortDirection, + SortDirectionNumeric, + TimeRange, +} from '../../../../../../../src/plugins/data/common'; import { ImmutableSourceProperty, SourceEditorArgs } from '../source'; import { IField } from '../../fields/field'; import { GeoJsonWithMeta, SourceTooltipConfig } from '../vector_source'; import { ITiledSingleLayerVectorSource } from '../tiled_single_layer_vector_source'; import { ITooltipProperty } from '../../tooltips/tooltip_property'; import { DataRequest } from '../../util/data_request'; -import { SortDirection, SortDirectionNumeric } from '../../../../../../../src/plugins/data/common'; import { isValidStringConfig } from '../../util/valid_string_config'; import { TopHitsUpdateSourceEditor } from './top_hits'; import { getDocValueAndSourceFields, ScriptField } from './util/get_docvalue_source_fields'; @@ -83,6 +85,8 @@ type ESSearchSourceSyncMeta = Pick< | 'topHitsSize' >; +const ES_MVT_HITS_LAYER_NAME = 'hits'; + export function timerangeToTimeextent(timerange: TimeRange): Timeslice | undefined { const timeRangeBounds = getTimeFilter().calculateBounds(timerange); return timeRangeBounds.min !== undefined && timeRangeBounds.max !== undefined @@ -185,6 +189,8 @@ export class ESSearchSource extends AbstractESSource implements ITiledSingleLaye sortOrder={this._descriptor.sortOrder} scalingType={this._descriptor.scalingType} filterByMapBounds={this.isFilterByMapBounds()} + hasJoins={sourceEditorArgs.hasJoins} + clearJoins={sourceEditorArgs.clearJoins} /> ); } @@ -211,6 +217,10 @@ export class ESSearchSource extends AbstractESSource implements ITiledSingleLaye return [this._descriptor.geoField]; } + isMvt() { + return this._descriptor.scalingType === SCALING_TYPES.MVT; + } + async getImmutableProperties(): Promise { let indexPatternName = this.getIndexPatternId(); let geoFieldType = ''; @@ -748,7 +758,7 @@ export class ESSearchSource extends AbstractESSource implements ITiledSingleLaye }); } else if (this._descriptor.scalingType === SCALING_TYPES.MVT) { reason = i18n.translate('xpack.maps.source.esSearch.joinsDisabledReasonMvt', { - defaultMessage: 'Joins are not supported when scaling by mvt vector tiles', + defaultMessage: 'Joins are not supported when scaling by vector tiles', }); } else { reason = null; @@ -757,7 +767,7 @@ export class ESSearchSource extends AbstractESSource implements ITiledSingleLaye } getLayerName(): string { - return MVT_SOURCE_LAYER_NAME; + return ES_MVT_HITS_LAYER_NAME; } async _getEditableIndex(): Promise { @@ -828,22 +838,17 @@ export class ESSearchSource extends AbstractESSource implements ITiledSingleLaye `/${GIS_API_PATH}/${MVT_GETTILE_API_PATH}/{z}/{x}/{y}.pbf` ); - const geoField = await this._getGeoField(); - const urlTemplate = `${mvtUrlServicePath}\ ?geometryFieldName=${this._descriptor.geoField}\ &index=${indexPattern.title}\ -&requestBody=${risonDsl}\ -&geoFieldType=${geoField.type}`; +&requestBody=${risonDsl}`; return { refreshTokenParamName: MVT_TOKEN_PARAM_NAME, layerName: this.getLayerName(), minSourceZoom: this.getMinZoom(), maxSourceZoom: this.getMaxZoom(), - urlTemplate: searchFilters.searchSessionId - ? urlTemplate + `&searchSessionId=${searchFilters.searchSessionId}` - : urlTemplate, + urlTemplate, }; } diff --git a/x-pack/plugins/maps/public/classes/sources/es_search_source/update_source_editor.js b/x-pack/plugins/maps/public/classes/sources/es_search_source/update_source_editor.js index c28c8bedafaf9..ad0e03c2fe09d 100644 --- a/x-pack/plugins/maps/public/classes/sources/es_search_source/update_source_editor.js +++ b/x-pack/plugins/maps/public/classes/sources/es_search_source/update_source_editor.js @@ -35,6 +35,8 @@ export class UpdateSourceEditor extends Component { sortOrder: PropTypes.string.isRequired, scalingType: PropTypes.string.isRequired, source: PropTypes.object, + hasJoins: PropTypes.bool.isRequired, + clearJoins: PropTypes.func.isRequired, }; state = { @@ -205,6 +207,8 @@ export class UpdateSourceEditor extends Component { scalingType={this.props.scalingType} supportsClustering={this.state.supportsClustering} clusteringDisabledReason={this.state.clusteringDisabledReason} + hasJoins={this.props.hasJoins} + clearJoins={this.props.clearJoins} /> ); diff --git a/x-pack/plugins/maps/public/classes/sources/es_search_source/util/__snapshots__/scaling_form.test.tsx.snap b/x-pack/plugins/maps/public/classes/sources/es_search_source/util/__snapshots__/scaling_form.test.tsx.snap index 749d55aeb5da7..bafb3172bbc11 100644 --- a/x-pack/plugins/maps/public/classes/sources/es_search_source/util/__snapshots__/scaling_form.test.tsx.snap +++ b/x-pack/plugins/maps/public/classes/sources/es_search_source/util/__snapshots__/scaling_form.test.tsx.snap @@ -46,17 +46,7 @@ exports[`scaling form should disable clusters option when clustering is not supp /> - - - Use vector tiles for faster display of large datasets. - - } + content="Use vector tiles for faster display of large datasets." delay="regular" display="inlineBlock" position="left" @@ -127,17 +117,7 @@ exports[`scaling form should render 1`] = ` onChange={[Function]} /> - - - Use vector tiles for faster display of large datasets. - - } + content="Use vector tiles for faster display of large datasets." delay="regular" display="inlineBlock" position="left" diff --git a/x-pack/plugins/maps/public/classes/sources/es_search_source/util/scaling_form.test.tsx b/x-pack/plugins/maps/public/classes/sources/es_search_source/util/scaling_form.test.tsx index c02d855f13aa4..aa3c7b51df5bb 100644 --- a/x-pack/plugins/maps/public/classes/sources/es_search_source/util/scaling_form.test.tsx +++ b/x-pack/plugins/maps/public/classes/sources/es_search_source/util/scaling_form.test.tsx @@ -26,6 +26,8 @@ const defaultProps = { scalingType: SCALING_TYPES.LIMIT, supportsClustering: true, termFields: [], + hasJoins: false, + clearJoins: () => {}, }; describe('scaling form', () => { diff --git a/x-pack/plugins/maps/public/classes/sources/es_search_source/util/scaling_form.tsx b/x-pack/plugins/maps/public/classes/sources/es_search_source/util/scaling_form.tsx index 2d202e934cea9..896b493507322 100644 --- a/x-pack/plugins/maps/public/classes/sources/es_search_source/util/scaling_form.tsx +++ b/x-pack/plugins/maps/public/classes/sources/es_search_source/util/scaling_form.tsx @@ -7,15 +7,14 @@ import React, { Component, Fragment } from 'react'; import { + EuiConfirmModal, EuiFormRow, - EuiHorizontalRule, EuiRadio, EuiSpacer, EuiSwitch, EuiSwitchEvent, EuiTitle, EuiToolTip, - EuiBetaBadge, } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; import { FormattedMessage } from '@kbn/i18n/react'; @@ -35,15 +34,20 @@ interface Props { scalingType: SCALING_TYPES; supportsClustering: boolean; clusteringDisabledReason?: string | null; + hasJoins: boolean; + clearJoins: () => void; } interface State { + nextScalingType?: SCALING_TYPES; maxResultWindow: string; + showModal: boolean; } export class ScalingForm extends Component { - state = { + state: State = { maxResultWindow: DEFAULT_MAX_RESULT_WINDOW.toLocaleString(), + showModal: false, }; _isMounted = false; @@ -68,7 +72,15 @@ export class ScalingForm extends Component { } } - _onScalingTypeChange = (optionId: string): void => { + _onScalingTypeSelect = (optionId: SCALING_TYPES): void => { + if (this.props.hasJoins && optionId !== SCALING_TYPES.LIMIT) { + this._openModal(optionId); + } else { + this._onScalingTypeChange(optionId); + } + }; + + _onScalingTypeChange = (optionId: SCALING_TYPES): void => { let layerType; if (optionId === SCALING_TYPES.CLUSTERS) { layerType = LAYER_TYPE.BLENDED_VECTOR; @@ -85,6 +97,69 @@ export class ScalingForm extends Component { this.props.onChange({ propName: 'filterByMapBounds', value: event.target.checked }); }; + _openModal = (optionId: SCALING_TYPES) => { + this.setState({ + nextScalingType: optionId, + showModal: true, + }); + }; + + _closeModal = () => { + this.setState({ + nextScalingType: undefined, + showModal: false, + }); + }; + + _acceptModal = () => { + this.props.clearJoins(); + this._onScalingTypeChange(this.state.nextScalingType!); + this._closeModal(); + }; + + _renderModal() { + if (!this.state.showModal || this.state.nextScalingType === undefined) { + return null; + } + + const scalingOptionLabel = + this.state.nextScalingType === SCALING_TYPES.CLUSTERS + ? i18n.translate('xpack.maps.source.esSearch.scalingModal.clusters', { + defaultMessage: `clusters`, + }) + : i18n.translate('xpack.maps.source.esSearch.scalingModal.vectorTiles', { + defaultMessage: `vector tiles`, + }); + return ( + +

+ +

+
+ ); + } + _renderClusteringRadio() { const clusteringRadio = ( { values: { maxResultWindow: this.state.maxResultWindow }, })} checked={this.props.scalingType === SCALING_TYPES.CLUSTERS} - onChange={() => this._onScalingTypeChange(SCALING_TYPES.CLUSTERS)} + onChange={() => this._onScalingTypeSelect(SCALING_TYPES.CLUSTERS)} disabled={!this.props.supportsClustering} /> ); @@ -108,36 +183,6 @@ export class ScalingForm extends Component { ); } - _renderMVTRadio() { - const labelText = i18n.translate('xpack.maps.source.esSearch.useMVTVectorTiles', { - defaultMessage: 'Use vector tiles', - }); - const mvtRadio = ( - this._onScalingTypeChange(SCALING_TYPES.MVT)} - /> - ); - - const enabledInfo = ( - <> - - - {i18n.translate('xpack.maps.source.esSearch.mvtDescription', { - defaultMessage: 'Use vector tiles for faster display of large datasets.', - })} - - ); - - return ( - - {mvtRadio} - - ); - } - render() { let filterByBoundsSwitch; if (this.props.scalingType === SCALING_TYPES.LIMIT) { @@ -157,6 +202,7 @@ export class ScalingForm extends Component { return ( + {this._renderModal()}
@@ -174,10 +220,24 @@ export class ScalingForm extends Component { values: { maxResultWindow: this.state.maxResultWindow }, })} checked={this.props.scalingType === SCALING_TYPES.LIMIT} - onChange={() => this._onScalingTypeChange(SCALING_TYPES.LIMIT)} + onChange={() => this._onScalingTypeSelect(SCALING_TYPES.LIMIT)} /> {this._renderClusteringRadio()} - {this._renderMVTRadio()} + + this._onScalingTypeSelect(SCALING_TYPES.MVT)} + /> + diff --git a/x-pack/plugins/maps/public/classes/sources/es_source/es_source.ts b/x-pack/plugins/maps/public/classes/sources/es_source/es_source.ts index 0fa6335c1e0d9..ed95fdbb022fd 100644 --- a/x-pack/plugins/maps/public/classes/sources/es_source/es_source.ts +++ b/x-pack/plugins/maps/public/classes/sources/es_source/es_source.ts @@ -20,7 +20,7 @@ import { getDataViewNotFoundMessage } from '../../../../common/i18n_getters'; import { createExtentFilter } from '../../../../common/elasticsearch_util'; import { copyPersistentState } from '../../../reducers/copy_persistent_state'; import { DataRequestAbortError } from '../../util/data_request'; -import { expandToTileBoundaries } from '../../../../common/geo_tile_utils'; +import { expandToTileBoundaries } from '../../util/geo_tile_utils'; import { IVectorSource } from '../vector_source'; import { TimeRange } from '../../../../../../../src/plugins/data/common'; import { diff --git a/x-pack/plugins/maps/public/classes/sources/mvt_single_layer_vector_source/__snapshots__/mvt_field_config_editor.test.tsx.snap b/x-pack/plugins/maps/public/classes/sources/mvt_single_layer_vector_source/__snapshots__/mvt_field_config_editor.test.tsx.snap index f6d0129e85abf..b8f7af8b3844e 100644 --- a/x-pack/plugins/maps/public/classes/sources/mvt_single_layer_vector_source/__snapshots__/mvt_field_config_editor.test.tsx.snap +++ b/x-pack/plugins/maps/public/classes/sources/mvt_single_layer_vector_source/__snapshots__/mvt_field_config_editor.test.tsx.snap @@ -5,7 +5,6 @@ exports[`should render error for dupes 1`] = ` { _renderFieldConfig() { return this.state.currentFields.map((mvtFieldConfig: MVTFieldDescriptor, index: number) => { return ( - <> - + + {this._renderFieldNameInput(mvtFieldConfig, index)} {this._renderFieldTypeDropDown(mvtFieldConfig, index)} {this._renderFieldButtonDelete(index)} - + ); }); } diff --git a/x-pack/plugins/maps/public/classes/sources/mvt_single_layer_vector_source/mvt_single_layer_vector_source.tsx b/x-pack/plugins/maps/public/classes/sources/mvt_single_layer_vector_source/mvt_single_layer_vector_source.tsx index 34a30ae9ec977..387bb9c3ca1ff 100644 --- a/x-pack/plugins/maps/public/classes/sources/mvt_single_layer_vector_source/mvt_single_layer_vector_source.tsx +++ b/x-pack/plugins/maps/public/classes/sources/mvt_single_layer_vector_source/mvt_single_layer_vector_source.tsx @@ -82,6 +82,10 @@ export class MVTSingleLayerVectorSource .filter((f) => f !== null) as MVTField[]; } + isMvt() { + return true; + } + async supportsFitToBounds() { return false; } diff --git a/x-pack/plugins/maps/public/classes/sources/source.ts b/x-pack/plugins/maps/public/classes/sources/source.ts index 4c2cffcf8b070..0ecca16fde07b 100644 --- a/x-pack/plugins/maps/public/classes/sources/source.ts +++ b/x-pack/plugins/maps/public/classes/sources/source.ts @@ -29,8 +29,10 @@ export type OnSourceChangeArgs = { }; export type SourceEditorArgs = { - onChange: (...args: OnSourceChangeArgs[]) => void; - currentLayerType?: string; + clearJoins: () => void; + currentLayerType: string; + hasJoins: boolean; + onChange: (...args: OnSourceChangeArgs[]) => Promise; }; export type ImmutableSourceProperty = { @@ -43,6 +45,7 @@ export interface ISource { destroy(): void; getDisplayName(): Promise; getInspectorAdapters(): Adapters | undefined; + getType(): string; isFieldAware(): boolean; isFilterByMapBounds(): boolean; isGeoGridPrecisionAware(): boolean; @@ -101,6 +104,10 @@ export class AbstractSource implements ISource { return this._inspectorAdapters; } + getType(): string { + return this._descriptor.type; + } + async getDisplayName(): Promise { return ''; } diff --git a/x-pack/plugins/maps/public/classes/sources/vector_source/vector_source.tsx b/x-pack/plugins/maps/public/classes/sources/vector_source/vector_source.tsx index 3c0adf64216e6..7042374296bbe 100644 --- a/x-pack/plugins/maps/public/classes/sources/vector_source/vector_source.tsx +++ b/x-pack/plugins/maps/public/classes/sources/vector_source/vector_source.tsx @@ -9,7 +9,7 @@ import type { Query } from 'src/plugins/data/common'; import { FeatureCollection, GeoJsonProperties, Geometry, Position } from 'geojson'; import { Filter, TimeRange } from 'src/plugins/data/public'; import { VECTOR_SHAPE_TYPE } from '../../../../common/constants'; -import { TooltipProperty, ITooltipProperty } from '../../tooltips/tooltip_property'; +import { ITooltipProperty, TooltipProperty } from '../../tooltips/tooltip_property'; import { AbstractSource, ISource } from '../source'; import { IField } from '../../fields/field'; import { @@ -44,6 +44,7 @@ export interface BoundsRequestMeta { } export interface IVectorSource extends ISource { + isMvt(): boolean; getTooltipProperties(properties: GeoJsonProperties): Promise; getBoundsForFilters( layerDataFilters: BoundsRequestMeta, @@ -89,6 +90,10 @@ export class AbstractVectorSource extends AbstractSource implements IVectorSourc return []; } + isMvt() { + return false; + } + createField({ fieldName }: { fieldName: string }): IField { throw new Error('Not implemented'); } diff --git a/x-pack/plugins/maps/public/classes/styles/vector/components/__snapshots__/vector_style_editor.test.tsx.snap b/x-pack/plugins/maps/public/classes/styles/vector/components/__snapshots__/vector_style_editor.test.tsx.snap index 64da5777988d1..be8c9b0750b94 100644 --- a/x-pack/plugins/maps/public/classes/styles/vector/components/__snapshots__/vector_style_editor.test.tsx.snap +++ b/x-pack/plugins/maps/public/classes/styles/vector/components/__snapshots__/vector_style_editor.test.tsx.snap @@ -384,546 +384,6 @@ exports[`should render 1`] = ` `; -exports[`should render line-style with label properties when ES-source is rendered as mvt 1`] = ` - - - - - - - - - - - - - - - - - - - -`; - -exports[`should render polygon-style without label properties when 3rd party mvt 1`] = ` - - - - - - - - - - - -`; - exports[`should render with no style fields 1`] = ` { class MockField extends AbstractField {} -function createLayerMock( - numFields: number, - supportedShapeTypes: VECTOR_SHAPE_TYPE[], - layerType: LAYER_TYPE = LAYER_TYPE.VECTOR, - isESSource: boolean = false -) { +function createLayerMock(numFields: number, supportedShapeTypes: VECTOR_SHAPE_TYPE[]) { const fields: IField[] = []; for (let i = 0; i < numFields; i++) { fields.push(new MockField({ fieldName: `field${i}`, origin: FIELD_ORIGIN.SOURCE })); @@ -45,17 +39,11 @@ function createLayerMock( getStyleEditorFields: async () => { return fields; }, - getType() { - return layerType; - }, getSource: () => { return { getSupportedShapeTypes: async () => { return supportedShapeTypes; }, - isESSource() { - return isESSource; - }, } as unknown as IVectorSource; }, } as unknown as IVectorLayer; @@ -111,35 +99,3 @@ test('should render with no style fields', async () => { expect(component).toMatchSnapshot(); }); - -test('should render polygon-style without label properties when 3rd party mvt', async () => { - const component = shallow( - - ); - - // Ensure all promises resolve - await new Promise((resolve) => process.nextTick(resolve)); - // Ensure the state changes are reflected - component.update(); - - expect(component).toMatchSnapshot(); -}); - -test('should render line-style with label properties when ES-source is rendered as mvt', async () => { - const component = shallow( - - ); - - // Ensure all promises resolve - await new Promise((resolve) => process.nextTick(resolve)); - // Ensure the state changes are reflected - component.update(); - - expect(component).toMatchSnapshot(); -}); diff --git a/x-pack/plugins/maps/public/classes/styles/vector/components/vector_style_editor.tsx b/x-pack/plugins/maps/public/classes/styles/vector/components/vector_style_editor.tsx index d909f31315e7d..e11a560c8755f 100644 --- a/x-pack/plugins/maps/public/classes/styles/vector/components/vector_style_editor.tsx +++ b/x-pack/plugins/maps/public/classes/styles/vector/components/vector_style_editor.tsx @@ -25,7 +25,6 @@ import { DEFAULT_FILL_COLORS, DEFAULT_LINE_COLORS } from '../../color_palettes'; import { LABEL_BORDER_SIZES, - LAYER_TYPE, STYLE_TYPE, VECTOR_SHAPE_TYPE, VECTOR_STYLES, @@ -258,18 +257,7 @@ export class VectorStyleEditor extends Component { ); } - _renderLabelProperties(isPoints: boolean) { - if ( - !isPoints && - this.props.layer.getType() === LAYER_TYPE.TILED_VECTOR && - !this.props.layer.getSource().isESSource() - ) { - // This handles and edge-case - // 3rd party lines and polygons from mvt sources cannot be labeled, because they do not have label-centroid geometries inside the tile. - // These label-centroids are only added for ES-sources - return; - } - + _renderLabelProperties() { const hasLabel = this._hasLabel(); const hasLabelBorder = this._hasLabelBorder(); return ( @@ -468,7 +456,7 @@ export class VectorStyleEditor extends Component { /> - {this._renderLabelProperties(true)} + {this._renderLabelProperties()} ); } @@ -482,7 +470,7 @@ export class VectorStyleEditor extends Component { {this._renderLineWidth()} - {this._renderLabelProperties(false)} + {this._renderLabelProperties()} ); } @@ -499,7 +487,7 @@ export class VectorStyleEditor extends Component { {this._renderLineWidth()} - {this._renderLabelProperties(false)} + {this._renderLabelProperties()} ); } diff --git a/x-pack/plugins/maps/public/classes/styles/vector/properties/dynamic_color_property.tsx b/x-pack/plugins/maps/public/classes/styles/vector/properties/dynamic_color_property.tsx index 73f8736750656..bff053fc469a0 100644 --- a/x-pack/plugins/maps/public/classes/styles/vector/properties/dynamic_color_property.tsx +++ b/x-pack/plugins/maps/public/classes/styles/vector/properties/dynamic_color_property.tsx @@ -135,7 +135,7 @@ export class DynamicColorProperty extends DynamicStyleProperty extends IStyleProperty { getFieldMetaOptions(): FieldMetaOptions; getField(): IField | null; getFieldName(): string; + getMbFieldName(): string; getFieldOrigin(): FIELD_ORIGIN | null; getRangeFieldMeta(): RangeFieldMeta | null; getCategoryFieldMeta(): CategoryFieldMeta | null; @@ -63,7 +58,7 @@ export interface IDynamicStyleProperty extends IStyleProperty { getFieldMetaRequest(): Promise; pluckOrdinalStyleMetaFromFeatures(features: Feature[]): RangeFieldMeta | null; pluckCategoricalStyleMetaFromFeatures(features: Feature[]): CategoryFieldMeta | null; - pluckOrdinalStyleMetaFromTileMetaFeatures(features: TileMetaFeature[]): RangeFieldMeta | null; + pluckOrdinalStyleMetaFromTileMetaFeatures(metaFeatures: TileMetaFeature[]): RangeFieldMeta | null; pluckCategoricalStyleMetaFromTileMetaFeatures( features: TileMetaFeature[] ): CategoryFieldMeta | null; @@ -213,6 +208,10 @@ export class DynamicStyleProperty return this._field ? this._field.getName() : ''; } + getMbFieldName() { + return this._field ? this._field.getMbFieldName() : ''; + } + isDynamic() { return true; } @@ -314,54 +313,36 @@ export class DynamicStyleProperty return null; } - const name = this.getFieldName(); + const mbFieldName = this.getMbFieldName(); let min = Infinity; let max = -Infinity; for (let i = 0; i < metaFeatures.length; i++) { - const fieldMeta = metaFeatures[i].properties.fieldMeta; - if (fieldMeta && fieldMeta[name] && fieldMeta[name].range) { - min = Math.min(fieldMeta[name].range?.min as number, min); - max = Math.max(fieldMeta[name].range?.max as number, max); + const fieldMeta = metaFeatures[i].properties; + const minField = `aggregations.${mbFieldName}.min`; + const maxField = `aggregations.${mbFieldName}.max`; + if ( + fieldMeta && + typeof fieldMeta[minField] === 'number' && + typeof fieldMeta[maxField] === 'number' + ) { + min = Math.min(fieldMeta[minField] as number, min); + max = Math.max(fieldMeta[maxField] as number, max); } } - return { - min, - max, - delta: max - min, - }; + + return min === Infinity || max === -Infinity + ? null + : { + min, + max, + delta: max - min, + }; } pluckCategoricalStyleMetaFromTileMetaFeatures( metaFeatures: TileMetaFeature[] ): CategoryFieldMeta | null { - const size = this.getNumberOfCategories(); - if (!this.isCategorical() || size <= 0) { - return null; - } - - const name = this.getFieldName(); - - const counts = new Map(); - for (let i = 0; i < metaFeatures.length; i++) { - const fieldMeta = metaFeatures[i].properties.fieldMeta; - if (fieldMeta && fieldMeta[name] && fieldMeta[name].categories) { - const categoryFieldMeta: CategoryFieldMeta = fieldMeta[name] - .categories as CategoryFieldMeta; - for (let c = 0; c < categoryFieldMeta.categories.length; c++) { - const category: Category = categoryFieldMeta.categories[c]; - // properties object may be sparse, so need to check if the field is effectively present - if (typeof category.key !== undefined) { - if (counts.has(category.key)) { - counts.set(category.key, (counts.get(category.key) as number) + category.count); - } else { - counts.set(category.key, category.count); - } - } - } - } - } - - return trimCategories(counts, size); + return null; } pluckOrdinalStyleMetaFromFeatures(features: Feature[]): RangeFieldMeta | null { @@ -370,9 +351,24 @@ export class DynamicStyleProperty } const name = this.getFieldName(); - return pluckRangeFieldMeta(features, name, (rawValue: unknown) => { - return parseFloat(rawValue as string); - }); + let min = Infinity; + let max = -Infinity; + for (let i = 0; i < features.length; i++) { + const feature = features[i]; + const newValue = feature.properties ? parseFloat(feature.properties[name]) : NaN; + if (!isNaN(newValue)) { + min = Math.min(min, newValue); + max = Math.max(max, newValue); + } + } + + return min === Infinity || max === -Infinity + ? null + : { + min, + max, + delta: max - min, + }; } pluckCategoricalStyleMetaFromFeatures(features: Feature[]): CategoryFieldMeta | null { @@ -381,7 +377,32 @@ export class DynamicStyleProperty return null; } - return pluckCategoryFieldMeta(features, this.getFieldName(), size); + const counts = new Map(); + for (let i = 0; i < features.length; i++) { + const feature = features[i]; + const term = feature.properties ? feature.properties[this.getFieldName()] : undefined; + // properties object may be sparse, so need to check if the field is effectively present + if (typeof term !== undefined) { + if (counts.has(term)) { + counts.set(term, counts.get(term) + 1); + } else { + counts.set(term, 1); + } + } + } + + const ordered = []; + for (const [key, value] of counts) { + ordered.push({ key, count: value }); + } + + ordered.sort((a, b) => { + return b.count - a.count; + }); + const truncated = ordered.slice(0, size); + return { + categories: truncated, + } as CategoryFieldMeta; } _pluckOrdinalStyleMetaFromFieldMetaData(styleMetaData: StyleMetaData): RangeFieldMeta | null { @@ -487,7 +508,7 @@ export class DynamicStyleProperty targetName = getComputedFieldName(this.getStyleName(), this._field.getName()); } else { // Non-geojson sources (e.g. 3rd party mvt or ES-source as mvt) - targetName = this._field.getName(); + targetName = this._field.getMbFieldName(); } } return targetName; diff --git a/x-pack/plugins/maps/public/classes/styles/vector/vector_style.tsx b/x-pack/plugins/maps/public/classes/styles/vector/vector_style.tsx index 1e7267b9e1e32..058ee0db08d35 100644 --- a/x-pack/plugins/maps/public/classes/styles/vector/vector_style.tsx +++ b/x-pack/plugins/maps/public/classes/styles/vector/vector_style.tsx @@ -16,7 +16,6 @@ import { FIELD_ORIGIN, GEO_JSON_TYPE, KBN_IS_CENTROID_FEATURE, - KBN_VECTOR_SHAPE_TYPE_COUNTS, LAYER_STYLE_TYPE, SOURCE_FORMATTERS_DATA_REQUEST_ID, STYLE_TYPE, @@ -76,7 +75,6 @@ import { IVectorLayer } from '../../layers/vector_layer'; import { IVectorSource } from '../../sources/vector_source'; import { createStyleFieldsHelper, StyleFieldsHelper } from './style_fields_helper'; import { IESAggField } from '../../fields/agg'; -import { VectorShapeTypeCounts } from '../../../../common/get_geometry_counts'; const POINTS = [GEO_JSON_TYPE.POINT, GEO_JSON_TYPE.MULTI_POINT]; const LINES = [GEO_JSON_TYPE.LINE_STRING, GEO_JSON_TYPE.MULTI_LINE_STRING]; @@ -92,9 +90,8 @@ export interface IVectorStyle extends IStyle { previousFields: IField[], mapColors: string[] ): Promise<{ hasChanges: boolean; nextStyleDescriptor?: VectorStyleDescriptor }>; - isTimeAware: () => boolean; - getIcon: () => ReactElement; - getIconFromGeometryTypes: (isLinesOnly: boolean, isPointsOnly: boolean) => ReactElement; + isTimeAware(): boolean; + getIcon(): ReactElement; hasLegendDetails: () => Promise; renderLegendDetails: () => ReactElement; clearFeatureState: (featureCollection: FeatureCollection, mbMap: MbMap, sourceId: string) => void; @@ -492,50 +489,16 @@ export class VectorStyle implements IVectorStyle { } async pluckStyleMetaFromTileMeta(metaFeatures: TileMetaFeature[]): Promise { - const shapeTypeCountMeta: VectorShapeTypeCounts = metaFeatures.reduce( - (accumulator: VectorShapeTypeCounts, tileMeta: TileMetaFeature) => { - if ( - !tileMeta || - !tileMeta.properties || - !tileMeta.properties[KBN_VECTOR_SHAPE_TYPE_COUNTS] - ) { - return accumulator; - } - - accumulator[VECTOR_SHAPE_TYPE.POINT] += - tileMeta.properties[KBN_VECTOR_SHAPE_TYPE_COUNTS][VECTOR_SHAPE_TYPE.POINT]; - accumulator[VECTOR_SHAPE_TYPE.LINE] += - tileMeta.properties[KBN_VECTOR_SHAPE_TYPE_COUNTS][VECTOR_SHAPE_TYPE.LINE]; - accumulator[VECTOR_SHAPE_TYPE.POLYGON] += - tileMeta.properties[KBN_VECTOR_SHAPE_TYPE_COUNTS][VECTOR_SHAPE_TYPE.POLYGON]; - - return accumulator; - }, - { - [VECTOR_SHAPE_TYPE.POLYGON]: 0, - [VECTOR_SHAPE_TYPE.LINE]: 0, - [VECTOR_SHAPE_TYPE.POINT]: 0, - } - ); - - const isLinesOnly = - shapeTypeCountMeta[VECTOR_SHAPE_TYPE.LINE] > 0 && - shapeTypeCountMeta[VECTOR_SHAPE_TYPE.POINT] === 0 && - shapeTypeCountMeta[VECTOR_SHAPE_TYPE.POLYGON] === 0; - const isPointsOnly = - shapeTypeCountMeta[VECTOR_SHAPE_TYPE.LINE] === 0 && - shapeTypeCountMeta[VECTOR_SHAPE_TYPE.POINT] > 0 && - shapeTypeCountMeta[VECTOR_SHAPE_TYPE.POLYGON] === 0; - const isPolygonsOnly = - shapeTypeCountMeta[VECTOR_SHAPE_TYPE.LINE] === 0 && - shapeTypeCountMeta[VECTOR_SHAPE_TYPE.POINT] === 0 && - shapeTypeCountMeta[VECTOR_SHAPE_TYPE.POLYGON] > 0; - + const supportedShapeTypes = await this._source.getSupportedShapeTypes(); const styleMeta: StyleMetaDescriptor = { geometryTypes: { - isPointsOnly, - isLinesOnly, - isPolygonsOnly, + isPointsOnly: + supportedShapeTypes.length === 1 && supportedShapeTypes.includes(VECTOR_SHAPE_TYPE.POINT), + isLinesOnly: + supportedShapeTypes.length === 1 && supportedShapeTypes.includes(VECTOR_SHAPE_TYPE.LINE), + isPolygonsOnly: + supportedShapeTypes.length === 1 && + supportedShapeTypes.includes(VECTOR_SHAPE_TYPE.POLYGON), }, fieldMeta: {}, }; @@ -737,7 +700,7 @@ export class VectorStyle implements IVectorStyle { : (this._iconStyleProperty as StaticIconProperty).getOptions().value; } - getIconFromGeometryTypes(isLinesOnly: boolean, isPointsOnly: boolean) { + _getIconFromGeometryTypes(isLinesOnly: boolean, isPointsOnly: boolean) { let strokeColor; if (isLinesOnly) { strokeColor = extractColorFromStyleProperty( @@ -771,7 +734,7 @@ export class VectorStyle implements IVectorStyle { getIcon() { const isLinesOnly = this._getIsLinesOnly(); const isPointsOnly = this._getIsPointsOnly(); - return this.getIconFromGeometryTypes(isLinesOnly, isPointsOnly); + return this._getIconFromGeometryTypes(isLinesOnly, isPointsOnly); } _getLegendDetailStyleProperties = () => { diff --git a/x-pack/plugins/maps/common/geo_tile_utils.test.js b/x-pack/plugins/maps/public/classes/util/geo_tile_utils.test.ts similarity index 100% rename from x-pack/plugins/maps/common/geo_tile_utils.test.js rename to x-pack/plugins/maps/public/classes/util/geo_tile_utils.test.ts diff --git a/x-pack/plugins/maps/common/geo_tile_utils.ts b/x-pack/plugins/maps/public/classes/util/geo_tile_utils.ts similarity index 95% rename from x-pack/plugins/maps/common/geo_tile_utils.ts rename to x-pack/plugins/maps/public/classes/util/geo_tile_utils.ts index 1a8ac3cbe17ae..6e82d3b509565 100644 --- a/x-pack/plugins/maps/common/geo_tile_utils.ts +++ b/x-pack/plugins/maps/public/classes/util/geo_tile_utils.ts @@ -6,9 +6,9 @@ */ import _ from 'lodash'; -import { DECIMAL_DEGREES_PRECISION } from './constants'; -import { clampToLatBounds } from './elasticsearch_util'; -import { MapExtent } from './descriptor_types'; +import { DECIMAL_DEGREES_PRECISION } from '../../../common/constants'; +import { clampToLatBounds } from '../../../common/elasticsearch_util'; +import { MapExtent } from '../../../common/descriptor_types'; const ZOOM_TILE_KEY_INDEX = 0; const X_TILE_KEY_INDEX = 1; diff --git a/x-pack/plugins/maps/public/classes/util/mb_filter_expressions.ts b/x-pack/plugins/maps/public/classes/util/mb_filter_expressions.ts index 68efd416718fd..544b2697cab43 100644 --- a/x-pack/plugins/maps/public/classes/util/mb_filter_expressions.ts +++ b/x-pack/plugins/maps/public/classes/util/mb_filter_expressions.ts @@ -9,7 +9,6 @@ import { GEO_JSON_TYPE, FEATURE_VISIBLE_PROPERTY_NAME, KBN_IS_CENTROID_FEATURE, - KBN_METADATA_FEATURE, } from '../../../common/constants'; import { Timeslice } from '../../../common/descriptor_types'; @@ -19,7 +18,6 @@ export interface TimesliceMaskConfig { timeslice: Timeslice; } -export const EXCLUDE_TOO_MANY_FEATURES_BOX = ['!=', ['get', KBN_METADATA_FEATURE], true]; export const EXCLUDE_CENTROID_FEATURES = ['!=', ['get', KBN_IS_CENTROID_FEATURE], true]; function getFilterExpression( @@ -56,7 +54,6 @@ export function getFillFilterExpression( ): unknown[] { return getFilterExpression( [ - EXCLUDE_TOO_MANY_FEATURES_BOX, EXCLUDE_CENTROID_FEATURES, [ 'any', @@ -75,7 +72,6 @@ export function getLineFilterExpression( ): unknown[] { return getFilterExpression( [ - EXCLUDE_TOO_MANY_FEATURES_BOX, EXCLUDE_CENTROID_FEATURES, [ 'any', @@ -96,7 +92,6 @@ export function getPointFilterExpression( ): unknown[] { return getFilterExpression( [ - EXCLUDE_TOO_MANY_FEATURES_BOX, EXCLUDE_CENTROID_FEATURES, [ 'any', @@ -109,13 +104,17 @@ export function getPointFilterExpression( ); } -export function getCentroidFilterExpression( +export function getLabelFilterExpression( hasJoins: boolean, + isSourceGeoJson: boolean, timesliceMaskConfig?: TimesliceMaskConfig ): unknown[] { - return getFilterExpression( - [EXCLUDE_TOO_MANY_FEATURES_BOX, ['==', ['get', KBN_IS_CENTROID_FEATURE], true]], - hasJoins, - timesliceMaskConfig - ); + const filters: unknown[] = []; + + // centroids added for geojson sources only + if (isSourceGeoJson) { + filters.push(['==', ['get', KBN_IS_CENTROID_FEATURE], true]); + } + + return getFilterExpression(filters, hasJoins, timesliceMaskConfig); } diff --git a/x-pack/plugins/maps/public/connected_components/edit_layer_panel/__snapshots__/edit_layer_panel.test.tsx.snap b/x-pack/plugins/maps/public/connected_components/edit_layer_panel/__snapshots__/edit_layer_panel.test.tsx.snap index 5fb1cc6f72585..1a3e97ee4fae1 100644 --- a/x-pack/plugins/maps/public/connected_components/edit_layer_panel/__snapshots__/edit_layer_panel.test.tsx.snap +++ b/x-pack/plugins/maps/public/connected_components/edit_layer_panel/__snapshots__/edit_layer_panel.test.tsx.snap @@ -98,7 +98,9 @@ exports[`EditLayerPanel is rendered 1`] = ` "getId": [Function], "getImmutableSourceProperties": [Function], "getLayerTypeIconName": [Function], + "getType": [Function], "hasErrors": [Function], + "hasJoins": [Function], "renderSourceSettingsEditor": [Function], "showJoinEditor": [Function], "supportsElasticsearchFilters": [Function], @@ -119,7 +121,9 @@ exports[`EditLayerPanel is rendered 1`] = ` "getId": [Function], "getImmutableSourceProperties": [Function], "getLayerTypeIconName": [Function], + "getType": [Function], "hasErrors": [Function], + "hasJoins": [Function], "renderSourceSettingsEditor": [Function], "showJoinEditor": [Function], "supportsElasticsearchFilters": [Function], diff --git a/x-pack/plugins/maps/public/connected_components/edit_layer_panel/edit_layer_panel.test.tsx b/x-pack/plugins/maps/public/connected_components/edit_layer_panel/edit_layer_panel.test.tsx index e66dc8a10948f..82795b8bd9317 100644 --- a/x-pack/plugins/maps/public/connected_components/edit_layer_panel/edit_layer_panel.test.tsx +++ b/x-pack/plugins/maps/public/connected_components/edit_layer_panel/edit_layer_panel.test.tsx @@ -48,6 +48,7 @@ jest.mock('../../kibana_services', () => { import React from 'react'; import { shallow } from 'enzyme'; +import { LAYER_TYPE } from '../../../common/constants'; import { ILayer } from '../../classes/layers/layer'; import { EditLayerPanel } from './edit_layer_panel'; @@ -55,6 +56,9 @@ const mockLayer = { getId: () => { return '1'; }, + getType: () => { + return LAYER_TYPE.VECTOR; + }, getDisplayName: () => { return 'layer 1'; }, @@ -79,6 +83,9 @@ const mockLayer = { hasErrors: () => { return false; }, + hasJoins: () => { + return false; + }, supportsFitToBounds: () => { return true; }, @@ -87,7 +94,8 @@ const mockLayer = { const defaultProps = { selectedLayer: mockLayer, fitToBounds: () => {}, - updateSourceProp: () => {}, + updateSourceProps: async () => {}, + clearJoins: () => {}, }; describe('EditLayerPanel', () => { diff --git a/x-pack/plugins/maps/public/connected_components/edit_layer_panel/edit_layer_panel.tsx b/x-pack/plugins/maps/public/connected_components/edit_layer_panel/edit_layer_panel.tsx index 424c4b8e16bec..7ba2f74ddc7d9 100644 --- a/x-pack/plugins/maps/public/connected_components/edit_layer_panel/edit_layer_panel.tsx +++ b/x-pack/plugins/maps/public/connected_components/edit_layer_panel/edit_layer_panel.tsx @@ -30,7 +30,6 @@ import { StyleSettings } from './style_settings'; import { KibanaContextProvider } from '../../../../../../src/plugins/kibana_react/public'; import { Storage } from '../../../../../../src/plugins/kibana_utils/public'; -import { LAYER_TYPE } from '../../../common/constants'; import { getData, getCore } from '../../kibana_services'; import { ILayer } from '../../classes/layers/layer'; import { isVectorLayer, IVectorLayer } from '../../classes/layers/vector_layer'; @@ -40,13 +39,9 @@ import { IField } from '../../classes/fields/field'; const localStorage = new Storage(window.localStorage); export interface Props { + clearJoins: (layer: ILayer) => void; selectedLayer?: ILayer; - updateSourceProp: ( - layerId: string, - propName: string, - value: unknown, - newLayerType?: LAYER_TYPE - ) => void; + updateSourceProps: (layerId: string, sourcePropChanges: OnSourceChangeArgs[]) => Promise; } interface State { @@ -141,9 +136,12 @@ export class EditLayerPanel extends Component { } _onSourceChange = (...args: OnSourceChangeArgs[]) => { - for (let i = 0; i < args.length; i++) { - const { propName, value, newLayerType } = args[i]; - this.props.updateSourceProp(this.props.selectedLayer!.getId(), propName, value, newLayerType); + return this.props.updateSourceProps(this.props.selectedLayer!.getId(), args); + }; + + _clearJoins = () => { + if (this.props.selectedLayer) { + this.props.clearJoins(this.props.selectedLayer); } }; @@ -279,6 +277,11 @@ export class EditLayerPanel extends Component { /> {this.props.selectedLayer.renderSourceSettingsEditor({ + clearJoins: this._clearJoins, + currentLayerType: this.props.selectedLayer.getType(), + hasJoins: isVectorLayer(this.props.selectedLayer) + ? (this.props.selectedLayer as IVectorLayer).hasJoins() + : false, onChange: this._onSourceChange, })} diff --git a/x-pack/plugins/maps/public/connected_components/edit_layer_panel/index.ts b/x-pack/plugins/maps/public/connected_components/edit_layer_panel/index.ts index 84caa45741a62..5f9a920d38494 100644 --- a/x-pack/plugins/maps/public/connected_components/edit_layer_panel/index.ts +++ b/x-pack/plugins/maps/public/connected_components/edit_layer_panel/index.ts @@ -9,11 +9,12 @@ import { AnyAction } from 'redux'; import { ThunkDispatch } from 'redux-thunk'; import { connect } from 'react-redux'; import { EditLayerPanel } from './edit_layer_panel'; -import { LAYER_TYPE } from '../../../common/constants'; import { getSelectedLayer } from '../../selectors/map_selectors'; -import { updateSourceProp } from '../../actions'; +import { setJoinsForLayer, updateSourceProps } from '../../actions'; import { MapStoreState } from '../../reducers/store'; +import { ILayer } from '../../classes/layers/layer'; import { isVectorLayer, IVectorLayer } from '../../classes/layers/vector_layer'; +import { OnSourceChangeArgs } from '../../classes/sources/source'; function mapStateToProps(state: MapStoreState) { const selectedLayer = getSelectedLayer(state); @@ -31,8 +32,11 @@ function mapStateToProps(state: MapStoreState) { function mapDispatchToProps(dispatch: ThunkDispatch) { return { - updateSourceProp: (id: string, propName: string, value: unknown, newLayerType?: LAYER_TYPE) => - dispatch(updateSourceProp(id, propName, value, newLayerType)), + clearJoins: (layer: ILayer) => { + dispatch(setJoinsForLayer(layer, [])); + }, + updateSourceProps: async (id: string, sourcePropChanges: OnSourceChangeArgs[]) => + await dispatch(updateSourceProps(id, sourcePropChanges)), }; } diff --git a/x-pack/plugins/maps/public/connected_components/edit_layer_panel/join_editor/join_editor.tsx b/x-pack/plugins/maps/public/connected_components/edit_layer_panel/join_editor/join_editor.tsx index e99ec6a688092..24cdd9b7dc813 100644 --- a/x-pack/plugins/maps/public/connected_components/edit_layer_panel/join_editor/join_editor.tsx +++ b/x-pack/plugins/maps/public/connected_components/edit_layer_panel/join_editor/join_editor.tsx @@ -90,9 +90,7 @@ export function JoinEditor({ joins, layer, onChange, leftJoinFields, layerDispla ) : ( {renderJoins()} - - { ] as [MbPoint, MbPoint]; const selectedFeatures = this.props.mbMap.queryRenderedFeatures(mbBbox, { layers: mbEditLayerIds, - filter: ['all', EXCLUDE_TOO_MANY_FEATURES_BOX, EXCLUDE_CENTROID_FEATURES], + filter: ['all', EXCLUDE_CENTROID_FEATURES], }); if (!selectedFeatures.length) { return; diff --git a/x-pack/plugins/maps/public/connected_components/mb_map/mb_map.tsx b/x-pack/plugins/maps/public/connected_components/mb_map/mb_map.tsx index 053e410b8c712..93dfebecd1c34 100644 --- a/x-pack/plugins/maps/public/connected_components/mb_map/mb_map.tsx +++ b/x-pack/plugins/maps/public/connected_components/mb_map/mb_map.tsx @@ -33,7 +33,6 @@ import { } from '../../../common/descriptor_types'; import { DECIMAL_DEGREES_PRECISION, - KBN_TOO_MANY_FEATURES_IMAGE_ID, LAYER_TYPE, RawValue, ZOOM_PRECISION, @@ -209,14 +208,6 @@ export class MbMap extends Component { }, }); - const tooManyFeaturesImageSrc = - 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAA7DgAAOw4BzLahgwAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAARLSURBVHic7ZnPbxRVAMe/7735sWO3293ZlUItJsivCxEE0oTYRgu1FqTQoFSwKTYx8SAH/wHjj4vRozGGi56sMcW2UfqTEuOhppE0KJc2GIuKQFDY7qzdtrudX88D3YTUdFuQN8+k87ltZt7uZz958/bNLAGwBWsYKltANmEA2QKyCQPIFpBNGEC2gGzCALIFZBMGkC0gmzCAbAHZhAFkC8gmDCBbQDZhANkCslnzARQZH6oDpNs0D5UDSUIInePcOpPLfdfnODNBuwQWIAWwNOABwHZN0x8npE6hNLJ4DPWRyFSf40wE5VOEQPBjcR0g3YlE4ybGmtK+/1NzJtOZA/xSYwZMs3nG962T2ez3It2AANaA/kSidYuivOQBs5WM1fUnk6f0u+GXJUqIuUtVXx00zRbRfkIDfBqL7a1WlIYbjvNtTTr99jXXHVpH6dMjK0R4cXq6c9rzxjcx9sKX8XitSEdhAToMI7VP10/97fsTh7PZrgWAN1lW72KE2vOm2b5chDTgtWQyn93x/bEEIetEOQIC14CxVOr1CkKefH929t0v8vn0vcdGEoljGxXl4C3PGz2YyXy+AHARDqtByAxoUdWKBKV70r4/vvTLA0CjZfX+5nkDGxirKzUTgkBIgNaysh3gnF627R+XO+dQJvP1ddcdrmSsbtA020pF+CAW21qrqmUiXIUEqGRsIwD0FQq/lzqv0bJ6rrvucBVjzwyb5ivLRTiiaW+8VV7eIEBVTAANiIIQd9RxZlc6t9Gyem647vn1jD07ZJonl4sQASoevqmgABzwwHnJzc69PGdZ3X+47sgGxuqHTPPE0ggeVtg5/QeEBMhxPg1Aa1DV2GrHPG9ZXy1G2D+wNALn9jyQEeHKAJgP+033Kgrdqij7AFwZtu3bqx3XWShMHtV1o1pRGo4YxiNd+fyEB2DKdX/4aG5u0hbwcylkBryTy/3scT6zW9Nq7ndso2Wdvea6Q1WUHuiPx1/WAXLBcWZXun94UMRcAoD/p+ddTFK6u8MwUvc7vsmyem+67oVqVT0wkEgcF+FYRNhW+L25uX6f84XThtHxIBudE5bVY/t++jFVrU/dvVSFICzAqG3PX/S8rihj2/61qK1AOUB7ksl2jdLUL7Z9rvgcQQRCFsEi5wqFmw26XnhCUQ63GcZmCly95Lrzpca0G0byk3j8tEnpU1c975tmyxoU5QcE8EAEAM5WVOzfoarHAeC2749dcpzxMwsLv07Ztg0AOzVNf03Ttu/S9T2PMlbjc25fdpyutmx2TLRbIAEA4M1otKo1EjmaoHQn4ZwBgA/kAVAK6MXXdzxv/ONcrq/HcbJBeAUWoEizqsaORaPbKglZrxMSZZyrM76f/ovzWx/m85PFWREUgQf4v7Hm/xcIA8gWkE0YQLaAbMIAsgVkEwaQLSCbMIBsAdmEAWQLyCYMIFtANmEA2QKyCQPIFpDNmg/wD3OFdEybUvJjAAAAAElFTkSuQmCC'; - const tooManyFeaturesImage = new Image(); - tooManyFeaturesImage.onload = () => { - mbMap.addImage(KBN_TOO_MANY_FEATURES_IMAGE_ID, tooManyFeaturesImage); - }; - tooManyFeaturesImage.src = tooManyFeaturesImageSrc; - let emptyImage: HTMLImageElement; mbMap.on('styleimagemissing', (e: unknown) => { if (emptyImage) { diff --git a/x-pack/plugins/maps/public/connected_components/mb_map/tooltip_control/tooltip_control.test.tsx b/x-pack/plugins/maps/public/connected_components/mb_map/tooltip_control/tooltip_control.test.tsx index 7e79113d6b242..04b1d2205644f 100644 --- a/x-pack/plugins/maps/public/connected_components/mb_map/tooltip_control/tooltip_control.test.tsx +++ b/x-pack/plugins/maps/public/connected_components/mb_map/tooltip_control/tooltip_control.test.tsx @@ -36,6 +36,19 @@ const mockLayer = { canShowTooltip: () => { return true; }, + getMbTooltipLayerIds: () => { + return ['foo', 'bar']; + }, + getSource: () => { + return { + isMvt: () => { + return false; + }, + isESSource: () => { + return false; + }, + }; + }, getFeatureById: () => { return { geometry: { diff --git a/x-pack/plugins/maps/public/connected_components/mb_map/tooltip_control/tooltip_control.tsx b/x-pack/plugins/maps/public/connected_components/mb_map/tooltip_control/tooltip_control.tsx index c2ad75d9cb335..c2b89e64a449b 100644 --- a/x-pack/plugins/maps/public/connected_components/mb_map/tooltip_control/tooltip_control.tsx +++ b/x-pack/plugins/maps/public/connected_components/mb_map/tooltip_control/tooltip_control.tsx @@ -19,12 +19,7 @@ import uuid from 'uuid/v4'; import { Geometry } from 'geojson'; import { Filter } from 'src/plugins/data/public'; import { ActionExecutionContext, Action } from 'src/plugins/ui_actions/public'; -import { - FEATURE_ID_PROPERTY_NAME, - GEO_JSON_TYPE, - LON_INDEX, - RawValue, -} from '../../../../common/constants'; +import { GEO_JSON_TYPE, LON_INDEX, RawValue } from '../../../../common/constants'; import { GEOMETRY_FILTER_ACTION, TooltipFeature, @@ -33,9 +28,8 @@ import { } from '../../../../common/descriptor_types'; import { TooltipPopover } from './tooltip_popover'; import { FeatureGeometryFilterForm } from './features_tooltip'; -import { EXCLUDE_TOO_MANY_FEATURES_BOX } from '../../../classes/util/mb_filter_expressions'; import { ILayer } from '../../../classes/layers/layer'; -import { IVectorLayer, isVectorLayer } from '../../../classes/layers/vector_layer'; +import { IVectorLayer, isVectorLayer, getFeatureId } from '../../../classes/layers/vector_layer'; import { RenderToolTipContent } from '../../../classes/tooltips/tooltip_property'; function justifyAnchorLocation( @@ -132,7 +126,13 @@ export class TooltipControl extends Component { }) as IVectorLayer; } - _loadPreIndexedShape = async ({ layerId, featureId }: { layerId: string; featureId: string }) => { + _loadPreIndexedShape = async ({ + layerId, + featureId, + }: { + layerId: string; + featureId?: string | number; + }) => { const tooltipLayer = this._findLayerById(layerId); if (!tooltipLayer || typeof featureId === 'undefined') { return null; @@ -152,7 +152,7 @@ export class TooltipControl extends Component { tooltipId, }: { layerId: string; - featureId: string; + featureId?: string | number; tooltipId: string; }): TooltipFeatureAction[] { const actions = []; @@ -203,7 +203,8 @@ export class TooltipControl extends Component { if (!layer) { break; } - const featureId = mbFeature.properties?.[FEATURE_ID_PROPERTY_NAME]; + + const featureId = getFeatureId(mbFeature, layer.getSource()); const layerId = layer.getId(); let match = false; for (let j = 0; j < uniqueFeatures.length; j++) { @@ -284,9 +285,10 @@ export class TooltipControl extends Component { } const targetMbFeature = mbFeatures[0]; - if (this.props.openTooltips[0] && this.props.openTooltips[0].features.length) { + const layer = this._getLayerByMbLayerId(targetMbFeature.layer.id); + if (layer && this.props.openTooltips[0] && this.props.openTooltips[0].features.length) { const firstFeature = this.props.openTooltips[0].features[0]; - if (targetMbFeature.properties?.[FEATURE_ID_PROPERTY_NAME] === firstFeature.id) { + if (getFeatureId(targetMbFeature, layer.getSource()) === firstFeature.id) { // ignore hover events when hover tooltip is all ready opened for feature return; } @@ -312,7 +314,7 @@ export class TooltipControl extends Component { (accumulator: string[], layer: ILayer) => { // tooltips are only supported for vector layers, filter out all other layer types return layer.isVisible() && isVectorLayer(layer) - ? accumulator.concat(layer.getMbLayerIds()) + ? accumulator.concat((layer as IVectorLayer).getMbTooltipLayerIds()) : accumulator; }, [] @@ -347,7 +349,6 @@ export class TooltipControl extends Component { ] as [MbPoint, MbPoint]; return this.props.mbMap.queryRenderedFeatures(mbBbox, { layers: mbLayerIds, - filter: EXCLUDE_TOO_MANY_FEATURES_BOX, }); } diff --git a/x-pack/plugins/maps/server/kibana_server_services.ts b/x-pack/plugins/maps/server/kibana_server_services.ts index e3c612f415c4d..f5bd4dad085d8 100644 --- a/x-pack/plugins/maps/server/kibana_server_services.ts +++ b/x-pack/plugins/maps/server/kibana_server_services.ts @@ -20,14 +20,17 @@ export const setInternalRepository = ( }; export const getInternalRepository = () => internalRepository; +let esClient: ElasticsearchClient; let indexPatternsService: IndexPatternsCommonService; export const setIndexPatternsService = async ( indexPatternsServiceFactory: IndexPatternsServiceStart['indexPatternsServiceFactory'], elasticsearchClient: ElasticsearchClient ) => { + esClient = elasticsearchClient; indexPatternsService = await indexPatternsServiceFactory( new SavedObjectsClient(getInternalRepository()), elasticsearchClient ); }; export const getIndexPatternsService = () => indexPatternsService; +export const getESClient = () => esClient; diff --git a/x-pack/plugins/maps/server/mvt/get_grid_tile.ts b/x-pack/plugins/maps/server/mvt/get_grid_tile.ts new file mode 100644 index 0000000000000..cfc894d512450 --- /dev/null +++ b/x-pack/plugins/maps/server/mvt/get_grid_tile.ts @@ -0,0 +1,64 @@ +/* + * 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; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { Logger } from 'src/core/server'; +import type { DataRequestHandlerContext } from 'src/plugins/data/server'; +import { RENDER_AS } from '../../common/constants'; + +function isAbortError(error: Error) { + return error.message === 'Request aborted' || error.message === 'Aborted'; +} + +export async function getEsGridTile({ + logger, + context, + index, + geometryFieldName, + x, + y, + z, + requestBody = {}, + requestType = RENDER_AS.POINT, +}: { + x: number; + y: number; + z: number; + geometryFieldName: string; + index: string; + context: DataRequestHandlerContext; + logger: Logger; + requestBody: any; + requestType: RENDER_AS.GRID | RENDER_AS.POINT; +}): Promise { + try { + const path = `/${encodeURIComponent(index)}/_mvt/${geometryFieldName}/${z}/${x}/${y}`; + const body = { + size: 0, // no hits + grid_precision: 7, + exact_bounds: false, + extent: 4096, // full resolution, + query: requestBody.query, + grid_type: requestType === RENDER_AS.GRID ? 'grid' : 'centroid', + aggs: requestBody.aggs, + fields: requestBody.fields, + runtime_mappings: requestBody.runtime_mappings, + }; + const tile = await context.core.elasticsearch.client.asCurrentUser.transport.request({ + method: 'GET', + path, + body, + }); + return tile.body as unknown as Buffer; + } catch (e) { + if (!isAbortError(e)) { + // These are often circuit breaking exceptions + // Should return a tile with some error message + logger.warn(`Cannot generate ES-grid-tile for ${z}/${x}/${y}: ${e.message}`); + } + return null; + } +} diff --git a/x-pack/plugins/maps/server/mvt/get_tile.ts b/x-pack/plugins/maps/server/mvt/get_tile.ts index 11e1af5a7d368..0864b373af3f8 100644 --- a/x-pack/plugins/maps/server/mvt/get_tile.ts +++ b/x-pack/plugins/maps/server/mvt/get_tile.ts @@ -5,53 +5,15 @@ * 2.0. */ -// @ts-expect-error -import geojsonvt from 'geojson-vt'; -// @ts-expect-error -import vtpbf from 'vt-pbf'; +import _ from 'lodash'; import { Logger } from 'src/core/server'; import type { DataRequestHandlerContext } from 'src/plugins/data/server'; -import { Feature, FeatureCollection, Polygon } from 'geojson'; -import { countVectorShapeTypes } from '../../common/get_geometry_counts'; -import { - COUNT_PROP_NAME, - ES_GEO_FIELD_TYPE, - FEATURE_ID_PROPERTY_NAME, - GEOTILE_GRID_AGG_NAME, - KBN_FEATURE_COUNT, - KBN_IS_TILE_COMPLETE, - KBN_METADATA_FEATURE, - KBN_VECTOR_SHAPE_TYPE_COUNTS, - MAX_ZOOM, - MVT_SOURCE_LAYER_NAME, - RENDER_AS, - SUPER_FINE_ZOOM_DELTA, - VECTOR_SHAPE_TYPE, -} from '../../common/constants'; - -import { - createExtentFilter, - convertRegularRespToGeoJson, - hitsToGeoJson, - isTotalHitsGreaterThan, - formatEnvelopeAsPolygon, - TotalHits, -} from '../../common/elasticsearch_util'; -import { flattenHit } from './util'; -import { ESBounds, tileToESBbox } from '../../common/geo_tile_utils'; -import { getCentroidFeatures } from '../../common/get_centroid_features'; -import { pluckRangeFieldMeta } from '../../common/pluck_range_field_meta'; -import { FieldMeta, TileMetaFeature } from '../../common/descriptor_types'; -import { pluckCategoryFieldMeta } from '../../common/pluck_category_field_meta'; - -// heuristic. largest color-palette has 30 colors. 1 color is used for 'other'. -const TERM_COUNT = 30 - 1; function isAbortError(error: Error) { return error.message === 'Request aborted' || error.message === 'Aborted'; } -export async function getGridTile({ +export async function getEsTile({ logger, context, index, @@ -60,9 +22,6 @@ export async function getGridTile({ y, z, requestBody = {}, - requestType = RENDER_AS.POINT, - searchSessionId, - abortSignal, }: { x: number; y: number; @@ -72,388 +31,32 @@ export async function getGridTile({ context: DataRequestHandlerContext; logger: Logger; requestBody: any; - requestType: RENDER_AS.GRID | RENDER_AS.POINT; - geoFieldType: ES_GEO_FIELD_TYPE; - searchSessionId?: string; - abortSignal: AbortSignal; }): Promise { try { - const tileBounds: ESBounds = tileToESBbox(x, y, z); - requestBody.query.bool.filter.push(getTileSpatialFilter(geometryFieldName, tileBounds)); - requestBody.aggs[GEOTILE_GRID_AGG_NAME].geotile_grid.precision = Math.min( - z + SUPER_FINE_ZOOM_DELTA, - MAX_ZOOM - ); - requestBody.aggs[GEOTILE_GRID_AGG_NAME].geotile_grid.bounds = tileBounds; - requestBody.track_total_hits = false; - - const response = await context - .search!.search( - { - params: { - index, - body: requestBody, - }, - }, - { - sessionId: searchSessionId, - legacyHitsTotal: false, - abortSignal, - } - ) - .toPromise(); - const features: Feature[] = convertRegularRespToGeoJson(response.rawResponse, requestType); - - if (features.length) { - const bounds = formatEnvelopeAsPolygon({ - maxLat: tileBounds.top_left.lat, - minLat: tileBounds.bottom_right.lat, - maxLon: tileBounds.bottom_right.lon, - minLon: tileBounds.top_left.lon, - }); - - const fieldNames = new Set(); - features.forEach((feature) => { - for (const key in feature.properties) { - if (feature.properties.hasOwnProperty(key) && key !== 'key' && key !== 'gridCentroid') { - fieldNames.add(key); - } - } - }); - - const fieldMeta: FieldMeta = {}; - fieldNames.forEach((fieldName: string) => { - const rangeMeta = pluckRangeFieldMeta(features, fieldName, (rawValue: unknown) => { - if (fieldName === COUNT_PROP_NAME) { - return parseFloat(rawValue as string); - } else if (typeof rawValue === 'number') { - return rawValue; - } else if (rawValue) { - return parseFloat((rawValue as { value: string }).value); - } else { - return NaN; - } - }); - - const categoryMeta = pluckCategoryFieldMeta(features, fieldName, TERM_COUNT); - - if (!fieldMeta[fieldName]) { - fieldMeta[fieldName] = {}; - } - - if (rangeMeta) { - fieldMeta[fieldName].range = rangeMeta; - } - - if (categoryMeta) { - fieldMeta[fieldName].categories = categoryMeta; - } - }); - - const metaDataFeature: TileMetaFeature = { - type: 'Feature', - properties: { - [KBN_METADATA_FEATURE]: true, - [KBN_FEATURE_COUNT]: features.length, - [KBN_IS_TILE_COMPLETE]: true, - [KBN_VECTOR_SHAPE_TYPE_COUNTS]: - requestType === RENDER_AS.GRID - ? { - [VECTOR_SHAPE_TYPE.POINT]: 0, - [VECTOR_SHAPE_TYPE.LINE]: 0, - [VECTOR_SHAPE_TYPE.POLYGON]: features.length, - } - : { - [VECTOR_SHAPE_TYPE.POINT]: features.length, - [VECTOR_SHAPE_TYPE.LINE]: 0, - [VECTOR_SHAPE_TYPE.POLYGON]: 0, - }, - fieldMeta, - }, - geometry: bounds, - }; - - features.push(metaDataFeature); - } - - const featureCollection: FeatureCollection = { - features, - type: 'FeatureCollection', + const path = `/${encodeURIComponent(index)}/_mvt/${geometryFieldName}/${z}/${x}/${y}`; + let fields = _.uniq(requestBody.docvalue_fields.concat(requestBody.stored_fields)); + fields = fields.filter((f) => f !== geometryFieldName); + const body = { + grid_precision: 0, // no aggs + exact_bounds: true, + extent: 4096, // full resolution, + query: requestBody.query, + fields, + runtime_mappings: requestBody.runtime_mappings, + track_total_hits: requestBody.size + 1, }; - - return createMvtTile(featureCollection, z, x, y); + const tile = await context.core.elasticsearch.client.asCurrentUser.transport.request({ + method: 'GET', + path, + body, + }); + return tile.body as unknown as Buffer; } catch (e) { if (!isAbortError(e)) { // These are often circuit breaking exceptions // Should return a tile with some error message - logger.warn(`Cannot generate grid-tile for ${z}/${x}/${y}: ${e.message}`); + logger.warn(`Cannot generate ES-grid-tile for ${z}/${x}/${y}: ${e.message}`); } return null; } } - -export async function getTile({ - logger, - context, - index, - geometryFieldName, - x, - y, - z, - requestBody = {}, - geoFieldType, - searchSessionId, - abortSignal, -}: { - x: number; - y: number; - z: number; - geometryFieldName: string; - index: string; - context: DataRequestHandlerContext; - logger: Logger; - requestBody: any; - geoFieldType: ES_GEO_FIELD_TYPE; - searchSessionId?: string; - abortSignal: AbortSignal; -}): Promise { - let features: Feature[]; - try { - requestBody.query.bool.filter.push( - getTileSpatialFilter(geometryFieldName, tileToESBbox(x, y, z)) - ); - - const searchOptions = { - sessionId: searchSessionId, - legacyHitsTotal: false, - abortSignal, - }; - - const countResponse = await context - .search!.search( - { - params: { - index, - body: { - size: 0, - query: requestBody.query, - track_total_hits: requestBody.size + 1, - }, - }, - }, - searchOptions - ) - .toPromise(); - - if ( - isTotalHitsGreaterThan( - countResponse.rawResponse.hits.total as unknown as TotalHits, - requestBody.size - ) - ) { - // Generate "too many features"-bounds - const bboxResponse = await context - .search!.search( - { - params: { - index, - body: { - size: 0, - query: requestBody.query, - aggs: { - data_bounds: { - geo_bounds: { - field: geometryFieldName, - }, - }, - }, - track_total_hits: false, - }, - }, - }, - searchOptions - ) - .toPromise(); - - const metaDataFeature: TileMetaFeature = { - type: 'Feature', - properties: { - [KBN_METADATA_FEATURE]: true, - [KBN_IS_TILE_COMPLETE]: false, - [KBN_FEATURE_COUNT]: 0, - [KBN_VECTOR_SHAPE_TYPE_COUNTS]: { - [VECTOR_SHAPE_TYPE.POINT]: 0, - [VECTOR_SHAPE_TYPE.LINE]: 0, - [VECTOR_SHAPE_TYPE.POLYGON]: 0, - }, - }, - geometry: esBboxToGeoJsonPolygon( - // @ts-expect-error @elastic/elasticsearch no way to declare aggregations for search response - bboxResponse.rawResponse.aggregations.data_bounds.bounds, - tileToESBbox(x, y, z) - ), - }; - features = [metaDataFeature]; - } else { - const documentsResponse = await context - .search!.search( - { - params: { - index, - body: { - ...requestBody, - track_total_hits: false, - }, - }, - }, - searchOptions - ) - .toPromise(); - - const featureCollection = hitsToGeoJson( - // @ts-expect-error hitsToGeoJson should be refactored to accept estypes.SearchHit - documentsResponse.rawResponse.hits.hits, - (hit: Record) => { - return flattenHit(geometryFieldName, hit); - }, - geometryFieldName, - geoFieldType, - [] - ); - - features = featureCollection.features; - - // Correct system-fields. - for (let i = 0; i < features.length; i++) { - const props = features[i].properties; - if (props !== null) { - props[FEATURE_ID_PROPERTY_NAME] = features[i].id; - } - } - - const counts = countVectorShapeTypes(features); - - const fieldNames = new Set(); - features.forEach((feature) => { - for (const key in feature.properties) { - if ( - feature.properties.hasOwnProperty(key) && - key !== '_index' && - key !== '_id' && - key !== FEATURE_ID_PROPERTY_NAME - ) { - fieldNames.add(key); - } - } - }); - - const fieldMeta: FieldMeta = {}; - fieldNames.forEach((fieldName: string) => { - const rangeMeta = pluckRangeFieldMeta(features, fieldName, (rawValue: unknown) => { - return typeof rawValue === 'number' ? rawValue : NaN; - }); - const categoryMeta = pluckCategoryFieldMeta(features, fieldName, TERM_COUNT); - - if (!fieldMeta[fieldName]) { - fieldMeta[fieldName] = {}; - } - - if (rangeMeta) { - fieldMeta[fieldName].range = rangeMeta; - } - - if (categoryMeta) { - fieldMeta[fieldName].categories = categoryMeta; - } - }); - - const metadataFeature: TileMetaFeature = { - type: 'Feature', - properties: { - [KBN_METADATA_FEATURE]: true, - [KBN_IS_TILE_COMPLETE]: true, - [KBN_VECTOR_SHAPE_TYPE_COUNTS]: counts, - [KBN_FEATURE_COUNT]: features.length, - fieldMeta, - }, - geometry: esBboxToGeoJsonPolygon(tileToESBbox(x, y, z), tileToESBbox(x, y, z)), - }; - - features.push(metadataFeature); - } - - const featureCollection: FeatureCollection = { - features, - type: 'FeatureCollection', - }; - - return createMvtTile(featureCollection, z, x, y); - } catch (e) { - if (!isAbortError(e)) { - logger.warn(`Cannot generate tile for ${z}/${x}/${y}: ${e.message}`); - } - return null; - } -} - -function getTileSpatialFilter(geometryFieldName: string, tileBounds: ESBounds): unknown { - const tileExtent = { - minLon: tileBounds.top_left.lon, - minLat: tileBounds.bottom_right.lat, - maxLon: tileBounds.bottom_right.lon, - maxLat: tileBounds.top_left.lat, - }; - const tileExtentFilter = createExtentFilter(tileExtent, [geometryFieldName]); - return tileExtentFilter.query; -} - -function esBboxToGeoJsonPolygon(esBounds: ESBounds, tileBounds: ESBounds): Polygon { - // Intersecting geo_shapes may push bounding box outside of tile so need to clamp to tile bounds. - let minLon = Math.max(esBounds.top_left.lon, tileBounds.top_left.lon); - const maxLon = Math.min(esBounds.bottom_right.lon, tileBounds.bottom_right.lon); - minLon = minLon > maxLon ? minLon - 360 : minLon; // fixes an ES bbox to straddle dateline - const minLat = Math.max(esBounds.bottom_right.lat, tileBounds.bottom_right.lat); - const maxLat = Math.min(esBounds.top_left.lat, tileBounds.top_left.lat); - - return { - type: 'Polygon', - coordinates: [ - [ - [minLon, minLat], - [minLon, maxLat], - [maxLon, maxLat], - [maxLon, minLat], - [minLon, minLat], - ], - ], - }; -} - -function createMvtTile( - featureCollection: FeatureCollection, - z: number, - x: number, - y: number -): Buffer | null { - featureCollection.features.push(...getCentroidFeatures(featureCollection)); - const tileIndex = geojsonvt(featureCollection, { - maxZoom: 24, // max zoom to preserve detail on; can't be higher than 24 - tolerance: 3, // simplification tolerance (higher means simpler) - extent: 4096, // tile extent (both width and height) - buffer: 64, // tile buffer on each side - debug: 0, // logging level (0 to disable, 1 or 2) - lineMetrics: false, // whether to enable line metrics tracking for LineString/MultiLineString features - promoteId: null, // name of a feature property to promote to feature.id. Cannot be used with `generateId` - generateId: false, // whether to generate feature ids. Cannot be used with `promoteId` - indexMaxZoom: 5, // max zoom in the initial tile index - indexMaxPoints: 100000, // max number of points per tile in the index - }); - const tile = tileIndex.getTile(z, x, y); - - if (tile) { - const pbf = vtpbf.fromGeojsonVt({ [MVT_SOURCE_LAYER_NAME]: tile }, { version: 2 }); - return Buffer.from(pbf); - } else { - return null; - } -} diff --git a/x-pack/plugins/maps/server/mvt/mvt_routes.ts b/x-pack/plugins/maps/server/mvt/mvt_routes.ts index 01a89aff1a661..3c61a47a383d6 100644 --- a/x-pack/plugins/maps/server/mvt/mvt_routes.ts +++ b/x-pack/plugins/maps/server/mvt/mvt_routes.ts @@ -16,10 +16,10 @@ import { MVT_GETTILE_API_PATH, API_ROOT_PATH, MVT_GETGRIDTILE_API_PATH, - ES_GEO_FIELD_TYPE, RENDER_AS, } from '../../common/constants'; -import { getGridTile, getTile } from './get_tile'; +import { getEsTile } from './get_tile'; +import { getEsGridTile } from './get_grid_tile'; const CACHE_TIMEOUT_SECONDS = 60 * 60; @@ -43,8 +43,6 @@ export function initMVTRoutes({ geometryFieldName: schema.string(), requestBody: schema.string(), index: schema.string(), - geoFieldType: schema.string(), - searchSessionId: schema.maybe(schema.string()), token: schema.maybe(schema.string()), }), }, @@ -56,14 +54,15 @@ export function initMVTRoutes({ ) => { const { query, params } = request; - const abortController = new AbortController(); - request.events.aborted$.subscribe(() => { - abortController.abort(); - }); + // todo - replace with direct abortion of raw transport request + // const abortController = new AbortController(); + // request.events.aborted$.subscribe(() => { + // abortController.abort(); + // }); const requestBodyDSL = rison.decode(query.requestBody as string); - const tile = await getTile({ + const tile = await getEsTile({ logger, context, geometryFieldName: query.geometryFieldName as string, @@ -72,9 +71,6 @@ export function initMVTRoutes({ z: parseInt((params as any).z, 10) as number, index: query.index as string, requestBody: requestBodyDSL as any, - geoFieldType: query.geoFieldType as ES_GEO_FIELD_TYPE, - searchSessionId: query.searchSessionId, - abortSignal: abortController.signal, }); return sendResponse(response, tile); @@ -95,8 +91,6 @@ export function initMVTRoutes({ requestBody: schema.string(), index: schema.string(), requestType: schema.string(), - geoFieldType: schema.string(), - searchSessionId: schema.maybe(schema.string()), token: schema.maybe(schema.string()), }), }, @@ -107,14 +101,16 @@ export function initMVTRoutes({ response: KibanaResponseFactory ) => { const { query, params } = request; - const abortController = new AbortController(); - request.events.aborted$.subscribe(() => { - abortController.abort(); - }); + + // todo - replace with direct abortion of raw transport request + // const abortController = new AbortController(); + // request.events.aborted$.subscribe(() => { + // abortController.abort(); + // }); const requestBodyDSL = rison.decode(query.requestBody as string); - const tile = await getGridTile({ + const tile = await getEsGridTile({ logger, context, geometryFieldName: query.geometryFieldName as string, @@ -124,9 +120,6 @@ export function initMVTRoutes({ index: query.index as string, requestBody: requestBodyDSL as any, requestType: query.requestType as RENDER_AS.POINT | RENDER_AS.GRID, - geoFieldType: query.geoFieldType as ES_GEO_FIELD_TYPE, - searchSessionId: query.searchSessionId, - abortSignal: abortController.signal, }); return sendResponse(response, tile); diff --git a/x-pack/plugins/maps/server/mvt/util.ts b/x-pack/plugins/maps/server/mvt/util.ts deleted file mode 100644 index b3dc606ba3f11..0000000000000 --- a/x-pack/plugins/maps/server/mvt/util.ts +++ /dev/null @@ -1,75 +0,0 @@ -/* - * 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; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -// This implementation: -// - does not include meta-fields -// - does not validate the schema against the index-pattern (e.g. nested fields) -// In the context of .mvt this is sufficient: -// - only fields from the response are packed in the tile (more efficient) -// - query-dsl submitted from the client, which was generated by the IndexPattern -// todo: Ideally, this should adapt/reuse from https://github.com/elastic/kibana/blob/52b42a81faa9dd5c102b9fbb9a645748c3623121/src/plugins/data/common/index_patterns/index_patterns/flatten_hit.ts#L26 - -export function flattenHit( - geometryField: string, - hit: Record -): Record { - const flat: Record = {}; - if (hit) { - flattenSource(flat, '', hit._source as Record, geometryField); - if (hit.fields) { - flattenFields(flat, hit.fields as Array>); - } - - // Attach meta fields - flat._index = hit._index; - flat._id = hit._id; - } - return flat; -} - -function flattenSource( - accum: Record, - path: string, - properties: Record = {}, - geometryField: string -): Record { - accum = accum || {}; - for (const key in properties) { - if (properties.hasOwnProperty(key)) { - const newKey = path ? path + '.' + key : key; - let value; - if (geometryField === newKey) { - value = properties[key]; // do not deep-copy the geometry - } else if (properties[key] !== null && typeof value === 'object' && !Array.isArray(value)) { - value = flattenSource( - accum, - newKey, - properties[key] as Record, - geometryField - ); - } else { - value = properties[key]; - } - accum[newKey] = value; - } - } - return accum; -} - -function flattenFields(accum: Record = {}, fields: Array>) { - accum = accum || {}; - for (const key in fields) { - if (fields.hasOwnProperty(key)) { - const value = fields[key]; - if (Array.isArray(value)) { - accum[key] = value[0]; - } else { - accum[key] = value; - } - } - } -} diff --git a/x-pack/test/api_integration/apis/maps/get_grid_tile.js b/x-pack/test/api_integration/apis/maps/get_grid_tile.js index fdb8b2187bbbb..c37dc9770693c 100644 --- a/x-pack/test/api_integration/apis/maps/get_grid_tile.js +++ b/x-pack/test/api_integration/apis/maps/get_grid_tile.js @@ -8,10 +8,6 @@ import { VectorTile } from '@mapbox/vector-tile'; import Protobuf from 'pbf'; import expect from '@kbn/expect'; -import { - KBN_IS_CENTROID_FEATURE, - MVT_SOURCE_LAYER_NAME, -} from '../../../../plugins/maps/common/constants'; export default function ({ getService }) { const supertest = getService('supertest'); @@ -23,45 +19,53 @@ export default function ({ getService }) { `/api/maps/mvt/getGridTile/3/2/3.pbf\ ?geometryFieldName=geo.coordinates\ &index=logstash-*\ -&requestBody=(_source:(excludes:!()),aggs:(gridSplit:(aggs:(avg_of_bytes:(avg:(field:bytes)),gridCentroid:(geo_centroid:(field:geo.coordinates))),geotile_grid:(bounds:!n,field:geo.coordinates,precision:!n,shard_size:65535,size:65535))),fields:!((field:%27@timestamp%27,format:date_time),(field:%27relatedContent.article:modified_time%27,format:date_time),(field:%27relatedContent.article:published_time%27,format:date_time),(field:utc_time,format:date_time)),query:(bool:(filter:!((match_all:()),(range:(%27@timestamp%27:(format:strict_date_optional_time,gte:%272015-09-20T00:00:00.000Z%27,lte:%272015-09-20T01:00:00.000Z%27)))),must:!(),must_not:!(),should:!())),runtime_mappings:(),script_fields:(hour_of_day:(script:(lang:painless,source:%27doc[!%27@timestamp!%27].value.getHour()%27))),size:0,stored_fields:!(%27*%27))\ -&requestType=point\ -&geoFieldType=geo_point` +&requestBody=(_source:(excludes:!()),aggs:(avg_of_bytes:(avg:(field:bytes))),fields:!((field:%27@timestamp%27,format:date_time),(field:%27relatedContent.article:modified_time%27,format:date_time),(field:%27relatedContent.article:published_time%27,format:date_time),(field:utc_time,format:date_time)),query:(bool:(filter:!((match_all:()),(range:(%27@timestamp%27:(format:strict_date_optional_time,gte:%272015-09-20T00:00:00.000Z%27,lte:%272015-09-20T01:00:00.000Z%27)))),must:!(),must_not:!(),should:!())),runtime_mappings:(),script_fields:(hour_of_day:(script:(lang:painless,source:%27doc[!%27@timestamp!%27].value.getHour()%27))),size:0,stored_fields:!(%27*%27))\ +&requestType=point` ) .set('kbn-xsrf', 'kibana') .responseType('blob') .expect(200); const jsonTile = new VectorTile(new Protobuf(resp.body)); - const layer = jsonTile.layers[MVT_SOURCE_LAYER_NAME]; - expect(layer.length).to.be(2); // Cluster feature + const layer = jsonTile.layers.aggs; + expect(layer.length).to.be(1); const clusterFeature = layer.feature(0); expect(clusterFeature.type).to.be(1); expect(clusterFeature.extent).to.be(4096); expect(clusterFeature.id).to.be(undefined); - expect(clusterFeature.properties).to.eql({ doc_count: 1, avg_of_bytes: 9252 }); + expect(clusterFeature.properties).to.eql({ _count: 1, 'avg_of_bytes.value': 9252 }); expect(clusterFeature.loadGeometry()).to.eql([[{ x: 87, y: 667 }]]); // Metadata feature - const metadataFeature = layer.feature(1); + const metaDataLayer = jsonTile.layers.meta; + expect(metaDataLayer.length).to.be(1); + const metadataFeature = metaDataLayer.feature(0); expect(metadataFeature.type).to.be(3); expect(metadataFeature.extent).to.be(4096); - expect(metadataFeature.properties).to.eql({ - __kbn_metadata_feature__: true, - __kbn_feature_count__: 1, - __kbn_is_tile_complete__: true, - __kbn_vector_shape_type_counts__: '{"POINT":1,"LINE":0,"POLYGON":0}', - fieldMeta: - '{"doc_count":{"range":{"min":1,"max":1,"delta":0},"categories":{"categories":[{"key":1,"count":1}]}},"avg_of_bytes":{"range":{"min":9252,"max":9252,"delta":0},"categories":{"categories":[{"key":9252,"count":1}]}}}', - }); + + expect(metadataFeature.properties['aggregations._count.avg']).to.eql(1); + expect(metadataFeature.properties['aggregations._count.count']).to.eql(1); + expect(metadataFeature.properties['aggregations._count.min']).to.eql(1); + expect(metadataFeature.properties['aggregations._count.sum']).to.eql(1); + + expect(metadataFeature.properties['aggregations.avg_of_bytes.avg']).to.eql(9252); + expect(metadataFeature.properties['aggregations.avg_of_bytes.count']).to.eql(1); + expect(metadataFeature.properties['aggregations.avg_of_bytes.max']).to.eql(9252); + expect(metadataFeature.properties['aggregations.avg_of_bytes.min']).to.eql(9252); + expect(metadataFeature.properties['aggregations.avg_of_bytes.sum']).to.eql(9252); + + expect(metadataFeature.properties['hits.total.relation']).to.eql('eq'); + expect(metadataFeature.properties['hits.total.value']).to.eql(1); + expect(metadataFeature.loadGeometry()).to.eql([ [ - { x: 0, y: 0 }, - { x: 4096, y: 0 }, - { x: 4096, y: 4096 }, { x: 0, y: 4096 }, + { x: 4096, y: 4096 }, + { x: 4096, y: 0 }, { x: 0, y: 0 }, + { x: 0, y: 4096 }, ], ]); }); @@ -72,65 +76,62 @@ export default function ({ getService }) { `/api/maps/mvt/getGridTile/3/2/3.pbf\ ?geometryFieldName=geo.coordinates\ &index=logstash-*\ -&requestBody=(_source:(excludes:!()),aggs:(gridSplit:(aggs:(avg_of_bytes:(avg:(field:bytes)),gridCentroid:(geo_centroid:(field:geo.coordinates))),geotile_grid:(bounds:!n,field:geo.coordinates,precision:!n,shard_size:65535,size:65535))),fields:!((field:%27@timestamp%27,format:date_time),(field:%27relatedContent.article:modified_time%27,format:date_time),(field:%27relatedContent.article:published_time%27,format:date_time),(field:utc_time,format:date_time)),query:(bool:(filter:!((match_all:()),(range:(%27@timestamp%27:(format:strict_date_optional_time,gte:%272015-09-20T00:00:00.000Z%27,lte:%272015-09-20T01:00:00.000Z%27)))),must:!(),must_not:!(),should:!())),runtime_mappings:(),script_fields:(hour_of_day:(script:(lang:painless,source:%27doc[!%27@timestamp!%27].value.getHour()%27))),size:0,stored_fields:!(%27*%27))\ -&requestType=grid\ -&geoFieldType=geo_point` +&requestBody=(_source:(excludes:!()),aggs:(avg_of_bytes:(avg:(field:bytes))),fields:!((field:%27@timestamp%27,format:date_time),(field:%27relatedContent.article:modified_time%27,format:date_time),(field:%27relatedContent.article:published_time%27,format:date_time),(field:utc_time,format:date_time)),query:(bool:(filter:!((match_all:()),(range:(%27@timestamp%27:(format:strict_date_optional_time,gte:%272015-09-20T00:00:00.000Z%27,lte:%272015-09-20T01:00:00.000Z%27)))),must:!(),must_not:!(),should:!())),runtime_mappings:(),script_fields:(hour_of_day:(script:(lang:painless,source:%27doc[!%27@timestamp!%27].value.getHour()%27))),size:0,stored_fields:!(%27*%27))\ +&requestType=grid` ) .set('kbn-xsrf', 'kibana') .responseType('blob') .expect(200); const jsonTile = new VectorTile(new Protobuf(resp.body)); - const layer = jsonTile.layers[MVT_SOURCE_LAYER_NAME]; - expect(layer.length).to.be(3); + const layer = jsonTile.layers.aggs; + expect(layer.length).to.be(1); const gridFeature = layer.feature(0); expect(gridFeature.type).to.be(3); expect(gridFeature.extent).to.be(4096); expect(gridFeature.id).to.be(undefined); - expect(gridFeature.properties).to.eql({ doc_count: 1, avg_of_bytes: 9252 }); + expect(gridFeature.properties).to.eql({ _count: 1, 'avg_of_bytes.value': 9252 }); expect(gridFeature.loadGeometry()).to.eql([ [ - { x: 96, y: 640 }, - { x: 96, y: 672 }, { x: 64, y: 672 }, - { x: 64, y: 640 }, + { x: 96, y: 672 }, { x: 96, y: 640 }, + { x: 64, y: 640 }, + { x: 64, y: 672 }, ], ]); // Metadata feature - const metadataFeature = layer.feature(1); + const metaDataLayer = jsonTile.layers.meta; + expect(metaDataLayer.length).to.be(1); + const metadataFeature = metaDataLayer.feature(0); expect(metadataFeature.type).to.be(3); expect(metadataFeature.extent).to.be(4096); - expect(metadataFeature.properties).to.eql({ - __kbn_metadata_feature__: true, - __kbn_feature_count__: 1, - __kbn_is_tile_complete__: true, - __kbn_vector_shape_type_counts__: '{"POINT":0,"LINE":0,"POLYGON":1}', - fieldMeta: - '{"doc_count":{"range":{"min":1,"max":1,"delta":0},"categories":{"categories":[{"key":1,"count":1}]}},"avg_of_bytes":{"range":{"min":9252,"max":9252,"delta":0},"categories":{"categories":[{"key":9252,"count":1}]}}}', - }); + + expect(metadataFeature.properties['aggregations._count.avg']).to.eql(1); + expect(metadataFeature.properties['aggregations._count.count']).to.eql(1); + expect(metadataFeature.properties['aggregations._count.min']).to.eql(1); + expect(metadataFeature.properties['aggregations._count.sum']).to.eql(1); + + expect(metadataFeature.properties['aggregations.avg_of_bytes.avg']).to.eql(9252); + expect(metadataFeature.properties['aggregations.avg_of_bytes.count']).to.eql(1); + expect(metadataFeature.properties['aggregations.avg_of_bytes.max']).to.eql(9252); + expect(metadataFeature.properties['aggregations.avg_of_bytes.min']).to.eql(9252); + expect(metadataFeature.properties['aggregations.avg_of_bytes.sum']).to.eql(9252); + + expect(metadataFeature.properties['hits.total.relation']).to.eql('eq'); + expect(metadataFeature.properties['hits.total.value']).to.eql(1); + expect(metadataFeature.loadGeometry()).to.eql([ [ - { x: 0, y: 0 }, - { x: 4096, y: 0 }, - { x: 4096, y: 4096 }, { x: 0, y: 4096 }, + { x: 4096, y: 4096 }, + { x: 4096, y: 0 }, { x: 0, y: 0 }, + { x: 0, y: 4096 }, ], ]); - - const clusterFeature = layer.feature(2); - expect(clusterFeature.type).to.be(1); - expect(clusterFeature.extent).to.be(4096); - expect(clusterFeature.id).to.be(undefined); - expect(clusterFeature.properties).to.eql({ - doc_count: 1, - avg_of_bytes: 9252, - [KBN_IS_CENTROID_FEATURE]: true, - }); - expect(clusterFeature.loadGeometry()).to.eql([[{ x: 80, y: 656 }]]); }); }); } diff --git a/x-pack/test/api_integration/apis/maps/get_tile.js b/x-pack/test/api_integration/apis/maps/get_tile.js index 9705064464843..699ff145aa1b1 100644 --- a/x-pack/test/api_integration/apis/maps/get_tile.js +++ b/x-pack/test/api_integration/apis/maps/get_tile.js @@ -8,7 +8,6 @@ import { VectorTile } from '@mapbox/vector-tile'; import Protobuf from 'pbf'; import expect from '@kbn/expect'; -import { MVT_SOURCE_LAYER_NAME } from '../../../../plugins/maps/common/constants'; function findFeature(layer, callbackFn) { for (let i = 0; i < layer.length; i++) { @@ -23,22 +22,21 @@ export default function ({ getService }) { const supertest = getService('supertest'); describe('getTile', () => { - it('should return vector tile containing document', async () => { + it('should return ES vector tile containing documents and metadata', async () => { const resp = await supertest .get( `/api/maps/mvt/getTile/2/1/1.pbf\ ?geometryFieldName=geo.coordinates\ &index=logstash-*\ -&requestBody=(_source:!f,docvalue_fields:!(bytes,geo.coordinates,machine.os.raw),query:(bool:(filter:!((match_all:()),(range:(%27@timestamp%27:(format:strict_date_optional_time,gte:%272015-09-20T00:00:00.000Z%27,lte:%272015-09-20T01:00:00.000Z%27)))),must:!(),must_not:!(),should:!())),runtime_mappings:(),script_fields:(),size:10000,stored_fields:!(bytes,geo.coordinates,machine.os.raw))\ -&geoFieldType=geo_point` +&requestBody=(_source:!f,docvalue_fields:!(bytes,geo.coordinates,machine.os.raw),query:(bool:(filter:!((match_all:()),(range:(%27@timestamp%27:(format:strict_date_optional_time,gte:%272015-09-20T00:00:00.000Z%27,lte:%272015-09-20T01:00:00.000Z%27)))),must:!(),must_not:!(),should:!())),runtime_mappings:(),script_fields:(),size:10000,stored_fields:!(bytes,geo.coordinates,machine.os.raw))` ) .set('kbn-xsrf', 'kibana') .responseType('blob') .expect(200); const jsonTile = new VectorTile(new Protobuf(resp.body)); - const layer = jsonTile.layers[MVT_SOURCE_LAYER_NAME]; - expect(layer.length).to.be(3); // 2 docs + the metadata feature + const layer = jsonTile.layers.hits; + expect(layer.length).to.be(2); // 2 docs // Verify ES document @@ -50,82 +48,32 @@ export default function ({ getService }) { expect(feature.extent).to.be(4096); expect(feature.id).to.be(undefined); expect(feature.properties).to.eql({ - __kbn__feature_id__: 'logstash-2015.09.20:AU_x3_BsGFA8no6Qjjug:0', _id: 'AU_x3_BsGFA8no6Qjjug', _index: 'logstash-2015.09.20', bytes: 9252, - ['machine.os.raw']: 'ios', + 'machine.os.raw': 'ios', }); expect(feature.loadGeometry()).to.eql([[{ x: 44, y: 2382 }]]); // Verify metadata feature - const metadataFeature = findFeature(layer, (feature) => { - return feature.properties.__kbn_metadata_feature__; - }); + const metaDataLayer = jsonTile.layers.meta; + const metadataFeature = metaDataLayer.feature(0); expect(metadataFeature).not.to.be(undefined); expect(metadataFeature.type).to.be(3); expect(metadataFeature.extent).to.be(4096); expect(metadataFeature.id).to.be(undefined); - const fieldMeta = JSON.parse(metadataFeature.properties.fieldMeta); - delete metadataFeature.properties.fieldMeta; - expect(metadataFeature.properties).to.eql({ - __kbn_feature_count__: 2, - __kbn_is_tile_complete__: true, - __kbn_metadata_feature__: true, - __kbn_vector_shape_type_counts__: '{"POINT":2,"LINE":0,"POLYGON":0}', - }); - expect(fieldMeta.bytes.range).to.eql({ - min: 9252, - max: 9583, - delta: 331, - }); - expect(fieldMeta.bytes.categories.categories.length).to.be(2); - expect(fieldMeta['machine.os.raw'].categories.categories.length).to.be(2); - expect(metadataFeature.loadGeometry()).to.eql([ - [ - { x: 0, y: 4096 }, - { x: 0, y: 0 }, - { x: 4096, y: 0 }, - { x: 4096, y: 4096 }, - { x: 0, y: 4096 }, - ], - ]); - }); - it('should return vector tile containing bounds when count exceeds size', async () => { - const resp = await supertest - // requestBody sets size=1 to force count exceeded - .get( - `/api/maps/mvt/getTile/2/1/1.pbf\ -?geometryFieldName=geo.coordinates\ -&index=logstash-*\ -&requestBody=(_source:!f,docvalue_fields:!(bytes,geo.coordinates,machine.os.raw),query:(bool:(filter:!((match_all:()),(range:(%27@timestamp%27:(format:strict_date_optional_time,gte:%272015-09-20T00:00:00.000Z%27,lte:%272015-09-20T01:00:00.000Z%27)))),must:!(),must_not:!(),should:!())),runtime_mappings:(),script_fields:(),size:1,stored_fields:!(bytes,geo.coordinates,machine.os.raw))\ -&geoFieldType=geo_point` - ) - .set('kbn-xsrf', 'kibana') - .responseType('blob') - .expect(200); + // This is dropping some irrelevant properties from the comparison + expect(metadataFeature.properties['hits.total.relation']).to.eql('eq'); + expect(metadataFeature.properties['hits.total.value']).to.eql(2); + expect(metadataFeature.properties.timed_out).to.eql(false); - const jsonTile = new VectorTile(new Protobuf(resp.body)); - const layer = jsonTile.layers[MVT_SOURCE_LAYER_NAME]; - expect(layer.length).to.be(1); - - const metadataFeature = layer.feature(0); - expect(metadataFeature.type).to.be(3); - expect(metadataFeature.extent).to.be(4096); - expect(metadataFeature.id).to.be(undefined); - expect(metadataFeature.properties).to.eql({ - __kbn_metadata_feature__: true, - __kbn_feature_count__: 0, - __kbn_is_tile_complete__: false, - __kbn_vector_shape_type_counts__: '{"POINT":0,"LINE":0,"POLYGON":0}', - }); expect(metadataFeature.loadGeometry()).to.eql([ [ { x: 44, y: 2382 }, - { x: 44, y: 1913 }, - { x: 550, y: 1913 }, { x: 550, y: 2382 }, + { x: 550, y: 1913 }, + { x: 44, y: 1913 }, { x: 44, y: 2382 }, ], ]); diff --git a/x-pack/test/functional/apps/maps/mapbox_styles.js b/x-pack/test/functional/apps/maps/mapbox_styles.js index 58c69950590cf..471e7440822c5 100644 --- a/x-pack/test/functional/apps/maps/mapbox_styles.js +++ b/x-pack/test/functional/apps/maps/mapbox_styles.js @@ -6,10 +6,6 @@ */ import expect from '@kbn/expect'; -import { - KBN_IS_TILE_COMPLETE, - KBN_METADATA_FEATURE, -} from '../../../../plugins/maps/common/constants'; export default function ({ getPageObjects, getService }) { const PageObjects = getPageObjects(['maps']); @@ -44,7 +40,6 @@ export default function ({ getPageObjects, getService }) { maxzoom: 24, filter: [ 'all', - ['!=', ['get', '__kbn_metadata_feature__'], true], ['!=', ['get', '__kbn_is_centroid_feature__'], true], ['any', ['==', ['geometry-type'], 'Point'], ['==', ['geometry-type'], 'MultiPoint']], ['==', ['get', '__kbn_isvisibleduetojoin__'], true], @@ -125,7 +120,6 @@ export default function ({ getPageObjects, getService }) { maxzoom: 24, filter: [ 'all', - ['!=', ['get', '__kbn_metadata_feature__'], true], ['!=', ['get', '__kbn_is_centroid_feature__'], true], ['any', ['==', ['geometry-type'], 'Polygon'], ['==', ['geometry-type'], 'MultiPolygon']], ['==', ['get', '__kbn_isvisibleduetojoin__'], true], @@ -202,7 +196,6 @@ export default function ({ getPageObjects, getService }) { maxzoom: 24, filter: [ 'all', - ['!=', ['get', '__kbn_metadata_feature__'], true], ['!=', ['get', '__kbn_is_centroid_feature__'], true], [ 'any', @@ -217,26 +210,5 @@ export default function ({ getPageObjects, getService }) { paint: { 'line-color': '#41937c', 'line-opacity': 0.75, 'line-width': 1 }, }); }); - - it('should style incomplete data layer as expected', async () => { - const layer = mapboxStyle.layers.find((mbLayer) => { - return mbLayer.id === 'n1t6f_toomanyfeatures'; - }); - - expect(layer).to.eql({ - id: 'n1t6f_toomanyfeatures', - type: 'fill', - source: 'n1t6f', - minzoom: 0, - maxzoom: 24, - filter: [ - 'all', - ['==', ['get', KBN_METADATA_FEATURE], true], - ['==', ['get', KBN_IS_TILE_COMPLETE], false], - ], - layout: { visibility: 'visible' }, - paint: { 'fill-pattern': '__kbn_too_many_features_image_id__', 'fill-opacity': 0.75 }, - }); - }); }); } diff --git a/x-pack/test/functional/apps/maps/mvt_scaling.js b/x-pack/test/functional/apps/maps/mvt_scaling.js index 66a511f6e9fec..d9b660ba0d730 100644 --- a/x-pack/test/functional/apps/maps/mvt_scaling.js +++ b/x-pack/test/functional/apps/maps/mvt_scaling.js @@ -31,7 +31,7 @@ export default function ({ getPageObjects, getService }) { //Source should be correct expect( mapboxStyle.sources[VECTOR_SOURCE_ID].tiles[0].startsWith( - `/api/maps/mvt/getTile/{z}/{x}/{y}.pbf?geometryFieldName=geometry&index=geo_shapes*&requestBody=(_source:!(geometry),docvalue_fields:!(prop1),query:(bool:(filter:!(),must:!(),must_not:!(),should:!())),runtime_mappings:(),script_fields:(),size:10001,stored_fields:!(geometry,prop1))&geoFieldType=geo_shape` + `/api/maps/mvt/getTile/{z}/{x}/{y}.pbf?geometryFieldName=geometry&index=geo_shapes*&requestBody=(_source:!(geometry),docvalue_fields:!(prop1),query:(bool:(filter:!(),must:!(),must_not:!(),should:!())),runtime_mappings:(),script_fields:(),size:10001,stored_fields:!(geometry,prop1))` ) ).to.equal(true); @@ -77,5 +77,34 @@ export default function ({ getPageObjects, getService }) { 'fill-opacity': 1, }); }); + + it('Style should include toomanyfeatures layer', async () => { + const mapboxStyle = await PageObjects.maps.getMapboxStyle(); + + const layer = mapboxStyle.layers.find((mbLayer) => { + return mbLayer.id === `${VECTOR_SOURCE_ID}_toomanyfeatures`; + }); + + expect(layer).to.eql({ + id: 'caffa63a-ebfb-466d-8ff6-d797975b88ab_toomanyfeatures', + type: 'line', + source: 'caffa63a-ebfb-466d-8ff6-d797975b88ab', + 'source-layer': 'meta', + minzoom: 0, + maxzoom: 24, + filter: [ + 'all', + ['==', ['get', 'hits.total.relation'], 'gte'], + ['>=', ['get', 'hits.total.value'], 10002], + ], + layout: { visibility: 'visible' }, + paint: { + 'line-color': '#fec514', + 'line-width': 3, + 'line-dasharray': [2, 1], + 'line-opacity': 1, + }, + }); + }); }); } diff --git a/x-pack/test/functional/apps/maps/mvt_super_fine.js b/x-pack/test/functional/apps/maps/mvt_super_fine.js index dcd2923cb9335..6c5065a77c1d2 100644 --- a/x-pack/test/functional/apps/maps/mvt_super_fine.js +++ b/x-pack/test/functional/apps/maps/mvt_super_fine.js @@ -34,7 +34,7 @@ export default function ({ getPageObjects, getService }) { //Source should be correct expect( mapboxStyle.sources[MB_VECTOR_SOURCE_ID].tiles[0].startsWith( - `/api/maps/mvt/getGridTile/{z}/{x}/{y}.pbf?geometryFieldName=geo.coordinates&index=logstash-*&requestBody=(_source:(excludes:!()),aggs:(gridSplit:(aggs:(gridCentroid:(geo_centroid:(field:geo.coordinates)),max_of_bytes:(max:(field:bytes))),geotile_grid:(bounds:!n,field:geo.coordinates,precision:!n,shard_size:65535,size:65535))),fields:!((field:'@timestamp',format:date_time),(field:'relatedContent.article:modified_time',format:date_time),(field:'relatedContent.article:published_time',format:date_time),(field:utc_time,format:date_time)),query:(bool:(filter:!((range:('@timestamp':(format:strict_date_optional_time,gte:'2015-09-20T00:00:00.000Z',lte:'2015-09-20T01:00:00.000Z')))),must:!(),must_not:!(),should:!())),runtime_mappings:(),script_fields:(hour_of_day:(script:(lang:painless,source:'doc[!'@timestamp!'].value.getHour()'))),size:0,stored_fields:!('*'))&requestType=grid&geoFieldType=geo_point` + `/api/maps/mvt/getGridTile/{z}/{x}/{y}.pbf?geometryFieldName=geo.coordinates&index=logstash-*&requestBody=(_source:(excludes:!()),aggs:(max_of_bytes:(max:(field:bytes))),fields:!((field:'@timestamp',format:date_time),(field:'relatedContent.article:modified_time',format:date_time),(field:'relatedContent.article:published_time',format:date_time),(field:utc_time,format:date_time)),query:(bool:(filter:!((range:('@timestamp':(format:strict_date_optional_time,gte:'2015-09-20T00:00:00.000Z',lte:'2015-09-20T01:00:00.000Z')))),must:!(),must_not:!(),should:!())),runtime_mappings:(),script_fields:(hour_of_day:(script:(lang:painless,source:'doc[!'@timestamp!'].value.getHour()'))),size:0,stored_fields:!('*'))&requestType=grid` ) ).to.equal(true); @@ -51,9 +51,9 @@ export default function ({ getPageObjects, getService }) { 'coalesce', [ 'case', - ['==', ['get', 'max_of_bytes'], null], + ['==', ['get', 'max_of_bytes.value'], null], 1622, - ['max', ['min', ['to-number', ['get', 'max_of_bytes']], 9790], 1623], + ['max', ['min', ['to-number', ['get', 'max_of_bytes.value']], 9790], 1623], ], 1622, ], From b1dab1f0299ccc4d7aaee494aab266f805ace2ff Mon Sep 17 00:00:00 2001 From: Jason Stoltzfus Date: Mon, 25 Oct 2021 12:42:25 -0400 Subject: [PATCH 10/23] Suggestions enabled check (#116136) --- .../suggested_documents_callout.test.tsx | 15 ++++++- .../curation/suggested_documents_callout.tsx | 13 ++++-- .../curations/views/curations.test.tsx | 41 ++++++------------- .../components/curations/views/curations.tsx | 15 ++++--- .../views/curations_overview.test.tsx | 36 ++++------------ .../curations/views/curations_overview.tsx | 12 ++---- .../curations_settings_logic.test.ts | 16 ++++++++ .../curations_settings_logic.ts | 5 +++ .../components/engine/engine_logic.test.ts | 1 + .../app_search/components/engine/types.ts | 1 + .../suggested_curations_callout.test.tsx | 20 +++++---- .../suggested_curations_callout.tsx | 9 ++-- 12 files changed, 95 insertions(+), 89 deletions(-) diff --git a/x-pack/plugins/enterprise_search/public/applications/app_search/components/curations/curation/suggested_documents_callout.test.tsx b/x-pack/plugins/enterprise_search/public/applications/app_search/components/curations/curation/suggested_documents_callout.test.tsx index 29418d09218f4..b1f02b960aa8a 100644 --- a/x-pack/plugins/enterprise_search/public/applications/app_search/components/curations/curation/suggested_documents_callout.test.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/app_search/components/curations/curation/suggested_documents_callout.test.tsx @@ -26,6 +26,10 @@ const MOCK_VALUES = { }, queries: ['some query'], }, + // EngineLogic + engine: { + search_relevance_suggestions_active: true, + }, }; describe('SuggestedDocumentsCallout', () => { @@ -40,7 +44,7 @@ describe('SuggestedDocumentsCallout', () => { expect(wrapper.is(SuggestionsCallout)); }); - it('is empty when the suggested is undefined', () => { + it('is empty when the suggestion is undefined', () => { setMockValues({ ...MOCK_VALUES, curation: {} }); const wrapper = shallow(); @@ -48,6 +52,15 @@ describe('SuggestedDocumentsCallout', () => { expect(wrapper.isEmptyRender()).toBe(true); }); + it('is empty when suggestions are not active', () => { + const values = set('engine.search_relevance_suggestions_active', false, MOCK_VALUES); + setMockValues(values); + + const wrapper = shallow(); + + expect(wrapper.isEmptyRender()).toBe(true); + }); + it('is empty when curation status is not pending', () => { const values = set('curation.suggestion.status', 'applied', MOCK_VALUES); setMockValues(values); diff --git a/x-pack/plugins/enterprise_search/public/applications/app_search/components/curations/curation/suggested_documents_callout.tsx b/x-pack/plugins/enterprise_search/public/applications/app_search/components/curations/curation/suggested_documents_callout.tsx index e443e77d76190..af76ebee16bad 100644 --- a/x-pack/plugins/enterprise_search/public/applications/app_search/components/curations/curation/suggested_documents_callout.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/app_search/components/curations/curation/suggested_documents_callout.tsx @@ -11,7 +11,7 @@ import { useValues } from 'kea'; import { i18n } from '@kbn/i18n'; import { ENGINE_CURATION_SUGGESTION_PATH } from '../../../routes'; -import { generateEnginePath } from '../../engine'; +import { EngineLogic, generateEnginePath } from '../../engine'; import { SuggestionsCallout } from '../components/suggestions_callout'; @@ -21,8 +21,15 @@ export const SuggestedDocumentsCallout: React.FC = () => { const { curation: { suggestion, queries }, } = useValues(CurationLogic); - - if (typeof suggestion === 'undefined' || suggestion.status !== 'pending') { + const { + engine: { search_relevance_suggestions_active: searchRelevanceSuggestionsActive }, + } = useValues(EngineLogic); + + if ( + typeof suggestion === 'undefined' || + suggestion.status !== 'pending' || + searchRelevanceSuggestionsActive === false + ) { return null; } diff --git a/x-pack/plugins/enterprise_search/public/applications/app_search/components/curations/views/curations.test.tsx b/x-pack/plugins/enterprise_search/public/applications/app_search/components/curations/views/curations.test.tsx index 4e09dadc6c836..49d48c8c05ba6 100644 --- a/x-pack/plugins/enterprise_search/public/applications/app_search/components/curations/views/curations.test.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/app_search/components/curations/views/curations.test.tsx @@ -14,6 +14,8 @@ import React from 'react'; import { shallow } from 'enzyme'; +import { set } from 'lodash/fp'; + import { EuiTab } from '@elastic/eui'; import { getPageHeaderTabs, getPageTitle } from '../../../../test_helpers'; @@ -51,8 +53,10 @@ describe('Curations', () => { curationsSettings: { enabled: true, }, - // LicensingLogic - hasPlatinumLicense: true, + // EngineLogic + engine: { + search_relevance_suggestions_active: true, + }, }; const actions = { @@ -84,8 +88,8 @@ describe('Curations', () => { expect(actions.onSelectPageTab).toHaveBeenNthCalledWith(3, 'settings'); }); - it('renders less tabs when less than platinum license', () => { - setMockValues({ ...values, hasPlatinumLicense: false }); + it('renders less tabs when suggestions are not active', () => { + setMockValues(set('engine.search_relevance_suggestions_active', false, values)); const wrapper = shallow(); expect(getPageTitle(wrapper)).toEqual('Curated results'); @@ -94,8 +98,8 @@ describe('Curations', () => { expect(tabs.length).toBe(2); }); - it('renders a New! badge when less than platinum license', () => { - setMockValues({ ...values, hasPlatinumLicense: false }); + it('renders a New! badge when suggestions are not active', () => { + setMockValues(set('engine.search_relevance_suggestions_active', false, values)); const wrapper = shallow(); expect(getPageTitle(wrapper)).toEqual('Curated results'); @@ -104,29 +108,8 @@ describe('Curations', () => { expect(tabs.at(1).prop('append')).not.toBeUndefined(); }); - it('renders a New! badge when suggestions are disabled', () => { - setMockValues({ - ...values, - curationsSettings: { - enabled: false, - }, - }); - const wrapper = shallow(); - - expect(getPageTitle(wrapper)).toEqual('Curated results'); - - const tabs = getPageHeaderTabs(wrapper).find(EuiTab); - expect(tabs.at(2).prop('append')).not.toBeUndefined(); - }); - - it('hides the badge when suggestions are enabled and the user has a platinum license', () => { - setMockValues({ - ...values, - hasPlatinumLicense: true, - curationsSettings: { - enabled: true, - }, - }); + it('hides the badge when suggestions are active', () => { + setMockValues(set('engine.search_relevance_suggestions_active', true, values)); const wrapper = shallow(); expect(getPageTitle(wrapper)).toEqual('Curated results'); diff --git a/x-pack/plugins/enterprise_search/public/applications/app_search/components/curations/views/curations.tsx b/x-pack/plugins/enterprise_search/public/applications/app_search/components/curations/views/curations.tsx index 1cd8313743536..2207555772b5b 100644 --- a/x-pack/plugins/enterprise_search/public/applications/app_search/components/curations/views/curations.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/app_search/components/curations/views/curations.tsx @@ -12,11 +12,10 @@ import { useValues, useActions } from 'kea'; import { EuiBadge } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -import { LicensingLogic } from '../../../../shared/licensing'; import { EuiButtonTo } from '../../../../shared/react_router_helpers'; import { ENGINE_CURATIONS_NEW_PATH } from '../../../routes'; -import { generateEnginePath } from '../../engine'; +import { EngineLogic, generateEnginePath } from '../../engine'; import { AppSearchPageTemplate } from '../../layout'; import { CURATIONS_OVERVIEW_TITLE, CREATE_NEW_CURATION_TITLE } from '../constants'; @@ -30,13 +29,13 @@ import { CurationsSettings, CurationsSettingsLogic } from './curations_settings' export const Curations: React.FC = () => { const { dataLoading: curationsDataLoading, meta, selectedPageTab } = useValues(CurationsLogic); const { loadCurations, onSelectPageTab } = useActions(CurationsLogic); - const { hasPlatinumLicense } = useValues(LicensingLogic); const { - dataLoading: curationsSettingsDataLoading, - curationsSettings: { enabled: curationsSettingsEnabled }, - } = useValues(CurationsSettingsLogic); + engine: { search_relevance_suggestions_active: searchRelevanceSuggestionsActive }, + } = useValues(EngineLogic); - const suggestionsEnabled = hasPlatinumLicense && curationsSettingsEnabled; + const { dataLoading: curationsSettingsDataLoading } = useValues(CurationsSettingsLogic); + + const suggestionsEnabled = searchRelevanceSuggestionsActive; const OVERVIEW_TAB = { label: i18n.translate( @@ -75,7 +74,7 @@ export const Curations: React.FC = () => { ), }; - const pageTabs = hasPlatinumLicense + const pageTabs = searchRelevanceSuggestionsActive ? [OVERVIEW_TAB, HISTORY_TAB, SETTINGS_TAB] : [OVERVIEW_TAB, SETTINGS_TAB]; diff --git a/x-pack/plugins/enterprise_search/public/applications/app_search/components/curations/views/curations_overview.test.tsx b/x-pack/plugins/enterprise_search/public/applications/app_search/components/curations/views/curations_overview.test.tsx index 809157704a14e..43ef9dfd7ad2b 100644 --- a/x-pack/plugins/enterprise_search/public/applications/app_search/components/curations/views/curations_overview.test.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/app_search/components/curations/views/curations_overview.test.tsx @@ -12,6 +12,7 @@ import '../../../__mocks__/engine_logic.mock'; import React from 'react'; import { shallow } from 'enzyme'; +import { set } from 'lodash/fp'; import { CurationsTable, EmptyState } from '../components'; @@ -33,8 +34,10 @@ const MOCK_VALUES = { id: 'cur-id-2', }, ], - // LicensingLogics - hasPlatinumLicense: true, + // EngineLogic + engine: { + search_relevance_suggestions_active: true, + }, }; describe('CurationsOverview', () => { @@ -67,36 +70,15 @@ describe('CurationsOverview', () => { expect(wrapper.find(CurationsTable)).toHaveLength(1); }); - it('renders a suggestions table when the user has a platinum license and curations suggestions enabled', () => { - setMockValues({ - ...MOCK_VALUES, - hasPlatinumLicense: true, - curationsSettings: { - enabled: true, - }, - }); + it('renders a suggestions table when suggestions are active', () => { + setMockValues(set('engine.search_relevance_suggestions_active', true, MOCK_VALUES)); const wrapper = shallow(); expect(wrapper.find(SuggestionsTable).exists()).toBe(true); }); - it('doesn\t render a suggestions table when the user has no platinum license', () => { - setMockValues({ - ...MOCK_VALUES, - hasPlatinumLicense: false, - }); - const wrapper = shallow(); - - expect(wrapper.find(SuggestionsTable).exists()).toBe(false); - }); - - it('doesn\t render a suggestions table when the user has disabled suggestions', () => { - setMockValues({ - ...MOCK_VALUES, - curationsSettings: { - enabled: false, - }, - }); + it('doesn\t render a suggestions table when suggestions are not active', () => { + setMockValues(set('engine.search_relevance_suggestions_active', false, MOCK_VALUES)); const wrapper = shallow(); expect(wrapper.find(SuggestionsTable).exists()).toBe(false); diff --git a/x-pack/plugins/enterprise_search/public/applications/app_search/components/curations/views/curations_overview.tsx b/x-pack/plugins/enterprise_search/public/applications/app_search/components/curations/views/curations_overview.tsx index 00593403b08cf..a611ca88cefd4 100644 --- a/x-pack/plugins/enterprise_search/public/applications/app_search/components/curations/views/curations_overview.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/app_search/components/curations/views/curations_overview.tsx @@ -11,22 +11,18 @@ import { useValues } from 'kea'; import { EuiSpacer } from '@elastic/eui'; -import { LicensingLogic } from '../../../../shared/licensing'; +import { EngineLogic } from '../../engine'; import { CurationsTable, EmptyState } from '../components'; import { SuggestionsTable } from '../components/suggestions_table'; import { CurationsLogic } from '../curations_logic'; -import { CurationsSettingsLogic } from './curations_settings'; - export const CurationsOverview: React.FC = () => { const { curations } = useValues(CurationsLogic); - const { hasPlatinumLicense } = useValues(LicensingLogic); - const { - curationsSettings: { enabled }, - } = useValues(CurationsSettingsLogic); + engine: { search_relevance_suggestions_active: searchRelevanceSuggestionsActive }, + } = useValues(EngineLogic); - const shouldShowSuggestions = enabled && hasPlatinumLicense; + const shouldShowSuggestions = searchRelevanceSuggestionsActive; return ( <> diff --git a/x-pack/plugins/enterprise_search/public/applications/app_search/components/curations/views/curations_settings/curations_settings_logic.test.ts b/x-pack/plugins/enterprise_search/public/applications/app_search/components/curations/views/curations_settings/curations_settings_logic.test.ts index 818fac3d0706e..b8aae9c39174d 100644 --- a/x-pack/plugins/enterprise_search/public/applications/app_search/components/curations/views/curations_settings/curations_settings_logic.test.ts +++ b/x-pack/plugins/enterprise_search/public/applications/app_search/components/curations/views/curations_settings/curations_settings_logic.test.ts @@ -12,8 +12,20 @@ import { } from '../../../../../__mocks__/kea_logic'; import '../../../../__mocks__/engine_logic.mock'; +jest.mock('../../curations_logic', () => ({ + CurationsLogic: { + values: {}, + actions: { + loadCurations: jest.fn(), + }, + }, +})); + import { nextTick } from '@kbn/test/jest'; +import { CurationsLogic } from '../..'; +import { EngineLogic } from '../../../engine'; + import { CurationsSettingsLogic } from './curations_settings_logic'; const DEFAULT_VALUES = { @@ -205,6 +217,10 @@ describe('CurationsSettingsLogic', () => { enabled: true, mode: 'automatic', }); + + // data should have been reloaded + expect(EngineLogic.actions.initializeEngine).toHaveBeenCalled(); + expect(CurationsLogic.actions.loadCurations).toHaveBeenCalled(); }); it('presents any API errors to the user', async () => { diff --git a/x-pack/plugins/enterprise_search/public/applications/app_search/components/curations/views/curations_settings/curations_settings_logic.ts b/x-pack/plugins/enterprise_search/public/applications/app_search/components/curations/views/curations_settings/curations_settings_logic.ts index d79ad64a69788..3984cbd024da4 100644 --- a/x-pack/plugins/enterprise_search/public/applications/app_search/components/curations/views/curations_settings/curations_settings_logic.ts +++ b/x-pack/plugins/enterprise_search/public/applications/app_search/components/curations/views/curations_settings/curations_settings_logic.ts @@ -10,6 +10,7 @@ import { kea, MakeLogicType } from 'kea'; import { flashAPIErrors } from '../../../../../shared/flash_messages'; import { HttpLogic } from '../../../../../shared/http'; import { EngineLogic } from '../../../engine'; +import { CurationsLogic } from '../../curations_logic'; export interface CurationsSettings { enabled: boolean; @@ -101,6 +102,10 @@ export const CurationsSettingsLogic = kea< } ); actions.onCurationsSettingsLoad(response.curation); + + // Re-fetch data so that UI updates to new settings + CurationsLogic.actions.loadCurations(); + EngineLogic.actions.initializeEngine(); } catch (e) { flashAPIErrors(e); } diff --git a/x-pack/plugins/enterprise_search/public/applications/app_search/components/engine/engine_logic.test.ts b/x-pack/plugins/enterprise_search/public/applications/app_search/components/engine/engine_logic.test.ts index 28739a2799332..bb30190833dd3 100644 --- a/x-pack/plugins/enterprise_search/public/applications/app_search/components/engine/engine_logic.test.ts +++ b/x-pack/plugins/enterprise_search/public/applications/app_search/components/engine/engine_logic.test.ts @@ -43,6 +43,7 @@ describe('EngineLogic', () => { schema: { test: SchemaType.Text }, apiTokens: [], apiKey: 'some-key', + search_relevance_suggestions_active: true, }; const DEFAULT_VALUES = { diff --git a/x-pack/plugins/enterprise_search/public/applications/app_search/components/engine/types.ts b/x-pack/plugins/enterprise_search/public/applications/app_search/components/engine/types.ts index d4c652ab9c7a7..0bfbc185b85f3 100644 --- a/x-pack/plugins/enterprise_search/public/applications/app_search/components/engine/types.ts +++ b/x-pack/plugins/enterprise_search/public/applications/app_search/components/engine/types.ts @@ -54,6 +54,7 @@ export interface EngineDetails extends Engine { engine_count?: number; includedEngines?: EngineDetails[]; search_relevance_suggestions?: SearchRelevanceSuggestionDetails; + search_relevance_suggestions_active: boolean; } interface ResultField { diff --git a/x-pack/plugins/enterprise_search/public/applications/app_search/components/engine_overview/components/suggested_curations_callout.test.tsx b/x-pack/plugins/enterprise_search/public/applications/app_search/components/engine_overview/components/suggested_curations_callout.test.tsx index 58e2cd8cf4c9b..c65d95a5254ee 100644 --- a/x-pack/plugins/enterprise_search/public/applications/app_search/components/engine_overview/components/suggested_curations_callout.test.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/app_search/components/engine_overview/components/suggested_curations_callout.test.tsx @@ -18,16 +18,14 @@ import { SuggestionsCallout } from '../../curations/components/suggestions_callo import { SuggestedCurationsCallout } from './suggested_curations_callout'; const MOCK_VALUES = { - // EngineLogic engine: { search_relevance_suggestions: { curation: { pending: 1, }, }, + search_relevance_suggestions_active: true, }, - // LicensingLogic - hasPlatinumLicense: true, }; describe('SuggestedCurationsCallout', () => { @@ -43,15 +41,20 @@ describe('SuggestedCurationsCallout', () => { }); it('is empty when the suggestions are undefined', () => { - setMockValues({ ...MOCK_VALUES, engine: {} }); + setMockValues({ + ...MOCK_VALUES, + engine: { + search_relevance_suggestions_active: true, + }, + }); const wrapper = shallow(); expect(wrapper.isEmptyRender()).toBe(true); }); - it('is empty when no pending curations', () => { - const values = set('engine.search_relevance_suggestions.curation.pending', 0, MOCK_VALUES); + it('is empty when suggestions are not active', () => { + const values = set('engine.search_relevance_suggestions_active', false, MOCK_VALUES); setMockValues(values); const wrapper = shallow(); @@ -59,9 +62,8 @@ describe('SuggestedCurationsCallout', () => { expect(wrapper.isEmptyRender()).toBe(true); }); - it('is empty when the user has no platinum license', () => { - // This would happen if the user *had* suggestions and then downgraded from platinum to gold or something - const values = set('hasPlatinumLicense', false, MOCK_VALUES); + it('is empty when no pending curations', () => { + const values = set('engine.search_relevance_suggestions.curation.pending', 0, MOCK_VALUES); setMockValues(values); const wrapper = shallow(); diff --git a/x-pack/plugins/enterprise_search/public/applications/app_search/components/engine_overview/components/suggested_curations_callout.tsx b/x-pack/plugins/enterprise_search/public/applications/app_search/components/engine_overview/components/suggested_curations_callout.tsx index 046cc2d744b00..04b2d2b207e94 100644 --- a/x-pack/plugins/enterprise_search/public/applications/app_search/components/engine_overview/components/suggested_curations_callout.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/app_search/components/engine_overview/components/suggested_curations_callout.tsx @@ -10,23 +10,24 @@ import { useValues } from 'kea'; import { i18n } from '@kbn/i18n'; -import { LicensingLogic } from '../../../../shared/licensing'; import { ENGINE_CURATIONS_PATH } from '../../../routes'; import { SuggestionsCallout } from '../../curations/components/suggestions_callout'; import { EngineLogic, generateEnginePath } from '../../engine'; export const SuggestedCurationsCallout: React.FC = () => { const { - engine: { search_relevance_suggestions: searchRelevanceSuggestions }, + engine: { + search_relevance_suggestions: searchRelevanceSuggestions, + search_relevance_suggestions_active: searchRelevanceSuggestionsActive, + }, } = useValues(EngineLogic); - const { hasPlatinumLicense } = useValues(LicensingLogic); const pendingCount = searchRelevanceSuggestions?.curation.pending; if ( typeof searchRelevanceSuggestions === 'undefined' || pendingCount === 0 || - hasPlatinumLicense === false + searchRelevanceSuggestionsActive === false ) { return null; } From 14ac1643e6d12ab37f4f347adcd623dc5495ac2e Mon Sep 17 00:00:00 2001 From: Christos Nasikas Date: Mon, 25 Oct 2021 19:51:26 +0300 Subject: [PATCH 11/23] [Cases] Add another newline after a quote message (#116104) --- .../components/add_comment/index.test.tsx | 34 +++++++++++- .../public/components/add_comment/index.tsx | 53 +++++++++++++++++-- .../components/markdown_editor/editor.tsx | 2 +- .../user_action_tree/index.test.tsx | 2 +- .../components/user_action_tree/index.tsx | 4 +- 5 files changed, 84 insertions(+), 11 deletions(-) diff --git a/x-pack/plugins/cases/public/components/add_comment/index.test.tsx b/x-pack/plugins/cases/public/components/add_comment/index.test.tsx index 06a3897687921..c15722a3ec354 100644 --- a/x-pack/plugins/cases/public/components/add_comment/index.test.tsx +++ b/x-pack/plugins/cases/public/components/add_comment/index.test.tsx @@ -120,7 +120,7 @@ describe('AddComment ', () => { }); it('should insert a quote', async () => { - const sampleQuote = 'what a cool quote'; + const sampleQuote = 'what a cool quote \n with new lines'; const ref = React.createRef(); const wrapper = mount( @@ -138,10 +138,40 @@ describe('AddComment ', () => { }); expect(wrapper.find(`[data-test-subj="add-comment"] textarea`).text()).toBe( - `${sampleData.comment}\n\n${sampleQuote}` + `${sampleData.comment}\n\n> what a cool quote \n> with new lines \n\n` ); }); + it('should call onFocus when adding a quote', async () => { + const ref = React.createRef(); + + mount( + + + + ); + + ref.current!.editor!.textarea!.focus = jest.fn(); + await act(async () => { + ref.current!.addQuote('a comment'); + }); + + expect(ref.current!.editor!.textarea!.focus).toHaveBeenCalled(); + }); + + it('should NOT call onFocus on mount', async () => { + const ref = React.createRef(); + + mount( + + + + ); + + ref.current!.editor!.textarea!.focus = jest.fn(); + expect(ref.current!.editor!.textarea!.focus).not.toHaveBeenCalled(); + }); + it('it should insert a timeline', async () => { const useInsertTimelineMock = jest.fn(); let attachTimeline = noop; diff --git a/x-pack/plugins/cases/public/components/add_comment/index.tsx b/x-pack/plugins/cases/public/components/add_comment/index.tsx index f788456a30dff..3ee7c1604b24d 100644 --- a/x-pack/plugins/cases/public/components/add_comment/index.tsx +++ b/x-pack/plugins/cases/public/components/add_comment/index.tsx @@ -5,14 +5,22 @@ * 2.0. */ +import React, { + useCallback, + useRef, + forwardRef, + useImperativeHandle, + useEffect, + useState, +} from 'react'; import { EuiButton, EuiFlexItem, EuiFlexGroup, EuiLoadingSpinner } from '@elastic/eui'; -import React, { useCallback, useRef, forwardRef, useImperativeHandle } from 'react'; import styled from 'styled-components'; +import { isEmpty } from 'lodash'; import { CommentType } from '../../../common'; import { usePostComment } from '../../containers/use_post_comment'; import { Case } from '../../containers/types'; -import { MarkdownEditorForm } from '../markdown_editor'; +import { EuiMarkdownEditorRef, MarkdownEditorForm } from '../markdown_editor'; import { Form, useForm, UseField, useFormData } from '../../common/shared_imports'; import * as i18n from './translations'; @@ -33,6 +41,7 @@ const initialCommentValue: AddCommentFormSchema = { export interface AddCommentRefObject { addQuote: (quote: string) => void; setComment: (newComment: string) => void; + editor: EuiMarkdownEditorRef | null; } export interface AddCommentProps { @@ -61,7 +70,8 @@ export const AddComment = React.memo( }, ref ) => { - const editorRef = useRef(); + const editorRef = useRef(null); + const [focusOnContext, setFocusOnContext] = useState(false); const owner = useOwnerContext(); const { isLoading, postComment } = usePostComment(); @@ -77,7 +87,10 @@ export const AddComment = React.memo( const addQuote = useCallback( (quote) => { - setFieldValue(fieldName, `${comment}${comment.length > 0 ? '\n\n' : ''}${quote}`); + const addCarrots = quote.replace(new RegExp('\r?\n', 'g'), '\n> '); + const val = `> ${addCarrots} \n\n`; + setFieldValue(fieldName, `${comment}${comment.length > 0 ? '\n\n' : ''}${val}`); + setFocusOnContext(true); }, [comment, setFieldValue] ); @@ -111,6 +124,38 @@ export const AddComment = React.memo( } }, [submit, onCommentSaving, postComment, caseId, owner, onCommentPosted, subCaseId, reset]); + /** + * Focus on the text area when a quote has been added. + * + * The useEffect will run only when focusOnContext + * changes. + * + * The useEffect is also called once one mount + * where the comment is empty. We do not want to focus + * in this scenario. + * + * Ideally we would like to put the + * editorRef.current?.textarea?.focus(); inside the if (focusOnContext). + * The reason this is not feasible is because when it sets the + * focusOnContext to false a render will occur again and the + * focus will be lost. + * + * We do not put the comment in the dependency list + * because we do not want to focus when the user + * is typing. + */ + + useEffect(() => { + if (!isEmpty(comment)) { + editorRef.current?.textarea?.focus(); + } + + if (focusOnContext) { + setFocusOnContext(false); + } + // eslint-disable-next-line react-hooks/exhaustive-deps + }, [focusOnContext]); + return ( {isLoading && showLoading && } diff --git a/x-pack/plugins/cases/public/components/markdown_editor/editor.tsx b/x-pack/plugins/cases/public/components/markdown_editor/editor.tsx index f2351a2b2d793..4bf25b23403e1 100644 --- a/x-pack/plugins/cases/public/components/markdown_editor/editor.tsx +++ b/x-pack/plugins/cases/public/components/markdown_editor/editor.tsx @@ -37,7 +37,7 @@ interface MarkdownEditorProps { value: string; } -type EuiMarkdownEditorRef = ElementRef; +export type EuiMarkdownEditorRef = ElementRef; export interface MarkdownEditorRef { textarea: HTMLTextAreaElement | null; diff --git a/x-pack/plugins/cases/public/components/user_action_tree/index.test.tsx b/x-pack/plugins/cases/public/components/user_action_tree/index.test.tsx index dd5c993939b82..5241b0e66fb38 100644 --- a/x-pack/plugins/cases/public/components/user_action_tree/index.test.tsx +++ b/x-pack/plugins/cases/public/components/user_action_tree/index.test.tsx @@ -348,7 +348,7 @@ describe(`UserActionTree`, () => { .first() .simulate('click'); await waitFor(() => { - expect(setFieldValue).toBeCalledWith('comment', `> ${props.data.description} \n`); + expect(setFieldValue).toBeCalledWith('comment', `> ${props.data.description} \n\n`); }); }); diff --git a/x-pack/plugins/cases/public/components/user_action_tree/index.tsx b/x-pack/plugins/cases/public/components/user_action_tree/index.tsx index 7ea415324194c..92640a34548e8 100644 --- a/x-pack/plugins/cases/public/components/user_action_tree/index.tsx +++ b/x-pack/plugins/cases/public/components/user_action_tree/index.tsx @@ -226,10 +226,8 @@ export const UserActionTree = React.memo( const handleManageQuote = useCallback( (quote: string) => { - const addCarrots = quote.replace(new RegExp('\r?\n', 'g'), ' \n> '); - if (commentRefs.current[NEW_ID]) { - commentRefs.current[NEW_ID].addQuote(`> ${addCarrots} \n`); + commentRefs.current[NEW_ID].addQuote(quote); } handleOutlineComment('add-comment'); From 59815a06813a10a1fddbb8a762cdf651ad962c4b Mon Sep 17 00:00:00 2001 From: Greg Thompson Date: Mon, 25 Oct 2021 11:54:37 -0500 Subject: [PATCH 12/23] Upgrade EUI to v40.0.0 (#115639) * eui to v40.0.0 * tokenKeyword -> tokenTag * mobileOptions type * snapshot updates * Revert "tokenKeyword -> tokenTag" This reverts commit 0e5eae64e773ffa7e744de5da5e1c277423cd890. * token snapshot --- package.json | 2 +- .../collapsible_nav.test.tsx.snap | 315 +++++++++++++----- .../chrome/ui/header/collapsible_nav.test.tsx | 5 +- src/dev/license_checker/config.ts | 2 +- .../__snapshots__/agg.test.tsx.snap | 2 + .../value_axes_panel.test.tsx.snap | 4 + .../value_axis_options.test.tsx.snap | 2 + .../var_config.stories.storyshot | 29 +- .../curations/components/curations_table.tsx | 3 - .../components/tables/shared_columns.tsx | 3 - .../edit_layer_panel.test.tsx.snap | 2 + .../__snapshots__/ccr_shard.test.js.snap | 2 + ...screen_capture_panel_content.test.tsx.snap | 132 ++++++-- .../modal_all_errors.test.tsx.snap | 2 + .../__snapshots__/index.test.tsx.snap | 8 + .../__snapshots__/index.test.tsx.snap | 6 + .../__snapshots__/ping_headers.test.tsx.snap | 2 + yarn.lock | 8 +- 18 files changed, 391 insertions(+), 138 deletions(-) diff --git a/package.json b/package.json index 177b70efd4cc7..d9dd4912481b9 100644 --- a/package.json +++ b/package.json @@ -102,7 +102,7 @@ "@elastic/datemath": "link:bazel-bin/packages/elastic-datemath", "@elastic/elasticsearch": "npm:@elastic/elasticsearch-canary@^8.0.0-canary.21", "@elastic/ems-client": "7.16.0", - "@elastic/eui": "39.1.1", + "@elastic/eui": "40.0.0", "@elastic/filesaver": "1.1.2", "@elastic/maki": "6.3.0", "@elastic/node-crypto": "1.2.1", diff --git a/src/core/public/chrome/ui/header/__snapshots__/collapsible_nav.test.tsx.snap b/src/core/public/chrome/ui/header/__snapshots__/collapsible_nav.test.tsx.snap index 6987b779d5d45..571b564f90329 100644 --- a/src/core/public/chrome/ui/header/__snapshots__/collapsible_nav.test.tsx.snap +++ b/src/core/public/chrome/ui/header/__snapshots__/collapsible_nav.test.tsx.snap @@ -644,6 +644,11 @@ exports[`CollapsibleNav renders links grouped by category 1`] = ` > } + buttonElement="button" className="euiCollapsibleNavGroup euiCollapsibleNavGroup--light euiCollapsibleNavGroup--withHeading" data-test-subj="collapsibleNavGroup-recentlyViewed" + element="div" id="generated-id" initialIsOpen={true} isLoading={false} @@ -685,28 +692,13 @@ exports[`CollapsibleNav renders links grouped by category 1`] = ` + + +
} + buttonElement="button" className="euiCollapsibleNavGroup euiCollapsibleNavGroup--withHeading" data-test-subj="collapsibleNavGroup-kibana" + element="div" id="generated-id" initialIsOpen={true} isLoading={false} @@ -941,28 +977,13 @@ exports[`CollapsibleNav renders links grouped by category 1`] = ` + + +
} + buttonElement="button" className="euiCollapsibleNavGroup euiCollapsibleNavGroup--withHeading" data-test-subj="collapsibleNavGroup-observability" + element="div" id="generated-id" initialIsOpen={true} isLoading={false} @@ -1233,28 +1298,13 @@ exports[`CollapsibleNav renders links grouped by category 1`] = ` + + +
} + buttonElement="button" className="euiCollapsibleNavGroup euiCollapsibleNavGroup--withHeading" data-test-subj="collapsibleNavGroup-securitySolution" + element="div" id="generated-id" initialIsOpen={true} isLoading={false} @@ -1486,28 +1580,13 @@ exports[`CollapsibleNav renders links grouped by category 1`] = ` + + +
} + buttonElement="button" className="euiCollapsibleNavGroup euiCollapsibleNavGroup--withHeading" data-test-subj="collapsibleNavGroup-management" + element="div" id="generated-id" initialIsOpen={true} isLoading={false} @@ -1700,28 +1823,13 @@ exports[`CollapsibleNav renders links grouped by category 1`] = ` + + +
{ diff --git a/src/dev/license_checker/config.ts b/src/dev/license_checker/config.ts index efa54e74fdf2f..305eeb9a6a358 100644 --- a/src/dev/license_checker/config.ts +++ b/src/dev/license_checker/config.ts @@ -75,6 +75,6 @@ export const LICENSE_OVERRIDES = { 'jsts@1.6.2': ['Eclipse Distribution License - v 1.0'], // cf. https://github.com/bjornharrtell/jsts '@mapbox/jsonlint-lines-primitives@2.0.2': ['MIT'], // license in readme https://github.com/tmcw/jsonlint '@elastic/ems-client@7.16.0': ['Elastic License 2.0'], - '@elastic/eui@39.1.1': ['SSPL-1.0 OR Elastic License 2.0'], + '@elastic/eui@40.0.0': ['SSPL-1.0 OR Elastic License 2.0'], 'language-subtag-registry@0.3.21': ['CC-BY-4.0'], // retired ODC‑By license https://github.com/mattcg/language-subtag-registry }; diff --git a/src/plugins/vis_default_editor/public/components/__snapshots__/agg.test.tsx.snap b/src/plugins/vis_default_editor/public/components/__snapshots__/agg.test.tsx.snap index bc6d28bd5c1c4..b25444d16c46a 100644 --- a/src/plugins/vis_default_editor/public/components/__snapshots__/agg.test.tsx.snap +++ b/src/plugins/vis_default_editor/public/components/__snapshots__/agg.test.tsx.snap @@ -12,8 +12,10 @@ exports[`DefaultEditorAgg component should init with the default set of props 1` } buttonContentClassName="visEditorSidebar__aggGroupAccordionButtonContent eui-textTruncate" + buttonElement="button" className="visEditorSidebar__section visEditorSidebar__collapsible visEditorSidebar__collapsible--marginBottom" data-test-subj="visEditorAggAccordion1" + element="div" extraAction={
} buttonContentClassName="visEditorSidebar__aggGroupAccordionButtonContent eui-textTruncate" + buttonElement="button" className="visEditorSidebar__section visEditorSidebar__collapsible" data-test-subj="toggleYAxisOptions-ValueAxis-1" + element="div" extraAction={ } buttonContentClassName="visEditorSidebar__aggGroupAccordionButtonContent eui-textTruncate" + buttonElement="button" className="visEditorSidebar__section visEditorSidebar__collapsible" data-test-subj="toggleYAxisOptions-ValueAxis-2" + element="div" extraAction={ + + + + + + +
} + buttonElement="button" + element="div" id="responseHeaderAccord" initialIsOpen={false} isLoading={false} diff --git a/yarn.lock b/yarn.lock index 669f8321fb4fc..a36d8e9373685 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2412,10 +2412,10 @@ resolved "https://registry.yarnpkg.com/@elastic/eslint-plugin-eui/-/eslint-plugin-eui-0.0.2.tgz#56b9ef03984a05cc213772ae3713ea8ef47b0314" integrity sha512-IoxURM5zraoQ7C8f+mJb9HYSENiZGgRVcG4tLQxE61yHNNRDXtGDWTZh8N1KIHcsqN1CEPETjuzBXkJYF/fDiQ== -"@elastic/eui@39.1.1": - version "39.1.1" - resolved "https://registry.yarnpkg.com/@elastic/eui/-/eui-39.1.1.tgz#52e59f1dd6448b2e80047259ca60c6c87e9873f0" - integrity sha512-zYCNitpp6Ds7U6eaa9QkJqc20ZMo2wjpZokNtd1WalFV22vdfiVizFg7DMtDjJrCDLmoXcLOOCMasKlmmJ1cRg== +"@elastic/eui@40.0.0": + version "40.0.0" + resolved "https://registry.yarnpkg.com/@elastic/eui/-/eui-40.0.0.tgz#9556a87fa5eb7d9061e85f71ea9d3e6a9022dc3e" + integrity sha512-Zsz8eczEjthMgU00YhnsNmkKA8j4hxQpWNnrgecMgpcFEIj+Nn5WBofL/TJux/latS/mB4WWmrq4FTiSIyv/+Q== dependencies: "@types/chroma-js" "^2.0.0" "@types/lodash" "^4.14.160" From 62e203818fc1e2489bf03841ad470ff3e526ad7e Mon Sep 17 00:00:00 2001 From: Christos Nasikas Date: Mon, 25 Oct 2021 20:13:47 +0300 Subject: [PATCH 13/23] [Connectors][ServiceNow] Rename isLegacy configuration property (#115028) Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> --- .../servicenow/api_sir.test.ts | 16 ++++----- .../servicenow/api_sir.ts | 14 ++++---- .../builtin_action_types/servicenow/schema.ts | 4 +-- .../servicenow/service.ts | 29 +++++++-------- .../saved_objects/actions_migrations.test.ts | 10 +++--- .../saved_objects/actions_migrations.ts | 6 ++-- .../configure_cases/connectors.test.tsx | 4 +-- .../components/configure_cases/connectors.tsx | 4 +-- .../connectors_dropdown.test.tsx | 8 ++--- .../configure_cases/connectors_dropdown.tsx | 6 ++-- .../connectors/deprecated_callout.test.tsx | 4 +-- .../connectors/deprecated_callout.tsx | 14 ++++---- .../servicenow_itsm_case_fields.test.tsx | 12 +++---- .../servicenow_sir_case_fields.test.tsx | 12 +++---- .../connectors/servicenow/validator.test.ts | 8 ++--- .../connectors/servicenow/validator.ts | 6 ++-- .../plugins/cases/public/components/utils.ts | 15 ++++++-- .../cases/public/containers/configure/mock.ts | 4 +-- .../servicenow/helpers.ts | 13 +++++-- .../servicenow/servicenow.test.tsx | 6 ++-- .../servicenow/servicenow.tsx | 2 +- .../servicenow/servicenow_connectors.test.tsx | 10 +++--- .../servicenow/servicenow_connectors.tsx | 35 ++++++++++--------- .../servicenow/servicenow_itsm_params.tsx | 8 ++--- .../servicenow/servicenow_sir_params.tsx | 8 ++--- .../builtin_action_types/servicenow/types.ts | 2 +- .../servicenow/update_connector.test.tsx | 2 +- .../servicenow/use_get_app_info.test.tsx | 2 +- .../components/actions_connectors_list.tsx | 6 ++-- .../builtin_action_types/servicenow_itsm.ts | 20 +++++------ .../builtin_action_types/servicenow_sir.ts | 20 +++++------ .../case_api_integration/common/lib/utils.ts | 4 +-- .../tests/trial/configure/get_connectors.ts | 4 +-- .../tests/trial/configure/get_connectors.ts | 4 +-- 34 files changed, 168 insertions(+), 154 deletions(-) diff --git a/x-pack/plugins/actions/server/builtin_action_types/servicenow/api_sir.test.ts b/x-pack/plugins/actions/server/builtin_action_types/servicenow/api_sir.test.ts index 358af7cd2e9ef..e5a161611fcb1 100644 --- a/x-pack/plugins/actions/server/builtin_action_types/servicenow/api_sir.test.ts +++ b/x-pack/plugins/actions/server/builtin_action_types/servicenow/api_sir.test.ts @@ -132,7 +132,7 @@ describe('api_sir', () => { }); describe('prepareParams', () => { - test('it prepares the params correctly when the connector is legacy', async () => { + test('it prepares the params correctly when the connector uses the old API', async () => { expect(prepareParams(true, sirParams)).toEqual({ ...sirParams, incident: { @@ -145,7 +145,7 @@ describe('api_sir', () => { }); }); - test('it prepares the params correctly when the connector is not legacy', async () => { + test('it prepares the params correctly when the connector does not uses the old API', async () => { expect(prepareParams(false, sirParams)).toEqual({ ...sirParams, incident: { @@ -158,7 +158,7 @@ describe('api_sir', () => { }); }); - test('it prepares the params correctly when the connector is legacy and the observables are undefined', async () => { + test('it prepares the params correctly when the connector uses the old API and the observables are undefined', async () => { const { dest_ip: destIp, source_ip: sourceIp, @@ -192,7 +192,7 @@ describe('api_sir', () => { const res = await apiSIR.pushToService({ externalService, params, - config: { isLegacy: false }, + config: { usesTableApi: false }, secrets: {}, logger: mockedLogger, commentFieldKey: 'work_notes', @@ -221,7 +221,7 @@ describe('api_sir', () => { await apiSIR.pushToService({ externalService, params, - config: { isLegacy: false }, + config: { usesTableApi: false }, secrets: {}, logger: mockedLogger, commentFieldKey: 'work_notes', @@ -244,12 +244,12 @@ describe('api_sir', () => { ); }); - test('it does not call bulkAddObservableToIncident if it a legacy connector', async () => { + test('it does not call bulkAddObservableToIncident if the connector uses the old API', async () => { const params = { ...sirParams, incident: { ...sirParams.incident, externalId: null } }; await apiSIR.pushToService({ externalService, params, - config: { isLegacy: true }, + config: { usesTableApi: true }, secrets: {}, logger: mockedLogger, commentFieldKey: 'work_notes', @@ -274,7 +274,7 @@ describe('api_sir', () => { await apiSIR.pushToService({ externalService, params, - config: { isLegacy: false }, + config: { usesTableApi: false }, secrets: {}, logger: mockedLogger, commentFieldKey: 'work_notes', diff --git a/x-pack/plugins/actions/server/builtin_action_types/servicenow/api_sir.ts b/x-pack/plugins/actions/server/builtin_action_types/servicenow/api_sir.ts index 326bb79a0e708..4e74d79c6f4a0 100644 --- a/x-pack/plugins/actions/server/builtin_action_types/servicenow/api_sir.ts +++ b/x-pack/plugins/actions/server/builtin_action_types/servicenow/api_sir.ts @@ -59,13 +59,13 @@ const observablesToString = (obs: string | string[] | null | undefined): string }; export const prepareParams = ( - isLegacy: boolean, + usesTableApi: boolean, params: PushToServiceApiParamsSIR ): PushToServiceApiParamsSIR => { - if (isLegacy) { + if (usesTableApi) { /** * The schema has change to accept an array of observables - * or a string. In the case of a legacy connector we need to + * or a string. In the case of connector that uses the old API we need to * convert the observables to a string */ return { @@ -81,8 +81,8 @@ export const prepareParams = ( } /** - * For non legacy connectors the observables - * will be added in a different call. + * For connectors that do not use the old API + * the observables will be added in a different call. * They need to be set to null when sending the fields * to ServiceNow */ @@ -108,7 +108,7 @@ const pushToServiceHandler = async ({ }: PushToServiceApiHandlerArgs): Promise => { const res = await api.pushToService({ externalService, - params: prepareParams(!!config.isLegacy, params as PushToServiceApiParamsSIR), + params: prepareParams(!!config.usesTableApi, params as PushToServiceApiParamsSIR), config, secrets, commentFieldKey, @@ -130,7 +130,7 @@ const pushToServiceHandler = async ({ * through the pushToService call. */ - if (!config.isLegacy) { + if (!config.usesTableApi) { const sirExternalService = externalService as ExternalServiceSIR; const obsWithType: Array<[string[], ObservableTypes]> = [ diff --git a/x-pack/plugins/actions/server/builtin_action_types/servicenow/schema.ts b/x-pack/plugins/actions/server/builtin_action_types/servicenow/schema.ts index af8d1b9f38b17..e41eea24834c7 100644 --- a/x-pack/plugins/actions/server/builtin_action_types/servicenow/schema.ts +++ b/x-pack/plugins/actions/server/builtin_action_types/servicenow/schema.ts @@ -14,7 +14,7 @@ export const ExternalIncidentServiceConfigurationBase = { export const ExternalIncidentServiceConfiguration = { ...ExternalIncidentServiceConfigurationBase, - isLegacy: schema.boolean({ defaultValue: true }), + usesTableApi: schema.boolean({ defaultValue: true }), }; export const ExternalIncidentServiceConfigurationBaseSchema = schema.object( @@ -49,7 +49,7 @@ const CommonAttributes = { externalId: schema.nullable(schema.string()), category: schema.nullable(schema.string()), subcategory: schema.nullable(schema.string()), - correlation_id: schema.nullable(schema.string()), + correlation_id: schema.nullable(schema.string({ defaultValue: DEFAULT_ALERTS_GROUPING_KEY })), correlation_display: schema.nullable(schema.string()), }; diff --git a/x-pack/plugins/actions/server/builtin_action_types/servicenow/service.ts b/x-pack/plugins/actions/server/builtin_action_types/servicenow/service.ts index cb030c7bb6933..c90a7222ba10b 100644 --- a/x-pack/plugins/actions/server/builtin_action_types/servicenow/service.ts +++ b/x-pack/plugins/actions/server/builtin_action_types/servicenow/service.ts @@ -35,7 +35,8 @@ export const createExternalService: ServiceFactory = ( configurationUtilities: ActionsConfigurationUtilities, { table, importSetTable, useImportAPI, appScope }: SNProductsConfigValue ): ExternalService => { - const { apiUrl: url, isLegacy } = config as ServiceNowPublicConfigurationType; + const { apiUrl: url, usesTableApi: usesTableApiConfigValue } = + config as ServiceNowPublicConfigurationType; const { username, password } = secrets as ServiceNowSecretConfigurationType; if (!url || !username || !password) { @@ -57,11 +58,11 @@ export const createExternalService: ServiceFactory = ( auth: { username, password }, }); - const useOldApi = !useImportAPI || isLegacy; + const useTableApi = !useImportAPI || usesTableApiConfigValue; - const getCreateIncidentUrl = () => (useOldApi ? tableApiIncidentUrl : importSetTableUrl); + const getCreateIncidentUrl = () => (useTableApi ? tableApiIncidentUrl : importSetTableUrl); const getUpdateIncidentUrl = (incidentId: string) => - useOldApi ? `${tableApiIncidentUrl}/${incidentId}` : importSetTableUrl; + useTableApi ? `${tableApiIncidentUrl}/${incidentId}` : importSetTableUrl; const getIncidentViewURL = (id: string) => { // Based on: https://docs.servicenow.com/bundle/orlando-platform-user-interface/page/use/navigation/reference/r_NavigatingByURLExamples.html @@ -105,7 +106,7 @@ export const createExternalService: ServiceFactory = ( /** * Gets the Elastic SN Application information including the current version. - * It should not be used on legacy connectors. + * It should not be used on connectors that use the old API. */ const getApplicationInformation = async (): Promise => { try { @@ -129,7 +130,7 @@ export const createExternalService: ServiceFactory = ( logger.debug(`Create incident: Application scope: ${scope}: Application version${version}`); const checkIfApplicationIsInstalled = async () => { - if (!useOldApi) { + if (!useTableApi) { const { version, scope } = await getApplicationInformation(); logApplicationInfo(scope, version); } @@ -180,17 +181,17 @@ export const createExternalService: ServiceFactory = ( url: getCreateIncidentUrl(), logger, method: 'post', - data: prepareIncident(useOldApi, incident), + data: prepareIncident(useTableApi, incident), configurationUtilities, }); checkInstance(res); - if (!useOldApi) { + if (!useTableApi) { throwIfImportSetApiResponseIsAnError(res.data); } - const incidentId = useOldApi ? res.data.result.sys_id : res.data.result[0].sys_id; + const incidentId = useTableApi ? res.data.result.sys_id : res.data.result[0].sys_id; const insertedIncident = await getIncident(incidentId); return { @@ -212,23 +213,23 @@ export const createExternalService: ServiceFactory = ( axios: axiosInstance, url: getUpdateIncidentUrl(incidentId), // Import Set API supports only POST. - method: useOldApi ? 'patch' : 'post', + method: useTableApi ? 'patch' : 'post', logger, data: { - ...prepareIncident(useOldApi, incident), + ...prepareIncident(useTableApi, incident), // elastic_incident_id is used to update the incident when using the Import Set API. - ...(useOldApi ? {} : { elastic_incident_id: incidentId }), + ...(useTableApi ? {} : { elastic_incident_id: incidentId }), }, configurationUtilities, }); checkInstance(res); - if (!useOldApi) { + if (!useTableApi) { throwIfImportSetApiResponseIsAnError(res.data); } - const id = useOldApi ? res.data.result.sys_id : res.data.result[0].sys_id; + const id = useTableApi ? res.data.result.sys_id : res.data.result[0].sys_id; const updatedIncident = await getIncident(id); return { diff --git a/x-pack/plugins/actions/server/saved_objects/actions_migrations.test.ts b/x-pack/plugins/actions/server/saved_objects/actions_migrations.test.ts index 9f8e62c77e3a7..6c61d9849c72c 100644 --- a/x-pack/plugins/actions/server/saved_objects/actions_migrations.test.ts +++ b/x-pack/plugins/actions/server/saved_objects/actions_migrations.test.ts @@ -166,7 +166,7 @@ describe('successful migrations', () => { expect(migratedAction).toEqual(action); }); - test('set isLegacy config property for .servicenow', () => { + test('set usesTableApi config property for .servicenow', () => { const migration716 = getActionsMigrations(encryptedSavedObjectsSetup)['7.16.0']; const action = getMockDataForServiceNow(); const migratedAction = migration716(action, context); @@ -177,13 +177,13 @@ describe('successful migrations', () => { ...action.attributes, config: { apiUrl: 'https://example.com', - isLegacy: true, + usesTableApi: true, }, }, }); }); - test('set isLegacy config property for .servicenow-sir', () => { + test('set usesTableApi config property for .servicenow-sir', () => { const migration716 = getActionsMigrations(encryptedSavedObjectsSetup)['7.16.0']; const action = getMockDataForServiceNow({ actionTypeId: '.servicenow-sir' }); const migratedAction = migration716(action, context); @@ -194,13 +194,13 @@ describe('successful migrations', () => { ...action.attributes, config: { apiUrl: 'https://example.com', - isLegacy: true, + usesTableApi: true, }, }, }); }); - test('it does not set isLegacy config for other connectors', () => { + test('it does not set usesTableApi config for other connectors', () => { const migration716 = getActionsMigrations(encryptedSavedObjectsSetup)['7.16.0']; const action = getMockData(); const migratedAction = migration716(action, context); diff --git a/x-pack/plugins/actions/server/saved_objects/actions_migrations.ts b/x-pack/plugins/actions/server/saved_objects/actions_migrations.ts index 688839eb89858..2e5b1b5d916fe 100644 --- a/x-pack/plugins/actions/server/saved_objects/actions_migrations.ts +++ b/x-pack/plugins/actions/server/saved_objects/actions_migrations.ts @@ -68,7 +68,7 @@ export function getActionsMigrations( doc.attributes.actionTypeId === '.servicenow' || doc.attributes.actionTypeId === '.servicenow-sir' || doc.attributes.actionTypeId === '.email', - pipeMigrations(markOldServiceNowITSMConnectorAsLegacy, setServiceConfigIfNotSet) + pipeMigrations(addUsesTableApiToServiceNowConnectors, setServiceConfigIfNotSet) ); const migrationActions800 = createEsoMigration( @@ -197,7 +197,7 @@ const addIsMissingSecretsField = ( }; }; -const markOldServiceNowITSMConnectorAsLegacy = ( +const addUsesTableApiToServiceNowConnectors = ( doc: SavedObjectUnsanitizedDoc ): SavedObjectUnsanitizedDoc => { if ( @@ -213,7 +213,7 @@ const markOldServiceNowITSMConnectorAsLegacy = ( ...doc.attributes, config: { ...doc.attributes.config, - isLegacy: true, + usesTableApi: true, }, }, }; diff --git a/x-pack/plugins/cases/public/components/configure_cases/connectors.test.tsx b/x-pack/plugins/cases/public/components/configure_cases/connectors.test.tsx index 4e0f1689bd4d1..9bbddfae2f9bd 100644 --- a/x-pack/plugins/cases/public/components/configure_cases/connectors.test.tsx +++ b/x-pack/plugins/cases/public/components/configure_cases/connectors.test.tsx @@ -123,11 +123,11 @@ describe('Connectors', () => { ).toBe('Update My Connector'); }); - test('it shows the deprecated callout when the connector is legacy', async () => { + test('it shows the deprecated callout when the connector is deprecated', async () => { render( , { // wrapper: TestProviders produces a TS error diff --git a/x-pack/plugins/cases/public/components/configure_cases/connectors.tsx b/x-pack/plugins/cases/public/components/configure_cases/connectors.tsx index 1b575e3ba9334..b7bf7c322f76e 100644 --- a/x-pack/plugins/cases/public/components/configure_cases/connectors.tsx +++ b/x-pack/plugins/cases/public/components/configure_cases/connectors.tsx @@ -23,7 +23,7 @@ import { ActionConnector, CaseConnectorMapping } from '../../containers/configur import { Mapping } from './mapping'; import { ActionTypeConnector, ConnectorTypes } from '../../../common'; import { DeprecatedCallout } from '../connectors/deprecated_callout'; -import { isLegacyConnector } from '../utils'; +import { isDeprecatedConnector } from '../utils'; const EuiFormRowExtended = styled(EuiFormRow)` .euiFormRow__labelWrapper { @@ -111,7 +111,7 @@ const ConnectorsComponent: React.FC = ({ appendAddConnectorButton={true} /> - {selectedConnector.type !== ConnectorTypes.none && isLegacyConnector(connector) && ( + {selectedConnector.type !== ConnectorTypes.none && isDeprecatedConnector(connector) && ( diff --git a/x-pack/plugins/cases/public/components/configure_cases/connectors_dropdown.test.tsx b/x-pack/plugins/cases/public/components/configure_cases/connectors_dropdown.test.tsx index 6f05f9f940d25..03ed3d6512638 100644 --- a/x-pack/plugins/cases/public/components/configure_cases/connectors_dropdown.test.tsx +++ b/x-pack/plugins/cases/public/components/configure_cases/connectors_dropdown.test.tsx @@ -171,7 +171,7 @@ describe('ConnectorsDropdown', () => { "value": "servicenow-sir", }, Object { - "data-test-subj": "dropdown-connector-servicenow-legacy", + "data-test-subj": "dropdown-connector-servicenow-uses-table-api", "inputDisplay": { /> , - "value": "servicenow-legacy", + "value": "servicenow-uses-table-api", }, ] `); @@ -288,8 +288,8 @@ describe('ConnectorsDropdown', () => { ).not.toThrowError(); }); - test('it shows the deprecated tooltip when the connector is legacy', () => { - render(, { + test('it shows the deprecated tooltip when the connector is deprecated', () => { + render(, { wrapper: ({ children }) => {children}, }); diff --git a/x-pack/plugins/cases/public/components/configure_cases/connectors_dropdown.tsx b/x-pack/plugins/cases/public/components/configure_cases/connectors_dropdown.tsx index c5fe9c7470745..c7ce3c5b3c4b6 100644 --- a/x-pack/plugins/cases/public/components/configure_cases/connectors_dropdown.tsx +++ b/x-pack/plugins/cases/public/components/configure_cases/connectors_dropdown.tsx @@ -13,7 +13,7 @@ import { ConnectorTypes } from '../../../common'; import { ActionConnector } from '../../containers/configure/types'; import * as i18n from './translations'; import { useKibana } from '../../common/lib/kibana'; -import { getConnectorIcon, isLegacyConnector } from '../utils'; +import { getConnectorIcon, isDeprecatedConnector } from '../utils'; import { euiStyled } from '../../../../../../src/plugins/kibana_react/common'; export interface Props { @@ -95,10 +95,10 @@ const ConnectorsDropdownComponent: React.FC = ({ {connector.name} - {isLegacyConnector(connector) && ` (${i18n.DEPRECATED_TOOLTIP_TEXT})`} + {isDeprecatedConnector(connector) && ` (${i18n.DEPRECATED_TOOLTIP_TEXT})`} - {isLegacyConnector(connector) && ( + {isDeprecatedConnector(connector) && ( { render(); expect(screen.getByText('This connector type is deprecated')).toBeInTheDocument(); expect(screen.getByText('Update this connector, or create a new one.')).toBeInTheDocument(); - expect(screen.getByTestId('legacy-connector-warning-callout')).toHaveClass( + expect(screen.getByTestId('deprecated-connector-warning-callout')).toHaveClass( 'euiCallOut euiCallOut--warning' ); }); test('it renders a danger flyout correctly', () => { render(); - expect(screen.getByTestId('legacy-connector-warning-callout')).toHaveClass( + expect(screen.getByTestId('deprecated-connector-warning-callout')).toHaveClass( 'euiCallOut euiCallOut--danger' ); }); diff --git a/x-pack/plugins/cases/public/components/connectors/deprecated_callout.tsx b/x-pack/plugins/cases/public/components/connectors/deprecated_callout.tsx index 9337f2843506b..195b2deb84d6e 100644 --- a/x-pack/plugins/cases/public/components/connectors/deprecated_callout.tsx +++ b/x-pack/plugins/cases/public/components/connectors/deprecated_callout.tsx @@ -9,15 +9,15 @@ import React from 'react'; import { EuiCallOut, EuiCallOutProps } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -const LEGACY_CONNECTOR_WARNING_TITLE = i18n.translate( - 'xpack.cases.connectors.serviceNow.legacyConnectorWarningTitle', +const DEPRECATED_CONNECTOR_WARNING_TITLE = i18n.translate( + 'xpack.cases.connectors.serviceNow.deprecatedConnectorWarningTitle', { defaultMessage: 'This connector type is deprecated', } ); -const LEGACY_CONNECTOR_WARNING_DESC = i18n.translate( - 'xpack.cases.connectors.serviceNow.legacyConnectorWarningDesc', +const DEPRECATED_CONNECTOR_WARNING_DESC = i18n.translate( + 'xpack.cases.connectors.serviceNow.deprecatedConnectorWarningDesc', { defaultMessage: 'Update this connector, or create a new one.', } @@ -29,12 +29,12 @@ interface Props { const DeprecatedCalloutComponent: React.FC = ({ type = 'warning' }) => ( - {LEGACY_CONNECTOR_WARNING_DESC} + {DEPRECATED_CONNECTOR_WARNING_DESC} ); diff --git a/x-pack/plugins/cases/public/components/connectors/servicenow/servicenow_itsm_case_fields.test.tsx b/x-pack/plugins/cases/public/components/connectors/servicenow/servicenow_itsm_case_fields.test.tsx index 008340b6b7e97..324dcef8ba397 100644 --- a/x-pack/plugins/cases/public/components/connectors/servicenow/servicenow_itsm_case_fields.test.tsx +++ b/x-pack/plugins/cases/public/components/connectors/servicenow/servicenow_itsm_case_fields.test.tsx @@ -127,15 +127,15 @@ describe('ServiceNowITSM Fields', () => { ); }); - test('it shows the deprecated callout when the connector is legacy', async () => { - const legacyConnector = { ...connector, config: { isLegacy: true } }; - render(); - expect(screen.getByTestId('legacy-connector-warning-callout')).toBeInTheDocument(); + test('it shows the deprecated callout when the connector uses the table API', async () => { + const tableApiConnector = { ...connector, config: { usesTableApi: true } }; + render(); + expect(screen.getByTestId('deprecated-connector-warning-callout')).toBeInTheDocument(); }); - test('it does not show the deprecated callout when the connector is not legacy', async () => { + test('it does not show the deprecated callout when the connector does not uses the table API', async () => { render(); - expect(screen.queryByTestId('legacy-connector-warning-callout')).not.toBeInTheDocument(); + expect(screen.queryByTestId('deprecated-connector-warning-callout')).not.toBeInTheDocument(); }); describe('onChange calls', () => { diff --git a/x-pack/plugins/cases/public/components/connectors/servicenow/servicenow_sir_case_fields.test.tsx b/x-pack/plugins/cases/public/components/connectors/servicenow/servicenow_sir_case_fields.test.tsx index aac78b8266fb5..cd8f5f4abf7b5 100644 --- a/x-pack/plugins/cases/public/components/connectors/servicenow/servicenow_sir_case_fields.test.tsx +++ b/x-pack/plugins/cases/public/components/connectors/servicenow/servicenow_sir_case_fields.test.tsx @@ -161,15 +161,15 @@ describe('ServiceNowSIR Fields', () => { ]); }); - test('it shows the deprecated callout when the connector is legacy', async () => { - const legacyConnector = { ...connector, config: { isLegacy: true } }; - render(); - expect(screen.getByTestId('legacy-connector-warning-callout')).toBeInTheDocument(); + test('it shows the deprecated callout when the connector uses the table API', async () => { + const tableApiConnector = { ...connector, config: { usesTableApi: true } }; + render(); + expect(screen.getByTestId('deprecated-connector-warning-callout')).toBeInTheDocument(); }); - test('it does not show the deprecated callout when the connector is not legacy', async () => { + test('it does not show the deprecated callout when the connector does not uses the table API', async () => { render(); - expect(screen.queryByTestId('legacy-connector-warning-callout')).not.toBeInTheDocument(); + expect(screen.queryByTestId('deprecated-connector-warning-callout')).not.toBeInTheDocument(); }); describe('onChange calls', () => { diff --git a/x-pack/plugins/cases/public/components/connectors/servicenow/validator.test.ts b/x-pack/plugins/cases/public/components/connectors/servicenow/validator.test.ts index c098d803276bc..aa643191ac62e 100644 --- a/x-pack/plugins/cases/public/components/connectors/servicenow/validator.test.ts +++ b/x-pack/plugins/cases/public/components/connectors/servicenow/validator.test.ts @@ -10,24 +10,24 @@ import { connectorValidator } from './validator'; describe('ServiceNow validator', () => { describe('connectorValidator', () => { - test('it returns an error message if the connector is legacy', () => { + test('it returns an error message if the connector uses the table API', () => { const invalidConnector = { ...connector, config: { ...connector.config, - isLegacy: true, + usesTableApi: true, }, }; expect(connectorValidator(invalidConnector)).toEqual({ message: 'Deprecated connector' }); }); - test('it does not returns an error message if the connector is not legacy', () => { + test('it does not returns an error message if the connector does not uses the table API', () => { const invalidConnector = { ...connector, config: { ...connector.config, - isLegacy: false, + usesTableApi: false, }, }; diff --git a/x-pack/plugins/cases/public/components/connectors/servicenow/validator.ts b/x-pack/plugins/cases/public/components/connectors/servicenow/validator.ts index 3f67f25549343..7d56163c48350 100644 --- a/x-pack/plugins/cases/public/components/connectors/servicenow/validator.ts +++ b/x-pack/plugins/cases/public/components/connectors/servicenow/validator.ts @@ -9,16 +9,16 @@ import { ValidationConfig } from '../../../common/shared_imports'; import { CaseActionConnector } from '../../types'; /** - * The user can not use a legacy connector + * The user can not create cases with connectors that use the table API */ export const connectorValidator = ( connector: CaseActionConnector ): ReturnType => { const { - config: { isLegacy }, + config: { usesTableApi }, } = connector; - if (isLegacy) { + if (usesTableApi) { return { message: 'Deprecated connector', }; diff --git a/x-pack/plugins/cases/public/components/utils.ts b/x-pack/plugins/cases/public/components/utils.ts index ac5f4dbdd298e..74137789958a4 100644 --- a/x-pack/plugins/cases/public/components/utils.ts +++ b/x-pack/plugins/cases/public/components/utils.ts @@ -78,7 +78,7 @@ export const getConnectorIcon = ( }; // TODO: Remove when the applications are certified -export const isLegacyConnector = (connector?: CaseActionConnector) => { +export const isDeprecatedConnector = (connector?: CaseActionConnector): boolean => { if (connector == null) { return true; } @@ -91,5 +91,16 @@ export const isLegacyConnector = (connector?: CaseActionConnector) => { return true; } - return connector.config.isLegacy; + /** + * Connector's prior to the Elastic ServiceNow application + * use the Table API (https://developer.servicenow.com/dev.do#!/reference/api/rome/rest/c_TableAPI) + * Connectors after the Elastic ServiceNow application use the + * Import Set API (https://developer.servicenow.com/dev.do#!/reference/api/rome/rest/c_ImportSetAPI) + * A ServiceNow connector is considered deprecated if it uses the Table API. + * + * All other connectors do not have the usesTableApi config property + * so the function will always return false for them. + */ + + return !!connector.config.usesTableApi; }; diff --git a/x-pack/plugins/cases/public/containers/configure/mock.ts b/x-pack/plugins/cases/public/containers/configure/mock.ts index d1ae7f310a719..a5483e524e92d 100644 --- a/x-pack/plugins/cases/public/containers/configure/mock.ts +++ b/x-pack/plugins/cases/public/containers/configure/mock.ts @@ -72,12 +72,12 @@ export const connectorsMock: ActionConnector[] = [ isPreconfigured: false, }, { - id: 'servicenow-legacy', + id: 'servicenow-uses-table-api', actionTypeId: '.servicenow', name: 'My Connector', config: { apiUrl: 'https://instance1.service-now.com', - isLegacy: true, + usesTableApi: true, }, isPreconfigured: false, }, diff --git a/x-pack/plugins/triggers_actions_ui/public/application/components/builtin_action_types/servicenow/helpers.ts b/x-pack/plugins/triggers_actions_ui/public/application/components/builtin_action_types/servicenow/helpers.ts index e6acb2e0976a8..755923acc25cb 100644 --- a/x-pack/plugins/triggers_actions_ui/public/application/components/builtin_action_types/servicenow/helpers.ts +++ b/x-pack/plugins/triggers_actions_ui/public/application/components/builtin_action_types/servicenow/helpers.ts @@ -28,7 +28,7 @@ export const isFieldInvalid = ( ): boolean => error !== undefined && error.length > 0 && field != null; // TODO: Remove when the applications are certified -export const isLegacyConnector = (connector: ServiceNowActionConnector) => { +export const isDeprecatedConnector = (connector: ServiceNowActionConnector): boolean => { if (connector == null) { return true; } @@ -41,5 +41,14 @@ export const isLegacyConnector = (connector: ServiceNowActionConnector) => { return true; } - return connector.config.isLegacy; + /** + * Connectors after the Elastic ServiceNow application use the + * Import Set API (https://developer.servicenow.com/dev.do#!/reference/api/rome/rest/c_ImportSetAPI) + * A ServiceNow connector is considered deprecated if it uses the Table API. + * + * All other connectors do not have the usesTableApi config property + * so the function will always return false for them. + */ + + return !!connector.config.usesTableApi; }; diff --git a/x-pack/plugins/triggers_actions_ui/public/application/components/builtin_action_types/servicenow/servicenow.test.tsx b/x-pack/plugins/triggers_actions_ui/public/application/components/builtin_action_types/servicenow/servicenow.test.tsx index eb3e1c01887c9..3f22a51b5bd53 100644 --- a/x-pack/plugins/triggers_actions_ui/public/application/components/builtin_action_types/servicenow/servicenow.test.tsx +++ b/x-pack/plugins/triggers_actions_ui/public/application/components/builtin_action_types/servicenow/servicenow.test.tsx @@ -52,7 +52,7 @@ describe('servicenow connector validation', () => { isPreconfigured: false, config: { apiUrl: 'https://dev94428.service-now.com/', - isLegacy: false, + usesTableApi: false, }, } as ServiceNowActionConnector; @@ -60,7 +60,7 @@ describe('servicenow connector validation', () => { config: { errors: { apiUrl: [], - isLegacy: [], + usesTableApi: [], }, }, secrets: { @@ -88,7 +88,7 @@ describe('servicenow connector validation', () => { config: { errors: { apiUrl: ['URL is required.'], - isLegacy: [], + usesTableApi: [], }, }, secrets: { diff --git a/x-pack/plugins/triggers_actions_ui/public/application/components/builtin_action_types/servicenow/servicenow.tsx b/x-pack/plugins/triggers_actions_ui/public/application/components/builtin_action_types/servicenow/servicenow.tsx index 6b6d536ff303b..7267e11ae7327 100644 --- a/x-pack/plugins/triggers_actions_ui/public/application/components/builtin_action_types/servicenow/servicenow.tsx +++ b/x-pack/plugins/triggers_actions_ui/public/application/components/builtin_action_types/servicenow/servicenow.tsx @@ -28,7 +28,7 @@ const validateConnector = async ( const translations = await import('./translations'); const configErrors = { apiUrl: new Array(), - isLegacy: new Array(), + usesTableApi: new Array(), }; const secretsErrors = { username: new Array(), diff --git a/x-pack/plugins/triggers_actions_ui/public/application/components/builtin_action_types/servicenow/servicenow_connectors.test.tsx b/x-pack/plugins/triggers_actions_ui/public/application/components/builtin_action_types/servicenow/servicenow_connectors.test.tsx index f491376e5078c..03acb673bf5a4 100644 --- a/x-pack/plugins/triggers_actions_ui/public/application/components/builtin_action_types/servicenow/servicenow_connectors.test.tsx +++ b/x-pack/plugins/triggers_actions_ui/public/application/components/builtin_action_types/servicenow/servicenow_connectors.test.tsx @@ -36,7 +36,7 @@ describe('ServiceNowActionConnectorFields renders', () => { name: 'SN', config: { apiUrl: 'https://test/', - isLegacy: true, + usesTableApi: true, }, } as ServiceNowActionConnector; @@ -44,7 +44,7 @@ describe('ServiceNowActionConnectorFields renders', () => { ...usesTableApiConnector, config: { ...usesTableApiConnector.config, - isLegacy: false, + usesTableApi: false, }, } as ServiceNowActionConnector; @@ -350,7 +350,7 @@ describe('ServiceNowActionConnectorFields renders', () => { id: usesTableApiConnector.id, connector: { name: usesTableApiConnector.name, - config: { ...usesTableApiConnector.config, isLegacy: false }, + config: { ...usesTableApiConnector.config, usesTableApi: false }, secrets: usesTableApiConnector.secrets, }, }) @@ -415,7 +415,7 @@ describe('ServiceNowActionConnectorFields renders', () => { ).toBeTruthy(); }); - test('should set the isLegacy to false when creating a connector', async () => { + test('should set the usesTableApi to false when creating a connector', async () => { const newConnector = { ...usesTableApiConnector, config: {}, secrets: {} }; const editActionConfig = jest.fn(); @@ -432,7 +432,7 @@ describe('ServiceNowActionConnectorFields renders', () => { /> ); - expect(editActionConfig).toHaveBeenCalledWith('isLegacy', false); + expect(editActionConfig).toHaveBeenCalledWith('usesTableApi', false); }); test('it should set the legacy attribute if it is not undefined', async () => { diff --git a/x-pack/plugins/triggers_actions_ui/public/application/components/builtin_action_types/servicenow/servicenow_connectors.tsx b/x-pack/plugins/triggers_actions_ui/public/application/components/builtin_action_types/servicenow/servicenow_connectors.tsx index a0b4bdca47ff5..db3c32755f0ed 100644 --- a/x-pack/plugins/triggers_actions_ui/public/application/components/builtin_action_types/servicenow/servicenow_connectors.tsx +++ b/x-pack/plugins/triggers_actions_ui/public/application/components/builtin_action_types/servicenow/servicenow_connectors.tsx @@ -15,7 +15,7 @@ import { useKibana } from '../../../../common/lib/kibana'; import { DeprecatedCallout } from './deprecated_callout'; import { useGetAppInfo } from './use_get_app_info'; import { ApplicationRequiredCallout } from './application_required_callout'; -import { isRESTApiError, isLegacyConnector } from './helpers'; +import { isRESTApiError, isDeprecatedConnector } from './helpers'; import { InstallationCallout } from './installation_callout'; import { UpdateConnector } from './update_connector'; import { updateActionConnector } from '../../../lib/action_connector_api'; @@ -36,9 +36,9 @@ const ServiceNowConnectorFields: React.FC(false); + const [showApplicationRequiredCallout, setShowApplicationRequiredCallout] = + useState(false); const [applicationInfoErrorMsg, setApplicationInfoErrorMsg] = useState(null); const getApplicationInfo = useCallback(async () => { - setApplicationRequired(false); + setShowApplicationRequiredCallout(false); setApplicationInfoErrorMsg(null); try { @@ -61,7 +62,7 @@ const ServiceNowConnectorFields: React.FC { - if (!isOldConnector) { + if (requiresNewApplication) { await getApplicationInfo(); } - }, [getApplicationInfo, isOldConnector]); + }, [getApplicationInfo, requiresNewApplication]); useEffect( () => setCallbacks({ beforeActionConnectorSave }), @@ -90,13 +91,13 @@ const ServiceNowConnectorFields: React.FC { - if (isLegacy == null) { - editActionConfig('isLegacy', false); + if (usesTableApi == null) { + editActionConfig('usesTableApi', false); } }); @@ -150,8 +151,8 @@ const ServiceNowConnectorFields: React.FC )} - {!isOldConnector && } - {isOldConnector && } + {requiresNewApplication && } + {!requiresNewApplication && } - {applicationRequired && !isOldConnector && ( + {showApplicationRequiredCallout && requiresNewApplication && ( )} diff --git a/x-pack/plugins/triggers_actions_ui/public/application/components/builtin_action_types/servicenow/servicenow_itsm_params.tsx b/x-pack/plugins/triggers_actions_ui/public/application/components/builtin_action_types/servicenow/servicenow_itsm_params.tsx index 09b04f0fa3c48..dcfdfe3af0e0e 100644 --- a/x-pack/plugins/triggers_actions_ui/public/application/components/builtin_action_types/servicenow/servicenow_itsm_params.tsx +++ b/x-pack/plugins/triggers_actions_ui/public/application/components/builtin_action_types/servicenow/servicenow_itsm_params.tsx @@ -23,7 +23,7 @@ import { ServiceNowITSMActionParams, Choice, Fields, ServiceNowActionConnector } import { TextAreaWithMessageVariables } from '../../text_area_with_message_variables'; import { TextFieldWithMessageVariables } from '../../text_field_with_message_variables'; import { useGetChoices } from './use_get_choices'; -import { choicesToEuiOptions, DEFAULT_CORRELATION_ID, isLegacyConnector } from './helpers'; +import { choicesToEuiOptions, DEFAULT_CORRELATION_ID, isDeprecatedConnector } from './helpers'; import * as i18n from './translations'; @@ -46,10 +46,6 @@ const ServiceNowParamsFields: React.FunctionComponent< notifications: { toasts }, } = useKibana().services; - const isDeprecatedConnector = isLegacyConnector( - actionConnector as unknown as ServiceNowActionConnector - ); - const actionConnectorRef = useRef(actionConnector?.id ?? ''); const { incident, comments } = useMemo( () => @@ -244,7 +240,7 @@ const ServiceNowParamsFields: React.FunctionComponent< - {!isDeprecatedConnector && ( + {!isDeprecatedConnector(actionConnector as unknown as ServiceNowActionConnector) && ( <> diff --git a/x-pack/plugins/triggers_actions_ui/public/application/components/builtin_action_types/servicenow/servicenow_sir_params.tsx b/x-pack/plugins/triggers_actions_ui/public/application/components/builtin_action_types/servicenow/servicenow_sir_params.tsx index 42758250408d9..a264ed5421c2e 100644 --- a/x-pack/plugins/triggers_actions_ui/public/application/components/builtin_action_types/servicenow/servicenow_sir_params.tsx +++ b/x-pack/plugins/triggers_actions_ui/public/application/components/builtin_action_types/servicenow/servicenow_sir_params.tsx @@ -25,7 +25,7 @@ import { TextFieldWithMessageVariables } from '../../text_field_with_message_var import * as i18n from './translations'; import { useGetChoices } from './use_get_choices'; import { ServiceNowSIRActionParams, Fields, Choice, ServiceNowActionConnector } from './types'; -import { choicesToEuiOptions, isLegacyConnector, DEFAULT_CORRELATION_ID } from './helpers'; +import { choicesToEuiOptions, isDeprecatedConnector, DEFAULT_CORRELATION_ID } from './helpers'; const useGetChoicesFields = ['category', 'subcategory', 'priority']; const defaultFields: Fields = { @@ -43,10 +43,6 @@ const ServiceNowSIRParamsFields: React.FunctionComponent< notifications: { toasts }, } = useKibana().services; - const isDeprecatedConnector = isLegacyConnector( - actionConnector as unknown as ServiceNowActionConnector - ); - const actionConnectorRef = useRef(actionConnector?.id ?? ''); const { incident, comments } = useMemo( () => @@ -229,7 +225,7 @@ const ServiceNowSIRParamsFields: React.FunctionComponent< - {!isDeprecatedConnector && ( + {!isDeprecatedConnector(actionConnector as unknown as ServiceNowActionConnector) && ( <> diff --git a/x-pack/plugins/triggers_actions_ui/public/application/components/builtin_action_types/servicenow/types.ts b/x-pack/plugins/triggers_actions_ui/public/application/components/builtin_action_types/servicenow/types.ts index ecbb4f9de726b..40bb47543a3c8 100644 --- a/x-pack/plugins/triggers_actions_ui/public/application/components/builtin_action_types/servicenow/types.ts +++ b/x-pack/plugins/triggers_actions_ui/public/application/components/builtin_action_types/servicenow/types.ts @@ -35,7 +35,7 @@ export interface ServiceNowITOMActionParams { export interface ServiceNowConfig { apiUrl: string; - isLegacy: boolean; + usesTableApi: boolean; } export interface ServiceNowSecrets { diff --git a/x-pack/plugins/triggers_actions_ui/public/application/components/builtin_action_types/servicenow/update_connector.test.tsx b/x-pack/plugins/triggers_actions_ui/public/application/components/builtin_action_types/servicenow/update_connector.test.tsx index 2d95bfa85ceb9..ecb90051e78c2 100644 --- a/x-pack/plugins/triggers_actions_ui/public/application/components/builtin_action_types/servicenow/update_connector.test.tsx +++ b/x-pack/plugins/triggers_actions_ui/public/application/components/builtin_action_types/servicenow/update_connector.test.tsx @@ -22,7 +22,7 @@ const actionConnector: ServiceNowActionConnector = { name: 'servicenow', config: { apiUrl: 'https://test/', - isLegacy: true, + usesTableApi: true, }, }; diff --git a/x-pack/plugins/triggers_actions_ui/public/application/components/builtin_action_types/servicenow/use_get_app_info.test.tsx b/x-pack/plugins/triggers_actions_ui/public/application/components/builtin_action_types/servicenow/use_get_app_info.test.tsx index c6b70443ec8fb..f842f6863676a 100644 --- a/x-pack/plugins/triggers_actions_ui/public/application/components/builtin_action_types/servicenow/use_get_app_info.test.tsx +++ b/x-pack/plugins/triggers_actions_ui/public/application/components/builtin_action_types/servicenow/use_get_app_info.test.tsx @@ -34,7 +34,7 @@ const actionConnector = { isPreconfigured: false, config: { apiUrl: 'https://test.service-now.com/', - isLegacy: false, + usesTableApi: false, }, } as ServiceNowActionConnector; diff --git a/x-pack/plugins/triggers_actions_ui/public/application/sections/actions_connectors_list/components/actions_connectors_list.tsx b/x-pack/plugins/triggers_actions_ui/public/application/sections/actions_connectors_list/components/actions_connectors_list.tsx index 844f28f022547..5de21470fc19a 100644 --- a/x-pack/plugins/triggers_actions_ui/public/application/sections/actions_connectors_list/components/actions_connectors_list.tsx +++ b/x-pack/plugins/triggers_actions_ui/public/application/sections/actions_connectors_list/components/actions_connectors_list.tsx @@ -205,8 +205,8 @@ const ActionsConnectorsList: React.FunctionComponent = () => { const itemConfig = ( item as UserConfiguredActionConnector, Record> ).config; - const showLegacyTooltip = - itemConfig?.isLegacy && + const showDeprecatedTooltip = + itemConfig?.usesTableApi && // TODO: Remove when applications are certified ((ENABLE_NEW_SN_ITSM_CONNECTOR && item.actionTypeId === '.servicenow') || (ENABLE_NEW_SN_SIR_CONNECTOR && item.actionTypeId === '.servicenow-sir')); @@ -233,7 +233,7 @@ const ActionsConnectorsList: React.FunctionComponent = () => { position="right" /> ) : null} - {showLegacyTooltip && } + {showDeprecatedTooltip && } ); diff --git a/x-pack/test/alerting_api_integration/security_and_spaces/tests/actions/builtin_action_types/servicenow_itsm.ts b/x-pack/test/alerting_api_integration/security_and_spaces/tests/actions/builtin_action_types/servicenow_itsm.ts index 97c2a77a8f074..1308959ebbacf 100644 --- a/x-pack/test/alerting_api_integration/security_and_spaces/tests/actions/builtin_action_types/servicenow_itsm.ts +++ b/x-pack/test/alerting_api_integration/security_and_spaces/tests/actions/builtin_action_types/servicenow_itsm.ts @@ -22,7 +22,7 @@ export default function serviceNowITSMTest({ getService }: FtrProviderContext) { const mockServiceNow = { config: { apiUrl: 'www.servicenowisinkibanaactions.com', - isLegacy: false, + usesTableApi: false, }, secrets: { password: 'elastic', @@ -91,7 +91,7 @@ export default function serviceNowITSMTest({ getService }: FtrProviderContext) { connector_type_id: '.servicenow', config: { apiUrl: serviceNowSimulatorURL, - isLegacy: false, + usesTableApi: false, }, secrets: mockServiceNow.secrets, }) @@ -105,7 +105,7 @@ export default function serviceNowITSMTest({ getService }: FtrProviderContext) { is_missing_secrets: false, config: { apiUrl: serviceNowSimulatorURL, - isLegacy: false, + usesTableApi: false, }, }); @@ -121,12 +121,12 @@ export default function serviceNowITSMTest({ getService }: FtrProviderContext) { is_missing_secrets: false, config: { apiUrl: serviceNowSimulatorURL, - isLegacy: false, + usesTableApi: false, }, }); }); - it('should set the isLegacy to true when not provided', async () => { + it('should set the usesTableApi to true when not provided', async () => { const { body: createdAction } = await supertest .post('/api/actions/connector') .set('kbn-xsrf', 'foo') @@ -144,7 +144,7 @@ export default function serviceNowITSMTest({ getService }: FtrProviderContext) { .get(`/api/actions/connector/${createdAction.id}`) .expect(200); - expect(fetchedAction.config.isLegacy).to.be(true); + expect(fetchedAction.config.usesTableApi).to.be(true); }); it('should respond with a 400 Bad Request when creating a servicenow action with no apiUrl', async () => { @@ -223,7 +223,7 @@ export default function serviceNowITSMTest({ getService }: FtrProviderContext) { connector_type_id: '.servicenow', config: { apiUrl: serviceNowSimulatorURL, - isLegacy: false, + usesTableApi: false, }, secrets: mockServiceNow.secrets, }); @@ -383,7 +383,7 @@ export default function serviceNowITSMTest({ getService }: FtrProviderContext) { }); describe('Execution', () => { - // New connectors + // Connectors that use the Import set API describe('Import set API', () => { it('should handle creating an incident without comments', async () => { const { body: result } = await supertest @@ -414,7 +414,7 @@ export default function serviceNowITSMTest({ getService }: FtrProviderContext) { }); }); - // Legacy connectors + // Connectors that use the Table API describe('Table API', () => { before(async () => { const { body } = await supertest @@ -425,7 +425,7 @@ export default function serviceNowITSMTest({ getService }: FtrProviderContext) { connector_type_id: '.servicenow', config: { apiUrl: serviceNowSimulatorURL, - isLegacy: true, + usesTableApi: true, }, secrets: mockServiceNow.secrets, }); diff --git a/x-pack/test/alerting_api_integration/security_and_spaces/tests/actions/builtin_action_types/servicenow_sir.ts b/x-pack/test/alerting_api_integration/security_and_spaces/tests/actions/builtin_action_types/servicenow_sir.ts index 3a13e055e7aeb..c27634ecf6aca 100644 --- a/x-pack/test/alerting_api_integration/security_and_spaces/tests/actions/builtin_action_types/servicenow_sir.ts +++ b/x-pack/test/alerting_api_integration/security_and_spaces/tests/actions/builtin_action_types/servicenow_sir.ts @@ -22,7 +22,7 @@ export default function serviceNowSIRTest({ getService }: FtrProviderContext) { const mockServiceNow = { config: { apiUrl: 'www.servicenowisinkibanaactions.com', - isLegacy: false, + usesTableApi: false, }, secrets: { password: 'elastic', @@ -95,7 +95,7 @@ export default function serviceNowSIRTest({ getService }: FtrProviderContext) { connector_type_id: '.servicenow-sir', config: { apiUrl: serviceNowSimulatorURL, - isLegacy: false, + usesTableApi: false, }, secrets: mockServiceNow.secrets, }) @@ -109,7 +109,7 @@ export default function serviceNowSIRTest({ getService }: FtrProviderContext) { is_missing_secrets: false, config: { apiUrl: serviceNowSimulatorURL, - isLegacy: false, + usesTableApi: false, }, }); @@ -125,12 +125,12 @@ export default function serviceNowSIRTest({ getService }: FtrProviderContext) { is_missing_secrets: false, config: { apiUrl: serviceNowSimulatorURL, - isLegacy: false, + usesTableApi: false, }, }); }); - it('should set the isLegacy to true when not provided', async () => { + it('should set the usesTableApi to true when not provided', async () => { const { body: createdAction } = await supertest .post('/api/actions/connector') .set('kbn-xsrf', 'foo') @@ -148,7 +148,7 @@ export default function serviceNowSIRTest({ getService }: FtrProviderContext) { .get(`/api/actions/connector/${createdAction.id}`) .expect(200); - expect(fetchedAction.config.isLegacy).to.be(true); + expect(fetchedAction.config.usesTableApi).to.be(true); }); it('should respond with a 400 Bad Request when creating a servicenow action with no apiUrl', async () => { @@ -227,7 +227,7 @@ export default function serviceNowSIRTest({ getService }: FtrProviderContext) { connector_type_id: '.servicenow-sir', config: { apiUrl: serviceNowSimulatorURL, - isLegacy: false, + usesTableApi: false, }, secrets: mockServiceNow.secrets, }); @@ -387,7 +387,7 @@ export default function serviceNowSIRTest({ getService }: FtrProviderContext) { }); describe('Execution', () => { - // New connectors + // Connectors that use the Import set API describe('Import set API', () => { it('should handle creating an incident without comments', async () => { const { body: result } = await supertest @@ -418,7 +418,7 @@ export default function serviceNowSIRTest({ getService }: FtrProviderContext) { }); }); - // Legacy connectors + // Connectors that use the Table API describe('Table API', () => { before(async () => { const { body } = await supertest @@ -429,7 +429,7 @@ export default function serviceNowSIRTest({ getService }: FtrProviderContext) { connector_type_id: '.servicenow-sir', config: { apiUrl: serviceNowSimulatorURL, - isLegacy: true, + usesTableApi: true, }, secrets: mockServiceNow.secrets, }); diff --git a/x-pack/test/case_api_integration/common/lib/utils.ts b/x-pack/test/case_api_integration/common/lib/utils.ts index 0a875f9f1e822..9d48aed32d55c 100644 --- a/x-pack/test/case_api_integration/common/lib/utils.ts +++ b/x-pack/test/case_api_integration/common/lib/utils.ts @@ -329,7 +329,7 @@ export const getServiceNowConnector = () => ({ }, config: { apiUrl: 'http://some.non.existent.com', - isLegacy: false, + usesTableApi: false, }, }); @@ -386,7 +386,7 @@ export const getServiceNowSIRConnector = () => ({ }, config: { apiUrl: 'http://some.non.existent.com', - isLegacy: false, + usesTableApi: false, }, }); diff --git a/x-pack/test/case_api_integration/security_and_spaces/tests/trial/configure/get_connectors.ts b/x-pack/test/case_api_integration/security_and_spaces/tests/trial/configure/get_connectors.ts index c3e737464f19b..a4e69ab928325 100644 --- a/x-pack/test/case_api_integration/security_and_spaces/tests/trial/configure/get_connectors.ts +++ b/x-pack/test/case_api_integration/security_and_spaces/tests/trial/configure/get_connectors.ts @@ -109,7 +109,7 @@ export default ({ getService }: FtrProviderContext): void => { name: 'ServiceNow Connector', config: { apiUrl: 'http://some.non.existent.com', - isLegacy: false, + usesTableApi: false, }, isPreconfigured: false, isMissingSecrets: false, @@ -121,7 +121,7 @@ export default ({ getService }: FtrProviderContext): void => { name: 'ServiceNow Connector', config: { apiUrl: 'http://some.non.existent.com', - isLegacy: false, + usesTableApi: false, }, isPreconfigured: false, isMissingSecrets: false, diff --git a/x-pack/test/case_api_integration/spaces_only/tests/trial/configure/get_connectors.ts b/x-pack/test/case_api_integration/spaces_only/tests/trial/configure/get_connectors.ts index 7b6848d1f301e..02b91c9f0b918 100644 --- a/x-pack/test/case_api_integration/spaces_only/tests/trial/configure/get_connectors.ts +++ b/x-pack/test/case_api_integration/spaces_only/tests/trial/configure/get_connectors.ts @@ -109,7 +109,7 @@ export default ({ getService }: FtrProviderContext): void => { name: 'ServiceNow Connector', config: { apiUrl: 'http://some.non.existent.com', - isLegacy: false, + usesTableApi: false, }, isPreconfigured: false, isMissingSecrets: false, @@ -121,7 +121,7 @@ export default ({ getService }: FtrProviderContext): void => { name: 'ServiceNow Connector', config: { apiUrl: 'http://some.non.existent.com', - isLegacy: false, + usesTableApi: false, }, isPreconfigured: false, isMissingSecrets: false, From 504896d51fd50c709686a398e24f1b2ae02dab98 Mon Sep 17 00:00:00 2001 From: Josh Dover <1813008+joshdover@users.noreply.github.com> Date: Mon, 25 Oct 2021 19:19:46 +0200 Subject: [PATCH 14/23] [Fleet] Fix showing deployment details callout on Cloud staging (#116123) --- .../integrations/components/header/deployment_details.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/x-pack/plugins/fleet/public/applications/integrations/components/header/deployment_details.tsx b/x-pack/plugins/fleet/public/applications/integrations/components/header/deployment_details.tsx index 48c8fa56fb91b..79175d241c29f 100644 --- a/x-pack/plugins/fleet/public/applications/integrations/components/header/deployment_details.tsx +++ b/x-pack/plugins/fleet/public/applications/integrations/components/header/deployment_details.tsx @@ -32,7 +32,8 @@ export const DeploymentDetails = () => { !( cname.endsWith('elastic-cloud.com') || cname.endsWith('found.io') || - cname.endsWith('found.no') + cname.endsWith('found.no') || + cname.endsWith('foundit.no') ) ) { return null; From f152787a6802d585e5341613db0677f27dbdd927 Mon Sep 17 00:00:00 2001 From: Thomas Watson Date: Mon, 25 Oct 2021 20:12:05 +0200 Subject: [PATCH 15/23] Remove deprecated xpack.security.enabled config option (#111681) Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> --- docs/settings/security-settings.asciidoc | 14 --------- .../resources/base/bin/kibana-docker | 1 - .../apis/custom_integration/integrations.ts | 2 +- test/common/services/security/test_user.ts | 11 ++++--- test/functional/config.js | 1 - x-pack/plugins/security/server/config.test.ts | 3 -- x-pack/plugins/security/server/config.ts | 1 - .../server/config_deprecations.test.ts | 30 ------------------- .../security/server/config_deprecations.ts | 24 --------------- .../alerting_api_integration/common/config.ts | 4 ++- .../case_api_integration/common/config.ts | 4 ++- .../lists_api_integration/common/config.ts | 4 ++- .../reporting_without_security.config.ts | 2 +- .../reporting_without_security.config.ts | 5 +--- x-pack/test/rule_registry/common/config.ts | 4 ++- .../common/config.ts | 4 ++- .../spaces_api_integration/common/config.ts | 4 ++- x-pack/test/timeline/common/config.ts | 4 ++- x-pack/test/ui_capabilities/common/config.ts | 4 ++- .../spaces_only/tests/catalogue.ts | 15 ++++++++-- .../spaces_only/tests/nav_links.ts | 15 ++++++++-- 21 files changed, 58 insertions(+), 98 deletions(-) diff --git a/docs/settings/security-settings.asciidoc b/docs/settings/security-settings.asciidoc index c291b65c3c35b..7737745c7cfa8 100644 --- a/docs/settings/security-settings.asciidoc +++ b/docs/settings/security-settings.asciidoc @@ -12,20 +12,6 @@ You do not need to configure any additional settings to use the [[general-security-settings]] ==== General security settings -[cols="2*<"] -|=== -| `xpack.security.enabled` - | deprecated:[7.16.0,"In 8.0 and later, this setting will no longer be supported."] - By default, {kib} automatically detects whether to enable the - {security-features} based on the license and whether {es} {security-features} - are enabled. + - + - Do not set this to `false`; it disables the login form, user and role management - screens, and authorization using <>. To disable - {security-features} entirely, see - {ref}/security-settings.html[{es} security settings]. -|=== - [float] [[authentication-security-settings]] ==== Authentication security settings diff --git a/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker b/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker index 235a5fbe1a1a3..3a38789fbcac6 100755 --- a/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker +++ b/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker @@ -343,7 +343,6 @@ kibana_vars=( xpack.security.authc.saml.realm xpack.security.authc.selector.enabled xpack.security.cookieName - xpack.security.enabled xpack.security.encryptionKey xpack.security.loginAssistanceMessage xpack.security.loginHelp diff --git a/test/api_integration/apis/custom_integration/integrations.ts b/test/api_integration/apis/custom_integration/integrations.ts index e4797b334a866..0784a86e4b546 100644 --- a/test/api_integration/apis/custom_integration/integrations.ts +++ b/test/api_integration/apis/custom_integration/integrations.ts @@ -22,7 +22,7 @@ export default function ({ getService }: FtrProviderContext) { expect(resp.body).to.be.an('array'); - expect(resp.body.length).to.be(12); + expect(resp.body.length).to.be(33); // Test for sample data card expect(resp.body.findIndex((c: { id: string }) => c.id === 'sample_data_all')).to.be.above( diff --git a/test/common/services/security/test_user.ts b/test/common/services/security/test_user.ts index 695294f08b02d..1161e7b493f41 100644 --- a/test/common/services/security/test_user.ts +++ b/test/common/services/security/test_user.ts @@ -71,13 +71,12 @@ export class TestUser extends FtrService { export async function createTestUserService(ctx: FtrProviderContext, role: Role, user: User) { const log = ctx.getService('log'); const config = ctx.getService('config'); - const kibanaServer = ctx.getService('kibanaServer'); - const enabledPlugins = config.get('security.disableTestUser') - ? [] - : await kibanaServer.plugins.getEnabledIds(); - - const enabled = enabledPlugins.includes('security') && !config.get('security.disableTestUser'); + const enabled = + !config + .get('esTestCluster.serverArgs') + .some((arg: string) => arg === 'xpack.security.enabled=false') && + !config.get('security.disableTestUser'); if (enabled) { log.debug('===============creating roles and users==============='); diff --git a/test/functional/config.js b/test/functional/config.js index e0195c4dadc8d..5b0b79e84e8df 100644 --- a/test/functional/config.js +++ b/test/functional/config.js @@ -45,7 +45,6 @@ export default async function ({ readConfigFile }) { '--savedObjects.maxImportPayloadBytes=10485760', // to be re-enabled once kibana/issues/102552 is completed - '--xpack.security.enabled=false', '--xpack.reporting.enabled=false', ], }, diff --git a/x-pack/plugins/security/server/config.test.ts b/x-pack/plugins/security/server/config.test.ts index 4034a7a79e6dd..ababf435af3c9 100644 --- a/x-pack/plugins/security/server/config.test.ts +++ b/x-pack/plugins/security/server/config.test.ts @@ -56,7 +56,6 @@ describe('config schema', () => { "selector": Object {}, }, "cookieName": "sid", - "enabled": true, "encryptionKey": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "loginAssistanceMessage": "", "public": Object {}, @@ -110,7 +109,6 @@ describe('config schema', () => { "selector": Object {}, }, "cookieName": "sid", - "enabled": true, "encryptionKey": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "loginAssistanceMessage": "", "public": Object {}, @@ -164,7 +162,6 @@ describe('config schema', () => { "selector": Object {}, }, "cookieName": "sid", - "enabled": true, "loginAssistanceMessage": "", "public": Object {}, "secureCookies": false, diff --git a/x-pack/plugins/security/server/config.ts b/x-pack/plugins/security/server/config.ts index 23a1fd2efa382..a9e22448e1725 100644 --- a/x-pack/plugins/security/server/config.ts +++ b/x-pack/plugins/security/server/config.ts @@ -198,7 +198,6 @@ const providersConfigSchema = schema.object( ); export const ConfigSchema = schema.object({ - enabled: schema.boolean({ defaultValue: true }), loginAssistanceMessage: schema.string({ defaultValue: '' }), showInsecureClusterWarning: schema.boolean({ defaultValue: true }), loginHelp: schema.maybe(schema.string()), diff --git a/x-pack/plugins/security/server/config_deprecations.test.ts b/x-pack/plugins/security/server/config_deprecations.test.ts index a629b6d73a682..3c674de97ad8e 100644 --- a/x-pack/plugins/security/server/config_deprecations.test.ts +++ b/x-pack/plugins/security/server/config_deprecations.test.ts @@ -357,34 +357,4 @@ describe('Config Deprecations', () => { ] `); }); - - it('warns when the security plugin is disabled', () => { - const config = { - xpack: { - security: { - enabled: false, - }, - }, - }; - const { messages, migrated } = applyConfigDeprecations(cloneDeep(config)); - expect(migrated).toEqual(config); - expect(messages).toMatchInlineSnapshot(` - Array [ - "Disabling the security plugin \\"xpack.security.enabled\\" will only be supported by disable security in Elasticsearch.", - ] - `); - }); - - it('does not warn when the security plugin is enabled', () => { - const config = { - xpack: { - security: { - enabled: true, - }, - }, - }; - const { messages, migrated } = applyConfigDeprecations(cloneDeep(config)); - expect(migrated).toEqual(config); - expect(messages).toHaveLength(0); - }); }); diff --git a/x-pack/plugins/security/server/config_deprecations.ts b/x-pack/plugins/security/server/config_deprecations.ts index 0c76840819b3d..055818a159a79 100644 --- a/x-pack/plugins/security/server/config_deprecations.ts +++ b/x-pack/plugins/security/server/config_deprecations.ts @@ -157,28 +157,4 @@ export const securityConfigDeprecationProvider: ConfigDeprecationProvider = ({ }); } }, - (settings, fromPath, addDeprecation) => { - if (settings?.xpack?.security?.enabled === false) { - addDeprecation({ - configPath: 'xpack.security.enabled', - title: i18n.translate('xpack.security.deprecations.enabledTitle', { - defaultMessage: 'Disabling the security plugin "xpack.security.enabled" is deprecated', - }), - message: i18n.translate('xpack.security.deprecations.enabledMessage', { - defaultMessage: - 'Disabling the security plugin "xpack.security.enabled" will only be supported by disable security in Elasticsearch.', - }), - correctiveActions: { - manualSteps: [ - i18n.translate('xpack.security.deprecations.enabled.manualStepOneMessage', { - defaultMessage: `Remove "xpack.security.enabled" from your Kibana configuration.`, - }), - i18n.translate('xpack.security.deprecations.enabled.manualStepTwoMessage', { - defaultMessage: `To turn off security features, disable them in Elasticsearch instead.`, - }), - ], - }, - }); - } - }, ]; diff --git a/x-pack/test/alerting_api_integration/common/config.ts b/x-pack/test/alerting_api_integration/common/config.ts index 3fe5ecb6076e2..7bcec7b11c10e 100644 --- a/x-pack/test/alerting_api_integration/common/config.ts +++ b/x-pack/test/alerting_api_integration/common/config.ts @@ -242,7 +242,9 @@ export function createTestConfig(name: string, options: CreateTestConfigOptions) }, }, })}`, - ...disabledPlugins.map((key) => `--xpack.${key}.enabled=false`), + ...disabledPlugins + .filter((k) => k !== 'security') + .map((key) => `--xpack.${key}.enabled=false`), ...plugins.map( (pluginDir) => `--plugin-path=${path.resolve(__dirname, 'fixtures', 'plugins', pluginDir)}` diff --git a/x-pack/test/case_api_integration/common/config.ts b/x-pack/test/case_api_integration/common/config.ts index 2658472a7b84d..284b4360dacf8 100644 --- a/x-pack/test/case_api_integration/common/config.ts +++ b/x-pack/test/case_api_integration/common/config.ts @@ -118,7 +118,9 @@ export function createTestConfig(name: string, options: CreateTestConfigOptions) `--xpack.actions.allowedHosts=${JSON.stringify(['localhost', 'some.non.existent.com'])}`, `--xpack.actions.enabledActionTypes=${JSON.stringify(enabledActionTypes)}`, '--xpack.eventLog.logEntries=true', - ...disabledPlugins.map((key) => `--xpack.${key}.enabled=false`), + ...disabledPlugins + .filter((k) => k !== 'security') + .map((key) => `--xpack.${key}.enabled=false`), // Actions simulators plugin. Needed for testing push to external services. ...alertingPlugins.map( (pluginDir) => diff --git a/x-pack/test/lists_api_integration/common/config.ts b/x-pack/test/lists_api_integration/common/config.ts index 4983f00cce044..214f03b632658 100644 --- a/x-pack/test/lists_api_integration/common/config.ts +++ b/x-pack/test/lists_api_integration/common/config.ts @@ -51,7 +51,9 @@ export function createTestConfig(name: string, options: CreateTestConfigOptions) ...xPackApiIntegrationTestsConfig.get('kbnTestServer'), serverArgs: [ ...xPackApiIntegrationTestsConfig.get('kbnTestServer.serverArgs'), - ...disabledPlugins.map((key) => `--xpack.${key}.enabled=false`), + ...disabledPlugins + .filter((k) => k !== 'security') + .map((key) => `--xpack.${key}.enabled=false`), `--plugin-path=${path.join(__dirname, 'fixtures', 'plugins', 'alerts')}`, `--plugin-path=${path.join(__dirname, 'fixtures', 'plugins', 'actions')}`, `--plugin-path=${path.join(__dirname, 'fixtures', 'plugins', 'task_manager')}`, diff --git a/x-pack/test/reporting_api_integration/reporting_without_security.config.ts b/x-pack/test/reporting_api_integration/reporting_without_security.config.ts index dfd79916b5ce0..0779b3b871e36 100644 --- a/x-pack/test/reporting_api_integration/reporting_without_security.config.ts +++ b/x-pack/test/reporting_api_integration/reporting_without_security.config.ts @@ -24,7 +24,7 @@ export default async function ({ readConfigFile }: FtrConfigProviderContext) { }, kbnTestServer: { ...apiConfig.get('kbnTestServer'), - serverArgs: [...apiConfig.get('kbnTestServer.serverArgs'), `--xpack.security.enabled=false`], + serverArgs: [...apiConfig.get('kbnTestServer.serverArgs')], }, }; } diff --git a/x-pack/test/reporting_functional/reporting_without_security.config.ts b/x-pack/test/reporting_functional/reporting_without_security.config.ts index 0269f57bf08cb..7ca7f89a0b709 100644 --- a/x-pack/test/reporting_functional/reporting_without_security.config.ts +++ b/x-pack/test/reporting_functional/reporting_without_security.config.ts @@ -17,10 +17,7 @@ export default async function ({ readConfigFile }: FtrConfigProviderContext) { testFiles: [resolve(__dirname, './reporting_without_security')], kbnTestServer: { ...reportingConfig.get('kbnTestServer'), - serverArgs: [ - ...reportingConfig.get('kbnTestServer.serverArgs'), - `--xpack.security.enabled=false`, - ], + serverArgs: [...reportingConfig.get('kbnTestServer.serverArgs')], }, esTestCluster: { ...reportingConfig.get('esTestCluster'), diff --git a/x-pack/test/rule_registry/common/config.ts b/x-pack/test/rule_registry/common/config.ts index 9cce58c30f6e9..6b920a6f5dbf2 100644 --- a/x-pack/test/rule_registry/common/config.ts +++ b/x-pack/test/rule_registry/common/config.ts @@ -79,7 +79,9 @@ export function createTestConfig(name: string, options: CreateTestConfigOptions) `--xpack.actions.allowedHosts=${JSON.stringify(['localhost', 'some.non.existent.com'])}`, `--xpack.actions.enabledActionTypes=${JSON.stringify(enabledActionTypes)}`, '--xpack.eventLog.logEntries=true', - ...disabledPlugins.map((key) => `--xpack.${key}.enabled=false`), + ...disabledPlugins + .filter((k) => k !== 'security') + .map((key) => `--xpack.${key}.enabled=false`), // TO DO: Remove feature flags once we're good to go '--xpack.securitySolution.enableExperimental=["ruleRegistryEnabled"]', '--xpack.ruleRegistry.write.enabled=true', diff --git a/x-pack/test/saved_object_api_integration/common/config.ts b/x-pack/test/saved_object_api_integration/common/config.ts index 9b9e46efa6d5d..8ca74c7fcea49 100644 --- a/x-pack/test/saved_object_api_integration/common/config.ts +++ b/x-pack/test/saved_object_api_integration/common/config.ts @@ -54,7 +54,9 @@ export function createTestConfig(name: string, options: CreateTestConfigOptions) ...config.xpack.api.get('kbnTestServer.serverArgs'), '--server.xsrf.disableProtection=true', `--plugin-path=${path.join(__dirname, 'fixtures', 'saved_object_test_plugin')}`, - ...disabledPlugins.map((key) => `--xpack.${key}.enabled=false`), + ...disabledPlugins + .filter((k) => k !== 'security') + .map((key) => `--xpack.${key}.enabled=false`), ], }, }; diff --git a/x-pack/test/spaces_api_integration/common/config.ts b/x-pack/test/spaces_api_integration/common/config.ts index 7cceb945790d5..5d135cd05605c 100644 --- a/x-pack/test/spaces_api_integration/common/config.ts +++ b/x-pack/test/spaces_api_integration/common/config.ts @@ -61,7 +61,9 @@ export function createTestConfig(name: string, options: CreateTestConfigOptions) '--status.allowAnonymous=false', '--server.xsrf.disableProtection=true', `--plugin-path=${path.join(__dirname, 'fixtures', 'spaces_test_plugin')}`, - ...disabledPlugins.map((key) => `--xpack.${key}.enabled=false`), + ...disabledPlugins + .filter((k) => k !== 'security') + .map((key) => `--xpack.${key}.enabled=false`), ], }, }; diff --git a/x-pack/test/timeline/common/config.ts b/x-pack/test/timeline/common/config.ts index fa8ddb2ad10a7..211f380b133a5 100644 --- a/x-pack/test/timeline/common/config.ts +++ b/x-pack/test/timeline/common/config.ts @@ -79,7 +79,9 @@ export function createTestConfig(name: string, options: CreateTestConfigOptions) `--xpack.actions.allowedHosts=${JSON.stringify(['localhost', 'some.non.existent.com'])}`, `--xpack.actions.enabledActionTypes=${JSON.stringify(enabledActionTypes)}`, '--xpack.eventLog.logEntries=true', - ...disabledPlugins.map((key) => `--xpack.${key}.enabled=false`), + ...disabledPlugins + .filter((k) => k !== 'security') + .map((key) => `--xpack.${key}.enabled=false`), // TO DO: Remove feature flags once we're good to go '--xpack.securitySolution.enableExperimental=["ruleRegistryEnabled"]', '--xpack.ruleRegistry.write.enabled=true', diff --git a/x-pack/test/ui_capabilities/common/config.ts b/x-pack/test/ui_capabilities/common/config.ts index 1f695e562da05..f676a5eeccee1 100644 --- a/x-pack/test/ui_capabilities/common/config.ts +++ b/x-pack/test/ui_capabilities/common/config.ts @@ -42,7 +42,9 @@ export function createTestConfig(name: string, options: CreateTestConfigOptions) ...xPackFunctionalTestsConfig.get('kbnTestServer'), serverArgs: [ ...xPackFunctionalTestsConfig.get('kbnTestServer.serverArgs'), - ...disabledPlugins.map((key) => `--xpack.${key}.enabled=false`), + ...disabledPlugins + .filter((k) => k !== 'security') + .map((key) => `--xpack.${key}.enabled=false`), `--plugin-path=${path.join(__dirname, 'fixtures', 'plugins', 'foo_plugin')}`, ], }, diff --git a/x-pack/test/ui_capabilities/spaces_only/tests/catalogue.ts b/x-pack/test/ui_capabilities/spaces_only/tests/catalogue.ts index b50f11553747c..e694b5be6e024 100644 --- a/x-pack/test/ui_capabilities/spaces_only/tests/catalogue.ts +++ b/x-pack/test/ui_capabilities/spaces_only/tests/catalogue.ts @@ -24,6 +24,13 @@ export default function catalogueTests({ getService }: FtrProviderContext) { 'watcher', ]; + const uiCapabilitiesExceptions = [ + // enterprise_search plugin is loaded but disabled because security isn't enabled in ES. That means the following 3 capabilities are disabled + 'enterpriseSearch', + 'appSearch', + 'workplaceSearch', + ]; + describe('catalogue', () => { SpaceScenarios.forEach((scenario) => { it(`${scenario.name}`, async () => { @@ -33,7 +40,10 @@ export default function catalogueTests({ getService }: FtrProviderContext) { expect(uiCapabilities.success).to.be(true); expect(uiCapabilities.value).to.have.property('catalogue'); // everything is enabled - const expected = mapValues(uiCapabilities.value!.catalogue, () => true); + const expected = mapValues( + uiCapabilities.value!.catalogue, + (enabled, catalogueId) => !uiCapabilitiesExceptions.includes(catalogueId) + ); expect(uiCapabilities.value!.catalogue).to.eql(expected); break; } @@ -55,7 +65,8 @@ export default function catalogueTests({ getService }: FtrProviderContext) { // only foo is disabled const expected = mapValues( uiCapabilities.value!.catalogue, - (value, catalogueId) => catalogueId !== 'foo' + (enabled, catalogueId) => + !uiCapabilitiesExceptions.includes(catalogueId) && catalogueId !== 'foo' ); expect(uiCapabilities.value!.catalogue).to.eql(expected); break; diff --git a/x-pack/test/ui_capabilities/spaces_only/tests/nav_links.ts b/x-pack/test/ui_capabilities/spaces_only/tests/nav_links.ts index 17c01888a7024..4ef919ebb46aa 100644 --- a/x-pack/test/ui_capabilities/spaces_only/tests/nav_links.ts +++ b/x-pack/test/ui_capabilities/spaces_only/tests/nav_links.ts @@ -16,6 +16,13 @@ export default function navLinksTests({ getService }: FtrProviderContext) { const uiCapabilitiesService: UICapabilitiesService = getService('uiCapabilities'); const featuresService: FeaturesService = getService('features'); + const uiCapabilitiesExceptions = [ + // enterprise_search plugin is loaded but disabled because security isn't enabled in ES. That means the following 3 capabilities are disabled + 'enterpriseSearch', + 'appSearch', + 'workplaceSearch', + ]; + describe('navLinks', () => { let navLinksBuilder: NavLinksBuilder; before(async () => { @@ -30,7 +37,9 @@ export default function navLinksTests({ getService }: FtrProviderContext) { case 'everything_space': expect(uiCapabilities.success).to.be(true); expect(uiCapabilities.value).to.have.property('navLinks'); - expect(uiCapabilities.value!.navLinks).to.eql(navLinksBuilder.all()); + expect(uiCapabilities.value!.navLinks).to.eql( + navLinksBuilder.except(...uiCapabilitiesExceptions) + ); break; case 'nothing_space': expect(uiCapabilities.success).to.be(true); @@ -40,7 +49,9 @@ export default function navLinksTests({ getService }: FtrProviderContext) { case 'foo_disabled_space': expect(uiCapabilities.success).to.be(true); expect(uiCapabilities.value).to.have.property('navLinks'); - expect(uiCapabilities.value!.navLinks).to.eql(navLinksBuilder.except('foo')); + expect(uiCapabilities.value!.navLinks).to.eql( + navLinksBuilder.except('foo', ...uiCapabilitiesExceptions) + ); break; default: throw new UnreachableError(scenario); From 1732927fb1004e59bd84bfab4638421818e04402 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cau=C3=AA=20Marcondes?= <55978943+cauemarcondes@users.noreply.github.com> Date: Mon, 25 Oct 2021 14:13:40 -0400 Subject: [PATCH 16/23] adjusting charts timezone (#116014) --- src/plugins/data/common/constants.ts | 1 + .../alerting/chart_preview/index.tsx | 7 +++++++ .../error_count_alert_trigger/index.tsx | 1 + .../index.tsx | 1 + .../index.tsx | 1 + .../Distribution/index.stories.tsx | 11 ++++++---- .../Distribution/index.tsx | 5 +++++ .../shared/charts/breakdown_chart/index.tsx | 10 +++++---- .../shared/charts/helper/timezone.test.ts | 21 ++++++++++++++++++- .../shared/charts/helper/timezone.ts | 14 +++++++++++++ .../shared/charts/timeseries_chart.tsx | 8 +++++-- 11 files changed, 69 insertions(+), 11 deletions(-) diff --git a/src/plugins/data/common/constants.ts b/src/plugins/data/common/constants.ts index e141bfbef3c89..1c457fdb64ce2 100644 --- a/src/plugins/data/common/constants.ts +++ b/src/plugins/data/common/constants.ts @@ -35,4 +35,5 @@ export const UI_SETTINGS = { AUTOCOMPLETE_USE_TIMERANGE: 'autocomplete:useTimeRange', AUTOCOMPLETE_VALUE_SUGGESTION_METHOD: 'autocomplete:valueSuggestionMethod', DATE_FORMAT: 'dateFormat', + DATEFORMAT_TZ: 'dateFormat:tz', } as const; diff --git a/x-pack/plugins/apm/public/components/alerting/chart_preview/index.tsx b/x-pack/plugins/apm/public/components/alerting/chart_preview/index.tsx index fb1a99db0bf5b..2015bf2228b6c 100644 --- a/x-pack/plugins/apm/public/components/alerting/chart_preview/index.tsx +++ b/x-pack/plugins/apm/public/components/alerting/chart_preview/index.tsx @@ -23,17 +23,21 @@ import { EuiSpacer } from '@elastic/eui'; import React from 'react'; import { Coordinate } from '../../../../typings/timeseries'; import { useTheme } from '../../../hooks/use_theme'; +import { IUiSettingsClient } from '../../../../../../../src/core/public'; +import { getTimeZone } from '../../shared/charts/helper/timezone'; interface ChartPreviewProps { yTickFormat?: TickFormatter; data?: Coordinate[]; threshold: number; + uiSettings?: IUiSettingsClient; } export function ChartPreview({ data = [], yTickFormat, threshold, + uiSettings, }: ChartPreviewProps) { const theme = useTheme(); const thresholdOpacity = 0.3; @@ -67,6 +71,8 @@ export function ChartPreview({ }, ]; + const timeZone = getTimeZone(uiSettings); + return ( <> @@ -99,6 +105,7 @@ export function ChartPreview({ domain={{ max: yMax, min: NaN }} /> ); diff --git a/x-pack/plugins/apm/public/components/alerting/transaction_duration_alert_trigger/index.tsx b/x-pack/plugins/apm/public/components/alerting/transaction_duration_alert_trigger/index.tsx index 8957dfc823e44..fa75fcca579e5 100644 --- a/x-pack/plugins/apm/public/components/alerting/transaction_duration_alert_trigger/index.tsx +++ b/x-pack/plugins/apm/public/components/alerting/transaction_duration_alert_trigger/index.tsx @@ -139,6 +139,7 @@ export function TransactionDurationAlertTrigger(props: Props) { data={latencyChartPreview} threshold={thresholdMs} yTickFormat={yTickFormat} + uiSettings={services.uiSettings} /> ); diff --git a/x-pack/plugins/apm/public/components/alerting/transaction_error_rate_alert_trigger/index.tsx b/x-pack/plugins/apm/public/components/alerting/transaction_error_rate_alert_trigger/index.tsx index ddddc4bbecbad..a818218cbf3ad 100644 --- a/x-pack/plugins/apm/public/components/alerting/transaction_error_rate_alert_trigger/index.tsx +++ b/x-pack/plugins/apm/public/components/alerting/transaction_error_rate_alert_trigger/index.tsx @@ -131,6 +131,7 @@ export function TransactionErrorRateAlertTrigger(props: Props) { data={data?.errorRateChartPreview} yTickFormat={(d: number | null) => asPercent(d, 1)} threshold={thresholdAsPercent} + uiSettings={services.uiSettings} /> ); diff --git a/x-pack/plugins/apm/public/components/app/error_group_details/Distribution/index.stories.tsx b/x-pack/plugins/apm/public/components/app/error_group_details/Distribution/index.stories.tsx index 4efc00ef71b91..101923a7678fb 100644 --- a/x-pack/plugins/apm/public/components/app/error_group_details/Distribution/index.stories.tsx +++ b/x-pack/plugins/apm/public/components/app/error_group_details/Distribution/index.stories.tsx @@ -19,14 +19,17 @@ export default { component: ErrorDistribution, decorators: [ (Story: ComponentType) => { - const apmPluginContextMock = { - observabilityRuleTypeRegistry: { getFormatter: () => undefined }, - } as unknown as ApmPluginContextValue; - const kibanaContextServices = { uiSettings: { get: () => {} }, }; + const apmPluginContextMock = { + observabilityRuleTypeRegistry: { getFormatter: () => undefined }, + core: { + uiSettings: kibanaContextServices.uiSettings, + }, + } as unknown as ApmPluginContextValue; + return ( diff --git a/x-pack/plugins/apm/public/components/app/error_group_details/Distribution/index.tsx b/x-pack/plugins/apm/public/components/app/error_group_details/Distribution/index.tsx index 429ad989b9738..6a3157b3c4b7f 100644 --- a/x-pack/plugins/apm/public/components/app/error_group_details/Distribution/index.tsx +++ b/x-pack/plugins/apm/public/components/app/error_group_details/Distribution/index.tsx @@ -32,6 +32,7 @@ import { useApmPluginContext } from '../../../../context/apm_plugin/use_apm_plug import { LazyAlertsFlyout } from '../../../../../../observability/public'; import { useUrlParams } from '../../../../context/url_params_context/use_url_params'; import { Coordinate } from '../../../../../typings/timeseries'; +import { getTimeZone } from '../../../shared/charts/helper/timezone'; const ALERT_RULE_TYPE_ID: typeof ALERT_RULE_TYPE_ID_TYPED = ALERT_RULE_TYPE_ID_NON_TYPED; @@ -58,6 +59,7 @@ interface Props { } export function ErrorDistribution({ distribution, title, fetchStatus }: Props) { + const { core } = useApmPluginContext(); const theme = useTheme(); const currentPeriod = getCoordinatedBuckets(distribution.currentPeriod); const previousPeriod = getCoordinatedBuckets(distribution.previousPeriod); @@ -103,6 +105,8 @@ export function ErrorDistribution({ distribution, title, fetchStatus }: Props) { undefined ); + const timeZone = getTimeZone(core.uiSettings); + return ( <> @@ -138,6 +142,7 @@ export function ErrorDistribution({ distribution, title, fetchStatus }: Props) { {timeseries.map((serie) => { return ( @@ -150,6 +151,7 @@ export function BreakdownChart({ timeseries.map((serie) => { return ( { let originalTimezone: moment.MomentZone | null; @@ -67,4 +68,22 @@ describe('Timezone helper', () => { ]); }); }); + + describe('getTimeZone', () => { + it('returns local when uiSettings is undefined', () => { + expect(getTimeZone()).toEqual('local'); + }); + + it('returns local when uiSettings returns Browser', () => { + expect( + getTimeZone({ get: () => 'Browser' } as unknown as IUiSettingsClient) + ).toEqual('local'); + }); + it('returns timezone defined on uiSettings', () => { + const timezone = 'America/toronto'; + expect( + getTimeZone({ get: () => timezone } as unknown as IUiSettingsClient) + ).toEqual(timezone); + }); + }); }); diff --git a/x-pack/plugins/apm/public/components/shared/charts/helper/timezone.ts b/x-pack/plugins/apm/public/components/shared/charts/helper/timezone.ts index 539c81c61c3ce..f807d83c8977f 100644 --- a/x-pack/plugins/apm/public/components/shared/charts/helper/timezone.ts +++ b/x-pack/plugins/apm/public/components/shared/charts/helper/timezone.ts @@ -7,6 +7,8 @@ import d3 from 'd3'; import { getTimezoneOffsetInMs } from './get_timezone_offset_in_ms'; +import { IUiSettingsClient } from '../../../../../../../../src/core/public'; +import { UI_SETTINGS } from '../../../../../../../../src/plugins/data/common'; interface Params { domain: [number, number]; @@ -31,3 +33,15 @@ export const getDomainTZ = (min: number, max: number): [number, number] => { ); return [xMinZone, xMaxZone]; }; + +export function getTimeZone(uiSettings?: IUiSettingsClient) { + const kibanaTimeZone = uiSettings?.get<'Browser' | string>( + UI_SETTINGS.DATEFORMAT_TZ + ); + + if (!kibanaTimeZone || kibanaTimeZone === 'Browser') { + return 'local'; + } + + return kibanaTimeZone; +} diff --git a/x-pack/plugins/apm/public/components/shared/charts/timeseries_chart.tsx b/x-pack/plugins/apm/public/components/shared/charts/timeseries_chart.tsx index 08e8908d50e7a..bcdfff2678cda 100644 --- a/x-pack/plugins/apm/public/components/shared/charts/timeseries_chart.tsx +++ b/x-pack/plugins/apm/public/components/shared/charts/timeseries_chart.tsx @@ -19,8 +19,8 @@ import { RectAnnotation, ScaleType, Settings, - YDomainRange, XYBrushEvent, + YDomainRange, } from '@elastic/charts'; import { EuiIcon } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; @@ -46,6 +46,7 @@ import { getLatencyChartSelector } from '../../../selectors/latency_chart_select import { unit } from '../../../utils/style'; import { ChartContainer } from './chart_container'; import { getAlertAnnotations } from './helper/get_alert_annotations'; +import { getTimeZone } from './helper/timezone'; import { isTimeseriesEmpty, onBrushEnd } from './helper/helper'; interface Props { @@ -85,7 +86,7 @@ export function TimeseriesChart({ alerts, }: Props) { const history = useHistory(); - const { observabilityRuleTypeRegistry } = useApmPluginContext(); + const { observabilityRuleTypeRegistry, core } = useApmPluginContext(); const { getFormatter } = observabilityRuleTypeRegistry; const { annotations } = useAnnotationsContext(); const { setPointerEvent, chartRef } = useChartPointerEventContext(); @@ -97,6 +98,8 @@ export function TimeseriesChart({ const xValues = timeseries.flatMap(({ data }) => data.map(({ x }) => x)); + const timeZone = getTimeZone(core.uiSettings); + const min = Math.min(...xValues); const max = Math.max(...xValues); @@ -180,6 +183,7 @@ export function TimeseriesChart({ return ( Date: Mon, 25 Oct 2021 20:28:47 +0200 Subject: [PATCH 17/23] Store interactive setup certificates in the data folder. (#115981) --- src/cli_setup/utils.ts | 4 +- .../server/kibana_config_writer.test.ts | 366 +++++++++--------- .../server/kibana_config_writer.ts | 21 +- .../interactive_setup/server/plugin.ts | 7 +- 4 files changed, 196 insertions(+), 202 deletions(-) diff --git a/src/cli_setup/utils.ts b/src/cli_setup/utils.ts index 65a46b8f5b278..21406bf7e57e0 100644 --- a/src/cli_setup/utils.ts +++ b/src/cli_setup/utils.ts @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -import { getConfigPath } from '@kbn/utils'; +import { getConfigPath, getDataPath } from '@kbn/utils'; import inquirer from 'inquirer'; import { duration } from 'moment'; import { merge } from 'lodash'; @@ -30,7 +30,7 @@ const logger: Logger = { get: () => logger, }; -export const kibanaConfigWriter = new KibanaConfigWriter(getConfigPath(), logger); +export const kibanaConfigWriter = new KibanaConfigWriter(getConfigPath(), getDataPath(), logger); export const elasticsearch = new ElasticsearchService(logger).setup({ connectionCheckInterval: duration(Infinity), elasticsearch: { diff --git a/src/plugins/interactive_setup/server/kibana_config_writer.test.ts b/src/plugins/interactive_setup/server/kibana_config_writer.test.ts index 4b68451930a3d..0580a35d909ea 100644 --- a/src/plugins/interactive_setup/server/kibana_config_writer.test.ts +++ b/src/plugins/interactive_setup/server/kibana_config_writer.test.ts @@ -30,6 +30,7 @@ describe('KibanaConfigWriter', () => { kibanaConfigWriter = new KibanaConfigWriter( '/some/path/kibana.yml', + '/data', loggingSystemMock.createLogger() ); }); @@ -37,15 +38,15 @@ describe('KibanaConfigWriter', () => { afterEach(() => jest.resetAllMocks()); describe('#isConfigWritable()', () => { - it('returns `false` if config directory is not writable even if kibana yml is writable', async () => { + it('returns `false` if data directory is not writable even if kibana yml is writable', async () => { mockFsAccess.mockImplementation((path, modifier) => - path === '/some/path' && modifier === constants.W_OK ? Promise.reject() : Promise.resolve() + path === '/data' && modifier === constants.W_OK ? Promise.reject() : Promise.resolve() ); await expect(kibanaConfigWriter.isConfigWritable()).resolves.toBe(false); }); - it('returns `false` if kibana yml is NOT writable if even config directory is writable', async () => { + it('returns `false` if kibana yml is NOT writable if even data directory is writable', async () => { mockFsAccess.mockImplementation((path, modifier) => path === '/some/path/kibana.yml' && modifier === constants.W_OK ? Promise.reject() @@ -55,219 +56,208 @@ describe('KibanaConfigWriter', () => { await expect(kibanaConfigWriter.isConfigWritable()).resolves.toBe(false); }); - it('returns `true` if both kibana yml and config directory are writable', async () => { + it('returns `true` if both kibana yml and data directory are writable', async () => { mockFsAccess.mockResolvedValue(undefined); await expect(kibanaConfigWriter.isConfigWritable()).resolves.toBe(true); }); - it('returns `true` even if kibana yml does not exist when config directory is writable', async () => { + it('returns `true` even if kibana yml does not exist even if data directory is writable', async () => { mockFsAccess.mockImplementation((path) => path === '/some/path/kibana.yml' ? Promise.reject() : Promise.resolve() ); - await expect(kibanaConfigWriter.isConfigWritable()).resolves.toBe(true); + await expect(kibanaConfigWriter.isConfigWritable()).resolves.toBe(false); }); }); describe('#writeConfig()', () => { - describe('without existing config', () => { - beforeEach(() => { - mockReadFile.mockResolvedValue(''); - }); - - it('throws if cannot write CA file', async () => { - mockWriteFile.mockRejectedValue(new Error('Oh no!')); - - await expect( - kibanaConfigWriter.writeConfig({ - caCert: 'ca-content', - host: '', - serviceAccountToken: { name: '', value: '' }, - }) - ).rejects.toMatchInlineSnapshot(`[Error: Oh no!]`); - - expect(mockWriteFile).toHaveBeenCalledTimes(1); - expect(mockWriteFile).toHaveBeenCalledWith('/some/path/ca_1234.crt', 'ca-content'); - }); - - it('throws if cannot write config to yaml file', async () => { - mockWriteFile.mockResolvedValueOnce(undefined).mockRejectedValueOnce(new Error('Oh no!')); - - await expect( - kibanaConfigWriter.writeConfig({ - caCert: 'ca-content', - host: 'some-host', - serviceAccountToken: { name: 'some-token', value: 'some-value' }, - }) - ).rejects.toMatchInlineSnapshot(`[Error: Oh no!]`); - - expect(mockWriteFile).toHaveBeenCalledTimes(2); - expect(mockWriteFile).toHaveBeenCalledWith('/some/path/ca_1234.crt', 'ca-content'); - expect(mockWriteFile).toHaveBeenCalledWith( - '/some/path/kibana.yml', - ` - -# This section was automatically generated during setup. -elasticsearch.hosts: [some-host] -elasticsearch.serviceAccountToken: some-value -elasticsearch.ssl.certificateAuthorities: [/some/path/ca_1234.crt] - -` - ); - }); - - it('throws if cannot read existing config', async () => { - mockReadFile.mockRejectedValue(new Error('Oh no!')); - - await expect( - kibanaConfigWriter.writeConfig({ - caCert: 'ca-content', - host: 'some-host', - serviceAccountToken: { name: 'some-token', value: 'some-value' }, - }) - ).rejects.toMatchInlineSnapshot(`[Error: Oh no!]`); - - expect(mockWriteFile).not.toHaveBeenCalled(); - }); - - it('throws if cannot parse existing config', async () => { - mockReadFile.mockResolvedValue('foo: bar\nfoo: baz'); - - await expect( - kibanaConfigWriter.writeConfig({ - caCert: 'ca-content', - host: 'some-host', - serviceAccountToken: { name: 'some-token', value: 'some-value' }, - }) - ).rejects.toMatchInlineSnapshot(` - [YAMLException: duplicated mapping key at line 2, column 1: - foo: baz - ^] - `); - - expect(mockWriteFile).not.toHaveBeenCalled(); - }); - - it('can successfully write CA certificate and elasticsearch config with service token', async () => { - await expect( - kibanaConfigWriter.writeConfig({ - caCert: 'ca-content', - host: 'some-host', - serviceAccountToken: { name: 'some-token', value: 'some-value' }, - }) - ).resolves.toBeUndefined(); + beforeEach(() => { + mockReadFile.mockResolvedValue( + '# Default Kibana configuration for docker target\nserver.host: "0.0.0.0"\nserver.shutdownTimeout: "5s"' + ); + }); - expect(mockWriteFile).toHaveBeenCalledTimes(2); - expect(mockWriteFile).toHaveBeenCalledWith('/some/path/ca_1234.crt', 'ca-content'); - expect(mockWriteFile).toHaveBeenCalledWith( - '/some/path/kibana.yml', - ` + it('throws if cannot write CA file', async () => { + mockWriteFile.mockRejectedValue(new Error('Oh no!')); -# This section was automatically generated during setup. -elasticsearch.hosts: [some-host] -elasticsearch.serviceAccountToken: some-value -elasticsearch.ssl.certificateAuthorities: [/some/path/ca_1234.crt] + await expect( + kibanaConfigWriter.writeConfig({ + caCert: 'ca-content', + host: '', + serviceAccountToken: { name: '', value: '' }, + }) + ).rejects.toMatchInlineSnapshot(`[Error: Oh no!]`); -` - ); - }); + expect(mockWriteFile).toHaveBeenCalledTimes(1); + expect(mockWriteFile).toHaveBeenCalledWith('/data/ca_1234.crt', 'ca-content'); + }); - it('can successfully write CA certificate and elasticsearch config with credentials', async () => { - await expect( - kibanaConfigWriter.writeConfig({ - caCert: 'ca-content', - host: 'some-host', - username: 'username', - password: 'password', - }) - ).resolves.toBeUndefined(); + it('throws if cannot write config to yaml file', async () => { + mockWriteFile.mockResolvedValueOnce(undefined).mockRejectedValueOnce(new Error('Oh no!')); - expect(mockWriteFile).toHaveBeenCalledTimes(2); - expect(mockWriteFile).toHaveBeenCalledWith('/some/path/ca_1234.crt', 'ca-content'); - expect(mockWriteFile).toHaveBeenCalledWith( - '/some/path/kibana.yml', - ` - -# This section was automatically generated during setup. -elasticsearch.hosts: [some-host] -elasticsearch.password: password -elasticsearch.username: username -elasticsearch.ssl.certificateAuthorities: [/some/path/ca_1234.crt] - -` - ); - }); + await expect( + kibanaConfigWriter.writeConfig({ + caCert: 'ca-content', + host: 'some-host', + serviceAccountToken: { name: 'some-token', value: 'some-value' }, + }) + ).rejects.toMatchInlineSnapshot(`[Error: Oh no!]`); - it('can successfully write elasticsearch config without CA certificate', async () => { - await expect( - kibanaConfigWriter.writeConfig({ - host: 'some-host', - username: 'username', - password: 'password', - }) - ).resolves.toBeUndefined(); + expect(mockWriteFile.mock.calls).toMatchInlineSnapshot(` + Array [ + Array [ + "/data/ca_1234.crt", + "ca-content", + ], + Array [ + "/some/path/kibana.yml", + "# Default Kibana configuration for docker target + server.host: \\"0.0.0.0\\" + server.shutdownTimeout: \\"5s\\" + + # This section was automatically generated during setup. + elasticsearch.hosts: [some-host] + elasticsearch.serviceAccountToken: some-value + elasticsearch.ssl.certificateAuthorities: [/data/ca_1234.crt] + + ", + ], + ] + `); + }); - expect(mockWriteFile).toHaveBeenCalledTimes(1); - expect(mockWriteFile).toHaveBeenCalledWith( - '/some/path/kibana.yml', - ` + it('throws if cannot read existing config', async () => { + mockReadFile.mockRejectedValue(new Error('Oh no!')); -# This section was automatically generated during setup. -elasticsearch.hosts: [some-host] -elasticsearch.password: password -elasticsearch.username: username + await expect( + kibanaConfigWriter.writeConfig({ + caCert: 'ca-content', + host: 'some-host', + serviceAccountToken: { name: 'some-token', value: 'some-value' }, + }) + ).rejects.toMatchInlineSnapshot(`[Error: Oh no!]`); -` - ); - }); + expect(mockWriteFile).not.toHaveBeenCalled(); }); - describe('with existing config (no conflicts)', () => { - beforeEach(() => { - mockReadFile.mockResolvedValue( - '# Default Kibana configuration for docker target\nserver.host: "0.0.0.0"\nserver.shutdownTimeout: "5s"' - ); - }); - - it('can successfully write CA certificate and elasticsearch config', async () => { - await expect( - kibanaConfigWriter.writeConfig({ - caCert: 'ca-content', - host: 'some-host', - serviceAccountToken: { name: 'some-token', value: 'some-value' }, - }) - ).resolves.toBeUndefined(); - - expect(mockReadFile).toHaveBeenCalledTimes(1); - expect(mockReadFile).toHaveBeenCalledWith('/some/path/kibana.yml', 'utf-8'); + it('throws if cannot parse existing config', async () => { + mockReadFile.mockResolvedValue('foo: bar\nfoo: baz'); + + await expect( + kibanaConfigWriter.writeConfig({ + caCert: 'ca-content', + host: 'some-host', + serviceAccountToken: { name: 'some-token', value: 'some-value' }, + }) + ).rejects.toMatchInlineSnapshot(` + [YAMLException: duplicated mapping key at line 2, column 1: + foo: baz + ^] + `); + + expect(mockWriteFile).not.toHaveBeenCalled(); + }); - expect(mockWriteFile).toHaveBeenCalledTimes(2); - expect(mockWriteFile.mock.calls).toMatchInlineSnapshot(` + it('can successfully write CA certificate and elasticsearch config with credentials', async () => { + await expect( + kibanaConfigWriter.writeConfig({ + caCert: 'ca-content', + host: 'some-host', + username: 'username', + password: 'password', + }) + ).resolves.toBeUndefined(); + + expect(mockWriteFile.mock.calls).toMatchInlineSnapshot(` + Array [ Array [ - Array [ - "/some/path/ca_1234.crt", - "ca-content", - ], - Array [ - "/some/path/kibana.yml", - "# Default Kibana configuration for docker target - server.host: \\"0.0.0.0\\" - server.shutdownTimeout: \\"5s\\" + "/data/ca_1234.crt", + "ca-content", + ], + Array [ + "/some/path/kibana.yml", + "# Default Kibana configuration for docker target + server.host: \\"0.0.0.0\\" + server.shutdownTimeout: \\"5s\\" + + # This section was automatically generated during setup. + elasticsearch.hosts: [some-host] + elasticsearch.password: password + elasticsearch.username: username + elasticsearch.ssl.certificateAuthorities: [/data/ca_1234.crt] + + ", + ], + ] + `); + }); - # This section was automatically generated during setup. - elasticsearch.hosts: [some-host] - elasticsearch.serviceAccountToken: some-value - elasticsearch.ssl.certificateAuthorities: [/some/path/ca_1234.crt] + it('can successfully write elasticsearch config without CA certificate', async () => { + await expect( + kibanaConfigWriter.writeConfig({ + host: 'some-host', + username: 'username', + password: 'password', + }) + ).resolves.toBeUndefined(); + + expect(mockWriteFile.mock.calls).toMatchInlineSnapshot(` + Array [ + Array [ + "/some/path/kibana.yml", + "# Default Kibana configuration for docker target + server.host: \\"0.0.0.0\\" + server.shutdownTimeout: \\"5s\\" + + # This section was automatically generated during setup. + elasticsearch.hosts: [some-host] + elasticsearch.password: password + elasticsearch.username: username + + ", + ], + ] + `); + }); - ", - ], - ] - `); - }); + it('can successfully write CA certificate and elasticsearch config with service token', async () => { + await expect( + kibanaConfigWriter.writeConfig({ + caCert: 'ca-content', + host: 'some-host', + serviceAccountToken: { name: 'some-token', value: 'some-value' }, + }) + ).resolves.toBeUndefined(); + + expect(mockReadFile).toHaveBeenCalledTimes(1); + expect(mockReadFile).toHaveBeenCalledWith('/some/path/kibana.yml', 'utf-8'); + + expect(mockWriteFile).toHaveBeenCalledTimes(2); + expect(mockWriteFile.mock.calls).toMatchInlineSnapshot(` + Array [ + Array [ + "/data/ca_1234.crt", + "ca-content", + ], + Array [ + "/some/path/kibana.yml", + "# Default Kibana configuration for docker target + server.host: \\"0.0.0.0\\" + server.shutdownTimeout: \\"5s\\" + + # This section was automatically generated during setup. + elasticsearch.hosts: [some-host] + elasticsearch.serviceAccountToken: some-value + elasticsearch.ssl.certificateAuthorities: [/data/ca_1234.crt] + + ", + ], + ] + `); }); - describe('with existing config (with conflicts)', () => { + describe('with conflicts', () => { beforeEach(() => { jest.spyOn(Date.prototype, 'toISOString').mockReturnValue('some date'); mockReadFile.mockResolvedValue( @@ -291,7 +281,7 @@ elasticsearch.username: username expect(mockWriteFile.mock.calls).toMatchInlineSnapshot(` Array [ Array [ - "/some/path/ca_1234.crt", + "/data/ca_1234.crt", "ca-content", ], Array [ @@ -312,7 +302,7 @@ elasticsearch.username: username elasticsearch.hosts: [some-host] monitoring.ui.container.elasticsearch.enabled: true elasticsearch.serviceAccountToken: some-value - elasticsearch.ssl.certificateAuthorities: [/some/path/ca_1234.crt] + elasticsearch.ssl.certificateAuthorities: [/data/ca_1234.crt] ", ], diff --git a/src/plugins/interactive_setup/server/kibana_config_writer.ts b/src/plugins/interactive_setup/server/kibana_config_writer.ts index ff67e887fab49..ea7f776aad82f 100644 --- a/src/plugins/interactive_setup/server/kibana_config_writer.ts +++ b/src/plugins/interactive_setup/server/kibana_config_writer.ts @@ -31,24 +31,23 @@ export type WriteConfigParameters = { ); export class KibanaConfigWriter { - constructor(private readonly configPath: string, private readonly logger: Logger) {} + constructor( + private readonly configPath: string, + private readonly dataDirectoryPath: string, + private readonly logger: Logger + ) {} /** - * Checks if we can write to the Kibana configuration file and configuration directory. + * Checks if we can write to the Kibana configuration file and data directory. */ public async isConfigWritable() { try { // We perform two separate checks here: - // 1. If we can write to config directory to add a new CA certificate file and potentially Kibana configuration - // file if it doesn't exist for some reason. + // 1. If we can write to data directory to add a new CA certificate file. // 2. If we can write to the Kibana configuration file if it exists. - const canWriteToConfigDirectory = fs.access(path.dirname(this.configPath), constants.W_OK); await Promise.all([ - canWriteToConfigDirectory, - fs.access(this.configPath, constants.F_OK).then( - () => fs.access(this.configPath, constants.W_OK), - () => canWriteToConfigDirectory - ), + fs.access(this.dataDirectoryPath, constants.W_OK), + fs.access(this.configPath, constants.W_OK), ]); return true; } catch { @@ -61,7 +60,7 @@ export class KibanaConfigWriter { * @param params */ public async writeConfig(params: WriteConfigParameters) { - const caPath = path.join(path.dirname(this.configPath), `ca_${Date.now()}.crt`); + const caPath = path.join(this.dataDirectoryPath, `ca_${Date.now()}.crt`); const config: Record = { 'elasticsearch.hosts': [params.host] }; if ('serviceAccountToken' in params) { config['elasticsearch.serviceAccountToken'] = params.serviceAccountToken.value; diff --git a/src/plugins/interactive_setup/server/plugin.ts b/src/plugins/interactive_setup/server/plugin.ts index 8c1d00a254764..067b8fd044f30 100644 --- a/src/plugins/interactive_setup/server/plugin.ts +++ b/src/plugins/interactive_setup/server/plugin.ts @@ -10,6 +10,7 @@ import chalk from 'chalk'; import type { Subscription } from 'rxjs'; import type { TypeOf } from '@kbn/config-schema'; +import { getDataPath } from '@kbn/utils'; import type { CorePreboot, Logger, PluginInitializerContext, PrebootPlugin } from 'src/core/server'; import { ElasticsearchConnectionStatus } from '../common'; @@ -146,7 +147,11 @@ Go to ${chalk.cyanBright.underline(url)} to get started. basePath: core.http.basePath, logger: this.#logger.get('routes'), preboot: { ...core.preboot, completeSetup }, - kibanaConfigWriter: new KibanaConfigWriter(configPath, this.#logger.get('kibana-config')), + kibanaConfigWriter: new KibanaConfigWriter( + configPath, + getDataPath(), + this.#logger.get('kibana-config') + ), elasticsearch, verificationCode, getConfig: this.#getConfig.bind(this), From a266b2d426f09f52f585a0facee4d2a7aaea20ec Mon Sep 17 00:00:00 2001 From: Mark Hopkin Date: Mon, 25 Oct 2021 19:54:11 +0100 Subject: [PATCH 18/23] [Fleet] Add link to integration data retention documentation (#115353) * add ILM policy help text * update API docs * change link * regen api docs --- ...-plugin-core-public.doclinksstart.links.md | 1 + ...kibana-plugin-core-public.doclinksstart.md | 2 +- .../public/doc_links/doc_links_service.ts | 2 ++ src/core/public/public.api.md | 1 + .../step_define_package_policy.tsx | 28 +++++++++++++++++++ 5 files changed, 33 insertions(+), 1 deletion(-) diff --git a/docs/development/core/public/kibana-plugin-core-public.doclinksstart.links.md b/docs/development/core/public/kibana-plugin-core-public.doclinksstart.links.md index 01e7beae61ce8..ed6763db69ffe 100644 --- a/docs/development/core/public/kibana-plugin-core-public.doclinksstart.links.md +++ b/docs/development/core/public/kibana-plugin-core-public.doclinksstart.links.md @@ -229,6 +229,7 @@ readonly links: { readonly snapshotRestore: Record; readonly ingest: Record; readonly fleet: Readonly<{ + datastreamsILM: string; guide: string; fleetServer: string; fleetServerAddFleetServer: string; diff --git a/docs/development/core/public/kibana-plugin-core-public.doclinksstart.md b/docs/development/core/public/kibana-plugin-core-public.doclinksstart.md index fdf469f443f28..96c2c0df9d782 100644 --- a/docs/development/core/public/kibana-plugin-core-public.doclinksstart.md +++ b/docs/development/core/public/kibana-plugin-core-public.doclinksstart.md @@ -17,5 +17,5 @@ export interface DocLinksStart | --- | --- | --- | | [DOC\_LINK\_VERSION](./kibana-plugin-core-public.doclinksstart.doc_link_version.md) | string | | | [ELASTIC\_WEBSITE\_URL](./kibana-plugin-core-public.doclinksstart.elastic_website_url.md) | string | | -| [links](./kibana-plugin-core-public.doclinksstart.links.md) | {
readonly settings: string;
readonly elasticStackGetStarted: string;
readonly apm: {
readonly kibanaSettings: string;
readonly supportedServiceMaps: string;
readonly customLinks: string;
readonly droppedTransactionSpans: string;
readonly upgrading: string;
readonly metaData: string;
};
readonly canvas: {
readonly guide: string;
};
readonly dashboard: {
readonly guide: string;
readonly drilldowns: string;
readonly drilldownsTriggerPicker: string;
readonly urlDrilldownTemplateSyntax: string;
readonly urlDrilldownVariables: string;
};
readonly discover: Record<string, string>;
readonly filebeat: {
readonly base: string;
readonly installation: string;
readonly configuration: string;
readonly elasticsearchOutput: string;
readonly elasticsearchModule: string;
readonly startup: string;
readonly exportedFields: string;
readonly suricataModule: string;
readonly zeekModule: string;
};
readonly auditbeat: {
readonly base: string;
readonly auditdModule: string;
readonly systemModule: string;
};
readonly metricbeat: {
readonly base: string;
readonly configure: string;
readonly httpEndpoint: string;
readonly install: string;
readonly start: string;
};
readonly enterpriseSearch: {
readonly base: string;
readonly appSearchBase: string;
readonly workplaceSearchBase: string;
};
readonly heartbeat: {
readonly base: string;
};
readonly libbeat: {
readonly getStarted: string;
};
readonly logstash: {
readonly base: string;
};
readonly functionbeat: {
readonly base: string;
};
readonly winlogbeat: {
readonly base: string;
};
readonly aggs: {
readonly composite: string;
readonly composite_missing_bucket: string;
readonly date_histogram: string;
readonly date_range: string;
readonly date_format_pattern: string;
readonly filter: string;
readonly filters: string;
readonly geohash_grid: string;
readonly histogram: string;
readonly ip_range: string;
readonly range: string;
readonly significant_terms: string;
readonly terms: string;
readonly avg: string;
readonly avg_bucket: string;
readonly max_bucket: string;
readonly min_bucket: string;
readonly sum_bucket: string;
readonly cardinality: string;
readonly count: string;
readonly cumulative_sum: string;
readonly derivative: string;
readonly geo_bounds: string;
readonly geo_centroid: string;
readonly max: string;
readonly median: string;
readonly min: string;
readonly moving_avg: string;
readonly percentile_ranks: string;
readonly serial_diff: string;
readonly std_dev: string;
readonly sum: string;
readonly top_hits: string;
};
readonly runtimeFields: {
readonly overview: string;
readonly mapping: string;
};
readonly scriptedFields: {
readonly scriptFields: string;
readonly scriptAggs: string;
readonly painless: string;
readonly painlessApi: string;
readonly painlessLangSpec: string;
readonly painlessSyntax: string;
readonly painlessWalkthrough: string;
readonly luceneExpressions: string;
};
readonly search: {
readonly sessions: string;
readonly sessionLimits: string;
};
readonly indexPatterns: {
readonly introduction: string;
readonly fieldFormattersNumber: string;
readonly fieldFormattersString: string;
readonly runtimeFields: string;
};
readonly addData: string;
readonly kibana: string;
readonly upgradeAssistant: string;
readonly rollupJobs: string;
readonly elasticsearch: Record<string, string>;
readonly siem: {
readonly privileges: string;
readonly guide: string;
readonly gettingStarted: string;
readonly ml: string;
readonly ruleChangeLog: string;
readonly detectionsReq: string;
readonly networkMap: string;
readonly troubleshootGaps: string;
};
readonly securitySolution: {
readonly trustedApps: string;
};
readonly query: {
readonly eql: string;
readonly kueryQuerySyntax: string;
readonly luceneQuerySyntax: string;
readonly percolate: string;
readonly queryDsl: string;
readonly autocompleteChanges: string;
};
readonly date: {
readonly dateMath: string;
readonly dateMathIndexNames: string;
};
readonly management: Record<string, string>;
readonly ml: Record<string, string>;
readonly transforms: Record<string, string>;
readonly visualize: Record<string, string>;
readonly apis: Readonly<{
bulkIndexAlias: string;
byteSizeUnits: string;
createAutoFollowPattern: string;
createFollower: string;
createIndex: string;
createSnapshotLifecyclePolicy: string;
createRoleMapping: string;
createRoleMappingTemplates: string;
createRollupJobsRequest: string;
createApiKey: string;
createPipeline: string;
createTransformRequest: string;
cronExpressions: string;
executeWatchActionModes: string;
indexExists: string;
openIndex: string;
putComponentTemplate: string;
painlessExecute: string;
painlessExecuteAPIContexts: string;
putComponentTemplateMetadata: string;
putSnapshotLifecyclePolicy: string;
putIndexTemplateV1: string;
putWatch: string;
simulatePipeline: string;
timeUnits: string;
updateTransform: string;
}>;
readonly observability: Readonly<{
guide: string;
infrastructureThreshold: string;
logsThreshold: string;
metricsThreshold: string;
monitorStatus: string;
monitorUptime: string;
tlsCertificate: string;
uptimeDurationAnomaly: string;
}>;
readonly alerting: Record<string, string>;
readonly maps: Record<string, string>;
readonly monitoring: Record<string, string>;
readonly security: Readonly<{
apiKeyServiceSettings: string;
clusterPrivileges: string;
elasticsearchSettings: string;
elasticsearchEnableSecurity: string;
indicesPrivileges: string;
kibanaTLS: string;
kibanaPrivileges: string;
mappingRoles: string;
mappingRolesFieldRules: string;
runAsPrivilege: string;
}>;
readonly spaces: Readonly<{
kibanaLegacyUrlAliases: string;
kibanaDisableLegacyUrlAliasesApi: string;
}>;
readonly watcher: Record<string, string>;
readonly ccs: Record<string, string>;
readonly plugins: Record<string, string>;
readonly snapshotRestore: Record<string, string>;
readonly ingest: Record<string, string>;
readonly fleet: Readonly<{
guide: string;
fleetServer: string;
fleetServerAddFleetServer: string;
settings: string;
settingsFleetServerHostSettings: string;
troubleshooting: string;
elasticAgent: string;
datastreams: string;
datastreamsNamingScheme: string;
installElasticAgent: string;
upgradeElasticAgent: string;
upgradeElasticAgent712lower: string;
learnMoreBlog: string;
apiKeysLearnMore: string;
}>;
readonly ecs: {
readonly guide: string;
};
readonly clients: {
readonly guide: string;
readonly goOverview: string;
readonly javaIndex: string;
readonly jsIntro: string;
readonly netGuide: string;
readonly perlGuide: string;
readonly phpGuide: string;
readonly pythonGuide: string;
readonly rubyOverview: string;
readonly rustGuide: string;
};
} | | +| [links](./kibana-plugin-core-public.doclinksstart.links.md) | {
readonly settings: string;
readonly elasticStackGetStarted: string;
readonly apm: {
readonly kibanaSettings: string;
readonly supportedServiceMaps: string;
readonly customLinks: string;
readonly droppedTransactionSpans: string;
readonly upgrading: string;
readonly metaData: string;
};
readonly canvas: {
readonly guide: string;
};
readonly dashboard: {
readonly guide: string;
readonly drilldowns: string;
readonly drilldownsTriggerPicker: string;
readonly urlDrilldownTemplateSyntax: string;
readonly urlDrilldownVariables: string;
};
readonly discover: Record<string, string>;
readonly filebeat: {
readonly base: string;
readonly installation: string;
readonly configuration: string;
readonly elasticsearchOutput: string;
readonly elasticsearchModule: string;
readonly startup: string;
readonly exportedFields: string;
readonly suricataModule: string;
readonly zeekModule: string;
};
readonly auditbeat: {
readonly base: string;
readonly auditdModule: string;
readonly systemModule: string;
};
readonly metricbeat: {
readonly base: string;
readonly configure: string;
readonly httpEndpoint: string;
readonly install: string;
readonly start: string;
};
readonly enterpriseSearch: {
readonly base: string;
readonly appSearchBase: string;
readonly workplaceSearchBase: string;
};
readonly heartbeat: {
readonly base: string;
};
readonly libbeat: {
readonly getStarted: string;
};
readonly logstash: {
readonly base: string;
};
readonly functionbeat: {
readonly base: string;
};
readonly winlogbeat: {
readonly base: string;
};
readonly aggs: {
readonly composite: string;
readonly composite_missing_bucket: string;
readonly date_histogram: string;
readonly date_range: string;
readonly date_format_pattern: string;
readonly filter: string;
readonly filters: string;
readonly geohash_grid: string;
readonly histogram: string;
readonly ip_range: string;
readonly range: string;
readonly significant_terms: string;
readonly terms: string;
readonly avg: string;
readonly avg_bucket: string;
readonly max_bucket: string;
readonly min_bucket: string;
readonly sum_bucket: string;
readonly cardinality: string;
readonly count: string;
readonly cumulative_sum: string;
readonly derivative: string;
readonly geo_bounds: string;
readonly geo_centroid: string;
readonly max: string;
readonly median: string;
readonly min: string;
readonly moving_avg: string;
readonly percentile_ranks: string;
readonly serial_diff: string;
readonly std_dev: string;
readonly sum: string;
readonly top_hits: string;
};
readonly runtimeFields: {
readonly overview: string;
readonly mapping: string;
};
readonly scriptedFields: {
readonly scriptFields: string;
readonly scriptAggs: string;
readonly painless: string;
readonly painlessApi: string;
readonly painlessLangSpec: string;
readonly painlessSyntax: string;
readonly painlessWalkthrough: string;
readonly luceneExpressions: string;
};
readonly search: {
readonly sessions: string;
readonly sessionLimits: string;
};
readonly indexPatterns: {
readonly introduction: string;
readonly fieldFormattersNumber: string;
readonly fieldFormattersString: string;
readonly runtimeFields: string;
};
readonly addData: string;
readonly kibana: string;
readonly upgradeAssistant: string;
readonly rollupJobs: string;
readonly elasticsearch: Record<string, string>;
readonly siem: {
readonly privileges: string;
readonly guide: string;
readonly gettingStarted: string;
readonly ml: string;
readonly ruleChangeLog: string;
readonly detectionsReq: string;
readonly networkMap: string;
readonly troubleshootGaps: string;
};
readonly securitySolution: {
readonly trustedApps: string;
};
readonly query: {
readonly eql: string;
readonly kueryQuerySyntax: string;
readonly luceneQuerySyntax: string;
readonly percolate: string;
readonly queryDsl: string;
readonly autocompleteChanges: string;
};
readonly date: {
readonly dateMath: string;
readonly dateMathIndexNames: string;
};
readonly management: Record<string, string>;
readonly ml: Record<string, string>;
readonly transforms: Record<string, string>;
readonly visualize: Record<string, string>;
readonly apis: Readonly<{
bulkIndexAlias: string;
byteSizeUnits: string;
createAutoFollowPattern: string;
createFollower: string;
createIndex: string;
createSnapshotLifecyclePolicy: string;
createRoleMapping: string;
createRoleMappingTemplates: string;
createRollupJobsRequest: string;
createApiKey: string;
createPipeline: string;
createTransformRequest: string;
cronExpressions: string;
executeWatchActionModes: string;
indexExists: string;
openIndex: string;
putComponentTemplate: string;
painlessExecute: string;
painlessExecuteAPIContexts: string;
putComponentTemplateMetadata: string;
putSnapshotLifecyclePolicy: string;
putIndexTemplateV1: string;
putWatch: string;
simulatePipeline: string;
timeUnits: string;
updateTransform: string;
}>;
readonly observability: Readonly<{
guide: string;
infrastructureThreshold: string;
logsThreshold: string;
metricsThreshold: string;
monitorStatus: string;
monitorUptime: string;
tlsCertificate: string;
uptimeDurationAnomaly: string;
}>;
readonly alerting: Record<string, string>;
readonly maps: Record<string, string>;
readonly monitoring: Record<string, string>;
readonly security: Readonly<{
apiKeyServiceSettings: string;
clusterPrivileges: string;
elasticsearchSettings: string;
elasticsearchEnableSecurity: string;
elasticsearchEnableApiKeys: string;
indicesPrivileges: string;
kibanaTLS: string;
kibanaPrivileges: string;
mappingRoles: string;
mappingRolesFieldRules: string;
runAsPrivilege: string;
}>;
readonly spaces: Readonly<{
kibanaLegacyUrlAliases: string;
kibanaDisableLegacyUrlAliasesApi: string;
}>;
readonly watcher: Record<string, string>;
readonly ccs: Record<string, string>;
readonly plugins: Record<string, string>;
readonly snapshotRestore: Record<string, string>;
readonly ingest: Record<string, string>;
readonly fleet: Readonly<{
datastreamsILM: string;
guide: string;
fleetServer: string;
fleetServerAddFleetServer: string;
settings: string;
settingsFleetServerHostSettings: string;
troubleshooting: string;
elasticAgent: string;
datastreams: string;
datastreamsNamingScheme: string;
installElasticAgent: string;
upgradeElasticAgent: string;
upgradeElasticAgent712lower: string;
learnMoreBlog: string;
apiKeysLearnMore: string;
}>;
readonly ecs: {
readonly guide: string;
};
readonly clients: {
readonly guide: string;
readonly goOverview: string;
readonly javaIndex: string;
readonly jsIntro: string;
readonly netGuide: string;
readonly perlGuide: string;
readonly phpGuide: string;
readonly pythonGuide: string;
readonly rubyOverview: string;
readonly rustGuide: string;
};
} | | diff --git a/src/core/public/doc_links/doc_links_service.ts b/src/core/public/doc_links/doc_links_service.ts index 20757463737fc..2bbb4703ecd19 100644 --- a/src/core/public/doc_links/doc_links_service.ts +++ b/src/core/public/doc_links/doc_links_service.ts @@ -480,6 +480,7 @@ export class DocLinksService { troubleshooting: `${FLEET_DOCS}fleet-troubleshooting.html`, elasticAgent: `${FLEET_DOCS}elastic-agent-installation.html`, datastreams: `${FLEET_DOCS}data-streams.html`, + datastreamsILM: `${FLEET_DOCS}data-streams.html#data-streams-ilm`, datastreamsNamingScheme: `${FLEET_DOCS}data-streams.html#data-streams-naming-scheme`, installElasticAgent: `${FLEET_DOCS}install-fleet-managed-elastic-agent.html`, upgradeElasticAgent: `${FLEET_DOCS}upgrade-elastic-agent.html`, @@ -734,6 +735,7 @@ export interface DocLinksStart { readonly snapshotRestore: Record; readonly ingest: Record; readonly fleet: Readonly<{ + datastreamsILM: string; guide: string; fleetServer: string; fleetServerAddFleetServer: string; diff --git a/src/core/public/public.api.md b/src/core/public/public.api.md index 353e5aa4607e4..bd274d7994bfa 100644 --- a/src/core/public/public.api.md +++ b/src/core/public/public.api.md @@ -698,6 +698,7 @@ export interface DocLinksStart { readonly snapshotRestore: Record; readonly ingest: Record; readonly fleet: Readonly<{ + datastreamsILM: string; guide: string; fleetServer: string; fleetServerAddFleetServer: string; diff --git a/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/create_package_policy_page/step_define_package_policy.tsx b/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/create_package_policy_page/step_define_package_policy.tsx index 29c226ca64f57..e11aaabb4fd95 100644 --- a/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/create_package_policy_page/step_define_package_policy.tsx +++ b/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/create_package_policy_page/step_define_package_policy.tsx @@ -312,6 +312,34 @@ export const StepDefinePackagePolicy: React.FunctionComponent<{ />
+ + + } + helpText={ + + {i18n.translate( + 'xpack.fleet.createPackagePolicy.stepConfigure.packagePolicyDataRetentionLearnMoreLink', + { defaultMessage: 'Learn more' } + )} + + ), + }} + /> + } + > +
+ + {/* Advanced vars */} {advancedVars.map((varDef) => { const { name: varName, type: varType } = varDef; From 3a18a8226ff58d1cab59f67ca428d9d064a8b096 Mon Sep 17 00:00:00 2001 From: Tiago Costa Date: Mon, 25 Oct 2021 19:55:16 +0100 Subject: [PATCH 19/23] skip flaky suite (#116186) --- x-pack/test/api_integration/apis/maps/get_grid_tile.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/x-pack/test/api_integration/apis/maps/get_grid_tile.js b/x-pack/test/api_integration/apis/maps/get_grid_tile.js index c37dc9770693c..63063514555b3 100644 --- a/x-pack/test/api_integration/apis/maps/get_grid_tile.js +++ b/x-pack/test/api_integration/apis/maps/get_grid_tile.js @@ -12,7 +12,8 @@ import expect from '@kbn/expect'; export default function ({ getService }) { const supertest = getService('supertest'); - describe('getGridTile', () => { + // FLAKY: https://github.com/elastic/kibana/issues/116186 + describe.skip('getGridTile', () => { it('should return vector tile containing cluster features', async () => { const resp = await supertest .get( From 81264f73e931412a7c2f8e0fbdf9346ccf5735c0 Mon Sep 17 00:00:00 2001 From: Nathan L Smith Date: Mon, 25 Oct 2021 14:05:15 -0500 Subject: [PATCH 20/23] Re-enable APM E2E tests and allow server to shut down cleanly on failure (#115450) * Re-enable APM E2E tests and allow server to shut down cleanly on failure Calling `process.exit` in the test script made it so the FTR runner would not properly shut down the server, and cause other tests to fail because Kibana was left running on a port. Remove that and just throw instead. No changes were made to the tests, as I was unable to reproduce any failures locally. I'll try in CI and see if we can get anything to fail. Fixes #115280. --- .../scripts/pipelines/pull_request/pipeline.js | 12 ++++++------ .buildkite/scripts/steps/functional/apm_cypress.sh | 8 ++++++-- vars/tasks.groovy | 14 +++++++------- x-pack/plugins/apm/ftr_e2e/cypress_start.ts | 11 +++-------- x-pack/plugins/apm/scripts/test/e2e.js | 9 +++++++-- 5 files changed, 29 insertions(+), 25 deletions(-) diff --git a/.buildkite/scripts/pipelines/pull_request/pipeline.js b/.buildkite/scripts/pipelines/pull_request/pipeline.js index 7b5c944d31c1c..02d6fc270ddb0 100644 --- a/.buildkite/scripts/pipelines/pull_request/pipeline.js +++ b/.buildkite/scripts/pipelines/pull_request/pipeline.js @@ -66,12 +66,12 @@ const uploadPipeline = (pipelineContent) => { pipeline.push(getPipeline('.buildkite/pipelines/pull_request/security_solution.yml')); } - // if ( - // (await doAnyChangesMatch([/^x-pack\/plugins\/apm/])) || - // process.env.GITHUB_PR_LABELS.includes('ci:all-cypress-suites') - // ) { - // pipeline.push(getPipeline('.buildkite/pipelines/pull_request/apm_cypress.yml')); - // } + if ( + (await doAnyChangesMatch([/^x-pack\/plugins\/apm/])) || + process.env.GITHUB_PR_LABELS.includes('ci:all-cypress-suites') + ) { + pipeline.push(getPipeline('.buildkite/pipelines/pull_request/apm_cypress.yml')); + } if (await doAnyChangesMatch([/^x-pack\/plugins\/uptime/])) { pipeline.push(getPipeline('.buildkite/pipelines/pull_request/uptime.yml')); diff --git a/.buildkite/scripts/steps/functional/apm_cypress.sh b/.buildkite/scripts/steps/functional/apm_cypress.sh index 800f22c78d14c..77b26fafee920 100755 --- a/.buildkite/scripts/steps/functional/apm_cypress.sh +++ b/.buildkite/scripts/steps/functional/apm_cypress.sh @@ -2,7 +2,10 @@ set -euo pipefail -source .buildkite/scripts/steps/functional/common.sh +source .buildkite/scripts/common/util.sh + +.buildkite/scripts/bootstrap.sh +.buildkite/scripts/download_build_artifacts.sh export JOB=kibana-apm-cypress @@ -11,4 +14,5 @@ echo "--- APM Cypress Tests" cd "$XPACK_DIR" checks-reporter-with-killswitch "APM Cypress Tests" \ - node plugins/apm/scripts/test/e2e.js + node plugins/apm/scripts/test/e2e.js \ + --kibana-install-dir "$KIBANA_BUILD_LOCATION" diff --git a/vars/tasks.groovy b/vars/tasks.groovy index da18d73e5b36c..1842e278282b1 100644 --- a/vars/tasks.groovy +++ b/vars/tasks.groovy @@ -146,13 +146,13 @@ def functionalXpack(Map params = [:]) { } } - // whenChanged([ - // 'x-pack/plugins/apm/', - // ]) { - // if (githubPr.isPr()) { - // task(kibanaPipeline.functionalTestProcess('xpack-APMCypress', './test/scripts/jenkins_apm_cypress.sh')) - // } - // } + whenChanged([ + 'x-pack/plugins/apm/', + ]) { + if (githubPr.isPr()) { + task(kibanaPipeline.functionalTestProcess('xpack-APMCypress', './test/scripts/jenkins_apm_cypress.sh')) + } + } whenChanged([ 'x-pack/plugins/uptime/', diff --git a/x-pack/plugins/apm/ftr_e2e/cypress_start.ts b/x-pack/plugins/apm/ftr_e2e/cypress_start.ts index caf87d2627459..0cfc58653801a 100644 --- a/x-pack/plugins/apm/ftr_e2e/cypress_start.ts +++ b/x-pack/plugins/apm/ftr_e2e/cypress_start.ts @@ -16,15 +16,10 @@ import { esArchiverLoad, esArchiverUnload } from './cypress/tasks/es_archiver'; export function cypressRunTests(spec?: string) { return async ({ getService }: FtrProviderContext) => { - try { - const result = await cypressStart(getService, cypress.run, spec); + const result = await cypressStart(getService, cypress.run, spec); - if (result && (result.status === 'failed' || result.totalFailed > 0)) { - process.exit(1); - } - } catch (error) { - console.error('errors: ', error); - process.exit(1); + if (result && (result.status === 'failed' || result.totalFailed > 0)) { + throw new Error(`APM Cypress tests failed`); } }; } diff --git a/x-pack/plugins/apm/scripts/test/e2e.js b/x-pack/plugins/apm/scripts/test/e2e.js index 629cdc2498414..b3ce510a8e569 100644 --- a/x-pack/plugins/apm/scripts/test/e2e.js +++ b/x-pack/plugins/apm/scripts/test/e2e.js @@ -12,6 +12,11 @@ const yargs = require('yargs'); const childProcess = require('child_process'); const { argv } = yargs(process.argv.slice(2)) + .option('kibana-install-dir', { + default: '', + type: 'string', + description: 'Path to the Kibana install directory', + }) .option('server', { default: false, type: 'boolean', @@ -30,7 +35,7 @@ const { argv } = yargs(process.argv.slice(2)) }) .help(); -const { server, runner, open } = argv; +const { server, runner, open, kibanaInstallDir } = argv; const e2eDir = path.join(__dirname, '../../ftr_e2e'); @@ -44,6 +49,6 @@ if (server) { const config = open ? './cypress_open.ts' : './cypress_run.ts'; childProcess.execSync( - `node ../../../../scripts/${ftrScript} --config ${config}`, + `node ../../../../scripts/${ftrScript} --config ${config} --kibana-install-dir '${kibanaInstallDir}'`, { cwd: e2eDir, stdio: 'inherit' } ); From 0119bd8e4547b877fe98ba3ca214e5df8cde3c6a Mon Sep 17 00:00:00 2001 From: Nicolas Chaulet Date: Mon, 25 Oct 2021 15:33:33 -0400 Subject: [PATCH 21/23] [Fleet] Remove unused authenticateAgentWithAccessToken method from agent service (#116183) --- x-pack/plugins/fleet/server/mocks/index.ts | 1 - x-pack/plugins/fleet/server/plugin.ts | 2 - .../services/agents/authenticate.test.ts | 156 ------------------ .../server/services/agents/authenticate.ts | 34 ---- .../fleet/server/services/agents/index.ts | 1 - x-pack/plugins/fleet/server/services/index.ts | 10 +- 6 files changed, 1 insertion(+), 203 deletions(-) delete mode 100644 x-pack/plugins/fleet/server/services/agents/authenticate.test.ts delete mode 100644 x-pack/plugins/fleet/server/services/agents/authenticate.ts diff --git a/x-pack/plugins/fleet/server/mocks/index.ts b/x-pack/plugins/fleet/server/mocks/index.ts index e6577426974a3..9300e0bb6c3e1 100644 --- a/x-pack/plugins/fleet/server/mocks/index.ts +++ b/x-pack/plugins/fleet/server/mocks/index.ts @@ -114,7 +114,6 @@ export const createMockAgentService = (): jest.Mocked => { return { getAgentStatusById: jest.fn(), getAgentStatusForAgentPolicy: jest.fn(), - authenticateAgentWithAccessToken: jest.fn(), getAgent: jest.fn(), listAgents: jest.fn(), }; diff --git a/x-pack/plugins/fleet/server/plugin.ts b/x-pack/plugins/fleet/server/plugin.ts index 8a95065380b69..410682a13733c 100644 --- a/x-pack/plugins/fleet/server/plugin.ts +++ b/x-pack/plugins/fleet/server/plugin.ts @@ -74,7 +74,6 @@ import { import { getAgentStatusById, getAgentStatusForAgentPolicy, - authenticateAgentWithAccessToken, getAgentsByKuery, getAgentById, } from './services/agents'; @@ -342,7 +341,6 @@ export class FleetPlugin listAgents: getAgentsByKuery, getAgentStatusById, getAgentStatusForAgentPolicy, - authenticateAgentWithAccessToken, }, agentPolicyService: { get: agentPolicyService.get, diff --git a/x-pack/plugins/fleet/server/services/agents/authenticate.test.ts b/x-pack/plugins/fleet/server/services/agents/authenticate.test.ts deleted file mode 100644 index eaa240165e853..0000000000000 --- a/x-pack/plugins/fleet/server/services/agents/authenticate.test.ts +++ /dev/null @@ -1,156 +0,0 @@ -/* - * 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; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import type { KibanaRequest } from 'kibana/server'; -import { elasticsearchServiceMock } from 'src/core/server/mocks'; - -import { authenticateAgentWithAccessToken } from './authenticate'; - -describe('test agent autenticate services', () => { - it('should succeed with a valid API key and an active agent', async () => { - const mockEsClient = elasticsearchServiceMock.createInternalClient(); - - mockEsClient.search.mockResolvedValue({ - body: { - hits: { - hits: [ - { - // @ts-expect-error - _id: 'agent1', - _source: { - // @ts-expect-error - active: true, - // @ts-expect-error - access_api_key_id: 'pedTuHIBTEDt93wW0Fhr', - }, - }, - ], - }, - }, - }); - await authenticateAgentWithAccessToken(mockEsClient, { - auth: { isAuthenticated: true }, - headers: { - authorization: 'ApiKey cGVkVHVISUJURUR0OTN3VzBGaHI6TnU1U0JtbHJSeC12Rm9qQWpoSHlUZw==', - }, - } as KibanaRequest); - }); - - it('should throw if the request is not authenticated', async () => { - const mockEsClient = elasticsearchServiceMock.createInternalClient(); - - mockEsClient.search.mockResolvedValue({ - body: { - hits: { - hits: [ - { - // @ts-expect-error - _id: 'agent1', - _source: { - // @ts-expect-error - active: true, - // @ts-expect-error - access_api_key_id: 'pedTuHIBTEDt93wW0Fhr', - }, - }, - ], - }, - }, - }); - expect( - authenticateAgentWithAccessToken(mockEsClient, { - auth: { isAuthenticated: false }, - headers: { - authorization: 'ApiKey cGVkVHVISUJURUR0OTN3VzBGaHI6TnU1U0JtbHJSeC12Rm9qQWpoSHlUZw==', - }, - } as KibanaRequest) - ).rejects.toThrow(/Request not authenticated/); - }); - - it('should throw if the ApiKey headers is malformed', async () => { - const mockEsClient = elasticsearchServiceMock.createInternalClient(); - - const hits = [ - { - _id: 'agent1', - _source: { - active: true, - - access_api_key_id: 'pedTuHIBTEDt93wW0Fhr', - }, - }, - ]; - - mockEsClient.search.mockResolvedValue({ - body: { - hits: { - // @ts-expect-error - hits, - }, - }, - }); - expect( - authenticateAgentWithAccessToken(mockEsClient, { - auth: { isAuthenticated: true }, - headers: { - authorization: 'aaaa', - }, - } as KibanaRequest) - ).rejects.toThrow(/Authorization header is malformed/); - }); - - it('should throw if the agent is not active', async () => { - const mockEsClient = elasticsearchServiceMock.createInternalClient(); - - const hits = [ - { - _id: 'agent1', - _source: { - active: false, - access_api_key_id: 'pedTuHIBTEDt93wW0Fhr', - }, - }, - ]; - mockEsClient.search.mockResolvedValue({ - body: { - hits: { - // @ts-expect-error - hits, - }, - }, - }); - expect( - authenticateAgentWithAccessToken(mockEsClient, { - auth: { isAuthenticated: true }, - headers: { - authorization: 'ApiKey cGVkVHVISUJURUR0OTN3VzBGaHI6TnU1U0JtbHJSeC12Rm9qQWpoSHlUZw==', - }, - } as KibanaRequest) - ).rejects.toThrow(/Agent inactive/); - }); - - it('should throw if there is no agent matching the API key', async () => { - const mockEsClient = elasticsearchServiceMock.createInternalClient(); - - mockEsClient.search.mockResolvedValue({ - body: { - hits: { - // @ts-expect-error - hits: [], - }, - }, - }); - expect( - authenticateAgentWithAccessToken(mockEsClient, { - auth: { isAuthenticated: true }, - headers: { - authorization: 'ApiKey cGVkVHVISUJURUR0OTN3VzBGaHI6TnU1U0JtbHJSeC12Rm9qQWpoSHlUZw==', - }, - } as KibanaRequest) - ).rejects.toThrow(/Agent not found/); - }); -}); diff --git a/x-pack/plugins/fleet/server/services/agents/authenticate.ts b/x-pack/plugins/fleet/server/services/agents/authenticate.ts deleted file mode 100644 index 0d0d520528dad..0000000000000 --- a/x-pack/plugins/fleet/server/services/agents/authenticate.ts +++ /dev/null @@ -1,34 +0,0 @@ -/* - * 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; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import Boom from '@hapi/boom'; -import type { KibanaRequest } from 'src/core/server'; -import type { ElasticsearchClient } from 'src/core/server'; - -import type { Agent } from '../../types'; -import * as APIKeyService from '../api_keys'; - -import { getAgentByAccessAPIKeyId } from './crud'; - -export async function authenticateAgentWithAccessToken( - esClient: ElasticsearchClient, - request: KibanaRequest -): Promise { - if (!request.auth.isAuthenticated) { - throw Boom.unauthorized('Request not authenticated'); - } - let res: { apiKey: string; apiKeyId: string }; - try { - res = APIKeyService.parseApiKeyFromHeaders(request.headers); - } catch (err) { - throw Boom.unauthorized(err.message); - } - - const agent = await getAgentByAccessAPIKeyId(esClient, res.apiKeyId); - - return agent; -} diff --git a/x-pack/plugins/fleet/server/services/agents/index.ts b/x-pack/plugins/fleet/server/services/agents/index.ts index ede548c6fd60d..9b2846b68364e 100644 --- a/x-pack/plugins/fleet/server/services/agents/index.ts +++ b/x-pack/plugins/fleet/server/services/agents/index.ts @@ -12,5 +12,4 @@ export * from './crud'; export * from './update'; export * from './actions'; export * from './reassign'; -export * from './authenticate'; export * from './setup'; diff --git a/x-pack/plugins/fleet/server/services/index.ts b/x-pack/plugins/fleet/server/services/index.ts index 0ec8a1452beb1..ab88e5af18efa 100644 --- a/x-pack/plugins/fleet/server/services/index.ts +++ b/x-pack/plugins/fleet/server/services/index.ts @@ -5,10 +5,9 @@ * 2.0. */ -import type { KibanaRequest } from 'kibana/server'; import type { ElasticsearchClient, SavedObjectsClientContract } from 'kibana/server'; -import type { AgentStatus, Agent } from '../types'; +import type { AgentStatus } from '../types'; import type { GetAgentStatusResponse } from '../../common'; @@ -48,13 +47,6 @@ export interface AgentService { * Get an Agent by id */ getAgent: typeof getAgentById; - /** - * Authenticate an agent with access toekn - */ - authenticateAgentWithAccessToken( - esClient: ElasticsearchClient, - request: KibanaRequest - ): Promise; /** * Return the status by the Agent's id */ From 51f8feaea06f2c93d2a97ed0aa944bf918180f06 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B8ren=20Louv-Jansen?= Date: Mon, 25 Oct 2021 22:25:01 +0200 Subject: [PATCH 22/23] Rename `apm-generator` to `apm-synthtrace` (#116075) --- api_docs/deprecations_by_api.mdx | 36 +- api_docs/deprecations_by_plugin.mdx | 101 +++--- api_docs/elastic_apm_generator.json | 288 ---------------- api_docs/elastic_apm_synthtrace.json | 321 ++++++++++++++++++ ...nerator.mdx => elastic_apm_synthtrace.mdx} | 16 +- api_docs/plugin_directory.mdx | 68 ++-- package.json | 2 +- packages/BUILD.bazel | 2 +- packages/elastic-apm-generator/README.md | 107 ------ .../BUILD.bazel | 4 +- packages/elastic-apm-synthtrace/README.md | 115 +++++++ .../jest.config.js | 2 +- .../package.json | 2 +- .../src/.eslintrc.js | 0 .../src/index.ts | 0 .../src/lib/apm_error.ts | 0 .../src/lib/base_span.ts | 0 .../src/lib/defaults/get_observer_defaults.ts | 0 .../src/lib/entity.ts | 0 .../src/lib/instance.ts | 0 .../src/lib/interval.ts | 0 .../src/lib/metricset.ts | 0 .../src/lib/output/to_elasticsearch_output.ts | 0 .../src/lib/serializable.ts | 0 .../src/lib/service.ts | 0 .../src/lib/span.ts | 0 .../src/lib/timerange.ts | 0 .../src/lib/transaction.ts | 0 .../src/lib/utils/aggregate.ts | 0 .../src/lib/utils/create_picker.ts | 0 .../src/lib/utils/generate_id.ts | 0 .../src/lib/utils/get_breakdown_metrics.ts | 0 .../lib/utils/get_span_destination_metrics.ts | 0 .../src/lib/utils/get_transaction_metrics.ts | 0 .../src/scripts/examples/01_simple_trace.ts | 0 .../src/scripts/run.js | 0 .../src/scripts/run.ts | 0 .../src/scripts/utils/clean_write_targets.ts | 0 .../src/scripts/utils/common_options.ts | 0 .../src/scripts/utils/get_common_resources.ts | 0 .../src/scripts/utils/get_scenario.ts | 0 .../src/scripts/utils/get_write_targets.ts | 0 .../src/scripts/utils/interval_to_ms.ts | 0 .../src/scripts/utils/logger.ts | 0 .../utils/start_historical_data_upload.ts | 0 .../scripts/utils/start_live_data_upload.ts | 0 .../src/scripts/utils/upload_events.ts | 0 .../test/scenarios/01_simple_trace.test.ts | 0 .../scenarios/02_transaction_metrics.test.ts | 0 .../03_span_destination_metrics.test.ts | 0 .../scenarios/04_breakdown_metrics.test.ts | 0 .../05_transactions_with_errors.test.ts | 0 .../scenarios/06_application_metrics.test.ts | 0 .../01_simple_trace.test.ts.snap | 0 .../src/test/to_elasticsearch_output.test.ts | 0 .../tsconfig.json | 11 +- .../apm_api_integration/common/trace_data.ts | 2 +- .../tests/error_rate/service_apis.ts | 2 +- .../tests/latency/service_apis.ts | 2 +- .../observability_overview.ts | 2 +- .../instances_main_statistics.ts | 2 +- .../tests/services/throughput.ts | 2 +- .../tests/throughput/dependencies_apis.ts | 2 +- .../tests/throughput/service_apis.ts | 2 +- ...transactions_groups_detailed_statistics.ts | 2 +- yarn.lock | 2 +- 66 files changed, 564 insertions(+), 531 deletions(-) delete mode 100644 api_docs/elastic_apm_generator.json create mode 100644 api_docs/elastic_apm_synthtrace.json rename api_docs/{elastic_apm_generator.mdx => elastic_apm_synthtrace.mdx} (63%) delete mode 100644 packages/elastic-apm-generator/README.md rename packages/{elastic-apm-generator => elastic-apm-synthtrace}/BUILD.bazel (95%) create mode 100644 packages/elastic-apm-synthtrace/README.md rename packages/{elastic-apm-generator => elastic-apm-synthtrace}/jest.config.js (89%) rename packages/{elastic-apm-generator => elastic-apm-synthtrace}/package.json (85%) rename packages/{elastic-apm-generator => elastic-apm-synthtrace}/src/.eslintrc.js (100%) rename packages/{elastic-apm-generator => elastic-apm-synthtrace}/src/index.ts (100%) rename packages/{elastic-apm-generator => elastic-apm-synthtrace}/src/lib/apm_error.ts (100%) rename packages/{elastic-apm-generator => elastic-apm-synthtrace}/src/lib/base_span.ts (100%) rename packages/{elastic-apm-generator => elastic-apm-synthtrace}/src/lib/defaults/get_observer_defaults.ts (100%) rename packages/{elastic-apm-generator => elastic-apm-synthtrace}/src/lib/entity.ts (100%) rename packages/{elastic-apm-generator => elastic-apm-synthtrace}/src/lib/instance.ts (100%) rename packages/{elastic-apm-generator => elastic-apm-synthtrace}/src/lib/interval.ts (100%) rename packages/{elastic-apm-generator => elastic-apm-synthtrace}/src/lib/metricset.ts (100%) rename packages/{elastic-apm-generator => elastic-apm-synthtrace}/src/lib/output/to_elasticsearch_output.ts (100%) rename packages/{elastic-apm-generator => elastic-apm-synthtrace}/src/lib/serializable.ts (100%) rename packages/{elastic-apm-generator => elastic-apm-synthtrace}/src/lib/service.ts (100%) rename packages/{elastic-apm-generator => elastic-apm-synthtrace}/src/lib/span.ts (100%) rename packages/{elastic-apm-generator => elastic-apm-synthtrace}/src/lib/timerange.ts (100%) rename packages/{elastic-apm-generator => elastic-apm-synthtrace}/src/lib/transaction.ts (100%) rename packages/{elastic-apm-generator => elastic-apm-synthtrace}/src/lib/utils/aggregate.ts (100%) rename packages/{elastic-apm-generator => elastic-apm-synthtrace}/src/lib/utils/create_picker.ts (100%) rename packages/{elastic-apm-generator => elastic-apm-synthtrace}/src/lib/utils/generate_id.ts (100%) rename packages/{elastic-apm-generator => elastic-apm-synthtrace}/src/lib/utils/get_breakdown_metrics.ts (100%) rename packages/{elastic-apm-generator => elastic-apm-synthtrace}/src/lib/utils/get_span_destination_metrics.ts (100%) rename packages/{elastic-apm-generator => elastic-apm-synthtrace}/src/lib/utils/get_transaction_metrics.ts (100%) rename packages/{elastic-apm-generator => elastic-apm-synthtrace}/src/scripts/examples/01_simple_trace.ts (100%) rename packages/{elastic-apm-generator => elastic-apm-synthtrace}/src/scripts/run.js (100%) rename packages/{elastic-apm-generator => elastic-apm-synthtrace}/src/scripts/run.ts (100%) rename packages/{elastic-apm-generator => elastic-apm-synthtrace}/src/scripts/utils/clean_write_targets.ts (100%) rename packages/{elastic-apm-generator => elastic-apm-synthtrace}/src/scripts/utils/common_options.ts (100%) rename packages/{elastic-apm-generator => elastic-apm-synthtrace}/src/scripts/utils/get_common_resources.ts (100%) rename packages/{elastic-apm-generator => elastic-apm-synthtrace}/src/scripts/utils/get_scenario.ts (100%) rename packages/{elastic-apm-generator => elastic-apm-synthtrace}/src/scripts/utils/get_write_targets.ts (100%) rename packages/{elastic-apm-generator => elastic-apm-synthtrace}/src/scripts/utils/interval_to_ms.ts (100%) rename packages/{elastic-apm-generator => elastic-apm-synthtrace}/src/scripts/utils/logger.ts (100%) rename packages/{elastic-apm-generator => elastic-apm-synthtrace}/src/scripts/utils/start_historical_data_upload.ts (100%) rename packages/{elastic-apm-generator => elastic-apm-synthtrace}/src/scripts/utils/start_live_data_upload.ts (100%) rename packages/{elastic-apm-generator => elastic-apm-synthtrace}/src/scripts/utils/upload_events.ts (100%) rename packages/{elastic-apm-generator => elastic-apm-synthtrace}/src/test/scenarios/01_simple_trace.test.ts (100%) rename packages/{elastic-apm-generator => elastic-apm-synthtrace}/src/test/scenarios/02_transaction_metrics.test.ts (100%) rename packages/{elastic-apm-generator => elastic-apm-synthtrace}/src/test/scenarios/03_span_destination_metrics.test.ts (100%) rename packages/{elastic-apm-generator => elastic-apm-synthtrace}/src/test/scenarios/04_breakdown_metrics.test.ts (100%) rename packages/{elastic-apm-generator => elastic-apm-synthtrace}/src/test/scenarios/05_transactions_with_errors.test.ts (100%) rename packages/{elastic-apm-generator => elastic-apm-synthtrace}/src/test/scenarios/06_application_metrics.test.ts (100%) rename packages/{elastic-apm-generator => elastic-apm-synthtrace}/src/test/scenarios/__snapshots__/01_simple_trace.test.ts.snap (100%) rename packages/{elastic-apm-generator => elastic-apm-synthtrace}/src/test/to_elasticsearch_output.test.ts (100%) rename packages/{elastic-apm-generator => elastic-apm-synthtrace}/tsconfig.json (60%) diff --git a/api_docs/deprecations_by_api.mdx b/api_docs/deprecations_by_api.mdx index 341a6b6b6bb33..fda6834f9b4e9 100644 --- a/api_docs/deprecations_by_api.mdx +++ b/api_docs/deprecations_by_api.mdx @@ -16,9 +16,9 @@ warning: This document is auto-generated and is meant to be viewed inside our ex | | securitySolution | - | | | dataViews, visTypeTimeseries, reporting, discover, observability, maps, dataVisualizer, apm, lens, osquery, securitySolution, transform, savedObjects, indexPatternFieldEditor, visualizations, dashboard, graph, stackAlerts, uptime, indexPatternEditor, indexPatternManagement, inputControlVis, savedObjectsManagement, visualize, visDefaultEditor, visTypeVega, data | - | | | dataViews, discover, maps, dataVisualizer, lens, indexPatternFieldEditor, securitySolution, indexPatternEditor, indexPatternManagement, inputControlVis, visDefaultEditor, visTypeTimeseries, data | - | -| | dataViews, timelines, monitoring, securitySolution, indexPatternManagement, stackAlerts, transform | - | -| | home, savedObjects, security, fleet, indexPatternFieldEditor, discover, visualizations, dashboard, lens, observability, maps, fileUpload, dataVisualizer, ml, infra, apm, graph, monitoring, osquery, securitySolution, stackAlerts, transform, upgradeAssistant, uptime, indexPatternEditor, indexPatternManagement, inputControlVis, kibanaOverview, savedObjectsManagement, visualize, visTypeTimelion, visTypeTimeseries, visTypeVega | - | -| | dataViews, timelines, monitoring, securitySolution, indexPatternManagement, stackAlerts, transform, data | - | +| | dataViews, timelines, monitoring, securitySolution, indexPatternManagement, presentationUtil, stackAlerts, transform | - | +| | home, savedObjects, security, fleet, indexPatternFieldEditor, discover, dashboard, lens, observability, maps, fileUpload, dataVisualizer, ml, infra, graph, monitoring, osquery, securitySolution, stackAlerts, transform, upgradeAssistant, uptime, indexPatternEditor, indexPatternManagement, inputControlVis, kibanaOverview, savedObjectsManagement, visualize, visTypeTimelion, visTypeTimeseries, visTypeVega | - | +| | dataViews, timelines, monitoring, securitySolution, indexPatternManagement, presentationUtil, stackAlerts, transform, data | - | | | dataViews, discover, maps, dataVisualizer, lens, indexPatternFieldEditor, securitySolution, indexPatternEditor, indexPatternManagement, inputControlVis, visDefaultEditor, visTypeTimeseries, data | - | | | dataViews, visTypeTimeseries, reporting, discover, observability, maps, dataVisualizer, apm, lens, osquery, securitySolution, transform, savedObjects, indexPatternFieldEditor, visualizations, dashboard, graph, stackAlerts, uptime, indexPatternEditor, indexPatternManagement, inputControlVis, savedObjectsManagement, visualize, visDefaultEditor, visTypeVega, data | - | | | dataViews, discover, maps, dataVisualizer, lens, indexPatternFieldEditor, securitySolution, indexPatternEditor, indexPatternManagement, inputControlVis, visDefaultEditor, visTypeTimeseries | - | @@ -29,27 +29,30 @@ warning: This document is auto-generated and is meant to be viewed inside our ex | | dashboard, lens, maps, ml, securitySolution, security, visualize | - | | | securitySolution | - | | | dataViews, visTypeTimeseries, maps, lens, discover, data | - | -| | dataViews, discover, observability, savedObjects, security, visualizations, dashboard, lens, maps, graph, stackAlerts, transform, indexPatternManagement, inputControlVis, savedObjectsManagement, visTypeTimelion, data | - | +| | dataViews, discover, observability, savedObjects, security, dashboard, lens, maps, graph, stackAlerts, transform, indexPatternManagement, inputControlVis, savedObjectsManagement, visTypeTimelion, data | - | | | dataViews, discover, transform, canvas | - | -| | dataViews, observability, indexPatternEditor, apm | - | +| | dataViews, observability, indexPatternEditor | - | | | dataViews | - | | | dataViews, indexPatternManagement | - | | | dataViews, discover, transform, canvas, data | - | | | dataViews, data | - | | | dataViews, data | - | | | dataViews | - | -| | dataViews, observability, indexPatternEditor, apm, data | - | +| | dataViews, observability, indexPatternEditor, data | - | | | dataViews, visualizations, dashboard, data | - | | | dataViews, data | - | | | dataViews, visTypeTimeseries, maps, lens, discover, data | - | -| | dataViews, discover, observability, savedObjects, security, visualizations, dashboard, lens, maps, graph, stackAlerts, transform, indexPatternManagement, inputControlVis, savedObjectsManagement, visTypeTimelion, data | - | +| | dataViews, discover, observability, savedObjects, security, dashboard, lens, maps, graph, stackAlerts, transform, indexPatternManagement, inputControlVis, savedObjectsManagement, visTypeTimelion, data | - | | | dataViews, discover, dashboard, lens, visualize | - | | | dataViews, indexPatternManagement, data | - | +| | dataViews, maps | - | | | dataViews, discover, transform, canvas | - | | | dataViews, visTypeTimeseries, maps, lens, discover | - | +| | dataViews, maps | - | | | fleet, indexPatternFieldEditor, discover, dashboard, lens, ml, stackAlerts, indexPatternManagement, visTypePie, visTypeTable, visTypeTimeseries, visTypeXy, visTypeVislib | - | | | reporting, visTypeTimeseries | - | | | data, lens, visTypeTimeseries, infra, maps, visTypeTimelion | - | +| | maps | - | | | dashboard, maps, graph, visualize | - | | | spaces, security, reporting, actions, alerting, ml, fleet, remoteClusters, graph, indexLifecycleManagement, maps, painlessLab, rollup, searchprofiler, snapshotRestore, transform, upgradeAssistant | - | | | discover, dashboard, lens, visualize | - | @@ -57,9 +60,6 @@ warning: This document is auto-generated and is meant to be viewed inside our ex | | discover | - | | | discover | - | | | embeddable, presentationUtil, discover, dashboard, graph | - | -| | discover, visualizations, dashboard | - | -| | savedObjectsTaggingOss, discover, visualizations, dashboard | - | -| | discover, visualizations, dashboard | - | | | data, discover, embeddable | - | | | advancedSettings, discover | - | | | advancedSettings, discover | - | @@ -68,7 +68,9 @@ warning: This document is auto-generated and is meant to be viewed inside our ex | | security | - | | | security, licenseManagement, ml, fleet, apm, reporting, crossClusterReplication, logstash, painlessLab, searchprofiler, watcher | - | | | management, fleet, security, kibanaOverview | - | -| | visualizations | - | +| | dashboard | - | +| | savedObjectsTaggingOss, dashboard | - | +| | dashboard | - | | | spaces, savedObjectsManagement | - | | | spaces, savedObjectsManagement | - | | | reporting | - | @@ -103,14 +105,14 @@ warning: This document is auto-generated and is meant to be viewed inside our ex | | discover, visualizations, dashboard, lens, observability, timelines, maps, infra, dashboardEnhanced, discoverEnhanced, securitySolution, urlDrilldown, inputControlVis, visualize, visTypeTimelion, visTypeVega, ml, visTypeTimeseries | 8.1 | | | discover, visualizations, dashboard, lens, observability, timelines, maps, infra, dashboardEnhanced, discoverEnhanced, securitySolution, urlDrilldown, inputControlVis, visualize, visTypeTimelion, visTypeVega, ml, visTypeTimeseries | 8.1 | | | discover, visualizations, dashboard, lens, observability, timelines, maps, infra, dashboardEnhanced, discoverEnhanced, securitySolution, urlDrilldown, inputControlVis, visualize, visTypeTimelion, visTypeVega, ml, visTypeTimeseries | 8.1 | -| | dataViews, fleet, infra, monitoring, stackAlerts, indexPatternManagement | 8.1 | -| | dataViews, fleet, infra, monitoring, stackAlerts, indexPatternManagement, data | 8.1 | +| | dataViews, fleet, infra, monitoring, stackAlerts, indexPatternManagement, presentationUtil | 8.1 | +| | dataViews, fleet, infra, monitoring, stackAlerts, indexPatternManagement, presentationUtil, data | 8.1 | | | dataViews | 8.1 | | | dataViews | 8.1 | | | indexPatternManagement, dataViews | 8.1 | | | visTypeTimeseries, graph, indexPatternManagement, dataViews | 8.1 | | | dataViews, indexPatternManagement | 8.1 | -| | dataViews, fleet, infra, monitoring, stackAlerts, indexPatternManagement | 8.1 | +| | dataViews, fleet, infra, monitoring, stackAlerts, indexPatternManagement, presentationUtil | 8.1 | | | dataViews | 8.1 | | | dataViews | 8.1 | | | indexPatternManagement, dataViews | 8.1 | @@ -125,8 +127,6 @@ warning: This document is auto-generated and is meant to be viewed inside our ex | | lens, infra, apm, graph, monitoring, stackAlerts, transform | 8.1 | | | observability | 8.1 | | | observability | 8.1 | -| | visualizations, visDefaultEditor | 8.1 | -| | visualizations, visDefaultEditor | 8.1 | | | indexPatternManagement | 8.1 | | | indexPatternManagement | 8.1 | | | indexPatternManagement | 8.1 | @@ -136,6 +136,8 @@ warning: This document is auto-generated and is meant to be viewed inside our ex | | indexPatternFieldEditor | 8.1 | | | indexPatternFieldEditor | 8.1 | | | indexPatternFieldEditor | 8.1 | +| | visualizations, visDefaultEditor | 8.1 | +| | visualizations, visDefaultEditor | 8.1 | | | visualize | 8.1 | | | timelines | 8.1 | | | timelines | 8.1 | @@ -214,8 +216,6 @@ Safe to remove. | | | | | | -| | -| | | | | | | | diff --git a/api_docs/deprecations_by_plugin.mdx b/api_docs/deprecations_by_plugin.mdx index 7ef3a75269963..d405da72f959c 100644 --- a/api_docs/deprecations_by_plugin.mdx +++ b/api_docs/deprecations_by_plugin.mdx @@ -48,19 +48,16 @@ warning: This document is auto-generated and is meant to be viewed inside our ex | Deprecated API | Reference location(s) | Remove By | | ---------------|-----------|-----------| -| | [SelectedFilters.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/apm/public/components/app/RumDashboard/LocalUIFilters/SelectedFilters.tsx#:~:text=IndexPattern), [SelectedFilters.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/apm/public/components/app/RumDashboard/LocalUIFilters/SelectedFilters.tsx#:~:text=IndexPattern), [use_index_pattern.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/apm/public/components/app/RumDashboard/LocalUIFilters/use_index_pattern.ts#:~:text=IndexPattern), [use_index_pattern.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/apm/public/components/app/RumDashboard/LocalUIFilters/use_index_pattern.ts#:~:text=IndexPattern), [index.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/apm/public/components/shared/kuery_bar/index.tsx#:~:text=IndexPattern), [index.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/apm/public/components/shared/kuery_bar/index.tsx#:~:text=IndexPattern), [index.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/apm/public/components/shared/kuery_bar/index.tsx#:~:text=IndexPattern), [SelectedFilters.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/apm/public/components/app/RumDashboard/LocalUIFilters/SelectedFilters.tsx#:~:text=IndexPattern), [SelectedFilters.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/apm/public/components/app/RumDashboard/LocalUIFilters/SelectedFilters.tsx#:~:text=IndexPattern), [use_index_pattern.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/apm/public/components/app/RumDashboard/LocalUIFilters/use_index_pattern.ts#:~:text=IndexPattern)+ 4 more | - | -| | [use_index_pattern.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/apm/public/components/app/RumDashboard/LocalUIFilters/use_index_pattern.ts#:~:text=IndexPatternSpec), [use_index_pattern.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/apm/public/components/app/RumDashboard/LocalUIFilters/use_index_pattern.ts#:~:text=IndexPatternSpec) | - | -| | [use_index_pattern.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/apm/public/components/app/RumDashboard/LocalUIFilters/use_index_pattern.ts#:~:text=indexPatterns) | - | +| | [SelectedFilters.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/apm/public/components/app/RumDashboard/LocalUIFilters/SelectedFilters.tsx#:~:text=IndexPattern), [SelectedFilters.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/apm/public/components/app/RumDashboard/LocalUIFilters/SelectedFilters.tsx#:~:text=IndexPattern), [selected_wildcards.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/apm/public/components/app/RumDashboard/LocalUIFilters/selected_wildcards.tsx#:~:text=IndexPattern), [selected_wildcards.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/apm/public/components/app/RumDashboard/LocalUIFilters/selected_wildcards.tsx#:~:text=IndexPattern), [SelectedFilters.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/apm/public/components/app/RumDashboard/LocalUIFilters/SelectedFilters.tsx#:~:text=IndexPattern), [SelectedFilters.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/apm/public/components/app/RumDashboard/LocalUIFilters/SelectedFilters.tsx#:~:text=IndexPattern), [selected_wildcards.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/apm/public/components/app/RumDashboard/LocalUIFilters/selected_wildcards.tsx#:~:text=IndexPattern), [selected_wildcards.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/apm/public/components/app/RumDashboard/LocalUIFilters/selected_wildcards.tsx#:~:text=IndexPattern) | - | | | [index.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/apm/public/components/shared/kuery_bar/index.tsx#:~:text=esKuery), [index.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/apm/public/components/shared/kuery_bar/index.tsx#:~:text=esKuery), [index.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/apm/public/components/shared/kuery_bar/index.tsx#:~:text=esKuery) | 8.1 | -| | [use_index_pattern.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/apm/public/components/app/RumDashboard/LocalUIFilters/use_index_pattern.ts#:~:text=IndexPatternSpec), [use_index_pattern.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/apm/public/components/app/RumDashboard/LocalUIFilters/use_index_pattern.ts#:~:text=IndexPatternSpec), [use_index_pattern.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/apm/public/components/app/RumDashboard/LocalUIFilters/use_index_pattern.ts#:~:text=IndexPatternSpec), [use_index_pattern.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/apm/public/components/app/RumDashboard/LocalUIFilters/use_index_pattern.ts#:~:text=IndexPatternSpec) | - | -| | [SelectedFilters.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/apm/public/components/app/RumDashboard/LocalUIFilters/SelectedFilters.tsx#:~:text=IndexPattern), [SelectedFilters.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/apm/public/components/app/RumDashboard/LocalUIFilters/SelectedFilters.tsx#:~:text=IndexPattern), [use_index_pattern.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/apm/public/components/app/RumDashboard/LocalUIFilters/use_index_pattern.ts#:~:text=IndexPattern), [use_index_pattern.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/apm/public/components/app/RumDashboard/LocalUIFilters/use_index_pattern.ts#:~:text=IndexPattern), [index.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/apm/public/components/shared/kuery_bar/index.tsx#:~:text=IndexPattern), [index.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/apm/public/components/shared/kuery_bar/index.tsx#:~:text=IndexPattern), [index.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/apm/public/components/shared/kuery_bar/index.tsx#:~:text=IndexPattern), [SelectedFilters.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/apm/public/components/app/RumDashboard/LocalUIFilters/SelectedFilters.tsx#:~:text=IndexPattern), [SelectedFilters.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/apm/public/components/app/RumDashboard/LocalUIFilters/SelectedFilters.tsx#:~:text=IndexPattern), [use_index_pattern.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/apm/public/components/app/RumDashboard/LocalUIFilters/use_index_pattern.ts#:~:text=IndexPattern)+ 4 more | - | -| | [SelectedFilters.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/apm/public/components/app/RumDashboard/LocalUIFilters/SelectedFilters.tsx#:~:text=IndexPattern), [SelectedFilters.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/apm/public/components/app/RumDashboard/LocalUIFilters/SelectedFilters.tsx#:~:text=IndexPattern), [use_index_pattern.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/apm/public/components/app/RumDashboard/LocalUIFilters/use_index_pattern.ts#:~:text=IndexPattern), [use_index_pattern.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/apm/public/components/app/RumDashboard/LocalUIFilters/use_index_pattern.ts#:~:text=IndexPattern), [index.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/apm/public/components/shared/kuery_bar/index.tsx#:~:text=IndexPattern), [index.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/apm/public/components/shared/kuery_bar/index.tsx#:~:text=IndexPattern), [index.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/apm/public/components/shared/kuery_bar/index.tsx#:~:text=IndexPattern) | - | +| | [SelectedFilters.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/apm/public/components/app/RumDashboard/LocalUIFilters/SelectedFilters.tsx#:~:text=IndexPattern), [SelectedFilters.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/apm/public/components/app/RumDashboard/LocalUIFilters/SelectedFilters.tsx#:~:text=IndexPattern), [selected_wildcards.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/apm/public/components/app/RumDashboard/LocalUIFilters/selected_wildcards.tsx#:~:text=IndexPattern), [selected_wildcards.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/apm/public/components/app/RumDashboard/LocalUIFilters/selected_wildcards.tsx#:~:text=IndexPattern), [SelectedFilters.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/apm/public/components/app/RumDashboard/LocalUIFilters/SelectedFilters.tsx#:~:text=IndexPattern), [SelectedFilters.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/apm/public/components/app/RumDashboard/LocalUIFilters/SelectedFilters.tsx#:~:text=IndexPattern), [selected_wildcards.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/apm/public/components/app/RumDashboard/LocalUIFilters/selected_wildcards.tsx#:~:text=IndexPattern), [selected_wildcards.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/apm/public/components/app/RumDashboard/LocalUIFilters/selected_wildcards.tsx#:~:text=IndexPattern) | - | +| | [SelectedFilters.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/apm/public/components/app/RumDashboard/LocalUIFilters/SelectedFilters.tsx#:~:text=IndexPattern), [SelectedFilters.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/apm/public/components/app/RumDashboard/LocalUIFilters/SelectedFilters.tsx#:~:text=IndexPattern), [selected_wildcards.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/apm/public/components/app/RumDashboard/LocalUIFilters/selected_wildcards.tsx#:~:text=IndexPattern), [selected_wildcards.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/apm/public/components/app/RumDashboard/LocalUIFilters/selected_wildcards.tsx#:~:text=IndexPattern) | - | | | [plugin.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/apm/public/plugin.ts#:~:text=environment) | - | | | [license_check.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/apm/common/license_check.test.ts#:~:text=mode), [license_check.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/apm/common/license_check.test.ts#:~:text=mode), [license_check.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/apm/common/license_check.test.ts#:~:text=mode), [license_check.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/apm/common/license_check.test.ts#:~:text=mode), [license_check.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/apm/common/license_check.test.ts#:~:text=mode), [license_check.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/apm/common/license_check.test.ts#:~:text=mode), [license_check.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/apm/common/license_check.test.ts#:~:text=mode), [license_check.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/apm/common/license_check.test.ts#:~:text=mode), [license_check.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/apm/common/license_check.test.ts#:~:text=mode), [license_check.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/apm/common/license_check.test.ts#:~:text=mode)+ 2 more | - | | | [license_context.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/apm/public/context/license/license_context.tsx#:~:text=license%24) | - | | | [license_check.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/apm/common/license_check.test.ts#:~:text=mode), [license_check.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/apm/common/license_check.test.ts#:~:text=mode), [license_check.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/apm/common/license_check.test.ts#:~:text=mode), [license_check.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/apm/common/license_check.test.ts#:~:text=mode), [license_check.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/apm/common/license_check.test.ts#:~:text=mode), [license_check.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/apm/common/license_check.test.ts#:~:text=mode), [license_check.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/apm/common/license_check.test.ts#:~:text=mode), [license_check.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/apm/common/license_check.test.ts#:~:text=mode), [license_check.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/apm/common/license_check.test.ts#:~:text=mode), [license_check.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/apm/common/license_check.test.ts#:~:text=mode)+ 2 more | - | -| | [index_pattern.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/apm/server/routes/index_pattern.ts#:~:text=spacesService) | 7.16 | -| | [index_pattern.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/apm/server/routes/index_pattern.ts#:~:text=getSpaceId) | 7.16 | +| | [data_view.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/apm/server/routes/data_view.ts#:~:text=spacesService) | 7.16 | +| | [data_view.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/apm/server/routes/data_view.ts#:~:text=getSpaceId) | 7.16 | @@ -228,6 +225,7 @@ warning: This document is auto-generated and is meant to be viewed inside our ex | | [index.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_views/common/index.ts#:~:text=IndexPattern), [data_view_field.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_views/common/fields/data_view_field.test.ts#:~:text=IndexPattern), [data_view_field.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_views/common/fields/data_view_field.test.ts#:~:text=IndexPattern), [index.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_views/public/index.ts#:~:text=IndexPattern), [data_view.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_views/common/data_views/data_view.test.ts#:~:text=IndexPattern), [data_view.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_views/common/data_views/data_view.test.ts#:~:text=IndexPattern), [data_view.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_views/common/data_views/data_view.test.ts#:~:text=IndexPattern), [data_view.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_views/common/data_views/data_view.test.ts#:~:text=IndexPattern) | - | | | [data_views.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_views/common/data_views/data_views.ts#:~:text=IndexPatternListItem), [index.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_views/common/index.ts#:~:text=IndexPatternListItem) | - | | | [data_view.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_views/common/data_views/data_view.ts#:~:text=intervalName), [data_view.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_views/common/data_views/data_view.ts#:~:text=intervalName), [data_view.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_views/common/data_views/data_view.ts#:~:text=intervalName), [update_index_pattern.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_views/server/routes/update_index_pattern.ts#:~:text=intervalName), [update_index_pattern.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_views/server/routes/update_index_pattern.ts#:~:text=intervalName) | 8.1 | +| | [data_view.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_views/common/data_views/data_view.ts#:~:text=flattenHit) | - | | | [data_view.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_views/common/data_views/data_view.test.ts#:~:text=addScriptedField), [data_view.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_views/common/data_views/data_view.test.ts#:~:text=addScriptedField) | 8.1 | | | [data_view.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_views/common/data_views/data_view.test.ts#:~:text=removeScriptedField) | 8.1 | | | [data_view.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_views/common/data_views/data_view.test.ts#:~:text=getNonScriptedFields) | 8.1 | @@ -238,6 +236,7 @@ warning: This document is auto-generated and is meant to be viewed inside our ex | | [index.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_views/common/index.ts#:~:text=IndexPattern), [data_view_field.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_views/common/fields/data_view_field.test.ts#:~:text=IndexPattern), [data_view_field.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_views/common/fields/data_view_field.test.ts#:~:text=IndexPattern), [index.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_views/public/index.ts#:~:text=IndexPattern), [data_view.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_views/common/data_views/data_view.test.ts#:~:text=IndexPattern), [data_view.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_views/common/data_views/data_view.test.ts#:~:text=IndexPattern), [data_view.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_views/common/data_views/data_view.test.ts#:~:text=IndexPattern), [data_view.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_views/common/data_views/data_view.test.ts#:~:text=IndexPattern) | - | | | [index.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_views/common/index.ts#:~:text=IndexPatternsService), [index.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_views/public/index.ts#:~:text=IndexPatternsService), [index.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_views/common/index.ts#:~:text=IndexPatternsService), [index.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_views/public/index.ts#:~:text=IndexPatternsService) | - | | | [data_view.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_views/common/data_views/data_view.ts#:~:text=intervalName), [data_view.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_views/common/data_views/data_view.ts#:~:text=intervalName), [data_view.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_views/common/data_views/data_view.ts#:~:text=intervalName), [update_index_pattern.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_views/server/routes/update_index_pattern.ts#:~:text=intervalName), [update_index_pattern.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_views/server/routes/update_index_pattern.ts#:~:text=intervalName) | 8.1 | +| | [data_view.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_views/common/data_views/data_view.ts#:~:text=flattenHit) | - | | | [data_view.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_views/common/data_views/data_view.test.ts#:~:text=addScriptedField), [data_view.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_views/common/data_views/data_view.test.ts#:~:text=addScriptedField) | 8.1 | | | [data_view.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_views/common/data_views/data_view.test.ts#:~:text=removeScriptedField) | 8.1 | | | [data_view.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_views/common/data_views/data_view.test.ts#:~:text=getNonScriptedFields) | 8.1 | @@ -250,11 +249,11 @@ warning: This document is auto-generated and is meant to be viewed inside our ex | Deprecated API | Reference location(s) | Remove By | | ---------------|-----------|-----------| | | [lens_utils.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/data_visualizer/public/application/common/components/field_data_row/action_menu/lens_utils.ts#:~:text=IndexPattern), [lens_utils.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/data_visualizer/public/application/common/components/field_data_row/action_menu/lens_utils.ts#:~:text=IndexPattern), [lens_utils.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/data_visualizer/public/application/common/components/field_data_row/action_menu/lens_utils.ts#:~:text=IndexPattern), [lens_utils.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/data_visualizer/public/application/common/components/field_data_row/action_menu/lens_utils.ts#:~:text=IndexPattern), [actions.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/data_visualizer/public/application/common/components/field_data_row/action_menu/actions.ts#:~:text=IndexPattern), [actions.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/data_visualizer/public/application/common/components/field_data_row/action_menu/actions.ts#:~:text=IndexPattern), [geo_point_content_with_map.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/data_visualizer/public/application/common/components/expanded_row/geo_point_content_with_map/geo_point_content_with_map.tsx#:~:text=IndexPattern), [geo_point_content_with_map.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/data_visualizer/public/application/common/components/expanded_row/geo_point_content_with_map/geo_point_content_with_map.tsx#:~:text=IndexPattern), [index_based_expanded_row.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/data_visualizer/public/application/common/components/expanded_row/index_based_expanded_row.tsx#:~:text=IndexPattern), [index_based_expanded_row.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/data_visualizer/public/application/common/components/expanded_row/index_based_expanded_row.tsx#:~:text=IndexPattern)+ 60 more | - | -| | [field_data_row.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/data_visualizer/public/application/common/components/stats_table/types/field_data_row.ts#:~:text=IndexPatternField), [field_data_row.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/data_visualizer/public/application/common/components/stats_table/types/field_data_row.ts#:~:text=IndexPatternField), [field_types_utils.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/data_visualizer/public/application/common/util/field_types_utils.ts#:~:text=IndexPatternField), [field_types_utils.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/data_visualizer/public/application/common/util/field_types_utils.ts#:~:text=IndexPatternField), [index_based_expanded_row.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/data_visualizer/public/application/common/components/expanded_row/index_based_expanded_row.tsx#:~:text=IndexPatternField), [index_based_expanded_row.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/data_visualizer/public/application/common/components/expanded_row/index_based_expanded_row.tsx#:~:text=IndexPatternField), [search_panel.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/data_visualizer/public/application/index_data_visualizer/components/search_panel/search_panel.tsx#:~:text=IndexPatternField), [search_panel.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/data_visualizer/public/application/index_data_visualizer/components/search_panel/search_panel.tsx#:~:text=IndexPatternField), [index_data_visualizer_view.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/data_visualizer/public/application/index_data_visualizer/components/index_data_visualizer_view/index_data_visualizer_view.tsx#:~:text=IndexPatternField), [index_data_visualizer_view.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/data_visualizer/public/application/index_data_visualizer/components/index_data_visualizer_view/index_data_visualizer_view.tsx#:~:text=IndexPatternField)+ 16 more | - | +| | [field_data_row.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/data_visualizer/public/application/common/components/stats_table/types/field_data_row.ts#:~:text=IndexPatternField), [field_data_row.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/data_visualizer/public/application/common/components/stats_table/types/field_data_row.ts#:~:text=IndexPatternField), [field_types_utils.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/data_visualizer/public/application/common/util/field_types_utils.ts#:~:text=IndexPatternField), [field_types_utils.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/data_visualizer/public/application/common/util/field_types_utils.ts#:~:text=IndexPatternField), [index_based_expanded_row.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/data_visualizer/public/application/common/components/expanded_row/index_based_expanded_row.tsx#:~:text=IndexPatternField), [index_based_expanded_row.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/data_visualizer/public/application/common/components/expanded_row/index_based_expanded_row.tsx#:~:text=IndexPatternField), [search_panel.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/data_visualizer/public/application/index_data_visualizer/components/search_panel/search_panel.tsx#:~:text=IndexPatternField), [search_panel.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/data_visualizer/public/application/index_data_visualizer/components/search_panel/search_panel.tsx#:~:text=IndexPatternField), [index_data_visualizer_view.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/data_visualizer/public/application/index_data_visualizer/components/index_data_visualizer_view/index_data_visualizer_view.tsx#:~:text=IndexPatternField), [index_data_visualizer_view.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/data_visualizer/public/application/index_data_visualizer/components/index_data_visualizer_view/index_data_visualizer_view.tsx#:~:text=IndexPatternField)+ 20 more | - | | | [file_data_visualizer.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/data_visualizer/public/application/file_data_visualizer/file_data_visualizer.tsx#:~:text=indexPatterns), [index_data_visualizer.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/data_visualizer/public/application/index_data_visualizer/index_data_visualizer.tsx#:~:text=indexPatterns) | - | -| | [field_data_row.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/data_visualizer/public/application/common/components/stats_table/types/field_data_row.ts#:~:text=IndexPatternField), [field_data_row.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/data_visualizer/public/application/common/components/stats_table/types/field_data_row.ts#:~:text=IndexPatternField), [field_types_utils.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/data_visualizer/public/application/common/util/field_types_utils.ts#:~:text=IndexPatternField), [field_types_utils.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/data_visualizer/public/application/common/util/field_types_utils.ts#:~:text=IndexPatternField), [index_based_expanded_row.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/data_visualizer/public/application/common/components/expanded_row/index_based_expanded_row.tsx#:~:text=IndexPatternField), [index_based_expanded_row.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/data_visualizer/public/application/common/components/expanded_row/index_based_expanded_row.tsx#:~:text=IndexPatternField), [search_panel.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/data_visualizer/public/application/index_data_visualizer/components/search_panel/search_panel.tsx#:~:text=IndexPatternField), [search_panel.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/data_visualizer/public/application/index_data_visualizer/components/search_panel/search_panel.tsx#:~:text=IndexPatternField), [index_data_visualizer_view.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/data_visualizer/public/application/index_data_visualizer/components/index_data_visualizer_view/index_data_visualizer_view.tsx#:~:text=IndexPatternField), [index_data_visualizer_view.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/data_visualizer/public/application/index_data_visualizer/components/index_data_visualizer_view/index_data_visualizer_view.tsx#:~:text=IndexPatternField)+ 16 more | - | +| | [field_data_row.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/data_visualizer/public/application/common/components/stats_table/types/field_data_row.ts#:~:text=IndexPatternField), [field_data_row.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/data_visualizer/public/application/common/components/stats_table/types/field_data_row.ts#:~:text=IndexPatternField), [field_types_utils.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/data_visualizer/public/application/common/util/field_types_utils.ts#:~:text=IndexPatternField), [field_types_utils.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/data_visualizer/public/application/common/util/field_types_utils.ts#:~:text=IndexPatternField), [index_based_expanded_row.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/data_visualizer/public/application/common/components/expanded_row/index_based_expanded_row.tsx#:~:text=IndexPatternField), [index_based_expanded_row.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/data_visualizer/public/application/common/components/expanded_row/index_based_expanded_row.tsx#:~:text=IndexPatternField), [search_panel.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/data_visualizer/public/application/index_data_visualizer/components/search_panel/search_panel.tsx#:~:text=IndexPatternField), [search_panel.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/data_visualizer/public/application/index_data_visualizer/components/search_panel/search_panel.tsx#:~:text=IndexPatternField), [index_data_visualizer_view.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/data_visualizer/public/application/index_data_visualizer/components/index_data_visualizer_view/index_data_visualizer_view.tsx#:~:text=IndexPatternField), [index_data_visualizer_view.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/data_visualizer/public/application/index_data_visualizer/components/index_data_visualizer_view/index_data_visualizer_view.tsx#:~:text=IndexPatternField)+ 20 more | - | | | [lens_utils.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/data_visualizer/public/application/common/components/field_data_row/action_menu/lens_utils.ts#:~:text=IndexPattern), [lens_utils.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/data_visualizer/public/application/common/components/field_data_row/action_menu/lens_utils.ts#:~:text=IndexPattern), [lens_utils.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/data_visualizer/public/application/common/components/field_data_row/action_menu/lens_utils.ts#:~:text=IndexPattern), [lens_utils.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/data_visualizer/public/application/common/components/field_data_row/action_menu/lens_utils.ts#:~:text=IndexPattern), [actions.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/data_visualizer/public/application/common/components/field_data_row/action_menu/actions.ts#:~:text=IndexPattern), [actions.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/data_visualizer/public/application/common/components/field_data_row/action_menu/actions.ts#:~:text=IndexPattern), [geo_point_content_with_map.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/data_visualizer/public/application/common/components/expanded_row/geo_point_content_with_map/geo_point_content_with_map.tsx#:~:text=IndexPattern), [geo_point_content_with_map.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/data_visualizer/public/application/common/components/expanded_row/geo_point_content_with_map/geo_point_content_with_map.tsx#:~:text=IndexPattern), [index_based_expanded_row.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/data_visualizer/public/application/common/components/expanded_row/index_based_expanded_row.tsx#:~:text=IndexPattern), [index_based_expanded_row.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/data_visualizer/public/application/common/components/expanded_row/index_based_expanded_row.tsx#:~:text=IndexPattern)+ 60 more | - | -| | [field_data_row.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/data_visualizer/public/application/common/components/stats_table/types/field_data_row.ts#:~:text=IndexPatternField), [field_data_row.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/data_visualizer/public/application/common/components/stats_table/types/field_data_row.ts#:~:text=IndexPatternField), [field_types_utils.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/data_visualizer/public/application/common/util/field_types_utils.ts#:~:text=IndexPatternField), [field_types_utils.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/data_visualizer/public/application/common/util/field_types_utils.ts#:~:text=IndexPatternField), [index_based_expanded_row.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/data_visualizer/public/application/common/components/expanded_row/index_based_expanded_row.tsx#:~:text=IndexPatternField), [index_based_expanded_row.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/data_visualizer/public/application/common/components/expanded_row/index_based_expanded_row.tsx#:~:text=IndexPatternField), [search_panel.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/data_visualizer/public/application/index_data_visualizer/components/search_panel/search_panel.tsx#:~:text=IndexPatternField), [search_panel.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/data_visualizer/public/application/index_data_visualizer/components/search_panel/search_panel.tsx#:~:text=IndexPatternField), [index_data_visualizer_view.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/data_visualizer/public/application/index_data_visualizer/components/index_data_visualizer_view/index_data_visualizer_view.tsx#:~:text=IndexPatternField), [index_data_visualizer_view.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/data_visualizer/public/application/index_data_visualizer/components/index_data_visualizer_view/index_data_visualizer_view.tsx#:~:text=IndexPatternField)+ 3 more | - | +| | [field_data_row.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/data_visualizer/public/application/common/components/stats_table/types/field_data_row.ts#:~:text=IndexPatternField), [field_data_row.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/data_visualizer/public/application/common/components/stats_table/types/field_data_row.ts#:~:text=IndexPatternField), [field_types_utils.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/data_visualizer/public/application/common/util/field_types_utils.ts#:~:text=IndexPatternField), [field_types_utils.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/data_visualizer/public/application/common/util/field_types_utils.ts#:~:text=IndexPatternField), [index_based_expanded_row.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/data_visualizer/public/application/common/components/expanded_row/index_based_expanded_row.tsx#:~:text=IndexPatternField), [index_based_expanded_row.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/data_visualizer/public/application/common/components/expanded_row/index_based_expanded_row.tsx#:~:text=IndexPatternField), [search_panel.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/data_visualizer/public/application/index_data_visualizer/components/search_panel/search_panel.tsx#:~:text=IndexPatternField), [search_panel.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/data_visualizer/public/application/index_data_visualizer/components/search_panel/search_panel.tsx#:~:text=IndexPatternField), [index_data_visualizer_view.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/data_visualizer/public/application/index_data_visualizer/components/index_data_visualizer_view/index_data_visualizer_view.tsx#:~:text=IndexPatternField), [index_data_visualizer_view.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/data_visualizer/public/application/index_data_visualizer/components/index_data_visualizer_view/index_data_visualizer_view.tsx#:~:text=IndexPatternField)+ 5 more | - | | | [lens_utils.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/data_visualizer/public/application/common/components/field_data_row/action_menu/lens_utils.ts#:~:text=IndexPattern), [lens_utils.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/data_visualizer/public/application/common/components/field_data_row/action_menu/lens_utils.ts#:~:text=IndexPattern), [lens_utils.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/data_visualizer/public/application/common/components/field_data_row/action_menu/lens_utils.ts#:~:text=IndexPattern), [lens_utils.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/data_visualizer/public/application/common/components/field_data_row/action_menu/lens_utils.ts#:~:text=IndexPattern), [actions.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/data_visualizer/public/application/common/components/field_data_row/action_menu/actions.ts#:~:text=IndexPattern), [actions.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/data_visualizer/public/application/common/components/field_data_row/action_menu/actions.ts#:~:text=IndexPattern), [geo_point_content_with_map.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/data_visualizer/public/application/common/components/expanded_row/geo_point_content_with_map/geo_point_content_with_map.tsx#:~:text=IndexPattern), [geo_point_content_with_map.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/data_visualizer/public/application/common/components/expanded_row/geo_point_content_with_map/geo_point_content_with_map.tsx#:~:text=IndexPattern), [index_based_expanded_row.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/data_visualizer/public/application/common/components/expanded_row/index_based_expanded_row.tsx#:~:text=IndexPattern), [index_based_expanded_row.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/data_visualizer/public/application/common/components/expanded_row/index_based_expanded_row.tsx#:~:text=IndexPattern)+ 25 more | - | @@ -264,38 +263,35 @@ warning: This document is auto-generated and is meant to be viewed inside our ex | Deprecated API | Reference location(s) | Remove By | | ---------------|-----------|-----------| | | [index_patterns.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/__mocks__/index_patterns.ts#:~:text=IndexPatternsService), [index_patterns.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/__mocks__/index_patterns.ts#:~:text=IndexPatternsService), [popularize_field.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/helpers/popularize_field.test.ts#:~:text=IndexPatternsService), [popularize_field.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/helpers/popularize_field.test.ts#:~:text=IndexPatternsService), [popularize_field.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/helpers/popularize_field.test.ts#:~:text=IndexPatternsService), [popularize_field.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/helpers/popularize_field.test.ts#:~:text=IndexPatternsService), [popularize_field.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/helpers/popularize_field.test.ts#:~:text=IndexPatternsService), [popularize_field.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/helpers/popularize_field.test.ts#:~:text=IndexPatternsService), [index_patterns.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/__mocks__/index_patterns.ts#:~:text=IndexPatternsService), [index_patterns.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/__mocks__/index_patterns.ts#:~:text=IndexPatternsService)+ 6 more | - | -| | [use_data_grid_columns.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/helpers/use_data_grid_columns.ts#:~:text=IndexPatternsContract), [use_data_grid_columns.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/helpers/use_data_grid_columns.ts#:~:text=IndexPatternsContract), [use_index_pattern.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/helpers/use_index_pattern.tsx#:~:text=IndexPatternsContract), [use_index_pattern.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/helpers/use_index_pattern.tsx#:~:text=IndexPatternsContract), [resolve_index_pattern.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/apps/main/utils/resolve_index_pattern.ts#:~:text=IndexPatternsContract), [resolve_index_pattern.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/apps/main/utils/resolve_index_pattern.ts#:~:text=IndexPatternsContract), [use_data_grid_columns.d.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/target/types/public/application/helpers/use_data_grid_columns.d.ts#:~:text=IndexPatternsContract), [use_data_grid_columns.d.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/target/types/public/application/helpers/use_data_grid_columns.d.ts#:~:text=IndexPatternsContract), [resolve_index_pattern.d.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/target/types/public/application/apps/main/utils/resolve_index_pattern.d.ts#:~:text=IndexPatternsContract), [resolve_index_pattern.d.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/target/types/public/application/apps/main/utils/resolve_index_pattern.d.ts#:~:text=IndexPatternsContract)+ 34 more | - | -| | [helpers.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/apps/main/components/doc_table/components/table_header/helpers.tsx#:~:text=IndexPattern), [helpers.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/apps/main/components/doc_table/components/table_header/helpers.tsx#:~:text=IndexPattern), [discover_grid_flyout.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/components/discover_grid/discover_grid_flyout.tsx#:~:text=IndexPattern), [discover_grid_flyout.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/components/discover_grid/discover_grid_flyout.tsx#:~:text=IndexPattern), [discover_grid_context.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/components/discover_grid/discover_grid_context.tsx#:~:text=IndexPattern), [discover_grid_context.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/components/discover_grid/discover_grid_context.tsx#:~:text=IndexPattern), [get_render_cell_value.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/components/discover_grid/get_render_cell_value.tsx#:~:text=IndexPattern), [get_render_cell_value.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/components/discover_grid/get_render_cell_value.tsx#:~:text=IndexPattern), [discover_grid_columns.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/components/discover_grid/discover_grid_columns.tsx#:~:text=IndexPattern), [discover_grid_columns.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/components/discover_grid/discover_grid_columns.tsx#:~:text=IndexPattern)+ 378 more | - | -| | [discover_grid_cell_actions.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/components/discover_grid/discover_grid_cell_actions.tsx#:~:text=IndexPatternField), [discover_grid_cell_actions.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/components/discover_grid/discover_grid_cell_actions.tsx#:~:text=IndexPatternField), [doc_table_wrapper.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/apps/main/components/doc_table/doc_table_wrapper.tsx#:~:text=IndexPatternField), [doc_table_wrapper.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/apps/main/components/doc_table/doc_table_wrapper.tsx#:~:text=IndexPatternField), [saved_search_embeddable.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/embeddable/saved_search_embeddable.tsx#:~:text=IndexPatternField), [saved_search_embeddable.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/embeddable/saved_search_embeddable.tsx#:~:text=IndexPatternField), [context_app.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/apps/context/context_app.tsx#:~:text=IndexPatternField), [context_app.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/apps/context/context_app.tsx#:~:text=IndexPatternField), [discover_field_visualize.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/apps/main/components/sidebar/discover_field_visualize.tsx#:~:text=IndexPatternField), [discover_field_visualize.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/apps/main/components/sidebar/discover_field_visualize.tsx#:~:text=IndexPatternField)+ 192 more | - | +| | [use_data_grid_columns.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/helpers/use_data_grid_columns.ts#:~:text=IndexPatternsContract), [use_data_grid_columns.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/helpers/use_data_grid_columns.ts#:~:text=IndexPatternsContract), [use_index_pattern.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/helpers/use_index_pattern.tsx#:~:text=IndexPatternsContract), [use_index_pattern.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/helpers/use_index_pattern.tsx#:~:text=IndexPatternsContract), [resolve_index_pattern.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/apps/main/utils/resolve_index_pattern.ts#:~:text=IndexPatternsContract), [resolve_index_pattern.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/apps/main/utils/resolve_index_pattern.ts#:~:text=IndexPatternsContract), [use_data_grid_columns.d.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/target/types/public/application/helpers/use_data_grid_columns.d.ts#:~:text=IndexPatternsContract), [use_data_grid_columns.d.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/target/types/public/application/helpers/use_data_grid_columns.d.ts#:~:text=IndexPatternsContract), [resolve_index_pattern.d.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/target/types/public/application/apps/main/utils/resolve_index_pattern.d.ts#:~:text=IndexPatternsContract), [resolve_index_pattern.d.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/target/types/public/application/apps/main/utils/resolve_index_pattern.d.ts#:~:text=IndexPatternsContract)+ 26 more | - | +| | [helpers.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/apps/main/components/doc_table/components/table_header/helpers.tsx#:~:text=IndexPattern), [helpers.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/apps/main/components/doc_table/components/table_header/helpers.tsx#:~:text=IndexPattern), [discover_grid_flyout.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/components/discover_grid/discover_grid_flyout.tsx#:~:text=IndexPattern), [discover_grid_flyout.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/components/discover_grid/discover_grid_flyout.tsx#:~:text=IndexPattern), [discover_grid_context.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/components/discover_grid/discover_grid_context.tsx#:~:text=IndexPattern), [discover_grid_context.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/components/discover_grid/discover_grid_context.tsx#:~:text=IndexPattern), [get_render_cell_value.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/components/discover_grid/get_render_cell_value.tsx#:~:text=IndexPattern), [get_render_cell_value.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/components/discover_grid/get_render_cell_value.tsx#:~:text=IndexPattern), [discover_grid_columns.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/components/discover_grid/discover_grid_columns.tsx#:~:text=IndexPattern), [discover_grid_columns.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/components/discover_grid/discover_grid_columns.tsx#:~:text=IndexPattern)+ 382 more | - | +| | [discover_grid_cell_actions.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/components/discover_grid/discover_grid_cell_actions.tsx#:~:text=IndexPatternField), [discover_grid_cell_actions.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/components/discover_grid/discover_grid_cell_actions.tsx#:~:text=IndexPatternField), [doc_table_wrapper.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/apps/main/components/doc_table/doc_table_wrapper.tsx#:~:text=IndexPatternField), [doc_table_wrapper.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/apps/main/components/doc_table/doc_table_wrapper.tsx#:~:text=IndexPatternField), [data_visualizer_grid.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/components/data_visualizer_grid/data_visualizer_grid.tsx#:~:text=IndexPatternField), [data_visualizer_grid.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/components/data_visualizer_grid/data_visualizer_grid.tsx#:~:text=IndexPatternField), [data_visualizer_grid.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/components/data_visualizer_grid/data_visualizer_grid.tsx#:~:text=IndexPatternField), [saved_search_embeddable.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/embeddable/saved_search_embeddable.tsx#:~:text=IndexPatternField), [saved_search_embeddable.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/embeddable/saved_search_embeddable.tsx#:~:text=IndexPatternField), [context_app.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/apps/context/context_app.tsx#:~:text=IndexPatternField)+ 198 more | - | | | [discover_index_pattern.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/apps/main/components/sidebar/discover_index_pattern.tsx#:~:text=IndexPatternAttributes), [discover_index_pattern.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/apps/main/components/sidebar/discover_index_pattern.tsx#:~:text=IndexPatternAttributes), [discover_index_pattern.d.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/target/types/public/application/apps/main/components/sidebar/discover_index_pattern.d.ts#:~:text=IndexPatternAttributes), [discover_index_pattern.d.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/target/types/public/application/apps/main/components/sidebar/discover_index_pattern.d.ts#:~:text=IndexPatternAttributes), [discover_sidebar_responsive.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/apps/main/components/sidebar/discover_sidebar_responsive.tsx#:~:text=IndexPatternAttributes), [discover_sidebar_responsive.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/apps/main/components/sidebar/discover_sidebar_responsive.tsx#:~:text=IndexPatternAttributes), [types.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/apps/main/components/layout/types.ts#:~:text=IndexPatternAttributes), [types.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/apps/main/components/layout/types.ts#:~:text=IndexPatternAttributes), [discover_main_app.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/apps/main/discover_main_app.tsx#:~:text=IndexPatternAttributes), [discover_main_app.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/apps/main/discover_main_app.tsx#:~:text=IndexPatternAttributes)+ 3 more | - | | | [saved_search_embeddable.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/embeddable/saved_search_embeddable.tsx#:~:text=create), [saved_search_embeddable.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/embeddable/saved_search_embeddable.tsx#:~:text=create) | - | | | [anchor.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/apps/context/services/anchor.ts#:~:text=fetch), [fetch_hits_in_interval.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/apps/context/services/utils/fetch_hits_in_interval.ts#:~:text=fetch) | 8.1 | -| | [build_services.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/build_services.ts#:~:text=indexPatterns), [source_viewer.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/components/source_viewer/source_viewer.tsx#:~:text=indexPatterns), [discover_main_route.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/apps/main/discover_main_route.tsx#:~:text=indexPatterns), [discover_main_route.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/apps/main/discover_main_route.tsx#:~:text=indexPatterns), [discover_main_route.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/apps/main/discover_main_route.tsx#:~:text=indexPatterns), [plugin.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/plugin.tsx#:~:text=indexPatterns) | - | +| | [build_services.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/build_services.ts#:~:text=indexPatterns), [discover_main_route.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/apps/main/discover_main_route.tsx#:~:text=indexPatterns), [discover_main_route.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/apps/main/discover_main_route.tsx#:~:text=indexPatterns), [discover_main_route.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/apps/main/discover_main_route.tsx#:~:text=indexPatterns), [plugin.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/plugin.tsx#:~:text=indexPatterns) | - | | | [histogram.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/apps/main/components/chart/histogram.tsx#:~:text=fieldFormats) | - | | | [url_generator.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/url_generator.ts#:~:text=esFilters), [url_generator.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/url_generator.ts#:~:text=esFilters), [url_generator.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/url_generator.ts#:~:text=esFilters), [locator.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/locator.ts#:~:text=esFilters), [locator.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/locator.ts#:~:text=esFilters), [locator.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/locator.ts#:~:text=esFilters), [get_context_url.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/helpers/get_context_url.tsx#:~:text=esFilters), [get_context_url.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/helpers/get_context_url.tsx#:~:text=esFilters), [discover_state.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/apps/main/services/discover_state.ts#:~:text=esFilters), [discover_state.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/apps/main/services/discover_state.ts#:~:text=esFilters)+ 17 more | 8.1 | | | [url_generator.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/url_generator.ts#:~:text=Filter), [url_generator.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/url_generator.ts#:~:text=Filter), [url_generator.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/url_generator.ts#:~:text=Filter), [locator.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/locator.ts#:~:text=Filter), [locator.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/locator.ts#:~:text=Filter), [locator.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/locator.ts#:~:text=Filter), [types.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/embeddable/types.ts#:~:text=Filter), [types.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/embeddable/types.ts#:~:text=Filter), [discover_state.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/apps/main/services/discover_state.ts#:~:text=Filter), [discover_state.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/apps/main/services/discover_state.ts#:~:text=Filter)+ 22 more | 8.1 | | | [discover_index_pattern.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/apps/main/components/sidebar/discover_index_pattern.tsx#:~:text=IndexPatternAttributes), [discover_index_pattern.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/apps/main/components/sidebar/discover_index_pattern.tsx#:~:text=IndexPatternAttributes), [discover_index_pattern.d.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/target/types/public/application/apps/main/components/sidebar/discover_index_pattern.d.ts#:~:text=IndexPatternAttributes), [discover_index_pattern.d.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/target/types/public/application/apps/main/components/sidebar/discover_index_pattern.d.ts#:~:text=IndexPatternAttributes), [discover_sidebar_responsive.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/apps/main/components/sidebar/discover_sidebar_responsive.tsx#:~:text=IndexPatternAttributes), [discover_sidebar_responsive.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/apps/main/components/sidebar/discover_sidebar_responsive.tsx#:~:text=IndexPatternAttributes), [types.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/apps/main/components/layout/types.ts#:~:text=IndexPatternAttributes), [types.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/apps/main/components/layout/types.ts#:~:text=IndexPatternAttributes), [discover_main_app.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/apps/main/discover_main_app.tsx#:~:text=IndexPatternAttributes), [discover_main_app.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/apps/main/discover_main_app.tsx#:~:text=IndexPatternAttributes)+ 16 more | - | -| | [discover_grid_cell_actions.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/components/discover_grid/discover_grid_cell_actions.tsx#:~:text=IndexPatternField), [discover_grid_cell_actions.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/components/discover_grid/discover_grid_cell_actions.tsx#:~:text=IndexPatternField), [doc_table_wrapper.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/apps/main/components/doc_table/doc_table_wrapper.tsx#:~:text=IndexPatternField), [doc_table_wrapper.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/apps/main/components/doc_table/doc_table_wrapper.tsx#:~:text=IndexPatternField), [saved_search_embeddable.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/embeddable/saved_search_embeddable.tsx#:~:text=IndexPatternField), [saved_search_embeddable.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/embeddable/saved_search_embeddable.tsx#:~:text=IndexPatternField), [context_app.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/apps/context/context_app.tsx#:~:text=IndexPatternField), [context_app.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/apps/context/context_app.tsx#:~:text=IndexPatternField), [discover_field_visualize.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/apps/main/components/sidebar/discover_field_visualize.tsx#:~:text=IndexPatternField), [discover_field_visualize.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/apps/main/components/sidebar/discover_field_visualize.tsx#:~:text=IndexPatternField)+ 192 more | - | +| | [discover_grid_cell_actions.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/components/discover_grid/discover_grid_cell_actions.tsx#:~:text=IndexPatternField), [discover_grid_cell_actions.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/components/discover_grid/discover_grid_cell_actions.tsx#:~:text=IndexPatternField), [doc_table_wrapper.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/apps/main/components/doc_table/doc_table_wrapper.tsx#:~:text=IndexPatternField), [doc_table_wrapper.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/apps/main/components/doc_table/doc_table_wrapper.tsx#:~:text=IndexPatternField), [data_visualizer_grid.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/components/data_visualizer_grid/data_visualizer_grid.tsx#:~:text=IndexPatternField), [data_visualizer_grid.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/components/data_visualizer_grid/data_visualizer_grid.tsx#:~:text=IndexPatternField), [data_visualizer_grid.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/components/data_visualizer_grid/data_visualizer_grid.tsx#:~:text=IndexPatternField), [saved_search_embeddable.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/embeddable/saved_search_embeddable.tsx#:~:text=IndexPatternField), [saved_search_embeddable.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/embeddable/saved_search_embeddable.tsx#:~:text=IndexPatternField), [context_app.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/apps/context/context_app.tsx#:~:text=IndexPatternField)+ 198 more | - | | | [index_patterns.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/__mocks__/index_patterns.ts#:~:text=IndexPatternsService), [index_patterns.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/__mocks__/index_patterns.ts#:~:text=IndexPatternsService), [popularize_field.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/helpers/popularize_field.test.ts#:~:text=IndexPatternsService), [popularize_field.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/helpers/popularize_field.test.ts#:~:text=IndexPatternsService), [popularize_field.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/helpers/popularize_field.test.ts#:~:text=IndexPatternsService), [popularize_field.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/helpers/popularize_field.test.ts#:~:text=IndexPatternsService), [popularize_field.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/helpers/popularize_field.test.ts#:~:text=IndexPatternsService), [popularize_field.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/helpers/popularize_field.test.ts#:~:text=IndexPatternsService), [index_patterns.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/__mocks__/index_patterns.ts#:~:text=IndexPatternsService), [index_patterns.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/__mocks__/index_patterns.ts#:~:text=IndexPatternsService)+ 6 more | - | -| | [use_data_grid_columns.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/helpers/use_data_grid_columns.ts#:~:text=IndexPatternsContract), [use_data_grid_columns.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/helpers/use_data_grid_columns.ts#:~:text=IndexPatternsContract), [use_index_pattern.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/helpers/use_index_pattern.tsx#:~:text=IndexPatternsContract), [use_index_pattern.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/helpers/use_index_pattern.tsx#:~:text=IndexPatternsContract), [resolve_index_pattern.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/apps/main/utils/resolve_index_pattern.ts#:~:text=IndexPatternsContract), [resolve_index_pattern.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/apps/main/utils/resolve_index_pattern.ts#:~:text=IndexPatternsContract), [use_data_grid_columns.d.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/target/types/public/application/helpers/use_data_grid_columns.d.ts#:~:text=IndexPatternsContract), [use_data_grid_columns.d.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/target/types/public/application/helpers/use_data_grid_columns.d.ts#:~:text=IndexPatternsContract), [resolve_index_pattern.d.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/target/types/public/application/apps/main/utils/resolve_index_pattern.d.ts#:~:text=IndexPatternsContract), [resolve_index_pattern.d.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/target/types/public/application/apps/main/utils/resolve_index_pattern.d.ts#:~:text=IndexPatternsContract)+ 34 more | - | +| | [use_data_grid_columns.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/helpers/use_data_grid_columns.ts#:~:text=IndexPatternsContract), [use_data_grid_columns.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/helpers/use_data_grid_columns.ts#:~:text=IndexPatternsContract), [use_index_pattern.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/helpers/use_index_pattern.tsx#:~:text=IndexPatternsContract), [use_index_pattern.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/helpers/use_index_pattern.tsx#:~:text=IndexPatternsContract), [resolve_index_pattern.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/apps/main/utils/resolve_index_pattern.ts#:~:text=IndexPatternsContract), [resolve_index_pattern.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/apps/main/utils/resolve_index_pattern.ts#:~:text=IndexPatternsContract), [use_data_grid_columns.d.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/target/types/public/application/helpers/use_data_grid_columns.d.ts#:~:text=IndexPatternsContract), [use_data_grid_columns.d.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/target/types/public/application/helpers/use_data_grid_columns.d.ts#:~:text=IndexPatternsContract), [resolve_index_pattern.d.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/target/types/public/application/apps/main/utils/resolve_index_pattern.d.ts#:~:text=IndexPatternsContract), [resolve_index_pattern.d.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/target/types/public/application/apps/main/utils/resolve_index_pattern.d.ts#:~:text=IndexPatternsContract)+ 26 more | - | | | [discover_main_route.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/apps/main/discover_main_route.tsx#:~:text=ensureDefaultDataView), [discover_main_route.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/apps/main/discover_main_route.tsx#:~:text=ensureDefaultDataView) | - | -| | [helpers.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/apps/main/components/doc_table/components/table_header/helpers.tsx#:~:text=IndexPattern), [helpers.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/apps/main/components/doc_table/components/table_header/helpers.tsx#:~:text=IndexPattern), [discover_grid_flyout.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/components/discover_grid/discover_grid_flyout.tsx#:~:text=IndexPattern), [discover_grid_flyout.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/components/discover_grid/discover_grid_flyout.tsx#:~:text=IndexPattern), [discover_grid_context.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/components/discover_grid/discover_grid_context.tsx#:~:text=IndexPattern), [discover_grid_context.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/components/discover_grid/discover_grid_context.tsx#:~:text=IndexPattern), [get_render_cell_value.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/components/discover_grid/get_render_cell_value.tsx#:~:text=IndexPattern), [get_render_cell_value.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/components/discover_grid/get_render_cell_value.tsx#:~:text=IndexPattern), [discover_grid_columns.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/components/discover_grid/discover_grid_columns.tsx#:~:text=IndexPattern), [discover_grid_columns.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/components/discover_grid/discover_grid_columns.tsx#:~:text=IndexPattern)+ 378 more | - | +| | [helpers.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/apps/main/components/doc_table/components/table_header/helpers.tsx#:~:text=IndexPattern), [helpers.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/apps/main/components/doc_table/components/table_header/helpers.tsx#:~:text=IndexPattern), [discover_grid_flyout.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/components/discover_grid/discover_grid_flyout.tsx#:~:text=IndexPattern), [discover_grid_flyout.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/components/discover_grid/discover_grid_flyout.tsx#:~:text=IndexPattern), [discover_grid_context.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/components/discover_grid/discover_grid_context.tsx#:~:text=IndexPattern), [discover_grid_context.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/components/discover_grid/discover_grid_context.tsx#:~:text=IndexPattern), [get_render_cell_value.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/components/discover_grid/get_render_cell_value.tsx#:~:text=IndexPattern), [get_render_cell_value.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/components/discover_grid/get_render_cell_value.tsx#:~:text=IndexPattern), [discover_grid_columns.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/components/discover_grid/discover_grid_columns.tsx#:~:text=IndexPattern), [discover_grid_columns.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/components/discover_grid/discover_grid_columns.tsx#:~:text=IndexPattern)+ 382 more | - | | | [url_generator.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/url_generator.ts#:~:text=Filter), [url_generator.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/url_generator.ts#:~:text=Filter), [url_generator.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/url_generator.ts#:~:text=Filter), [locator.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/locator.ts#:~:text=Filter), [locator.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/locator.ts#:~:text=Filter), [locator.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/locator.ts#:~:text=Filter), [types.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/embeddable/types.ts#:~:text=Filter), [types.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/embeddable/types.ts#:~:text=Filter), [discover_state.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/apps/main/services/discover_state.ts#:~:text=Filter), [discover_state.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/apps/main/services/discover_state.ts#:~:text=Filter)+ 22 more | 8.1 | | | [saved_search_embeddable.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/embeddable/saved_search_embeddable.tsx#:~:text=create), [saved_search_embeddable.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/embeddable/saved_search_embeddable.tsx#:~:text=create) | - | | | [anchor.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/apps/context/services/anchor.ts#:~:text=fetch), [fetch_hits_in_interval.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/apps/context/services/utils/fetch_hits_in_interval.ts#:~:text=fetch) | 8.1 | -| | [discover_grid_cell_actions.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/components/discover_grid/discover_grid_cell_actions.tsx#:~:text=IndexPatternField), [discover_grid_cell_actions.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/components/discover_grid/discover_grid_cell_actions.tsx#:~:text=IndexPatternField), [doc_table_wrapper.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/apps/main/components/doc_table/doc_table_wrapper.tsx#:~:text=IndexPatternField), [doc_table_wrapper.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/apps/main/components/doc_table/doc_table_wrapper.tsx#:~:text=IndexPatternField), [saved_search_embeddable.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/embeddable/saved_search_embeddable.tsx#:~:text=IndexPatternField), [saved_search_embeddable.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/embeddable/saved_search_embeddable.tsx#:~:text=IndexPatternField), [context_app.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/apps/context/context_app.tsx#:~:text=IndexPatternField), [context_app.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/apps/context/context_app.tsx#:~:text=IndexPatternField), [discover_field_visualize.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/apps/main/components/sidebar/discover_field_visualize.tsx#:~:text=IndexPatternField), [discover_field_visualize.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/apps/main/components/sidebar/discover_field_visualize.tsx#:~:text=IndexPatternField)+ 91 more | - | +| | [discover_grid_cell_actions.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/components/discover_grid/discover_grid_cell_actions.tsx#:~:text=IndexPatternField), [discover_grid_cell_actions.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/components/discover_grid/discover_grid_cell_actions.tsx#:~:text=IndexPatternField), [doc_table_wrapper.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/apps/main/components/doc_table/doc_table_wrapper.tsx#:~:text=IndexPatternField), [doc_table_wrapper.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/apps/main/components/doc_table/doc_table_wrapper.tsx#:~:text=IndexPatternField), [data_visualizer_grid.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/components/data_visualizer_grid/data_visualizer_grid.tsx#:~:text=IndexPatternField), [data_visualizer_grid.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/components/data_visualizer_grid/data_visualizer_grid.tsx#:~:text=IndexPatternField), [data_visualizer_grid.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/components/data_visualizer_grid/data_visualizer_grid.tsx#:~:text=IndexPatternField), [saved_search_embeddable.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/embeddable/saved_search_embeddable.tsx#:~:text=IndexPatternField), [saved_search_embeddable.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/embeddable/saved_search_embeddable.tsx#:~:text=IndexPatternField), [context_app.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/apps/context/context_app.tsx#:~:text=IndexPatternField)+ 94 more | - | | | [discover_index_pattern.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/apps/main/components/sidebar/discover_index_pattern.tsx#:~:text=IndexPatternAttributes), [discover_index_pattern.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/apps/main/components/sidebar/discover_index_pattern.tsx#:~:text=IndexPatternAttributes), [discover_index_pattern.d.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/target/types/public/application/apps/main/components/sidebar/discover_index_pattern.d.ts#:~:text=IndexPatternAttributes), [discover_index_pattern.d.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/target/types/public/application/apps/main/components/sidebar/discover_index_pattern.d.ts#:~:text=IndexPatternAttributes), [discover_sidebar_responsive.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/apps/main/components/sidebar/discover_sidebar_responsive.tsx#:~:text=IndexPatternAttributes), [discover_sidebar_responsive.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/apps/main/components/sidebar/discover_sidebar_responsive.tsx#:~:text=IndexPatternAttributes), [types.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/apps/main/components/layout/types.ts#:~:text=IndexPatternAttributes), [types.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/apps/main/components/layout/types.ts#:~:text=IndexPatternAttributes), [discover_main_app.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/apps/main/discover_main_app.tsx#:~:text=IndexPatternAttributes), [discover_main_app.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/apps/main/discover_main_app.tsx#:~:text=IndexPatternAttributes)+ 3 more | - | -| | [helpers.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/apps/main/components/doc_table/components/table_header/helpers.tsx#:~:text=IndexPattern), [helpers.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/apps/main/components/doc_table/components/table_header/helpers.tsx#:~:text=IndexPattern), [discover_grid_flyout.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/components/discover_grid/discover_grid_flyout.tsx#:~:text=IndexPattern), [discover_grid_flyout.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/components/discover_grid/discover_grid_flyout.tsx#:~:text=IndexPattern), [discover_grid_context.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/components/discover_grid/discover_grid_context.tsx#:~:text=IndexPattern), [discover_grid_context.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/components/discover_grid/discover_grid_context.tsx#:~:text=IndexPattern), [get_render_cell_value.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/components/discover_grid/get_render_cell_value.tsx#:~:text=IndexPattern), [get_render_cell_value.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/components/discover_grid/get_render_cell_value.tsx#:~:text=IndexPattern), [discover_grid_columns.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/components/discover_grid/discover_grid_columns.tsx#:~:text=IndexPattern), [discover_grid_columns.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/components/discover_grid/discover_grid_columns.tsx#:~:text=IndexPattern)+ 184 more | - | +| | [helpers.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/apps/main/components/doc_table/components/table_header/helpers.tsx#:~:text=IndexPattern), [helpers.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/apps/main/components/doc_table/components/table_header/helpers.tsx#:~:text=IndexPattern), [discover_grid_flyout.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/components/discover_grid/discover_grid_flyout.tsx#:~:text=IndexPattern), [discover_grid_flyout.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/components/discover_grid/discover_grid_flyout.tsx#:~:text=IndexPattern), [discover_grid_context.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/components/discover_grid/discover_grid_context.tsx#:~:text=IndexPattern), [discover_grid_context.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/components/discover_grid/discover_grid_context.tsx#:~:text=IndexPattern), [get_render_cell_value.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/components/discover_grid/get_render_cell_value.tsx#:~:text=IndexPattern), [get_render_cell_value.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/components/discover_grid/get_render_cell_value.tsx#:~:text=IndexPattern), [discover_grid_columns.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/components/discover_grid/discover_grid_columns.tsx#:~:text=IndexPattern), [discover_grid_columns.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/components/discover_grid/discover_grid_columns.tsx#:~:text=IndexPattern)+ 186 more | - | | | [index_patterns.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/__mocks__/index_patterns.ts#:~:text=IndexPatternsService), [index_patterns.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/__mocks__/index_patterns.ts#:~:text=IndexPatternsService), [popularize_field.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/helpers/popularize_field.test.ts#:~:text=IndexPatternsService), [popularize_field.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/helpers/popularize_field.test.ts#:~:text=IndexPatternsService), [popularize_field.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/helpers/popularize_field.test.ts#:~:text=IndexPatternsService), [popularize_field.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/helpers/popularize_field.test.ts#:~:text=IndexPatternsService), [popularize_field.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/helpers/popularize_field.test.ts#:~:text=IndexPatternsService), [popularize_field.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/helpers/popularize_field.test.ts#:~:text=IndexPatternsService), [index_patterns.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/__mocks__/index_patterns.ts#:~:text=IndexPatternsService), [index_patterns.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/__mocks__/index_patterns.ts#:~:text=IndexPatternsService)+ 6 more | - | | | [url_generator.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/url_generator.ts#:~:text=Filter), [url_generator.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/url_generator.ts#:~:text=Filter), [url_generator.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/url_generator.ts#:~:text=Filter), [locator.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/locator.ts#:~:text=Filter), [locator.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/locator.ts#:~:text=Filter), [locator.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/locator.ts#:~:text=Filter), [types.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/embeddable/types.ts#:~:text=Filter), [types.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/embeddable/types.ts#:~:text=Filter), [discover_state.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/apps/main/services/discover_state.ts#:~:text=Filter), [discover_state.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/apps/main/services/discover_state.ts#:~:text=Filter)+ 22 more | 8.1 | | | [discover_main_route.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/apps/main/discover_main_route.tsx#:~:text=ensureDefaultDataView) | - | | | [on_save_search.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/apps/main/components/top_nav/on_save_search.tsx#:~:text=SavedObjectSaveModal), [on_save_search.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/apps/main/components/top_nav/on_save_search.tsx#:~:text=SavedObjectSaveModal) | - | -| | [saved_searches.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/saved_searches/legacy/saved_searches.ts#:~:text=SavedObjectLoader), [saved_searches.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/saved_searches/legacy/saved_searches.ts#:~:text=SavedObjectLoader), [plugin.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/plugin.tsx#:~:text=SavedObjectLoader), [plugin.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/plugin.tsx#:~:text=SavedObjectLoader) | - | -| | [_saved_search.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/saved_searches/legacy/_saved_search.ts#:~:text=SavedObject), [_saved_search.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/saved_searches/legacy/_saved_search.ts#:~:text=SavedObject) | - | -| | [_saved_search.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/saved_searches/legacy/_saved_search.ts#:~:text=SavedObjectClass) | - | | | [saved_search_embeddable.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/embeddable/saved_search_embeddable.tsx#:~:text=executeTriggerActions), [search_embeddable_factory.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/embeddable/search_embeddable_factory.ts#:~:text=executeTriggerActions), [plugin.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/plugin.tsx#:~:text=executeTriggerActions), [search_embeddable_factory.d.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/target/types/public/application/embeddable/search_embeddable_factory.d.ts#:~:text=executeTriggerActions) | - | -| | [ui_settings.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/server/ui_settings.ts#:~:text=metric), [ui_settings.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/server/ui_settings.ts#:~:text=metric) | - | -| | [ui_settings.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/server/ui_settings.ts#:~:text=metric), [ui_settings.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/server/ui_settings.ts#:~:text=metric) | - | +| | [ui_settings.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/server/ui_settings.ts#:~:text=metric), [ui_settings.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/server/ui_settings.ts#:~:text=metric), [ui_settings.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/server/ui_settings.ts#:~:text=metric) | - | +| | [ui_settings.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/server/ui_settings.ts#:~:text=metric), [ui_settings.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/server/ui_settings.ts#:~:text=metric), [ui_settings.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/server/ui_settings.ts#:~:text=metric) | - | @@ -443,7 +439,7 @@ warning: This document is auto-generated and is meant to be viewed inside our ex | | [utils.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/utils.ts#:~:text=IFieldType), [utils.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/utils.ts#:~:text=IFieldType), [utils.d.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/target/types/public/components/utils.d.ts#:~:text=IFieldType), [utils.d.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/target/types/public/components/utils.d.ts#:~:text=IFieldType) | 8.1 | | | [utils.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/utils.ts#:~:text=IndexPatternListItem), [utils.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/utils.ts#:~:text=IndexPatternListItem), [utils.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/utils.ts#:~:text=IndexPatternListItem), [utils.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/utils.ts#:~:text=IndexPatternListItem), [utils.d.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/target/types/public/components/utils.d.ts#:~:text=IndexPatternListItem), [utils.d.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/target/types/public/components/utils.d.ts#:~:text=IndexPatternListItem), [utils.d.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/target/types/public/components/utils.d.ts#:~:text=IndexPatternListItem), [utils.d.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/target/types/public/components/utils.d.ts#:~:text=IndexPatternListItem) | - | | | [index.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/field_editor/constants/index.ts#:~:text=getKbnTypeNames), [index.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/field_editor/constants/index.ts#:~:text=getKbnTypeNames) | 8.1 | -| | [edit_index_pattern.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/edit_index_pattern/edit_index_pattern.tsx#:~:text=indexPatterns), [edit_index_pattern.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/edit_index_pattern/edit_index_pattern.tsx#:~:text=indexPatterns), [edit_index_pattern_container.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/edit_index_pattern/edit_index_pattern_container.tsx#:~:text=indexPatterns), [edit_index_pattern_container.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/edit_index_pattern/edit_index_pattern_container.tsx#:~:text=indexPatterns), [create_edit_field.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/edit_index_pattern/create_edit_field/create_edit_field.tsx#:~:text=indexPatterns), [create_edit_field_container.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/edit_index_pattern/create_edit_field/create_edit_field_container.tsx#:~:text=indexPatterns), [create_edit_field_container.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/edit_index_pattern/create_edit_field/create_edit_field_container.tsx#:~:text=indexPatterns) | - | +| | [scripted_fields_table.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/edit_index_pattern/scripted_fields_table/scripted_fields_table.tsx#:~:text=indexPatterns), [tabs.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/edit_index_pattern/tabs/tabs.tsx#:~:text=indexPatterns), [edit_index_pattern.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/edit_index_pattern/edit_index_pattern.tsx#:~:text=indexPatterns), [edit_index_pattern.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/edit_index_pattern/edit_index_pattern.tsx#:~:text=indexPatterns), [edit_index_pattern_container.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/edit_index_pattern/edit_index_pattern_container.tsx#:~:text=indexPatterns), [edit_index_pattern_container.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/edit_index_pattern/edit_index_pattern_container.tsx#:~:text=indexPatterns), [create_edit_field.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/edit_index_pattern/create_edit_field/create_edit_field.tsx#:~:text=indexPatterns), [create_edit_field_container.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/edit_index_pattern/create_edit_field/create_edit_field_container.tsx#:~:text=indexPatterns), [create_edit_field_container.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/edit_index_pattern/create_edit_field/create_edit_field_container.tsx#:~:text=indexPatterns) | - | | | [field_editor.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/field_editor/field_editor.tsx#:~:text=fieldFormats), [field_editor.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/field_editor/field_editor.tsx#:~:text=fieldFormats), [field_editor.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/field_editor/field_editor.tsx#:~:text=fieldFormats), [field_editor.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/field_editor/field_editor.tsx#:~:text=fieldFormats), [field_editor.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/field_editor/field_editor.tsx#:~:text=fieldFormats), [field_editor.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/field_editor/field_editor.tsx#:~:text=fieldFormats) | - | | | [test_script.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/field_editor/components/scripting_help/test_script.tsx#:~:text=esQuery), [test_script.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/field_editor/components/scripting_help/test_script.tsx#:~:text=esQuery), [test_script.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/field_editor/components/scripting_help/test_script.tsx#:~:text=esQuery) | 8.1 | | | [utils.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/utils.ts#:~:text=IFieldType), [utils.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/utils.ts#:~:text=IFieldType), [utils.d.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/target/types/public/components/utils.d.ts#:~:text=IFieldType), [utils.d.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/target/types/public/components/utils.d.ts#:~:text=IFieldType), [utils.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/utils.ts#:~:text=IFieldType), [utils.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/utils.ts#:~:text=IFieldType), [utils.d.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/target/types/public/components/utils.d.ts#:~:text=IFieldType), [utils.d.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/target/types/public/components/utils.d.ts#:~:text=IFieldType) | 8.1 | @@ -541,18 +537,18 @@ warning: This document is auto-generated and is meant to be viewed inside our ex | Deprecated API | Reference location(s) | Remove By | | ---------------|-----------|-----------| | | [existing_fields.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/server/routes/existing_fields.ts#:~:text=IndexPatternsService), [existing_fields.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/server/routes/existing_fields.ts#:~:text=IndexPatternsService), [existing_fields.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/server/routes/existing_fields.ts#:~:text=IndexPatternsService), [existing_fields.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/server/routes/existing_fields.ts#:~:text=IndexPatternsService) | - | -| | [embeddable.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/public/embeddable/embeddable.tsx#:~:text=IndexPatternsContract), [embeddable.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/public/embeddable/embeddable.tsx#:~:text=IndexPatternsContract), [utils.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/public/utils.ts#:~:text=IndexPatternsContract), [utils.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/public/utils.ts#:~:text=IndexPatternsContract), [loader.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/public/indexpattern_datasource/loader.ts#:~:text=IndexPatternsContract), [loader.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/public/indexpattern_datasource/loader.ts#:~:text=IndexPatternsContract), [embeddable_factory.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/public/embeddable/embeddable_factory.ts#:~:text=IndexPatternsContract), [embeddable_factory.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/public/embeddable/embeddable_factory.ts#:~:text=IndexPatternsContract), [loader.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/public/indexpattern_datasource/loader.test.ts#:~:text=IndexPatternsContract), [loader.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/public/indexpattern_datasource/loader.test.ts#:~:text=IndexPatternsContract)+ 20 more | - | +| | [embeddable.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/public/embeddable/embeddable.tsx#:~:text=IndexPatternsContract), [embeddable.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/public/embeddable/embeddable.tsx#:~:text=IndexPatternsContract), [utils.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/public/utils.ts#:~:text=IndexPatternsContract), [utils.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/public/utils.ts#:~:text=IndexPatternsContract), [loader.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/public/indexpattern_datasource/loader.ts#:~:text=IndexPatternsContract), [loader.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/public/indexpattern_datasource/loader.ts#:~:text=IndexPatternsContract), [embeddable_factory.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/public/embeddable/embeddable_factory.ts#:~:text=IndexPatternsContract), [embeddable_factory.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/public/embeddable/embeddable_factory.ts#:~:text=IndexPatternsContract), [loader.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/public/indexpattern_datasource/loader.test.ts#:~:text=IndexPatternsContract), [loader.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/public/indexpattern_datasource/loader.test.ts#:~:text=IndexPatternsContract)+ 22 more | - | | | [existing_fields.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/server/routes/existing_fields.ts#:~:text=IndexPattern), [existing_fields.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/server/routes/existing_fields.ts#:~:text=IndexPattern), [existing_fields.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/server/routes/existing_fields.test.ts#:~:text=IndexPattern), [existing_fields.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/server/routes/existing_fields.test.ts#:~:text=IndexPattern), [existing_fields.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/server/routes/existing_fields.test.ts#:~:text=IndexPattern), [existing_fields.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/server/routes/existing_fields.test.ts#:~:text=IndexPattern), [existing_fields.d.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/target/types/server/routes/existing_fields.d.ts#:~:text=IndexPattern), [existing_fields.d.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/target/types/server/routes/existing_fields.d.ts#:~:text=IndexPattern), [loader.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/public/indexpattern_datasource/loader.ts#:~:text=IndexPattern), [embeddable.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/public/embeddable/embeddable.tsx#:~:text=IndexPattern)+ 36 more | - | | | [field_stats.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/server/routes/field_stats.ts#:~:text=IndexPatternField), [field_stats.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/server/routes/field_stats.ts#:~:text=IndexPatternField), [field_stats.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/server/routes/field_stats.ts#:~:text=IndexPatternField), [field_stats.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/server/routes/field_stats.ts#:~:text=IndexPatternField), [field_stats.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/server/routes/field_stats.ts#:~:text=IndexPatternField), [field_stats.d.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/target/types/server/routes/field_stats.d.ts#:~:text=IndexPatternField), [field_stats.d.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/target/types/server/routes/field_stats.d.ts#:~:text=IndexPatternField), [field_stats.d.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/target/types/server/routes/field_stats.d.ts#:~:text=IndexPatternField), [field_stats.d.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/target/types/server/routes/field_stats.d.ts#:~:text=IndexPatternField), [field_stats.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/server/routes/field_stats.ts#:~:text=IndexPatternField)+ 8 more | - | | | [datapanel.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/public/indexpattern_datasource/datapanel.tsx#:~:text=indexPatterns), [datapanel.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/public/indexpattern_datasource/datapanel.tsx#:~:text=indexPatterns), [datapanel.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/public/indexpattern_datasource/datapanel.tsx#:~:text=indexPatterns), [datapanel.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/public/indexpattern_datasource/datapanel.tsx#:~:text=indexPatterns), [indexpattern.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/public/indexpattern_datasource/indexpattern.tsx#:~:text=indexPatterns), [lens_top_nav.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/public/app_plugin/lens_top_nav.tsx#:~:text=indexPatterns), [lens_top_nav.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/public/app_plugin/lens_top_nav.tsx#:~:text=indexPatterns), [plugin.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/public/plugin.ts#:~:text=indexPatterns), [plugin.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/public/plugin.ts#:~:text=indexPatterns) | - | | | [ranges.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/ranges/ranges.tsx#:~:text=fieldFormats), [droppable.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/public/indexpattern_datasource/dimension_panel/droppable/droppable.test.ts#:~:text=fieldFormats) | - | -| | [save_modal_container.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/public/app_plugin/save_modal_container.tsx#:~:text=esFilters), [save_modal_container.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/public/app_plugin/save_modal_container.tsx#:~:text=esFilters), [mocks.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/public/mocks.tsx#:~:text=esFilters), [mocks.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/public/mocks.tsx#:~:text=esFilters) | 8.1 | +| | [save_modal_container.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/public/app_plugin/save_modal_container.tsx#:~:text=esFilters), [save_modal_container.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/public/app_plugin/save_modal_container.tsx#:~:text=esFilters), [data_plugin_mock.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/public/mocks/data_plugin_mock.ts#:~:text=esFilters), [data_plugin_mock.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/public/mocks/data_plugin_mock.ts#:~:text=esFilters) | 8.1 | | | [validation.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/formula/validation.ts#:~:text=esKuery), [validation.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/formula/validation.ts#:~:text=esKuery), [validation.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/formula/validation.ts#:~:text=esKuery) | 8.1 | | | [validation.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/formula/validation.ts#:~:text=esQuery), [validation.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/formula/validation.ts#:~:text=esQuery), [index.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/terms/index.tsx#:~:text=esQuery), [index.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/terms/index.tsx#:~:text=esQuery), [index.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/terms/index.tsx#:~:text=esQuery), [field_item.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/public/indexpattern_datasource/field_item.tsx#:~:text=esQuery), [field_item.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/public/indexpattern_datasource/field_item.tsx#:~:text=esQuery), [field_item.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/public/indexpattern_datasource/field_item.tsx#:~:text=esQuery), [datapanel.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/public/indexpattern_datasource/datapanel.tsx#:~:text=esQuery), [datapanel.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/public/indexpattern_datasource/datapanel.tsx#:~:text=esQuery)+ 1 more | 8.1 | | | [types.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/public/types.ts#:~:text=Filter), [types.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/public/types.ts#:~:text=Filter), [types.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/public/types.ts#:~:text=Filter), [embeddable.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/public/embeddable/embeddable.tsx#:~:text=Filter), [embeddable.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/public/embeddable/embeddable.tsx#:~:text=Filter), [embeddable.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/public/embeddable/embeddable.tsx#:~:text=Filter), [types.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/public/state_management/types.ts#:~:text=Filter), [types.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/public/state_management/types.ts#:~:text=Filter), [field_item.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/public/indexpattern_datasource/field_item.tsx#:~:text=Filter), [field_item.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/public/indexpattern_datasource/field_item.tsx#:~:text=Filter)+ 16 more | 8.1 | | | [field_stats.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/server/routes/field_stats.ts#:~:text=IndexPatternField), [field_stats.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/server/routes/field_stats.ts#:~:text=IndexPatternField), [field_stats.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/server/routes/field_stats.ts#:~:text=IndexPatternField), [field_stats.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/server/routes/field_stats.ts#:~:text=IndexPatternField), [field_stats.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/server/routes/field_stats.ts#:~:text=IndexPatternField), [field_stats.d.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/target/types/server/routes/field_stats.d.ts#:~:text=IndexPatternField), [field_stats.d.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/target/types/server/routes/field_stats.d.ts#:~:text=IndexPatternField), [field_stats.d.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/target/types/server/routes/field_stats.d.ts#:~:text=IndexPatternField), [field_stats.d.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/target/types/server/routes/field_stats.d.ts#:~:text=IndexPatternField), [field_stats.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/server/routes/field_stats.ts#:~:text=IndexPatternField)+ 8 more | - | | | [existing_fields.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/server/routes/existing_fields.ts#:~:text=IndexPatternsService), [existing_fields.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/server/routes/existing_fields.ts#:~:text=IndexPatternsService), [existing_fields.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/server/routes/existing_fields.ts#:~:text=IndexPatternsService), [existing_fields.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/server/routes/existing_fields.ts#:~:text=IndexPatternsService) | - | -| | [embeddable.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/public/embeddable/embeddable.tsx#:~:text=IndexPatternsContract), [embeddable.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/public/embeddable/embeddable.tsx#:~:text=IndexPatternsContract), [utils.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/public/utils.ts#:~:text=IndexPatternsContract), [utils.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/public/utils.ts#:~:text=IndexPatternsContract), [loader.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/public/indexpattern_datasource/loader.ts#:~:text=IndexPatternsContract), [loader.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/public/indexpattern_datasource/loader.ts#:~:text=IndexPatternsContract), [embeddable_factory.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/public/embeddable/embeddable_factory.ts#:~:text=IndexPatternsContract), [embeddable_factory.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/public/embeddable/embeddable_factory.ts#:~:text=IndexPatternsContract), [loader.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/public/indexpattern_datasource/loader.test.ts#:~:text=IndexPatternsContract), [loader.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/public/indexpattern_datasource/loader.test.ts#:~:text=IndexPatternsContract)+ 20 more | - | +| | [embeddable.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/public/embeddable/embeddable.tsx#:~:text=IndexPatternsContract), [embeddable.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/public/embeddable/embeddable.tsx#:~:text=IndexPatternsContract), [utils.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/public/utils.ts#:~:text=IndexPatternsContract), [utils.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/public/utils.ts#:~:text=IndexPatternsContract), [loader.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/public/indexpattern_datasource/loader.ts#:~:text=IndexPatternsContract), [loader.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/public/indexpattern_datasource/loader.ts#:~:text=IndexPatternsContract), [embeddable_factory.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/public/embeddable/embeddable_factory.ts#:~:text=IndexPatternsContract), [embeddable_factory.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/public/embeddable/embeddable_factory.ts#:~:text=IndexPatternsContract), [loader.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/public/indexpattern_datasource/loader.test.ts#:~:text=IndexPatternsContract), [loader.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/public/indexpattern_datasource/loader.test.ts#:~:text=IndexPatternsContract)+ 22 more | - | | | [plugin.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/public/plugin.ts#:~:text=ensureDefaultDataView), [plugin.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/public/plugin.ts#:~:text=ensureDefaultDataView) | - | | | [existing_fields.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/server/routes/existing_fields.ts#:~:text=IndexPattern), [existing_fields.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/server/routes/existing_fields.ts#:~:text=IndexPattern), [existing_fields.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/server/routes/existing_fields.test.ts#:~:text=IndexPattern), [existing_fields.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/server/routes/existing_fields.test.ts#:~:text=IndexPattern), [existing_fields.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/server/routes/existing_fields.test.ts#:~:text=IndexPattern), [existing_fields.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/server/routes/existing_fields.test.ts#:~:text=IndexPattern), [existing_fields.d.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/target/types/server/routes/existing_fields.d.ts#:~:text=IndexPattern), [existing_fields.d.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/target/types/server/routes/existing_fields.d.ts#:~:text=IndexPattern), [loader.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/public/indexpattern_datasource/loader.ts#:~:text=IndexPattern), [embeddable.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/public/embeddable/embeddable.tsx#:~:text=IndexPattern)+ 36 more | - | | | [types.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/public/types.ts#:~:text=Filter), [types.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/public/types.ts#:~:text=Filter), [types.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/public/types.ts#:~:text=Filter), [embeddable.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/public/embeddable/embeddable.tsx#:~:text=Filter), [embeddable.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/public/embeddable/embeddable.tsx#:~:text=Filter), [embeddable.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/public/embeddable/embeddable.tsx#:~:text=Filter), [types.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/public/state_management/types.ts#:~:text=Filter), [types.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/public/state_management/types.ts#:~:text=Filter), [field_item.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/public/indexpattern_datasource/field_item.tsx#:~:text=Filter), [field_item.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/public/indexpattern_datasource/field_item.tsx#:~:text=Filter)+ 16 more | 8.1 | @@ -608,12 +604,15 @@ warning: This document is auto-generated and is meant to be viewed inside our ex | | [kibana_server_services.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/server/kibana_server_services.ts#:~:text=IndexPatternsService), [kibana_server_services.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/server/kibana_server_services.ts#:~:text=IndexPatternsService), [create_doc_source.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/server/data_indexing/create_doc_source.ts#:~:text=IndexPatternsService), [create_doc_source.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/server/data_indexing/create_doc_source.ts#:~:text=IndexPatternsService), [kibana_server_services.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/server/kibana_server_services.ts#:~:text=IndexPatternsService), [kibana_server_services.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/server/kibana_server_services.ts#:~:text=IndexPatternsService), [create_doc_source.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/server/data_indexing/create_doc_source.ts#:~:text=IndexPatternsService), [create_doc_source.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/server/data_indexing/create_doc_source.ts#:~:text=IndexPatternsService) | - | | | [index.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/lazy_load_bundle/index.ts#:~:text=IndexPatternsContract), [index.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/lazy_load_bundle/index.ts#:~:text=IndexPatternsContract), [index.d.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/target/types/public/lazy_load_bundle/index.d.ts#:~:text=IndexPatternsContract), [index.d.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/target/types/public/lazy_load_bundle/index.d.ts#:~:text=IndexPatternsContract), [index.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/lazy_load_bundle/index.ts#:~:text=IndexPatternsContract), [index.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/lazy_load_bundle/index.ts#:~:text=IndexPatternsContract), [index.d.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/target/types/public/lazy_load_bundle/index.d.ts#:~:text=IndexPatternsContract), [index.d.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/target/types/public/lazy_load_bundle/index.d.ts#:~:text=IndexPatternsContract) | - | | | [types.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/embeddable/types.ts#:~:text=IndexPattern), [types.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/embeddable/types.ts#:~:text=IndexPattern), [es_agg_utils.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/common/elasticsearch_util/es_agg_utils.ts#:~:text=IndexPattern), [es_agg_utils.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/common/elasticsearch_util/es_agg_utils.ts#:~:text=IndexPattern), [agg_field_types.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/classes/fields/agg/agg_field_types.ts#:~:text=IndexPattern), [agg_field_types.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/classes/fields/agg/agg_field_types.ts#:~:text=IndexPattern), [percentile_agg_field.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/classes/fields/agg/percentile_agg_field.ts#:~:text=IndexPattern), [percentile_agg_field.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/classes/fields/agg/percentile_agg_field.ts#:~:text=IndexPattern), [es_geo_grid_source.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/classes/sources/es_geo_grid_source/es_geo_grid_source.tsx#:~:text=IndexPattern), [es_geo_grid_source.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/classes/sources/es_geo_grid_source/es_geo_grid_source.tsx#:~:text=IndexPattern)+ 206 more | - | +| | [es_search_source.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/classes/sources/es_search_source/es_search_source.tsx#:~:text=flattenHit), [es_search_source.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/classes/sources/es_search_source/es_search_source.tsx#:~:text=flattenHit), [es_search_source.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/classes/sources/es_search_source/es_search_source.tsx#:~:text=flattenHit), [es_search_source.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/classes/sources/es_search_source/es_search_source.tsx#:~:text=flattenHit) | - | | | [types.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/reducers/map/types.ts#:~:text=Filter), [types.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/reducers/map/types.ts#:~:text=Filter), [tooltip_property.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/classes/tooltips/tooltip_property.ts#:~:text=Filter), [tooltip_property.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/classes/tooltips/tooltip_property.ts#:~:text=Filter), [tooltip_property.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/classes/tooltips/tooltip_property.ts#:~:text=Filter), [tooltip_property.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/classes/tooltips/tooltip_property.ts#:~:text=Filter), [vector_source.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/classes/sources/vector_source/vector_source.tsx#:~:text=Filter), [vector_source.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/classes/sources/vector_source/vector_source.tsx#:~:text=Filter), [es_tooltip_property.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/classes/tooltips/es_tooltip_property.ts#:~:text=Filter), [es_tooltip_property.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/classes/tooltips/es_tooltip_property.ts#:~:text=Filter)+ 115 more | 8.1 | | | [es_source.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/classes/sources/es_source/es_source.ts#:~:text=fetch), [es_search_source.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/classes/sources/es_search_source/es_search_source.tsx#:~:text=fetch), [es_search_source.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/classes/sources/es_search_source/es_search_source.tsx#:~:text=fetch) | 8.1 | | | [es_agg_utils.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/common/elasticsearch_util/es_agg_utils.ts#:~:text=IndexPatternField), [es_agg_utils.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/common/elasticsearch_util/es_agg_utils.ts#:~:text=IndexPatternField), [es_agg_utils.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/common/elasticsearch_util/es_agg_utils.ts#:~:text=IndexPatternField), [es_agg_utils.d.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/target/types/common/elasticsearch_util/es_agg_utils.d.ts#:~:text=IndexPatternField), [es_agg_utils.d.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/target/types/common/elasticsearch_util/es_agg_utils.d.ts#:~:text=IndexPatternField), [es_agg_utils.d.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/target/types/common/elasticsearch_util/es_agg_utils.d.ts#:~:text=IndexPatternField), [es_tooltip_property.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/classes/tooltips/es_tooltip_property.ts#:~:text=IndexPatternField), [es_tooltip_property.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/classes/tooltips/es_tooltip_property.ts#:~:text=IndexPatternField), [es_doc_field.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/classes/fields/es_doc_field.ts#:~:text=IndexPatternField), [es_doc_field.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/classes/fields/es_doc_field.ts#:~:text=IndexPatternField)+ 129 more | - | | | [types.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/embeddable/types.ts#:~:text=IndexPattern), [types.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/embeddable/types.ts#:~:text=IndexPattern), [es_agg_utils.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/common/elasticsearch_util/es_agg_utils.ts#:~:text=IndexPattern), [es_agg_utils.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/common/elasticsearch_util/es_agg_utils.ts#:~:text=IndexPattern), [agg_field_types.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/classes/fields/agg/agg_field_types.ts#:~:text=IndexPattern), [agg_field_types.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/classes/fields/agg/agg_field_types.ts#:~:text=IndexPattern), [percentile_agg_field.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/classes/fields/agg/percentile_agg_field.ts#:~:text=IndexPattern), [percentile_agg_field.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/classes/fields/agg/percentile_agg_field.ts#:~:text=IndexPattern), [es_geo_grid_source.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/classes/sources/es_geo_grid_source/es_geo_grid_source.tsx#:~:text=IndexPattern), [es_geo_grid_source.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/classes/sources/es_geo_grid_source/es_geo_grid_source.tsx#:~:text=IndexPattern)+ 98 more | - | | | [kibana_server_services.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/server/kibana_server_services.ts#:~:text=IndexPatternsService), [kibana_server_services.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/server/kibana_server_services.ts#:~:text=IndexPatternsService), [create_doc_source.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/server/data_indexing/create_doc_source.ts#:~:text=IndexPatternsService), [create_doc_source.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/server/data_indexing/create_doc_source.ts#:~:text=IndexPatternsService), [kibana_server_services.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/server/kibana_server_services.ts#:~:text=IndexPatternsService), [kibana_server_services.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/server/kibana_server_services.ts#:~:text=IndexPatternsService), [create_doc_source.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/server/data_indexing/create_doc_source.ts#:~:text=IndexPatternsService), [create_doc_source.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/server/data_indexing/create_doc_source.ts#:~:text=IndexPatternsService) | - | +| | [es_search_source.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/classes/sources/es_search_source/es_search_source.tsx#:~:text=flattenHit), [es_search_source.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/classes/sources/es_search_source/es_search_source.tsx#:~:text=flattenHit) | - | | | [types.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/reducers/map/types.ts#:~:text=Filter), [types.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/reducers/map/types.ts#:~:text=Filter), [tooltip_property.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/classes/tooltips/tooltip_property.ts#:~:text=Filter), [tooltip_property.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/classes/tooltips/tooltip_property.ts#:~:text=Filter), [tooltip_property.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/classes/tooltips/tooltip_property.ts#:~:text=Filter), [tooltip_property.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/classes/tooltips/tooltip_property.ts#:~:text=Filter), [vector_source.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/classes/sources/vector_source/vector_source.tsx#:~:text=Filter), [vector_source.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/classes/sources/vector_source/vector_source.tsx#:~:text=Filter), [es_tooltip_property.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/classes/tooltips/es_tooltip_property.ts#:~:text=Filter), [es_tooltip_property.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/classes/tooltips/es_tooltip_property.ts#:~:text=Filter)+ 115 more | 8.1 | +| | [es_search_source.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/classes/sources/es_search_source/es_search_source.tsx#:~:text=flattenHit), [es_search_source.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/classes/sources/es_search_source/es_search_source.tsx#:~:text=flattenHit) | - | | | [kibana_server_services.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/server/kibana_server_services.ts#:~:text=indexPatternsServiceFactory), [plugin.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/server/plugin.ts#:~:text=indexPatternsServiceFactory), [indexing_routes.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/server/data_indexing/indexing_routes.ts#:~:text=indexPatternsServiceFactory) | - | | | [maps_list_view.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/routes/list_page/maps_list_view.tsx#:~:text=settings), [maps_list_view.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/routes/list_page/maps_list_view.tsx#:~:text=settings), [maps_list_view.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/routes/list_page/maps_list_view.tsx#:~:text=settings) | - | | | [plugin.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/server/plugin.ts#:~:text=license%24) | - | @@ -683,11 +682,11 @@ warning: This document is auto-generated and is meant to be viewed inside our ex | Deprecated API | Reference location(s) | Remove By | | ---------------|-----------|-----------| -| | [use_scheduled_query_group_query_errors.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/osquery/public/scheduled_query_groups/use_scheduled_query_group_query_errors.ts#:~:text=IndexPattern), [use_scheduled_query_group_query_errors.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/osquery/public/scheduled_query_groups/use_scheduled_query_group_query_errors.ts#:~:text=IndexPattern), [use_scheduled_query_group_query_last_results.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/osquery/public/scheduled_query_groups/use_scheduled_query_group_query_last_results.ts#:~:text=IndexPattern), [use_scheduled_query_group_query_last_results.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/osquery/public/scheduled_query_groups/use_scheduled_query_group_query_last_results.ts#:~:text=IndexPattern), [scheduled_query_group_queries_status_table.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/osquery/public/scheduled_query_groups/scheduled_query_group_queries_status_table.tsx#:~:text=IndexPattern), [scheduled_query_group_queries_status_table.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/osquery/public/scheduled_query_groups/scheduled_query_group_queries_status_table.tsx#:~:text=IndexPattern), [use_scheduled_query_group_query_errors.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/osquery/public/scheduled_query_groups/use_scheduled_query_group_query_errors.ts#:~:text=IndexPattern), [use_scheduled_query_group_query_errors.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/osquery/public/scheduled_query_groups/use_scheduled_query_group_query_errors.ts#:~:text=IndexPattern), [use_scheduled_query_group_query_last_results.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/osquery/public/scheduled_query_groups/use_scheduled_query_group_query_last_results.ts#:~:text=IndexPattern), [use_scheduled_query_group_query_last_results.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/osquery/public/scheduled_query_groups/use_scheduled_query_group_query_last_results.ts#:~:text=IndexPattern)+ 2 more | - | -| | [scheduled_query_group_queries_status_table.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/osquery/public/scheduled_query_groups/scheduled_query_group_queries_status_table.tsx#:~:text=indexPatterns), [scheduled_query_group_queries_status_table.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/osquery/public/scheduled_query_groups/scheduled_query_group_queries_status_table.tsx#:~:text=indexPatterns) | - | -| | [use_scheduled_query_group_query_errors.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/osquery/public/scheduled_query_groups/use_scheduled_query_group_query_errors.ts#:~:text=IndexPattern), [use_scheduled_query_group_query_errors.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/osquery/public/scheduled_query_groups/use_scheduled_query_group_query_errors.ts#:~:text=IndexPattern), [use_scheduled_query_group_query_last_results.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/osquery/public/scheduled_query_groups/use_scheduled_query_group_query_last_results.ts#:~:text=IndexPattern), [use_scheduled_query_group_query_last_results.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/osquery/public/scheduled_query_groups/use_scheduled_query_group_query_last_results.ts#:~:text=IndexPattern), [scheduled_query_group_queries_status_table.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/osquery/public/scheduled_query_groups/scheduled_query_group_queries_status_table.tsx#:~:text=IndexPattern), [scheduled_query_group_queries_status_table.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/osquery/public/scheduled_query_groups/scheduled_query_group_queries_status_table.tsx#:~:text=IndexPattern), [use_scheduled_query_group_query_errors.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/osquery/public/scheduled_query_groups/use_scheduled_query_group_query_errors.ts#:~:text=IndexPattern), [use_scheduled_query_group_query_errors.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/osquery/public/scheduled_query_groups/use_scheduled_query_group_query_errors.ts#:~:text=IndexPattern), [use_scheduled_query_group_query_last_results.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/osquery/public/scheduled_query_groups/use_scheduled_query_group_query_last_results.ts#:~:text=IndexPattern), [use_scheduled_query_group_query_last_results.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/osquery/public/scheduled_query_groups/use_scheduled_query_group_query_last_results.ts#:~:text=IndexPattern)+ 2 more | - | -| | [use_scheduled_query_group_query_errors.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/osquery/public/scheduled_query_groups/use_scheduled_query_group_query_errors.ts#:~:text=IndexPattern), [use_scheduled_query_group_query_errors.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/osquery/public/scheduled_query_groups/use_scheduled_query_group_query_errors.ts#:~:text=IndexPattern), [use_scheduled_query_group_query_last_results.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/osquery/public/scheduled_query_groups/use_scheduled_query_group_query_last_results.ts#:~:text=IndexPattern), [use_scheduled_query_group_query_last_results.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/osquery/public/scheduled_query_groups/use_scheduled_query_group_query_last_results.ts#:~:text=IndexPattern), [scheduled_query_group_queries_status_table.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/osquery/public/scheduled_query_groups/scheduled_query_group_queries_status_table.tsx#:~:text=IndexPattern), [scheduled_query_group_queries_status_table.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/osquery/public/scheduled_query_groups/scheduled_query_group_queries_status_table.tsx#:~:text=IndexPattern) | - | -| | [scheduled_query_group_queries_status_table.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/osquery/public/scheduled_query_groups/scheduled_query_group_queries_status_table.tsx#:~:text=urlGenerator), [use_discover_link.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/osquery/public/common/hooks/use_discover_link.tsx#:~:text=urlGenerator) | - | +| | [use_pack_query_errors.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/osquery/public/packs/use_pack_query_errors.ts#:~:text=IndexPattern), [use_pack_query_errors.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/osquery/public/packs/use_pack_query_errors.ts#:~:text=IndexPattern), [use_pack_query_last_results.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/osquery/public/packs/use_pack_query_last_results.ts#:~:text=IndexPattern), [use_pack_query_last_results.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/osquery/public/packs/use_pack_query_last_results.ts#:~:text=IndexPattern), [pack_queries_status_table.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/osquery/public/packs/pack_queries_status_table.tsx#:~:text=IndexPattern), [pack_queries_status_table.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/osquery/public/packs/pack_queries_status_table.tsx#:~:text=IndexPattern), [use_pack_query_errors.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/osquery/public/packs/use_pack_query_errors.ts#:~:text=IndexPattern), [use_pack_query_errors.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/osquery/public/packs/use_pack_query_errors.ts#:~:text=IndexPattern), [use_pack_query_last_results.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/osquery/public/packs/use_pack_query_last_results.ts#:~:text=IndexPattern), [use_pack_query_last_results.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/osquery/public/packs/use_pack_query_last_results.ts#:~:text=IndexPattern)+ 2 more | - | +| | [pack_queries_status_table.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/osquery/public/packs/pack_queries_status_table.tsx#:~:text=indexPatterns), [pack_queries_status_table.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/osquery/public/packs/pack_queries_status_table.tsx#:~:text=indexPatterns) | - | +| | [use_pack_query_errors.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/osquery/public/packs/use_pack_query_errors.ts#:~:text=IndexPattern), [use_pack_query_errors.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/osquery/public/packs/use_pack_query_errors.ts#:~:text=IndexPattern), [use_pack_query_last_results.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/osquery/public/packs/use_pack_query_last_results.ts#:~:text=IndexPattern), [use_pack_query_last_results.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/osquery/public/packs/use_pack_query_last_results.ts#:~:text=IndexPattern), [pack_queries_status_table.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/osquery/public/packs/pack_queries_status_table.tsx#:~:text=IndexPattern), [pack_queries_status_table.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/osquery/public/packs/pack_queries_status_table.tsx#:~:text=IndexPattern), [use_pack_query_errors.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/osquery/public/packs/use_pack_query_errors.ts#:~:text=IndexPattern), [use_pack_query_errors.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/osquery/public/packs/use_pack_query_errors.ts#:~:text=IndexPattern), [use_pack_query_last_results.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/osquery/public/packs/use_pack_query_last_results.ts#:~:text=IndexPattern), [use_pack_query_last_results.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/osquery/public/packs/use_pack_query_last_results.ts#:~:text=IndexPattern)+ 2 more | - | +| | [use_pack_query_errors.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/osquery/public/packs/use_pack_query_errors.ts#:~:text=IndexPattern), [use_pack_query_errors.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/osquery/public/packs/use_pack_query_errors.ts#:~:text=IndexPattern), [use_pack_query_last_results.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/osquery/public/packs/use_pack_query_last_results.ts#:~:text=IndexPattern), [use_pack_query_last_results.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/osquery/public/packs/use_pack_query_last_results.ts#:~:text=IndexPattern), [pack_queries_status_table.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/osquery/public/packs/pack_queries_status_table.tsx#:~:text=IndexPattern), [pack_queries_status_table.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/osquery/public/packs/pack_queries_status_table.tsx#:~:text=IndexPattern) | - | +| | [pack_queries_status_table.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/osquery/public/packs/pack_queries_status_table.tsx#:~:text=urlGenerator), [use_discover_link.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/osquery/public/common/hooks/use_discover_link.tsx#:~:text=urlGenerator) | - | @@ -704,7 +703,12 @@ warning: This document is auto-generated and is meant to be viewed inside our ex | Deprecated API | Reference location(s) | Remove By | | ---------------|-----------|-----------| +| | [options_list_embeddable.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/presentation_util/public/components/controls/control_types/options_list/options_list_embeddable.tsx#:~:text=IIndexPattern), [options_list_embeddable.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/presentation_util/public/components/controls/control_types/options_list/options_list_embeddable.tsx#:~:text=IIndexPattern), [options_list_embeddable.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/presentation_util/public/components/controls/control_types/options_list/options_list_embeddable.tsx#:~:text=IIndexPattern), [options_list_embeddable.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/presentation_util/public/components/controls/control_types/options_list/options_list_embeddable.tsx#:~:text=IIndexPattern), [options_list_embeddable.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/presentation_util/public/components/controls/control_types/options_list/options_list_embeddable.tsx#:~:text=IIndexPattern), [options_list_editor.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/presentation_util/public/components/controls/control_types/options_list/options_list_editor.tsx#:~:text=IIndexPattern), [options_list_editor.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/presentation_util/public/components/controls/control_types/options_list/options_list_editor.tsx#:~:text=IIndexPattern), [options_list_editor.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/presentation_util/public/components/controls/control_types/options_list/options_list_editor.tsx#:~:text=IIndexPattern), [options_list_editor.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/presentation_util/public/components/controls/control_types/options_list/options_list_editor.tsx#:~:text=IIndexPattern), [options_list_editor.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/presentation_util/public/components/controls/control_types/options_list/options_list_editor.tsx#:~:text=IIndexPattern) | - | +| | [options_list_embeddable.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/presentation_util/public/components/controls/control_types/options_list/options_list_embeddable.tsx#:~:text=IFieldType), [options_list_embeddable.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/presentation_util/public/components/controls/control_types/options_list/options_list_embeddable.tsx#:~:text=IFieldType), [options_list_embeddable.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/presentation_util/public/components/controls/control_types/options_list/options_list_embeddable.tsx#:~:text=IFieldType), [options_list_embeddable.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/presentation_util/public/components/controls/control_types/options_list/options_list_embeddable.tsx#:~:text=IFieldType), [options_list_editor.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/presentation_util/public/components/controls/control_types/options_list/options_list_editor.tsx#:~:text=IFieldType), [options_list_editor.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/presentation_util/public/components/controls/control_types/options_list/options_list_editor.tsx#:~:text=IFieldType), [options_list_editor.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/presentation_util/public/components/controls/control_types/options_list/options_list_editor.tsx#:~:text=IFieldType), [options_list_editor.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/presentation_util/public/components/controls/control_types/options_list/options_list_editor.tsx#:~:text=IFieldType), [options_list_editor.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/presentation_util/public/components/controls/control_types/options_list/options_list_editor.tsx#:~:text=IFieldType), [options_list_editor.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/presentation_util/public/components/controls/control_types/options_list/options_list_editor.tsx#:~:text=IFieldType) | 8.1 | | | [options_list_embeddable.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/presentation_util/public/components/controls/control_types/options_list/options_list_embeddable.tsx#:~:text=esFilters), [options_list_embeddable.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/presentation_util/public/components/controls/control_types/options_list/options_list_embeddable.tsx#:~:text=esFilters) | 8.1 | +| | [options_list_embeddable.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/presentation_util/public/components/controls/control_types/options_list/options_list_embeddable.tsx#:~:text=IFieldType), [options_list_embeddable.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/presentation_util/public/components/controls/control_types/options_list/options_list_embeddable.tsx#:~:text=IFieldType), [options_list_embeddable.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/presentation_util/public/components/controls/control_types/options_list/options_list_embeddable.tsx#:~:text=IFieldType), [options_list_embeddable.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/presentation_util/public/components/controls/control_types/options_list/options_list_embeddable.tsx#:~:text=IFieldType), [options_list_editor.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/presentation_util/public/components/controls/control_types/options_list/options_list_editor.tsx#:~:text=IFieldType), [options_list_editor.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/presentation_util/public/components/controls/control_types/options_list/options_list_editor.tsx#:~:text=IFieldType), [options_list_editor.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/presentation_util/public/components/controls/control_types/options_list/options_list_editor.tsx#:~:text=IFieldType), [options_list_editor.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/presentation_util/public/components/controls/control_types/options_list/options_list_editor.tsx#:~:text=IFieldType), [options_list_editor.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/presentation_util/public/components/controls/control_types/options_list/options_list_editor.tsx#:~:text=IFieldType), [options_list_editor.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/presentation_util/public/components/controls/control_types/options_list/options_list_editor.tsx#:~:text=IFieldType)+ 10 more | 8.1 | +| | [options_list_embeddable.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/presentation_util/public/components/controls/control_types/options_list/options_list_embeddable.tsx#:~:text=IIndexPattern), [options_list_embeddable.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/presentation_util/public/components/controls/control_types/options_list/options_list_embeddable.tsx#:~:text=IIndexPattern), [options_list_embeddable.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/presentation_util/public/components/controls/control_types/options_list/options_list_embeddable.tsx#:~:text=IIndexPattern), [options_list_embeddable.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/presentation_util/public/components/controls/control_types/options_list/options_list_embeddable.tsx#:~:text=IIndexPattern), [options_list_embeddable.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/presentation_util/public/components/controls/control_types/options_list/options_list_embeddable.tsx#:~:text=IIndexPattern), [options_list_editor.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/presentation_util/public/components/controls/control_types/options_list/options_list_editor.tsx#:~:text=IIndexPattern), [options_list_editor.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/presentation_util/public/components/controls/control_types/options_list/options_list_editor.tsx#:~:text=IIndexPattern), [options_list_editor.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/presentation_util/public/components/controls/control_types/options_list/options_list_editor.tsx#:~:text=IIndexPattern), [options_list_editor.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/presentation_util/public/components/controls/control_types/options_list/options_list_editor.tsx#:~:text=IIndexPattern), [options_list_editor.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/presentation_util/public/components/controls/control_types/options_list/options_list_editor.tsx#:~:text=IIndexPattern)+ 10 more | - | +| | [options_list_embeddable.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/presentation_util/public/components/controls/control_types/options_list/options_list_embeddable.tsx#:~:text=IFieldType), [options_list_embeddable.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/presentation_util/public/components/controls/control_types/options_list/options_list_embeddable.tsx#:~:text=IFieldType), [options_list_embeddable.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/presentation_util/public/components/controls/control_types/options_list/options_list_embeddable.tsx#:~:text=IFieldType), [options_list_embeddable.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/presentation_util/public/components/controls/control_types/options_list/options_list_embeddable.tsx#:~:text=IFieldType), [options_list_editor.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/presentation_util/public/components/controls/control_types/options_list/options_list_editor.tsx#:~:text=IFieldType), [options_list_editor.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/presentation_util/public/components/controls/control_types/options_list/options_list_editor.tsx#:~:text=IFieldType), [options_list_editor.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/presentation_util/public/components/controls/control_types/options_list/options_list_editor.tsx#:~:text=IFieldType), [options_list_editor.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/presentation_util/public/components/controls/control_types/options_list/options_list_editor.tsx#:~:text=IFieldType), [options_list_editor.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/presentation_util/public/components/controls/control_types/options_list/options_list_editor.tsx#:~:text=IFieldType), [options_list_editor.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/presentation_util/public/components/controls/control_types/options_list/options_list_editor.tsx#:~:text=IFieldType) | 8.1 | | | [saved_object_save_modal_dashboard.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/presentation_util/public/components/saved_object_save_modal_dashboard.tsx#:~:text=SavedObjectSaveModal), [saved_object_save_modal_dashboard.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/presentation_util/public/components/saved_object_save_modal_dashboard.tsx#:~:text=SavedObjectSaveModal) | - | @@ -826,23 +830,23 @@ warning: This document is auto-generated and is meant to be viewed inside our ex | | [use_risky_hosts_dashboard_button_href.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/overview/containers/overview_risky_host_links/use_risky_hosts_dashboard_button_href.ts#:~:text=dashboardUrlGenerator), [use_risky_hosts_dashboard_links.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/overview/containers/overview_risky_host_links/use_risky_hosts_dashboard_links.tsx#:~:text=dashboardUrlGenerator), [index.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/overview/containers/overview_cti_links/index.tsx#:~:text=dashboardUrlGenerator) | - | | | [helpers.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/common/components/threat_match/helpers.tsx#:~:text=IndexPattern), [helpers.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/common/components/threat_match/helpers.tsx#:~:text=IndexPattern), [helpers.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/common/components/threat_match/helpers.tsx#:~:text=IndexPattern), [helpers.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/common/components/threat_match/helpers.tsx#:~:text=IndexPattern), [helpers.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/common/components/threat_match/helpers.tsx#:~:text=IndexPattern), [entry_item.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/common/components/threat_match/entry_item.tsx#:~:text=IndexPattern), [entry_item.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/common/components/threat_match/entry_item.tsx#:~:text=IndexPattern), [entry_item.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/common/components/threat_match/entry_item.tsx#:~:text=IndexPattern), [list_item.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/common/components/threat_match/list_item.tsx#:~:text=IndexPattern), [list_item.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/common/components/threat_match/list_item.tsx#:~:text=IndexPattern)+ 30 more | - | | | [field_name_cell.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/common/components/event_details/table/field_name_cell.tsx#:~:text=IndexPatternField), [field_name_cell.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/common/components/event_details/table/field_name_cell.tsx#:~:text=IndexPatternField), [field_name_cell.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/common/components/event_details/table/field_name_cell.tsx#:~:text=IndexPatternField), [field_name_cell.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/common/components/event_details/table/field_name_cell.tsx#:~:text=IndexPatternField) | - | -| | [types.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/types.ts#:~:text=IIndexPattern), [types.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/types.ts#:~:text=IIndexPattern), [action.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/store/action.ts#:~:text=IIndexPattern), [action.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/store/action.ts#:~:text=IIndexPattern), [index.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/common/containers/source/index.tsx#:~:text=IIndexPattern), [index.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/common/containers/source/index.tsx#:~:text=IIndexPattern), [index.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/common/containers/source/index.tsx#:~:text=IIndexPattern), [helpers.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/timelines/components/timeline/helpers.tsx#:~:text=IIndexPattern), [helpers.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/timelines/components/timeline/helpers.tsx#:~:text=IIndexPattern), [types.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/common/components/url_state/types.ts#:~:text=IIndexPattern)+ 74 more | - | +| | [types.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/types.ts#:~:text=IIndexPattern), [types.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/types.ts#:~:text=IIndexPattern), [index.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/common/containers/source/index.tsx#:~:text=IIndexPattern), [index.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/common/containers/source/index.tsx#:~:text=IIndexPattern), [index.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/common/containers/source/index.tsx#:~:text=IIndexPattern), [helpers.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/timelines/components/timeline/helpers.tsx#:~:text=IIndexPattern), [helpers.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/timelines/components/timeline/helpers.tsx#:~:text=IIndexPattern), [types.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/common/components/url_state/types.ts#:~:text=IIndexPattern), [types.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/common/components/url_state/types.ts#:~:text=IIndexPattern), [types.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/common/components/url_state/types.ts#:~:text=IIndexPattern)+ 74 more | - | | | [middleware.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/store/middleware.ts#:~:text=indexPatterns), [plugin.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/plugin.tsx#:~:text=indexPatterns), [dependencies_start_mock.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/common/mock/endpoint/dependencies_start_mock.ts#:~:text=indexPatterns) | - | | | [index.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/timelines/components/timeline/query_bar/index.tsx#:~:text=esFilters), [index.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/timelines/components/timeline/query_bar/index.tsx#:~:text=esFilters), [epic.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/timelines/store/timeline/epic.ts#:~:text=esFilters), [epic.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/timelines/store/timeline/epic.ts#:~:text=esFilters), [epic.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/timelines/store/timeline/epic.ts#:~:text=esFilters), [epic.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/timelines/store/timeline/epic.ts#:~:text=esFilters), [epic.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/timelines/store/timeline/epic.ts#:~:text=esFilters), [epic.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/timelines/store/timeline/epic.ts#:~:text=esFilters), [epic.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/timelines/store/timeline/epic.ts#:~:text=esFilters), [epic.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/timelines/store/timeline/epic.ts#:~:text=esFilters)+ 14 more | 8.1 | | | [expandable_network.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/timelines/components/side_panel/network_details/expandable_network.tsx#:~:text=esQuery), [expandable_network.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/timelines/components/side_panel/network_details/expandable_network.tsx#:~:text=esQuery), [events_viewer.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/common/components/events_viewer/events_viewer.tsx#:~:text=esQuery), [events_viewer.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/common/components/events_viewer/events_viewer.tsx#:~:text=esQuery), [index.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/overview/components/events_by_dataset/index.tsx#:~:text=esQuery), [index.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/overview/components/events_by_dataset/index.tsx#:~:text=esQuery), [index.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/detections/components/alerts_kpis/alerts_histogram_panel/index.tsx#:~:text=esQuery), [index.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/detections/components/alerts_kpis/alerts_histogram_panel/index.tsx#:~:text=esQuery), [index.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/detections/components/alerts_kpis/alerts_histogram_panel/index.tsx#:~:text=esQuery), [index.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/common/components/top_n/index.tsx#:~:text=esQuery)+ 30 more | 8.1 | -| | [store.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/common/types/timeline/store.ts#:~:text=Filter), [store.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/common/types/timeline/store.ts#:~:text=Filter), [model.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/common/store/inputs/model.ts#:~:text=Filter), [model.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/common/store/inputs/model.ts#:~:text=Filter), [actions.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/common/store/inputs/actions.ts#:~:text=Filter), [actions.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/common/store/inputs/actions.ts#:~:text=Filter), [selectors.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/common/store/inputs/selectors.ts#:~:text=Filter), [selectors.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/common/store/inputs/selectors.ts#:~:text=Filter), [actions.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/timelines/store/timeline/actions.ts#:~:text=Filter), [actions.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/timelines/store/timeline/actions.ts#:~:text=Filter)+ 163 more | 8.1 | -| | [types.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/types.ts#:~:text=IIndexPattern), [types.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/types.ts#:~:text=IIndexPattern), [action.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/store/action.ts#:~:text=IIndexPattern), [action.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/store/action.ts#:~:text=IIndexPattern), [index.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/common/containers/source/index.tsx#:~:text=IIndexPattern), [index.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/common/containers/source/index.tsx#:~:text=IIndexPattern), [index.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/common/containers/source/index.tsx#:~:text=IIndexPattern), [helpers.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/timelines/components/timeline/helpers.tsx#:~:text=IIndexPattern), [helpers.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/timelines/components/timeline/helpers.tsx#:~:text=IIndexPattern), [types.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/common/components/url_state/types.ts#:~:text=IIndexPattern)+ 158 more | - | +| | [store.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/common/types/timeline/store.ts#:~:text=Filter), [store.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/common/types/timeline/store.ts#:~:text=Filter), [model.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/common/store/inputs/model.ts#:~:text=Filter), [model.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/common/store/inputs/model.ts#:~:text=Filter), [actions.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/common/store/inputs/actions.ts#:~:text=Filter), [actions.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/common/store/inputs/actions.ts#:~:text=Filter), [actions.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/timelines/store/timeline/actions.ts#:~:text=Filter), [actions.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/timelines/store/timeline/actions.ts#:~:text=Filter), [helpers.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/detections/pages/detection_engine/rules/helpers.tsx#:~:text=Filter), [helpers.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/detections/pages/detection_engine/rules/helpers.tsx#:~:text=Filter)+ 165 more | 8.1 | +| | [types.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/types.ts#:~:text=IIndexPattern), [types.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/types.ts#:~:text=IIndexPattern), [index.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/common/containers/source/index.tsx#:~:text=IIndexPattern), [index.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/common/containers/source/index.tsx#:~:text=IIndexPattern), [index.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/common/containers/source/index.tsx#:~:text=IIndexPattern), [helpers.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/timelines/components/timeline/helpers.tsx#:~:text=IIndexPattern), [helpers.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/timelines/components/timeline/helpers.tsx#:~:text=IIndexPattern), [types.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/common/components/url_state/types.ts#:~:text=IIndexPattern), [types.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/common/components/url_state/types.ts#:~:text=IIndexPattern), [types.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/common/components/url_state/types.ts#:~:text=IIndexPattern)+ 158 more | - | | | [field_name_cell.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/common/components/event_details/table/field_name_cell.tsx#:~:text=IndexPatternField), [field_name_cell.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/common/components/event_details/table/field_name_cell.tsx#:~:text=IndexPatternField), [field_name_cell.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/common/components/event_details/table/field_name_cell.tsx#:~:text=IndexPatternField), [field_name_cell.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/common/components/event_details/table/field_name_cell.tsx#:~:text=IndexPatternField) | - | | | [helpers.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/common/components/threat_match/helpers.tsx#:~:text=IndexPattern), [helpers.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/common/components/threat_match/helpers.tsx#:~:text=IndexPattern), [helpers.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/common/components/threat_match/helpers.tsx#:~:text=IndexPattern), [helpers.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/common/components/threat_match/helpers.tsx#:~:text=IndexPattern), [helpers.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/common/components/threat_match/helpers.tsx#:~:text=IndexPattern), [entry_item.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/common/components/threat_match/entry_item.tsx#:~:text=IndexPattern), [entry_item.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/common/components/threat_match/entry_item.tsx#:~:text=IndexPattern), [entry_item.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/common/components/threat_match/entry_item.tsx#:~:text=IndexPattern), [list_item.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/common/components/threat_match/list_item.tsx#:~:text=IndexPattern), [list_item.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/common/components/threat_match/list_item.tsx#:~:text=IndexPattern)+ 30 more | - | -| | [store.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/common/types/timeline/store.ts#:~:text=Filter), [store.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/common/types/timeline/store.ts#:~:text=Filter), [model.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/common/store/inputs/model.ts#:~:text=Filter), [model.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/common/store/inputs/model.ts#:~:text=Filter), [actions.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/common/store/inputs/actions.ts#:~:text=Filter), [actions.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/common/store/inputs/actions.ts#:~:text=Filter), [selectors.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/common/store/inputs/selectors.ts#:~:text=Filter), [selectors.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/common/store/inputs/selectors.ts#:~:text=Filter), [actions.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/timelines/store/timeline/actions.ts#:~:text=Filter), [actions.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/timelines/store/timeline/actions.ts#:~:text=Filter)+ 163 more | 8.1 | +| | [store.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/common/types/timeline/store.ts#:~:text=Filter), [store.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/common/types/timeline/store.ts#:~:text=Filter), [model.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/common/store/inputs/model.ts#:~:text=Filter), [model.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/common/store/inputs/model.ts#:~:text=Filter), [actions.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/common/store/inputs/actions.ts#:~:text=Filter), [actions.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/common/store/inputs/actions.ts#:~:text=Filter), [actions.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/timelines/store/timeline/actions.ts#:~:text=Filter), [actions.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/timelines/store/timeline/actions.ts#:~:text=Filter), [helpers.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/detections/pages/detection_engine/rules/helpers.tsx#:~:text=Filter), [helpers.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/detections/pages/detection_engine/rules/helpers.tsx#:~:text=Filter)+ 165 more | 8.1 | | | [field_name_cell.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/common/components/event_details/table/field_name_cell.tsx#:~:text=IndexPatternField), [field_name_cell.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/common/components/event_details/table/field_name_cell.tsx#:~:text=IndexPatternField) | - | | | [helpers.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/common/components/threat_match/helpers.tsx#:~:text=IndexPattern), [helpers.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/common/components/threat_match/helpers.tsx#:~:text=IndexPattern), [helpers.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/common/components/threat_match/helpers.tsx#:~:text=IndexPattern), [helpers.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/common/components/threat_match/helpers.tsx#:~:text=IndexPattern), [helpers.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/common/components/threat_match/helpers.tsx#:~:text=IndexPattern), [entry_item.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/common/components/threat_match/entry_item.tsx#:~:text=IndexPattern), [entry_item.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/common/components/threat_match/entry_item.tsx#:~:text=IndexPattern), [entry_item.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/common/components/threat_match/entry_item.tsx#:~:text=IndexPattern), [list_item.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/common/components/threat_match/list_item.tsx#:~:text=IndexPattern), [list_item.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/common/components/threat_match/list_item.tsx#:~:text=IndexPattern)+ 10 more | - | -| | [store.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/common/types/timeline/store.ts#:~:text=Filter), [store.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/common/types/timeline/store.ts#:~:text=Filter), [model.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/common/store/inputs/model.ts#:~:text=Filter), [model.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/common/store/inputs/model.ts#:~:text=Filter), [actions.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/common/store/inputs/actions.ts#:~:text=Filter), [actions.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/common/store/inputs/actions.ts#:~:text=Filter), [selectors.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/common/store/inputs/selectors.ts#:~:text=Filter), [selectors.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/common/store/inputs/selectors.ts#:~:text=Filter), [actions.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/timelines/store/timeline/actions.ts#:~:text=Filter), [actions.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/timelines/store/timeline/actions.ts#:~:text=Filter)+ 163 more | 8.1 | +| | [store.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/common/types/timeline/store.ts#:~:text=Filter), [store.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/common/types/timeline/store.ts#:~:text=Filter), [model.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/common/store/inputs/model.ts#:~:text=Filter), [model.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/common/store/inputs/model.ts#:~:text=Filter), [actions.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/common/store/inputs/actions.ts#:~:text=Filter), [actions.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/common/store/inputs/actions.ts#:~:text=Filter), [actions.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/timelines/store/timeline/actions.ts#:~:text=Filter), [actions.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/timelines/store/timeline/actions.ts#:~:text=Filter), [helpers.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/detections/pages/detection_engine/rules/helpers.tsx#:~:text=Filter), [helpers.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/detections/pages/detection_engine/rules/helpers.tsx#:~:text=Filter)+ 165 more | 8.1 | | | [policy_config.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/common/license/policy_config.test.ts#:~:text=mode), [policy_config.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/common/license/policy_config.test.ts#:~:text=mode), [policy_config.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/common/license/policy_config.test.ts#:~:text=mode), [fleet_integration.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/server/fleet_integration/fleet_integration.test.ts#:~:text=mode), [fleet_integration.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/server/fleet_integration/fleet_integration.test.ts#:~:text=mode), [license_watch.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/server/endpoint/lib/policy/license_watch.test.ts#:~:text=mode), [license_watch.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/server/endpoint/lib/policy/license_watch.test.ts#:~:text=mode), [license_watch.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/server/endpoint/lib/policy/license_watch.test.ts#:~:text=mode), [isolation.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/server/endpoint/routes/actions/isolation.test.ts#:~:text=mode), [isolation.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/server/endpoint/routes/actions/isolation.test.ts#:~:text=mode)+ 4 more | - | | | [policy_config.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/common/license/policy_config.test.ts#:~:text=mode), [policy_config.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/common/license/policy_config.test.ts#:~:text=mode), [policy_config.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/common/license/policy_config.test.ts#:~:text=mode), [fleet_integration.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/server/fleet_integration/fleet_integration.test.ts#:~:text=mode), [fleet_integration.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/server/fleet_integration/fleet_integration.test.ts#:~:text=mode), [license_watch.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/server/endpoint/lib/policy/license_watch.test.ts#:~:text=mode), [license_watch.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/server/endpoint/lib/policy/license_watch.test.ts#:~:text=mode), [license_watch.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/server/endpoint/lib/policy/license_watch.test.ts#:~:text=mode), [isolation.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/server/endpoint/routes/actions/isolation.test.ts#:~:text=mode), [isolation.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/server/endpoint/routes/actions/isolation.test.ts#:~:text=mode)+ 4 more | - | -| | [create_signals_migration_route.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/server/lib/detection_engine/routes/signals/create_signals_migration_route.ts#:~:text=authc), [delete_signals_migration_route.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/server/lib/detection_engine/routes/signals/delete_signals_migration_route.ts#:~:text=authc), [finalize_signals_migration_route.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/server/lib/detection_engine/routes/signals/finalize_signals_migration_route.ts#:~:text=authc), [common.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/server/lib/timeline/utils/common.ts#:~:text=authc) | - | -| | [plugin.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/server/plugin.ts#:~:text=spacesService), [plugin.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/server/plugin.ts#:~:text=spacesService) | 7.16 | -| | [plugin.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/server/plugin.ts#:~:text=getSpaceId), [plugin.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/server/plugin.ts#:~:text=getSpaceId) | 7.16 | +| | [create_signals_migration_route.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/server/lib/detection_engine/routes/signals/create_signals_migration_route.ts#:~:text=authc), [delete_signals_migration_route.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/server/lib/detection_engine/routes/signals/delete_signals_migration_route.ts#:~:text=authc), [finalize_signals_migration_route.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/server/lib/detection_engine/routes/signals/finalize_signals_migration_route.ts#:~:text=authc), [preview_rules_route.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/server/lib/detection_engine/routes/rules/preview_rules_route.ts#:~:text=authc), [request_context_factory.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/server/request_context_factory.ts#:~:text=authc), [common.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/server/lib/timeline/utils/common.ts#:~:text=authc) | - | +| | [plugin.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/server/plugin.ts#:~:text=spacesService), [request_context_factory.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/server/request_context_factory.ts#:~:text=spacesService), [request_context_factory.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/server/request_context_factory.ts#:~:text=spacesService) | 7.16 | +| | [plugin.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/server/plugin.ts#:~:text=getSpaceId), [request_context_factory.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/server/request_context_factory.ts#:~:text=getSpaceId), [request_context_factory.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/server/request_context_factory.ts#:~:text=getSpaceId) | 7.16 | | | [index.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/app/index.tsx#:~:text=onAppLeave) | - | | | [index.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/timelines/components/flyout/index.tsx#:~:text=AppLeaveHandler), [index.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/timelines/components/flyout/index.tsx#:~:text=AppLeaveHandler), [index.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/app/home/template_wrapper/bottom_bar/index.tsx#:~:text=AppLeaveHandler), [index.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/app/home/template_wrapper/bottom_bar/index.tsx#:~:text=AppLeaveHandler), [index.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/app/home/template_wrapper/index.tsx#:~:text=AppLeaveHandler), [index.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/app/home/template_wrapper/index.tsx#:~:text=AppLeaveHandler), [index.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/app/home/index.tsx#:~:text=AppLeaveHandler), [index.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/app/home/index.tsx#:~:text=AppLeaveHandler), [routes.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/app/routes.tsx#:~:text=AppLeaveHandler), [routes.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/app/routes.tsx#:~:text=AppLeaveHandler)+ 3 more | - | @@ -894,11 +898,11 @@ warning: This document is auto-generated and is meant to be viewed inside our ex | | [helpers.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/timelines/public/components/t_grid/helpers.tsx#:~:text=IIndexPattern), [helpers.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/timelines/public/components/t_grid/helpers.tsx#:~:text=IIndexPattern), [index.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/timelines/public/components/t_grid/integrated/index.tsx#:~:text=IIndexPattern), [index.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/timelines/public/components/t_grid/integrated/index.tsx#:~:text=IIndexPattern), [index.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/timelines/public/container/source/index.tsx#:~:text=IIndexPattern), [index.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/timelines/public/container/source/index.tsx#:~:text=IIndexPattern), [index.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/timelines/public/container/source/index.tsx#:~:text=IIndexPattern), [index_pattern.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/timelines/public/mock/index_pattern.ts#:~:text=IIndexPattern), [index_pattern.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/timelines/public/mock/index_pattern.ts#:~:text=IIndexPattern) | - | | | [index.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/timelines/common/types/timeline/columns/index.tsx#:~:text=IFieldSubType), [index.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/timelines/common/types/timeline/columns/index.tsx#:~:text=IFieldSubType) | 8.1 | | | [index.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/timelines/public/components/t_grid/integrated/index.tsx#:~:text=esQuery), [index.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/timelines/public/components/t_grid/integrated/index.tsx#:~:text=esQuery), [index.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/timelines/public/components/t_grid/integrated/index.tsx#:~:text=esQuery), [index.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/timelines/public/components/t_grid/standalone/index.tsx#:~:text=esQuery), [index.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/timelines/public/components/t_grid/standalone/index.tsx#:~:text=esQuery), [index.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/timelines/public/components/t_grid/standalone/index.tsx#:~:text=esQuery) | 8.1 | -| | [store.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/timelines/common/types/timeline/store.ts#:~:text=Filter), [store.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/timelines/common/types/timeline/store.ts#:~:text=Filter), [model.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/timelines/public/store/t_grid/model.ts#:~:text=Filter), [model.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/timelines/public/store/t_grid/model.ts#:~:text=Filter), [index.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/timelines/public/components/t_grid/body/index.tsx#:~:text=Filter), [index.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/timelines/public/components/t_grid/body/index.tsx#:~:text=Filter), [index.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/timelines/public/components/t_grid/integrated/index.tsx#:~:text=Filter), [index.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/timelines/public/components/t_grid/integrated/index.tsx#:~:text=Filter), [index.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/timelines/public/components/t_grid/standalone/index.tsx#:~:text=Filter), [index.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/timelines/public/components/t_grid/standalone/index.tsx#:~:text=Filter)+ 5 more | 8.1 | +| | [index.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/timelines/common/types/timeline/cells/index.ts#:~:text=Filter), [index.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/timelines/common/types/timeline/cells/index.ts#:~:text=Filter), [store.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/timelines/common/types/timeline/store.ts#:~:text=Filter), [store.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/timelines/common/types/timeline/store.ts#:~:text=Filter), [model.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/timelines/public/store/t_grid/model.ts#:~:text=Filter), [model.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/timelines/public/store/t_grid/model.ts#:~:text=Filter), [index.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/timelines/public/components/t_grid/body/index.tsx#:~:text=Filter), [index.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/timelines/public/components/t_grid/body/index.tsx#:~:text=Filter), [index.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/timelines/public/components/t_grid/integrated/index.tsx#:~:text=Filter), [index.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/timelines/public/components/t_grid/integrated/index.tsx#:~:text=Filter)+ 5 more | 8.1 | | | [helpers.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/timelines/public/components/t_grid/helpers.tsx#:~:text=IIndexPattern), [helpers.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/timelines/public/components/t_grid/helpers.tsx#:~:text=IIndexPattern), [index.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/timelines/public/components/t_grid/integrated/index.tsx#:~:text=IIndexPattern), [index.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/timelines/public/components/t_grid/integrated/index.tsx#:~:text=IIndexPattern), [index.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/timelines/public/container/source/index.tsx#:~:text=IIndexPattern), [index.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/timelines/public/container/source/index.tsx#:~:text=IIndexPattern), [index.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/timelines/public/container/source/index.tsx#:~:text=IIndexPattern), [index_pattern.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/timelines/public/mock/index_pattern.ts#:~:text=IIndexPattern), [index_pattern.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/timelines/public/mock/index_pattern.ts#:~:text=IIndexPattern), [helpers.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/timelines/public/components/t_grid/helpers.tsx#:~:text=IIndexPattern)+ 8 more | - | -| | [store.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/timelines/common/types/timeline/store.ts#:~:text=Filter), [store.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/timelines/common/types/timeline/store.ts#:~:text=Filter), [model.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/timelines/public/store/t_grid/model.ts#:~:text=Filter), [model.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/timelines/public/store/t_grid/model.ts#:~:text=Filter), [index.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/timelines/public/components/t_grid/body/index.tsx#:~:text=Filter), [index.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/timelines/public/components/t_grid/body/index.tsx#:~:text=Filter), [index.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/timelines/public/components/t_grid/integrated/index.tsx#:~:text=Filter), [index.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/timelines/public/components/t_grid/integrated/index.tsx#:~:text=Filter), [index.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/timelines/public/components/t_grid/standalone/index.tsx#:~:text=Filter), [index.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/timelines/public/components/t_grid/standalone/index.tsx#:~:text=Filter)+ 5 more | 8.1 | +| | [index.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/timelines/common/types/timeline/cells/index.ts#:~:text=Filter), [index.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/timelines/common/types/timeline/cells/index.ts#:~:text=Filter), [store.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/timelines/common/types/timeline/store.ts#:~:text=Filter), [store.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/timelines/common/types/timeline/store.ts#:~:text=Filter), [model.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/timelines/public/store/t_grid/model.ts#:~:text=Filter), [model.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/timelines/public/store/t_grid/model.ts#:~:text=Filter), [index.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/timelines/public/components/t_grid/body/index.tsx#:~:text=Filter), [index.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/timelines/public/components/t_grid/body/index.tsx#:~:text=Filter), [index.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/timelines/public/components/t_grid/integrated/index.tsx#:~:text=Filter), [index.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/timelines/public/components/t_grid/integrated/index.tsx#:~:text=Filter)+ 5 more | 8.1 | | | [index.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/timelines/common/types/timeline/columns/index.tsx#:~:text=IFieldSubType), [index.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/timelines/common/types/timeline/columns/index.tsx#:~:text=IFieldSubType) | 8.1 | -| | [store.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/timelines/common/types/timeline/store.ts#:~:text=Filter), [store.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/timelines/common/types/timeline/store.ts#:~:text=Filter), [model.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/timelines/public/store/t_grid/model.ts#:~:text=Filter), [model.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/timelines/public/store/t_grid/model.ts#:~:text=Filter), [index.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/timelines/public/components/t_grid/body/index.tsx#:~:text=Filter), [index.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/timelines/public/components/t_grid/body/index.tsx#:~:text=Filter), [index.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/timelines/public/components/t_grid/integrated/index.tsx#:~:text=Filter), [index.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/timelines/public/components/t_grid/integrated/index.tsx#:~:text=Filter), [index.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/timelines/public/components/t_grid/standalone/index.tsx#:~:text=Filter), [index.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/timelines/public/components/t_grid/standalone/index.tsx#:~:text=Filter)+ 5 more | 8.1 | +| | [index.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/timelines/common/types/timeline/cells/index.ts#:~:text=Filter), [index.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/timelines/common/types/timeline/cells/index.ts#:~:text=Filter), [store.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/timelines/common/types/timeline/store.ts#:~:text=Filter), [store.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/timelines/common/types/timeline/store.ts#:~:text=Filter), [model.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/timelines/public/store/t_grid/model.ts#:~:text=Filter), [model.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/timelines/public/store/t_grid/model.ts#:~:text=Filter), [index.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/timelines/public/components/t_grid/body/index.tsx#:~:text=Filter), [index.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/timelines/public/components/t_grid/body/index.tsx#:~:text=Filter), [index.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/timelines/public/components/t_grid/integrated/index.tsx#:~:text=Filter), [index.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/timelines/public/components/t_grid/integrated/index.tsx#:~:text=Filter)+ 5 more | 8.1 | | | [index.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/timelines/common/types/timeline/columns/index.tsx#:~:text=IFieldSubType), [index.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/timelines/common/types/timeline/columns/index.tsx#:~:text=IFieldSubType) | 8.1 | @@ -1073,23 +1077,16 @@ warning: This document is auto-generated and is meant to be viewed inside our ex | Deprecated API | Reference location(s) | Remove By | | ---------------|-----------|-----------| -| | [_saved_vis.ts](https://github.com/elastic/kibana/tree/master/src/plugins/visualizations/public/saved_visualizations/_saved_vis.ts#:~:text=IndexPatternsContract), [_saved_vis.ts](https://github.com/elastic/kibana/tree/master/src/plugins/visualizations/public/saved_visualizations/_saved_vis.ts#:~:text=IndexPatternsContract), [_saved_vis.ts](https://github.com/elastic/kibana/tree/master/src/plugins/visualizations/public/saved_visualizations/_saved_vis.ts#:~:text=IndexPatternsContract), [_saved_vis.ts](https://github.com/elastic/kibana/tree/master/src/plugins/visualizations/public/saved_visualizations/_saved_vis.ts#:~:text=IndexPatternsContract) | - | | | [vis.ts](https://github.com/elastic/kibana/tree/master/src/plugins/visualizations/public/vis.ts#:~:text=IndexPattern), [vis.ts](https://github.com/elastic/kibana/tree/master/src/plugins/visualizations/public/vis.ts#:~:text=IndexPattern), [types.ts](https://github.com/elastic/kibana/tree/master/src/plugins/visualizations/public/vis_types/types.ts#:~:text=IndexPattern), [types.ts](https://github.com/elastic/kibana/tree/master/src/plugins/visualizations/public/vis_types/types.ts#:~:text=IndexPattern), [types.ts](https://github.com/elastic/kibana/tree/master/src/plugins/visualizations/public/vis_types/types.ts#:~:text=IndexPattern), [create_vis_embeddable_from_object.ts](https://github.com/elastic/kibana/tree/master/src/plugins/visualizations/public/embeddable/create_vis_embeddable_from_object.ts#:~:text=IndexPattern), [create_vis_embeddable_from_object.ts](https://github.com/elastic/kibana/tree/master/src/plugins/visualizations/public/embeddable/create_vis_embeddable_from_object.ts#:~:text=IndexPattern), [visualize_embeddable.ts](https://github.com/elastic/kibana/tree/master/src/plugins/visualizations/public/embeddable/visualize_embeddable.ts#:~:text=IndexPattern), [visualize_embeddable.ts](https://github.com/elastic/kibana/tree/master/src/plugins/visualizations/public/embeddable/visualize_embeddable.ts#:~:text=IndexPattern), [visualize_embeddable.ts](https://github.com/elastic/kibana/tree/master/src/plugins/visualizations/public/embeddable/visualize_embeddable.ts#:~:text=IndexPattern)+ 10 more | - | | | [vis.ts](https://github.com/elastic/kibana/tree/master/src/plugins/visualizations/public/vis.ts#:~:text=toJSON) | 8.1 | -| | [plugin.ts](https://github.com/elastic/kibana/tree/master/src/plugins/visualizations/public/plugin.ts#:~:text=indexPatterns) | - | | | [visualize_embeddable.ts](https://github.com/elastic/kibana/tree/master/src/plugins/visualizations/public/embeddable/visualize_embeddable.ts#:~:text=esFilters), [visualize_embeddable.ts](https://github.com/elastic/kibana/tree/master/src/plugins/visualizations/public/embeddable/visualize_embeddable.ts#:~:text=esFilters) | 8.1 | | | [visualize_embeddable.ts](https://github.com/elastic/kibana/tree/master/src/plugins/visualizations/public/embeddable/visualize_embeddable.ts#:~:text=Filter), [visualize_embeddable.ts](https://github.com/elastic/kibana/tree/master/src/plugins/visualizations/public/embeddable/visualize_embeddable.ts#:~:text=Filter), [visualize_embeddable.ts](https://github.com/elastic/kibana/tree/master/src/plugins/visualizations/public/embeddable/visualize_embeddable.ts#:~:text=Filter) | 8.1 | | | [controls_references.ts](https://github.com/elastic/kibana/tree/master/src/plugins/visualizations/public/utils/saved_visualization_references/controls_references.ts#:~:text=INDEX_PATTERN_SAVED_OBJECT_TYPE), [controls_references.ts](https://github.com/elastic/kibana/tree/master/src/plugins/visualizations/public/utils/saved_visualization_references/controls_references.ts#:~:text=INDEX_PATTERN_SAVED_OBJECT_TYPE), [timeseries_references.ts](https://github.com/elastic/kibana/tree/master/src/plugins/visualizations/public/utils/saved_visualization_references/timeseries_references.ts#:~:text=INDEX_PATTERN_SAVED_OBJECT_TYPE), [timeseries_references.ts](https://github.com/elastic/kibana/tree/master/src/plugins/visualizations/public/utils/saved_visualization_references/timeseries_references.ts#:~:text=INDEX_PATTERN_SAVED_OBJECT_TYPE), [visualization_saved_object_migrations.ts](https://github.com/elastic/kibana/tree/master/src/plugins/visualizations/server/migrations/visualization_saved_object_migrations.ts#:~:text=INDEX_PATTERN_SAVED_OBJECT_TYPE), [visualization_saved_object_migrations.ts](https://github.com/elastic/kibana/tree/master/src/plugins/visualizations/server/migrations/visualization_saved_object_migrations.ts#:~:text=INDEX_PATTERN_SAVED_OBJECT_TYPE), [visualization_saved_object_migrations.ts](https://github.com/elastic/kibana/tree/master/src/plugins/visualizations/server/migrations/visualization_saved_object_migrations.ts#:~:text=INDEX_PATTERN_SAVED_OBJECT_TYPE), [visualization_saved_object_migrations.ts](https://github.com/elastic/kibana/tree/master/src/plugins/visualizations/server/migrations/visualization_saved_object_migrations.ts#:~:text=INDEX_PATTERN_SAVED_OBJECT_TYPE), [visualization_saved_object_migrations.ts](https://github.com/elastic/kibana/tree/master/src/plugins/visualizations/server/migrations/visualization_saved_object_migrations.ts#:~:text=INDEX_PATTERN_SAVED_OBJECT_TYPE), [controls_references.ts](https://github.com/elastic/kibana/tree/master/src/plugins/visualizations/public/utils/saved_visualization_references/controls_references.ts#:~:text=INDEX_PATTERN_SAVED_OBJECT_TYPE)+ 8 more | - | -| | [_saved_vis.ts](https://github.com/elastic/kibana/tree/master/src/plugins/visualizations/public/saved_visualizations/_saved_vis.ts#:~:text=IndexPatternsContract), [_saved_vis.ts](https://github.com/elastic/kibana/tree/master/src/plugins/visualizations/public/saved_visualizations/_saved_vis.ts#:~:text=IndexPatternsContract), [_saved_vis.ts](https://github.com/elastic/kibana/tree/master/src/plugins/visualizations/public/saved_visualizations/_saved_vis.ts#:~:text=IndexPatternsContract), [_saved_vis.ts](https://github.com/elastic/kibana/tree/master/src/plugins/visualizations/public/saved_visualizations/_saved_vis.ts#:~:text=IndexPatternsContract) | - | | | [vis.ts](https://github.com/elastic/kibana/tree/master/src/plugins/visualizations/public/vis.ts#:~:text=IndexPattern), [vis.ts](https://github.com/elastic/kibana/tree/master/src/plugins/visualizations/public/vis.ts#:~:text=IndexPattern), [types.ts](https://github.com/elastic/kibana/tree/master/src/plugins/visualizations/public/vis_types/types.ts#:~:text=IndexPattern), [types.ts](https://github.com/elastic/kibana/tree/master/src/plugins/visualizations/public/vis_types/types.ts#:~:text=IndexPattern), [types.ts](https://github.com/elastic/kibana/tree/master/src/plugins/visualizations/public/vis_types/types.ts#:~:text=IndexPattern), [create_vis_embeddable_from_object.ts](https://github.com/elastic/kibana/tree/master/src/plugins/visualizations/public/embeddable/create_vis_embeddable_from_object.ts#:~:text=IndexPattern), [create_vis_embeddable_from_object.ts](https://github.com/elastic/kibana/tree/master/src/plugins/visualizations/public/embeddable/create_vis_embeddable_from_object.ts#:~:text=IndexPattern), [visualize_embeddable.ts](https://github.com/elastic/kibana/tree/master/src/plugins/visualizations/public/embeddable/visualize_embeddable.ts#:~:text=IndexPattern), [visualize_embeddable.ts](https://github.com/elastic/kibana/tree/master/src/plugins/visualizations/public/embeddable/visualize_embeddable.ts#:~:text=IndexPattern), [visualize_embeddable.ts](https://github.com/elastic/kibana/tree/master/src/plugins/visualizations/public/embeddable/visualize_embeddable.ts#:~:text=IndexPattern)+ 10 more | - | | | [visualize_embeddable.ts](https://github.com/elastic/kibana/tree/master/src/plugins/visualizations/public/embeddable/visualize_embeddable.ts#:~:text=Filter), [visualize_embeddable.ts](https://github.com/elastic/kibana/tree/master/src/plugins/visualizations/public/embeddable/visualize_embeddable.ts#:~:text=Filter), [visualize_embeddable.ts](https://github.com/elastic/kibana/tree/master/src/plugins/visualizations/public/embeddable/visualize_embeddable.ts#:~:text=Filter) | 8.1 | | | [vis.ts](https://github.com/elastic/kibana/tree/master/src/plugins/visualizations/public/vis.ts#:~:text=toJSON) | 8.1 | | | [vis.ts](https://github.com/elastic/kibana/tree/master/src/plugins/visualizations/public/vis.ts#:~:text=IndexPattern), [vis.ts](https://github.com/elastic/kibana/tree/master/src/plugins/visualizations/public/vis.ts#:~:text=IndexPattern), [types.ts](https://github.com/elastic/kibana/tree/master/src/plugins/visualizations/public/vis_types/types.ts#:~:text=IndexPattern), [types.ts](https://github.com/elastic/kibana/tree/master/src/plugins/visualizations/public/vis_types/types.ts#:~:text=IndexPattern), [types.ts](https://github.com/elastic/kibana/tree/master/src/plugins/visualizations/public/vis_types/types.ts#:~:text=IndexPattern), [create_vis_embeddable_from_object.ts](https://github.com/elastic/kibana/tree/master/src/plugins/visualizations/public/embeddable/create_vis_embeddable_from_object.ts#:~:text=IndexPattern), [create_vis_embeddable_from_object.ts](https://github.com/elastic/kibana/tree/master/src/plugins/visualizations/public/embeddable/create_vis_embeddable_from_object.ts#:~:text=IndexPattern), [visualize_embeddable.ts](https://github.com/elastic/kibana/tree/master/src/plugins/visualizations/public/embeddable/visualize_embeddable.ts#:~:text=IndexPattern), [visualize_embeddable.ts](https://github.com/elastic/kibana/tree/master/src/plugins/visualizations/public/embeddable/visualize_embeddable.ts#:~:text=IndexPattern), [visualize_embeddable.ts](https://github.com/elastic/kibana/tree/master/src/plugins/visualizations/public/embeddable/visualize_embeddable.ts#:~:text=IndexPattern) | - | | | [visualize_embeddable.ts](https://github.com/elastic/kibana/tree/master/src/plugins/visualizations/public/embeddable/visualize_embeddable.ts#:~:text=Filter), [visualize_embeddable.ts](https://github.com/elastic/kibana/tree/master/src/plugins/visualizations/public/embeddable/visualize_embeddable.ts#:~:text=Filter), [visualize_embeddable.ts](https://github.com/elastic/kibana/tree/master/src/plugins/visualizations/public/embeddable/visualize_embeddable.ts#:~:text=Filter) | 8.1 | -| | [_saved_vis.ts](https://github.com/elastic/kibana/tree/master/src/plugins/visualizations/public/saved_visualizations/_saved_vis.ts#:~:text=__LEGACY), [_saved_vis.ts](https://github.com/elastic/kibana/tree/master/src/plugins/visualizations/public/saved_visualizations/_saved_vis.ts#:~:text=__LEGACY) | - | -| | [find_list_items.ts](https://github.com/elastic/kibana/tree/master/src/plugins/visualizations/public/saved_visualizations/find_list_items.ts#:~:text=SavedObjectLoader), [find_list_items.ts](https://github.com/elastic/kibana/tree/master/src/plugins/visualizations/public/saved_visualizations/find_list_items.ts#:~:text=SavedObjectLoader), [saved_visualizations.ts](https://github.com/elastic/kibana/tree/master/src/plugins/visualizations/public/saved_visualizations/saved_visualizations.ts#:~:text=SavedObjectLoader), [saved_visualizations.ts](https://github.com/elastic/kibana/tree/master/src/plugins/visualizations/public/saved_visualizations/saved_visualizations.ts#:~:text=SavedObjectLoader), [saved_visualizations.ts](https://github.com/elastic/kibana/tree/master/src/plugins/visualizations/public/saved_visualizations/saved_visualizations.ts#:~:text=SavedObjectLoader) | - | -| | [_saved_vis.ts](https://github.com/elastic/kibana/tree/master/src/plugins/visualizations/public/saved_visualizations/_saved_vis.ts#:~:text=SavedObject), [_saved_vis.ts](https://github.com/elastic/kibana/tree/master/src/plugins/visualizations/public/saved_visualizations/_saved_vis.ts#:~:text=SavedObject), [_saved_vis.ts](https://github.com/elastic/kibana/tree/master/src/plugins/visualizations/public/saved_visualizations/_saved_vis.ts#:~:text=SavedObject), [_saved_vis.ts](https://github.com/elastic/kibana/tree/master/src/plugins/visualizations/public/saved_visualizations/_saved_vis.ts#:~:text=SavedObject) | - | -| | [_saved_vis.ts](https://github.com/elastic/kibana/tree/master/src/plugins/visualizations/public/saved_visualizations/_saved_vis.ts#:~:text=SavedObjectClass) | - | diff --git a/api_docs/elastic_apm_generator.json b/api_docs/elastic_apm_generator.json deleted file mode 100644 index 24f11791d92b6..0000000000000 --- a/api_docs/elastic_apm_generator.json +++ /dev/null @@ -1,288 +0,0 @@ -{ - "id": "@elastic/apm-generator", - "client": { - "classes": [], - "functions": [], - "interfaces": [], - "enums": [], - "misc": [], - "objects": [] - }, - "server": { - "classes": [], - "functions": [ - { - "parentPluginId": "@elastic/apm-generator", - "id": "def-server.getBreakdownMetrics", - "type": "Function", - "tags": [], - "label": "getBreakdownMetrics", - "description": [], - "signature": [ - "(events: Partial<{ '@timestamp': number; 'agent.name': string; 'agent.version': string; 'container.id': string; 'ecs.version': string; 'event.outcome': string; 'event.ingested': number; 'host.name': string; 'metricset.name': string; 'observer.version': string; 'observer.version_major': number; 'parent.id': string; 'processor.event': string; 'processor.name': string; 'trace.id': string; 'transaction.name': string; 'transaction.type': string; 'transaction.id': string; 'transaction.duration.us': number; 'transaction.duration.histogram': { values: number[]; counts: number[]; }; 'transaction.sampled': true; 'service.name': string; 'service.environment': string; 'service.node.name': string; 'span.id': string; 'span.name': string; 'span.type': string; 'span.subtype': string; 'span.duration.us': number; 'span.destination.service.name': string; 'span.destination.service.resource': string; 'span.destination.service.type': string; 'span.destination.service.response_time.sum.us': number; 'span.destination.service.response_time.count': number; 'span.self_time.count': number; 'span.self_time.sum.us': number; }>[]) => Partial<{ '@timestamp': number; 'agent.name': string; 'agent.version': string; 'container.id': string; 'ecs.version': string; 'event.outcome': string; 'event.ingested': number; 'host.name': string; 'metricset.name': string; 'observer.version': string; 'observer.version_major': number; 'parent.id': string; 'processor.event': string; 'processor.name': string; 'trace.id': string; 'transaction.name': string; 'transaction.type': string; 'transaction.id': string; 'transaction.duration.us': number; 'transaction.duration.histogram': { values: number[]; counts: number[]; }; 'transaction.sampled': true; 'service.name': string; 'service.environment': string; 'service.node.name': string; 'span.id': string; 'span.name': string; 'span.type': string; 'span.subtype': string; 'span.duration.us': number; 'span.destination.service.name': string; 'span.destination.service.resource': string; 'span.destination.service.type': string; 'span.destination.service.response_time.sum.us': number; 'span.destination.service.response_time.count': number; 'span.self_time.count': number; 'span.self_time.sum.us': number; }>[]" - ], - "path": "packages/elastic-apm-generator/src/lib/utils/get_breakdown_metrics.ts", - "deprecated": false, - "children": [ - { - "parentPluginId": "@elastic/apm-generator", - "id": "def-server.getBreakdownMetrics.$1", - "type": "Array", - "tags": [], - "label": "events", - "description": [], - "signature": [ - "Partial<{ '@timestamp': number; 'agent.name': string; 'agent.version': string; 'container.id': string; 'ecs.version': string; 'event.outcome': string; 'event.ingested': number; 'host.name': string; 'metricset.name': string; 'observer.version': string; 'observer.version_major': number; 'parent.id': string; 'processor.event': string; 'processor.name': string; 'trace.id': string; 'transaction.name': string; 'transaction.type': string; 'transaction.id': string; 'transaction.duration.us': number; 'transaction.duration.histogram': { values: number[]; counts: number[]; }; 'transaction.sampled': true; 'service.name': string; 'service.environment': string; 'service.node.name': string; 'span.id': string; 'span.name': string; 'span.type': string; 'span.subtype': string; 'span.duration.us': number; 'span.destination.service.name': string; 'span.destination.service.resource': string; 'span.destination.service.type': string; 'span.destination.service.response_time.sum.us': number; 'span.destination.service.response_time.count': number; 'span.self_time.count': number; 'span.self_time.sum.us': number; }>[]" - ], - "path": "packages/elastic-apm-generator/src/lib/utils/get_breakdown_metrics.ts", - "deprecated": false, - "isRequired": true - } - ], - "returnComment": [], - "initialIsOpen": false - }, - { - "parentPluginId": "@elastic/apm-generator", - "id": "def-server.getObserverDefaults", - "type": "Function", - "tags": [], - "label": "getObserverDefaults", - "description": [], - "signature": [ - "() => Partial<{ '@timestamp': number; 'agent.name': string; 'agent.version': string; 'container.id': string; 'ecs.version': string; 'event.outcome': string; 'event.ingested': number; 'host.name': string; 'metricset.name': string; 'observer.version': string; 'observer.version_major': number; 'parent.id': string; 'processor.event': string; 'processor.name': string; 'trace.id': string; 'transaction.name': string; 'transaction.type': string; 'transaction.id': string; 'transaction.duration.us': number; 'transaction.duration.histogram': { values: number[]; counts: number[]; }; 'transaction.sampled': true; 'service.name': string; 'service.environment': string; 'service.node.name': string; 'span.id': string; 'span.name': string; 'span.type': string; 'span.subtype': string; 'span.duration.us': number; 'span.destination.service.name': string; 'span.destination.service.resource': string; 'span.destination.service.type': string; 'span.destination.service.response_time.sum.us': number; 'span.destination.service.response_time.count': number; 'span.self_time.count': number; 'span.self_time.sum.us': number; }>" - ], - "path": "packages/elastic-apm-generator/src/lib/defaults/get_observer_defaults.ts", - "deprecated": false, - "children": [], - "returnComment": [], - "initialIsOpen": false - }, - { - "parentPluginId": "@elastic/apm-generator", - "id": "def-server.getSpanDestinationMetrics", - "type": "Function", - "tags": [], - "label": "getSpanDestinationMetrics", - "description": [], - "signature": [ - "(events: Partial<{ '@timestamp': number; 'agent.name': string; 'agent.version': string; 'container.id': string; 'ecs.version': string; 'event.outcome': string; 'event.ingested': number; 'host.name': string; 'metricset.name': string; 'observer.version': string; 'observer.version_major': number; 'parent.id': string; 'processor.event': string; 'processor.name': string; 'trace.id': string; 'transaction.name': string; 'transaction.type': string; 'transaction.id': string; 'transaction.duration.us': number; 'transaction.duration.histogram': { values: number[]; counts: number[]; }; 'transaction.sampled': true; 'service.name': string; 'service.environment': string; 'service.node.name': string; 'span.id': string; 'span.name': string; 'span.type': string; 'span.subtype': string; 'span.duration.us': number; 'span.destination.service.name': string; 'span.destination.service.resource': string; 'span.destination.service.type': string; 'span.destination.service.response_time.sum.us': number; 'span.destination.service.response_time.count': number; 'span.self_time.count': number; 'span.self_time.sum.us': number; }>[]) => { \"metricset.name\": string; 'span.destination.service.response_time.sum.us': number; 'span.destination.service.response_time.count': number; '@timestamp'?: number | undefined; 'agent.name'?: string | undefined; 'agent.version'?: string | undefined; 'container.id'?: string | undefined; 'ecs.version'?: string | undefined; 'event.outcome'?: string | undefined; 'event.ingested'?: number | undefined; 'host.name'?: string | undefined; 'observer.version'?: string | undefined; 'observer.version_major'?: number | undefined; 'parent.id'?: string | undefined; 'processor.event'?: string | undefined; 'processor.name'?: string | undefined; 'trace.id'?: string | undefined; 'transaction.name'?: string | undefined; 'transaction.type'?: string | undefined; 'transaction.id'?: string | undefined; 'transaction.duration.us'?: number | undefined; 'transaction.duration.histogram'?: { values: number[]; counts: number[]; } | undefined; 'transaction.sampled'?: true | undefined; 'service.name'?: string | undefined; 'service.environment'?: string | undefined; 'service.node.name'?: string | undefined; 'span.id'?: string | undefined; 'span.name'?: string | undefined; 'span.type'?: string | undefined; 'span.subtype'?: string | undefined; 'span.duration.us'?: number | undefined; 'span.destination.service.name'?: string | undefined; 'span.destination.service.resource'?: string | undefined; 'span.destination.service.type'?: string | undefined; 'span.self_time.count'?: number | undefined; 'span.self_time.sum.us'?: number | undefined; }[]" - ], - "path": "packages/elastic-apm-generator/src/lib/utils/get_span_destination_metrics.ts", - "deprecated": false, - "children": [ - { - "parentPluginId": "@elastic/apm-generator", - "id": "def-server.getSpanDestinationMetrics.$1", - "type": "Array", - "tags": [], - "label": "events", - "description": [], - "signature": [ - "Partial<{ '@timestamp': number; 'agent.name': string; 'agent.version': string; 'container.id': string; 'ecs.version': string; 'event.outcome': string; 'event.ingested': number; 'host.name': string; 'metricset.name': string; 'observer.version': string; 'observer.version_major': number; 'parent.id': string; 'processor.event': string; 'processor.name': string; 'trace.id': string; 'transaction.name': string; 'transaction.type': string; 'transaction.id': string; 'transaction.duration.us': number; 'transaction.duration.histogram': { values: number[]; counts: number[]; }; 'transaction.sampled': true; 'service.name': string; 'service.environment': string; 'service.node.name': string; 'span.id': string; 'span.name': string; 'span.type': string; 'span.subtype': string; 'span.duration.us': number; 'span.destination.service.name': string; 'span.destination.service.resource': string; 'span.destination.service.type': string; 'span.destination.service.response_time.sum.us': number; 'span.destination.service.response_time.count': number; 'span.self_time.count': number; 'span.self_time.sum.us': number; }>[]" - ], - "path": "packages/elastic-apm-generator/src/lib/utils/get_span_destination_metrics.ts", - "deprecated": false, - "isRequired": true - } - ], - "returnComment": [], - "initialIsOpen": false - }, - { - "parentPluginId": "@elastic/apm-generator", - "id": "def-server.getTransactionMetrics", - "type": "Function", - "tags": [], - "label": "getTransactionMetrics", - "description": [], - "signature": [ - "(events: Partial<{ '@timestamp': number; 'agent.name': string; 'agent.version': string; 'container.id': string; 'ecs.version': string; 'event.outcome': string; 'event.ingested': number; 'host.name': string; 'metricset.name': string; 'observer.version': string; 'observer.version_major': number; 'parent.id': string; 'processor.event': string; 'processor.name': string; 'trace.id': string; 'transaction.name': string; 'transaction.type': string; 'transaction.id': string; 'transaction.duration.us': number; 'transaction.duration.histogram': { values: number[]; counts: number[]; }; 'transaction.sampled': true; 'service.name': string; 'service.environment': string; 'service.node.name': string; 'span.id': string; 'span.name': string; 'span.type': string; 'span.subtype': string; 'span.duration.us': number; 'span.destination.service.name': string; 'span.destination.service.resource': string; 'span.destination.service.type': string; 'span.destination.service.response_time.sum.us': number; 'span.destination.service.response_time.count': number; 'span.self_time.count': number; 'span.self_time.sum.us': number; }>[]) => { 'transaction.duration.histogram': { values: number[]; counts: number[]; }; _doc_count: number; '@timestamp'?: number | undefined; 'agent.name'?: string | undefined; 'agent.version'?: string | undefined; 'container.id'?: string | undefined; 'ecs.version'?: string | undefined; 'event.outcome'?: string | undefined; 'event.ingested'?: number | undefined; 'host.name'?: string | undefined; 'metricset.name'?: string | undefined; 'observer.version'?: string | undefined; 'observer.version_major'?: number | undefined; 'parent.id'?: string | undefined; 'processor.event'?: string | undefined; 'processor.name'?: string | undefined; 'trace.id'?: string | undefined; 'transaction.name'?: string | undefined; 'transaction.type'?: string | undefined; 'transaction.id'?: string | undefined; 'transaction.duration.us'?: number | undefined; 'transaction.sampled'?: true | undefined; 'service.name'?: string | undefined; 'service.environment'?: string | undefined; 'service.node.name'?: string | undefined; 'span.id'?: string | undefined; 'span.name'?: string | undefined; 'span.type'?: string | undefined; 'span.subtype'?: string | undefined; 'span.duration.us'?: number | undefined; 'span.destination.service.name'?: string | undefined; 'span.destination.service.resource'?: string | undefined; 'span.destination.service.type'?: string | undefined; 'span.destination.service.response_time.sum.us'?: number | undefined; 'span.destination.service.response_time.count'?: number | undefined; 'span.self_time.count'?: number | undefined; 'span.self_time.sum.us'?: number | undefined; }[]" - ], - "path": "packages/elastic-apm-generator/src/lib/utils/get_transaction_metrics.ts", - "deprecated": false, - "children": [ - { - "parentPluginId": "@elastic/apm-generator", - "id": "def-server.getTransactionMetrics.$1", - "type": "Array", - "tags": [], - "label": "events", - "description": [], - "signature": [ - "Partial<{ '@timestamp': number; 'agent.name': string; 'agent.version': string; 'container.id': string; 'ecs.version': string; 'event.outcome': string; 'event.ingested': number; 'host.name': string; 'metricset.name': string; 'observer.version': string; 'observer.version_major': number; 'parent.id': string; 'processor.event': string; 'processor.name': string; 'trace.id': string; 'transaction.name': string; 'transaction.type': string; 'transaction.id': string; 'transaction.duration.us': number; 'transaction.duration.histogram': { values: number[]; counts: number[]; }; 'transaction.sampled': true; 'service.name': string; 'service.environment': string; 'service.node.name': string; 'span.id': string; 'span.name': string; 'span.type': string; 'span.subtype': string; 'span.duration.us': number; 'span.destination.service.name': string; 'span.destination.service.resource': string; 'span.destination.service.type': string; 'span.destination.service.response_time.sum.us': number; 'span.destination.service.response_time.count': number; 'span.self_time.count': number; 'span.self_time.sum.us': number; }>[]" - ], - "path": "packages/elastic-apm-generator/src/lib/utils/get_transaction_metrics.ts", - "deprecated": false, - "isRequired": true - } - ], - "returnComment": [], - "initialIsOpen": false - }, - { - "parentPluginId": "@elastic/apm-generator", - "id": "def-server.service", - "type": "Function", - "tags": [], - "label": "service", - "description": [], - "signature": [ - "(name: string, environment: string, agentName: string) => ", - "Service" - ], - "path": "packages/elastic-apm-generator/src/lib/service.ts", - "deprecated": false, - "children": [ - { - "parentPluginId": "@elastic/apm-generator", - "id": "def-server.service.$1", - "type": "string", - "tags": [], - "label": "name", - "description": [], - "signature": [ - "string" - ], - "path": "packages/elastic-apm-generator/src/lib/service.ts", - "deprecated": false, - "isRequired": true - }, - { - "parentPluginId": "@elastic/apm-generator", - "id": "def-server.service.$2", - "type": "string", - "tags": [], - "label": "environment", - "description": [], - "signature": [ - "string" - ], - "path": "packages/elastic-apm-generator/src/lib/service.ts", - "deprecated": false, - "isRequired": true - }, - { - "parentPluginId": "@elastic/apm-generator", - "id": "def-server.service.$3", - "type": "string", - "tags": [], - "label": "agentName", - "description": [], - "signature": [ - "string" - ], - "path": "packages/elastic-apm-generator/src/lib/service.ts", - "deprecated": false, - "isRequired": true - } - ], - "returnComment": [], - "initialIsOpen": false - }, - { - "parentPluginId": "@elastic/apm-generator", - "id": "def-server.timerange", - "type": "Function", - "tags": [], - "label": "timerange", - "description": [], - "signature": [ - "(from: number, to: number) => ", - "Timerange" - ], - "path": "packages/elastic-apm-generator/src/lib/timerange.ts", - "deprecated": false, - "children": [ - { - "parentPluginId": "@elastic/apm-generator", - "id": "def-server.timerange.$1", - "type": "number", - "tags": [], - "label": "from", - "description": [], - "signature": [ - "number" - ], - "path": "packages/elastic-apm-generator/src/lib/timerange.ts", - "deprecated": false, - "isRequired": true - }, - { - "parentPluginId": "@elastic/apm-generator", - "id": "def-server.timerange.$2", - "type": "number", - "tags": [], - "label": "to", - "description": [], - "signature": [ - "number" - ], - "path": "packages/elastic-apm-generator/src/lib/timerange.ts", - "deprecated": false, - "isRequired": true - } - ], - "returnComment": [], - "initialIsOpen": false - }, - { - "parentPluginId": "@elastic/apm-generator", - "id": "def-server.toElasticsearchOutput", - "type": "Function", - "tags": [], - "label": "toElasticsearchOutput", - "description": [], - "signature": [ - "(events: Partial<{ '@timestamp': number; 'agent.name': string; 'agent.version': string; 'container.id': string; 'ecs.version': string; 'event.outcome': string; 'event.ingested': number; 'host.name': string; 'metricset.name': string; 'observer.version': string; 'observer.version_major': number; 'parent.id': string; 'processor.event': string; 'processor.name': string; 'trace.id': string; 'transaction.name': string; 'transaction.type': string; 'transaction.id': string; 'transaction.duration.us': number; 'transaction.duration.histogram': { values: number[]; counts: number[]; }; 'transaction.sampled': true; 'service.name': string; 'service.environment': string; 'service.node.name': string; 'span.id': string; 'span.name': string; 'span.type': string; 'span.subtype': string; 'span.duration.us': number; 'span.destination.service.name': string; 'span.destination.service.resource': string; 'span.destination.service.type': string; 'span.destination.service.response_time.sum.us': number; 'span.destination.service.response_time.count': number; 'span.self_time.count': number; 'span.self_time.sum.us': number; }>[], versionOverride: string | undefined) => { _index: string; _source: {}; }[]" - ], - "path": "packages/elastic-apm-generator/src/lib/output/to_elasticsearch_output.ts", - "deprecated": false, - "children": [ - { - "parentPluginId": "@elastic/apm-generator", - "id": "def-server.toElasticsearchOutput.$1", - "type": "Array", - "tags": [], - "label": "events", - "description": [], - "signature": [ - "Partial<{ '@timestamp': number; 'agent.name': string; 'agent.version': string; 'container.id': string; 'ecs.version': string; 'event.outcome': string; 'event.ingested': number; 'host.name': string; 'metricset.name': string; 'observer.version': string; 'observer.version_major': number; 'parent.id': string; 'processor.event': string; 'processor.name': string; 'trace.id': string; 'transaction.name': string; 'transaction.type': string; 'transaction.id': string; 'transaction.duration.us': number; 'transaction.duration.histogram': { values: number[]; counts: number[]; }; 'transaction.sampled': true; 'service.name': string; 'service.environment': string; 'service.node.name': string; 'span.id': string; 'span.name': string; 'span.type': string; 'span.subtype': string; 'span.duration.us': number; 'span.destination.service.name': string; 'span.destination.service.resource': string; 'span.destination.service.type': string; 'span.destination.service.response_time.sum.us': number; 'span.destination.service.response_time.count': number; 'span.self_time.count': number; 'span.self_time.sum.us': number; }>[]" - ], - "path": "packages/elastic-apm-generator/src/lib/output/to_elasticsearch_output.ts", - "deprecated": false, - "isRequired": true - }, - { - "parentPluginId": "@elastic/apm-generator", - "id": "def-server.toElasticsearchOutput.$2", - "type": "string", - "tags": [], - "label": "versionOverride", - "description": [], - "signature": [ - "string | undefined" - ], - "path": "packages/elastic-apm-generator/src/lib/output/to_elasticsearch_output.ts", - "deprecated": false, - "isRequired": false - } - ], - "returnComment": [], - "initialIsOpen": false - } - ], - "interfaces": [], - "enums": [], - "misc": [], - "objects": [] - }, - "common": { - "classes": [], - "functions": [], - "interfaces": [], - "enums": [], - "misc": [], - "objects": [] - } -} \ No newline at end of file diff --git a/api_docs/elastic_apm_synthtrace.json b/api_docs/elastic_apm_synthtrace.json new file mode 100644 index 0000000000000..13d950c53a8df --- /dev/null +++ b/api_docs/elastic_apm_synthtrace.json @@ -0,0 +1,321 @@ +{ + "id": "@elastic/apm-synthtrace", + "client": { + "classes": [], + "functions": [], + "interfaces": [], + "enums": [], + "misc": [], + "objects": [] + }, + "server": { + "classes": [], + "functions": [ + { + "parentPluginId": "@elastic/apm-synthtrace", + "id": "def-server.getBreakdownMetrics", + "type": "Function", + "tags": [], + "label": "getBreakdownMetrics", + "description": [], + "signature": [ + "(events: ", + "Fields", + "[]) => ", + "Fields", + "[]" + ], + "path": "packages/elastic-apm-synthtrace/src/lib/utils/get_breakdown_metrics.ts", + "deprecated": false, + "children": [ + { + "parentPluginId": "@elastic/apm-synthtrace", + "id": "def-server.getBreakdownMetrics.$1", + "type": "Array", + "tags": [], + "label": "events", + "description": [], + "signature": [ + "Fields", + "[]" + ], + "path": "packages/elastic-apm-synthtrace/src/lib/utils/get_breakdown_metrics.ts", + "deprecated": false, + "isRequired": true + } + ], + "returnComment": [], + "initialIsOpen": false + }, + { + "parentPluginId": "@elastic/apm-synthtrace", + "id": "def-server.getObserverDefaults", + "type": "Function", + "tags": [], + "label": "getObserverDefaults", + "description": [], + "signature": [ + "() => ", + "Fields" + ], + "path": "packages/elastic-apm-synthtrace/src/lib/defaults/get_observer_defaults.ts", + "deprecated": false, + "children": [], + "returnComment": [], + "initialIsOpen": false + }, + { + "parentPluginId": "@elastic/apm-synthtrace", + "id": "def-server.getSpanDestinationMetrics", + "type": "Function", + "tags": [], + "label": "getSpanDestinationMetrics", + "description": [], + "signature": [ + "(events: ", + "Fields", + "[]) => { \"metricset.name\": string; 'span.destination.service.response_time.sum.us': number; 'span.destination.service.response_time.count': number; '@timestamp'?: number | undefined; 'agent.name'?: string | undefined; 'agent.version'?: string | undefined; 'container.id'?: string | undefined; 'ecs.version'?: string | undefined; 'event.outcome'?: string | undefined; 'event.ingested'?: number | undefined; 'error.id'?: string | undefined; 'error.exception'?: ", + "Exception", + "[] | undefined; 'error.grouping_name'?: string | undefined; 'error.grouping_key'?: string | undefined; 'host.name'?: string | undefined; 'observer.version'?: string | undefined; 'observer.version_major'?: number | undefined; 'parent.id'?: string | undefined; 'processor.event'?: string | undefined; 'processor.name'?: string | undefined; 'trace.id'?: string | undefined; 'transaction.name'?: string | undefined; 'transaction.type'?: string | undefined; 'transaction.id'?: string | undefined; 'transaction.duration.us'?: number | undefined; 'transaction.duration.histogram'?: { values: number[]; counts: number[]; } | undefined; 'transaction.sampled'?: true | undefined; 'service.name'?: string | undefined; 'service.environment'?: string | undefined; 'service.node.name'?: string | undefined; 'span.id'?: string | undefined; 'span.name'?: string | undefined; 'span.type'?: string | undefined; 'span.subtype'?: string | undefined; 'span.duration.us'?: number | undefined; 'span.destination.service.name'?: string | undefined; 'span.destination.service.resource'?: string | undefined; 'span.destination.service.type'?: string | undefined; 'span.self_time.count'?: number | undefined; 'span.self_time.sum.us'?: number | undefined; 'system.process.memory.size'?: number | undefined; 'system.memory.actual.free'?: number | undefined; 'system.memory.total'?: number | undefined; 'system.cpu.total.norm.pct'?: number | undefined; 'system.process.memory.rss.bytes'?: number | undefined; 'system.process.cpu.total.norm.pct'?: number | undefined; }[]" + ], + "path": "packages/elastic-apm-synthtrace/src/lib/utils/get_span_destination_metrics.ts", + "deprecated": false, + "children": [ + { + "parentPluginId": "@elastic/apm-synthtrace", + "id": "def-server.getSpanDestinationMetrics.$1", + "type": "Array", + "tags": [], + "label": "events", + "description": [], + "signature": [ + "Fields", + "[]" + ], + "path": "packages/elastic-apm-synthtrace/src/lib/utils/get_span_destination_metrics.ts", + "deprecated": false, + "isRequired": true + } + ], + "returnComment": [], + "initialIsOpen": false + }, + { + "parentPluginId": "@elastic/apm-synthtrace", + "id": "def-server.getTransactionMetrics", + "type": "Function", + "tags": [], + "label": "getTransactionMetrics", + "description": [], + "signature": [ + "(events: ", + "Fields", + "[]) => { 'transaction.duration.histogram': { values: number[]; counts: number[]; }; _doc_count: number; '@timestamp'?: number | undefined; 'agent.name'?: string | undefined; 'agent.version'?: string | undefined; 'container.id'?: string | undefined; 'ecs.version'?: string | undefined; 'event.outcome'?: string | undefined; 'event.ingested'?: number | undefined; 'error.id'?: string | undefined; 'error.exception'?: ", + "Exception", + "[] | undefined; 'error.grouping_name'?: string | undefined; 'error.grouping_key'?: string | undefined; 'host.name'?: string | undefined; 'metricset.name'?: string | undefined; 'observer.version'?: string | undefined; 'observer.version_major'?: number | undefined; 'parent.id'?: string | undefined; 'processor.event'?: string | undefined; 'processor.name'?: string | undefined; 'trace.id'?: string | undefined; 'transaction.name'?: string | undefined; 'transaction.type'?: string | undefined; 'transaction.id'?: string | undefined; 'transaction.duration.us'?: number | undefined; 'transaction.sampled'?: true | undefined; 'service.name'?: string | undefined; 'service.environment'?: string | undefined; 'service.node.name'?: string | undefined; 'span.id'?: string | undefined; 'span.name'?: string | undefined; 'span.type'?: string | undefined; 'span.subtype'?: string | undefined; 'span.duration.us'?: number | undefined; 'span.destination.service.name'?: string | undefined; 'span.destination.service.resource'?: string | undefined; 'span.destination.service.type'?: string | undefined; 'span.destination.service.response_time.sum.us'?: number | undefined; 'span.destination.service.response_time.count'?: number | undefined; 'span.self_time.count'?: number | undefined; 'span.self_time.sum.us'?: number | undefined; 'system.process.memory.size'?: number | undefined; 'system.memory.actual.free'?: number | undefined; 'system.memory.total'?: number | undefined; 'system.cpu.total.norm.pct'?: number | undefined; 'system.process.memory.rss.bytes'?: number | undefined; 'system.process.cpu.total.norm.pct'?: number | undefined; }[]" + ], + "path": "packages/elastic-apm-synthtrace/src/lib/utils/get_transaction_metrics.ts", + "deprecated": false, + "children": [ + { + "parentPluginId": "@elastic/apm-synthtrace", + "id": "def-server.getTransactionMetrics.$1", + "type": "Array", + "tags": [], + "label": "events", + "description": [], + "signature": [ + "Fields", + "[]" + ], + "path": "packages/elastic-apm-synthtrace/src/lib/utils/get_transaction_metrics.ts", + "deprecated": false, + "isRequired": true + } + ], + "returnComment": [], + "initialIsOpen": false + }, + { + "parentPluginId": "@elastic/apm-synthtrace", + "id": "def-server.service", + "type": "Function", + "tags": [], + "label": "service", + "description": [], + "signature": [ + "(name: string, environment: string, agentName: string) => ", + "Service" + ], + "path": "packages/elastic-apm-synthtrace/src/lib/service.ts", + "deprecated": false, + "children": [ + { + "parentPluginId": "@elastic/apm-synthtrace", + "id": "def-server.service.$1", + "type": "string", + "tags": [], + "label": "name", + "description": [], + "signature": [ + "string" + ], + "path": "packages/elastic-apm-synthtrace/src/lib/service.ts", + "deprecated": false, + "isRequired": true + }, + { + "parentPluginId": "@elastic/apm-synthtrace", + "id": "def-server.service.$2", + "type": "string", + "tags": [], + "label": "environment", + "description": [], + "signature": [ + "string" + ], + "path": "packages/elastic-apm-synthtrace/src/lib/service.ts", + "deprecated": false, + "isRequired": true + }, + { + "parentPluginId": "@elastic/apm-synthtrace", + "id": "def-server.service.$3", + "type": "string", + "tags": [], + "label": "agentName", + "description": [], + "signature": [ + "string" + ], + "path": "packages/elastic-apm-synthtrace/src/lib/service.ts", + "deprecated": false, + "isRequired": true + } + ], + "returnComment": [], + "initialIsOpen": false + }, + { + "parentPluginId": "@elastic/apm-synthtrace", + "id": "def-server.timerange", + "type": "Function", + "tags": [], + "label": "timerange", + "description": [], + "signature": [ + "(from: number, to: number) => ", + "Timerange" + ], + "path": "packages/elastic-apm-synthtrace/src/lib/timerange.ts", + "deprecated": false, + "children": [ + { + "parentPluginId": "@elastic/apm-synthtrace", + "id": "def-server.timerange.$1", + "type": "number", + "tags": [], + "label": "from", + "description": [], + "signature": [ + "number" + ], + "path": "packages/elastic-apm-synthtrace/src/lib/timerange.ts", + "deprecated": false, + "isRequired": true + }, + { + "parentPluginId": "@elastic/apm-synthtrace", + "id": "def-server.timerange.$2", + "type": "number", + "tags": [], + "label": "to", + "description": [], + "signature": [ + "number" + ], + "path": "packages/elastic-apm-synthtrace/src/lib/timerange.ts", + "deprecated": false, + "isRequired": true + } + ], + "returnComment": [], + "initialIsOpen": false + }, + { + "parentPluginId": "@elastic/apm-synthtrace", + "id": "def-server.toElasticsearchOutput", + "type": "Function", + "tags": [], + "label": "toElasticsearchOutput", + "description": [], + "signature": [ + "({\n events,\n writeTargets,\n}: { events: ", + "Fields", + "[]; writeTargets: ", + "ElasticsearchOutputWriteTargets", + "; }) => ", + "ElasticsearchOutput", + "[]" + ], + "path": "packages/elastic-apm-synthtrace/src/lib/output/to_elasticsearch_output.ts", + "deprecated": false, + "children": [ + { + "parentPluginId": "@elastic/apm-synthtrace", + "id": "def-server.toElasticsearchOutput.$1", + "type": "Object", + "tags": [], + "label": "{\n events,\n writeTargets,\n}", + "description": [], + "path": "packages/elastic-apm-synthtrace/src/lib/output/to_elasticsearch_output.ts", + "deprecated": false, + "children": [ + { + "parentPluginId": "@elastic/apm-synthtrace", + "id": "def-server.toElasticsearchOutput.$1.events", + "type": "Array", + "tags": [], + "label": "events", + "description": [], + "signature": [ + "Fields", + "[]" + ], + "path": "packages/elastic-apm-synthtrace/src/lib/output/to_elasticsearch_output.ts", + "deprecated": false + }, + { + "parentPluginId": "@elastic/apm-synthtrace", + "id": "def-server.toElasticsearchOutput.$1.writeTargets", + "type": "Object", + "tags": [], + "label": "writeTargets", + "description": [], + "signature": [ + "ElasticsearchOutputWriteTargets" + ], + "path": "packages/elastic-apm-synthtrace/src/lib/output/to_elasticsearch_output.ts", + "deprecated": false + } + ] + } + ], + "returnComment": [], + "initialIsOpen": false + } + ], + "interfaces": [], + "enums": [], + "misc": [], + "objects": [] + }, + "common": { + "classes": [], + "functions": [], + "interfaces": [], + "enums": [], + "misc": [], + "objects": [] + } +} \ No newline at end of file diff --git a/api_docs/elastic_apm_generator.mdx b/api_docs/elastic_apm_synthtrace.mdx similarity index 63% rename from api_docs/elastic_apm_generator.mdx rename to api_docs/elastic_apm_synthtrace.mdx index 4c95050b09c28..b41afe6c7357c 100644 --- a/api_docs/elastic_apm_generator.mdx +++ b/api_docs/elastic_apm_synthtrace.mdx @@ -1,14 +1,14 @@ --- -id: kibElasticApmGeneratorPluginApi -slug: /kibana-dev-docs/api/elastic-apm-generator -title: "@elastic/apm-generator" +id: kibElasticApmSynthtracePluginApi +slug: /kibana-dev-docs/api/elastic-apm-synthtrace +title: "@elastic/apm-synthtrace" image: https://source.unsplash.com/400x175/?github -summary: API docs for the @elastic/apm-generator plugin +summary: API docs for the @elastic/apm-synthtrace plugin date: 2020-11-16 -tags: ['contributor', 'dev', 'apidocs', 'kibana', '@elastic/apm-generator'] +tags: ['contributor', 'dev', 'apidocs', 'kibana', '@elastic/apm-synthtrace'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- -import elasticApmGeneratorObj from './elastic_apm_generator.json'; +import elasticApmSynthtraceObj from './elastic_apm_synthtrace.json'; Elastic APM trace data generator @@ -18,10 +18,10 @@ Contact [Owner missing] for questions regarding this plugin. | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 17 | 0 | 17 | 2 | +| 18 | 0 | 18 | 6 | ## Server ### Functions - + diff --git a/api_docs/plugin_directory.mdx b/api_docs/plugin_directory.mdx index 19e3bc08a5361..d23a52b07a1e3 100644 --- a/api_docs/plugin_directory.mdx +++ b/api_docs/plugin_directory.mdx @@ -18,7 +18,7 @@ warning: This document is auto-generated and is meant to be viewed inside our ex | API Count | Any Count | Missing comments | Missing exports | |--------------|----------|-----------------|--------| -| 24459 | 276 | 19826 | 1583 | +| 24503 | 264 | 19863 | 1594 | ## Plugin Directory @@ -26,7 +26,7 @@ warning: This document is auto-generated and is meant to be viewed inside our ex |--------------|----------------|-----------|--------------|----------|---------------|--------| | | [Kibana Alerting](https://github.com/orgs/elastic/teams/kibana-alerting-services) | - | 125 | 0 | 125 | 8 | | | [Vis Editors](https://github.com/orgs/elastic/teams/kibana-vis-editors) | - | 23 | 0 | 22 | 1 | -| | [Kibana Alerting](https://github.com/orgs/elastic/teams/kibana-alerting-services) | - | 257 | 0 | 249 | 17 | +| | [Kibana Alerting](https://github.com/orgs/elastic/teams/kibana-alerting-services) | - | 258 | 0 | 250 | 17 | | | [APM UI](https://github.com/orgs/elastic/teams/apm-ui) | The user interface for Elastic APM | 39 | 0 | 39 | 37 | | | [Kibana Core](https://github.com/orgs/elastic/teams/kibana-core) | - | 9 | 0 | 9 | 0 | | | [App Services](https://github.com/orgs/elastic/teams/kibana-app-services) | Considering using bfetch capabilities when fetching large amounts of data. This services supports batching HTTP requests and streaming responses back. | 76 | 1 | 67 | 2 | @@ -34,18 +34,18 @@ warning: This document is auto-generated and is meant to be viewed inside our ex | | [Security Solution Threat Hunting](https://github.com/orgs/elastic/teams/security-threat-hunting) | The Case management system in Kibana | 476 | 0 | 432 | 14 | | | [Vis Editors](https://github.com/orgs/elastic/teams/kibana-vis-editors) | - | 285 | 4 | 253 | 3 | | | [Kibana Core](https://github.com/orgs/elastic/teams/kibana-core) | - | 22 | 0 | 22 | 0 | -| | [Stack Management](https://github.com/orgs/elastic/teams/kibana-stack-management) | - | 9 | 0 | 9 | 1 | -| | [Kibana Core](https://github.com/orgs/elastic/teams/kibana-core) | - | 2298 | 27 | 1018 | 29 | +| | [Stack Management](https://github.com/orgs/elastic/teams/kibana-stack-management) | - | 13 | 0 | 13 | 1 | +| | [Kibana Core](https://github.com/orgs/elastic/teams/kibana-core) | - | 2304 | 27 | 1023 | 29 | | crossClusterReplication | [Stack Management](https://github.com/orgs/elastic/teams/kibana-stack-management) | - | 0 | 0 | 0 | 0 | -| | [Fleet](https://github.com/orgs/elastic/teams/fleet) | Add custom data integrations so they can be displayed in the Fleet integrations app | 91 | 1 | 75 | 1 | -| | [Kibana Presentation](https://github.com/orgs/elastic/teams/kibana-presentation) | Adds the Dashboard app to Kibana | 145 | 1 | 132 | 10 | +| | [Fleet](https://github.com/orgs/elastic/teams/fleet) | Add custom data integrations so they can be displayed in the Fleet integrations app | 100 | 1 | 84 | 1 | +| | [Kibana Presentation](https://github.com/orgs/elastic/teams/kibana-presentation) | Adds the Dashboard app to Kibana | 147 | 1 | 134 | 10 | | | [App Services](https://github.com/orgs/elastic/teams/kibana-app-services) | - | 51 | 0 | 50 | 0 | -| | [App Services](https://github.com/orgs/elastic/teams/kibana-app-services) | Data services are useful for searching and querying data from Elasticsearch. Helpful utilities include: a re-usable react query bar, KQL autocomplete, async search, Data Views (Index Patterns) and field formatters. | 3193 | 43 | 2807 | 48 | +| | [App Services](https://github.com/orgs/elastic/teams/kibana-app-services) | Data services are useful for searching and querying data from Elasticsearch. Helpful utilities include: a re-usable react query bar, KQL autocomplete, async search, Data Views (Index Patterns) and field formatters. | 3238 | 40 | 2848 | 48 | | | [App Services](https://github.com/orgs/elastic/teams/kibana-app-services) | Enhanced data plugin. (See src/plugins/data.) Enhances the main data plugin with a search session management UI. Includes a reusable search session indicator component to use in other applications. Exposes routes for managing search sessions. Includes a service that monitors, updates, and cleans up search session saved objects. | 16 | 0 | 16 | 2 | -| | [App Services](https://github.com/orgs/elastic/teams/kibana-app-services) | Data services are useful for searching and querying data from Elasticsearch. Helpful utilities include: a re-usable react query bar, KQL autocomplete, async search, Data Views (Index Patterns) and field formatters. | 683 | 6 | 541 | 5 | -| | [Machine Learning UI](https://github.com/orgs/elastic/teams/ml-ui) | The Data Visualizer tools help you understand your data, by analyzing the metrics and fields in a log file or an existing Elasticsearch index. | 80 | 5 | 80 | 0 | +| | [App Services](https://github.com/orgs/elastic/teams/kibana-app-services) | Data services are useful for searching and querying data from Elasticsearch. Helpful utilities include: a re-usable react query bar, KQL autocomplete, async search, Data Views (Index Patterns) and field formatters. | 668 | 5 | 526 | 5 | +| | [Machine Learning UI](https://github.com/orgs/elastic/teams/ml-ui) | The Data Visualizer tools help you understand your data, by analyzing the metrics and fields in a log file or an existing Elasticsearch index. | 84 | 5 | 84 | 0 | | | [Stack Management](https://github.com/orgs/elastic/teams/kibana-stack-management) | - | 10 | 0 | 8 | 2 | -| | [Data Discovery](https://github.com/orgs/elastic/teams/kibana-data-discovery) | This plugin contains the Discover application and the saved search embeddable. | 103 | 0 | 77 | 7 | +| | [Data Discovery](https://github.com/orgs/elastic/teams/kibana-data-discovery) | This plugin contains the Discover application and the saved search embeddable. | 84 | 0 | 58 | 7 | | | [Data Discovery](https://github.com/orgs/elastic/teams/kibana-data-discovery) | - | 37 | 0 | 35 | 2 | | | [App Services](https://github.com/orgs/elastic/teams/kibana-app-services) | Adds embeddables service to Kibana | 469 | 5 | 393 | 3 | | | [App Services](https://github.com/orgs/elastic/teams/kibana-app-services) | Extends embeddable plugin with more functionality | 14 | 0 | 14 | 0 | @@ -61,17 +61,17 @@ warning: This document is auto-generated and is meant to be viewed inside our ex | | [Kibana Presentation](https://github.com/orgs/elastic/teams/kibana-presentation) | Adds 'revealImage' function and renderer to expressions | 12 | 0 | 12 | 3 | | | [Kibana Presentation](https://github.com/orgs/elastic/teams/kibana-presentation) | Adds 'shape' function and renderer to expressions | 143 | 0 | 143 | 0 | | | [Vis Editors](https://github.com/orgs/elastic/teams/kibana-vis-editors) | Expression Tagcloud plugin adds a `tagcloud` renderer and function to the expression plugin. The renderer will display the `Wordcloud` chart. | 5 | 0 | 5 | 0 | -| | [App Services](https://github.com/orgs/elastic/teams/kibana-app-services) | Adds expression runtime to Kibana | 2086 | 27 | 1640 | 4 | +| | [App Services](https://github.com/orgs/elastic/teams/kibana-app-services) | Adds expression runtime to Kibana | 2092 | 27 | 1646 | 3 | | | [Kibana Core](https://github.com/orgs/elastic/teams/kibana-core) | - | 216 | 0 | 98 | 2 | -| | [App Services](https://github.com/orgs/elastic/teams/kibana-app-services) | Index pattern fields and ambiguous values formatters | 288 | 7 | 250 | 3 | +| | [App Services](https://github.com/orgs/elastic/teams/kibana-app-services) | Index pattern fields and ambiguous values formatters | 284 | 7 | 246 | 3 | | | [Machine Learning UI](https://github.com/orgs/elastic/teams/ml-ui) | The file upload plugin contains components and services for uploading a file, analyzing its data, and then importing the data into an Elasticsearch index. Supported file types include CSV, TSV, newline-delimited JSON and GeoJSON. | 129 | 4 | 129 | 1 | -| | [Fleet](https://github.com/orgs/elastic/teams/fleet) | - | 1210 | 15 | 1110 | 10 | +| | [Fleet](https://github.com/orgs/elastic/teams/fleet) | - | 1225 | 15 | 1122 | 10 | | | [Kibana Core](https://github.com/orgs/elastic/teams/kibana-core) | - | 68 | 0 | 14 | 5 | | globalSearchBar | [Kibana Core](https://github.com/orgs/elastic/teams/kibana-core) | - | 0 | 0 | 0 | 0 | | globalSearchProviders | [Kibana Core](https://github.com/orgs/elastic/teams/kibana-core) | - | 0 | 0 | 0 | 0 | | graph | [Data Discovery](https://github.com/orgs/elastic/teams/kibana-data-discovery) | - | 0 | 0 | 0 | 0 | | grokdebugger | [Stack Management](https://github.com/orgs/elastic/teams/kibana-stack-management) | - | 0 | 0 | 0 | 0 | -| | [Kibana Core](https://github.com/orgs/elastic/teams/kibana-core) | - | 99 | 3 | 77 | 5 | +| | [Kibana Core](https://github.com/orgs/elastic/teams/kibana-core) | - | 96 | 2 | 74 | 5 | | | [Stack Management](https://github.com/orgs/elastic/teams/kibana-stack-management) | - | 4 | 0 | 4 | 0 | | | [Stack Management](https://github.com/orgs/elastic/teams/kibana-stack-management) | - | 169 | 9 | 164 | 3 | | | [App Services](https://github.com/orgs/elastic/teams/kibana-app-services) | This plugin provides the ability to create index patterns via a modal flyout from any kibana app | 13 | 1 | 8 | 0 | @@ -82,16 +82,16 @@ warning: This document is auto-generated and is meant to be viewed inside our ex | inputControlVis | [Kibana Presentation](https://github.com/orgs/elastic/teams/kibana-presentation) | Adds Input Control visualization to Kibana | 0 | 0 | 0 | 0 | | | [App Services](https://github.com/orgs/elastic/teams/kibana-app-services) | - | 123 | 6 | 96 | 4 | | | [Platform Security](https://github.com/orgs/elastic/teams/kibana-security) | This plugin provides UI and APIs for the interactive setup mode. | 26 | 0 | 16 | 0 | -| | [Vis Editors](https://github.com/orgs/elastic/teams/kibana-vis-editors) | - | 48 | 1 | 45 | 0 | +| | [Vis Editors](https://github.com/orgs/elastic/teams/kibana-vis-editors) | - | 12 | 0 | 9 | 0 | | | [Kibana Core](https://github.com/orgs/elastic/teams/kibana-core) | - | 6 | 0 | 6 | 0 | -| | [App Services](https://github.com/orgs/elastic/teams/kibana-app-services) | - | 297 | 8 | 260 | 5 | +| | [App Services](https://github.com/orgs/elastic/teams/kibana-app-services) | - | 282 | 2 | 245 | 5 | | kibanaUsageCollection | [Kibana Telemtry](https://github.com/orgs/elastic/teams/kibana-telemetry) | - | 0 | 0 | 0 | 0 | -| | [App Services](https://github.com/orgs/elastic/teams/kibana-app-services) | - | 606 | 3 | 413 | 8 | +| | [App Services](https://github.com/orgs/elastic/teams/kibana-app-services) | - | 607 | 3 | 414 | 8 | | | [Vis Editors](https://github.com/orgs/elastic/teams/kibana-vis-editors) | Visualization editor allowing to quickly and easily configure compelling visualizations to use on dashboards and canvas workpads. Exposes components to embed visualizations and link into the Lens editor from within other apps in Kibana. | 253 | 0 | 235 | 24 | | | [Stack Management](https://github.com/orgs/elastic/teams/kibana-stack-management) | - | 8 | 0 | 8 | 0 | | | [Stack Management](https://github.com/orgs/elastic/teams/kibana-stack-management) | - | 3 | 0 | 3 | 0 | | | [Kibana Core](https://github.com/orgs/elastic/teams/kibana-core) | - | 117 | 0 | 42 | 8 | -| | [Security detections response](https://github.com/orgs/elastic/teams/security-detections-response) | - | 150 | 0 | 143 | 38 | +| | [Security detections response](https://github.com/orgs/elastic/teams/security-detections-response) | - | 155 | 0 | 148 | 39 | | logstash | [Logstash](https://github.com/orgs/elastic/teams/logstash) | - | 0 | 0 | 0 | 0 | | | [Vis Editors](https://github.com/orgs/elastic/teams/kibana-vis-editors) | - | 40 | 0 | 40 | 5 | | | [GIS](https://github.com/orgs/elastic/teams/kibana-gis) | - | 202 | 0 | 201 | 29 | @@ -101,14 +101,14 @@ warning: This document is auto-generated and is meant to be viewed inside our ex | | [Stack Monitoring](https://github.com/orgs/elastic/teams/stack-monitoring-ui) | - | 10 | 0 | 10 | 2 | | | [App Services](https://github.com/orgs/elastic/teams/kibana-app-services) | - | 31 | 0 | 31 | 2 | | | [Kibana Core](https://github.com/orgs/elastic/teams/kibana-core) | - | 17 | 0 | 17 | 0 | -| | [Observability UI](https://github.com/orgs/elastic/teams/observability-ui) | - | 258 | 1 | 257 | 12 | -| | [Security asset management](https://github.com/orgs/elastic/teams/security-asset-management) | - | 11 | 0 | 11 | 0 | +| | [Observability UI](https://github.com/orgs/elastic/teams/observability-ui) | - | 268 | 1 | 267 | 15 | +| | [Security asset management](https://github.com/orgs/elastic/teams/security-asset-management) | - | 10 | 0 | 10 | 0 | | painlessLab | [Stack Management](https://github.com/orgs/elastic/teams/kibana-stack-management) | - | 0 | 0 | 0 | 0 | | | [Kibana Presentation](https://github.com/orgs/elastic/teams/kibana-presentation) | The Presentation Utility Plugin is a set of common, shared components and toolkits for solutions within the Presentation space, (e.g. Dashboards, Canvas). | 178 | 3 | 151 | 6 | | | [Stack Management](https://github.com/orgs/elastic/teams/kibana-stack-management) | - | 4 | 0 | 4 | 0 | -| | [Kibana Reporting Services](https://github.com/orgs/elastic/teams/kibana-reporting-services) | Reporting Services enables applications to feature reports that the user can automate with Watcher and download later. | 135 | 0 | 134 | 12 | -| | [Stack Management](https://github.com/orgs/elastic/teams/kibana-stack-management) | - | 20 | 0 | 20 | 0 | -| | [RAC](https://github.com/orgs/elastic/teams/rac) | - | 136 | 0 | 113 | 7 | +| | [Kibana Reporting Services](https://github.com/orgs/elastic/teams/kibana-reporting-services) | Reporting Services enables applications to feature reports that the user can automate with Watcher and download later. | 137 | 0 | 136 | 12 | +| | [Stack Management](https://github.com/orgs/elastic/teams/kibana-stack-management) | - | 21 | 0 | 21 | 0 | +| | [RAC](https://github.com/orgs/elastic/teams/rac) | - | 151 | 0 | 128 | 7 | | | [App Services](https://github.com/orgs/elastic/teams/kibana-app-services) | - | 24 | 0 | 19 | 2 | | | [Kibana Core](https://github.com/orgs/elastic/teams/kibana-core) | - | 221 | 3 | 207 | 4 | | | [Kibana Core](https://github.com/orgs/elastic/teams/kibana-core) | - | 103 | 0 | 90 | 0 | @@ -116,18 +116,18 @@ warning: This document is auto-generated and is meant to be viewed inside our ex | | [Kibana Core](https://github.com/orgs/elastic/teams/kibana-core) | - | 90 | 3 | 51 | 0 | | | [App Services](https://github.com/orgs/elastic/teams/kibana-app-services) | - | 22 | 0 | 17 | 1 | | searchprofiler | [Stack Management](https://github.com/orgs/elastic/teams/kibana-stack-management) | - | 0 | 0 | 0 | 0 | -| | [Platform Security](https://github.com/orgs/elastic/teams/kibana-security) | This plugin provides authentication and authorization features, and exposes functionality to understand the capabilities of the currently authenticated user. | 113 | 0 | 51 | 7 | -| | [Security solution](https://github.com/orgs/elastic/teams/security-solution) | - | 1361 | 8 | 1307 | 30 | +| | [Platform Security](https://github.com/orgs/elastic/teams/kibana-security) | This plugin provides authentication and authorization features, and exposes functionality to understand the capabilities of the currently authenticated user. | 116 | 0 | 54 | 8 | +| | [Security solution](https://github.com/orgs/elastic/teams/security-solution) | - | 1372 | 8 | 1318 | 33 | | | [App Services](https://github.com/orgs/elastic/teams/kibana-app-services) | Adds URL Service and sharing capabilities to Kibana | 143 | 1 | 90 | 10 | -| | [Stack Management](https://github.com/orgs/elastic/teams/kibana-stack-management) | - | 23 | 1 | 22 | 1 | +| | [Stack Management](https://github.com/orgs/elastic/teams/kibana-stack-management) | - | 23 | 1 | 23 | 1 | | | [Platform Security](https://github.com/orgs/elastic/teams/kibana-security) | This plugin provides the Spaces feature, which allows saved objects to be organized into meaningful categories. | 208 | 0 | 21 | 1 | | | [Kibana Alerting](https://github.com/orgs/elastic/teams/kibana-alerting-services) | - | 4 | 0 | 4 | 0 | | | [Kibana Alerting](https://github.com/orgs/elastic/teams/kibana-alerting-services) | - | 70 | 0 | 32 | 7 | | | [Kibana Telemetry](https://github.com/orgs/elastic/teams/kibana-telemetry) | - | 41 | 0 | 0 | 0 | -| | [Kibana Telemetry](https://github.com/orgs/elastic/teams/kibana-telemetry) | - | 36 | 0 | 36 | 4 | +| | [Kibana Telemetry](https://github.com/orgs/elastic/teams/kibana-telemetry) | - | 32 | 0 | 32 | 5 | | | [Kibana Telemetry](https://github.com/orgs/elastic/teams/kibana-telemetry) | - | 1 | 0 | 1 | 0 | -| | [Kibana Telemetry](https://github.com/orgs/elastic/teams/kibana-telemetry) | - | 14 | 0 | 13 | 0 | -| | [Security solution](https://github.com/orgs/elastic/teams/security-solution) | - | 968 | 6 | 847 | 25 | +| | [Kibana Telemetry](https://github.com/orgs/elastic/teams/kibana-telemetry) | - | 11 | 0 | 10 | 0 | +| | [Security solution](https://github.com/orgs/elastic/teams/security-solution) | - | 969 | 6 | 848 | 25 | | | [Machine Learning UI](https://github.com/orgs/elastic/teams/ml-ui) | This plugin provides access to the transforms features provided by Elastic. Transforms enable you to convert existing Elasticsearch indices into summarized indices, which provide opportunities for new insights and analytics. | 4 | 0 | 4 | 1 | | translations | [Kibana Localization](https://github.com/orgs/elastic/teams/kibana-localization) | - | 0 | 0 | 0 | 0 | | | [Kibana Alerting](https://github.com/orgs/elastic/teams/kibana-alerting-services) | - | 238 | 1 | 229 | 18 | @@ -142,14 +142,14 @@ warning: This document is auto-generated and is meant to be viewed inside our ex | visTypeMarkdown | [Kibana Presentation](https://github.com/orgs/elastic/teams/kibana-presentation) | Adds a markdown visualization type | 0 | 0 | 0 | 0 | | visTypeMetric | [Vis Editors](https://github.com/orgs/elastic/teams/kibana-vis-editors) | Registers the Metric aggregation-based visualization. | 0 | 0 | 0 | 0 | | | [Vis Editors](https://github.com/orgs/elastic/teams/kibana-vis-editors) | Contains the pie chart implementation using the elastic-charts library. The goal is to eventually deprecate the old implementation and keep only this. Until then, the library used is defined by the Legacy charts library advanced setting. | 12 | 0 | 12 | 2 | -| | [Vis Editors](https://github.com/orgs/elastic/teams/kibana-vis-editors) | Registers the datatable aggregation-based visualization. | 11 | 0 | 11 | 0 | +| | [Vis Editors](https://github.com/orgs/elastic/teams/kibana-vis-editors) | Registers the datatable aggregation-based visualization. | 12 | 0 | 12 | 0 | | visTypeTagcloud | [Vis Editors](https://github.com/orgs/elastic/teams/kibana-vis-editors) | Registers the tagcloud visualization. It is based on elastic-charts wordcloud. | 0 | 0 | 0 | 0 | | | [Vis Editors](https://github.com/orgs/elastic/teams/kibana-vis-editors) | Registers the timelion visualization. Also contains the backend for both timelion app and timelion visualization. | 2 | 0 | 2 | 2 | | | [Vis Editors](https://github.com/orgs/elastic/teams/kibana-vis-editors) | Registers the TSVB visualization. TSVB has its one editor, works with index patterns and index strings and contains 6 types of charts: timeseries, topN, table. markdown, metric and gauge. | 10 | 1 | 10 | 3 | | | [Vis Editors](https://github.com/orgs/elastic/teams/kibana-vis-editors) | Registers the vega visualization. Is the elastic version of vega and vega-lite libraries. | 2 | 0 | 2 | 0 | | | [Vis Editors](https://github.com/orgs/elastic/teams/kibana-vis-editors) | Contains the vislib visualizations. These are the classical area/line/bar, pie, gauge/goal and heatmap charts. We want to replace them with elastic-charts. | 26 | 0 | 25 | 1 | | | [Vis Editors](https://github.com/orgs/elastic/teams/kibana-vis-editors) | Contains the new xy-axis chart using the elastic-charts library, which will eventually replace the vislib xy-axis charts including bar, area, and line. | 57 | 0 | 51 | 5 | -| | [Vis Editors](https://github.com/orgs/elastic/teams/kibana-vis-editors) | Contains the shared architecture among all the legacy visualizations, e.g. the visualization type registry or the visualization embeddable. | 304 | 13 | 286 | 16 | +| | [Vis Editors](https://github.com/orgs/elastic/teams/kibana-vis-editors) | Contains the shared architecture among all the legacy visualizations, e.g. the visualization type registry or the visualization embeddable. | 303 | 13 | 285 | 15 | | | [Vis Editors](https://github.com/orgs/elastic/teams/kibana-vis-editors) | Contains the visualize application which includes the listing page and the app frame, which will load the visualization's editor. | 24 | 0 | 23 | 1 | | watcher | [Stack Management](https://github.com/orgs/elastic/teams/kibana-stack-management) | - | 0 | 0 | 0 | 0 | @@ -157,7 +157,7 @@ warning: This document is auto-generated and is meant to be viewed inside our ex | Package name           | Maintaining team | Description | API Cnt | Any Cnt | Missing
comments | Missing
exports | |--------------|----------------|-----------|--------------|----------|---------------|--------| -| | [Owner missing] | Elastic APM trace data generator | 17 | 0 | 17 | 2 | +| | [Owner missing] | Elastic APM trace data generator | 18 | 0 | 18 | 6 | | | [Owner missing] | elasticsearch datemath parser, used in kibana | 44 | 0 | 43 | 0 | | | [Owner missing] | - | 11 | 5 | 11 | 0 | | | [Owner missing] | Alerts components and hooks | 9 | 1 | 9 | 0 | @@ -187,13 +187,13 @@ warning: This document is auto-generated and is meant to be viewed inside our ex | | [Owner missing] | security solution elastic search utilities to use across plugins such lists, security_solution, cases, etc... | 54 | 0 | 51 | 0 | | | [Owner missing] | Security Solution utilities for React hooks | 8 | 0 | 1 | 1 | | | [Owner missing] | io ts utilities and types to be shared with plugins from the security solution project | 147 | 1 | 128 | 0 | -| | [Owner missing] | io ts utilities and types to be shared with plugins from the security solution project | 418 | 1 | 409 | 0 | +| | [Owner missing] | io ts utilities and types to be shared with plugins from the security solution project | 419 | 1 | 410 | 0 | | | [Owner missing] | io ts utilities and types to be shared with plugins from the security solution project | 45 | 0 | 23 | 0 | | | [Owner missing] | io ts utilities and types to be shared with plugins from the security solution project | 28 | 0 | 22 | 0 | | | [Owner missing] | security solution list REST API | 42 | 0 | 41 | 5 | | | [Owner missing] | security solution list constants to use across plugins such lists, security_solution, cases, etc... | 23 | 0 | 9 | 0 | | | [Owner missing] | Security solution list ReactJS hooks | 56 | 0 | 44 | 0 | -| | [Owner missing] | security solution list utilities | 222 | 0 | 177 | 0 | +| | [Owner missing] | security solution list utilities | 223 | 0 | 178 | 0 | | | [Owner missing] | security solution t-grid packages will allow sharing components between timelines and security_solution plugin until we transfer all functionality to timelines plugin | 120 | 0 | 116 | 0 | | | [Owner missing] | security solution utilities to use across plugins such lists, security_solution, cases, etc... | 6 | 0 | 4 | 0 | | | [Owner missing] | - | 53 | 0 | 50 | 1 | diff --git a/package.json b/package.json index d9dd4912481b9..1f2102f3aff2e 100644 --- a/package.json +++ b/package.json @@ -95,7 +95,7 @@ "@dnd-kit/core": "^3.1.1", "@dnd-kit/sortable": "^4.0.0", "@dnd-kit/utilities": "^2.0.0", - "@elastic/apm-generator": "link:bazel-bin/packages/elastic-apm-generator", + "@elastic/apm-synthtrace": "link:bazel-bin/packages/elastic-apm-synthtrace", "@elastic/apm-rum": "^5.9.1", "@elastic/apm-rum-react": "^1.3.1", "@elastic/charts": "38.0.1", diff --git a/packages/BUILD.bazel b/packages/BUILD.bazel index ace4f982b8515..846f2c9fc3e4b 100644 --- a/packages/BUILD.bazel +++ b/packages/BUILD.bazel @@ -3,7 +3,7 @@ filegroup( name = "build", srcs = [ - "//packages/elastic-apm-generator:build", + "//packages/elastic-apm-synthtrace:build", "//packages/elastic-datemath:build", "//packages/elastic-eslint-config-kibana:build", "//packages/elastic-safer-lodash-set:build", diff --git a/packages/elastic-apm-generator/README.md b/packages/elastic-apm-generator/README.md deleted file mode 100644 index b442c0ec23ee0..0000000000000 --- a/packages/elastic-apm-generator/README.md +++ /dev/null @@ -1,107 +0,0 @@ -# @elastic/apm-generator - -`@elastic/apm-generator` is an experimental tool to generate synthetic APM data. It is intended to be used for development and testing of the Elastic APM app in Kibana. - -At a high-level, the module works by modeling APM events/metricsets with [a fluent API](https://en.wikipedia.org/wiki/Fluent_interface). The models can then be serialized and converted to Elasticsearch documents. In the future we might support APM Server as an output as well. - -## Usage - -This section assumes that you've installed Kibana's dependencies by running `yarn kbn bootstrap` in the repository's root folder. - -This library can currently be used in two ways: - -- Imported as a Node.js module, for instance to be used in Kibana's functional test suite. -- With a command line interface, to index data based on a specified scenario. - -### Using the Node.js module - -#### Concepts - -- `Service`: a logical grouping for a monitored service. A `Service` object contains fields like `service.name`, `service.environment` and `agent.name`. -- `Instance`: a single instance of a monitored service. E.g., the workload for a monitored service might be spread across multiple containers. An `Instance` object contains fields like `service.node.name` and `container.id`. -- `Timerange`: an object that will return an array of timestamps based on an interval and a rate. These timestamps can be used to generate events/metricsets. -- `Transaction`, `Span`, `APMError` and `Metricset`: events/metricsets that occur on an instance. For more background, see the [explanation of the APM data model](https://www.elastic.co/guide/en/apm/get-started/7.15/apm-data-model.html) - - -#### Example - -```ts -import { service, timerange, toElasticsearchOutput } from '@elastic/apm-generator'; - -const instance = service('synth-go', 'production', 'go') - .instance('instance-a'); - -const from = new Date('2021-01-01T12:00:00.000Z').getTime(); -const to = new Date('2021-01-01T12:00:00.000Z').getTime(); - -const traceEvents = timerange(from, to) - .interval('1m') - .rate(10) - .flatMap(timestamp => instance.transaction('GET /api/product/list') - .timestamp(timestamp) - .duration(1000) - .success() - .children( - instance.span('GET apm-*/_search', 'db', 'elasticsearch') - .timestamp(timestamp + 50) - .duration(900) - .destination('elasticsearch') - .success() - ).serialize() - ); - -const metricsets = timerange(from, to) - .interval('30s') - .rate(1) - .flatMap(timestamp => instance.appMetrics({ - 'system.memory.actual.free': 800, - 'system.memory.total': 1000, - 'system.cpu.total.norm.pct': 0.6, - 'system.process.cpu.total.norm.pct': 0.7, - }).timestamp(timestamp) - .serialize() - ); - -const esEvents = toElasticsearchOutput(traceEvents.concat(metricsets)); -``` - -#### Generating metricsets - -`@elastic/apm-generator` can also automatically generate transaction metrics, span destination metrics and transaction breakdown metrics based on the generated trace events. If we expand on the previous example: - -```ts -import { getTransactionMetrics, getSpanDestinationMetrics, getBreakdownMetrics } from '@elastic/apm-generator'; - -const esEvents = toElasticsearchOutput([ - ...traceEvents, - ...getTransactionMetrics(traceEvents), - ...getSpanDestinationMetrics(traceEvents), - ...getBreakdownMetrics(traceEvents) -]); -``` - -### CLI - -Via the CLI, you can upload scenarios, either using a fixed time range or continuously generating data. Some examples are available in in `src/scripts/examples`. Here's an example for live data: - -`$ node packages/elastic-apm-generator/src/scripts/run packages/elastic-apm-generator/src/examples/01_simple_trace.ts --target=http://admin:changeme@localhost:9200 --live` - -For a fixed time window: -`$ node packages/elastic-apm-generator/src/scripts/run packages/elastic-apm-generator/src/examples/01_simple_trace.ts --target=http://admin:changeme@localhost:9200 --from=now-24h --to=now` - -The script will try to automatically find bootstrapped APM indices. __If these indices do not exist, the script will exit with an error. It will not bootstrap the indices itself.__ - -The following options are supported: -| Option | Description | Default | -| -------------- | ------------------------------------------------------- | ------------ | -| `--from` | The start of the time window. | `now - 15m` | -| `--to` | The end of the time window. | `now` | -| `--live` | Continously ingest data | `false` | -| `--bucketSize` | Size of bucket for which to generate data. | `15m` | -| `--clean` | Clean APM indices before indexing new data. | `false` | -| `--interval` | The interval at which to index data. | `10s` | -| `--logLevel` | Log level. | `info` | -| `--lookback` | The lookback window for which data should be generated. | `15m` | -| `--target` | Elasticsearch target, including username/password. | **Required** | -| `--workers` | Amount of simultaneously connected ES clients. | `1` | - diff --git a/packages/elastic-apm-generator/BUILD.bazel b/packages/elastic-apm-synthtrace/BUILD.bazel similarity index 95% rename from packages/elastic-apm-generator/BUILD.bazel rename to packages/elastic-apm-synthtrace/BUILD.bazel index 396c27b3a4c89..5d9510c6a81d5 100644 --- a/packages/elastic-apm-generator/BUILD.bazel +++ b/packages/elastic-apm-synthtrace/BUILD.bazel @@ -2,8 +2,8 @@ load("@npm//@bazel/typescript:index.bzl", "ts_config", "ts_project") load("@build_bazel_rules_nodejs//:index.bzl", "js_library", "pkg_npm") load("//src/dev/bazel:index.bzl", "jsts_transpiler") -PKG_BASE_NAME = "elastic-apm-generator" -PKG_REQUIRE_NAME = "@elastic/apm-generator" +PKG_BASE_NAME = "elastic-apm-synthtrace" +PKG_REQUIRE_NAME = "@elastic/apm-synthtrace" SOURCE_FILES = glob( [ diff --git a/packages/elastic-apm-synthtrace/README.md b/packages/elastic-apm-synthtrace/README.md new file mode 100644 index 0000000000000..8413ba58a5c42 --- /dev/null +++ b/packages/elastic-apm-synthtrace/README.md @@ -0,0 +1,115 @@ +# @elastic/apm-synthtrace + +`@elastic/apm-synthtrace` is an experimental tool to generate synthetic APM data. It is intended to be used for development and testing of the Elastic APM app in Kibana. + +At a high-level, the module works by modeling APM events/metricsets with [a fluent API](https://en.wikipedia.org/wiki/Fluent_interface). The models can then be serialized and converted to Elasticsearch documents. In the future we might support APM Server as an output as well. + +## Usage + +This section assumes that you've installed Kibana's dependencies by running `yarn kbn bootstrap` in the repository's root folder. + +This library can currently be used in two ways: + +- Imported as a Node.js module, for instance to be used in Kibana's functional test suite. +- With a command line interface, to index data based on a specified scenario. + +### Using the Node.js module + +#### Concepts + +- `Service`: a logical grouping for a monitored service. A `Service` object contains fields like `service.name`, `service.environment` and `agent.name`. +- `Instance`: a single instance of a monitored service. E.g., the workload for a monitored service might be spread across multiple containers. An `Instance` object contains fields like `service.node.name` and `container.id`. +- `Timerange`: an object that will return an array of timestamps based on an interval and a rate. These timestamps can be used to generate events/metricsets. +- `Transaction`, `Span`, `APMError` and `Metricset`: events/metricsets that occur on an instance. For more background, see the [explanation of the APM data model](https://www.elastic.co/guide/en/apm/get-started/7.15/apm-data-model.html) + +#### Example + +```ts +import { service, timerange, toElasticsearchOutput } from '@elastic/apm-synthtrace'; + +const instance = service('synth-go', 'production', 'go').instance('instance-a'); + +const from = new Date('2021-01-01T12:00:00.000Z').getTime(); +const to = new Date('2021-01-01T12:00:00.000Z').getTime(); + +const traceEvents = timerange(from, to) + .interval('1m') + .rate(10) + .flatMap((timestamp) => + instance + .transaction('GET /api/product/list') + .timestamp(timestamp) + .duration(1000) + .success() + .children( + instance + .span('GET apm-*/_search', 'db', 'elasticsearch') + .timestamp(timestamp + 50) + .duration(900) + .destination('elasticsearch') + .success() + ) + .serialize() + ); + +const metricsets = timerange(from, to) + .interval('30s') + .rate(1) + .flatMap((timestamp) => + instance + .appMetrics({ + 'system.memory.actual.free': 800, + 'system.memory.total': 1000, + 'system.cpu.total.norm.pct': 0.6, + 'system.process.cpu.total.norm.pct': 0.7, + }) + .timestamp(timestamp) + .serialize() + ); + +const esEvents = toElasticsearchOutput(traceEvents.concat(metricsets)); +``` + +#### Generating metricsets + +`@elastic/apm-synthtrace` can also automatically generate transaction metrics, span destination metrics and transaction breakdown metrics based on the generated trace events. If we expand on the previous example: + +```ts +import { + getTransactionMetrics, + getSpanDestinationMetrics, + getBreakdownMetrics, +} from '@elastic/apm-synthtrace'; + +const esEvents = toElasticsearchOutput([ + ...traceEvents, + ...getTransactionMetrics(traceEvents), + ...getSpanDestinationMetrics(traceEvents), + ...getBreakdownMetrics(traceEvents), +]); +``` + +### CLI + +Via the CLI, you can upload scenarios, either using a fixed time range or continuously generating data. Some examples are available in in `src/scripts/examples`. Here's an example for live data: + +`$ node packages/elastic-apm-synthtrace/src/scripts/run packages/elastic-apm-synthtrace/src/examples/01_simple_trace.ts --target=http://admin:changeme@localhost:9200 --live` + +For a fixed time window: +`$ node packages/elastic-apm-synthtrace/src/scripts/run packages/elastic-apm-synthtrace/src/examples/01_simple_trace.ts --target=http://admin:changeme@localhost:9200 --from=now-24h --to=now` + +The script will try to automatically find bootstrapped APM indices. **If these indices do not exist, the script will exit with an error. It will not bootstrap the indices itself.** + +The following options are supported: +| Option | Description | Default | +| -------------- | ------------------------------------------------------- | ------------ | +| `--from` | The start of the time window. | `now - 15m` | +| `--to` | The end of the time window. | `now` | +| `--live` | Continously ingest data | `false` | +| `--bucketSize` | Size of bucket for which to generate data. | `15m` | +| `--clean` | Clean APM indices before indexing new data. | `false` | +| `--interval` | The interval at which to index data. | `10s` | +| `--logLevel` | Log level. | `info` | +| `--lookback` | The lookback window for which data should be generated. | `15m` | +| `--target` | Elasticsearch target, including username/password. | **Required** | +| `--workers` | Amount of simultaneously connected ES clients. | `1` | diff --git a/packages/elastic-apm-generator/jest.config.js b/packages/elastic-apm-synthtrace/jest.config.js similarity index 89% rename from packages/elastic-apm-generator/jest.config.js rename to packages/elastic-apm-synthtrace/jest.config.js index 64aaa43741cc3..13d8643c5213c 100644 --- a/packages/elastic-apm-generator/jest.config.js +++ b/packages/elastic-apm-synthtrace/jest.config.js @@ -9,7 +9,7 @@ module.exports = { preset: '@kbn/test', rootDir: '../..', - roots: ['/packages/elastic-apm-generator'], + roots: ['/packages/elastic-apm-synthtrace'], setupFiles: [], setupFilesAfterEnv: [], }; diff --git a/packages/elastic-apm-generator/package.json b/packages/elastic-apm-synthtrace/package.json similarity index 85% rename from packages/elastic-apm-generator/package.json rename to packages/elastic-apm-synthtrace/package.json index 57dafd5d6431d..43699e4795586 100644 --- a/packages/elastic-apm-generator/package.json +++ b/packages/elastic-apm-synthtrace/package.json @@ -1,5 +1,5 @@ { - "name": "@elastic/apm-generator", + "name": "@elastic/apm-synthtrace", "version": "0.1.0", "description": "Elastic APM trace data generator", "license": "SSPL-1.0 OR Elastic License 2.0", diff --git a/packages/elastic-apm-generator/src/.eslintrc.js b/packages/elastic-apm-synthtrace/src/.eslintrc.js similarity index 100% rename from packages/elastic-apm-generator/src/.eslintrc.js rename to packages/elastic-apm-synthtrace/src/.eslintrc.js diff --git a/packages/elastic-apm-generator/src/index.ts b/packages/elastic-apm-synthtrace/src/index.ts similarity index 100% rename from packages/elastic-apm-generator/src/index.ts rename to packages/elastic-apm-synthtrace/src/index.ts diff --git a/packages/elastic-apm-generator/src/lib/apm_error.ts b/packages/elastic-apm-synthtrace/src/lib/apm_error.ts similarity index 100% rename from packages/elastic-apm-generator/src/lib/apm_error.ts rename to packages/elastic-apm-synthtrace/src/lib/apm_error.ts diff --git a/packages/elastic-apm-generator/src/lib/base_span.ts b/packages/elastic-apm-synthtrace/src/lib/base_span.ts similarity index 100% rename from packages/elastic-apm-generator/src/lib/base_span.ts rename to packages/elastic-apm-synthtrace/src/lib/base_span.ts diff --git a/packages/elastic-apm-generator/src/lib/defaults/get_observer_defaults.ts b/packages/elastic-apm-synthtrace/src/lib/defaults/get_observer_defaults.ts similarity index 100% rename from packages/elastic-apm-generator/src/lib/defaults/get_observer_defaults.ts rename to packages/elastic-apm-synthtrace/src/lib/defaults/get_observer_defaults.ts diff --git a/packages/elastic-apm-generator/src/lib/entity.ts b/packages/elastic-apm-synthtrace/src/lib/entity.ts similarity index 100% rename from packages/elastic-apm-generator/src/lib/entity.ts rename to packages/elastic-apm-synthtrace/src/lib/entity.ts diff --git a/packages/elastic-apm-generator/src/lib/instance.ts b/packages/elastic-apm-synthtrace/src/lib/instance.ts similarity index 100% rename from packages/elastic-apm-generator/src/lib/instance.ts rename to packages/elastic-apm-synthtrace/src/lib/instance.ts diff --git a/packages/elastic-apm-generator/src/lib/interval.ts b/packages/elastic-apm-synthtrace/src/lib/interval.ts similarity index 100% rename from packages/elastic-apm-generator/src/lib/interval.ts rename to packages/elastic-apm-synthtrace/src/lib/interval.ts diff --git a/packages/elastic-apm-generator/src/lib/metricset.ts b/packages/elastic-apm-synthtrace/src/lib/metricset.ts similarity index 100% rename from packages/elastic-apm-generator/src/lib/metricset.ts rename to packages/elastic-apm-synthtrace/src/lib/metricset.ts diff --git a/packages/elastic-apm-generator/src/lib/output/to_elasticsearch_output.ts b/packages/elastic-apm-synthtrace/src/lib/output/to_elasticsearch_output.ts similarity index 100% rename from packages/elastic-apm-generator/src/lib/output/to_elasticsearch_output.ts rename to packages/elastic-apm-synthtrace/src/lib/output/to_elasticsearch_output.ts diff --git a/packages/elastic-apm-generator/src/lib/serializable.ts b/packages/elastic-apm-synthtrace/src/lib/serializable.ts similarity index 100% rename from packages/elastic-apm-generator/src/lib/serializable.ts rename to packages/elastic-apm-synthtrace/src/lib/serializable.ts diff --git a/packages/elastic-apm-generator/src/lib/service.ts b/packages/elastic-apm-synthtrace/src/lib/service.ts similarity index 100% rename from packages/elastic-apm-generator/src/lib/service.ts rename to packages/elastic-apm-synthtrace/src/lib/service.ts diff --git a/packages/elastic-apm-generator/src/lib/span.ts b/packages/elastic-apm-synthtrace/src/lib/span.ts similarity index 100% rename from packages/elastic-apm-generator/src/lib/span.ts rename to packages/elastic-apm-synthtrace/src/lib/span.ts diff --git a/packages/elastic-apm-generator/src/lib/timerange.ts b/packages/elastic-apm-synthtrace/src/lib/timerange.ts similarity index 100% rename from packages/elastic-apm-generator/src/lib/timerange.ts rename to packages/elastic-apm-synthtrace/src/lib/timerange.ts diff --git a/packages/elastic-apm-generator/src/lib/transaction.ts b/packages/elastic-apm-synthtrace/src/lib/transaction.ts similarity index 100% rename from packages/elastic-apm-generator/src/lib/transaction.ts rename to packages/elastic-apm-synthtrace/src/lib/transaction.ts diff --git a/packages/elastic-apm-generator/src/lib/utils/aggregate.ts b/packages/elastic-apm-synthtrace/src/lib/utils/aggregate.ts similarity index 100% rename from packages/elastic-apm-generator/src/lib/utils/aggregate.ts rename to packages/elastic-apm-synthtrace/src/lib/utils/aggregate.ts diff --git a/packages/elastic-apm-generator/src/lib/utils/create_picker.ts b/packages/elastic-apm-synthtrace/src/lib/utils/create_picker.ts similarity index 100% rename from packages/elastic-apm-generator/src/lib/utils/create_picker.ts rename to packages/elastic-apm-synthtrace/src/lib/utils/create_picker.ts diff --git a/packages/elastic-apm-generator/src/lib/utils/generate_id.ts b/packages/elastic-apm-synthtrace/src/lib/utils/generate_id.ts similarity index 100% rename from packages/elastic-apm-generator/src/lib/utils/generate_id.ts rename to packages/elastic-apm-synthtrace/src/lib/utils/generate_id.ts diff --git a/packages/elastic-apm-generator/src/lib/utils/get_breakdown_metrics.ts b/packages/elastic-apm-synthtrace/src/lib/utils/get_breakdown_metrics.ts similarity index 100% rename from packages/elastic-apm-generator/src/lib/utils/get_breakdown_metrics.ts rename to packages/elastic-apm-synthtrace/src/lib/utils/get_breakdown_metrics.ts diff --git a/packages/elastic-apm-generator/src/lib/utils/get_span_destination_metrics.ts b/packages/elastic-apm-synthtrace/src/lib/utils/get_span_destination_metrics.ts similarity index 100% rename from packages/elastic-apm-generator/src/lib/utils/get_span_destination_metrics.ts rename to packages/elastic-apm-synthtrace/src/lib/utils/get_span_destination_metrics.ts diff --git a/packages/elastic-apm-generator/src/lib/utils/get_transaction_metrics.ts b/packages/elastic-apm-synthtrace/src/lib/utils/get_transaction_metrics.ts similarity index 100% rename from packages/elastic-apm-generator/src/lib/utils/get_transaction_metrics.ts rename to packages/elastic-apm-synthtrace/src/lib/utils/get_transaction_metrics.ts diff --git a/packages/elastic-apm-generator/src/scripts/examples/01_simple_trace.ts b/packages/elastic-apm-synthtrace/src/scripts/examples/01_simple_trace.ts similarity index 100% rename from packages/elastic-apm-generator/src/scripts/examples/01_simple_trace.ts rename to packages/elastic-apm-synthtrace/src/scripts/examples/01_simple_trace.ts diff --git a/packages/elastic-apm-generator/src/scripts/run.js b/packages/elastic-apm-synthtrace/src/scripts/run.js similarity index 100% rename from packages/elastic-apm-generator/src/scripts/run.js rename to packages/elastic-apm-synthtrace/src/scripts/run.js diff --git a/packages/elastic-apm-generator/src/scripts/run.ts b/packages/elastic-apm-synthtrace/src/scripts/run.ts similarity index 100% rename from packages/elastic-apm-generator/src/scripts/run.ts rename to packages/elastic-apm-synthtrace/src/scripts/run.ts diff --git a/packages/elastic-apm-generator/src/scripts/utils/clean_write_targets.ts b/packages/elastic-apm-synthtrace/src/scripts/utils/clean_write_targets.ts similarity index 100% rename from packages/elastic-apm-generator/src/scripts/utils/clean_write_targets.ts rename to packages/elastic-apm-synthtrace/src/scripts/utils/clean_write_targets.ts diff --git a/packages/elastic-apm-generator/src/scripts/utils/common_options.ts b/packages/elastic-apm-synthtrace/src/scripts/utils/common_options.ts similarity index 100% rename from packages/elastic-apm-generator/src/scripts/utils/common_options.ts rename to packages/elastic-apm-synthtrace/src/scripts/utils/common_options.ts diff --git a/packages/elastic-apm-generator/src/scripts/utils/get_common_resources.ts b/packages/elastic-apm-synthtrace/src/scripts/utils/get_common_resources.ts similarity index 100% rename from packages/elastic-apm-generator/src/scripts/utils/get_common_resources.ts rename to packages/elastic-apm-synthtrace/src/scripts/utils/get_common_resources.ts diff --git a/packages/elastic-apm-generator/src/scripts/utils/get_scenario.ts b/packages/elastic-apm-synthtrace/src/scripts/utils/get_scenario.ts similarity index 100% rename from packages/elastic-apm-generator/src/scripts/utils/get_scenario.ts rename to packages/elastic-apm-synthtrace/src/scripts/utils/get_scenario.ts diff --git a/packages/elastic-apm-generator/src/scripts/utils/get_write_targets.ts b/packages/elastic-apm-synthtrace/src/scripts/utils/get_write_targets.ts similarity index 100% rename from packages/elastic-apm-generator/src/scripts/utils/get_write_targets.ts rename to packages/elastic-apm-synthtrace/src/scripts/utils/get_write_targets.ts diff --git a/packages/elastic-apm-generator/src/scripts/utils/interval_to_ms.ts b/packages/elastic-apm-synthtrace/src/scripts/utils/interval_to_ms.ts similarity index 100% rename from packages/elastic-apm-generator/src/scripts/utils/interval_to_ms.ts rename to packages/elastic-apm-synthtrace/src/scripts/utils/interval_to_ms.ts diff --git a/packages/elastic-apm-generator/src/scripts/utils/logger.ts b/packages/elastic-apm-synthtrace/src/scripts/utils/logger.ts similarity index 100% rename from packages/elastic-apm-generator/src/scripts/utils/logger.ts rename to packages/elastic-apm-synthtrace/src/scripts/utils/logger.ts diff --git a/packages/elastic-apm-generator/src/scripts/utils/start_historical_data_upload.ts b/packages/elastic-apm-synthtrace/src/scripts/utils/start_historical_data_upload.ts similarity index 100% rename from packages/elastic-apm-generator/src/scripts/utils/start_historical_data_upload.ts rename to packages/elastic-apm-synthtrace/src/scripts/utils/start_historical_data_upload.ts diff --git a/packages/elastic-apm-generator/src/scripts/utils/start_live_data_upload.ts b/packages/elastic-apm-synthtrace/src/scripts/utils/start_live_data_upload.ts similarity index 100% rename from packages/elastic-apm-generator/src/scripts/utils/start_live_data_upload.ts rename to packages/elastic-apm-synthtrace/src/scripts/utils/start_live_data_upload.ts diff --git a/packages/elastic-apm-generator/src/scripts/utils/upload_events.ts b/packages/elastic-apm-synthtrace/src/scripts/utils/upload_events.ts similarity index 100% rename from packages/elastic-apm-generator/src/scripts/utils/upload_events.ts rename to packages/elastic-apm-synthtrace/src/scripts/utils/upload_events.ts diff --git a/packages/elastic-apm-generator/src/test/scenarios/01_simple_trace.test.ts b/packages/elastic-apm-synthtrace/src/test/scenarios/01_simple_trace.test.ts similarity index 100% rename from packages/elastic-apm-generator/src/test/scenarios/01_simple_trace.test.ts rename to packages/elastic-apm-synthtrace/src/test/scenarios/01_simple_trace.test.ts diff --git a/packages/elastic-apm-generator/src/test/scenarios/02_transaction_metrics.test.ts b/packages/elastic-apm-synthtrace/src/test/scenarios/02_transaction_metrics.test.ts similarity index 100% rename from packages/elastic-apm-generator/src/test/scenarios/02_transaction_metrics.test.ts rename to packages/elastic-apm-synthtrace/src/test/scenarios/02_transaction_metrics.test.ts diff --git a/packages/elastic-apm-generator/src/test/scenarios/03_span_destination_metrics.test.ts b/packages/elastic-apm-synthtrace/src/test/scenarios/03_span_destination_metrics.test.ts similarity index 100% rename from packages/elastic-apm-generator/src/test/scenarios/03_span_destination_metrics.test.ts rename to packages/elastic-apm-synthtrace/src/test/scenarios/03_span_destination_metrics.test.ts diff --git a/packages/elastic-apm-generator/src/test/scenarios/04_breakdown_metrics.test.ts b/packages/elastic-apm-synthtrace/src/test/scenarios/04_breakdown_metrics.test.ts similarity index 100% rename from packages/elastic-apm-generator/src/test/scenarios/04_breakdown_metrics.test.ts rename to packages/elastic-apm-synthtrace/src/test/scenarios/04_breakdown_metrics.test.ts diff --git a/packages/elastic-apm-generator/src/test/scenarios/05_transactions_with_errors.test.ts b/packages/elastic-apm-synthtrace/src/test/scenarios/05_transactions_with_errors.test.ts similarity index 100% rename from packages/elastic-apm-generator/src/test/scenarios/05_transactions_with_errors.test.ts rename to packages/elastic-apm-synthtrace/src/test/scenarios/05_transactions_with_errors.test.ts diff --git a/packages/elastic-apm-generator/src/test/scenarios/06_application_metrics.test.ts b/packages/elastic-apm-synthtrace/src/test/scenarios/06_application_metrics.test.ts similarity index 100% rename from packages/elastic-apm-generator/src/test/scenarios/06_application_metrics.test.ts rename to packages/elastic-apm-synthtrace/src/test/scenarios/06_application_metrics.test.ts diff --git a/packages/elastic-apm-generator/src/test/scenarios/__snapshots__/01_simple_trace.test.ts.snap b/packages/elastic-apm-synthtrace/src/test/scenarios/__snapshots__/01_simple_trace.test.ts.snap similarity index 100% rename from packages/elastic-apm-generator/src/test/scenarios/__snapshots__/01_simple_trace.test.ts.snap rename to packages/elastic-apm-synthtrace/src/test/scenarios/__snapshots__/01_simple_trace.test.ts.snap diff --git a/packages/elastic-apm-generator/src/test/to_elasticsearch_output.test.ts b/packages/elastic-apm-synthtrace/src/test/to_elasticsearch_output.test.ts similarity index 100% rename from packages/elastic-apm-generator/src/test/to_elasticsearch_output.test.ts rename to packages/elastic-apm-synthtrace/src/test/to_elasticsearch_output.test.ts diff --git a/packages/elastic-apm-generator/tsconfig.json b/packages/elastic-apm-synthtrace/tsconfig.json similarity index 60% rename from packages/elastic-apm-generator/tsconfig.json rename to packages/elastic-apm-synthtrace/tsconfig.json index 534e8481dce9a..6ae9c20b4387b 100644 --- a/packages/elastic-apm-generator/tsconfig.json +++ b/packages/elastic-apm-synthtrace/tsconfig.json @@ -7,13 +7,8 @@ "outDir": "target_types", "rootDir": "./src", "sourceMap": true, - "sourceRoot": "../../../../packages/elastic-apm-generator/src", - "types": [ - "node", - "jest" - ] + "sourceRoot": "../../../../packages/elastic-apm-synthtrace/src", + "types": ["node", "jest"] }, - "include": [ - "./src/**/*.ts" - ] + "include": ["./src/**/*.ts"] } diff --git a/x-pack/test/apm_api_integration/common/trace_data.ts b/x-pack/test/apm_api_integration/common/trace_data.ts index 9799e111cb135..4e813efab2913 100644 --- a/x-pack/test/apm_api_integration/common/trace_data.ts +++ b/x-pack/test/apm_api_integration/common/trace_data.ts @@ -10,7 +10,7 @@ import { getSpanDestinationMetrics, getTransactionMetrics, toElasticsearchOutput, -} from '@elastic/apm-generator'; +} from '@elastic/apm-synthtrace'; import { chunk } from 'lodash'; import pLimit from 'p-limit'; import { inspect } from 'util'; diff --git a/x-pack/test/apm_api_integration/tests/error_rate/service_apis.ts b/x-pack/test/apm_api_integration/tests/error_rate/service_apis.ts index 75ea10ed4d9d4..ac81b6d5a4412 100644 --- a/x-pack/test/apm_api_integration/tests/error_rate/service_apis.ts +++ b/x-pack/test/apm_api_integration/tests/error_rate/service_apis.ts @@ -4,7 +4,7 @@ * 2.0; you may not use this file except in compliance with the Elastic License * 2.0. */ -import { service, timerange } from '@elastic/apm-generator'; +import { service, timerange } from '@elastic/apm-synthtrace'; import expect from '@kbn/expect'; import { mean, meanBy, sumBy } from 'lodash'; import { LatencyAggregationType } from '../../../../plugins/apm/common/latency_aggregation_types'; diff --git a/x-pack/test/apm_api_integration/tests/latency/service_apis.ts b/x-pack/test/apm_api_integration/tests/latency/service_apis.ts index a09442cd73a2a..c6ecf9e4a4aba 100644 --- a/x-pack/test/apm_api_integration/tests/latency/service_apis.ts +++ b/x-pack/test/apm_api_integration/tests/latency/service_apis.ts @@ -4,7 +4,7 @@ * 2.0; you may not use this file except in compliance with the Elastic License * 2.0. */ -import { service, timerange } from '@elastic/apm-generator'; +import { service, timerange } from '@elastic/apm-synthtrace'; import expect from '@kbn/expect'; import { meanBy, sumBy } from 'lodash'; import { LatencyAggregationType } from '../../../../plugins/apm/common/latency_aggregation_types'; diff --git a/x-pack/test/apm_api_integration/tests/observability_overview/observability_overview.ts b/x-pack/test/apm_api_integration/tests/observability_overview/observability_overview.ts index 458372196452a..af95f981a3dc5 100644 --- a/x-pack/test/apm_api_integration/tests/observability_overview/observability_overview.ts +++ b/x-pack/test/apm_api_integration/tests/observability_overview/observability_overview.ts @@ -4,7 +4,7 @@ * 2.0; you may not use this file except in compliance with the Elastic License * 2.0. */ -import { service, timerange } from '@elastic/apm-generator'; +import { service, timerange } from '@elastic/apm-synthtrace'; import expect from '@kbn/expect'; import { meanBy, sumBy } from 'lodash'; import { FtrProviderContext } from '../../common/ftr_provider_context'; diff --git a/x-pack/test/apm_api_integration/tests/service_overview/instances_main_statistics.ts b/x-pack/test/apm_api_integration/tests/service_overview/instances_main_statistics.ts index 5585a292d317e..68979795f9dcf 100644 --- a/x-pack/test/apm_api_integration/tests/service_overview/instances_main_statistics.ts +++ b/x-pack/test/apm_api_integration/tests/service_overview/instances_main_statistics.ts @@ -8,7 +8,7 @@ import expect from '@kbn/expect'; import { pick, sortBy } from 'lodash'; import moment from 'moment'; -import { service, timerange } from '@elastic/apm-generator'; +import { service, timerange } from '@elastic/apm-synthtrace'; import { APIReturnType } from '../../../../plugins/apm/public/services/rest/createCallApmApi'; import { isFiniteNumber } from '../../../../plugins/apm/common/utils/is_finite_number'; import { FtrProviderContext } from '../../common/ftr_provider_context'; diff --git a/x-pack/test/apm_api_integration/tests/services/throughput.ts b/x-pack/test/apm_api_integration/tests/services/throughput.ts index 561680e2725cf..e98ab60af8ca4 100644 --- a/x-pack/test/apm_api_integration/tests/services/throughput.ts +++ b/x-pack/test/apm_api_integration/tests/services/throughput.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { service, timerange } from '@elastic/apm-generator'; +import { service, timerange } from '@elastic/apm-synthtrace'; import expect from '@kbn/expect'; import { first, last, meanBy } from 'lodash'; import moment from 'moment'; diff --git a/x-pack/test/apm_api_integration/tests/throughput/dependencies_apis.ts b/x-pack/test/apm_api_integration/tests/throughput/dependencies_apis.ts index 4b3820ee7f033..4df40d1d85d56 100644 --- a/x-pack/test/apm_api_integration/tests/throughput/dependencies_apis.ts +++ b/x-pack/test/apm_api_integration/tests/throughput/dependencies_apis.ts @@ -4,7 +4,7 @@ * 2.0; you may not use this file except in compliance with the Elastic License * 2.0. */ -import { service, timerange } from '@elastic/apm-generator'; +import { service, timerange } from '@elastic/apm-synthtrace'; import expect from '@kbn/expect'; import { meanBy, sumBy } from 'lodash'; import { BackendNode, ServiceNode } from '../../../../plugins/apm/common/connections'; diff --git a/x-pack/test/apm_api_integration/tests/throughput/service_apis.ts b/x-pack/test/apm_api_integration/tests/throughput/service_apis.ts index 6bf0e8c14fb23..00e5e57c546dd 100644 --- a/x-pack/test/apm_api_integration/tests/throughput/service_apis.ts +++ b/x-pack/test/apm_api_integration/tests/throughput/service_apis.ts @@ -4,7 +4,7 @@ * 2.0; you may not use this file except in compliance with the Elastic License * 2.0. */ -import { service, timerange } from '@elastic/apm-generator'; +import { service, timerange } from '@elastic/apm-synthtrace'; import expect from '@kbn/expect'; import { meanBy, sumBy } from 'lodash'; import { LatencyAggregationType } from '../../../../plugins/apm/common/latency_aggregation_types'; diff --git a/x-pack/test/apm_api_integration/tests/transactions/transactions_groups_detailed_statistics.ts b/x-pack/test/apm_api_integration/tests/transactions/transactions_groups_detailed_statistics.ts index 100d3c306b7de..acdd12f3501bf 100644 --- a/x-pack/test/apm_api_integration/tests/transactions/transactions_groups_detailed_statistics.ts +++ b/x-pack/test/apm_api_integration/tests/transactions/transactions_groups_detailed_statistics.ts @@ -4,7 +4,7 @@ * 2.0; you may not use this file except in compliance with the Elastic License * 2.0. */ -import { service, timerange } from '@elastic/apm-generator'; +import { service, timerange } from '@elastic/apm-synthtrace'; import expect from '@kbn/expect'; import { first, isEmpty, last, meanBy } from 'lodash'; import moment from 'moment'; diff --git a/yarn.lock b/yarn.lock index a36d8e9373685..04e303975b9c7 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2302,7 +2302,7 @@ is-absolute "^1.0.0" is-negated-glob "^1.0.0" -"@elastic/apm-generator@link:bazel-bin/packages/elastic-apm-generator": +"@elastic/apm-synthtrace@link:bazel-bin/packages/elastic-apm-synthtrace": version "0.0.0" uid "" From 74bc51ea7c2befe22ab11280c57f3e91053b204a Mon Sep 17 00:00:00 2001 From: Chris Cowan Date: Mon, 25 Oct 2021 14:50:02 -0600 Subject: [PATCH 23/23] [Metrics UI] Ensure Kubernetes Pod CPU Usage is consistent across pages (#116177) --- .../pod/metrics/tsvb/pod_overview.ts | 32 +++++++++++++++++-- 1 file changed, 30 insertions(+), 2 deletions(-) diff --git a/x-pack/plugins/infra/common/inventory_models/pod/metrics/tsvb/pod_overview.ts b/x-pack/plugins/infra/common/inventory_models/pod/metrics/tsvb/pod_overview.ts index 5746410f03388..0fe94c7f53dab 100644 --- a/x-pack/plugins/infra/common/inventory_models/pod/metrics/tsvb/pod_overview.ts +++ b/x-pack/plugins/infra/common/inventory_models/pod/metrics/tsvb/pod_overview.ts @@ -25,9 +25,23 @@ export const podOverview: TSVBMetricModelCreator = ( metrics: [ { field: 'kubernetes.pod.cpu.usage.node.pct', - id: 'avg-cpu-usage', + id: 'avg-cpu-without', type: 'avg', }, + { + field: 'kubernetes.pod.cpu.usage.limit.pct', + id: 'avg-cpu-with', + type: 'avg', + }, + { + id: 'cpu-usage', + type: 'calculation', + variables: [ + { id: 'cpu_with', name: 'with_limit', field: 'avg-cpu-with' }, + { id: 'cpu_without', name: 'without_limit', field: 'avg-cpu-without' }, + ], + script: 'params.with_limit > 0.0 ? params.with_limit : params.without_limit', + }, ], }, { @@ -36,9 +50,23 @@ export const podOverview: TSVBMetricModelCreator = ( metrics: [ { field: 'kubernetes.pod.memory.usage.node.pct', - id: 'avg-memory-usage', + id: 'avg-memory-without', type: 'avg', }, + { + field: 'kubernetes.pod.memory.usage.limit.pct', + id: 'avg-memory-with', + type: 'avg', + }, + { + id: 'memory-usage', + type: 'calculation', + variables: [ + { id: 'memory_with', name: 'with_limit', field: 'avg-memory-with' }, + { id: 'memory_without', name: 'without_limit', field: 'avg-memory-without' }, + ], + script: 'params.with_limit > 0.0 ? params.with_limit : params.without_limit', + }, ], }, {