(RECENT_SESSION_ROUTE, {
+ query: {
+ indexes: ['cmd*', '.siem-signals*'],
+ },
+ });
+ },
+ {
+ refetchOnWindowFocus: false,
+ refetchOnMount: false,
+ refetchOnReconnect: false,
+ }
+ );
const [sessionEntityId, setSessionEntityId] = useState('');
@@ -158,7 +159,9 @@ export const SessionViewPage = (props: RouteComponentProps) => {
description="Session view showing the most recent interactive session."
/>
- {sessionEntityId && }
+ {sessionEntityId && (
+
+ )}
diff --git a/x-pack/plugins/session_view/public/components/SessionViewTableProcessTree/index.test.tsx b/x-pack/plugins/session_view/public/components/SessionViewTableProcessTree/index.test.tsx
index ad724f7ace9847..c551c2f89794c3 100644
--- a/x-pack/plugins/session_view/public/components/SessionViewTableProcessTree/index.test.tsx
+++ b/x-pack/plugins/session_view/public/components/SessionViewTableProcessTree/index.test.tsx
@@ -36,11 +36,7 @@ const mockActionProps: ActionProps = {
jest.mock('../SessionView/index.tsx', () => {
return {
SessionView: () => {
- return (
-
- Mock
-
- );
+ return Mock
;
},
};
});
@@ -50,7 +46,8 @@ jest.mock('../SessionLeaderTable/index.tsx', () => {
SessionLeaderTable: (props: SessionLeaderTableProps) => {
const { onOpenSessionViewer = () => {} } = props;
return (
- onOpenSessionViewer(mockActionProps)}
>
@@ -93,8 +90,8 @@ describe('SessionViewTableProcessTree component', () => {
it('Switches to session view when the user picks a session', async () => {
renderResult = mockedContext.render();
- const sessionLeaderTable = renderResult.queryByTestId('SessionLeaderTable');
- sessionLeaderTable && fireEvent.click(sessionLeaderTable);
+ const sessionLeaderTable = renderResult.getByTestId('SessionLeaderTable');
+ fireEvent.click(sessionLeaderTable);
await waitForApiCall();
// Now that we fetched the entity id, session view should be visible
@@ -104,15 +101,15 @@ describe('SessionViewTableProcessTree component', () => {
it('Close button works', async () => {
renderResult = mockedContext.render();
- const sessionLeaderTable = renderResult.queryByTestId('SessionLeaderTable');
- sessionLeaderTable && fireEvent.click(sessionLeaderTable);
+ const sessionLeaderTable = renderResult.getByTestId('SessionLeaderTable');
+ fireEvent.click(sessionLeaderTable);
await waitForApiCall();
expect(renderResult.queryByTestId('SessionView')).toBeTruthy();
expect(renderResult.queryByTestId('SessionLeaderTable')).toBeNull();
- const closeButton = renderResult.queryByTestId('session-view-close-button');
- closeButton && fireEvent.click(closeButton);
+ const closeButton = renderResult.getByTestId('session-view-close-button');
+ fireEvent.click(closeButton);
expect(renderResult.queryByTestId('SessionLeaderTable')).toBeTruthy();
expect(renderResult.queryByTestId('SessionView')).toBeNull();
diff --git a/x-pack/plugins/session_view/server/routes/index.ts b/x-pack/plugins/session_view/server/routes/index.ts
index c12841e7d5ef0f..7da631f59512ea 100644
--- a/x-pack/plugins/session_view/server/routes/index.ts
+++ b/x-pack/plugins/session_view/server/routes/index.ts
@@ -4,14 +4,13 @@
* 2.0; you may not use this file except in compliance with the Elastic License
* 2.0.
*/
-
+import type { Logger } from 'kibana/server';
import { IRouter } from '../../../../../src/core/server';
import { registerTestRoute } from './test_route';
import { registerTestSavedObjectsRoute } from './test_saved_objects_route';
import { registerProcessEventsRoute } from './process_events_route';
import { registerRecentSessionRoute } from './recent_session_route';
import { sessionEntryLeadersRoute } from './session_entry_leaders_route';
-import type { Logger } from 'kibana/server';
export const registerRoutes = (router: IRouter, logger: Logger) => {
registerTestRoute(router);
diff --git a/x-pack/plugins/session_view/server/routes/process_events_route.ts b/x-pack/plugins/session_view/server/routes/process_events_route.ts
index e456f9a024cec9..6871560424a9ae 100644
--- a/x-pack/plugins/session_view/server/routes/process_events_route.ts
+++ b/x-pack/plugins/session_view/server/routes/process_events_route.ts
@@ -5,9 +5,8 @@
* 2.0.
*/
import { schema } from '@kbn/config-schema';
-import type { Logger } from 'kibana/server';
+import type { ElasticsearchClient, Logger } from 'kibana/server';
import { IRouter } from '../../../../../src/core/server';
-import { ElasticsearchClient } from '../../../../../src/core/server/elasticsearch';
import { PROCESS_EVENTS_ROUTE, PROCESS_EVENTS_PER_PAGE } from '../../common/constants';
import { expandDottedObject } from '../../common/utils/expand_dotted_object';
diff --git a/x-pack/plugins/session_view/server/routes/session_entry_leaders_route.ts b/x-pack/plugins/session_view/server/routes/session_entry_leaders_route.ts
index 58791926e0c732..68f8facab25e90 100644
--- a/x-pack/plugins/session_view/server/routes/session_entry_leaders_route.ts
+++ b/x-pack/plugins/session_view/server/routes/session_entry_leaders_route.ts
@@ -32,6 +32,6 @@ export const sessionEntryLeadersRoute = (router: IRouter) => {
session_entry_leader: result?.body?._source,
},
});
- },
+ }
);
};