-
- {i18n.translate('console.embeddableConsole.title', {
- defaultMessage: 'Console',
- })}
-
- {alternateView && (
-
+
+ {isOpen && (
+
)}
+
+
+
+ {i18n.translate('console.embeddableConsole.title', {
+ defaultMessage: 'Console',
+ })}
+
+ {alternateView && (
+
+ )}
+
{showConsole ? (
diff --git a/src/plugins/console/public/application/containers/embeddable/index.tsx b/src/plugins/console/public/application/containers/embeddable/index.tsx
index 0563a5f445da2..0ec32dbeaac91 100644
--- a/src/plugins/console/public/application/containers/embeddable/index.tsx
+++ b/src/plugins/console/public/application/containers/embeddable/index.tsx
@@ -8,12 +8,9 @@
import { dynamic } from '@kbn/shared-ux-utility';
import React from 'react';
-import {
- EmbeddableConsoleProps,
- EmbeddableConsoleDependencies,
-} from '../../../types/embeddable_console';
+import { EmbeddableConsoleDependencies } from '../../../types/embeddable_console';
-type EmbeddableConsoleInternalProps = EmbeddableConsoleProps & EmbeddableConsoleDependencies;
+type EmbeddableConsoleInternalProps = EmbeddableConsoleDependencies;
const Console = dynamic(async () => ({
default: (await import('./embeddable_console')).EmbeddableConsole,
}));
diff --git a/src/plugins/console/public/index.ts b/src/plugins/console/public/index.ts
index 4e907d4329d1e..277190a1a443c 100644
--- a/src/plugins/console/public/index.ts
+++ b/src/plugins/console/public/index.ts
@@ -17,7 +17,6 @@ export type {
ConsoleUILocatorParams,
ConsolePluginSetup,
ConsolePluginStart,
- EmbeddableConsoleProps,
EmbeddedConsoleView,
EmbeddedConsoleViewButtonProps,
} from './types';
diff --git a/src/plugins/console/public/plugin.ts b/src/plugins/console/public/plugin.ts
index 43cedf1fa4bb0..54d8d1db97bc7 100644
--- a/src/plugins/console/public/plugin.ts
+++ b/src/plugins/console/public/plugin.ts
@@ -18,18 +18,30 @@ import {
ConsolePluginSetup,
ConsolePluginStart,
ConsoleUILocatorParams,
- EmbeddableConsoleProps,
EmbeddedConsoleView,
} from './types';
-import { AutocompleteInfo, setAutocompleteInfo, EmbeddableConsoleInfo } from './services';
+import {
+ AutocompleteInfo,
+ setAutocompleteInfo,
+ EmbeddableConsoleInfo,
+ createStorage,
+ setStorage,
+} from './services';
export class ConsoleUIPlugin
implements Plugin
{
private readonly autocompleteInfo = new AutocompleteInfo();
- private _embeddableConsole: EmbeddableConsoleInfo = new EmbeddableConsoleInfo();
-
- constructor(private ctx: PluginInitializerContext) {}
+ private _embeddableConsole: EmbeddableConsoleInfo;
+
+ constructor(private ctx: PluginInitializerContext) {
+ const storage = createStorage({
+ engine: window.localStorage,
+ prefix: 'sense:',
+ });
+ setStorage(storage);
+ this._embeddableConsole = new EmbeddableConsoleInfo(storage);
+ }
public setup(
{ notifications, getStartServices, http }: CoreSetup,
@@ -126,9 +138,8 @@ export class ConsoleUIPlugin
embeddedConsoleUiSetting;
if (embeddedConsoleAvailable) {
- consoleStart.EmbeddableConsole = (props: EmbeddableConsoleProps) => {
+ consoleStart.EmbeddableConsole = (_props: {}) => {
return EmbeddableConsole({
- ...props,
core,
usageCollection: deps.usageCollection,
setDispatch: (d) => {
@@ -136,6 +147,8 @@ export class ConsoleUIPlugin
},
alternateView: this._embeddableConsole.alternateView,
isMonacoEnabled,
+ getConsoleHeight: this._embeddableConsole.getConsoleHeight.bind(this._embeddableConsole),
+ setConsoleHeight: this._embeddableConsole.setConsoleHeight.bind(this._embeddableConsole),
});
};
consoleStart.isEmbeddedConsoleAvailable = () =>
diff --git a/src/plugins/console/public/services/embeddable_console.test.ts b/src/plugins/console/public/services/embeddable_console.test.ts
index 7df8230b6dbdf..92cc4d8450906 100644
--- a/src/plugins/console/public/services/embeddable_console.test.ts
+++ b/src/plugins/console/public/services/embeddable_console.test.ts
@@ -6,12 +6,17 @@
* Side Public License, v 1.
*/
+import { StorageMock } from './storage.mock';
import { EmbeddableConsoleInfo } from './embeddable_console';
describe('EmbeddableConsoleInfo', () => {
+ jest.useFakeTimers();
+
let eConsole: EmbeddableConsoleInfo;
+ let storage: StorageMock;
beforeEach(() => {
- eConsole = new EmbeddableConsoleInfo();
+ storage = new StorageMock({} as unknown as Storage, 'test');
+ eConsole = new EmbeddableConsoleInfo(storage);
});
describe('isEmbeddedConsoleAvailable', () => {
it('returns true if dispatch has been set', () => {
@@ -50,4 +55,28 @@ describe('EmbeddableConsoleInfo', () => {
});
});
});
+ describe('getConsoleHeight', () => {
+ it('returns value in storage when found', () => {
+ storage.get.mockReturnValue('201');
+ expect(eConsole.getConsoleHeight()).toEqual('201');
+ expect(storage.get).toHaveBeenCalledWith('embeddedConsoleHeight', undefined);
+ });
+ it('returns undefined when not found', () => {
+ storage.get.mockReturnValue(undefined);
+ expect(eConsole.getConsoleHeight()).toEqual(undefined);
+ });
+ });
+ describe('setConsoleHeight', () => {
+ it('stores value in storage', () => {
+ // setConsoleHeight calls are debounced
+ eConsole.setConsoleHeight('120');
+ eConsole.setConsoleHeight('110');
+ eConsole.setConsoleHeight('100');
+
+ jest.runAllTimers();
+
+ expect(storage.set).toHaveBeenCalledTimes(1);
+ expect(storage.set).toHaveBeenCalledWith('embeddedConsoleHeight', '100');
+ });
+ });
});
diff --git a/src/plugins/console/public/services/embeddable_console.ts b/src/plugins/console/public/services/embeddable_console.ts
index 91bf086bc3e33..f5e0197ad833b 100644
--- a/src/plugins/console/public/services/embeddable_console.ts
+++ b/src/plugins/console/public/services/embeddable_console.ts
@@ -6,16 +6,28 @@
* Side Public License, v 1.
*/
import type { Dispatch } from 'react';
+import { debounce } from 'lodash';
import {
EmbeddedConsoleAction as EmbeddableConsoleAction,
EmbeddedConsoleView,
} from '../types/embeddable_console';
+import { Storage } from '.';
+
+const CONSOLE_HEIGHT_KEY = 'embeddedConsoleHeight';
+const CONSOLE_HEIGHT_LOCAL_STORAGE_DEBOUNCE_WAIT_TIME = 500;
export class EmbeddableConsoleInfo {
private _dispatch: Dispatch | null = null;
private _alternateView: EmbeddedConsoleView | undefined;
+ constructor(private readonly storage: Storage) {
+ this.setConsoleHeight = debounce(
+ this.setConsoleHeight.bind(this),
+ CONSOLE_HEIGHT_LOCAL_STORAGE_DEBOUNCE_WAIT_TIME
+ );
+ }
+
public get alternateView(): EmbeddedConsoleView | undefined {
return this._alternateView;
}
@@ -38,4 +50,12 @@ export class EmbeddableConsoleInfo {
public registerAlternateView(view: EmbeddedConsoleView | null) {
this._alternateView = view ?? undefined;
}
+
+ public getConsoleHeight(): string | undefined {
+ return this.storage.get(CONSOLE_HEIGHT_KEY, undefined);
+ }
+
+ public setConsoleHeight(value: string) {
+ this.storage.set(CONSOLE_HEIGHT_KEY, value);
+ }
}
diff --git a/src/plugins/console/public/types/embeddable_console.ts b/src/plugins/console/public/types/embeddable_console.ts
index 07a801c40287b..9a31e0f1cf151 100644
--- a/src/plugins/console/public/types/embeddable_console.ts
+++ b/src/plugins/console/public/types/embeddable_console.ts
@@ -10,22 +10,14 @@ import type { CoreStart } from '@kbn/core/public';
import type { UsageCollectionStart } from '@kbn/usage-collection-plugin/public';
import type { Dispatch } from 'react';
-/**
- * EmbeddableConsoleProps are optional props used when rendering the embeddable developer console.
- */
-export interface EmbeddableConsoleProps {
- /**
- * The default height of the content area.
- */
- size?: 's' | 'm' | 'l';
-}
-
export interface EmbeddableConsoleDependencies {
core: CoreStart;
usageCollection?: UsageCollectionStart;
setDispatch: (dispatch: Dispatch | null) => void;
alternateView?: EmbeddedConsoleView;
isMonacoEnabled: boolean;
+ getConsoleHeight: () => string | undefined;
+ setConsoleHeight: (value: string) => void;
}
export type EmbeddedConsoleAction =
diff --git a/src/plugins/console/public/types/plugin_dependencies.ts b/src/plugins/console/public/types/plugin_dependencies.ts
index 03db14c181be8..63446135e7f3c 100644
--- a/src/plugins/console/public/types/plugin_dependencies.ts
+++ b/src/plugins/console/public/types/plugin_dependencies.ts
@@ -13,7 +13,7 @@ import { UsageCollectionSetup, UsageCollectionStart } from '@kbn/usage-collectio
import { SharePluginSetup, SharePluginStart, LocatorPublic } from '@kbn/share-plugin/public';
import { ConsoleUILocatorParams } from './locator';
-import { EmbeddableConsoleProps, EmbeddedConsoleView } from './embeddable_console';
+import { EmbeddedConsoleView } from './embeddable_console';
export interface AppSetupUIPluginDependencies {
home?: HomePublicPluginSetup;
@@ -55,7 +55,7 @@ export interface ConsolePluginStart {
/**
* EmbeddableConsole is a functional component used to render a portable version of the dev tools console on any page in Kibana
*/
- EmbeddableConsole?: FC;
+ EmbeddableConsole?: FC<{}>;
/**
* Register an alternate view for the Embedded Console
*
diff --git a/src/plugins/embeddable/public/react_embeddable_system/react_embeddable_renderer.tsx b/src/plugins/embeddable/public/react_embeddable_system/react_embeddable_renderer.tsx
index 6243b3a9c3eb9..45cb648e1b626 100644
--- a/src/plugins/embeddable/public/react_embeddable_system/react_embeddable_renderer.tsx
+++ b/src/plugins/embeddable/public/react_embeddable_system/react_embeddable_renderer.tsx
@@ -34,6 +34,7 @@ export const ReactEmbeddableRenderer = <
onApiAvailable,
panelProps,
onAnyStateChange,
+ hidePanelChrome,
}: {
maybeId?: string;
type: string;
@@ -49,6 +50,7 @@ export const ReactEmbeddableRenderer = <
| 'hideHeader'
| 'hideInspector'
>;
+ hidePanelChrome?: boolean;
/**
* This `onAnyStateChange` callback allows the parent to keep track of the state of the embeddable
* as it changes. This is **not** expected to change over the lifetime of the component.
@@ -129,5 +131,11 @@ export const ReactEmbeddableRenderer = <
};
}, []);
- return ;
+ return (
+
+ hidePanelChrome={hidePanelChrome}
+ {...panelProps}
+ Component={componentPromise}
+ />
+ );
};
diff --git a/src/plugins/presentation_panel/public/panel_component/presentation_panel.tsx b/src/plugins/presentation_panel/public/panel_component/presentation_panel.tsx
index fc871c317d7d6..772714eb44e33 100644
--- a/src/plugins/presentation_panel/public/panel_component/presentation_panel.tsx
+++ b/src/plugins/presentation_panel/public/panel_component/presentation_panel.tsx
@@ -8,7 +8,7 @@
import './_presentation_panel.scss';
-import { EuiFlexGroup } from '@elastic/eui';
+import { EuiErrorBoundary, EuiFlexGroup } from '@elastic/eui';
import { PanelLoader } from '@kbn/panel-loader';
import { isPromise } from '@kbn/std';
import React from 'react';
@@ -22,10 +22,18 @@ export const PresentationPanel = <
ApiType extends DefaultPresentationPanelApi = DefaultPresentationPanelApi,
PropsType extends {} = {}
>(
- props: PresentationPanelProps
+ props: PresentationPanelProps & {
+ hidePanelChrome?: boolean;
+ }
) => {
- const { Component, ...passThroughProps } = props;
+ const { Component, hidePanelChrome, ...passThroughProps } = props;
const { loading, value, error } = useAsync(async () => {
+ if (hidePanelChrome) {
+ return {
+ unwrappedComponent: isPromise(Component) ? await Component : Component,
+ };
+ }
+
const startServicesPromise = untilPluginStartServicesReady();
const modulePromise = await import('./presentation_panel_internal');
const componentPromise = isPromise(Component) ? Component : Promise.resolve(Component);
@@ -36,11 +44,24 @@ export const PresentationPanel = <
]);
const Panel = panelModule.PresentationPanelInternal;
return { Panel, unwrappedComponent };
+
// Ancestry chain is expected to use 'key' attribute to reset DOM and state
// when unwrappedComponent needs to be re-loaded
}, []);
- if (error || (!loading && (!value?.Panel || !value?.unwrappedComponent))) {
+ if (loading)
+ return (
+
+ );
+
+ const Panel = value?.Panel;
+ const UnwrappedComponent = value?.unwrappedComponent;
+ const shouldHavePanel = !hidePanelChrome;
+ if (error || (shouldHavePanel && !Panel) || !UnwrappedComponent) {
return (
Component={UnwrappedComponent} {...passThroughProps} />
+ ) : (
+
+ )}
/>
- );
-
- return (
- Component={value.unwrappedComponent} {...passThroughProps} />
+
);
};
diff --git a/test/examples/config.js b/test/examples/config.js
index dbc9d32055cc7..77d73642afd1c 100644
--- a/test/examples/config.js
+++ b/test/examples/config.js
@@ -18,7 +18,6 @@ export default async function ({ readConfigFile }) {
rootTags: ['runOutsideOfCiGroups'],
testFiles: [
require.resolve('./hello_world'),
- require.resolve('./embeddables'),
require.resolve('./bfetch_explorer'),
require.resolve('./ui_actions'),
require.resolve('./state_sync'),
diff --git a/test/examples/embeddables/hello_world_embeddable.ts b/test/examples/embeddables/hello_world_embeddable.ts
deleted file mode 100644
index 9e74246f2e2ba..0000000000000
--- a/test/examples/embeddables/hello_world_embeddable.ts
+++ /dev/null
@@ -1,37 +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 and the Server Side Public License, v 1; you may not use this file except
- * in compliance with, at your election, the Elastic License 2.0 or the Server
- * Side Public License, v 1.
- */
-
-import expect from '@kbn/expect';
-
-import { PluginFunctionalProviderContext } from '../../plugin_functional/services';
-
-// eslint-disable-next-line import/no-default-export
-export default function ({ getService }: PluginFunctionalProviderContext) {
- const testSubjects = getService('testSubjects');
- const retry = getService('retry');
-
- describe('hello world embeddable', () => {
- before(async () => {
- await testSubjects.click('helloWorldEmbeddableSection');
- });
-
- it('hello world embeddable render', async () => {
- await retry.try(async () => {
- const text = await testSubjects.getVisibleText('helloWorldEmbeddable');
- expect(text).to.be('HELLO WORLD!');
- });
- });
-
- it('hello world embeddable from factory renders', async () => {
- await retry.try(async () => {
- const text = await testSubjects.getVisibleText('helloWorldEmbeddableFromFactory');
- expect(text).to.be('HELLO WORLD!');
- });
- });
- });
-}
diff --git a/test/examples/embeddables/index.ts b/test/examples/embeddables/index.ts
deleted file mode 100644
index 27745cf717258..0000000000000
--- a/test/examples/embeddables/index.ts
+++ /dev/null
@@ -1,29 +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 and the Server Side Public License, v 1; you may not use this file except
- * in compliance with, at your election, the Elastic License 2.0 or the Server
- * Side Public License, v 1.
- */
-
-import { PluginFunctionalProviderContext } from '../../plugin_functional/services';
-
-// eslint-disable-next-line import/no-default-export
-export default function ({
- getService,
- getPageObjects,
- loadTestFile,
-}: PluginFunctionalProviderContext) {
- const browser = getService('browser');
- const PageObjects = getPageObjects(['common', 'header']);
-
- describe('embeddable explorer', function () {
- before(async () => {
- await browser.setWindowSize(1300, 900);
- await PageObjects.common.navigateToApp('embeddableExplorer');
- });
-
- loadTestFile(require.resolve('./hello_world_embeddable'));
- loadTestFile(require.resolve('./list_container'));
- });
-}
diff --git a/test/examples/embeddables/list_container.ts b/test/examples/embeddables/list_container.ts
deleted file mode 100644
index f18ff169171f0..0000000000000
--- a/test/examples/embeddables/list_container.ts
+++ /dev/null
@@ -1,32 +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 and the Server Side Public License, v 1; you may not use this file except
- * in compliance with, at your election, the Elastic License 2.0 or the Server
- * Side Public License, v 1.
- */
-
-import expect from '@kbn/expect';
-import { PluginFunctionalProviderContext } from '../../plugin_functional/services';
-
-// eslint-disable-next-line import/no-default-export
-export default function ({ getService }: PluginFunctionalProviderContext) {
- const testSubjects = getService('testSubjects');
- const retry = getService('retry');
-
- describe('list container', () => {
- before(async () => {
- await testSubjects.click('listContainerSection');
- });
-
- it('list containers render', async () => {
- await retry.try(async () => {
- const title = await testSubjects.getVisibleText('listContainerTitle');
- expect(title).to.be('Hello world list');
-
- const text = await testSubjects.getVisibleTextAll('helloWorldEmbeddable');
- expect(text).to.eql(['HELLO WORLD!', 'HELLO WORLD!']);
- });
- });
- });
-}
diff --git a/test/functional/apps/discover/group1/index.ts b/test/functional/apps/discover/group1/index.ts
index 375954797c3ca..2ca6413a11c22 100644
--- a/test/functional/apps/discover/group1/index.ts
+++ b/test/functional/apps/discover/group1/index.ts
@@ -20,23 +20,13 @@ export default function ({ getService, loadTestFile }: FtrProviderContext) {
await esArchiver.unload('test/functional/fixtures/es_archiver/logstash_functional');
});
- loadTestFile(require.resolve('./_no_data'));
loadTestFile(require.resolve('./_discover'));
loadTestFile(require.resolve('./_discover_accessibility'));
loadTestFile(require.resolve('./_discover_histogram_breakdown'));
loadTestFile(require.resolve('./_discover_histogram'));
loadTestFile(require.resolve('./_doc_accessibility'));
- loadTestFile(require.resolve('./_filter_editor'));
loadTestFile(require.resolve('./_errors'));
- loadTestFile(require.resolve('./_field_data'));
- loadTestFile(require.resolve('./_field_data_with_fields_api'));
- loadTestFile(require.resolve('./_shared_links'));
- loadTestFile(require.resolve('./_source_filters'));
- loadTestFile(require.resolve('./_large_string'));
- loadTestFile(require.resolve('./_greeting_screen'));
- loadTestFile(require.resolve('./_inspector'));
loadTestFile(require.resolve('./_date_nanos'));
loadTestFile(require.resolve('./_date_nanos_mixed'));
- loadTestFile(require.resolve('./_url_state'));
});
}
diff --git a/test/functional/apps/discover/group2/_data_grid.ts b/test/functional/apps/discover/group2_data_grid1/_data_grid.ts
similarity index 100%
rename from test/functional/apps/discover/group2/_data_grid.ts
rename to test/functional/apps/discover/group2_data_grid1/_data_grid.ts
diff --git a/test/functional/apps/discover/group2/_data_grid_context.ts b/test/functional/apps/discover/group2_data_grid1/_data_grid_context.ts
similarity index 100%
rename from test/functional/apps/discover/group2/_data_grid_context.ts
rename to test/functional/apps/discover/group2_data_grid1/_data_grid_context.ts
diff --git a/test/functional/apps/discover/group2/_data_grid_copy_to_clipboard.ts b/test/functional/apps/discover/group2_data_grid1/_data_grid_copy_to_clipboard.ts
similarity index 100%
rename from test/functional/apps/discover/group2/_data_grid_copy_to_clipboard.ts
rename to test/functional/apps/discover/group2_data_grid1/_data_grid_copy_to_clipboard.ts
diff --git a/test/functional/apps/discover/group2/_data_grid_doc_navigation.ts b/test/functional/apps/discover/group2_data_grid1/_data_grid_doc_navigation.ts
similarity index 100%
rename from test/functional/apps/discover/group2/_data_grid_doc_navigation.ts
rename to test/functional/apps/discover/group2_data_grid1/_data_grid_doc_navigation.ts
diff --git a/test/functional/apps/discover/group2/_data_grid_doc_table.ts b/test/functional/apps/discover/group2_data_grid1/_data_grid_doc_table.ts
similarity index 100%
rename from test/functional/apps/discover/group2/_data_grid_doc_table.ts
rename to test/functional/apps/discover/group2_data_grid1/_data_grid_doc_table.ts
diff --git a/test/functional/apps/discover/group2/config.ts b/test/functional/apps/discover/group2_data_grid1/config.ts
similarity index 100%
rename from test/functional/apps/discover/group2/config.ts
rename to test/functional/apps/discover/group2_data_grid1/config.ts
diff --git a/test/functional/apps/discover/group2/index.ts b/test/functional/apps/discover/group2_data_grid1/index.ts
similarity index 67%
rename from test/functional/apps/discover/group2/index.ts
rename to test/functional/apps/discover/group2_data_grid1/index.ts
index 2639601e12c17..c9e9e9739337a 100644
--- a/test/functional/apps/discover/group2/index.ts
+++ b/test/functional/apps/discover/group2_data_grid1/index.ts
@@ -11,7 +11,7 @@ export default function ({ getService, loadTestFile }: FtrProviderContext) {
const esArchiver = getService('esArchiver');
const browser = getService('browser');
- describe('discover/group2', function () {
+ describe('discover/group2/data_grid1', function () {
before(async function () {
await browser.setWindowSize(1600, 1200);
});
@@ -22,16 +22,8 @@ export default function ({ getService, loadTestFile }: FtrProviderContext) {
loadTestFile(require.resolve('./_data_grid'));
loadTestFile(require.resolve('./_data_grid_context'));
- loadTestFile(require.resolve('./_data_grid_field_data'));
loadTestFile(require.resolve('./_data_grid_doc_navigation'));
- loadTestFile(require.resolve('./_data_grid_row_navigation'));
loadTestFile(require.resolve('./_data_grid_doc_table'));
loadTestFile(require.resolve('./_data_grid_copy_to_clipboard'));
- loadTestFile(require.resolve('./_data_grid_row_height'));
- loadTestFile(require.resolve('./_data_grid_new_line'));
- loadTestFile(require.resolve('./_data_grid_sample_size'));
- loadTestFile(require.resolve('./_data_grid_pagination'));
- loadTestFile(require.resolve('./_data_grid_footer'));
- loadTestFile(require.resolve('./_data_grid_field_tokens'));
});
}
diff --git a/test/functional/apps/discover/group2/_data_grid_field_data.ts b/test/functional/apps/discover/group2_data_grid2/_data_grid_field_data.ts
similarity index 100%
rename from test/functional/apps/discover/group2/_data_grid_field_data.ts
rename to test/functional/apps/discover/group2_data_grid2/_data_grid_field_data.ts
diff --git a/test/functional/apps/discover/group2/_data_grid_field_tokens.ts b/test/functional/apps/discover/group2_data_grid2/_data_grid_field_tokens.ts
similarity index 100%
rename from test/functional/apps/discover/group2/_data_grid_field_tokens.ts
rename to test/functional/apps/discover/group2_data_grid2/_data_grid_field_tokens.ts
diff --git a/test/functional/apps/discover/group2/_data_grid_footer.ts b/test/functional/apps/discover/group2_data_grid2/_data_grid_footer.ts
similarity index 100%
rename from test/functional/apps/discover/group2/_data_grid_footer.ts
rename to test/functional/apps/discover/group2_data_grid2/_data_grid_footer.ts
diff --git a/test/functional/apps/discover/group2/_data_grid_new_line.ts b/test/functional/apps/discover/group2_data_grid2/_data_grid_new_line.ts
similarity index 100%
rename from test/functional/apps/discover/group2/_data_grid_new_line.ts
rename to test/functional/apps/discover/group2_data_grid2/_data_grid_new_line.ts
diff --git a/examples/embeddable_explorer/public/index.ts b/test/functional/apps/discover/group2_data_grid2/config.ts
similarity index 52%
rename from examples/embeddable_explorer/public/index.ts
rename to test/functional/apps/discover/group2_data_grid2/config.ts
index 7620d1daf20f6..a70a190ca63f8 100644
--- a/examples/embeddable_explorer/public/index.ts
+++ b/test/functional/apps/discover/group2_data_grid2/config.ts
@@ -6,6 +6,13 @@
* Side Public License, v 1.
*/
-import { EmbeddableExplorerPlugin } from './plugin';
+import { FtrConfigProviderContext } from '@kbn/test';
-export const plugin = () => new EmbeddableExplorerPlugin();
+export default async function ({ readConfigFile }: FtrConfigProviderContext) {
+ const functionalConfig = await readConfigFile(require.resolve('../../../config.base.js'));
+
+ return {
+ ...functionalConfig.getAll(),
+ testFiles: [require.resolve('.')],
+ };
+}
diff --git a/test/functional/apps/discover/group2_data_grid2/index.ts b/test/functional/apps/discover/group2_data_grid2/index.ts
new file mode 100644
index 0000000000000..1d3736cafe80b
--- /dev/null
+++ b/test/functional/apps/discover/group2_data_grid2/index.ts
@@ -0,0 +1,28 @@
+/*
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
+ * or more contributor license agreements. Licensed under the Elastic License
+ * 2.0 and the Server Side Public License, v 1; you may not use this file except
+ * in compliance with, at your election, the Elastic License 2.0 or the Server
+ * Side Public License, v 1.
+ */
+import { FtrProviderContext } from '../ftr_provider_context';
+
+export default function ({ getService, loadTestFile }: FtrProviderContext) {
+ const esArchiver = getService('esArchiver');
+ const browser = getService('browser');
+
+ describe('discover/group2/data_grid2', function () {
+ before(async function () {
+ await browser.setWindowSize(1600, 1200);
+ });
+
+ after(async function unloadMakelogs() {
+ await esArchiver.unload('test/functional/fixtures/es_archiver/logstash_functional');
+ });
+
+ loadTestFile(require.resolve('./_data_grid_new_line'));
+ loadTestFile(require.resolve('./_data_grid_footer'));
+ loadTestFile(require.resolve('./_data_grid_field_data'));
+ loadTestFile(require.resolve('./_data_grid_field_tokens'));
+ });
+}
diff --git a/test/functional/apps/discover/group2/_data_grid_pagination.ts b/test/functional/apps/discover/group2_data_grid3/_data_grid_pagination.ts
similarity index 100%
rename from test/functional/apps/discover/group2/_data_grid_pagination.ts
rename to test/functional/apps/discover/group2_data_grid3/_data_grid_pagination.ts
diff --git a/test/functional/apps/discover/group2/_data_grid_row_height.ts b/test/functional/apps/discover/group2_data_grid3/_data_grid_row_height.ts
similarity index 100%
rename from test/functional/apps/discover/group2/_data_grid_row_height.ts
rename to test/functional/apps/discover/group2_data_grid3/_data_grid_row_height.ts
diff --git a/test/functional/apps/discover/group2/_data_grid_row_navigation.ts b/test/functional/apps/discover/group2_data_grid3/_data_grid_row_navigation.ts
similarity index 100%
rename from test/functional/apps/discover/group2/_data_grid_row_navigation.ts
rename to test/functional/apps/discover/group2_data_grid3/_data_grid_row_navigation.ts
diff --git a/test/functional/apps/discover/group2/_data_grid_sample_size.ts b/test/functional/apps/discover/group2_data_grid3/_data_grid_sample_size.ts
similarity index 100%
rename from test/functional/apps/discover/group2/_data_grid_sample_size.ts
rename to test/functional/apps/discover/group2_data_grid3/_data_grid_sample_size.ts
diff --git a/test/functional/apps/discover/group2_data_grid3/config.ts b/test/functional/apps/discover/group2_data_grid3/config.ts
new file mode 100644
index 0000000000000..a70a190ca63f8
--- /dev/null
+++ b/test/functional/apps/discover/group2_data_grid3/config.ts
@@ -0,0 +1,18 @@
+/*
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
+ * or more contributor license agreements. Licensed under the Elastic License
+ * 2.0 and the Server Side Public License, v 1; you may not use this file except
+ * in compliance with, at your election, the Elastic License 2.0 or the Server
+ * Side Public License, v 1.
+ */
+
+import { FtrConfigProviderContext } from '@kbn/test';
+
+export default async function ({ readConfigFile }: FtrConfigProviderContext) {
+ const functionalConfig = await readConfigFile(require.resolve('../../../config.base.js'));
+
+ return {
+ ...functionalConfig.getAll(),
+ testFiles: [require.resolve('.')],
+ };
+}
diff --git a/test/functional/apps/discover/group2_data_grid3/index.ts b/test/functional/apps/discover/group2_data_grid3/index.ts
new file mode 100644
index 0000000000000..7200eb1e9bf10
--- /dev/null
+++ b/test/functional/apps/discover/group2_data_grid3/index.ts
@@ -0,0 +1,28 @@
+/*
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
+ * or more contributor license agreements. Licensed under the Elastic License
+ * 2.0 and the Server Side Public License, v 1; you may not use this file except
+ * in compliance with, at your election, the Elastic License 2.0 or the Server
+ * Side Public License, v 1.
+ */
+import { FtrProviderContext } from '../ftr_provider_context';
+
+export default function ({ getService, loadTestFile }: FtrProviderContext) {
+ const esArchiver = getService('esArchiver');
+ const browser = getService('browser');
+
+ describe('discover/group2/data_grid3', function () {
+ before(async function () {
+ await browser.setWindowSize(1600, 1200);
+ });
+
+ after(async function unloadMakelogs() {
+ await esArchiver.unload('test/functional/fixtures/es_archiver/logstash_functional');
+ });
+
+ loadTestFile(require.resolve('./_data_grid_row_navigation'));
+ loadTestFile(require.resolve('./_data_grid_row_height'));
+ loadTestFile(require.resolve('./_data_grid_sample_size'));
+ loadTestFile(require.resolve('./_data_grid_pagination'));
+ });
+}
diff --git a/test/functional/apps/discover/group3/index.ts b/test/functional/apps/discover/group3/index.ts
index a80ae44e49801..582710e419a75 100644
--- a/test/functional/apps/discover/group3/index.ts
+++ b/test/functional/apps/discover/group3/index.ts
@@ -21,14 +21,9 @@ export default function ({ getService, loadTestFile }: FtrProviderContext) {
});
loadTestFile(require.resolve('./_default_columns'));
- loadTestFile(require.resolve('./_time_field_column'));
loadTestFile(require.resolve('./_drag_drop'));
- loadTestFile(require.resolve('./_sidebar'));
- loadTestFile(require.resolve('./_sidebar_field_stats'));
loadTestFile(require.resolve('./_request_counts'));
loadTestFile(require.resolve('./_doc_viewer'));
- loadTestFile(require.resolve('./_view_mode_toggle'));
- loadTestFile(require.resolve('./_unsaved_changes_badge'));
loadTestFile(require.resolve('./_panels_toggle'));
loadTestFile(require.resolve('./_lens_vis'));
});
diff --git a/test/functional/apps/discover/group4/index.ts b/test/functional/apps/discover/group4/index.ts
index 4a145b06cf248..211b4501ed329 100644
--- a/test/functional/apps/discover/group4/index.ts
+++ b/test/functional/apps/discover/group4/index.ts
@@ -20,22 +20,14 @@ export default function ({ getService, loadTestFile }: FtrProviderContext) {
await esArchiver.unload('test/functional/fixtures/es_archiver/logstash_functional');
});
- loadTestFile(require.resolve('./_indexpattern_without_timefield'));
loadTestFile(require.resolve('./_discover_fields_api'));
loadTestFile(require.resolve('./_adhoc_data_views'));
loadTestFile(require.resolve('./_esql_view'));
- loadTestFile(require.resolve('./_indexpattern_with_unmapped_fields'));
- loadTestFile(require.resolve('./_runtime_fields_editor'));
- loadTestFile(require.resolve('./_huge_fields'));
loadTestFile(require.resolve('./_date_nested'));
- loadTestFile(require.resolve('./_search_on_page_load'));
loadTestFile(require.resolve('./_chart_hidden'));
loadTestFile(require.resolve('./_context_encoded_url_params'));
- loadTestFile(require.resolve('./_hide_announcements'));
loadTestFile(require.resolve('./_data_view_edit'));
loadTestFile(require.resolve('./_field_list_new_fields'));
- loadTestFile(require.resolve('./_request_cancellation'));
- loadTestFile(require.resolve('./_new_search'));
loadTestFile(require.resolve('./_document_comparison'));
});
}
diff --git a/test/functional/apps/discover/group1/_field_data.ts b/test/functional/apps/discover/group5/_field_data.ts
similarity index 100%
rename from test/functional/apps/discover/group1/_field_data.ts
rename to test/functional/apps/discover/group5/_field_data.ts
diff --git a/test/functional/apps/discover/group1/_field_data_with_fields_api.ts b/test/functional/apps/discover/group5/_field_data_with_fields_api.ts
similarity index 100%
rename from test/functional/apps/discover/group1/_field_data_with_fields_api.ts
rename to test/functional/apps/discover/group5/_field_data_with_fields_api.ts
diff --git a/test/functional/apps/discover/group1/_filter_editor.ts b/test/functional/apps/discover/group5/_filter_editor.ts
similarity index 100%
rename from test/functional/apps/discover/group1/_filter_editor.ts
rename to test/functional/apps/discover/group5/_filter_editor.ts
diff --git a/test/functional/apps/discover/group1/_greeting_screen.ts b/test/functional/apps/discover/group5/_greeting_screen.ts
similarity index 100%
rename from test/functional/apps/discover/group1/_greeting_screen.ts
rename to test/functional/apps/discover/group5/_greeting_screen.ts
diff --git a/test/functional/apps/discover/group1/_inspector.ts b/test/functional/apps/discover/group5/_inspector.ts
similarity index 100%
rename from test/functional/apps/discover/group1/_inspector.ts
rename to test/functional/apps/discover/group5/_inspector.ts
diff --git a/test/functional/apps/discover/group1/_large_string.ts b/test/functional/apps/discover/group5/_large_string.ts
similarity index 100%
rename from test/functional/apps/discover/group1/_large_string.ts
rename to test/functional/apps/discover/group5/_large_string.ts
diff --git a/test/functional/apps/discover/group1/_no_data.ts b/test/functional/apps/discover/group5/_no_data.ts
similarity index 100%
rename from test/functional/apps/discover/group1/_no_data.ts
rename to test/functional/apps/discover/group5/_no_data.ts
diff --git a/test/functional/apps/discover/group1/_shared_links.ts b/test/functional/apps/discover/group5/_shared_links.ts
similarity index 100%
rename from test/functional/apps/discover/group1/_shared_links.ts
rename to test/functional/apps/discover/group5/_shared_links.ts
diff --git a/test/functional/apps/discover/group1/_source_filters.ts b/test/functional/apps/discover/group5/_source_filters.ts
similarity index 100%
rename from test/functional/apps/discover/group1/_source_filters.ts
rename to test/functional/apps/discover/group5/_source_filters.ts
diff --git a/test/functional/apps/discover/group1/_url_state.ts b/test/functional/apps/discover/group5/_url_state.ts
similarity index 100%
rename from test/functional/apps/discover/group1/_url_state.ts
rename to test/functional/apps/discover/group5/_url_state.ts
diff --git a/test/functional/apps/discover/group5/config.ts b/test/functional/apps/discover/group5/config.ts
new file mode 100644
index 0000000000000..a70a190ca63f8
--- /dev/null
+++ b/test/functional/apps/discover/group5/config.ts
@@ -0,0 +1,18 @@
+/*
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
+ * or more contributor license agreements. Licensed under the Elastic License
+ * 2.0 and the Server Side Public License, v 1; you may not use this file except
+ * in compliance with, at your election, the Elastic License 2.0 or the Server
+ * Side Public License, v 1.
+ */
+
+import { FtrConfigProviderContext } from '@kbn/test';
+
+export default async function ({ readConfigFile }: FtrConfigProviderContext) {
+ const functionalConfig = await readConfigFile(require.resolve('../../../config.base.js'));
+
+ return {
+ ...functionalConfig.getAll(),
+ testFiles: [require.resolve('.')],
+ };
+}
diff --git a/test/functional/apps/discover/group5/index.ts b/test/functional/apps/discover/group5/index.ts
new file mode 100644
index 0000000000000..bc875494307d6
--- /dev/null
+++ b/test/functional/apps/discover/group5/index.ts
@@ -0,0 +1,34 @@
+/*
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
+ * or more contributor license agreements. Licensed under the Elastic License
+ * 2.0 and the Server Side Public License, v 1; you may not use this file except
+ * in compliance with, at your election, the Elastic License 2.0 or the Server
+ * Side Public License, v 1.
+ */
+import { FtrProviderContext } from '../ftr_provider_context';
+
+export default function ({ getService, loadTestFile }: FtrProviderContext) {
+ const esArchiver = getService('esArchiver');
+ const browser = getService('browser');
+
+ describe('discover/group5', function () {
+ before(async function () {
+ await browser.setWindowSize(1300, 800);
+ });
+
+ after(async function unloadMakelogs() {
+ await esArchiver.unload('test/functional/fixtures/es_archiver/logstash_functional');
+ });
+
+ loadTestFile(require.resolve('./_no_data'));
+ loadTestFile(require.resolve('./_filter_editor'));
+ loadTestFile(require.resolve('./_field_data'));
+ loadTestFile(require.resolve('./_field_data_with_fields_api'));
+ loadTestFile(require.resolve('./_shared_links'));
+ loadTestFile(require.resolve('./_source_filters'));
+ loadTestFile(require.resolve('./_large_string'));
+ loadTestFile(require.resolve('./_greeting_screen'));
+ loadTestFile(require.resolve('./_inspector'));
+ loadTestFile(require.resolve('./_url_state'));
+ });
+}
diff --git a/test/functional/apps/discover/group3/_sidebar.ts b/test/functional/apps/discover/group6/_sidebar.ts
similarity index 100%
rename from test/functional/apps/discover/group3/_sidebar.ts
rename to test/functional/apps/discover/group6/_sidebar.ts
diff --git a/test/functional/apps/discover/group3/_sidebar_field_stats.ts b/test/functional/apps/discover/group6/_sidebar_field_stats.ts
similarity index 100%
rename from test/functional/apps/discover/group3/_sidebar_field_stats.ts
rename to test/functional/apps/discover/group6/_sidebar_field_stats.ts
diff --git a/test/functional/apps/discover/group3/_time_field_column.ts b/test/functional/apps/discover/group6/_time_field_column.ts
similarity index 100%
rename from test/functional/apps/discover/group3/_time_field_column.ts
rename to test/functional/apps/discover/group6/_time_field_column.ts
diff --git a/test/functional/apps/discover/group3/_unsaved_changes_badge.ts b/test/functional/apps/discover/group6/_unsaved_changes_badge.ts
similarity index 100%
rename from test/functional/apps/discover/group3/_unsaved_changes_badge.ts
rename to test/functional/apps/discover/group6/_unsaved_changes_badge.ts
diff --git a/test/functional/apps/discover/group3/_view_mode_toggle.ts b/test/functional/apps/discover/group6/_view_mode_toggle.ts
similarity index 100%
rename from test/functional/apps/discover/group3/_view_mode_toggle.ts
rename to test/functional/apps/discover/group6/_view_mode_toggle.ts
diff --git a/test/functional/apps/discover/group6/config.ts b/test/functional/apps/discover/group6/config.ts
new file mode 100644
index 0000000000000..a70a190ca63f8
--- /dev/null
+++ b/test/functional/apps/discover/group6/config.ts
@@ -0,0 +1,18 @@
+/*
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
+ * or more contributor license agreements. Licensed under the Elastic License
+ * 2.0 and the Server Side Public License, v 1; you may not use this file except
+ * in compliance with, at your election, the Elastic License 2.0 or the Server
+ * Side Public License, v 1.
+ */
+
+import { FtrConfigProviderContext } from '@kbn/test';
+
+export default async function ({ readConfigFile }: FtrConfigProviderContext) {
+ const functionalConfig = await readConfigFile(require.resolve('../../../config.base.js'));
+
+ return {
+ ...functionalConfig.getAll(),
+ testFiles: [require.resolve('.')],
+ };
+}
diff --git a/test/functional/apps/discover/group6/index.ts b/test/functional/apps/discover/group6/index.ts
new file mode 100644
index 0000000000000..f71d96e63d2fd
--- /dev/null
+++ b/test/functional/apps/discover/group6/index.ts
@@ -0,0 +1,29 @@
+/*
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
+ * or more contributor license agreements. Licensed under the Elastic License
+ * 2.0 and the Server Side Public License, v 1; you may not use this file except
+ * in compliance with, at your election, the Elastic License 2.0 or the Server
+ * Side Public License, v 1.
+ */
+import { FtrProviderContext } from '../ftr_provider_context';
+
+export default function ({ getService, loadTestFile }: FtrProviderContext) {
+ const esArchiver = getService('esArchiver');
+ const browser = getService('browser');
+
+ describe('discover/group6', function () {
+ before(async function () {
+ await browser.setWindowSize(1300, 800);
+ });
+
+ after(async function unloadMakelogs() {
+ await esArchiver.unload('test/functional/fixtures/es_archiver/logstash_functional');
+ });
+
+ loadTestFile(require.resolve('./_sidebar'));
+ loadTestFile(require.resolve('./_sidebar_field_stats'));
+ loadTestFile(require.resolve('./_time_field_column'));
+ loadTestFile(require.resolve('./_unsaved_changes_badge'));
+ loadTestFile(require.resolve('./_view_mode_toggle'));
+ });
+}
diff --git a/test/functional/apps/discover/group4/_huge_fields.ts b/test/functional/apps/discover/group7/_huge_fields.ts
similarity index 100%
rename from test/functional/apps/discover/group4/_huge_fields.ts
rename to test/functional/apps/discover/group7/_huge_fields.ts
diff --git a/test/functional/apps/discover/group4/_indexpattern_with_unmapped_fields.ts b/test/functional/apps/discover/group7/_indexpattern_with_unmapped_fields.ts
similarity index 100%
rename from test/functional/apps/discover/group4/_indexpattern_with_unmapped_fields.ts
rename to test/functional/apps/discover/group7/_indexpattern_with_unmapped_fields.ts
diff --git a/test/functional/apps/discover/group4/_indexpattern_without_timefield.ts b/test/functional/apps/discover/group7/_indexpattern_without_timefield.ts
similarity index 100%
rename from test/functional/apps/discover/group4/_indexpattern_without_timefield.ts
rename to test/functional/apps/discover/group7/_indexpattern_without_timefield.ts
diff --git a/test/functional/apps/discover/group4/_new_search.ts b/test/functional/apps/discover/group7/_new_search.ts
similarity index 100%
rename from test/functional/apps/discover/group4/_new_search.ts
rename to test/functional/apps/discover/group7/_new_search.ts
diff --git a/test/functional/apps/discover/group4/_request_cancellation.ts b/test/functional/apps/discover/group7/_request_cancellation.ts
similarity index 100%
rename from test/functional/apps/discover/group4/_request_cancellation.ts
rename to test/functional/apps/discover/group7/_request_cancellation.ts
diff --git a/test/functional/apps/discover/group4/_runtime_fields_editor.ts b/test/functional/apps/discover/group7/_runtime_fields_editor.ts
similarity index 100%
rename from test/functional/apps/discover/group4/_runtime_fields_editor.ts
rename to test/functional/apps/discover/group7/_runtime_fields_editor.ts
diff --git a/test/functional/apps/discover/group4/_search_on_page_load.ts b/test/functional/apps/discover/group7/_search_on_page_load.ts
similarity index 100%
rename from test/functional/apps/discover/group4/_search_on_page_load.ts
rename to test/functional/apps/discover/group7/_search_on_page_load.ts
diff --git a/test/functional/apps/discover/group7/config.ts b/test/functional/apps/discover/group7/config.ts
new file mode 100644
index 0000000000000..a70a190ca63f8
--- /dev/null
+++ b/test/functional/apps/discover/group7/config.ts
@@ -0,0 +1,18 @@
+/*
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
+ * or more contributor license agreements. Licensed under the Elastic License
+ * 2.0 and the Server Side Public License, v 1; you may not use this file except
+ * in compliance with, at your election, the Elastic License 2.0 or the Server
+ * Side Public License, v 1.
+ */
+
+import { FtrConfigProviderContext } from '@kbn/test';
+
+export default async function ({ readConfigFile }: FtrConfigProviderContext) {
+ const functionalConfig = await readConfigFile(require.resolve('../../../config.base.js'));
+
+ return {
+ ...functionalConfig.getAll(),
+ testFiles: [require.resolve('.')],
+ };
+}
diff --git a/test/functional/apps/discover/group7/index.ts b/test/functional/apps/discover/group7/index.ts
new file mode 100644
index 0000000000000..3abc84514f15d
--- /dev/null
+++ b/test/functional/apps/discover/group7/index.ts
@@ -0,0 +1,31 @@
+/*
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
+ * or more contributor license agreements. Licensed under the Elastic License
+ * 2.0 and the Server Side Public License, v 1; you may not use this file except
+ * in compliance with, at your election, the Elastic License 2.0 or the Server
+ * Side Public License, v 1.
+ */
+import { FtrProviderContext } from '../ftr_provider_context';
+
+export default function ({ getService, loadTestFile }: FtrProviderContext) {
+ const esArchiver = getService('esArchiver');
+ const browser = getService('browser');
+
+ describe('discover/group7', function () {
+ before(async function () {
+ await browser.setWindowSize(1600, 1200);
+ });
+
+ after(async function unloadMakelogs() {
+ await esArchiver.unload('test/functional/fixtures/es_archiver/logstash_functional');
+ });
+
+ loadTestFile(require.resolve('./_indexpattern_without_timefield'));
+ loadTestFile(require.resolve('./_indexpattern_with_unmapped_fields'));
+ loadTestFile(require.resolve('./_runtime_fields_editor'));
+ loadTestFile(require.resolve('./_huge_fields'));
+ loadTestFile(require.resolve('./_search_on_page_load'));
+ loadTestFile(require.resolve('./_request_cancellation'));
+ loadTestFile(require.resolve('./_new_search'));
+ });
+}
diff --git a/test/functional/apps/discover/group4/_hide_announcements.ts b/test/functional/apps/discover/group8/_hide_announcements.ts
similarity index 100%
rename from test/functional/apps/discover/group4/_hide_announcements.ts
rename to test/functional/apps/discover/group8/_hide_announcements.ts
diff --git a/test/functional/apps/discover/group8/config.ts b/test/functional/apps/discover/group8/config.ts
new file mode 100644
index 0000000000000..a70a190ca63f8
--- /dev/null
+++ b/test/functional/apps/discover/group8/config.ts
@@ -0,0 +1,18 @@
+/*
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
+ * or more contributor license agreements. Licensed under the Elastic License
+ * 2.0 and the Server Side Public License, v 1; you may not use this file except
+ * in compliance with, at your election, the Elastic License 2.0 or the Server
+ * Side Public License, v 1.
+ */
+
+import { FtrConfigProviderContext } from '@kbn/test';
+
+export default async function ({ readConfigFile }: FtrConfigProviderContext) {
+ const functionalConfig = await readConfigFile(require.resolve('../../../config.base.js'));
+
+ return {
+ ...functionalConfig.getAll(),
+ testFiles: [require.resolve('.')],
+ };
+}
diff --git a/test/functional/apps/discover/group8/index.ts b/test/functional/apps/discover/group8/index.ts
new file mode 100644
index 0000000000000..09aaca23e8b95
--- /dev/null
+++ b/test/functional/apps/discover/group8/index.ts
@@ -0,0 +1,25 @@
+/*
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
+ * or more contributor license agreements. Licensed under the Elastic License
+ * 2.0 and the Server Side Public License, v 1; you may not use this file except
+ * in compliance with, at your election, the Elastic License 2.0 or the Server
+ * Side Public License, v 1.
+ */
+import { FtrProviderContext } from '../ftr_provider_context';
+
+export default function ({ getService, loadTestFile }: FtrProviderContext) {
+ const esArchiver = getService('esArchiver');
+ const browser = getService('browser');
+
+ describe('discover/group8', function () {
+ before(async function () {
+ await browser.setWindowSize(1600, 1200);
+ });
+
+ after(async function unloadMakelogs() {
+ await esArchiver.unload('test/functional/fixtures/es_archiver/logstash_functional');
+ });
+
+ loadTestFile(require.resolve('./_hide_announcements'));
+ });
+}
diff --git a/test/functional/firefox/discover.config.ts b/test/functional/firefox/discover.config.ts
index 8b7e7205cd434..5c9f9c0939754 100644
--- a/test/functional/firefox/discover.config.ts
+++ b/test/functional/firefox/discover.config.ts
@@ -19,9 +19,15 @@ export default async function ({ readConfigFile }: FtrConfigProviderContext) {
testFiles: [
require.resolve('../apps/discover/classic'),
require.resolve('../apps/discover/group1'),
- require.resolve('../apps/discover/group2'),
+ require.resolve('../apps/discover/group2_data_grid1'),
+ require.resolve('../apps/discover/group2_data_grid2'),
+ require.resolve('../apps/discover/group2_data_grid3'),
require.resolve('../apps/discover/group3'),
require.resolve('../apps/discover/group4'),
+ require.resolve('../apps/discover/group5'),
+ require.resolve('../apps/discover/group6'),
+ require.resolve('../apps/discover/group7'),
+ require.resolve('../apps/discover/group8'),
],
junit: {
diff --git a/tsconfig.base.json b/tsconfig.base.json
index 17e13abcd5b5d..6f59b5dcfceea 100644
--- a/tsconfig.base.json
+++ b/tsconfig.base.json
@@ -762,8 +762,6 @@
"@kbn/embeddable-enhanced-plugin/*": ["x-pack/plugins/embeddable_enhanced/*"],
"@kbn/embeddable-examples-plugin": ["examples/embeddable_examples"],
"@kbn/embeddable-examples-plugin/*": ["examples/embeddable_examples/*"],
- "@kbn/embeddable-explorer-plugin": ["examples/embeddable_explorer"],
- "@kbn/embeddable-explorer-plugin/*": ["examples/embeddable_explorer/*"],
"@kbn/embeddable-plugin": ["src/plugins/embeddable"],
"@kbn/embeddable-plugin/*": ["src/plugins/embeddable/*"],
"@kbn/embedded-lens-example-plugin": ["x-pack/examples/embedded_lens_example"],
diff --git a/x-pack/plugins/observability_solution/apm/server/lib/transaction_groups/get_failed_transaction_rate.ts b/x-pack/plugins/observability_solution/apm/server/lib/transaction_groups/get_failed_transaction_rate.ts
index 08448ef50dc4b..4b1ee98c48cd3 100644
--- a/x-pack/plugins/observability_solution/apm/server/lib/transaction_groups/get_failed_transaction_rate.ts
+++ b/x-pack/plugins/observability_solution/apm/server/lib/transaction_groups/get_failed_transaction_rate.ts
@@ -4,7 +4,7 @@
* 2.0; you may not use this file except in compliance with the Elastic License
* 2.0.
*/
-
+import { BoolQuery } from '@kbn/es-query';
import { kqlQuery, rangeQuery, termQuery } from '@kbn/observability-plugin/server';
import { ApmServiceTransactionDocumentType } from '../../../common/document_type';
import { SERVICE_NAME, TRANSACTION_NAME, TRANSACTION_TYPE } from '../../../common/es_fields/apm';
@@ -22,6 +22,7 @@ import {
export async function getFailedTransactionRate({
environment,
kuery,
+ filters,
serviceName,
transactionTypes,
transactionName,
@@ -35,6 +36,7 @@ export async function getFailedTransactionRate({
}: {
environment: string;
kuery: string;
+ filters?: BoolQuery;
serviceName: string;
transactionTypes: string[];
transactionName?: string;
@@ -62,7 +64,9 @@ export async function getFailedTransactionRate({
...rangeQuery(startWithOffset, endWithOffset),
...environmentQuery(environment),
...kqlQuery(kuery),
+ ...(filters?.filter || []),
];
+ const mustNot = filters?.must_not || [];
const outcomes = getOutcomeAggregation(documentType);
@@ -73,7 +77,7 @@ export async function getFailedTransactionRate({
body: {
track_total_hits: false,
size: 0,
- query: { bool: { filter } },
+ query: { bool: { filter, must_not: mustNot } },
aggs: {
...outcomes,
timeseries: {
diff --git a/x-pack/plugins/observability_solution/apm/server/routes/apm_routes/register_apm_server_routes.test.ts b/x-pack/plugins/observability_solution/apm/server/routes/apm_routes/register_apm_server_routes.test.ts
index 47ada9ee20f4c..c5e652fa910d0 100644
--- a/x-pack/plugins/observability_solution/apm/server/routes/apm_routes/register_apm_server_routes.test.ts
+++ b/x-pack/plugins/observability_solution/apm/server/routes/apm_routes/register_apm_server_routes.test.ts
@@ -256,7 +256,8 @@ describe('createApi', () => {
expect(response.custom).toHaveBeenCalledWith({
body: {
attributes: { _inspect: [], data: null },
- message: 'Invalid value "1" supplied to "query,_inspect"',
+ message: `Failed to validate:
+ in /query/_inspect: 1 does not match expected type pipe(JSON, boolean)`,
},
statusCode: 400,
});
diff --git a/x-pack/plugins/observability_solution/apm/server/routes/default_api_types.test.ts b/x-pack/plugins/observability_solution/apm/server/routes/default_api_types.test.ts
new file mode 100644
index 0000000000000..baeda52f7fc3c
--- /dev/null
+++ b/x-pack/plugins/observability_solution/apm/server/routes/default_api_types.test.ts
@@ -0,0 +1,42 @@
+/*
+ * 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 { isLeft } from 'fp-ts/lib/Either';
+import { filtersRt } from './default_api_types';
+
+describe('filtersRt', () => {
+ it('should decode', () => {
+ const filters =
+ '{"must_not":[{"term":{"service.name":"myService"}}],"filter":[{"range":{"@timestamp":{"gte":1617273600000,"lte":1617277200000}}}]}';
+ const result = filtersRt.decode(filters);
+ expect(result).toEqual({
+ _tag: 'Right',
+ right: {
+ should: [],
+ must: [],
+ must_not: [{ term: { 'service.name': 'myService' } }],
+ filter: [{ range: { '@timestamp': { gte: 1617273600000, lte: 1617277200000 } } }],
+ },
+ });
+ });
+
+ it.each(['3', 'true', '{}'])('should not decode invalid filter JSON: %s', (invalidJson) => {
+ const filters = `{ "filter": ${invalidJson}}`;
+ const result = filtersRt.decode(filters);
+ // @ts-ignore-next-line
+ expect(result.left[0].message).toEqual('filters.filter is not iterable');
+ expect(isLeft(result)).toEqual(true);
+ });
+
+ it.each(['3', 'true', '{}'])('should not decode invalid must_not JSON: %s', (invalidJson) => {
+ const filters = `{ "must_not": ${invalidJson}}`;
+ const result = filtersRt.decode(filters);
+ // @ts-ignore-next-line
+ expect(result.left[0].message).toEqual('filters.must_not is not iterable');
+ expect(isLeft(result)).toEqual(true);
+ });
+});
diff --git a/x-pack/plugins/observability_solution/apm/server/routes/default_api_types.ts b/x-pack/plugins/observability_solution/apm/server/routes/default_api_types.ts
index a58a5a24af7b5..42ab1b63d431e 100644
--- a/x-pack/plugins/observability_solution/apm/server/routes/default_api_types.ts
+++ b/x-pack/plugins/observability_solution/apm/server/routes/default_api_types.ts
@@ -7,6 +7,8 @@
import * as t from 'io-ts';
import { isoToEpochRt, toNumberRt } from '@kbn/io-ts-utils';
+import { either } from 'fp-ts/lib/Either';
+import { BoolQuery } from '@kbn/es-query';
import { ApmDocumentType } from '../../common/document_type';
import { RollupInterval } from '../../common/rollup';
@@ -48,3 +50,31 @@ export const transactionDataSourceRt = t.type({
t.literal(RollupInterval.None),
]),
});
+
+const BoolQueryRt = t.type({
+ should: t.array(t.record(t.string, t.unknown)),
+ must: t.array(t.record(t.string, t.unknown)),
+ must_not: t.array(t.record(t.string, t.unknown)),
+ filter: t.array(t.record(t.string, t.unknown)),
+});
+
+export const filtersRt = new t.Type(
+ 'BoolQuery',
+ BoolQueryRt.is,
+ (input: unknown, context: t.Context) =>
+ either.chain(t.string.validate(input, context), (value: string) => {
+ try {
+ const filters = JSON.parse(value);
+ const decoded = {
+ should: [],
+ must: [],
+ must_not: filters.must_not ? [...filters.must_not] : [],
+ filter: filters.filter ? [...filters.filter] : [],
+ };
+ return t.success(decoded);
+ } catch (err) {
+ return t.failure(input, context, err.message);
+ }
+ }),
+ (filters: BoolQuery): string => JSON.stringify(filters)
+);
diff --git a/x-pack/plugins/observability_solution/apm/server/routes/services/get_throughput.ts b/x-pack/plugins/observability_solution/apm/server/routes/services/get_throughput.ts
index 5d45ea28c95e5..b5c48484e1039 100644
--- a/x-pack/plugins/observability_solution/apm/server/routes/services/get_throughput.ts
+++ b/x-pack/plugins/observability_solution/apm/server/routes/services/get_throughput.ts
@@ -4,7 +4,7 @@
* 2.0; you may not use this file except in compliance with the Elastic License
* 2.0.
*/
-
+import { BoolQuery } from '@kbn/es-query';
import { kqlQuery, rangeQuery, termQuery } from '@kbn/observability-plugin/server';
import { ApmServiceTransactionDocumentType } from '../../../common/document_type';
import { SERVICE_NAME, TRANSACTION_NAME, TRANSACTION_TYPE } from '../../../common/es_fields/apm';
@@ -17,6 +17,7 @@ import { Maybe } from '../../../typings/common';
interface Options {
environment: string;
kuery: string;
+ filters?: BoolQuery;
serviceName: string;
apmEventClient: APMEventClient;
transactionType: string;
@@ -34,6 +35,7 @@ export type ServiceThroughputResponse = Array<{ x: number; y: Maybe }>;
export async function getThroughput({
environment,
kuery,
+ filters,
serviceName,
apmEventClient,
transactionType,
@@ -67,7 +69,9 @@ export async function getThroughput({
...environmentQuery(environment),
...kqlQuery(kuery),
...termQuery(TRANSACTION_NAME, transactionName),
+ ...(filters?.filter ?? []),
],
+ must_not: [...(filters?.must_not ?? [])],
},
},
aggs: {
diff --git a/x-pack/plugins/observability_solution/apm/server/routes/services/route.ts b/x-pack/plugins/observability_solution/apm/server/routes/services/route.ts
index 05fdeec8fdf5d..4b0ef92450f34 100644
--- a/x-pack/plugins/observability_solution/apm/server/routes/services/route.ts
+++ b/x-pack/plugins/observability_solution/apm/server/routes/services/route.ts
@@ -33,6 +33,7 @@ import { withApmSpan } from '../../utils/with_apm_span';
import { createApmServerRoute } from '../apm_routes/create_apm_server_route';
import {
environmentRt,
+ filtersRt,
kueryRt,
probabilityRt,
rangeRt,
@@ -495,7 +496,7 @@ const serviceThroughputRoute = createApmServerRoute({
}),
query: t.intersection([
t.type({ transactionType: t.string, bucketSizeInSeconds: toNumberRt }),
- t.partial({ transactionName: t.string }),
+ t.partial({ transactionName: t.string, filters: filtersRt }),
t.intersection([environmentRt, kueryRt, rangeRt, offsetRt, serviceTransactionDataSourceRt]),
]),
}),
@@ -512,6 +513,7 @@ const serviceThroughputRoute = createApmServerRoute({
const {
environment,
kuery,
+ filters,
transactionType,
transactionName,
offset,
@@ -525,6 +527,7 @@ const serviceThroughputRoute = createApmServerRoute({
const commonProps = {
environment,
kuery,
+ filters,
serviceName,
apmEventClient,
transactionType,
diff --git a/x-pack/plugins/observability_solution/apm/server/routes/transactions/get_failed_transaction_rate_periods.ts b/x-pack/plugins/observability_solution/apm/server/routes/transactions/get_failed_transaction_rate_periods.ts
index 5b77a780bce6a..c2ba9d1014a67 100644
--- a/x-pack/plugins/observability_solution/apm/server/routes/transactions/get_failed_transaction_rate_periods.ts
+++ b/x-pack/plugins/observability_solution/apm/server/routes/transactions/get_failed_transaction_rate_periods.ts
@@ -4,6 +4,7 @@
* 2.0; you may not use this file except in compliance with the Elastic License
* 2.0.
*/
+import { BoolQuery } from '@kbn/es-query';
import { getFailedTransactionRate } from '../../lib/transaction_groups/get_failed_transaction_rate';
import { offsetPreviousPeriodCoordinates } from '../../../common/utils/offset_previous_period_coordinate';
import { APMEventClient } from '../../lib/helpers/create_es_client/create_apm_event_client';
@@ -25,6 +26,7 @@ export interface FailedTransactionRateResponse {
export async function getFailedTransactionRatePeriods({
environment,
kuery,
+ filters,
serviceName,
transactionType,
transactionName,
@@ -38,6 +40,7 @@ export async function getFailedTransactionRatePeriods({
}: {
environment: string;
kuery: string;
+ filters?: BoolQuery;
serviceName: string;
transactionType: string;
transactionName?: string;
@@ -52,6 +55,7 @@ export async function getFailedTransactionRatePeriods({
const commonProps = {
environment,
kuery,
+ filters,
serviceName,
transactionTypes: [transactionType],
transactionName,
diff --git a/x-pack/plugins/observability_solution/apm/server/routes/transactions/get_latency_charts/index.ts b/x-pack/plugins/observability_solution/apm/server/routes/transactions/get_latency_charts/index.ts
index f05682ca047bb..70e9555af4849 100644
--- a/x-pack/plugins/observability_solution/apm/server/routes/transactions/get_latency_charts/index.ts
+++ b/x-pack/plugins/observability_solution/apm/server/routes/transactions/get_latency_charts/index.ts
@@ -4,7 +4,7 @@
* 2.0; you may not use this file except in compliance with the Elastic License
* 2.0.
*/
-
+import { BoolQuery } from '@kbn/es-query';
import { kqlQuery, rangeQuery, termQuery } from '@kbn/observability-plugin/server';
import { ApmServiceTransactionDocumentType } from '../../../../common/document_type';
import {
@@ -29,6 +29,7 @@ import { getDurationFieldForTransactions } from '../../../lib/helpers/transactio
function searchLatency({
environment,
kuery,
+ filters,
serviceName,
transactionType,
transactionName,
@@ -45,6 +46,7 @@ function searchLatency({
}: {
environment: string;
kuery: string;
+ filters?: BoolQuery;
serviceName: string;
transactionType: string | undefined;
transactionName: string | undefined;
@@ -87,7 +89,9 @@ function searchLatency({
...termQuery(TRANSACTION_NAME, transactionName),
...termQuery(TRANSACTION_TYPE, transactionType),
...termQuery(FAAS_ID, serverlessId),
+ ...(filters?.filter || []),
],
+ must_not: filters?.must_not || [],
},
},
aggs: {
@@ -111,6 +115,7 @@ function searchLatency({
export async function getLatencyTimeseries({
environment,
kuery,
+ filters,
serviceName,
transactionType,
transactionName,
@@ -127,6 +132,7 @@ export async function getLatencyTimeseries({
}: {
environment: string;
kuery: string;
+ filters?: BoolQuery;
serviceName: string;
transactionType?: string;
transactionName?: string;
@@ -144,6 +150,7 @@ export async function getLatencyTimeseries({
const response = await searchLatency({
environment,
kuery,
+ filters,
serviceName,
transactionType,
transactionName,
@@ -195,6 +202,7 @@ export async function getLatencyPeriods({
apmEventClient,
latencyAggregationType,
kuery,
+ filters,
environment,
start,
end,
@@ -210,6 +218,7 @@ export async function getLatencyPeriods({
apmEventClient: APMEventClient;
latencyAggregationType: LatencyAggregationType;
kuery: string;
+ filters?: BoolQuery;
environment: string;
start: number;
end: number;
@@ -225,6 +234,7 @@ export async function getLatencyPeriods({
transactionName,
apmEventClient,
kuery,
+ filters,
environment,
documentType,
rollupInterval,
diff --git a/x-pack/plugins/observability_solution/apm/server/routes/transactions/route.ts b/x-pack/plugins/observability_solution/apm/server/routes/transactions/route.ts
index 8e6b8a654a030..816879d7cb40a 100644
--- a/x-pack/plugins/observability_solution/apm/server/routes/transactions/route.ts
+++ b/x-pack/plugins/observability_solution/apm/server/routes/transactions/route.ts
@@ -4,7 +4,6 @@
* 2.0; you may not use this file except in compliance with the Elastic License
* 2.0.
*/
-
import { jsonRt, toBooleanRt, toNumberRt } from '@kbn/io-ts-utils';
import * as t from 'io-ts';
import { offsetRt } from '../../../common/comparison_rt';
@@ -23,6 +22,7 @@ import {
import { createApmServerRoute } from '../apm_routes/create_apm_server_route';
import {
environmentRt,
+ filtersRt,
kueryRt,
rangeRt,
serviceTransactionDataSourceRt,
@@ -221,7 +221,7 @@ const transactionLatencyChartsRoute = createApmServerRoute({
bucketSizeInSeconds: toNumberRt,
useDurationSummary: toBooleanRt,
}),
- t.partial({ transactionName: t.string }),
+ t.partial({ transactionName: t.string, filters: filtersRt }),
t.intersection([environmentRt, kueryRt, rangeRt, offsetRt]),
serviceTransactionDataSourceRt,
]),
@@ -235,6 +235,7 @@ const transactionLatencyChartsRoute = createApmServerRoute({
const {
environment,
kuery,
+ filters,
transactionType,
transactionName,
latencyAggregationType,
@@ -250,6 +251,7 @@ const transactionLatencyChartsRoute = createApmServerRoute({
const options = {
environment,
kuery,
+ filters,
serviceName,
transactionType,
transactionName,
@@ -372,7 +374,7 @@ const transactionChartsErrorRateRoute = createApmServerRoute({
}),
query: t.intersection([
t.type({ transactionType: t.string, bucketSizeInSeconds: toNumberRt }),
- t.partial({ transactionName: t.string }),
+ t.partial({ transactionName: t.string, filters: filtersRt }),
t.intersection([environmentRt, kueryRt, rangeRt, offsetRt, serviceTransactionDataSourceRt]),
]),
}),
@@ -385,6 +387,7 @@ const transactionChartsErrorRateRoute = createApmServerRoute({
const {
environment,
kuery,
+ filters,
transactionType,
transactionName,
start,
@@ -398,6 +401,7 @@ const transactionChartsErrorRateRoute = createApmServerRoute({
return getFailedTransactionRatePeriods({
environment,
kuery,
+ filters,
serviceName,
transactionType,
transactionName,
diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/left/components/correlations_details.test.tsx b/x-pack/plugins/security_solution/public/flyout/document_details/left/components/correlations_details.test.tsx
index aad62c152773a..a0a147d9754d5 100644
--- a/x-pack/plugins/security_solution/public/flyout/document_details/left/components/correlations_details.test.tsx
+++ b/x-pack/plugins/security_solution/public/flyout/document_details/left/components/correlations_details.test.tsx
@@ -27,6 +27,7 @@ import { useFetchRelatedAlertsByAncestry } from '../../shared/hooks/use_fetch_re
import { useFetchRelatedAlertsBySameSourceEvent } from '../../shared/hooks/use_fetch_related_alerts_by_same_source_event';
import { useFetchRelatedCases } from '../../shared/hooks/use_fetch_related_cases';
import { mockContextValue } from '../mocks/mock_context';
+import { useTimelineDataFilters } from '../../../../timelines/containers/use_timeline_data_filters';
import { EXPANDABLE_PANEL_HEADER_TITLE_TEXT_TEST_ID } from '../../../shared/components/test_ids';
jest.mock('react-router-dom', () => {
@@ -43,6 +44,11 @@ jest.mock('../../shared/hooks/use_fetch_related_alerts_by_ancestry');
jest.mock('../../shared/hooks/use_fetch_related_alerts_by_same_source_event');
jest.mock('../../shared/hooks/use_fetch_related_cases');
+jest.mock('../../../../timelines/containers/use_timeline_data_filters', () => ({
+ useTimelineDataFilters: jest.fn(),
+}));
+const mockUseTimelineDataFilters = useTimelineDataFilters as jest.Mock;
+
const renderCorrelationDetails = () => {
return render(
@@ -62,12 +68,13 @@ const NO_DATA_MESSAGE = 'No correlations data available.';
describe('CorrelationsDetails', () => {
beforeEach(() => {
jest.clearAllMocks();
+ mockUseTimelineDataFilters.mockReturnValue({ selectedPatterns: ['index'] });
});
it('renders all sections', () => {
jest
.mocked(useShowRelatedAlertsByAncestry)
- .mockReturnValue({ show: true, documentId: 'event-id', indices: ['index1'] });
+ .mockReturnValue({ show: true, documentId: 'event-id' });
jest
.mocked(useShowRelatedAlertsBySameSourceEvent)
.mockReturnValue({ show: true, originalEventId: 'originalEventId' });
@@ -115,7 +122,7 @@ describe('CorrelationsDetails', () => {
it('should render no section and show error message if show values are false', () => {
jest
.mocked(useShowRelatedAlertsByAncestry)
- .mockReturnValue({ show: false, documentId: 'event-id', indices: ['index1'] });
+ .mockReturnValue({ show: false, documentId: 'event-id' });
jest
.mocked(useShowRelatedAlertsBySameSourceEvent)
.mockReturnValue({ show: false, originalEventId: 'originalEventId' });
@@ -142,30 +149,4 @@ describe('CorrelationsDetails', () => {
).not.toBeInTheDocument();
expect(getByText(NO_DATA_MESSAGE)).toBeInTheDocument();
});
-
- it('should render no section if values are null', () => {
- jest
- .mocked(useShowRelatedAlertsByAncestry)
- .mockReturnValue({ show: true, documentId: 'event-id' });
- jest.mocked(useShowRelatedAlertsBySameSourceEvent).mockReturnValue({ show: true });
- jest.mocked(useShowRelatedAlertsBySession).mockReturnValue({ show: true });
- jest.mocked(useShowRelatedCases).mockReturnValue(false);
- jest.mocked(useShowSuppressedAlerts).mockReturnValue({ show: false, alertSuppressionCount: 0 });
-
- const { queryByTestId } = renderCorrelationDetails();
-
- expect(
- queryByTestId(CORRELATIONS_DETAILS_BY_ANCESTRY_SECTION_TABLE_TEST_ID)
- ).not.toBeInTheDocument();
- expect(
- queryByTestId(CORRELATIONS_DETAILS_BY_SOURCE_SECTION_TABLE_TEST_ID)
- ).not.toBeInTheDocument();
- expect(
- queryByTestId(CORRELATIONS_DETAILS_BY_SESSION_SECTION_TABLE_TEST_ID)
- ).not.toBeInTheDocument();
- expect(queryByTestId(CORRELATIONS_DETAILS_CASES_SECTION_TABLE_TEST_ID)).not.toBeInTheDocument();
- expect(
- queryByTestId(CORRELATIONS_DETAILS_SUPPRESSED_ALERTS_TITLE_TEST_ID)
- ).not.toBeInTheDocument();
- });
});
diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/left/components/correlations_details.tsx b/x-pack/plugins/security_solution/public/flyout/document_details/left/components/correlations_details.tsx
index 226fbe4d7a4d6..9c5a33a04a243 100644
--- a/x-pack/plugins/security_solution/public/flyout/document_details/left/components/correlations_details.tsx
+++ b/x-pack/plugins/security_solution/public/flyout/document_details/left/components/correlations_details.tsx
@@ -20,6 +20,8 @@ import { useShowRelatedAlertsBySameSourceEvent } from '../../shared/hooks/use_sh
import { useShowRelatedAlertsBySession } from '../../shared/hooks/use_show_related_alerts_by_session';
import { RelatedAlertsByAncestry } from './related_alerts_by_ancestry';
import { SuppressedAlerts } from './suppressed_alerts';
+import { useTimelineDataFilters } from '../../../../timelines/containers/use_timeline_data_filters';
+import { isActiveTimeline } from '../../../../helpers';
export const CORRELATIONS_TAB_ID = 'correlations';
@@ -27,27 +29,18 @@ export const CORRELATIONS_TAB_ID = 'correlations';
* Correlations displayed in the document details expandable flyout left section under the Insights tab
*/
export const CorrelationsDetails: React.FC = () => {
- const {
- dataAsNestedObject,
- dataFormattedForFieldBrowser,
- eventId,
- getFieldsData,
- scopeId,
- isPreview,
- } = useLeftPanelContext();
+ const { dataAsNestedObject, eventId, getFieldsData, scopeId, isPreview } = useLeftPanelContext();
+
+ const { selectedPatterns } = useTimelineDataFilters(isActiveTimeline(scopeId));
- const {
- show: showAlertsByAncestry,
- indices,
- documentId,
- } = useShowRelatedAlertsByAncestry({
+ const { show: showAlertsByAncestry, documentId } = useShowRelatedAlertsByAncestry({
getFieldsData,
dataAsNestedObject,
- dataFormattedForFieldBrowser,
eventId,
isPreview,
});
const { show: showSameSourceAlerts, originalEventId } = useShowRelatedAlertsBySameSourceEvent({
+ eventId,
getFieldsData,
});
const { show: showAlertsBySession, entityId } = useShowRelatedAlertsBySession({ getFieldsData });
@@ -80,7 +73,7 @@ export const CorrelationsDetails: React.FC = () => {
)}
- {showSameSourceAlerts && originalEventId && (
+ {showSameSourceAlerts && (
{
)}
- {showAlertsByAncestry && documentId && indices && (
+ {showAlertsByAncestry && (
diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/left/components/related_alerts_by_same_source_event.test.tsx b/x-pack/plugins/security_solution/public/flyout/document_details/left/components/related_alerts_by_same_source_event.test.tsx
index 66902bd9bda34..e8334613d1d24 100644
--- a/x-pack/plugins/security_solution/public/flyout/document_details/left/components/related_alerts_by_same_source_event.test.tsx
+++ b/x-pack/plugins/security_solution/public/flyout/document_details/left/components/related_alerts_by_same_source_event.test.tsx
@@ -94,14 +94,21 @@ describe('', () => {
expect(getByTestId(CORRELATIONS_DETAILS_BY_SOURCE_SECTION_TABLE_TEST_ID)).toBeInTheDocument();
});
- it('should render null if error', () => {
+ it('should render no data message if error', () => {
(useFetchRelatedAlertsBySameSourceEvent as jest.Mock).mockReturnValue({
loading: false,
error: true,
+ data: [],
+ dataCount: 0,
+ });
+ (usePaginatedAlerts as jest.Mock).mockReturnValue({
+ loading: false,
+ error: false,
+ data: [],
});
- const { container } = renderRelatedAlertsBySameSourceEvent();
- expect(container).toBeEmptyDOMElement();
+ const { getByText } = renderRelatedAlertsBySameSourceEvent();
+ expect(getByText('No related source events.')).toBeInTheDocument();
});
it('should render no data message', () => {
diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/left/components/related_alerts_by_same_source_event.tsx b/x-pack/plugins/security_solution/public/flyout/document_details/left/components/related_alerts_by_same_source_event.tsx
index e3bbf48c5fe15..42c9d910d93c6 100644
--- a/x-pack/plugins/security_solution/public/flyout/document_details/left/components/related_alerts_by_same_source_event.tsx
+++ b/x-pack/plugins/security_solution/public/flyout/document_details/left/components/related_alerts_by_same_source_event.tsx
@@ -34,15 +34,11 @@ export const RelatedAlertsBySameSourceEvent: React.VFC {
- const { loading, error, data, dataCount } = useFetchRelatedAlertsBySameSourceEvent({
+ const { loading, data, dataCount } = useFetchRelatedAlertsBySameSourceEvent({
originalEventId,
scopeId,
});
- if (error) {
- return null;
- }
-
return (
({
ExpandableFlyoutProvider: ({ children }: React.PropsWithChildren<{}>) => <>{children}>,
}));
+jest.mock('../../../../timelines/containers/use_timeline_data_filters', () => ({
+ useTimelineDataFilters: jest.fn(),
+}));
+const mockUseTimelineDataFilters = useTimelineDataFilters as jest.Mock;
+
+const originalEventId = 'originalEventId';
+
describe('', () => {
beforeAll(() => {
jest.mocked(useExpandableFlyoutApi).mockReturnValue(flyoutContextValue);
+ mockUseTimelineDataFilters.mockReturnValue({ selectedPatterns: ['index'] });
});
it('should render wrapper component', () => {
jest
.mocked(useShowRelatedAlertsByAncestry)
.mockReturnValue({ show: false, documentId: 'event-id' });
- jest.mocked(useShowRelatedAlertsBySameSourceEvent).mockReturnValue({ show: false });
+ jest
+ .mocked(useShowRelatedAlertsBySameSourceEvent)
+ .mockReturnValue({ show: false, originalEventId });
jest.mocked(useShowRelatedAlertsBySession).mockReturnValue({ show: false });
jest.mocked(useShowRelatedCases).mockReturnValue(false);
jest.mocked(useShowSuppressedAlerts).mockReturnValue({ show: false, alertSuppressionCount: 0 });
@@ -117,7 +128,7 @@ describe('', () => {
it('should show component with all rows in expandable panel', () => {
jest
.mocked(useShowRelatedAlertsByAncestry)
- .mockReturnValue({ show: true, documentId: 'event-id', indices: ['index1'] });
+ .mockReturnValue({ show: true, documentId: 'event-id' });
jest
.mocked(useShowRelatedAlertsBySameSourceEvent)
.mockReturnValue({ show: true, originalEventId: 'originalEventId' });
@@ -160,7 +171,7 @@ describe('', () => {
it('should hide rows and show error message if show values are false', () => {
jest
.mocked(useShowRelatedAlertsByAncestry)
- .mockReturnValue({ show: false, documentId: 'event-id', indices: ['index1'] });
+ .mockReturnValue({ show: false, documentId: 'event-id' });
jest
.mocked(useShowRelatedAlertsBySameSourceEvent)
.mockReturnValue({ show: false, originalEventId: 'originalEventId' });
@@ -179,24 +190,6 @@ describe('', () => {
expect(getByText(NO_DATA_MESSAGE)).toBeInTheDocument();
});
- it('should hide rows if values are null', () => {
- jest
- .mocked(useShowRelatedAlertsByAncestry)
- .mockReturnValue({ show: true, documentId: 'event-id' });
- jest.mocked(useShowRelatedAlertsBySameSourceEvent).mockReturnValue({ show: true });
- jest.mocked(useShowRelatedAlertsBySession).mockReturnValue({ show: true });
- jest.mocked(useShowRelatedCases).mockReturnValue(false);
- jest.mocked(useShowSuppressedAlerts).mockReturnValue({ show: false, alertSuppressionCount: 0 });
-
- const { queryByTestId, queryByText } = render(renderCorrelationsOverview(panelContextValue));
- expect(queryByTestId(RELATED_ALERTS_BY_ANCESTRY_TEST_ID)).not.toBeInTheDocument();
- expect(queryByTestId(RELATED_ALERTS_BY_SAME_SOURCE_EVENT_TEST_ID)).not.toBeInTheDocument();
- expect(queryByTestId(RELATED_ALERTS_BY_SESSION_TEST_ID)).not.toBeInTheDocument();
- expect(queryByTestId(RELATED_CASES_TEST_ID)).not.toBeInTheDocument();
- expect(queryByTestId(SUPPRESSED_ALERTS_TEST_ID)).not.toBeInTheDocument();
- expect(queryByText(NO_DATA_MESSAGE)).not.toBeInTheDocument();
- });
-
it('should navigate to the left section Insights tab when clicking on button', () => {
const { getByTestId } = render(
diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/right/components/correlations_overview.tsx b/x-pack/plugins/security_solution/public/flyout/document_details/right/components/correlations_overview.tsx
index 6d91eabd00304..e272a058bf0da 100644
--- a/x-pack/plugins/security_solution/public/flyout/document_details/right/components/correlations_overview.tsx
+++ b/x-pack/plugins/security_solution/public/flyout/document_details/right/components/correlations_overview.tsx
@@ -24,6 +24,8 @@ import { CORRELATIONS_TEST_ID } from './test_ids';
import { useRightPanelContext } from '../context';
import { DocumentDetailsLeftPanelKey, LeftPanelInsightsTab } from '../../left';
import { CORRELATIONS_TAB_ID } from '../../left/components/correlations_details';
+import { useTimelineDataFilters } from '../../../../timelines/containers/use_timeline_data_filters';
+import { isActiveTimeline } from '../../../../helpers';
/**
* Correlations section under Insights section, overview tab.
@@ -31,17 +33,12 @@ import { CORRELATIONS_TAB_ID } from '../../left/components/correlations_details'
* and the SummaryPanel component for data rendering.
*/
export const CorrelationsOverview: React.FC = () => {
- const {
- dataAsNestedObject,
- dataFormattedForFieldBrowser,
- eventId,
- indexName,
- getFieldsData,
- scopeId,
- isPreview,
- } = useRightPanelContext();
+ const { dataAsNestedObject, eventId, indexName, getFieldsData, scopeId, isPreview } =
+ useRightPanelContext();
const { openLeftPanel } = useExpandableFlyoutApi();
+ const { selectedPatterns } = useTimelineDataFilters(isActiveTimeline(scopeId));
+
const goToCorrelationsTab = useCallback(() => {
openLeftPanel({
id: DocumentDetailsLeftPanelKey,
@@ -57,18 +54,14 @@ export const CorrelationsOverview: React.FC = () => {
});
}, [eventId, openLeftPanel, indexName, scopeId]);
- const {
- show: showAlertsByAncestry,
- documentId,
- indices,
- } = useShowRelatedAlertsByAncestry({
+ const { show: showAlertsByAncestry, documentId } = useShowRelatedAlertsByAncestry({
getFieldsData,
dataAsNestedObject,
- dataFormattedForFieldBrowser,
eventId,
isPreview,
});
const { show: showSameSourceAlerts, originalEventId } = useShowRelatedAlertsBySameSourceEvent({
+ eventId,
getFieldsData,
});
const { show: showAlertsBySession, entityId } = useShowRelatedAlertsBySession({ getFieldsData });
@@ -112,14 +105,18 @@ export const CorrelationsOverview: React.FC = () => {
)}
{showCases && }
- {showSameSourceAlerts && originalEventId && (
+ {showSameSourceAlerts && (
)}
{showAlertsBySession && entityId && (
)}
- {showAlertsByAncestry && documentId && indices && (
-
+ {showAlertsByAncestry && (
+
)}
) : (
diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/right/components/insights_section.test.tsx b/x-pack/plugins/security_solution/public/flyout/document_details/right/components/insights_section.test.tsx
index 71897773d801e..81f9c6d54457e 100644
--- a/x-pack/plugins/security_solution/public/flyout/document_details/right/components/insights_section.test.tsx
+++ b/x-pack/plugins/security_solution/public/flyout/document_details/right/components/insights_section.test.tsx
@@ -28,6 +28,7 @@ import { InsightsSection } from './insights_section';
import { useAlertPrevalence } from '../../../../common/containers/alerts/use_alert_prevalence';
import { useRiskScore } from '../../../../entity_analytics/api/hooks/use_risk_score';
import { useExpandSection } from '../hooks/use_expand_section';
+import { useTimelineDataFilters } from '../../../../timelines/containers/use_timeline_data_filters';
jest.mock('../../../../common/containers/alerts/use_alert_prevalence');
@@ -55,6 +56,11 @@ jest.mock('react-router-dom', () => {
alertIds: [],
});
+jest.mock('../../../../timelines/containers/use_timeline_data_filters', () => ({
+ useTimelineDataFilters: jest.fn(),
+}));
+const mockUseTimelineDataFilters = useTimelineDataFilters as jest.Mock;
+
const from = '2022-04-05T12:00:00.000Z';
const to = '2022-04-08T12:00:00.;000Z';
const selectedPatterns = 'alerts';
@@ -101,6 +107,7 @@ const renderInsightsSection = (contextValue: RightPanelContext) =>
describe('', () => {
beforeEach(() => {
+ mockUseTimelineDataFilters.mockReturnValue({ selectedPatterns: ['index'] });
mockUseUserDetails.mockReturnValue([false, { userDetails: null }]);
mockUseRiskScore.mockReturnValue({ data: null, isAuthorized: false });
mockUseHostDetails.mockReturnValue([false, { hostDetails: null }]);
diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/right/components/related_alerts_by_same_source_event.test.tsx b/x-pack/plugins/security_solution/public/flyout/document_details/right/components/related_alerts_by_same_source_event.test.tsx
index 59dfb183a1338..d52d547397789 100644
--- a/x-pack/plugins/security_solution/public/flyout/document_details/right/components/related_alerts_by_same_source_event.test.tsx
+++ b/x-pack/plugins/security_solution/public/flyout/document_details/right/components/related_alerts_by_same_source_event.test.tsx
@@ -79,13 +79,18 @@ describe('', () => {
expect(getByTestId(LOADING_TEST_ID)).toBeInTheDocument();
});
- it('should render null if error', () => {
+ it('should render 0 same source alert if error', () => {
(useFetchRelatedAlertsBySameSourceEvent as jest.Mock).mockReturnValue({
loading: false,
error: true,
+ dataCount: 0,
});
- const { container } = renderRelatedAlertsBySameSourceEvent();
- expect(container).toBeEmptyDOMElement();
+ const { getByTestId } = renderRelatedAlertsBySameSourceEvent();
+ expect(getByTestId(ICON_TEST_ID)).toBeInTheDocument();
+ const value = getByTestId(VALUE_TEST_ID);
+ expect(value).toBeInTheDocument();
+ expect(value).toHaveTextContent('0 alerts related by source event');
+ expect(getByTestId(VALUE_TEST_ID)).toBeInTheDocument();
});
});
diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/right/components/related_alerts_by_same_source_event.tsx b/x-pack/plugins/security_solution/public/flyout/document_details/right/components/related_alerts_by_same_source_event.tsx
index e309a2e4bc93a..0c1550dbb8692 100644
--- a/x-pack/plugins/security_solution/public/flyout/document_details/right/components/related_alerts_by_same_source_event.tsx
+++ b/x-pack/plugins/security_solution/public/flyout/document_details/right/components/related_alerts_by_same_source_event.tsx
@@ -31,7 +31,7 @@ export const RelatedAlertsBySameSourceEvent: React.VFC {
- const { loading, error, dataCount } = useFetchRelatedAlertsBySameSourceEvent({
+ const { loading, dataCount } = useFetchRelatedAlertsBySameSourceEvent({
originalEventId,
scopeId,
});
@@ -46,7 +46,6 @@ export const RelatedAlertsBySameSourceEvent: React.VFC;
const eventId = 'event-id';
const dataAsNestedObject = mockDataAsNestedObject;
-const dataFormattedForFieldBrowser = mockDataFormattedForFieldBrowser;
describe('useShowRelatedAlertsByAncestry', () => {
let hookResult: RenderHookResult<
@@ -53,7 +51,6 @@ describe('useShowRelatedAlertsByAncestry', () => {
useShowRelatedAlertsByAncestry({
getFieldsData,
dataAsNestedObject,
- dataFormattedForFieldBrowser,
eventId,
isPreview: false,
})
@@ -62,7 +59,6 @@ describe('useShowRelatedAlertsByAncestry', () => {
expect(hookResult.result.current).toEqual({
show: false,
documentId: 'event-id',
- indices: ['rule-parameters-index'],
});
});
@@ -74,7 +70,6 @@ describe('useShowRelatedAlertsByAncestry', () => {
useShowRelatedAlertsByAncestry({
getFieldsData,
dataAsNestedObject,
- dataFormattedForFieldBrowser,
eventId,
isPreview: false,
})
@@ -83,7 +78,6 @@ describe('useShowRelatedAlertsByAncestry', () => {
expect(hookResult.result.current).toEqual({
show: false,
documentId: 'event-id',
- indices: ['rule-parameters-index'],
});
});
@@ -95,7 +89,6 @@ describe('useShowRelatedAlertsByAncestry', () => {
useShowRelatedAlertsByAncestry({
getFieldsData,
dataAsNestedObject,
- dataFormattedForFieldBrowser,
eventId,
isPreview: false,
})
@@ -104,7 +97,6 @@ describe('useShowRelatedAlertsByAncestry', () => {
expect(hookResult.result.current).toEqual({
show: false,
documentId: 'event-id',
- indices: ['rule-parameters-index'],
});
});
@@ -117,7 +109,6 @@ describe('useShowRelatedAlertsByAncestry', () => {
useShowRelatedAlertsByAncestry({
getFieldsData,
dataAsNestedObject,
- dataFormattedForFieldBrowser,
eventId,
isPreview: false,
})
@@ -126,7 +117,6 @@ describe('useShowRelatedAlertsByAncestry', () => {
expect(hookResult.result.current).toEqual({
show: true,
documentId: 'event-id',
- indices: ['rule-parameters-index'],
});
});
@@ -139,7 +129,6 @@ describe('useShowRelatedAlertsByAncestry', () => {
useShowRelatedAlertsByAncestry({
getFieldsData,
dataAsNestedObject,
- dataFormattedForFieldBrowser,
eventId,
isPreview: true,
})
@@ -148,7 +137,6 @@ describe('useShowRelatedAlertsByAncestry', () => {
expect(hookResult.result.current).toEqual({
show: true,
documentId: 'ancestors-id',
- indices: ['rule-parameters-index'],
});
});
});
diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/shared/hooks/use_show_related_alerts_by_ancestry.ts b/x-pack/plugins/security_solution/public/flyout/document_details/shared/hooks/use_show_related_alerts_by_ancestry.ts
index 5a3f9c4f0b657..b11485f67ae6e 100644
--- a/x-pack/plugins/security_solution/public/flyout/document_details/shared/hooks/use_show_related_alerts_by_ancestry.ts
+++ b/x-pack/plugins/security_solution/public/flyout/document_details/shared/hooks/use_show_related_alerts_by_ancestry.ts
@@ -6,14 +6,11 @@
*/
import type { EcsSecurityExtension as Ecs } from '@kbn/securitysolution-ecs';
-import { useMemo } from 'react';
-import { find } from 'lodash/fp';
-import type { TimelineEventsDetailsItem } from '@kbn/timelines-plugin/common';
import type { GetFieldsData } from '../../../../common/hooks/use_get_fields_data';
import { useIsInvestigateInResolverActionEnabled } from '../../../../detections/components/alerts_table/timeline_actions/investigate_in_resolver';
import { useIsExperimentalFeatureEnabled } from '../../../../common/hooks/use_experimental_features';
import { useLicense } from '../../../../common/hooks/use_license';
-import { ANCESTOR_ID, RULE_PARAMETERS_INDEX } from '../constants/field_names';
+import { ANCESTOR_ID } from '../constants/field_names';
import { getField } from '../utils';
export interface UseShowRelatedAlertsByAncestryParams {
@@ -25,10 +22,6 @@ export interface UseShowRelatedAlertsByAncestryParams {
* An object with top level fields from the ECS object
*/
dataAsNestedObject: Ecs;
- /**
- * An array of field objects with category and value
- */
- dataFormattedForFieldBrowser: TimelineEventsDetailsItem[];
/**
* Id of the event document
*/
@@ -44,10 +37,6 @@ export interface UseShowRelatedAlertsByAncestryResult {
* Returns true if the user has at least platinum privilege, and if the document has ancestry data
*/
show: boolean;
- /**
- * Values of the kibana.alert.rule.parameters.index field
- */
- indices?: string[];
/**
* Value of the document id for fetching ancestry alerts
*/
@@ -60,7 +49,6 @@ export interface UseShowRelatedAlertsByAncestryResult {
export const useShowRelatedAlertsByAncestry = ({
getFieldsData,
dataAsNestedObject,
- dataFormattedForFieldBrowser,
eventId,
isPreview,
}: UseShowRelatedAlertsByAncestryParams): UseShowRelatedAlertsByAncestryResult => {
@@ -71,24 +59,14 @@ export const useShowRelatedAlertsByAncestry = ({
const ancestorId = getField(getFieldsData(ANCESTOR_ID)) ?? '';
const documentId = isPreview ? ancestorId : eventId;
- // can't use getFieldsData here as the kibana.alert.rule.parameters is different and can be nested
- const originalDocumentIndex = useMemo(
- () => find({ category: 'kibana', field: RULE_PARAMETERS_INDEX }, dataFormattedForFieldBrowser),
- [dataFormattedForFieldBrowser]
- );
const hasAtLeastPlatinum = useLicense().isPlatinumPlus();
const show =
- isRelatedAlertsByProcessAncestryEnabled &&
- hasProcessEntityInfo &&
- originalDocumentIndex != null &&
- hasAtLeastPlatinum;
+ isRelatedAlertsByProcessAncestryEnabled && hasProcessEntityInfo && hasAtLeastPlatinum;
return {
show,
documentId,
- ...(originalDocumentIndex &&
- originalDocumentIndex.values && { indices: originalDocumentIndex.values }),
};
};
diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/shared/hooks/use_show_related_alerts_by_same_source_event.test.tsx b/x-pack/plugins/security_solution/public/flyout/document_details/shared/hooks/use_show_related_alerts_by_same_source_event.test.tsx
index 01a014409264c..dfbfeeccc655a 100644
--- a/x-pack/plugins/security_solution/public/flyout/document_details/shared/hooks/use_show_related_alerts_by_same_source_event.test.tsx
+++ b/x-pack/plugins/security_solution/public/flyout/document_details/shared/hooks/use_show_related_alerts_by_same_source_event.test.tsx
@@ -14,22 +14,28 @@ import type {
} from './use_show_related_alerts_by_same_source_event';
import { useShowRelatedAlertsBySameSourceEvent } from './use_show_related_alerts_by_same_source_event';
+const eventId = 'eventId';
+
describe('useShowRelatedAlertsBySameSourceEvent', () => {
let hookResult: RenderHookResult<
ShowRelatedAlertsBySameSourceEventParams,
ShowRelatedAlertsBySameSourceEventResult
>;
- it('should return false if getFieldsData returns null', () => {
+ it('should return eventId if getFieldsData returns null', () => {
const getFieldsData = () => null;
- hookResult = renderHook(() => useShowRelatedAlertsBySameSourceEvent({ getFieldsData }));
+ hookResult = renderHook(() =>
+ useShowRelatedAlertsBySameSourceEvent({ getFieldsData, eventId })
+ );
- expect(hookResult.result.current).toEqual({ show: false });
+ expect(hookResult.result.current).toEqual({ show: true, originalEventId: 'eventId' });
});
it('should return true if getFieldsData has the correct field', () => {
const getFieldsData = () => 'original_event';
- hookResult = renderHook(() => useShowRelatedAlertsBySameSourceEvent({ getFieldsData }));
+ hookResult = renderHook(() =>
+ useShowRelatedAlertsBySameSourceEvent({ getFieldsData, eventId })
+ );
expect(hookResult.result.current).toEqual({ show: true, originalEventId: 'original_event' });
});
diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/shared/hooks/use_show_related_alerts_by_same_source_event.ts b/x-pack/plugins/security_solution/public/flyout/document_details/shared/hooks/use_show_related_alerts_by_same_source_event.ts
index 0d510400d5efe..2f76c74b329d1 100644
--- a/x-pack/plugins/security_solution/public/flyout/document_details/shared/hooks/use_show_related_alerts_by_same_source_event.ts
+++ b/x-pack/plugins/security_solution/public/flyout/document_details/shared/hooks/use_show_related_alerts_by_same_source_event.ts
@@ -10,6 +10,10 @@ import { ANCESTOR_ID } from '../constants/field_names';
import { getField } from '../utils';
export interface ShowRelatedAlertsBySameSourceEventParams {
+ /**
+ * Id of the event document
+ */
+ eventId: string;
/**
* Retrieves searchHit values for the provided field
*/
@@ -24,18 +28,19 @@ export interface ShowRelatedAlertsBySameSourceEventResult {
/**
* Value of the kibana.alert.original_event.id field
*/
- originalEventId?: string;
+ originalEventId: string;
}
/**
- * Returns true if document has kibana.alert.original.event.id field with values
+ * Returns kibana.alert.ancestors.id field or default eventId
*/
export const useShowRelatedAlertsBySameSourceEvent = ({
+ eventId,
getFieldsData,
}: ShowRelatedAlertsBySameSourceEventParams): ShowRelatedAlertsBySameSourceEventResult => {
- const originalEventId = getField(getFieldsData(ANCESTOR_ID));
+ const originalEventId = getField(getFieldsData(ANCESTOR_ID)) ?? eventId;
return {
- show: originalEventId != null,
- ...(originalEventId && { originalEventId }),
+ show: true,
+ originalEventId,
};
};
diff --git a/x-pack/plugins/security_solution/public/management/cypress/e2e/automated_response_actions/automated_response_actions.cy.ts b/x-pack/plugins/security_solution/public/management/cypress/e2e/automated_response_actions/automated_response_actions.cy.ts
index adaaf9c99059a..c295de7dd0b3e 100644
--- a/x-pack/plugins/security_solution/public/management/cypress/e2e/automated_response_actions/automated_response_actions.cy.ts
+++ b/x-pack/plugins/security_solution/public/management/cypress/e2e/automated_response_actions/automated_response_actions.cy.ts
@@ -20,7 +20,9 @@ import { createEndpointHost } from '../../tasks/create_endpoint_host';
import { deleteAllLoadedEndpointData } from '../../tasks/delete_all_endpoint_data';
import { enableAllPolicyProtections } from '../../tasks/endpoint_policy';
-describe(
+// FLAKY: https://github.com/elastic/kibana/issues/168340
+// Failing: See https://github.com/elastic/kibana/issues/168340
+describe.skip(
'Automated Response Actions',
{
tags: ['@ess', '@serverless'],
diff --git a/x-pack/plugins/security_solution/public/management/cypress/e2e/endpoint_alerts.cy.ts b/x-pack/plugins/security_solution/public/management/cypress/e2e/endpoint_alerts.cy.ts
index 06b33141bad1b..2de94b7ca0557 100644
--- a/x-pack/plugins/security_solution/public/management/cypress/e2e/endpoint_alerts.cy.ts
+++ b/x-pack/plugins/security_solution/public/management/cypress/e2e/endpoint_alerts.cy.ts
@@ -19,7 +19,9 @@ import { login, ROLE } from '../tasks/login';
import { EXECUTE_ROUTE } from '../../../../common/endpoint/constants';
import { waitForActionToComplete } from '../tasks/response_actions';
-describe('Endpoint generated alerts', { tags: ['@ess', '@serverless'] }, () => {
+// FLAKY: https://github.com/elastic/kibana/issues/169958
+// Failing: See https://github.com/elastic/kibana/issues/169958
+describe.skip('Endpoint generated alerts', { tags: ['@ess', '@serverless'] }, () => {
let indexedPolicy: IndexedFleetEndpointPolicyResponse;
let policy: PolicyData;
let createdHost: CreateAndEnrollEndpointHostResponse;
diff --git a/x-pack/plugins/security_solution/public/management/cypress/e2e/endpoint_list/endpoints.cy.ts b/x-pack/plugins/security_solution/public/management/cypress/e2e/endpoint_list/endpoints.cy.ts
index 4396937e57228..c0b12f6bd700c 100644
--- a/x-pack/plugins/security_solution/public/management/cypress/e2e/endpoint_list/endpoints.cy.ts
+++ b/x-pack/plugins/security_solution/public/management/cypress/e2e/endpoint_list/endpoints.cy.ts
@@ -28,7 +28,9 @@ import { createEndpointHost } from '../../tasks/create_endpoint_host';
import { deleteAllLoadedEndpointData } from '../../tasks/delete_all_endpoint_data';
import { enableAllPolicyProtections } from '../../tasks/endpoint_policy';
-describe('Endpoints page', { tags: ['@ess', '@serverless'] }, () => {
+// FLAKY: https://github.com/elastic/kibana/issues/168284
+// Failing: See https://github.com/elastic/kibana/issues/168284
+describe.skip('Endpoints page', { tags: ['@ess', '@serverless'] }, () => {
let indexedPolicy: IndexedFleetEndpointPolicyResponse;
let policy: PolicyData;
let createdHost: CreateAndEnrollEndpointHostResponse;
diff --git a/x-pack/plugins/security_solution/public/management/cypress/e2e/response_actions/alerts_response_console.cy.ts b/x-pack/plugins/security_solution/public/management/cypress/e2e/response_actions/alerts_response_console.cy.ts
index 63428ec6018d2..db1477916f75a 100644
--- a/x-pack/plugins/security_solution/public/management/cypress/e2e/response_actions/alerts_response_console.cy.ts
+++ b/x-pack/plugins/security_solution/public/management/cypress/e2e/response_actions/alerts_response_console.cy.ts
@@ -27,7 +27,9 @@ import { enableAllPolicyProtections } from '../../tasks/endpoint_policy';
import { createEndpointHost } from '../../tasks/create_endpoint_host';
import { deleteAllLoadedEndpointData } from '../../tasks/delete_all_endpoint_data';
-describe(
+// FLAKY: https://github.com/elastic/kibana/issues/179598
+// Failing: See https://github.com/elastic/kibana/issues/179598
+describe.skip(
'Response console: From Alerts',
{ tags: ['@ess', '@serverless', '@brokenInServerless'] },
() => {
diff --git a/x-pack/plugins/security_solution/public/management/cypress/e2e/response_actions/document_signing.cy.ts b/x-pack/plugins/security_solution/public/management/cypress/e2e/response_actions/document_signing.cy.ts
index b806323726018..ec41ffa31edc9 100644
--- a/x-pack/plugins/security_solution/public/management/cypress/e2e/response_actions/document_signing.cy.ts
+++ b/x-pack/plugins/security_solution/public/management/cypress/e2e/response_actions/document_signing.cy.ts
@@ -22,7 +22,9 @@ import { enableAllPolicyProtections } from '../../tasks/endpoint_policy';
import { createEndpointHost } from '../../tasks/create_endpoint_host';
import { deleteAllLoadedEndpointData } from '../../tasks/delete_all_endpoint_data';
-describe('Document signing:', { tags: ['@ess', '@serverless', '@brokenInServerless'] }, () => {
+// FLAKY: https://github.com/elastic/kibana/issues/170674
+// Failing: See https://github.com/elastic/kibana/issues/170674
+describe.skip('Document signing:', { tags: ['@ess', '@serverless', '@brokenInServerless'] }, () => {
let indexedPolicy: IndexedFleetEndpointPolicyResponse;
let policy: PolicyData;
let createdHost: CreateAndEnrollEndpointHostResponse;
diff --git a/x-pack/plugins/security_solution/public/management/cypress/e2e/response_actions/endpoints_list_response_console.cy.ts b/x-pack/plugins/security_solution/public/management/cypress/e2e/response_actions/endpoints_list_response_console.cy.ts
index 75074b0d3f94a..10a8908684577 100644
--- a/x-pack/plugins/security_solution/public/management/cypress/e2e/response_actions/endpoints_list_response_console.cy.ts
+++ b/x-pack/plugins/security_solution/public/management/cypress/e2e/response_actions/endpoints_list_response_console.cy.ts
@@ -20,7 +20,8 @@ import { enableAllPolicyProtections } from '../../tasks/endpoint_policy';
import { createEndpointHost } from '../../tasks/create_endpoint_host';
import { deleteAllLoadedEndpointData } from '../../tasks/delete_all_endpoint_data';
-describe('Response console', { tags: ['@ess', '@serverless', '@brokenInServerless'] }, () => {
+// Failing: See https://github.com/elastic/kibana/issues/169821
+describe.skip('Response console', { tags: ['@ess', '@serverless', '@brokenInServerless'] }, () => {
beforeEach(() => {
login();
});
diff --git a/x-pack/plugins/security_solution/public/management/cypress/e2e/response_actions/response_console/execute.cy.ts b/x-pack/plugins/security_solution/public/management/cypress/e2e/response_actions/response_console/execute.cy.ts
index dad573bb09c2b..d43037f4d7f97 100644
--- a/x-pack/plugins/security_solution/public/management/cypress/e2e/response_actions/response_console/execute.cy.ts
+++ b/x-pack/plugins/security_solution/public/management/cypress/e2e/response_actions/response_console/execute.cy.ts
@@ -21,7 +21,8 @@ import { enableAllPolicyProtections } from '../../../tasks/endpoint_policy';
import { createEndpointHost } from '../../../tasks/create_endpoint_host';
import { deleteAllLoadedEndpointData } from '../../../tasks/delete_all_endpoint_data';
-describe('Response console', { tags: ['@ess', '@serverless'] }, () => {
+// FLAKY: https://github.com/elastic/kibana/issues/170373
+describe.skip('Response console', { tags: ['@ess', '@serverless'] }, () => {
beforeEach(() => {
login();
});
diff --git a/x-pack/plugins/security_solution/public/management/cypress/e2e/response_actions/response_console/file_operations.cy.ts b/x-pack/plugins/security_solution/public/management/cypress/e2e/response_actions/response_console/file_operations.cy.ts
index 70b008f7eda7b..38f442dec0e63 100644
--- a/x-pack/plugins/security_solution/public/management/cypress/e2e/response_actions/response_console/file_operations.cy.ts
+++ b/x-pack/plugins/security_solution/public/management/cypress/e2e/response_actions/response_console/file_operations.cy.ts
@@ -21,7 +21,8 @@ import { enableAllPolicyProtections } from '../../../tasks/endpoint_policy';
import { createEndpointHost } from '../../../tasks/create_endpoint_host';
import { deleteAllLoadedEndpointData } from '../../../tasks/delete_all_endpoint_data';
-describe('Response console', { tags: ['@ess', '@serverless'] }, () => {
+// FLAKY: https://github.com/elastic/kibana/issues/170424
+describe.skip('Response console', { tags: ['@ess', '@serverless'] }, () => {
beforeEach(() => {
login();
});
diff --git a/x-pack/plugins/security_solution/public/management/cypress/e2e/response_actions/response_console/process_operations.cy.ts b/x-pack/plugins/security_solution/public/management/cypress/e2e/response_actions/response_console/process_operations.cy.ts
index f7c70ebf8c7e9..0f6da6fb9fad1 100644
--- a/x-pack/plugins/security_solution/public/management/cypress/e2e/response_actions/response_console/process_operations.cy.ts
+++ b/x-pack/plugins/security_solution/public/management/cypress/e2e/response_actions/response_console/process_operations.cy.ts
@@ -26,7 +26,8 @@ import { deleteAllLoadedEndpointData } from '../../../tasks/delete_all_endpoint_
const AGENT_BEAT_FILE_PATH_SUFFIX = '/components/agentbeat';
-describe('Response console', { tags: ['@ess', '@serverless'] }, () => {
+// FLAKY: https://github.com/elastic/kibana/issues/170563
+describe.skip('Response console', { tags: ['@ess', '@serverless'] }, () => {
beforeEach(() => {
login();
});
diff --git a/x-pack/plugins/security_solution/public/management/cypress/e2e/response_actions/response_console/release.cy.ts b/x-pack/plugins/security_solution/public/management/cypress/e2e/response_actions/response_console/release.cy.ts
index 47d30ad96699c..50630b8fc1b46 100644
--- a/x-pack/plugins/security_solution/public/management/cypress/e2e/response_actions/response_console/release.cy.ts
+++ b/x-pack/plugins/security_solution/public/management/cypress/e2e/response_actions/response_console/release.cy.ts
@@ -27,7 +27,9 @@ import { enableAllPolicyProtections } from '../../../tasks/endpoint_policy';
import { createEndpointHost } from '../../../tasks/create_endpoint_host';
import { deleteAllLoadedEndpointData } from '../../../tasks/delete_all_endpoint_data';
-describe('Response console', { tags: ['@ess', '@serverless'] }, () => {
+// FLAKY: https://github.com/elastic/kibana/issues/172326
+// Failing: See https://github.com/elastic/kibana/issues/172326
+describe.skip('Response console', { tags: ['@ess', '@serverless'] }, () => {
let indexedPolicy: IndexedFleetEndpointPolicyResponse;
let policy: PolicyData;
let createdHost: CreateAndEnrollEndpointHostResponse;
diff --git a/x-pack/plugins/security_solution/public/management/cypress/e2e/tamper_protection/disabled/unenroll_agent_from_fleet.cy.ts b/x-pack/plugins/security_solution/public/management/cypress/e2e/tamper_protection/disabled/unenroll_agent_from_fleet.cy.ts
index e0b26bc2f77dd..3a35f49d0ddcf 100644
--- a/x-pack/plugins/security_solution/public/management/cypress/e2e/tamper_protection/disabled/unenroll_agent_from_fleet.cy.ts
+++ b/x-pack/plugins/security_solution/public/management/cypress/e2e/tamper_protection/disabled/unenroll_agent_from_fleet.cy.ts
@@ -20,7 +20,9 @@ import { enableAllPolicyProtections } from '../../../tasks/endpoint_policy';
import { createEndpointHost } from '../../../tasks/create_endpoint_host';
import { deleteAllLoadedEndpointData } from '../../../tasks/delete_all_endpoint_data';
-describe(
+// FLAKY: https://github.com/elastic/kibana/issues/170814
+// Failing: See https://github.com/elastic/kibana/issues/170814
+describe.skip(
'Unenroll agent from fleet with agent tamper protection is disabled',
{ tags: ['@ess'] },
() => {
diff --git a/x-pack/plugins/security_solution/public/management/cypress/e2e/tamper_protection/disabled/uninstall_agent_from_host.cy.ts b/x-pack/plugins/security_solution/public/management/cypress/e2e/tamper_protection/disabled/uninstall_agent_from_host.cy.ts
index ed47855ac894a..a32932e0ed508 100644
--- a/x-pack/plugins/security_solution/public/management/cypress/e2e/tamper_protection/disabled/uninstall_agent_from_host.cy.ts
+++ b/x-pack/plugins/security_solution/public/management/cypress/e2e/tamper_protection/disabled/uninstall_agent_from_host.cy.ts
@@ -21,7 +21,9 @@ import { enableAllPolicyProtections } from '../../../tasks/endpoint_policy';
import { createEndpointHost } from '../../../tasks/create_endpoint_host';
import { deleteAllLoadedEndpointData } from '../../../tasks/delete_all_endpoint_data';
-describe(
+// FLAKY: https://github.com/elastic/kibana/issues/170667
+// Failing: See https://github.com/elastic/kibana/issues/170667
+describe.skip(
'Uninstall agent from host when agent tamper protection is disabled',
{ tags: ['@ess'] },
() => {
diff --git a/x-pack/plugins/security_solution/public/management/cypress/e2e/tamper_protection/enabled/unenroll_agent_from_fleet.cy.ts b/x-pack/plugins/security_solution/public/management/cypress/e2e/tamper_protection/enabled/unenroll_agent_from_fleet.cy.ts
index 17cb52c2cb042..61af90092c06d 100644
--- a/x-pack/plugins/security_solution/public/management/cypress/e2e/tamper_protection/enabled/unenroll_agent_from_fleet.cy.ts
+++ b/x-pack/plugins/security_solution/public/management/cypress/e2e/tamper_protection/enabled/unenroll_agent_from_fleet.cy.ts
@@ -20,7 +20,9 @@ import { login } from '../../../tasks/login';
import { createEndpointHost } from '../../../tasks/create_endpoint_host';
import { deleteAllLoadedEndpointData } from '../../../tasks/delete_all_endpoint_data';
-describe(
+// FLAKY: https://github.com/elastic/kibana/issues/170706
+// Failing: See https://github.com/elastic/kibana/issues/170706
+describe.skip(
'Unenroll agent from fleet when agent tamper protection is enabled',
{ tags: ['@ess'] },
() => {
diff --git a/x-pack/plugins/security_solution/public/management/cypress/e2e/tamper_protection/enabled/uninstall_agent_from_host.cy.ts b/x-pack/plugins/security_solution/public/management/cypress/e2e/tamper_protection/enabled/uninstall_agent_from_host.cy.ts
index 527566bed608b..7cbcaf361a38c 100644
--- a/x-pack/plugins/security_solution/public/management/cypress/e2e/tamper_protection/enabled/uninstall_agent_from_host.cy.ts
+++ b/x-pack/plugins/security_solution/public/management/cypress/e2e/tamper_protection/enabled/uninstall_agent_from_host.cy.ts
@@ -22,7 +22,9 @@ import { login } from '../../../tasks/login';
import { createEndpointHost } from '../../../tasks/create_endpoint_host';
import { deleteAllLoadedEndpointData } from '../../../tasks/delete_all_endpoint_data';
-describe(
+// FLAKY: https://github.com/elastic/kibana/issues/170601
+// Failing: See https://github.com/elastic/kibana/issues/170601
+describe.skip(
'Uninstall agent from host when agent tamper protection is enabled',
{ tags: ['@ess'] },
() => {
diff --git a/x-pack/plugins/security_solution/public/management/cypress/e2e/tamper_protection/switching_policies/unenroll_agent_from_fleet_changing_policy_from_disabled_to_enabled.cy.ts b/x-pack/plugins/security_solution/public/management/cypress/e2e/tamper_protection/switching_policies/unenroll_agent_from_fleet_changing_policy_from_disabled_to_enabled.cy.ts
index 3d92528c2eee7..03eef1c4337c2 100644
--- a/x-pack/plugins/security_solution/public/management/cypress/e2e/tamper_protection/switching_policies/unenroll_agent_from_fleet_changing_policy_from_disabled_to_enabled.cy.ts
+++ b/x-pack/plugins/security_solution/public/management/cypress/e2e/tamper_protection/switching_policies/unenroll_agent_from_fleet_changing_policy_from_disabled_to_enabled.cy.ts
@@ -22,7 +22,9 @@ import { enableAllPolicyProtections } from '../../../tasks/endpoint_policy';
import { createEndpointHost } from '../../../tasks/create_endpoint_host';
import { deleteAllLoadedEndpointData } from '../../../tasks/delete_all_endpoint_data';
-describe(
+// FLAKY: https://github.com/elastic/kibana/issues/170811
+// Failing: See https://github.com/elastic/kibana/issues/170811
+describe.skip(
'Unenroll agent from fleet when agent tamper protection is disabled but then is switched to a policy with it enabled',
{ tags: ['@ess'] },
() => {
diff --git a/x-pack/plugins/security_solution/public/management/cypress/e2e/tamper_protection/switching_policies/unenroll_agent_from_fleet_changing_policy_from_enabled_to_disabled.cy.ts b/x-pack/plugins/security_solution/public/management/cypress/e2e/tamper_protection/switching_policies/unenroll_agent_from_fleet_changing_policy_from_enabled_to_disabled.cy.ts
index a9508a13f719b..b36f7eca756e2 100644
--- a/x-pack/plugins/security_solution/public/management/cypress/e2e/tamper_protection/switching_policies/unenroll_agent_from_fleet_changing_policy_from_enabled_to_disabled.cy.ts
+++ b/x-pack/plugins/security_solution/public/management/cypress/e2e/tamper_protection/switching_policies/unenroll_agent_from_fleet_changing_policy_from_enabled_to_disabled.cy.ts
@@ -22,7 +22,9 @@ import { enableAllPolicyProtections } from '../../../tasks/endpoint_policy';
import { createEndpointHost } from '../../../tasks/create_endpoint_host';
import { deleteAllLoadedEndpointData } from '../../../tasks/delete_all_endpoint_data';
-describe(
+// FLAKY: https://github.com/elastic/kibana/issues/170817
+// Failing: See https://github.com/elastic/kibana/issues/170817
+describe.skip(
'Unenroll agent from fleet changing when agent tamper protection is enabled but then is switched to a policy with it disabled',
{ tags: ['@ess'] },
() => {
diff --git a/x-pack/plugins/security_solution/public/management/cypress/e2e/tamper_protection/switching_policies/unenroll_agent_from_fleet_changing_policy_from_enabled_to_enabled.cy.ts b/x-pack/plugins/security_solution/public/management/cypress/e2e/tamper_protection/switching_policies/unenroll_agent_from_fleet_changing_policy_from_enabled_to_enabled.cy.ts
index a5654734c15e4..414f18fb1fac7 100644
--- a/x-pack/plugins/security_solution/public/management/cypress/e2e/tamper_protection/switching_policies/unenroll_agent_from_fleet_changing_policy_from_enabled_to_enabled.cy.ts
+++ b/x-pack/plugins/security_solution/public/management/cypress/e2e/tamper_protection/switching_policies/unenroll_agent_from_fleet_changing_policy_from_enabled_to_enabled.cy.ts
@@ -21,7 +21,9 @@ import { login } from '../../../tasks/login';
import { createEndpointHost } from '../../../tasks/create_endpoint_host';
import { deleteAllLoadedEndpointData } from '../../../tasks/delete_all_endpoint_data';
-describe(
+// FLAKY: https://github.com/elastic/kibana/issues/170816
+// Failing: See https://github.com/elastic/kibana/issues/170816
+describe.skip(
'Unenroll agent from fleet changing agent policy when agent tamper protection is enabled but then is switched to a policy with it also enabled',
{ tags: ['@ess'] },
() => {
diff --git a/x-pack/plugins/security_solution/public/management/cypress/e2e/tamper_protection/switching_policies/uninstall_agent_from_host_changing_policy_from_disabled_to_enabled.cy.ts b/x-pack/plugins/security_solution/public/management/cypress/e2e/tamper_protection/switching_policies/uninstall_agent_from_host_changing_policy_from_disabled_to_enabled.cy.ts
index bbb675cf56d5e..d256fb2f990b3 100644
--- a/x-pack/plugins/security_solution/public/management/cypress/e2e/tamper_protection/switching_policies/uninstall_agent_from_host_changing_policy_from_disabled_to_enabled.cy.ts
+++ b/x-pack/plugins/security_solution/public/management/cypress/e2e/tamper_protection/switching_policies/uninstall_agent_from_host_changing_policy_from_disabled_to_enabled.cy.ts
@@ -24,7 +24,9 @@ import { enableAllPolicyProtections } from '../../../tasks/endpoint_policy';
import { createEndpointHost } from '../../../tasks/create_endpoint_host';
import { deleteAllLoadedEndpointData } from '../../../tasks/delete_all_endpoint_data';
-describe(
+// FLAKY: https://github.com/elastic/kibana/issues/170794
+// Failing: See https://github.com/elastic/kibana/issues/170794
+describe.skip(
'Uninstall agent from host changing agent policy when agent tamper protection is disabled but then is switched to a policy with it enabled',
{ tags: ['@ess'] },
() => {
diff --git a/x-pack/plugins/security_solution/public/management/cypress/e2e/tamper_protection/switching_policies/uninstall_agent_from_host_changing_policy_from_enabled_to_disabled.cy.ts b/x-pack/plugins/security_solution/public/management/cypress/e2e/tamper_protection/switching_policies/uninstall_agent_from_host_changing_policy_from_enabled_to_disabled.cy.ts
index 0768c4a49ca39..665e51ea56da5 100644
--- a/x-pack/plugins/security_solution/public/management/cypress/e2e/tamper_protection/switching_policies/uninstall_agent_from_host_changing_policy_from_enabled_to_disabled.cy.ts
+++ b/x-pack/plugins/security_solution/public/management/cypress/e2e/tamper_protection/switching_policies/uninstall_agent_from_host_changing_policy_from_enabled_to_disabled.cy.ts
@@ -23,7 +23,9 @@ import { enableAllPolicyProtections } from '../../../tasks/endpoint_policy';
import { createEndpointHost } from '../../../tasks/create_endpoint_host';
import { deleteAllLoadedEndpointData } from '../../../tasks/delete_all_endpoint_data';
-describe(
+// FLAKY: https://github.com/elastic/kibana/issues/170604
+// Failing: See https://github.com/elastic/kibana/issues/170604
+describe.skip(
'Uninstall agent from host changing agent policy when agent tamper protection is enabled but then is switched to a policy with it disabled',
{ tags: ['@ess'] },
() => {
diff --git a/x-pack/plugins/security_solution/public/management/cypress/e2e/tamper_protection/switching_policies/uninstall_agent_from_host_changing_policy_from_enabled_to_enabled.cy.ts b/x-pack/plugins/security_solution/public/management/cypress/e2e/tamper_protection/switching_policies/uninstall_agent_from_host_changing_policy_from_enabled_to_enabled.cy.ts
index d8630a50a83b9..d0b16f5b757ff 100644
--- a/x-pack/plugins/security_solution/public/management/cypress/e2e/tamper_protection/switching_policies/uninstall_agent_from_host_changing_policy_from_enabled_to_enabled.cy.ts
+++ b/x-pack/plugins/security_solution/public/management/cypress/e2e/tamper_protection/switching_policies/uninstall_agent_from_host_changing_policy_from_enabled_to_enabled.cy.ts
@@ -23,7 +23,9 @@ import { login } from '../../../tasks/login';
import { createEndpointHost } from '../../../tasks/create_endpoint_host';
import { deleteAllLoadedEndpointData } from '../../../tasks/delete_all_endpoint_data';
-describe(
+// FLAKY: https://github.com/elastic/kibana/issues/170812
+// Failing: See https://github.com/elastic/kibana/issues/170812
+describe.skip(
'Uninstall agent from host changing agent policy when agent tamper protection is enabled but then is switched to a policy with it also enabled',
{ tags: ['@ess'] },
() => {
diff --git a/x-pack/plugins/serverless_search/public/application/components/api_key/security_privileges_form.tsx b/x-pack/plugins/serverless_search/public/application/components/api_key/security_privileges_form.tsx
index dcc301469837a..c647471f90e71 100644
--- a/x-pack/plugins/serverless_search/public/application/components/api_key/security_privileges_form.tsx
+++ b/x-pack/plugins/serverless_search/public/application/components/api_key/security_privileges_form.tsx
@@ -5,22 +5,51 @@
* 2.0.
*/
-import { EuiText, EuiLink, EuiSpacer } from '@elastic/eui';
+import {
+ EuiText,
+ EuiLink,
+ EuiSpacer,
+ EuiPanel,
+ EuiFlexItem,
+ EuiFlexGroup,
+ EuiButtonEmpty,
+} from '@elastic/eui';
import { i18n } from '@kbn/i18n';
import { CodeEditorField } from '@kbn/code-editor';
import React from 'react';
import { docLinks } from '../../../../common/doc_links';
-
+const READ_ONLY_BOILERPLATE = `{
+ "read-only-role": {
+ "cluster": [],
+ "indices": [
+ {
+ "names": ["*"],
+ "privileges": ["read"]
+ }
+ ]
+ }
+}`;
+const WRITE_ONLY_BOILERPLATE = `{
+ "write-only-role": {
+ "cluster": [],
+ "indices": [
+ {
+ "names": ["*"],
+ "privileges": ["write"]
+ }
+ ]
+ }
+}`;
interface SecurityPrivilegesFormProps {
- roleDescriptors: string;
onChangeRoleDescriptors: (roleDescriptors: string) => void;
error?: React.ReactNode | React.ReactNode[];
+ roleDescriptors: string;
}
export const SecurityPrivilegesForm: React.FC = ({
- roleDescriptors,
onChangeRoleDescriptors,
error,
+ roleDescriptors,
}) => {
return (
@@ -39,6 +68,46 @@ export const SecurityPrivilegesForm: React.FC
= ({
{error}
)}
+
+
+
+
+
+ {i18n.translate('xpack.serverlessSearch.apiKey.privileges.boilerplate.label', {
+ defaultMessage: 'Replace with boilerplate:',
+ })}
+
+
+
+
+
+ onChangeRoleDescriptors(READ_ONLY_BOILERPLATE)}
+ >
+ {i18n.translate(
+ 'xpack.serverlessSearch.apiKey.privileges.boilerplate.readOnlyLabel',
+ {
+ defaultMessage: 'Read-only',
+ }
+ )}
+
+
+
+ onChangeRoleDescriptors(WRITE_ONLY_BOILERPLATE)}
+ >
+ {i18n.translate(
+ 'xpack.serverlessSearch.apiKey.privileges.boilerplate.writeOnlyLabel',
+ {
+ defaultMessage: 'Write-only',
+ }
+ )}
+
+
+
+
{
+ let throughputMetrics: ThroughputReturn;
+ let throughputTransactions: ThroughputReturn;
+
+ before(async () => {
+ const [throughputMetricsResponse, throughputTransactionsResponse] = await Promise.all([
+ callApi(
+ {
+ query: {
+ kuery: 'transaction.name : "GET /api/product/list"',
+ },
+ },
+ 'metric'
+ ),
+ callApi(
+ {
+ query: {
+ kuery: 'transaction.name : "GET /api/product/list"',
+ },
+ },
+ 'transaction'
+ ),
+ ]);
+ throughputMetrics = throughputMetricsResponse.body;
+ throughputTransactions = throughputTransactionsResponse.body;
+ });
+
+ it('returns some transactions data', () => {
+ expect(throughputTransactions.currentPeriod.length).to.be.greaterThan(0);
+ const hasData = throughputTransactions.currentPeriod.some(({ y }) => isFiniteNumber(y));
+ expect(hasData).to.equal(true);
+ });
+
+ it('returns some metrics data', () => {
+ expect(throughputMetrics.currentPeriod.length).to.be.greaterThan(0);
+ const hasData = throughputMetrics.currentPeriod.some(({ y }) => isFiniteNumber(y));
+ expect(hasData).to.equal(true);
+ });
+
+ it('has same mean value for metrics and transactions data', () => {
+ const transactionsMean = meanBy(throughputTransactions.currentPeriod, 'y');
+ const metricsMean = meanBy(throughputMetrics.currentPeriod, 'y');
+ [transactionsMean, metricsMean].forEach((value) =>
+ expect(roundNumber(value)).to.be.equal(roundNumber(GO_PROD_RATE))
+ );
+ });
+
+ it('has a bucket size of 30 seconds for transactions data', () => {
+ const firstTimerange = throughputTransactions.currentPeriod[0].x;
+ const secondTimerange = throughputTransactions.currentPeriod[1].x;
+ const timeIntervalAsSeconds = (secondTimerange - firstTimerange) / 1000;
+ expect(timeIntervalAsSeconds).to.equal(30);
+ });
+
+ it('has a bucket size of 1 minute for metrics data', () => {
+ const firstTimerange = throughputMetrics.currentPeriod[0].x;
+ const secondTimerange = throughputMetrics.currentPeriod[1].x;
+ const timeIntervalAsMinutes = (secondTimerange - firstTimerange) / 1000 / 60;
+ expect(timeIntervalAsMinutes).to.equal(1);
+ });
+ });
+
+ describe('handles filters', () => {
+ let throughputMetrics: ThroughputReturn;
+ let throughputTransactions: ThroughputReturn;
+ const filters = [
+ {
+ meta: {
+ disabled: false,
+ negate: false,
+ alias: null,
+ key: 'transaction.name',
+ params: ['GET /api/product/list'],
+ type: 'phrases',
+ },
+ query: {
+ bool: {
+ minimum_should_match: 1,
+ should: {
+ match_phrase: {
+ 'transaction.name': 'GET /api/product/list',
+ },
+ },
+ },
+ },
+ },
+ ];
+ const serializedFilters = JSON.stringify(buildQueryFromFilters(filters, undefined));
+
+ before(async () => {
+ const [throughputMetricsResponse, throughputTransactionsResponse] = await Promise.all([
+ callApi(
+ {
+ query: {
+ filters: serializedFilters,
+ },
+ },
+ 'metric'
+ ),
+ callApi(
+ {
+ query: {
+ filters: serializedFilters,
+ },
+ },
+ 'transaction'
+ ),
+ ]);
+ throughputMetrics = throughputMetricsResponse.body;
+ throughputTransactions = throughputTransactionsResponse.body;
+ });
+
+ it('returns some transactions data', () => {
+ expect(throughputTransactions.currentPeriod.length).to.be.greaterThan(0);
+ const hasData = throughputTransactions.currentPeriod.some(({ y }) => isFiniteNumber(y));
+ expect(hasData).to.equal(true);
+ });
+
+ it('returns some metrics data', () => {
+ expect(throughputMetrics.currentPeriod.length).to.be.greaterThan(0);
+ const hasData = throughputMetrics.currentPeriod.some(({ y }) => isFiniteNumber(y));
+ expect(hasData).to.equal(true);
+ });
+
+ it('has same mean value for metrics and transactions data', () => {
+ const transactionsMean = meanBy(throughputTransactions.currentPeriod, 'y');
+ const metricsMean = meanBy(throughputMetrics.currentPeriod, 'y');
+ [transactionsMean, metricsMean].forEach((value) =>
+ expect(roundNumber(value)).to.be.equal(roundNumber(GO_PROD_RATE))
+ );
+ });
+
+ it('has a bucket size of 30 seconds for transactions data', () => {
+ const firstTimerange = throughputTransactions.currentPeriod[0].x;
+ const secondTimerange = throughputTransactions.currentPeriod[1].x;
+ const timeIntervalAsSeconds = (secondTimerange - firstTimerange) / 1000;
+ expect(timeIntervalAsSeconds).to.equal(30);
+ });
+
+ it('has a bucket size of 1 minute for metrics data', () => {
+ const firstTimerange = throughputMetrics.currentPeriod[0].x;
+ const secondTimerange = throughputMetrics.currentPeriod[1].x;
+ const timeIntervalAsMinutes = (secondTimerange - firstTimerange) / 1000 / 60;
+ expect(timeIntervalAsMinutes).to.equal(1);
+ });
+ });
+
+ describe('handles negate filters', () => {
+ let throughputMetrics: ThroughputReturn;
+ let throughputTransactions: ThroughputReturn;
+ const filters = [
+ {
+ meta: {
+ disabled: false,
+ negate: true,
+ alias: null,
+ key: 'transaction.name',
+ params: ['GET /api/product/list'],
+ type: 'phrases',
+ },
+ query: {
+ bool: {
+ minimum_should_match: 1,
+ should: {
+ match_phrase: {
+ 'transaction.name': 'GET /api/product/list',
+ },
+ },
+ },
+ },
+ },
+ ];
+ const serializedFilters = JSON.stringify(buildQueryFromFilters(filters, undefined));
+
+ before(async () => {
+ const [throughputMetricsResponse, throughputTransactionsResponse] = await Promise.all([
+ callApi(
+ {
+ query: {
+ filters: serializedFilters,
+ },
+ },
+ 'metric'
+ ),
+ callApi(
+ {
+ query: {
+ filters: serializedFilters,
+ },
+ },
+ 'transaction'
+ ),
+ ]);
+ throughputMetrics = throughputMetricsResponse.body;
+ throughputTransactions = throughputTransactionsResponse.body;
+ });
+
+ it('returns some transactions data', () => {
+ expect(throughputTransactions.currentPeriod.length).to.be.greaterThan(0);
+ const hasData = throughputTransactions.currentPeriod.some(({ y }) => isFiniteNumber(y));
+ expect(hasData).to.equal(true);
+ });
+
+ it('returns some metrics data', () => {
+ expect(throughputMetrics.currentPeriod.length).to.be.greaterThan(0);
+ const hasData = throughputMetrics.currentPeriod.some(({ y }) => isFiniteNumber(y));
+ expect(hasData).to.equal(true);
+ });
+
+ it('has same mean value for metrics and transactions data', () => {
+ const transactionsMean = meanBy(throughputTransactions.currentPeriod, 'y');
+ const metricsMean = meanBy(throughputMetrics.currentPeriod, 'y');
+ [transactionsMean, metricsMean].forEach((value) =>
+ expect(roundNumber(value)).to.be.equal(roundNumber(GO_DEV_RATE))
+ );
+ });
+
+ it('has a bucket size of 30 seconds for transactions data', () => {
+ const firstTimerange = throughputTransactions.currentPeriod[0].x;
+ const secondTimerange = throughputTransactions.currentPeriod[1].x;
+ const timeIntervalAsSeconds = (secondTimerange - firstTimerange) / 1000;
+ expect(timeIntervalAsSeconds).to.equal(30);
+ });
+
+ it('has a bucket size of 1 minute for metrics data', () => {
+ const firstTimerange = throughputMetrics.currentPeriod[0].x;
+ const secondTimerange = throughputMetrics.currentPeriod[1].x;
+ const timeIntervalAsMinutes = (secondTimerange - firstTimerange) / 1000 / 60;
+ expect(timeIntervalAsMinutes).to.equal(1);
+ });
+ });
+
+ describe('handles bad filters request', () => {
+ it('throws bad request error', async () => {
+ try {
+ await callApi({
+ query: { environment: 'production', filters: '{}}' },
+ });
+ } catch (error) {
+ expect(error.res.status).to.be(400);
+ }
+ });
+ });
});
});
}
diff --git a/x-pack/test/apm_api_integration/tests/transactions/error_rate.spec.ts b/x-pack/test/apm_api_integration/tests/transactions/error_rate.spec.ts
index 996127103b090..123bb0d6d594d 100644
--- a/x-pack/test/apm_api_integration/tests/transactions/error_rate.spec.ts
+++ b/x-pack/test/apm_api_integration/tests/transactions/error_rate.spec.ts
@@ -6,6 +6,7 @@
*/
import { apm, timerange } from '@kbn/apm-synthtrace-client';
import expect from '@kbn/expect';
+import { buildQueryFromFilters } from '@kbn/es-query';
import { first, last } from 'lodash';
import moment from 'moment';
import {
@@ -297,5 +298,136 @@ export default function ApiTest({ getService }: FtrProviderContext) {
});
});
});
+
+ describe('handles kuery', () => {
+ let txMetricsErrorRateResponse: ErrorRate;
+
+ before(async () => {
+ const txMetricsResponse = await fetchErrorCharts({
+ query: {
+ kuery: 'transaction.name : "GET /pear 🍎 "',
+ },
+ });
+ txMetricsErrorRateResponse = txMetricsResponse.body;
+ });
+
+ describe('has the correct calculation for average with kuery', () => {
+ const expectedFailureRate = config.secondTransaction.failureRate / 100;
+
+ it('for tx metrics', () => {
+ expect(txMetricsErrorRateResponse.currentPeriod.average).to.eql(expectedFailureRate);
+ });
+ });
+ });
+
+ describe('handles filters', () => {
+ const filters = [
+ {
+ meta: {
+ disabled: false,
+ negate: false,
+ alias: null,
+ key: 'transaction.name',
+ params: ['GET /api/product/list'],
+ type: 'phrases',
+ },
+ query: {
+ bool: {
+ minimum_should_match: 1,
+ should: {
+ match_phrase: {
+ 'transaction.name': 'GET /pear 🍎 ',
+ },
+ },
+ },
+ },
+ },
+ ];
+ const serializedFilters = JSON.stringify(buildQueryFromFilters(filters, undefined));
+ let txMetricsErrorRateResponse: ErrorRate;
+
+ before(async () => {
+ const txMetricsResponse = await fetchErrorCharts({
+ query: {
+ filters: serializedFilters,
+ },
+ });
+ txMetricsErrorRateResponse = txMetricsResponse.body;
+ });
+
+ describe('has the correct calculation for average with filter', () => {
+ const expectedFailureRate = config.secondTransaction.failureRate / 100;
+
+ it('for tx metrics', () => {
+ expect(txMetricsErrorRateResponse.currentPeriod.average).to.eql(expectedFailureRate);
+ });
+ });
+
+ describe('has the correct calculation for average with negate filter', () => {
+ const expectedFailureRate = config.secondTransaction.failureRate / 100;
+
+ it('for tx metrics', () => {
+ expect(txMetricsErrorRateResponse.currentPeriod.average).to.eql(expectedFailureRate);
+ });
+ });
+ });
+
+ describe('handles negate filters', () => {
+ const filters = [
+ {
+ meta: {
+ disabled: false,
+ negate: true,
+ alias: null,
+ key: 'transaction.name',
+ params: ['GET /api/product/list'],
+ type: 'phrases',
+ },
+ query: {
+ bool: {
+ minimum_should_match: 1,
+ should: {
+ match_phrase: {
+ 'transaction.name': 'GET /pear 🍎 ',
+ },
+ },
+ },
+ },
+ },
+ ];
+ const serializedFilters = JSON.stringify(buildQueryFromFilters(filters, undefined));
+ let txMetricsErrorRateResponse: ErrorRate;
+
+ before(async () => {
+ const txMetricsResponse = await fetchErrorCharts({
+ query: {
+ filters: serializedFilters,
+ },
+ });
+ txMetricsErrorRateResponse = txMetricsResponse.body;
+ });
+
+ describe('has the correct calculation for average with filter', () => {
+ const expectedFailureRate = config.firstTransaction.failureRate / 100;
+
+ it('for tx metrics', () => {
+ expect(txMetricsErrorRateResponse.currentPeriod.average).to.eql(expectedFailureRate);
+ });
+ });
+ });
+
+ describe('handles bad filters request', () => {
+ it('for tx metrics', async () => {
+ try {
+ await fetchErrorCharts({
+ query: {
+ filters: '{}}}',
+ },
+ });
+ } catch (e) {
+ expect(e.res.status).to.eql(400);
+ }
+ });
+ });
});
}
diff --git a/x-pack/test/apm_api_integration/tests/transactions/latency.spec.ts b/x-pack/test/apm_api_integration/tests/transactions/latency.spec.ts
index a1cea01f408ca..eb876e6e312b7 100644
--- a/x-pack/test/apm_api_integration/tests/transactions/latency.spec.ts
+++ b/x-pack/test/apm_api_integration/tests/transactions/latency.spec.ts
@@ -6,6 +6,7 @@
*/
import { apm, timerange } from '@kbn/apm-synthtrace-client';
import expect from '@kbn/expect';
+import { buildQueryFromFilters } from '@kbn/es-query';
import moment from 'moment';
import {
APIClientRequestParamsOf,
@@ -115,6 +116,9 @@ export default function ApiTest({ getService }: FtrProviderContext) {
((GO_PROD_RATE * GO_PROD_DURATION + GO_DEV_RATE * GO_DEV_DURATION) /
(GO_PROD_RATE + GO_DEV_RATE)) *
1000;
+ const expectedLatencyAvgValueProdMs =
+ ((GO_PROD_RATE * GO_PROD_DURATION) / GO_PROD_RATE) * 1000;
+ const expectedLatencyAvgValueDevMs = ((GO_DEV_RATE * GO_DEV_DURATION) / GO_DEV_RATE) * 1000;
describe('average latency type', () => {
it('returns average duration and timeseries', async () => {
@@ -319,6 +323,122 @@ export default function ApiTest({ getService }: FtrProviderContext) {
});
});
});
+
+ describe('handles kuery', () => {
+ it('should return the appropriate latency values when a kuery is applied', async () => {
+ const response = await fetchLatencyCharts({
+ query: {
+ latencyAggregationType: LatencyAggregationType.p95,
+ useDurationSummary: false,
+ kuery: 'transaction.name : "GET /api/product/list"',
+ },
+ });
+
+ expect(response.status).to.be(200);
+ const latencyChartReturn = response.body as LatencyChartReturnType;
+
+ expect(latencyChartReturn.currentPeriod.overallAvgDuration).to.be(
+ expectedLatencyAvgValueProdMs
+ );
+ expect(latencyChartReturn.currentPeriod.latencyTimeseries.length).to.be.eql(15);
+ });
+ });
+
+ describe('handles filters', () => {
+ it('should return the appropriate latency values when filters are applied', async () => {
+ const filters = [
+ {
+ meta: {
+ disabled: false,
+ negate: false,
+ alias: null,
+ key: 'transaction.name',
+ params: ['GET /api/product/list'],
+ type: 'phrases',
+ },
+ query: {
+ bool: {
+ minimum_should_match: 1,
+ should: {
+ match_phrase: {
+ 'transaction.name': 'GET /api/product/list',
+ },
+ },
+ },
+ },
+ },
+ ];
+ const serializedFilters = JSON.stringify(buildQueryFromFilters(filters, undefined));
+ const response = await fetchLatencyCharts({
+ query: {
+ latencyAggregationType: LatencyAggregationType.p95,
+ useDurationSummary: false,
+ filters: serializedFilters,
+ },
+ });
+
+ expect(response.status).to.be(200);
+ const latencyChartReturn = response.body as LatencyChartReturnType;
+
+ expect(latencyChartReturn.currentPeriod.overallAvgDuration).to.be(
+ expectedLatencyAvgValueProdMs
+ );
+ expect(latencyChartReturn.currentPeriod.latencyTimeseries.length).to.be.eql(15);
+ });
+
+ it('should return the appropriate latency values when negate filters are applied', async () => {
+ const filters = [
+ {
+ meta: {
+ disabled: false,
+ negate: true,
+ alias: null,
+ key: 'transaction.name',
+ params: ['GET /api/product/list'],
+ type: 'phrases',
+ },
+ query: {
+ bool: {
+ minimum_should_match: 1,
+ should: {
+ match_phrase: {
+ 'transaction.name': 'GET /api/product/list',
+ },
+ },
+ },
+ },
+ },
+ ];
+ const serializedFilters = JSON.stringify(buildQueryFromFilters(filters, undefined));
+ const response = await fetchLatencyCharts({
+ query: {
+ latencyAggregationType: LatencyAggregationType.p95,
+ useDurationSummary: false,
+ filters: serializedFilters,
+ },
+ });
+
+ expect(response.status).to.be(200);
+ const latencyChartReturn = response.body as LatencyChartReturnType;
+
+ expect(latencyChartReturn.currentPeriod.overallAvgDuration).to.be(
+ expectedLatencyAvgValueDevMs
+ );
+ expect(latencyChartReturn.currentPeriod.latencyTimeseries.length).to.be.eql(15);
+ });
+ });
+
+ describe('handles bad filters request', () => {
+ it('throws bad request error', async () => {
+ try {
+ await fetchLatencyCharts({
+ query: { environment: 'production', filters: '{}}' },
+ });
+ } catch (error) {
+ expect(error.res.status).to.be(400);
+ }
+ });
+ });
}
);
}
diff --git a/x-pack/test_serverless/functional/page_objects/svl_search_landing_page.ts b/x-pack/test_serverless/functional/page_objects/svl_search_landing_page.ts
index a9de87ca60d71..a2b991d5b2e14 100644
--- a/x-pack/test_serverless/functional/page_objects/svl_search_landing_page.ts
+++ b/x-pack/test_serverless/functional/page_objects/svl_search_landing_page.ts
@@ -68,6 +68,8 @@ export function SvlSearchLandingPageProvider({ getService }: FtrProviderContext)
},
async expectRoleDescriptorsEditorToExist() {
await testSubjects.existOrFail('create-api-role-descriptors-code-editor-container');
+ await testSubjects.existOrFail('serverlessSearchSecurityPrivilegesFormReadOnlyButton');
+ await testSubjects.existOrFail('serverlessSearchSecurityPrivilegesFormWriteOnlyButton');
},
async setRoleDescriptorsValue(value: string) {
await testSubjects.existOrFail('create-api-role-descriptors-code-editor-container');
diff --git a/x-pack/test_serverless/functional/test_suites/common/discover/group1/index.ts b/x-pack/test_serverless/functional/test_suites/common/discover/group1/index.ts
index 4ad60320df38b..9fc6d4447e8c7 100644
--- a/x-pack/test_serverless/functional/test_suites/common/discover/group1/index.ts
+++ b/x-pack/test_serverless/functional/test_suites/common/discover/group1/index.ts
@@ -22,6 +22,5 @@ export default function ({ getService, loadTestFile }: FtrProviderContext) {
loadTestFile(require.resolve('./_discover'));
loadTestFile(require.resolve('./_discover_histogram'));
- loadTestFile(require.resolve('./_url_state'));
});
}
diff --git a/x-pack/test_serverless/functional/test_suites/common/discover/group2/index.ts b/x-pack/test_serverless/functional/test_suites/common/discover/group2/index.ts
index c579eca3bb7bd..658b92845ffca 100644
--- a/x-pack/test_serverless/functional/test_suites/common/discover/group2/index.ts
+++ b/x-pack/test_serverless/functional/test_suites/common/discover/group2/index.ts
@@ -22,6 +22,5 @@ export default function ({ getService, loadTestFile }: FtrProviderContext) {
loadTestFile(require.resolve('./_data_grid_doc_navigation'));
loadTestFile(require.resolve('./_data_grid_doc_table'));
- loadTestFile(require.resolve('./_adhoc_data_views'));
});
}
diff --git a/x-pack/test_serverless/functional/test_suites/common/discover/group3/index.ts b/x-pack/test_serverless/functional/test_suites/common/discover/group3/index.ts
index 9f322013d986b..70d95fef41958 100644
--- a/x-pack/test_serverless/functional/test_suites/common/discover/group3/index.ts
+++ b/x-pack/test_serverless/functional/test_suites/common/discover/group3/index.ts
@@ -20,8 +20,6 @@ export default function ({ getService, loadTestFile }: FtrProviderContext) {
await esArchiver.unload('test/functional/fixtures/es_archiver/logstash_functional');
});
- loadTestFile(require.resolve('./_sidebar'));
loadTestFile(require.resolve('./_request_counts'));
- loadTestFile(require.resolve('./_unsaved_changes_badge'));
});
}
diff --git a/x-pack/test_serverless/functional/test_suites/common/discover/group2/_adhoc_data_views.ts b/x-pack/test_serverless/functional/test_suites/common/discover/group4/_adhoc_data_views.ts
similarity index 100%
rename from x-pack/test_serverless/functional/test_suites/common/discover/group2/_adhoc_data_views.ts
rename to x-pack/test_serverless/functional/test_suites/common/discover/group4/_adhoc_data_views.ts
diff --git a/x-pack/test_serverless/functional/test_suites/common/discover/group4/index.ts b/x-pack/test_serverless/functional/test_suites/common/discover/group4/index.ts
new file mode 100644
index 0000000000000..c262798065000
--- /dev/null
+++ b/x-pack/test_serverless/functional/test_suites/common/discover/group4/index.ts
@@ -0,0 +1,25 @@
+/*
+ * 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 { FtrProviderContext } from '../../../../ftr_provider_context';
+
+export default function ({ getService, loadTestFile }: FtrProviderContext) {
+ const esArchiver = getService('esArchiver');
+ const browser = getService('browser');
+
+ describe('discover/group4', function () {
+ before(async function () {
+ await browser.setWindowSize(1600, 1200);
+ });
+
+ after(async function unloadMakelogs() {
+ await esArchiver.unload('test/functional/fixtures/es_archiver/logstash_functional');
+ });
+
+ loadTestFile(require.resolve('./_adhoc_data_views'));
+ });
+}
diff --git a/x-pack/test_serverless/functional/test_suites/common/discover/group1/_url_state.ts b/x-pack/test_serverless/functional/test_suites/common/discover/group5/_url_state.ts
similarity index 100%
rename from x-pack/test_serverless/functional/test_suites/common/discover/group1/_url_state.ts
rename to x-pack/test_serverless/functional/test_suites/common/discover/group5/_url_state.ts
diff --git a/x-pack/test_serverless/functional/test_suites/common/discover/group5/index.ts b/x-pack/test_serverless/functional/test_suites/common/discover/group5/index.ts
new file mode 100644
index 0000000000000..a38a6d4e33dd6
--- /dev/null
+++ b/x-pack/test_serverless/functional/test_suites/common/discover/group5/index.ts
@@ -0,0 +1,25 @@
+/*
+ * 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 { FtrProviderContext } from '../../../../ftr_provider_context';
+
+export default function ({ getService, loadTestFile }: FtrProviderContext) {
+ const esArchiver = getService('esArchiver');
+ const browser = getService('browser');
+
+ describe('discover/group5', function () {
+ before(async function () {
+ await browser.setWindowSize(1300, 800);
+ });
+
+ after(async function unloadMakelogs() {
+ await esArchiver.unload('test/functional/fixtures/es_archiver/logstash_functional');
+ });
+
+ loadTestFile(require.resolve('./_url_state'));
+ });
+}
diff --git a/x-pack/test_serverless/functional/test_suites/common/discover/group3/_sidebar.ts b/x-pack/test_serverless/functional/test_suites/common/discover/group6/_sidebar.ts
similarity index 100%
rename from x-pack/test_serverless/functional/test_suites/common/discover/group3/_sidebar.ts
rename to x-pack/test_serverless/functional/test_suites/common/discover/group6/_sidebar.ts
diff --git a/x-pack/test_serverless/functional/test_suites/common/discover/group3/_unsaved_changes_badge.ts b/x-pack/test_serverless/functional/test_suites/common/discover/group6/_unsaved_changes_badge.ts
similarity index 100%
rename from x-pack/test_serverless/functional/test_suites/common/discover/group3/_unsaved_changes_badge.ts
rename to x-pack/test_serverless/functional/test_suites/common/discover/group6/_unsaved_changes_badge.ts
diff --git a/x-pack/test_serverless/functional/test_suites/common/discover/group6/index.ts b/x-pack/test_serverless/functional/test_suites/common/discover/group6/index.ts
new file mode 100644
index 0000000000000..8857ebe9bf310
--- /dev/null
+++ b/x-pack/test_serverless/functional/test_suites/common/discover/group6/index.ts
@@ -0,0 +1,26 @@
+/*
+ * 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 { FtrProviderContext } from '../../../../ftr_provider_context';
+
+export default function ({ getService, loadTestFile }: FtrProviderContext) {
+ const esArchiver = getService('esArchiver');
+ const browser = getService('browser');
+
+ describe('discover/group6', function () {
+ before(async function () {
+ await browser.setWindowSize(1300, 800);
+ });
+
+ after(async function unloadMakelogs() {
+ await esArchiver.unload('test/functional/fixtures/es_archiver/logstash_functional');
+ });
+
+ loadTestFile(require.resolve('./_sidebar'));
+ loadTestFile(require.resolve('./_unsaved_changes_badge'));
+ });
+}
diff --git a/x-pack/test_serverless/functional/test_suites/observability/common_configs/config.group5.ts b/x-pack/test_serverless/functional/test_suites/observability/common_configs/config.group5.ts
index 7b8fb4b072847..be3c0098d35d2 100644
--- a/x-pack/test_serverless/functional/test_suites/observability/common_configs/config.group5.ts
+++ b/x-pack/test_serverless/functional/test_suites/observability/common_configs/config.group5.ts
@@ -16,6 +16,9 @@ export default async function ({ readConfigFile }: FtrConfigProviderContext) {
require.resolve('../../common/discover/group1'),
require.resolve('../../common/discover/group2'),
require.resolve('../../common/discover/group3'),
+ require.resolve('../../common/discover/group4'),
+ require.resolve('../../common/discover/group5'),
+ require.resolve('../../common/discover/group6'),
],
junit: {
reportName: 'Serverless Observability Functional Tests - Common Group 5',
diff --git a/x-pack/test_serverless/functional/test_suites/search/common_configs/config.group5.ts b/x-pack/test_serverless/functional/test_suites/search/common_configs/config.group5.ts
index 70cabf59051a9..ad661b474a33d 100644
--- a/x-pack/test_serverless/functional/test_suites/search/common_configs/config.group5.ts
+++ b/x-pack/test_serverless/functional/test_suites/search/common_configs/config.group5.ts
@@ -16,6 +16,9 @@ export default async function ({ readConfigFile }: FtrConfigProviderContext) {
require.resolve('../../common/discover/group1'),
require.resolve('../../common/discover/group2'),
require.resolve('../../common/discover/group3'),
+ require.resolve('../../common/discover/group4'),
+ require.resolve('../../common/discover/group5'),
+ require.resolve('../../common/discover/group6'),
],
junit: {
reportName: 'Serverless Search Functional Tests - Common Group 5',
diff --git a/x-pack/test_serverless/functional/test_suites/security/common_configs/config.group5.ts b/x-pack/test_serverless/functional/test_suites/security/common_configs/config.group5.ts
index d1637bf34b4fd..c65131e27e9e8 100644
--- a/x-pack/test_serverless/functional/test_suites/security/common_configs/config.group5.ts
+++ b/x-pack/test_serverless/functional/test_suites/security/common_configs/config.group5.ts
@@ -16,6 +16,9 @@ export default async function ({ readConfigFile }: FtrConfigProviderContext) {
require.resolve('../../common/discover/group1'),
require.resolve('../../common/discover/group2'),
require.resolve('../../common/discover/group3'),
+ require.resolve('../../common/discover/group4'),
+ require.resolve('../../common/discover/group5'),
+ require.resolve('../../common/discover/group6'),
],
junit: {
reportName: 'Serverless Security Functional Tests - Common Group 5',
diff --git a/yarn.lock b/yarn.lock
index 5709927c111bf..16b7c7a3932a0 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -4574,10 +4574,6 @@
version "0.0.0"
uid ""
-"@kbn/embeddable-explorer-plugin@link:examples/embeddable_explorer":
- version "0.0.0"
- uid ""
-
"@kbn/embeddable-plugin@link:src/plugins/embeddable":
version "0.0.0"
uid ""