Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
87c4088
fix nested flyout issue
akowalska622 Jan 22, 2026
ee95011
refactor background search flyout to use openSystemFlyout and opt in …
akowalska622 Jan 22, 2026
957a0c0
improve styling of inspect flyout
akowalska622 Jan 23, 2026
75d51a9
prepare background search flyout for session
akowalska622 Jan 23, 2026
0f4c169
adjust styling
akowalska622 Jan 23, 2026
bbaa4dc
add inspect action to background searches flyout
akowalska622 Jan 23, 2026
0ab11bf
adjust flyouts to new system flyout service
akowalska622 Jan 23, 2026
f464751
don't hide the title
akowalska622 Jan 23, 2026
c550ecc
temp: fix flyoutMenuProps in system flyout service
akowalska622 Jan 23, 2026
bda99e4
add isWithinFlyout prop
akowalska622 Jan 23, 2026
18c5e23
improve closing behavior
akowalska622 Jan 23, 2026
78e80e6
Changes from node scripts/lint_ts_projects --fix
kibanamachine Jan 26, 2026
1d0cd11
Changes from node scripts/regenerate_moon_projects.js --update
kibanamachine Jan 26, 2026
4c82fb9
add minimal reproducible example for parent-child relationship bug
akowalska622 Jan 26, 2026
a078f97
Merge branch 'discover-background-search-inspect-in-flyout' of github…
akowalska622 Jan 26, 2026
d4be458
Merge branch 'main' into discover-background-search-inspect-in-flyout
akowalska622 Jan 26, 2026
5cdac52
Merge branch 'main' into discover-background-search-inspect-in-flyout
akowalska622 Jan 28, 2026
1f469bb
Merge branch 'discover-background-search-inspect-in-flyout' of github…
akowalska622 Jan 28, 2026
2911348
pull back in changes from fix 250332
akowalska622 Jan 28, 2026
dfc8a05
Merge branch 'main' into discover-background-search-inspect-in-flyout
akowalska622 Feb 20, 2026
27674d5
Merge branch 'main' into discover-background-search-inspect-in-flyout
akowalska622 Feb 20, 2026
b3b398b
Changes from node scripts/lint_ts_projects --fix
kibanamachine Feb 20, 2026
cb9821e
Changes from node scripts/regenerate_moon_projects.js --update
kibanamachine Feb 20, 2026
fb62c28
Merge branch 'main' into discover-background-search-inspect-in-flyout
akowalska622 Feb 20, 2026
bb302d9
remove redundant code
akowalska622 Feb 23, 2026
3a819f6
Merge branch 'discover-background-search-inspect-in-flyout' of github…
akowalska622 Feb 23, 2026
fa8668b
Merge branch 'main' into discover-background-search-inspect-in-flyout
akowalska622 Feb 23, 2026
4f9d821
Merge branch 'main' into discover-background-search-inspect-in-flyout
akowalska622 Feb 23, 2026
e880d16
remove redundant test assertion
akowalska622 Feb 23, 2026
d6a6df8
Merge branch 'discover-background-search-inspect-in-flyout' of github…
akowalska622 Feb 23, 2026
22bc818
add flyout bug example back and enrich it with second flyout
akowalska622 Feb 23, 2026
ac86bad
Merge branch 'main' into discover-background-search-inspect-in-flyout
akowalska622 Mar 17, 2026
6ea5497
Merge branch 'main' into discover-background-search-inspect-in-flyout
akowalska622 Apr 10, 2026
5281a2a
remove bug example
akowalska622 Apr 10, 2026
b875879
add session name to the child flyout title
akowalska622 Apr 10, 2026
066186a
remove redundant allowedActions
akowalska622 Apr 10, 2026
26af7c8
set outsideClickCloses to true
akowalska622 Apr 10, 2026
5cea722
update IClickActionDescriptor type
akowalska622 Apr 10, 2026
3c6f2fa
remove wrong old aria-labelledby
akowalska622 Apr 10, 2026
e83c3c7
Merge branch 'main' into discover-background-search-inspect-in-flyout
akowalska622 Apr 10, 2026
ee5d269
fix i18n syntax
akowalska622 Apr 10, 2026
9a107b5
Merge branch 'discover-background-search-inspect-in-flyout' of github…
akowalska622 Apr 10, 2026
7468bd2
Merge branch 'main' into discover-background-search-inspect-in-flyout
akowalska622 Apr 10, 2026
4d1639a
run i18n fix script
akowalska622 Apr 10, 2026
406e9f1
Merge branch 'discover-background-search-inspect-in-flyout' of github…
akowalska622 Apr 10, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/platform/plugins/shared/data/moon.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ dependsOn:
- '@kbn/apm-utils'
- '@kbn/std'
- '@kbn/core-elasticsearch-server'
- '@kbn/css-utils'
tags:
- plugin
- prod
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
/*
* 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", the "GNU Affero General Public License v3.0 only", 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", the "GNU Affero General Public
* License v3.0 only", or the "Server Side Public License, v 1".
*/

export { InspectFlyout } from './inspect_flyout';
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
/*
* 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", the "GNU Affero General Public License v3.0 only", 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", the "GNU Affero General Public
* License v3.0 only", or the "Server Side Public License, v 1".
*/

import { EuiFlyoutBody, EuiSpacer, EuiText, type UseEuiTheme } from '@elastic/eui';
import { FormattedMessage } from '@kbn/i18n-react';
import React from 'react';
import { css } from '@emotion/react';
import { CodeEditor } from '@kbn/code-editor';
import { useMemoCss } from '@kbn/css-utils/public/use_memo_css';
import type { UISession } from '../../types';

interface InspectFlyoutProps {
searchSession: UISession;
}

export const InspectFlyout: React.FC<InspectFlyoutProps> = ({ searchSession }) => {
const styles = useMemoCss(componentStyles);

const renderInfo = () => {
return (
<div css={styles.jsonCodeEditor}>
<CodeEditor
languageId="json"
value={JSON.stringify(searchSession, null, 2)}
options={{
readOnly: true,
lineNumbers: 'off',
fontSize: 12,
minimap: {
enabled: false,
},
scrollBeyondLastLine: false,
wordWrap: 'on',
wrappingIndent: 'indent',
automaticLayout: true,
}}
/>
</div>
);
};

return (
<EuiFlyoutBody css={styles.flyout} data-test-subj="searchSessionsFlyout">
<EuiText>
<EuiText size="xs">
<p>
<FormattedMessage
id="data.sessions.management.backgroundSearchFlyoutText"
defaultMessage="Configuration for this background search"
/>
</p>
</EuiText>
<EuiSpacer />
{renderInfo()}
</EuiText>
</EuiFlyoutBody>
);
};

const componentStyles = {
flyout: css({
'.euiFlyoutBody__overflowContent': {
height: '100%',
overflow: 'hidden',
'> div': {
height: '100%',
},
},
}),
jsonCodeEditor: ({ euiTheme }: UseEuiTheme) =>
css({
height: `calc(100% - ${euiTheme.size.l})`,
}),
};
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,12 @@ export const getAction = (
api: SearchSessionsMgmtAPI,
actionType: ACTION,
uiSession: UISession,
core: CoreStart
core: CoreStart,
isWithinFlyout: boolean = false
): IClickActionDescriptor | null => {
switch (actionType) {
case ACTION.INSPECT:
return createInspectActionDescriptor(api, uiSession, core);
return createInspectActionDescriptor(api, uiSession, core, isWithinFlyout);
case ACTION.DELETE:
return createDeleteActionDescriptor(api, uiSession, core);
case ACTION.EXTEND:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,106 +7,20 @@
* License v3.0 only", or the "Server Side Public License, v 1".
*/

import { EuiFlyoutBody, EuiFlyoutHeader, EuiSpacer, EuiText, EuiTitle } from '@elastic/eui';
import { FormattedMessage } from '@kbn/i18n-react';
import React, { Fragment } from 'react';
import { css } from '@emotion/react';
import { i18n } from '@kbn/i18n';
import React from 'react';
import type { CoreStart } from '@kbn/core/public';
import { createKibanaReactContext } from '@kbn/kibana-react-plugin/public';
import { toMountPoint } from '@kbn/react-kibana-mount';
import { CodeEditor } from '@kbn/code-editor';
import type { UISession } from '../../../types';
import type { IClickActionDescriptor } from './types';
import type { SearchSessionsMgmtAPI } from '../../../lib/api';

interface InspectFlyoutProps {
searchSession: UISession;
}

const InspectFlyout: React.FC<InspectFlyoutProps> = ({ searchSession }) => {
const renderInfo = () => {
return (
<Fragment>
<CodeEditor
languageId="json"
value={JSON.stringify(searchSession, null, 2)}
options={{
readOnly: true,
lineNumbers: 'off',
fontSize: 12,
minimap: {
enabled: false,
},
scrollBeyondLastLine: false,
wordWrap: 'on',
wrappingIndent: 'indent',
automaticLayout: true,
}}
/>
</Fragment>
);
};

return (
<>
<EuiFlyoutHeader hasBorder>
<EuiTitle size="m">
<h2 id="flyoutTitle">
<FormattedMessage
id="data.sessions.management.backgroundSearchFlyoutTitle"
defaultMessage="Inspect background search"
/>
</h2>
</EuiTitle>
</EuiFlyoutHeader>
<EuiFlyoutBody css={styles.flyout} data-test-subj="searchSessionsFlyout">
<EuiText>
<EuiText size="xs">
<p>
<FormattedMessage
id="data.sessions.management.backgroundSearchFlyoutText"
defaultMessage="Configuration for this background search"
/>
</p>
</EuiText>
<EuiSpacer />
{renderInfo()}
</EuiText>
</EuiFlyoutBody>
</>
);
};

interface InspectFlyoutWrapperProps {
searchSession: UISession;
uiSettings: CoreStart['uiSettings'];
settings: CoreStart['settings'];
theme: CoreStart['theme'];
}

const InspectFlyoutWrapper: React.FC<InspectFlyoutWrapperProps> = ({
searchSession,
uiSettings,
settings,
theme,
}) => {
const { Provider: KibanaReactContextProvider } = createKibanaReactContext({
uiSettings,
settings,
theme,
});

return (
<KibanaReactContextProvider>
<InspectFlyout searchSession={searchSession} />
</KibanaReactContextProvider>
);
};
import { InspectFlyout } from '../../inspect_flyout';

export const createInspectActionDescriptor = (
api: SearchSessionsMgmtAPI,
uiSession: UISession,
core: CoreStart
core: CoreStart,
isWithinFlyout: boolean = false
): IClickActionDescriptor => ({
iconType: 'document',
label: (
Expand All @@ -117,26 +31,18 @@ export const createInspectActionDescriptor = (
/>
),
onClick: async () => {
const flyoutWrapper = (
<InspectFlyoutWrapper
uiSettings={core.uiSettings}
settings={core.settings}
theme={core.theme}
searchSession={uiSession}
/>
);
const overlay = core.overlays.openFlyout(toMountPoint(flyoutWrapper, core));
const overlay = core.overlays.openSystemFlyout(<InspectFlyout searchSession={uiSession} />, {
id: `inspect-background-search-${uiSession.id}`,
title: i18n.translate('data.sessions.management.backgroundSearchFlyoutTitle', {
defaultMessage: 'Inspect {name}',
values: { name: uiSession.name },
}),
flyoutMenuProps: { hideTitle: false },
size: 'm',
session: isWithinFlyout ? 'inherit' : 'start',
type: 'overlay',
outsideClickCloses: true,
});
await overlay.onClose;
},
});

const styles = {
flyout: css({
'.euiFlyoutBody__overflowContent': {
height: '100%',
'> div': {
height: '100%',
},
},
}),
};
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ interface PopoverActionItemsProps {
onActionComplete: OnActionComplete;
core: CoreStart;
allowedActions?: UISession['actions'];
isWithinFlyout?: boolean;
}

export const PopoverActionsMenu = ({
Expand All @@ -36,6 +37,7 @@ export const PopoverActionsMenu = ({
session,
core,
allowedActions,
isWithinFlyout = false,
}: PopoverActionItemsProps) => {
const [isPopoverOpen, setPopover] = useState(false);

Expand Down Expand Up @@ -71,7 +73,7 @@ export const PopoverActionsMenu = ({
}) || [];
// Generic set of actions - up to the API to return what is available
const items = actions.reduce((itemSet, actionType) => {
const actionDef = getAction(api, actionType, session, core);
const actionDef = getAction(api, actionType, session, core, isWithinFlyout);
if (actionDef) {
const { label, iconType, onClick } = actionDef;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,11 @@
* your election, the "Elastic License 2.0", the "GNU Affero General Public
* License v3.0 only", or the "Server Side Public License, v 1".
*/
import type extendSessionIcon from './icons/extend_session.svg';

export type OnActionComplete = () => void;
export type OnActionDismiss = () => void;

export interface IClickActionDescriptor {
label: React.ReactNode;
iconType: 'trash' | 'cancel' | typeof extendSessionIcon;
iconType: string;
onClick: () => Promise<void> | void;
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,13 @@ export const actionsColumn = ({
core,
onActionComplete,
allowedActions,
isWithinFlyout = false,
}: {
core: CoreStart;
api: SearchSessionsMgmtAPI;
onActionComplete: OnActionComplete;
allowedActions?: UISession['actions'];
isWithinFlyout?: boolean;
}): EuiBasicTableColumn<UISession> => ({
field: 'actions',
name: i18n.translate('data.mgmt.searchSessions.table.headerActions', {
Expand All @@ -47,6 +49,7 @@ export const actionsColumn = ({
core={core}
allowedActions={allowedActions}
onActionComplete={onActionComplete}
isWithinFlyout={isWithinFlyout}
/>
</EuiFlexItem>
</EuiFlexGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ const setup = () => {
render(
<IntlProvider>
<Flyout
flyoutId="test"
onClose={onClose}
api={api}
config={mockConfig}
Expand All @@ -70,11 +69,6 @@ const setup = () => {
};

describe('<Flyout />', () => {
it('render the title', () => {
setup();
expect(screen.getByText('Background searches')).toBeVisible();
});

it('renders the table', () => {
setup();
expect(screen.getByTestId('searchSessionsMgmtUiTable')).toBeVisible();
Expand Down
Loading
Loading