From d0e43906154a3f554a5355fe737fa22217f7132a Mon Sep 17 00:00:00 2001 From: Tomasz Ciecierski Date: Mon, 26 Aug 2024 12:45:16 +0200 Subject: [PATCH 1/6] [EDR Workflows] Enable JAMF data in Analyzer (#190965) --- .../plugins/security_solution/common/experimental_features.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/x-pack/plugins/security_solution/common/experimental_features.ts b/x-pack/plugins/security_solution/common/experimental_features.ts index ed8d76c1949a7..fde8e1f4537a7 100644 --- a/x-pack/plugins/security_solution/common/experimental_features.ts +++ b/x-pack/plugins/security_solution/common/experimental_features.ts @@ -170,7 +170,7 @@ export const allowedExperimentalValues = Object.freeze({ /** * Enables experimental JAMF integration data to be available in Analyzer */ - jamfDataInAnalyzerEnabled: false, + jamfDataInAnalyzerEnabled: true, /* * Disables discover esql tab within timeline From e6e51cc68f5cf7a0b7e5137784487de5335f8eb8 Mon Sep 17 00:00:00 2001 From: Julia Date: Mon, 26 Aug 2024 13:11:16 +0200 Subject: [PATCH 2/6] [MX] Fix alert table last column size (#190712) Issue https://github.com/elastic/kibana/issues/186907. Now even on wide screens, and when there is space after the last column, a grey area is not shown, last column extended to meet the full page width. We should extend the last column to meet the full page width. ![Screenshot 2024-08-23 at 14 38 50](https://github.com/user-attachments/assets/d62151fc-9640-46a8-ba60-2b9bd55deeae) For this part of the task: "Also, we should consider adding a column action for users to be able to reset the width of the column" I'll create another issue. How to test: 1. Create a rule, which will trigger alerts. 2. Go to Alerts table 3. Keep only 3-4 fields in the table 4. Check if the grey area after last field does not exist ![Screenshot 2024-08-23 at 14 42 00](https://github.com/user-attachments/assets/dd0eafb8-9261-4180-9829-eecc1685c04f) ### Checklist - [x] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios --- .../hooks/use_columns/use_columns.test.tsx | 80 +++++++++++++++---- .../hooks/use_columns/use_columns.ts | 17 +++- 2 files changed, 80 insertions(+), 17 deletions(-) diff --git a/x-pack/plugins/triggers_actions_ui/public/application/sections/alerts_table/hooks/use_columns/use_columns.test.tsx b/x-pack/plugins/triggers_actions_ui/public/application/sections/alerts_table/hooks/use_columns/use_columns.test.tsx index ced47444f3a8f..18db63c44234e 100644 --- a/x-pack/plugins/triggers_actions_ui/public/application/sections/alerts_table/hooks/use_columns/use_columns.test.tsx +++ b/x-pack/plugins/triggers_actions_ui/public/application/sections/alerts_table/hooks/use_columns/use_columns.test.tsx @@ -90,6 +90,33 @@ describe('useColumns', () => { }; const defaultColumns: EuiDataGridColumn[] = [ + { + id: 'event.action', + displayAsText: 'Alert status', + initialWidth: 150, + schema: 'string', + }, + { + id: '@timestamp', + displayAsText: 'Last updated', + initialWidth: 250, + schema: 'datetime', + }, + { + id: 'kibana.alert.duration.us', + displayAsText: 'Duration', + initialWidth: 150, + schema: 'numeric', + }, + { + id: 'kibana.alert.reason', + displayAsText: 'Reason', + initialWidth: 260, + schema: 'string', + }, + ]; + + const resultColumns = [ { id: 'event.action', displayAsText: 'Alert status', @@ -122,10 +149,9 @@ describe('useColumns', () => { }); test('onColumnResize', async () => { - // storageTable will always be in sync with defualtColumns. - // it is an invariant. If that is the case, that can be considered an issue - const localStorageAlertsTable = getStorageAlertsTableByDefaultColumns(defaultColumns); - const { result } = renderHook( + const localDefaultColumns = [...defaultColumns]; + const localStorageAlertsTable = getStorageAlertsTableByDefaultColumns(localDefaultColumns); + const { result, rerender } = renderHook( () => useColumns({ defaultColumns, @@ -137,13 +163,15 @@ describe('useColumns', () => { { wrapper } ); - act(() => { + await act(async () => { result.current.onColumnResize({ columnId: '@timestamp', width: 100 }); }); + rerender(); + expect(setItemStorageMock).toHaveBeenCalledWith( 'useColumnTest', - '{"columns":[{"id":"event.action","displayAsText":"Alert status","initialWidth":150,"schema":"string"},{"id":"@timestamp","displayAsText":"Last updated","initialWidth":100,"schema":"datetime"},{"id":"kibana.alert.duration.us","displayAsText":"Duration","initialWidth":150,"schema":"numeric"},{"id":"kibana.alert.reason","displayAsText":"Reason","schema":"string"}],"visibleColumns":["event.action","@timestamp","kibana.alert.duration.us","kibana.alert.reason"],"sort":[]}' + '{"columns":[{"id":"event.action","displayAsText":"Alert status","initialWidth":150,"schema":"string"},{"id":"@timestamp","displayAsText":"Last updated","initialWidth":100,"schema":"datetime"},{"id":"kibana.alert.duration.us","displayAsText":"Duration","initialWidth":150,"schema":"numeric"},{"id":"kibana.alert.reason","displayAsText":"Reason","initialWidth":260,"schema":"string"}],"visibleColumns":["event.action","@timestamp","kibana.alert.duration.us","kibana.alert.reason"],"sort":[]}' ); expect(result.current.columns.find((c) => c.id === '@timestamp')).toEqual({ displayAsText: 'Last updated', @@ -153,6 +181,28 @@ describe('useColumns', () => { }); }); + test('check if initial width for the last column does not exist', async () => { + const localStorageAlertsTable = getStorageAlertsTableByDefaultColumns(defaultColumns); + const { result } = renderHook( + () => + useColumns({ + defaultColumns, + featureIds, + id, + storageAlertsTable: localStorageAlertsTable, + storage, + }), + { wrapper } + ); + + const columns = result.current.columns; + const visibleColumns = result.current.visibleColumns; + const lastVisibleColumnId = visibleColumns[visibleColumns.length - 1]; + const lastVisiableColumn = columns.find((col) => col.id === lastVisibleColumnId); + + expect(lastVisiableColumn).not.toHaveProperty('initialWidth'); + }); + test("does not fetch alerts fields if they're overridden through the alertsFields prop", () => { const localStorageAlertsTable = getStorageAlertsTableByDefaultColumns(defaultColumns); const alertsFields = { @@ -216,7 +266,7 @@ describe('useColumns', () => { result.current.onChangeVisibleColumns([]); }); act(() => { - result.current.onChangeVisibleColumns(defaultColumns.map((dc) => dc.id)); + result.current.onChangeVisibleColumns(resultColumns.map((dc) => dc.id)); }); expect(result.current.visibleColumns).toEqual([ 'event.action', @@ -224,7 +274,7 @@ describe('useColumns', () => { 'kibana.alert.duration.us', 'kibana.alert.reason', ]); - expect(result.current.columns).toEqual(defaultColumns); + expect(result.current.columns).toEqual(resultColumns); }); test('should populate visibleColumns correctly', async () => { @@ -296,7 +346,7 @@ describe('useColumns', () => { { wrapper } ); - await waitFor(() => expect(result.current.columns).toMatchObject(defaultColumns)); + await waitFor(() => expect(result.current.columns).toMatchObject(resultColumns)); }); }); @@ -316,10 +366,10 @@ describe('useColumns', () => { ); act(() => { - result.current.onToggleColumn(defaultColumns[0].id); + result.current.onToggleColumn(resultColumns[0].id); }); - expect(result.current.columns).toMatchObject(defaultColumns.slice(1)); + expect(result.current.columns).toMatchObject(resultColumns.slice(1)); }); test('should update the list of visible columns when onToggleColumn is called', async () => { @@ -338,17 +388,17 @@ describe('useColumns', () => { // remove particular column act(() => { - result.current.onToggleColumn(defaultColumns[0].id); + result.current.onToggleColumn(resultColumns[0].id); }); - expect(result.current.columns).toMatchObject(defaultColumns.slice(1)); + expect(result.current.columns).toMatchObject(resultColumns.slice(1)); // make it visible again act(() => { - result.current.onToggleColumn(defaultColumns[0].id); + result.current.onToggleColumn(resultColumns[0].id); }); - expect(result.current.columns).toMatchObject(defaultColumns); + expect(result.current.columns).toMatchObject(resultColumns); }); test('should update the column details in the storage when onToggleColumn is called', () => { diff --git a/x-pack/plugins/triggers_actions_ui/public/application/sections/alerts_table/hooks/use_columns/use_columns.ts b/x-pack/plugins/triggers_actions_ui/public/application/sections/alerts_table/hooks/use_columns/use_columns.ts index 8846470a2d263..30c9ff0ea69ed 100644 --- a/x-pack/plugins/triggers_actions_ui/public/application/sections/alerts_table/hooks/use_columns/use_columns.ts +++ b/x-pack/plugins/triggers_actions_ui/public/application/sections/alerts_table/hooks/use_columns/use_columns.ts @@ -306,9 +306,22 @@ export const useColumns = ({ [columns] ); + // remove initialWidth property from the last column to extended it to meet the full page width + const columnsWithoutInitialWidthForLastVisibleColumn = useMemo(() => { + const lastVisibleColumns = visibleColumns[visibleColumns.length - 1]; + return columns.map((col) => { + if (col.id !== lastVisibleColumns) { + return col; + } + + const { initialWidth, ...rest } = col; + return rest; + }); + }, [columns, visibleColumns]); + return useMemo( () => ({ - columns, + columns: columnsWithoutInitialWidthForLastVisibleColumn, visibleColumns, isBrowserFieldDataLoading: fieldsQuery.isLoading, browserFields: selectedAlertsFields, @@ -319,7 +332,7 @@ export const useColumns = ({ fields: fieldsToFetch, }), [ - columns, + columnsWithoutInitialWidthForLastVisibleColumn, visibleColumns, fieldsQuery.isLoading, selectedAlertsFields, From 7eb7e973689bb8fcbcf5e857f905064dffbc43fa Mon Sep 17 00:00:00 2001 From: Stratoula Kalafateli Date: Mon, 26 Aug 2024 14:11:28 +0300 Subject: [PATCH 3/6] [Discover] Hides the menu when no data (#191252) ## Summary Closes https://github.com/elastic/kibana/issues/190416 Hides the menu when there is no data. --- .../discover/public/application/main/discover_main_route.tsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/plugins/discover/public/application/main/discover_main_route.tsx b/src/plugins/discover/public/application/main/discover_main_route.tsx index 0e1c1472ac556..4ceae12fe8929 100644 --- a/src/plugins/discover/public/application/main/discover_main_route.tsx +++ b/src/plugins/discover/public/application/main/discover_main_route.tsx @@ -354,7 +354,10 @@ export function DiscoverMainRoute({ <> - + {mainContent} From 56730e86af9f6c3c701f1f666e8ce856bcf98fd1 Mon Sep 17 00:00:00 2001 From: Pierre Gayvallet Date: Mon, 26 Aug 2024 13:18:12 +0200 Subject: [PATCH 4/6] [Inference] Minor cleanup and restructure (#191069) ## Summary Fixing and improving a few things I noticed while discovering / ramping up on the existing code - address some nits - extract / reuse some low level functions - move things around - add unit tests --- .../inference/common/chat_complete/index.ts | 1 + x-pack/plugins/inference/common/connectors.ts | 12 ++- .../inference/public/chat_complete/index.ts | 4 +- x-pack/plugins/inference/public/plugin.tsx | 12 ++- .../adapters/get_inference_adapter.test.ts | 24 +++++ .../adapters/get_inference_adapter.ts | 29 ++++++ .../server/chat_complete/adapters/index.ts | 8 ++ .../adapters/openai/index.test.ts | 35 +++---- .../chat_complete/adapters/openai/index.ts | 85 ++++++++--------- .../inference/server/chat_complete/api.ts | 63 +++++++++++++ .../inference/server/chat_complete/index.ts | 67 +------------- .../inference/server/chat_complete/types.ts | 33 +++++-- .../chunks_into_message.test.ts | 0 .../chunks_into_message.ts | 0 .../server/chat_complete/utils/index.ts | 14 +++ .../utils/inference_executor.test.ts | 51 ++++++++++ .../chat_complete/utils/inference_executor.ts | 46 ++++++++++ .../server/inference_client/index.ts | 34 +------ x-pack/plugins/inference/server/plugin.ts | 13 +-- .../inference/server/routes/chat_complete.ts | 19 ++-- .../inference/server/routes/connectors.ts | 14 ++- .../plugins/inference/server/routes/index.ts | 22 +++++ x-pack/plugins/inference/server/types.ts | 2 - ...vent_source_stream_into_observable.test.ts | 54 +++++++++++ .../event_source_stream_into_observable.ts | 2 +- .../server/util/get_connector_by_id.test.ts | 92 +++++++++++++++++++ .../server/util/get_connector_by_id.ts | 46 ++++++++++ 27 files changed, 571 insertions(+), 211 deletions(-) create mode 100644 x-pack/plugins/inference/server/chat_complete/adapters/get_inference_adapter.test.ts create mode 100644 x-pack/plugins/inference/server/chat_complete/adapters/get_inference_adapter.ts create mode 100644 x-pack/plugins/inference/server/chat_complete/adapters/index.ts create mode 100644 x-pack/plugins/inference/server/chat_complete/api.ts rename x-pack/plugins/inference/server/chat_complete/{adapters => utils}/chunks_into_message.test.ts (100%) rename x-pack/plugins/inference/server/chat_complete/{adapters => utils}/chunks_into_message.ts (100%) create mode 100644 x-pack/plugins/inference/server/chat_complete/utils/index.ts create mode 100644 x-pack/plugins/inference/server/chat_complete/utils/inference_executor.test.ts create mode 100644 x-pack/plugins/inference/server/chat_complete/utils/inference_executor.ts create mode 100644 x-pack/plugins/inference/server/routes/index.ts create mode 100644 x-pack/plugins/inference/server/util/event_source_stream_into_observable.test.ts rename x-pack/plugins/inference/server/{chat_complete/adapters => util}/event_source_stream_into_observable.ts (95%) create mode 100644 x-pack/plugins/inference/server/util/get_connector_by_id.test.ts create mode 100644 x-pack/plugins/inference/server/util/get_connector_by_id.ts diff --git a/x-pack/plugins/inference/common/chat_complete/index.ts b/x-pack/plugins/inference/common/chat_complete/index.ts index 175f86f74b5c4..abad6a4372595 100644 --- a/x-pack/plugins/inference/common/chat_complete/index.ts +++ b/x-pack/plugins/inference/common/chat_complete/index.ts @@ -4,6 +4,7 @@ * 2.0; you may not use this file except in compliance with the Elastic License * 2.0. */ + import type { Observable } from 'rxjs'; import type { InferenceTaskEventBase } from '../tasks'; import type { ToolCall, ToolCallsOf, ToolOptions } from './tools'; diff --git a/x-pack/plugins/inference/common/connectors.ts b/x-pack/plugins/inference/common/connectors.ts index 82baea2f83c39..f7ad616741d79 100644 --- a/x-pack/plugins/inference/common/connectors.ts +++ b/x-pack/plugins/inference/common/connectors.ts @@ -11,6 +11,8 @@ export enum InferenceConnectorType { Gemini = '.gemini', } +const allSupportedConnectorTypes = Object.values(InferenceConnectorType); + export interface InferenceConnector { type: InferenceConnectorType; name: string; @@ -18,9 +20,9 @@ export interface InferenceConnector { } export function isSupportedConnectorType(id: string): id is InferenceConnectorType { - return ( - id === InferenceConnectorType.OpenAI || - id === InferenceConnectorType.Bedrock || - id === InferenceConnectorType.Gemini - ); + return allSupportedConnectorTypes.includes(id as InferenceConnectorType); +} + +export interface GetConnectorsResponseBody { + connectors: InferenceConnector[]; } diff --git a/x-pack/plugins/inference/public/chat_complete/index.ts b/x-pack/plugins/inference/public/chat_complete/index.ts index 2509ea2dc1222..3dfe4616b7323 100644 --- a/x-pack/plugins/inference/public/chat_complete/index.ts +++ b/x-pack/plugins/inference/public/chat_complete/index.ts @@ -5,9 +5,9 @@ * 2.0. */ -import type { HttpStart } from '@kbn/core/public'; import { from } from 'rxjs'; -import { ChatCompleteAPI } from '../../common/chat_complete'; +import type { HttpStart } from '@kbn/core/public'; +import type { ChatCompleteAPI } from '../../common/chat_complete'; import type { ChatCompleteRequestBody } from '../../common/chat_complete/request'; import { httpResponseIntoObservable } from '../util/http_response_into_observable'; diff --git a/x-pack/plugins/inference/public/plugin.tsx b/x-pack/plugins/inference/public/plugin.tsx index 9785efb7a8874..13ef4a0373845 100644 --- a/x-pack/plugins/inference/public/plugin.tsx +++ b/x-pack/plugins/inference/public/plugin.tsx @@ -4,9 +4,11 @@ * 2.0; you may not use this file except in compliance with the Elastic License * 2.0. */ -import { CoreSetup, CoreStart, Plugin, PluginInitializerContext } from '@kbn/core/public'; + +import type { CoreSetup, CoreStart, Plugin, PluginInitializerContext } from '@kbn/core/public'; import type { Logger } from '@kbn/logging'; import { createOutputApi } from '../common/output/create_output_api'; +import type { GetConnectorsResponseBody } from '../common/connectors'; import { createChatCompleteApi } from './chat_complete'; import type { ConfigSchema, @@ -39,11 +41,15 @@ export class InferencePlugin start(coreStart: CoreStart, pluginsStart: InferenceStartDependencies): InferencePublicStart { const chatComplete = createChatCompleteApi({ http: coreStart.http }); + return { chatComplete, output: createOutputApi(chatComplete), - getConnectors: () => { - return coreStart.http.get('/internal/inference/connectors'); + getConnectors: async () => { + const res = await coreStart.http.get( + '/internal/inference/connectors' + ); + return res.connectors; }, }; } diff --git a/x-pack/plugins/inference/server/chat_complete/adapters/get_inference_adapter.test.ts b/x-pack/plugins/inference/server/chat_complete/adapters/get_inference_adapter.test.ts new file mode 100644 index 0000000000000..272ad76538898 --- /dev/null +++ b/x-pack/plugins/inference/server/chat_complete/adapters/get_inference_adapter.test.ts @@ -0,0 +1,24 @@ +/* + * 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 { InferenceConnectorType } from '../../../common/connectors'; +import { getInferenceAdapter } from './get_inference_adapter'; +import { openAIAdapter } from './openai'; + +describe('getInferenceAdapter', () => { + it('returns the openAI adapter for OpenAI type', () => { + expect(getInferenceAdapter(InferenceConnectorType.OpenAI)).toBe(openAIAdapter); + }); + + it('returns undefined for Bedrock type', () => { + expect(getInferenceAdapter(InferenceConnectorType.Bedrock)).toBe(undefined); + }); + + it('returns undefined for Gemini type', () => { + expect(getInferenceAdapter(InferenceConnectorType.Gemini)).toBe(undefined); + }); +}); diff --git a/x-pack/plugins/inference/server/chat_complete/adapters/get_inference_adapter.ts b/x-pack/plugins/inference/server/chat_complete/adapters/get_inference_adapter.ts new file mode 100644 index 0000000000000..a62ec8b795608 --- /dev/null +++ b/x-pack/plugins/inference/server/chat_complete/adapters/get_inference_adapter.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; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { InferenceConnectorType } from '../../../common/connectors'; +import type { InferenceConnectorAdapter } from '../types'; +import { openAIAdapter } from './openai'; + +export const getInferenceAdapter = ( + connectorType: InferenceConnectorType +): InferenceConnectorAdapter | undefined => { + switch (connectorType) { + case InferenceConnectorType.OpenAI: + return openAIAdapter; + + case InferenceConnectorType.Bedrock: + // not implemented yet + break; + + case InferenceConnectorType.Gemini: + // not implemented yet + break; + } + + return undefined; +}; diff --git a/x-pack/plugins/inference/server/chat_complete/adapters/index.ts b/x-pack/plugins/inference/server/chat_complete/adapters/index.ts new file mode 100644 index 0000000000000..bc420bdf57473 --- /dev/null +++ b/x-pack/plugins/inference/server/chat_complete/adapters/index.ts @@ -0,0 +1,8 @@ +/* + * 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. + */ + +export { getInferenceAdapter } from './get_inference_adapter'; diff --git a/x-pack/plugins/inference/server/chat_complete/adapters/openai/index.test.ts b/x-pack/plugins/inference/server/chat_complete/adapters/openai/index.test.ts index 7f55f8a8faa48..f3b7c423ea42f 100644 --- a/x-pack/plugins/inference/server/chat_complete/adapters/openai/index.test.ts +++ b/x-pack/plugins/inference/server/chat_complete/adapters/openai/index.test.ts @@ -6,14 +6,14 @@ */ import OpenAI from 'openai'; -import { openAIAdapter } from '.'; -import type { ActionsClient } from '@kbn/actions-plugin/server/actions_client'; -import { ChatCompletionEventType, MessageRole } from '../../../../common/chat_complete'; +import { v4 } from 'uuid'; import { PassThrough } from 'stream'; import { pick } from 'lodash'; import { lastValueFrom, Subject, toArray } from 'rxjs'; +import { ChatCompletionEventType, MessageRole } from '../../../../common/chat_complete'; import { observableIntoEventSourceStream } from '../../../util/observable_into_event_source_stream'; -import { v4 } from 'uuid'; +import { InferenceExecutor } from '../../utils/inference_executor'; +import { openAIAdapter } from '.'; function createOpenAIChunk({ delta, @@ -39,38 +39,27 @@ function createOpenAIChunk({ } describe('openAIAdapter', () => { - const actionsClientMock = { - execute: jest.fn(), - } as ActionsClient & { execute: jest.MockedFn }; + const executorMock = { + invoke: jest.fn(), + } as InferenceExecutor & { invoke: jest.MockedFn }; beforeEach(() => { - actionsClientMock.execute.mockReset(); + executorMock.invoke.mockReset(); }); const defaultArgs = { - connector: { - id: 'foo', - actionTypeId: '.gen-ai', - name: 'OpenAI', - isPreconfigured: false, - isDeprecated: false, - isSystemAction: false, - }, - actionsClient: actionsClientMock, + executor: executorMock, }; describe('when creating the request', () => { function getRequest() { - const params = actionsClientMock.execute.mock.calls[0][0].params.subActionParams as Record< - string, - any - >; + const params = executorMock.invoke.mock.calls[0][0].subActionParams as Record; return { stream: params.stream, body: JSON.parse(params.body) }; } beforeEach(() => { - actionsClientMock.execute.mockImplementation(async () => { + executorMock.invoke.mockImplementation(async () => { return { actionId: '', status: 'ok', @@ -262,7 +251,7 @@ describe('openAIAdapter', () => { beforeEach(() => { source$ = new Subject>(); - actionsClientMock.execute.mockImplementation(async () => { + executorMock.invoke.mockImplementation(async () => { return { actionId: '', status: 'ok', diff --git a/x-pack/plugins/inference/server/chat_complete/adapters/openai/index.ts b/x-pack/plugins/inference/server/chat_complete/adapters/openai/index.ts index c811ed9f400ea..80fa9bfb781f5 100644 --- a/x-pack/plugins/inference/server/chat_complete/adapters/openai/index.ts +++ b/x-pack/plugins/inference/server/chat_complete/adapters/openai/index.ts @@ -21,60 +21,30 @@ import { Message, MessageRole, } from '../../../../common/chat_complete'; +import type { ToolOptions } from '../../../../common/chat_complete/tools'; import { createTokenLimitReachedError } from '../../../../common/chat_complete/errors'; import { createInferenceInternalError } from '../../../../common/errors'; +import { eventSourceStreamIntoObservable } from '../../../util/event_source_stream_into_observable'; import { InferenceConnectorAdapter } from '../../types'; -import { eventSourceStreamIntoObservable } from '../event_source_stream_into_observable'; export const openAIAdapter: InferenceConnectorAdapter = { - chatComplete: ({ connector, actionsClient, system, messages, toolChoice, tools }) => { - const openAIMessages = messagesToOpenAI({ system, messages }); - - const toolChoiceForOpenAI = - typeof toolChoice === 'string' - ? toolChoice - : toolChoice - ? { - function: { - name: toolChoice.function, - }, - type: 'function' as const, - } - : undefined; - + chatComplete: ({ executor, system, messages, toolChoice, tools }) => { const stream = true; const request: Omit & { model?: string } = { stream, - messages: openAIMessages, + messages: messagesToOpenAI({ system, messages }), + tool_choice: toolChoiceToOpenAI(toolChoice), + tools: toolsToOpenAI(tools), temperature: 0, - tool_choice: toolChoiceForOpenAI, - tools: tools - ? Object.entries(tools).map(([toolName, { description, schema }]) => { - return { - type: 'function', - function: { - name: toolName, - description, - parameters: (schema ?? { - type: 'object' as const, - properties: {}, - }) as unknown as Record, - }, - }; - }) - : undefined, }; return from( - actionsClient.execute({ - actionId: connector.id, - params: { - subAction: 'stream', - subActionParams: { - body: JSON.stringify(request), - stream, - }, + executor.invoke({ + subAction: 'stream', + subActionParams: { + body: JSON.stringify(request), + stream, }, }) ).pipe( @@ -125,6 +95,39 @@ export const openAIAdapter: InferenceConnectorAdapter = { }, }; +function toolsToOpenAI(tools: ToolOptions['tools']): OpenAI.ChatCompletionCreateParams['tools'] { + return tools + ? Object.entries(tools).map(([toolName, { description, schema }]) => { + return { + type: 'function', + function: { + name: toolName, + description, + parameters: (schema ?? { + type: 'object' as const, + properties: {}, + }) as unknown as Record, + }, + }; + }) + : undefined; +} + +function toolChoiceToOpenAI( + toolChoice: ToolOptions['toolChoice'] +): OpenAI.ChatCompletionCreateParams['tool_choice'] { + return typeof toolChoice === 'string' + ? toolChoice + : toolChoice + ? { + function: { + name: toolChoice.function, + }, + type: 'function' as const, + } + : undefined; +} + function messagesToOpenAI({ system, messages, diff --git a/x-pack/plugins/inference/server/chat_complete/api.ts b/x-pack/plugins/inference/server/chat_complete/api.ts new file mode 100644 index 0000000000000..17bf0e5214300 --- /dev/null +++ b/x-pack/plugins/inference/server/chat_complete/api.ts @@ -0,0 +1,63 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import type { KibanaRequest } from '@kbn/core-http-server'; +import { defer, switchMap, throwError } from 'rxjs'; +import type { ChatCompleteAPI, ChatCompletionResponse } from '../../common/chat_complete'; +import { createInferenceRequestError } from '../../common/errors'; +import type { InferenceStartDependencies } from '../types'; +import { getConnectorById } from '../util/get_connector_by_id'; +import { getInferenceAdapter } from './adapters'; +import { createInferenceExecutor, chunksIntoMessage } from './utils'; + +export function createChatCompleteApi({ + request, + actions, +}: { + request: KibanaRequest; + actions: InferenceStartDependencies['actions']; +}) { + const chatCompleteAPI: ChatCompleteAPI = ({ + connectorId, + messages, + toolChoice, + tools, + system, + }): ChatCompletionResponse => { + return defer(async () => { + const actionsClient = await actions.getActionsClientWithRequest(request); + const connector = await getConnectorById({ connectorId, actionsClient }); + const executor = createInferenceExecutor({ actionsClient, connector }); + return { executor, connector }; + }).pipe( + switchMap(({ executor, connector }) => { + const connectorType = connector.type; + const inferenceAdapter = getInferenceAdapter(connectorType); + + if (!inferenceAdapter) { + return throwError(() => + createInferenceRequestError(`Adapter for type ${connectorType} not implemented`, 400) + ); + } + + return inferenceAdapter.chatComplete({ + system, + executor, + messages, + toolChoice, + tools, + }); + }), + chunksIntoMessage({ + toolChoice, + tools, + }) + ); + }; + + return chatCompleteAPI; +} diff --git a/x-pack/plugins/inference/server/chat_complete/index.ts b/x-pack/plugins/inference/server/chat_complete/index.ts index e30afb58ca25a..5273822aea5b2 100644 --- a/x-pack/plugins/inference/server/chat_complete/index.ts +++ b/x-pack/plugins/inference/server/chat_complete/index.ts @@ -5,69 +5,4 @@ * 2.0. */ -import type { KibanaRequest } from '@kbn/core-http-server'; -import { defer, switchMap, throwError } from 'rxjs'; -import type { ChatCompleteAPI, ChatCompletionResponse } from '../../common/chat_complete'; -import type { ToolOptions } from '../../common/chat_complete/tools'; -import { InferenceConnectorType } from '../../common/connectors'; -import { createInferenceRequestError } from '../../common/errors'; -import type { InferenceStartDependencies } from '../types'; -import { chunksIntoMessage } from './adapters/chunks_into_message'; -import { openAIAdapter } from './adapters/openai'; - -export function createChatCompleteApi({ - request, - actions, -}: { - request: KibanaRequest; - actions: InferenceStartDependencies['actions']; -}) { - const chatCompleteAPI: ChatCompleteAPI = ({ - connectorId, - messages, - toolChoice, - tools, - system, - }): ChatCompletionResponse => { - return defer(async () => { - const actionsClient = await actions.getActionsClientWithRequest(request); - - const connector = await actionsClient.get({ id: connectorId, throwIfSystemAction: true }); - - return { actionsClient, connector }; - }).pipe( - switchMap(({ actionsClient, connector }) => { - switch (connector.actionTypeId) { - case InferenceConnectorType.OpenAI: - return openAIAdapter.chatComplete({ - system, - connector, - actionsClient, - messages, - toolChoice, - tools, - }); - - case InferenceConnectorType.Bedrock: - break; - - case InferenceConnectorType.Gemini: - break; - } - - return throwError(() => - createInferenceRequestError( - `Adapter for type ${connector.actionTypeId} not implemented`, - 400 - ) - ); - }), - chunksIntoMessage({ - toolChoice, - tools, - }) - ); - }; - - return chatCompleteAPI; -} +export { createChatCompleteApi } from './api'; diff --git a/x-pack/plugins/inference/server/chat_complete/types.ts b/x-pack/plugins/inference/server/chat_complete/types.ts index 6c89df1498646..fff902f7e885e 100644 --- a/x-pack/plugins/inference/server/chat_complete/types.ts +++ b/x-pack/plugins/inference/server/chat_complete/types.ts @@ -5,21 +5,36 @@ * 2.0. */ -import type { ActionsClient } from '@kbn/actions-plugin/server'; import type { Observable } from 'rxjs'; import type { - ChatCompleteAPI, ChatCompletionChunkEvent, ChatCompletionTokenCountEvent, + Message, } from '../../common/chat_complete'; +import type { ToolOptions } from '../../common/chat_complete/tools'; +import type { InferenceExecutor } from './utils'; -type Connector = Awaited>; - +/** + * Adapter in charge of communicating with a specific inference connector + * and to convert inputs/outputs from/to the common chatComplete inference format. + * + * @internal + */ export interface InferenceConnectorAdapter { chatComplete: ( - options: Omit[0], 'connectorId'> & { - actionsClient: ActionsClient; - connector: Connector; - } - ) => Observable; + options: { + messages: Message[]; + system?: string; + executor: InferenceExecutor; + } & ToolOptions + ) => Observable; } + +/** + * Events that can be emitted by the observable returned from {@link InferenceConnectorAdapter.chatComplete} + * + * @internal + */ +export type InferenceConnectorAdapterChatCompleteEvent = + | ChatCompletionChunkEvent + | ChatCompletionTokenCountEvent; diff --git a/x-pack/plugins/inference/server/chat_complete/adapters/chunks_into_message.test.ts b/x-pack/plugins/inference/server/chat_complete/utils/chunks_into_message.test.ts similarity index 100% rename from x-pack/plugins/inference/server/chat_complete/adapters/chunks_into_message.test.ts rename to x-pack/plugins/inference/server/chat_complete/utils/chunks_into_message.test.ts diff --git a/x-pack/plugins/inference/server/chat_complete/adapters/chunks_into_message.ts b/x-pack/plugins/inference/server/chat_complete/utils/chunks_into_message.ts similarity index 100% rename from x-pack/plugins/inference/server/chat_complete/adapters/chunks_into_message.ts rename to x-pack/plugins/inference/server/chat_complete/utils/chunks_into_message.ts diff --git a/x-pack/plugins/inference/server/chat_complete/utils/index.ts b/x-pack/plugins/inference/server/chat_complete/utils/index.ts new file mode 100644 index 0000000000000..dea2ac65f4755 --- /dev/null +++ b/x-pack/plugins/inference/server/chat_complete/utils/index.ts @@ -0,0 +1,14 @@ +/* + * 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. + */ + +export { + createInferenceExecutor, + type InferenceInvokeOptions, + type InferenceInvokeResult, + type InferenceExecutor, +} from './inference_executor'; +export { chunksIntoMessage } from './chunks_into_message'; diff --git a/x-pack/plugins/inference/server/chat_complete/utils/inference_executor.test.ts b/x-pack/plugins/inference/server/chat_complete/utils/inference_executor.test.ts new file mode 100644 index 0000000000000..1821b553dd6a9 --- /dev/null +++ b/x-pack/plugins/inference/server/chat_complete/utils/inference_executor.test.ts @@ -0,0 +1,51 @@ +/* + * 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 { actionsClientMock } from '@kbn/actions-plugin/server/mocks'; +import { InferenceConnector, InferenceConnectorType } from '../../../common/connectors'; +import { createInferenceExecutor, type InferenceExecutor } from './inference_executor'; + +describe('createInferenceExecutor', () => { + let actionsClient: ReturnType; + let executor: InferenceExecutor; + + const connector: InferenceConnector = { + connectorId: 'foo', + name: 'My Connector', + type: InferenceConnectorType.OpenAI, + }; + + beforeEach(() => { + actionsClient = actionsClientMock.create(); + executor = createInferenceExecutor({ actionsClient, connector }); + }); + + describe('#invoke()', () => { + it('calls `actionsClient.execute` with the right parameters', async () => { + await executor.invoke({ subAction: 'stream', subActionParams: { over: 9000 } }); + + expect(actionsClient.execute).toHaveBeenCalledTimes(1); + expect(actionsClient.execute).toHaveBeenCalledWith({ + actionId: connector.connectorId, + params: { subAction: 'stream', subActionParams: { over: 9000 } }, + }); + }); + + it('returns the value returned from `actionsClient.execute`', async () => { + const expectedResult = Symbol.for('call_result'); + + actionsClient.execute.mockResolvedValue(expectedResult as any); + + const result = await executor.invoke({ + subAction: 'stream', + subActionParams: { over: 9000 }, + }); + + expect(result).toBe(expectedResult); + }); + }); +}); diff --git a/x-pack/plugins/inference/server/chat_complete/utils/inference_executor.ts b/x-pack/plugins/inference/server/chat_complete/utils/inference_executor.ts new file mode 100644 index 0000000000000..736beb82aa685 --- /dev/null +++ b/x-pack/plugins/inference/server/chat_complete/utils/inference_executor.ts @@ -0,0 +1,46 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import type { ActionTypeExecutorResult } from '@kbn/actions-plugin/common'; +import type { ActionsClient } from '@kbn/actions-plugin/server'; +import type { InferenceConnector } from '../../../common/connectors'; + +export interface InferenceInvokeOptions { + subAction: string; + subActionParams?: Record; +} + +export type InferenceInvokeResult = ActionTypeExecutorResult; + +/** + * Represent the actual interface to communicate with the inference model. + * + * In practice, for now it's just a thin abstraction around the action client. + */ +export interface InferenceExecutor { + invoke(params: InferenceInvokeOptions): Promise; +} + +export const createInferenceExecutor = ({ + connector, + actionsClient, +}: { + connector: InferenceConnector; + actionsClient: ActionsClient; +}): InferenceExecutor => { + return { + async invoke({ subAction, subActionParams }): Promise { + return await actionsClient.execute({ + actionId: connector.connectorId, + params: { + subAction, + subActionParams, + }, + }); + }, + }; +}; diff --git a/x-pack/plugins/inference/server/inference_client/index.ts b/x-pack/plugins/inference/server/inference_client/index.ts index 3c25cf29f6280..d9d52a8e41ec1 100644 --- a/x-pack/plugins/inference/server/inference_client/index.ts +++ b/x-pack/plugins/inference/server/inference_client/index.ts @@ -6,12 +6,10 @@ */ import type { KibanaRequest } from '@kbn/core-http-server'; -import { ActionsClient } from '@kbn/actions-plugin/server'; -import { isSupportedConnectorType } from '../../common/connectors'; -import { createInferenceRequestError } from '../../common/errors'; -import { createChatCompleteApi } from '../chat_complete'; import type { InferenceClient, InferenceStartDependencies } from '../types'; +import { createChatCompleteApi } from '../chat_complete'; import { createOutputApi } from '../../common/output/create_output_api'; +import { getConnectorById } from '../util/get_connector_by_id'; export function createInferenceClient({ request, @@ -21,33 +19,9 @@ export function createInferenceClient({ return { chatComplete, output: createOutputApi(chatComplete), - getConnectorById: async (id: string) => { + getConnectorById: async (connectorId: string) => { const actionsClient = await actions.getActionsClientWithRequest(request); - let connector: Awaited>; - - try { - connector = await actionsClient.get({ - id, - throwIfSystemAction: true, - }); - } catch (error) { - throw createInferenceRequestError(`No connector found for id ${id}`, 400); - } - - const actionTypeId = connector.id; - - if (!isSupportedConnectorType(actionTypeId)) { - throw createInferenceRequestError( - `Type ${actionTypeId} not recognized as a supported connector type`, - 400 - ); - } - - return { - connectorId: connector.id, - name: connector.name, - type: actionTypeId, - }; + return await getConnectorById({ connectorId, actionsClient }); }, }; } diff --git a/x-pack/plugins/inference/server/plugin.ts b/x-pack/plugins/inference/server/plugin.ts index 26c56209df8ce..1b17eb4a66d35 100644 --- a/x-pack/plugins/inference/server/plugin.ts +++ b/x-pack/plugins/inference/server/plugin.ts @@ -8,10 +8,9 @@ import type { CoreSetup, CoreStart, Plugin, PluginInitializerContext } from '@kbn/core/server'; import type { Logger } from '@kbn/logging'; import { createInferenceClient } from './inference_client'; -import { registerChatCompleteRoute } from './routes/chat_complete'; -import { registerConnectorsRoute } from './routes/connectors'; +import { registerRoutes } from './routes'; +import type { InferenceConfig } from './config'; import type { - ConfigSchema, InferenceServerSetup, InferenceServerStart, InferenceSetupDependencies, @@ -29,7 +28,7 @@ export class InferencePlugin { logger: Logger; - constructor(context: PluginInitializerContext) { + constructor(context: PluginInitializerContext) { this.logger = context.logger.get(); } setup( @@ -38,15 +37,11 @@ export class InferencePlugin ): InferenceServerSetup { const router = coreSetup.http.createRouter(); - registerChatCompleteRoute({ + registerRoutes({ router, coreSetup, }); - registerConnectorsRoute({ - router, - coreSetup, - }); return {}; } diff --git a/x-pack/plugins/inference/server/routes/chat_complete.ts b/x-pack/plugins/inference/server/routes/chat_complete.ts index 6c840f80466c2..6b5aea7b71696 100644 --- a/x-pack/plugins/inference/server/routes/chat_complete.ts +++ b/x-pack/plugins/inference/server/routes/chat_complete.ts @@ -7,7 +7,6 @@ import { schema, Type } from '@kbn/config-schema'; import type { CoreSetup, IRouter, RequestHandlerContext } from '@kbn/core/server'; -import { isObservable } from 'rxjs'; import { MessageRole } from '../../common/chat_complete'; import type { ChatCompleteRequestBody } from '../../common/chat_complete/request'; import { ToolCall, ToolChoiceType } from '../../common/chat_complete/tools'; @@ -20,7 +19,7 @@ const toolCallSchema: Type = schema.arrayOf( toolCallId: schema.string(), function: schema.object({ name: schema.string(), - arguments: schema.maybe(schema.object({}, { unknowns: 'allow' })), + arguments: schema.maybe(schema.recordOf(schema.string(), schema.any())), }), }) ); @@ -57,7 +56,7 @@ const chatCompleteBodySchema: Type = schema.object({ schema.oneOf([ schema.object({ role: schema.literal(MessageRole.Assistant), - content: schema.string(), + content: schema.oneOf([schema.string(), schema.literal(null)]), toolCalls: toolCallSchema, }), schema.object({ @@ -68,7 +67,7 @@ const chatCompleteBodySchema: Type = schema.object({ schema.object({ role: schema.literal(MessageRole.Tool), toolCallId: schema.string(), - response: schema.object({}, { unknowns: 'allow' }), + response: schema.recordOf(schema.string(), schema.any()), }), ]) ), @@ -97,7 +96,7 @@ export function registerChatCompleteRoute({ const { connectorId, messages, system, toolChoice, tools } = request.body; - const chatCompleteResponse = await client.chatComplete({ + const chatCompleteResponse = client.chatComplete({ connectorId, messages, system, @@ -105,13 +104,9 @@ export function registerChatCompleteRoute({ tools, }); - if (isObservable(chatCompleteResponse)) { - return response.ok({ - body: observableIntoEventSourceStream(chatCompleteResponse), - }); - } - - return response.ok({ body: chatCompleteResponse }); + return response.ok({ + body: observableIntoEventSourceStream(chatCompleteResponse), + }); } ); } diff --git a/x-pack/plugins/inference/server/routes/connectors.ts b/x-pack/plugins/inference/server/routes/connectors.ts index 8c69b68d55f14..a03a393f133b1 100644 --- a/x-pack/plugins/inference/server/routes/connectors.ts +++ b/x-pack/plugins/inference/server/routes/connectors.ts @@ -6,7 +6,11 @@ */ import type { CoreSetup, IRouter, RequestHandlerContext } from '@kbn/core/server'; -import { InferenceConnector, InferenceConnectorType } from '../../common/connectors'; +import { + InferenceConnector, + InferenceConnectorType, + isSupportedConnectorType, +} from '../../common/connectors'; import type { InferenceServerStart, InferenceStartDependencies } from '../types'; export function registerConnectorsRoute({ @@ -32,14 +36,8 @@ export function registerConnectorsRoute({ includeSystemActions: false, }); - const connectorTypes: string[] = [ - InferenceConnectorType.OpenAI, - InferenceConnectorType.Bedrock, - InferenceConnectorType.Gemini, - ]; - const connectors: InferenceConnector[] = allConnectors - .filter((connector) => connectorTypes.includes(connector.actionTypeId)) + .filter((connector) => isSupportedConnectorType(connector.actionTypeId)) .map((connector) => { return { connectorId: connector.id, diff --git a/x-pack/plugins/inference/server/routes/index.ts b/x-pack/plugins/inference/server/routes/index.ts new file mode 100644 index 0000000000000..0f6891ace1223 --- /dev/null +++ b/x-pack/plugins/inference/server/routes/index.ts @@ -0,0 +1,22 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import type { CoreSetup, IRouter } from '@kbn/core/server'; +import type { InferenceServerStart, InferenceStartDependencies } from '../types'; +import { registerChatCompleteRoute } from './chat_complete'; +import { registerConnectorsRoute } from './connectors'; + +export const registerRoutes = ({ + router, + coreSetup, +}: { + router: IRouter; + coreSetup: CoreSetup; +}) => { + registerChatCompleteRoute({ router, coreSetup }); + registerConnectorsRoute({ router, coreSetup }); +}; diff --git a/x-pack/plugins/inference/server/types.ts b/x-pack/plugins/inference/server/types.ts index 609b719b15236..20679ffd4cedf 100644 --- a/x-pack/plugins/inference/server/types.ts +++ b/x-pack/plugins/inference/server/types.ts @@ -16,8 +16,6 @@ import { OutputAPI } from '../common/output'; /* eslint-disable @typescript-eslint/no-empty-interface*/ -export interface ConfigSchema {} - export interface InferenceSetupDependencies { actions: ActionsPluginSetup; } diff --git a/x-pack/plugins/inference/server/util/event_source_stream_into_observable.test.ts b/x-pack/plugins/inference/server/util/event_source_stream_into_observable.test.ts new file mode 100644 index 0000000000000..235305a9316ce --- /dev/null +++ b/x-pack/plugins/inference/server/util/event_source_stream_into_observable.test.ts @@ -0,0 +1,54 @@ +/* + * 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 { Readable } from 'node:stream'; +import { toArray, firstValueFrom } from 'rxjs'; +import { eventSourceStreamIntoObservable } from './event_source_stream_into_observable'; + +describe('eventSourceStreamIntoObservable', () => { + it('emits for a single-chunk event', async () => { + const someMessage = JSON.stringify({ foo: 'bar' }); + const stream = Readable.from([`data: ${someMessage}\n\n`]); + + const results = await firstValueFrom(eventSourceStreamIntoObservable(stream).pipe(toArray())); + + expect(results).toEqual([someMessage]); + }); + + it('emits for single-chunk events', async () => { + const messages = [JSON.stringify({ foo: 'bar' }), '42', JSON.stringify({ foo: 'dolly' })]; + const stream = Readable.from(messages.map((message) => `data: ${message}\n\n`)); + + const results = await firstValueFrom(eventSourceStreamIntoObservable(stream).pipe(toArray())); + + expect(results).toEqual(messages); + }); + + it('emits for a multi-chunk event', async () => { + const stream = Readable.from([`data: abc`, `de`, `fgh\n\n`]); + + const results = await firstValueFrom(eventSourceStreamIntoObservable(stream).pipe(toArray())); + + expect(results).toEqual(['abcdefgh']); + }); + + it('emits for a multi-events chunk', async () => { + const stream = Readable.from([`data: A\n\ndata: B\n\ndata: C\n\n`]); + + const results = await firstValueFrom(eventSourceStreamIntoObservable(stream).pipe(toArray())); + + expect(results).toEqual(['A', 'B', 'C']); + }); + + it('emits for split chunk events', async () => { + const stream = Readable.from([`data: 42\n\ndata: `, `9000\n\nda`, `ta: 51\n\n`]); + + const results = await firstValueFrom(eventSourceStreamIntoObservable(stream).pipe(toArray())); + + expect(results).toEqual(['42', '9000', '51']); + }); +}); diff --git a/x-pack/plugins/inference/server/chat_complete/adapters/event_source_stream_into_observable.ts b/x-pack/plugins/inference/server/util/event_source_stream_into_observable.ts similarity index 95% rename from x-pack/plugins/inference/server/chat_complete/adapters/event_source_stream_into_observable.ts rename to x-pack/plugins/inference/server/util/event_source_stream_into_observable.ts index ece32d76222cc..cad0a8e84d6a7 100644 --- a/x-pack/plugins/inference/server/chat_complete/adapters/event_source_stream_into_observable.ts +++ b/x-pack/plugins/inference/server/util/event_source_stream_into_observable.ts @@ -5,8 +5,8 @@ * 2.0. */ +import type { Readable } from 'node:stream'; import { createParser } from 'eventsource-parser'; -import { Readable } from 'node:stream'; import { Observable } from 'rxjs'; export function eventSourceStreamIntoObservable(readable: Readable) { diff --git a/x-pack/plugins/inference/server/util/get_connector_by_id.test.ts b/x-pack/plugins/inference/server/util/get_connector_by_id.test.ts new file mode 100644 index 0000000000000..7387944950f4a --- /dev/null +++ b/x-pack/plugins/inference/server/util/get_connector_by_id.test.ts @@ -0,0 +1,92 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import type { ActionResult as ActionConnector } from '@kbn/actions-plugin/server'; +import { actionsClientMock } from '@kbn/actions-plugin/server/mocks'; +import { InferenceConnectorType } from '../../common/connectors'; +import { getConnectorById } from './get_connector_by_id'; + +describe('getConnectorById', () => { + let actionsClient: ReturnType; + const connectorId = 'my-connector-id'; + + const createMockConnector = (parts: Partial = {}): ActionConnector => { + return { + id: 'mock', + name: 'Mock', + actionTypeId: 'action-type', + ...parts, + } as ActionConnector; + }; + + beforeEach(() => { + actionsClient = actionsClientMock.create(); + actionsClient.get.mockResolvedValue(createMockConnector()); + }); + + it('calls `actionsClient.get` with the right parameters', async () => { + actionsClient.get.mockResolvedValue( + createMockConnector({ + id: 'foo', + name: 'Foo', + actionTypeId: InferenceConnectorType.OpenAI, + }) + ); + + await getConnectorById({ actionsClient, connectorId }); + + expect(actionsClient.get).toHaveBeenCalledTimes(1); + expect(actionsClient.get).toHaveBeenCalledWith({ + id: connectorId, + throwIfSystemAction: true, + }); + }); + + it('throws if `actionsClient.get` throws', async () => { + actionsClient.get.mockImplementation(() => { + throw new Error('Something wrong'); + }); + + await expect(() => + getConnectorById({ actionsClient, connectorId }) + ).rejects.toThrowErrorMatchingInlineSnapshot(`"No connector found for id 'my-connector-id'"`); + }); + + it('throws the connector type is not compatible', async () => { + actionsClient.get.mockResolvedValue( + createMockConnector({ + id: 'tcp-pigeon-3-0', + name: 'Tcp Pigeon', + actionTypeId: '.tcp-pigeon', + }) + ); + + await expect(() => + getConnectorById({ actionsClient, connectorId }) + ).rejects.toThrowErrorMatchingInlineSnapshot( + `"Type '.tcp-pigeon' not recognized as a supported connector type"` + ); + }); + + it('returns the inference connector when successful', async () => { + actionsClient.get.mockResolvedValue( + createMockConnector({ + id: 'my-id', + name: 'My Name', + actionTypeId: InferenceConnectorType.OpenAI, + }) + ); + + const connector = await getConnectorById({ actionsClient, connectorId }); + + expect(connector).toEqual({ + connectorId: 'my-id', + name: 'My Name', + type: InferenceConnectorType.OpenAI, + }); + }); +}); diff --git a/x-pack/plugins/inference/server/util/get_connector_by_id.ts b/x-pack/plugins/inference/server/util/get_connector_by_id.ts new file mode 100644 index 0000000000000..3fd77630ad3d1 --- /dev/null +++ b/x-pack/plugins/inference/server/util/get_connector_by_id.ts @@ -0,0 +1,46 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import type { ActionsClient, ActionResult as ActionConnector } from '@kbn/actions-plugin/server'; +import { isSupportedConnectorType, type InferenceConnector } from '../../common/connectors'; +import { createInferenceRequestError } from '../../common/errors'; + +/** + * Retrieves a connector given the provided `connectorId` and asserts it's an inference connector + */ +export const getConnectorById = async ({ + connectorId, + actionsClient, +}: { + actionsClient: ActionsClient; + connectorId: string; +}): Promise => { + let connector: ActionConnector; + try { + connector = await actionsClient.get({ + id: connectorId, + throwIfSystemAction: true, + }); + } catch (error) { + throw createInferenceRequestError(`No connector found for id '${connectorId}'`, 400); + } + + const actionTypeId = connector.actionTypeId; + + if (!isSupportedConnectorType(actionTypeId)) { + throw createInferenceRequestError( + `Type '${actionTypeId}' not recognized as a supported connector type`, + 400 + ); + } + + return { + connectorId: connector.id, + name: connector.name, + type: actionTypeId, + }; +}; From dd18bc7c4de31ed038ee475c7cc0208ddcc9ff72 Mon Sep 17 00:00:00 2001 From: Karen Grigoryan Date: Mon, 26 Aug 2024 14:28:20 +0200 Subject: [PATCH 5/6] [Security Solution][DQD][Tech Debt] Colocate components (#190978) addresses https://github.com/elastic/kibana/issues/190964 Second in the series of PRs to address general DQD tech debt. Currently this PR build on the work of https://github.com/elastic/kibana/pull/190970. So this PR restructures components to colocate component throughout the hierarchy. So instead of: ```bash root/ component1/ childOfComponent1/ grandChildOfComponent1/ component2/ use_hook_used_for_1/ use_hook_used_for_2/ ``` we use: ```bash root/ component1/ hooks/ use_hook_used_for_1/ childOfComponent1/ grandChildOfComponent1/ component2/ hooks/ use_hook_used_for_2/ ``` PROs of such scaffold: - complete and clear hierarchical visibility into component structure of the entire DQD codebase - ability to easily introduce and integrate a new change and calculate its impact on the tree of components - ability to easily remove colocated functionality without having to scout through the convoluted DQD code - clear understanding of where shared code should live as opposed to know when its shoved into top level by default with other non shared code - since nesting too deep has an import name readability tax it forces us to think about not splitting our components into too many small parts but rather keep it balanced, as opposed to now where flat structure incentivizes free and cheap fragmentation as seen with component like . CONS: - import names have too many `../../../../../../../../../`. It is fixable by ts paths/webpack aliases, but on the other hand especially if there are many of those it's an indication of potential architectural smell, that needs to be addressed (which is a PRO). Imho, overall visibility trumps any cons and facilitates greater ease of adding new and changing existing functionality with more confidence. ## Before ![image](https://github.com/user-attachments/assets/89062883-c40a-410d-af43-8dbe3e712475) ## After ![image](https://github.com/user-attachments/assets/83e33a85-cf3e-4cb1-a56d-c7f4f27a1f37) --- .../allowed_values/helpers.test.tsx | 152 --------------- .../data_quality_panel/body/index.test.tsx | 51 ----- .../data_quality_panel/body/index.tsx | 29 --- .../impl/data_quality/index.test.tsx | 44 ----- .../data_quality/use_mappings/index.test.tsx | 138 -------------- .../impl/data_quality/use_mappings/index.tsx | 66 ------- .../use_unallowed_values/index.test.tsx | 178 ------------------ .../use_unallowed_values/index.tsx | 91 --------- .../hooks}/use_add_to_new_case/index.tsx | 0 .../use_add_to_new_case/translations.ts | 0 .../actions/add_to_new_case/index.test.tsx | 2 +- .../actions/add_to_new_case/index.tsx | 4 +- .../actions/chat/index.test.tsx | 2 +- .../data_quality_panel/actions/chat/index.tsx | 2 +- .../actions/chat/translations.ts | 0 .../actions/copy_to_clipboard/index.test.tsx | 2 +- .../actions/copy_to_clipboard/index.tsx | 2 +- .../data_quality_panel/actions/index.test.tsx | 2 +- .../data_quality_panel/actions/index.tsx | 0 .../data_quality_panel/actions/styles.tsx | 0 .../constants.ts | 0 .../contexts/indices_check_context/index.tsx | 2 +- .../contexts/results_rollup_context/index.tsx | 2 +- .../data_quality_context/index.test.tsx | 0 .../data_quality_context/index.tsx | 2 +- .../ilm_phases_empty_prompt/index.test.tsx | 2 +- .../ilm_phases_empty_prompt/index.tsx | 2 +- .../ilm_phases_empty_prompt/translations.ts | 0 .../data_quality_details/index.test.tsx | 2 +- .../data_quality_details/index.tsx | 6 +- .../indices_details/index.test.tsx | 12 +- .../indices_details/index.tsx | 8 +- .../error_empty_prompt/index.test.tsx | 2 +- .../pattern}/error_empty_prompt/index.tsx | 2 +- .../indices_details}/pattern/helpers.test.ts | 12 +- .../indices_details}/pattern/helpers.ts | 4 +- .../hooks}/use_ilm_explain/index.test.tsx | 6 +- .../pattern/hooks}/use_ilm_explain/index.tsx | 8 +- .../pattern/hooks}/use_stats/index.test.tsx | 6 +- .../pattern/hooks}/use_stats/index.tsx | 10 +- .../indices_details}/pattern/index.test.tsx | 10 +- .../indices_details}/pattern/index.tsx | 24 +-- .../use_current_window_width/index.test.tsx | 0 .../hooks}/use_current_window_width/index.tsx | 0 .../pattern/index_check_flyout/index.test.tsx | 8 +- .../pattern/index_check_flyout/index.tsx | 14 +- .../empty_prompt_body.test.tsx | 2 +- .../index_properties/empty_prompt_body.tsx | 0 .../empty_prompt_title.test.tsx | 2 +- .../index_properties/empty_prompt_title.tsx | 0 .../index_properties/helpers.test.ts | 6 +- .../index_properties/helpers.ts | 6 +- .../index_properties/index.test.tsx | 8 +- .../index_properties/index.tsx | 12 +- .../index_check_fields/index.test.tsx | 4 +- .../index_check_fields/index.tsx | 8 +- .../tabs/all_tab/index.tsx | 12 +- .../callouts/custom_callout/index.test.tsx | 6 +- .../tabs/callouts/custom_callout/index.tsx | 4 +- .../incompatible_callout/index.test.tsx | 4 +- .../callouts/incompatible_callout/index.tsx | 2 +- .../missing_timestamp_callout/index.tsx | 2 +- .../same_family_callout/index.test.tsx | 6 +- .../callouts/same_family_callout/index.tsx | 4 +- .../ecs_allowed_values/index.test.tsx | 4 +- .../ecs_allowed_values/index.tsx | 4 +- .../get_common_table_columns/index.test.tsx | 8 +- .../get_common_table_columns/index.tsx | 12 +- .../index.test.tsx | 8 +- .../index.tsx | 6 +- .../compare_fields_table/helpers.test.tsx | 4 +- .../tabs}/compare_fields_table/helpers.tsx | 4 +- .../tabs}/compare_fields_table/index.test.tsx | 6 +- .../tabs}/compare_fields_table/index.tsx | 2 +- .../index_invalid_values/index.test.tsx | 4 +- .../index_invalid_values/index.tsx | 4 +- .../same_family/index.test.tsx | 2 +- .../same_family/index.tsx | 0 .../same_family/translations.ts | 0 .../compare_fields_table/translations.ts | 0 .../tabs/custom_tab/helpers.test.ts | 8 +- .../tabs/custom_tab/helpers.ts | 12 +- .../tabs/custom_tab/index.tsx | 14 +- .../tabs/ecs_compliant_tab/index.tsx | 12 +- .../index_check_fields}/tabs/helpers.test.tsx | 6 +- .../index_check_fields}/tabs/helpers.tsx | 10 +- .../tabs/incompatible_tab/helpers.test.ts | 8 +- .../tabs/incompatible_tab/helpers.ts | 14 +- .../tabs/incompatible_tab/index.tsx | 16 +- .../tabs/incompatible_tab/translations.ts | 0 .../tabs/same_family_tab/helpers.test.ts | 6 +- .../tabs/same_family_tab/helpers.ts | 12 +- .../tabs/same_family_tab/index.tsx | 8 +- .../tabs/same_family_tab/translations.ts | 0 .../tabs/sticky_actions/index.tsx | 2 +- .../index_check_fields}/tabs/styles.tsx | 0 .../index_stats_panel/index.test.tsx | 2 +- .../index_stats_panel/index.tsx | 9 +- .../index_properties/markdown/helpers.test.ts | 26 +-- .../index_properties/markdown/helpers.ts | 22 ++- .../index_properties/translations.ts | 0 .../index_check_flyout/translations.ts | 0 .../index_result_badge/helpers.test.ts | 0 .../pattern}/index_result_badge/helpers.ts | 0 .../index_result_badge/index.test.tsx | 0 .../pattern}/index_result_badge/index.tsx | 0 .../index_result_badge/translations.ts | 0 .../pattern}/loading_empty_prompt/index.tsx | 0 .../pattern/pattern_summary/index.tsx | 4 +- .../pattern_label/helpers.test.ts | 0 .../pattern_summary/pattern_label/helpers.ts | 0 .../ilm_phase_counts/index.test.tsx | 4 +- .../pattern_label}/ilm_phase_counts/index.tsx | 4 +- .../pattern_summary/pattern_label/index.tsx | 6 +- .../pattern_label/translations.ts | 0 .../pattern/pattern_summary/translations.ts | 0 .../remote_clusters_callout/index.test.tsx | 0 .../remote_clusters_callout/index.tsx | 0 .../remote_clusters_callout/translations.ts | 0 .../indices_details}/pattern/styles.tsx | 0 .../pattern}/summary_table/helpers.test.tsx | 8 +- .../pattern}/summary_table/helpers.tsx | 12 +- .../pattern}/summary_table/index.test.tsx | 14 +- .../pattern}/summary_table/index.tsx | 10 +- .../pattern}/summary_table/translations.ts | 0 .../indices_details}/pattern/translations.ts | 0 .../indices_details}/pattern/types.ts | 2 +- .../storage_details/helpers.test.ts | 10 +- .../storage_details/helpers.ts | 6 +- .../storage_details/index.test.tsx | 12 +- .../storage_details/index.tsx | 10 +- .../chart_legend_item/index.tsx | 0 .../storage_treemap/index.test.tsx | 20 +- .../storage_treemap/index.tsx | 11 +- .../storage_treemap/no_data/index.test.tsx | 2 +- .../storage_treemap/no_data/index.tsx | 0 .../storage_treemap/translations.ts | 0 .../storage_details/translations.ts | 0 .../ilm_phase_filter/index.test.tsx | 4 +- .../ilm_phase_filter/index.tsx | 6 +- .../ilm_phase_filter/styles.tsx | 0 .../data_quality_summary/index.test.tsx | 14 +- .../data_quality_summary/index.tsx | 4 +- .../summary_actions/check_all/helpers.test.ts | 2 +- .../summary_actions/check_all/helpers.ts | 4 +- .../summary_actions/check_all/index.test.tsx | 29 +-- .../summary_actions/check_all/index.tsx | 10 +- .../summary_actions/check_all/translations.ts | 0 .../errors_viewer/helpers.test.tsx | 4 +- .../errors_popover}/errors_viewer/helpers.tsx | 2 +- .../errors_viewer/index.test.tsx | 4 +- .../errors_popover}/errors_viewer/index.tsx | 2 +- .../errors_viewer/translations.ts | 0 .../errors_popover/index.test.tsx | 2 +- .../check_status}/errors_popover/index.tsx | 10 +- .../errors_popover/translations.ts | 0 .../check_status/index.test.tsx | 0 .../summary_actions}/check_status/index.tsx | 4 +- .../summary_actions/index.test.tsx | 14 +- .../summary_actions/index.tsx | 19 +- .../helpers.test.ts | 0 .../helpers.ts | 2 +- .../hooks}/use_indices_check/index.test.tsx | 12 +- .../hooks}/use_indices_check/index.tsx | 8 +- .../hooks}/use_indices_check/reducer.ts | 6 +- .../hooks}/use_indices_check/types.ts | 8 +- .../hooks}/use_is_mounted/index.test.tsx | 0 .../hooks}/use_is_mounted/index.tsx | 0 .../hooks}/use_results_rollup/helpers.test.ts | 12 +- .../hooks}/use_results_rollup/helpers.ts | 10 +- .../hooks}/use_results_rollup/index.tsx | 11 +- .../hooks}/use_results_rollup/types.ts | 2 +- .../impl/data_quality_panel/index.test.tsx | 84 +++++++++ .../index.tsx | 22 ++- .../allowed_values/mock_allowed_values.ts | 0 .../data_quality_check_result/mock_index.tsx | 0 .../mock_enriched_field_metadata.ts | 0 .../mock/ilm_explain/mock_ilm_explain.ts | 0 ...ndices_get_mapping_index_mapping_record.ts | 0 .../mock_mappings_properties.ts | 0 .../mock_mappings_response.ts | 0 .../mock_partitioned_field_metadata.tsx | 0 ...itioned_field_metadata_with_same_family.ts | 0 .../mock_alerts_pattern_rollup.ts | 0 .../mock_auditbeat_pattern_rollup.ts | 0 .../mock_packetbeat_pattern_rollup.ts | 0 .../mock/stats/mock_stats.tsx | 0 .../mock/stats/mock_stats_auditbeat_index.tsx | 0 .../mock/stats/mock_stats_packetbeat_index.ts | 0 .../mock/test_providers/test_providers.tsx | 9 +- .../get_merged_data_quality_context_props.ts | 2 +- .../get_merged_indices_check_context_props.ts | 2 +- ...get_merged_results_rollup_context_props.ts | 24 +-- .../unallowed_values/mock_unallowed_values.ts | 0 .../mock_use_results_rollup.ts | 30 +++ .../stat/index.test.tsx | 2 +- .../stat/index.tsx | 0 .../stat_label/translations.ts | 0 .../stats_rollup/index.test.tsx | 2 +- .../stats_rollup/index.tsx | 8 +- .../stub/get_check_state/index.ts | 8 +- .../styles.tsx | 0 .../translations.ts | 0 .../types.ts | 0 .../utils/check_index.test.ts | 36 ++-- .../utils/check_index.ts | 10 +- .../utils/fetch_mappings.test.ts} | 2 +- .../utils/fetch_mappings.ts} | 0 .../utils/fetch_unallowed_values.test.ts} | 2 +- .../utils/fetch_unallowed_values.ts} | 0 .../get_unallowed_value_request_items.tsx} | 4 +- ...et_unallowed_values_request_items.test.tsx | 154 +++++++++++++++ .../ecs_data_quality_dashboard/index.ts | 8 +- 213 files changed, 774 insertions(+), 1227 deletions(-) delete mode 100644 x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/allowed_values/helpers.test.tsx delete mode 100644 x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/body/index.test.tsx delete mode 100644 x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/body/index.tsx delete mode 100644 x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/index.test.tsx delete mode 100644 x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/use_mappings/index.test.tsx delete mode 100644 x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/use_mappings/index.tsx delete mode 100644 x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/use_unallowed_values/index.test.tsx delete mode 100644 x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/use_unallowed_values/index.tsx rename x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/{data_quality => data_quality_panel/actions/add_to_new_case/hooks}/use_add_to_new_case/index.tsx (100%) rename x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/{data_quality => data_quality_panel/actions/add_to_new_case/hooks}/use_add_to_new_case/translations.ts (100%) rename x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/{data_quality => }/data_quality_panel/actions/add_to_new_case/index.test.tsx (98%) rename x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/{data_quality => }/data_quality_panel/actions/add_to_new_case/index.tsx (92%) rename x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/{data_quality => }/data_quality_panel/actions/chat/index.test.tsx (93%) rename x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/{data_quality => }/data_quality_panel/actions/chat/index.tsx (98%) rename x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/{data_quality => }/data_quality_panel/actions/chat/translations.ts (100%) rename x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/{data_quality => }/data_quality_panel/actions/copy_to_clipboard/index.test.tsx (97%) rename x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/{data_quality => }/data_quality_panel/actions/copy_to_clipboard/index.tsx (98%) rename x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/{data_quality => }/data_quality_panel/actions/index.test.tsx (97%) rename x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/{data_quality => }/data_quality_panel/actions/index.tsx (100%) rename x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/{data_quality => }/data_quality_panel/actions/styles.tsx (100%) rename x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/{data_quality => data_quality_panel}/constants.ts (100%) rename x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/{data_quality => data_quality_panel}/contexts/indices_check_context/index.tsx (88%) rename x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/{data_quality => data_quality_panel}/contexts/results_rollup_context/index.tsx (88%) rename x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/{data_quality => }/data_quality_panel/data_quality_context/index.test.tsx (100%) rename x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/{data_quality => }/data_quality_panel/data_quality_context/index.tsx (98%) rename x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/{data_quality => data_quality_panel/data_quality_details}/ilm_phases_empty_prompt/index.test.tsx (94%) rename x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/{data_quality => data_quality_panel/data_quality_details}/ilm_phases_empty_prompt/index.tsx (98%) rename x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/{data_quality => data_quality_panel/data_quality_details}/ilm_phases_empty_prompt/translations.ts (100%) rename x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/{data_quality/data_quality_panel/body => data_quality_panel}/data_quality_details/index.test.tsx (97%) rename x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/{data_quality/data_quality_panel/body => data_quality_panel}/data_quality_details/index.tsx (86%) rename x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/{data_quality/data_quality_panel/body => data_quality_panel}/data_quality_details/indices_details/index.test.tsx (83%) rename x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/{data_quality/data_quality_panel/body => data_quality_panel}/data_quality_details/indices_details/index.tsx (85%) rename x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/{data_quality/data_quality_panel => data_quality_panel/data_quality_details/indices_details/pattern}/error_empty_prompt/index.test.tsx (89%) rename x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/{data_quality/data_quality_panel => data_quality_panel/data_quality_details/indices_details/pattern}/error_empty_prompt/index.tsx (89%) rename x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/{data_quality/data_quality_panel => data_quality_panel/data_quality_details/indices_details}/pattern/helpers.test.ts (98%) rename x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/{data_quality/data_quality_panel => data_quality_panel/data_quality_details/indices_details}/pattern/helpers.ts (98%) rename x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/{data_quality => data_quality_panel/data_quality_details/indices_details/pattern/hooks}/use_ilm_explain/index.test.tsx (96%) rename x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/{data_quality => data_quality_panel/data_quality_details/indices_details/pattern/hooks}/use_ilm_explain/index.tsx (89%) rename x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/{data_quality => data_quality_panel/data_quality_details/indices_details/pattern/hooks}/use_stats/index.test.tsx (96%) rename x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/{data_quality => data_quality_panel/data_quality_details/indices_details/pattern/hooks}/use_stats/index.tsx (88%) rename x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/{data_quality/data_quality_panel => data_quality_panel/data_quality_details/indices_details}/pattern/index.test.tsx (91%) rename x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/{data_quality/data_quality_panel => data_quality_panel/data_quality_details/indices_details}/pattern/index.tsx (93%) rename x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/{data_quality => data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/hooks}/use_current_window_width/index.test.tsx (100%) rename x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/{data_quality => data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/hooks}/use_current_window_width/index.tsx (100%) rename x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/{data_quality/data_quality_panel => data_quality_panel/data_quality_details/indices_details}/pattern/index_check_flyout/index.test.tsx (92%) rename x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/{data_quality/data_quality_panel => data_quality_panel/data_quality_details/indices_details}/pattern/index_check_flyout/index.tsx (91%) rename x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/{data_quality/data_quality_panel => data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout}/index_properties/empty_prompt_body.test.tsx (88%) rename x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/{data_quality/data_quality_panel => data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout}/index_properties/empty_prompt_body.tsx (100%) rename x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/{data_quality/data_quality_panel => data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout}/index_properties/empty_prompt_title.test.tsx (89%) rename x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/{data_quality/data_quality_panel => data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout}/index_properties/empty_prompt_title.tsx (100%) rename x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/{data_quality/data_quality_panel => data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout}/index_properties/helpers.test.ts (96%) rename x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/{data_quality/data_quality_panel => data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout}/index_properties/helpers.ts (96%) rename x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/{data_quality/data_quality_panel => data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout}/index_properties/index.test.tsx (95%) rename x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/{data_quality/data_quality_panel => data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout}/index_properties/index.tsx (86%) rename x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/{data_quality/data_quality_panel => data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout}/index_properties/index_check_fields/index.test.tsx (90%) rename x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/{data_quality/data_quality_panel => data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout}/index_properties/index_check_fields/index.tsx (91%) rename x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/{data_quality/data_quality_panel => data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/index_check_fields}/tabs/all_tab/index.tsx (77%) rename x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/{data_quality/data_quality_panel => data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/index_check_fields}/tabs/callouts/custom_callout/index.test.tsx (80%) rename x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/{data_quality/data_quality_panel => data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/index_check_fields}/tabs/callouts/custom_callout/index.tsx (88%) rename x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/{data_quality/data_quality_panel => data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/index_check_fields}/tabs/callouts/incompatible_callout/index.test.tsx (92%) rename x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/{data_quality/data_quality_panel => data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/index_check_fields}/tabs/callouts/incompatible_callout/index.tsx (95%) rename x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/{data_quality/data_quality_panel => data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/index_check_fields}/tabs/callouts/missing_timestamp_callout/index.tsx (94%) rename x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/{data_quality/data_quality_panel => data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/index_check_fields}/tabs/callouts/same_family_callout/index.test.tsx (82%) rename x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/{data_quality/data_quality_panel => data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/index_check_fields}/tabs/callouts/same_family_callout/index.tsx (89%) rename x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/{data_quality => data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/index_check_fields/tabs}/compare_fields_table/ecs_allowed_values/index.test.tsx (88%) rename x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/{data_quality => data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/index_check_fields/tabs}/compare_fields_table/ecs_allowed_values/index.tsx (89%) rename x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/{data_quality => data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/index_check_fields/tabs}/compare_fields_table/get_common_table_columns/index.test.tsx (96%) rename x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/{data_quality => data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/index_check_fields/tabs}/compare_fields_table/get_common_table_columns/index.tsx (90%) rename x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/{data_quality => data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/index_check_fields/tabs}/compare_fields_table/get_incompatible_mappings_table_columns/index.test.tsx (92%) rename x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/{data_quality => data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/index_check_fields/tabs}/compare_fields_table/get_incompatible_mappings_table_columns/index.tsx (88%) rename x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/{data_quality => data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/index_check_fields/tabs}/compare_fields_table/helpers.test.tsx (98%) rename x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/{data_quality => data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/index_check_fields/tabs}/compare_fields_table/helpers.tsx (96%) rename x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/{data_quality => data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/index_check_fields/tabs}/compare_fields_table/index.test.tsx (79%) rename x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/{data_quality => data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/index_check_fields/tabs}/compare_fields_table/index.tsx (95%) rename x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/{data_quality => data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/index_check_fields/tabs}/compare_fields_table/index_invalid_values/index.test.tsx (88%) rename x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/{data_quality => data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/index_check_fields/tabs}/compare_fields_table/index_invalid_values/index.tsx (91%) rename x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/{data_quality/data_quality_panel => data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/index_check_fields/tabs/compare_fields_table}/same_family/index.test.tsx (87%) rename x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/{data_quality/data_quality_panel => data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/index_check_fields/tabs/compare_fields_table}/same_family/index.tsx (100%) rename x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/{data_quality/data_quality_panel => data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/index_check_fields/tabs/compare_fields_table}/same_family/translations.ts (100%) rename x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/{data_quality => data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/index_check_fields/tabs}/compare_fields_table/translations.ts (100%) rename x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/{data_quality/data_quality_panel => data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/index_check_fields}/tabs/custom_tab/helpers.test.ts (94%) rename x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/{data_quality/data_quality_panel => data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/index_check_fields}/tabs/custom_tab/helpers.ts (88%) rename x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/{data_quality/data_quality_panel => data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/index_check_fields}/tabs/custom_tab/index.tsx (85%) rename x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/{data_quality/data_quality_panel => data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/index_check_fields}/tabs/ecs_compliant_tab/index.tsx (85%) rename x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/{data_quality/data_quality_panel => data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/index_check_fields}/tabs/helpers.test.tsx (90%) rename x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/{data_quality/data_quality_panel => data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/index_check_fields}/tabs/helpers.tsx (95%) rename x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/{data_quality/data_quality_panel => data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/index_check_fields}/tabs/incompatible_tab/helpers.test.ts (98%) rename x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/{data_quality/data_quality_panel => data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/index_check_fields}/tabs/incompatible_tab/helpers.ts (94%) rename x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/{data_quality/data_quality_panel => data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/index_check_fields}/tabs/incompatible_tab/index.tsx (87%) rename x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/{data_quality/data_quality_panel => data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/index_check_fields}/tabs/incompatible_tab/translations.ts (100%) rename x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/{data_quality/data_quality_panel => data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/index_check_fields}/tabs/same_family_tab/helpers.test.ts (95%) rename x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/{data_quality/data_quality_panel => data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/index_check_fields}/tabs/same_family_tab/helpers.ts (92%) rename x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/{data_quality/data_quality_panel => data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/index_check_fields}/tabs/same_family_tab/index.tsx (90%) rename x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/{data_quality/data_quality_panel => data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/index_check_fields}/tabs/same_family_tab/translations.ts (100%) rename x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/{data_quality/data_quality_panel => data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/index_check_fields}/tabs/sticky_actions/index.tsx (96%) rename x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/{data_quality/data_quality_panel => data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/index_check_fields}/tabs/styles.tsx (100%) rename x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/{data_quality/data_quality_panel => data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout}/index_properties/index_stats_panel/index.test.tsx (89%) rename x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/{data_quality/data_quality_panel => data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout}/index_properties/index_stats_panel/index.tsx (88%) rename x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/{data_quality/data_quality_panel => data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout}/index_properties/markdown/helpers.test.ts (96%) rename x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/{data_quality/data_quality_panel => data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout}/index_properties/markdown/helpers.ts (95%) rename x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/{data_quality/data_quality_panel => data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout}/index_properties/translations.ts (100%) rename x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/{data_quality/data_quality_panel => data_quality_panel/data_quality_details/indices_details}/pattern/index_check_flyout/translations.ts (100%) rename x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/{data_quality/data_quality_panel => data_quality_panel/data_quality_details/indices_details/pattern}/index_result_badge/helpers.test.ts (100%) rename x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/{data_quality/data_quality_panel => data_quality_panel/data_quality_details/indices_details/pattern}/index_result_badge/helpers.ts (100%) rename x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/{data_quality/data_quality_panel => data_quality_panel/data_quality_details/indices_details/pattern}/index_result_badge/index.test.tsx (100%) rename x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/{data_quality/data_quality_panel => data_quality_panel/data_quality_details/indices_details/pattern}/index_result_badge/index.tsx (100%) rename x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/{data_quality/data_quality_panel => data_quality_panel/data_quality_details/indices_details/pattern}/index_result_badge/translations.ts (100%) rename x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/{data_quality/data_quality_panel => data_quality_panel/data_quality_details/indices_details/pattern}/loading_empty_prompt/index.tsx (100%) rename x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/{data_quality/data_quality_panel => data_quality_panel/data_quality_details/indices_details}/pattern/pattern_summary/index.tsx (92%) rename x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/{data_quality/data_quality_panel => data_quality_panel/data_quality_details/indices_details}/pattern/pattern_summary/pattern_label/helpers.test.ts (100%) rename x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/{data_quality/data_quality_panel => data_quality_panel/data_quality_details/indices_details}/pattern/pattern_summary/pattern_label/helpers.ts (100%) rename x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/{data_quality/data_quality_panel => data_quality_panel/data_quality_details/indices_details/pattern/pattern_summary/pattern_label}/ilm_phase_counts/index.test.tsx (93%) rename x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/{data_quality/data_quality_panel => data_quality_panel/data_quality_details/indices_details/pattern/pattern_summary/pattern_label}/ilm_phase_counts/index.tsx (90%) rename x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/{data_quality/data_quality_panel => data_quality_panel/data_quality_details/indices_details}/pattern/pattern_summary/pattern_label/index.tsx (92%) rename x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/{data_quality/data_quality_panel => data_quality_panel/data_quality_details/indices_details}/pattern/pattern_summary/pattern_label/translations.ts (100%) rename x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/{data_quality/data_quality_panel => data_quality_panel/data_quality_details/indices_details}/pattern/pattern_summary/translations.ts (100%) rename x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/{data_quality/data_quality_panel => data_quality_panel/data_quality_details/indices_details/pattern}/remote_clusters_callout/index.test.tsx (100%) rename x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/{data_quality/data_quality_panel => data_quality_panel/data_quality_details/indices_details/pattern}/remote_clusters_callout/index.tsx (100%) rename x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/{data_quality/data_quality_panel => data_quality_panel/data_quality_details/indices_details/pattern}/remote_clusters_callout/translations.ts (100%) rename x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/{data_quality/data_quality_panel => data_quality_panel/data_quality_details/indices_details}/pattern/styles.tsx (100%) rename x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/{data_quality/data_quality_panel => data_quality_panel/data_quality_details/indices_details/pattern}/summary_table/helpers.test.tsx (98%) rename x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/{data_quality/data_quality_panel => data_quality_panel/data_quality_details/indices_details/pattern}/summary_table/helpers.tsx (94%) rename x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/{data_quality/data_quality_panel => data_quality_panel/data_quality_details/indices_details/pattern}/summary_table/index.test.tsx (86%) rename x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/{data_quality/data_quality_panel => data_quality_panel/data_quality_details/indices_details/pattern}/summary_table/index.tsx (91%) rename x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/{data_quality/data_quality_panel => data_quality_panel/data_quality_details/indices_details/pattern}/summary_table/translations.ts (100%) rename x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/{data_quality/data_quality_panel => data_quality_panel/data_quality_details/indices_details}/pattern/translations.ts (100%) rename x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/{data_quality/data_quality_panel => data_quality_panel/data_quality_details/indices_details}/pattern/types.ts (92%) rename x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/{data_quality/data_quality_panel/body => data_quality_panel}/data_quality_details/storage_details/helpers.test.ts (97%) rename x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/{data_quality/data_quality_panel/body => data_quality_panel}/data_quality_details/storage_details/helpers.ts (97%) rename x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/{data_quality/data_quality_panel/body => data_quality_panel}/data_quality_details/storage_details/index.test.tsx (79%) rename x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/{data_quality/data_quality_panel/body => data_quality_panel}/data_quality_details/storage_details/index.tsx (81%) rename x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/{data_quality/data_quality_panel => data_quality_panel/data_quality_details/storage_details}/storage_treemap/chart_legend_item/index.tsx (100%) rename x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/{data_quality/data_quality_panel => data_quality_panel/data_quality_details/storage_details}/storage_treemap/index.test.tsx (88%) rename x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/{data_quality/data_quality_panel => data_quality_panel/data_quality_details/storage_details}/storage_treemap/index.tsx (94%) rename x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/{data_quality/data_quality_panel => data_quality_panel/data_quality_details/storage_details}/storage_treemap/no_data/index.test.tsx (88%) rename x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/{data_quality/data_quality_panel => data_quality_panel/data_quality_details/storage_details}/storage_treemap/no_data/index.tsx (100%) rename x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/{data_quality/data_quality_panel => data_quality_panel/data_quality_details/storage_details}/storage_treemap/translations.ts (100%) rename x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/{data_quality/data_quality_panel/body => data_quality_panel}/data_quality_details/storage_details/translations.ts (100%) rename x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/{data_quality => }/data_quality_panel/data_quality_summary/ilm_phase_filter/index.test.tsx (98%) rename x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/{data_quality => }/data_quality_panel/data_quality_summary/ilm_phase_filter/index.tsx (93%) rename x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/{data_quality => }/data_quality_panel/data_quality_summary/ilm_phase_filter/styles.tsx (100%) rename x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/{data_quality => }/data_quality_panel/data_quality_summary/index.test.tsx (86%) rename x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/{data_quality => }/data_quality_panel/data_quality_summary/index.tsx (94%) rename x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/{data_quality => }/data_quality_panel/data_quality_summary/summary_actions/check_all/helpers.test.ts (96%) rename x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/{data_quality => }/data_quality_panel/data_quality_summary/summary_actions/check_all/helpers.ts (95%) rename x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/{data_quality => }/data_quality_panel/data_quality_summary/summary_actions/check_all/index.test.tsx (94%) rename x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/{data_quality => }/data_quality_panel/data_quality_summary/summary_actions/check_all/index.tsx (94%) rename x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/{data_quality => }/data_quality_panel/data_quality_summary/summary_actions/check_all/translations.ts (100%) rename x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/{data_quality/data_quality_panel/data_quality_summary => data_quality_panel/data_quality_summary/summary_actions/check_status/errors_popover}/errors_viewer/helpers.test.tsx (96%) rename x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/{data_quality/data_quality_panel/data_quality_summary => data_quality_panel/data_quality_summary/summary_actions/check_status/errors_popover}/errors_viewer/helpers.tsx (95%) rename x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/{data_quality/data_quality_panel/data_quality_summary => data_quality_panel/data_quality_summary/summary_actions/check_status/errors_popover}/errors_viewer/index.test.tsx (92%) rename x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/{data_quality/data_quality_panel/data_quality_summary => data_quality_panel/data_quality_summary/summary_actions/check_status/errors_popover}/errors_viewer/index.tsx (95%) rename x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/{data_quality/data_quality_panel/data_quality_summary => data_quality_panel/data_quality_summary/summary_actions/check_status/errors_popover}/errors_viewer/translations.ts (100%) rename x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/{data_quality/data_quality_panel/data_quality_summary => data_quality_panel/data_quality_summary/summary_actions/check_status}/errors_popover/index.test.tsx (97%) rename x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/{data_quality/data_quality_panel/data_quality_summary => data_quality_panel/data_quality_summary/summary_actions/check_status}/errors_popover/index.tsx (89%) rename x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/{data_quality/data_quality_panel/data_quality_summary => data_quality_panel/data_quality_summary/summary_actions/check_status}/errors_popover/translations.ts (100%) rename x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/{data_quality/data_quality_panel/data_quality_summary => data_quality_panel/data_quality_summary/summary_actions}/check_status/index.test.tsx (100%) rename x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/{data_quality/data_quality_panel/data_quality_summary => data_quality_panel/data_quality_summary/summary_actions}/check_status/index.tsx (96%) rename x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/{data_quality => }/data_quality_panel/data_quality_summary/summary_actions/index.test.tsx (88%) rename x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/{data_quality => }/data_quality_panel/data_quality_summary/summary_actions/index.tsx (91%) rename x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/{data_quality => data_quality_panel}/helpers.test.ts (100%) rename x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/{data_quality => data_quality_panel}/helpers.ts (99%) rename x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/{data_quality => data_quality_panel/hooks}/use_indices_check/index.test.tsx (96%) rename x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/{data_quality => data_quality_panel/hooks}/use_indices_check/index.tsx (92%) rename x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/{data_quality => data_quality_panel/hooks}/use_indices_check/reducer.ts (97%) rename x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/{data_quality => data_quality_panel/hooks}/use_indices_check/types.ts (86%) rename x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/{data_quality => data_quality_panel/hooks}/use_is_mounted/index.test.tsx (100%) rename x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/{data_quality => data_quality_panel/hooks}/use_is_mounted/index.tsx (100%) rename x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/{data_quality => data_quality_panel/hooks}/use_results_rollup/helpers.test.ts (98%) rename x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/{data_quality => data_quality_panel/hooks}/use_results_rollup/helpers.ts (92%) rename x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/{data_quality => data_quality_panel/hooks}/use_results_rollup/index.tsx (96%) rename x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/{data_quality => data_quality_panel/hooks}/use_results_rollup/types.ts (93%) create mode 100644 x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/index.test.tsx rename x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/{data_quality => data_quality_panel}/index.tsx (86%) rename x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/{data_quality => data_quality_panel}/mock/allowed_values/mock_allowed_values.ts (100%) rename x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/{data_quality => data_quality_panel}/mock/data_quality_check_result/mock_index.tsx (100%) rename x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/{data_quality => data_quality_panel}/mock/enriched_field_metadata/mock_enriched_field_metadata.ts (100%) rename x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/{data_quality => data_quality_panel}/mock/ilm_explain/mock_ilm_explain.ts (100%) rename x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/{data_quality => data_quality_panel}/mock/indices_get_mapping_index_mapping_record/mock_indices_get_mapping_index_mapping_record.ts (100%) rename x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/{data_quality => data_quality_panel}/mock/mappings_properties/mock_mappings_properties.ts (100%) rename x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/{data_quality => data_quality_panel}/mock/mappings_response/mock_mappings_response.ts (100%) rename x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/{data_quality => data_quality_panel}/mock/partitioned_field_metadata/mock_partitioned_field_metadata.tsx (100%) rename x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/{data_quality => data_quality_panel}/mock/partitioned_field_metadata/mock_partitioned_field_metadata_with_same_family.ts (100%) rename x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/{data_quality => data_quality_panel}/mock/pattern_rollup/mock_alerts_pattern_rollup.ts (100%) rename x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/{data_quality => data_quality_panel}/mock/pattern_rollup/mock_auditbeat_pattern_rollup.ts (100%) rename x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/{data_quality => data_quality_panel}/mock/pattern_rollup/mock_packetbeat_pattern_rollup.ts (100%) rename x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/{data_quality => data_quality_panel}/mock/stats/mock_stats.tsx (100%) rename x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/{data_quality => data_quality_panel}/mock/stats/mock_stats_auditbeat_index.tsx (100%) rename x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/{data_quality => data_quality_panel}/mock/stats/mock_stats_packetbeat_index.ts (100%) rename x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/{data_quality => data_quality_panel}/mock/test_providers/test_providers.tsx (95%) rename x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/{data_quality => data_quality_panel}/mock/test_providers/utils/get_merged_data_quality_context_props.ts (98%) rename x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/{data_quality => data_quality_panel}/mock/test_providers/utils/get_merged_indices_check_context_props.ts (95%) rename x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/{data_quality => data_quality_panel}/mock/test_providers/utils/get_merged_results_rollup_context_props.ts (57%) rename x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/{data_quality => data_quality_panel}/mock/unallowed_values/mock_unallowed_values.ts (100%) create mode 100644 x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/mock/use_results_rollup/mock_use_results_rollup.ts rename x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/{data_quality/data_quality_panel/pattern/pattern_summary/stats_rollup => data_quality_panel}/stat/index.test.tsx (96%) rename x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/{data_quality/data_quality_panel/pattern/pattern_summary/stats_rollup => data_quality_panel}/stat/index.tsx (100%) rename x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/{data_quality => }/data_quality_panel/stat_label/translations.ts (100%) rename x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/{data_quality/data_quality_panel/pattern/pattern_summary => data_quality_panel}/stats_rollup/index.test.tsx (98%) rename x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/{data_quality/data_quality_panel/pattern/pattern_summary => data_quality_panel}/stats_rollup/index.tsx (93%) rename x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/{data_quality => data_quality_panel}/stub/get_check_state/index.ts (84%) rename x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/{data_quality => data_quality_panel}/styles.tsx (100%) rename x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/{data_quality => data_quality_panel}/translations.ts (100%) rename x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/{data_quality => data_quality_panel}/types.ts (100%) rename x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/{data_quality => data_quality_panel}/utils/check_index.test.ts (95%) rename x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/{data_quality => data_quality_panel}/utils/check_index.ts (91%) rename x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/{data_quality/use_mappings/helpers.test.ts => data_quality_panel/utils/fetch_mappings.test.ts} (97%) rename x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/{data_quality/use_mappings/helpers.ts => data_quality_panel/utils/fetch_mappings.ts} (100%) rename x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/{data_quality/use_unallowed_values/helpers.test.ts => data_quality_panel/utils/fetch_unallowed_values.test.ts} (99%) rename x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/{data_quality/use_unallowed_values/helpers.ts => data_quality_panel/utils/fetch_unallowed_values.ts} (100%) rename x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/{data_quality/data_quality_panel/allowed_values/helpers.tsx => data_quality_panel/utils/get_unallowed_value_request_items.tsx} (94%) create mode 100644 x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/utils/get_unallowed_values_request_items.test.tsx diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/allowed_values/helpers.test.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/allowed_values/helpers.test.tsx deleted file mode 100644 index 7fd0a3f3b133d..0000000000000 --- a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/allowed_values/helpers.test.tsx +++ /dev/null @@ -1,152 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import { EcsFlatTyped } from '../../constants'; -import { getUnallowedValueRequestItems, getValidValues, hasAllowedValues } from './helpers'; - -describe('helpers', () => { - describe('hasAllowedValues', () => { - test('it returns true for a field that has `allowed_values`', () => { - expect( - hasAllowedValues({ - ecsMetadata: EcsFlatTyped, - fieldName: 'event.category', - }) - ).toBe(true); - }); - - test('it returns false for a field that does NOT have `allowed_values`', () => { - expect( - hasAllowedValues({ - ecsMetadata: EcsFlatTyped, - fieldName: 'host.name', - }) - ).toBe(false); - }); - - test('it returns false for a field that does NOT exist in `ecsMetadata`', () => { - expect( - hasAllowedValues({ - ecsMetadata: EcsFlatTyped, - fieldName: 'does.NOT.exist', - }) - ).toBe(false); - }); - }); - - describe('getValidValues', () => { - test('it returns the expected valid values', () => { - expect(getValidValues(EcsFlatTyped['event.category'])).toEqual( - expect.arrayContaining([ - 'authentication', - 'configuration', - 'database', - 'driver', - 'email', - 'file', - 'host', - 'iam', - 'intrusion_detection', - 'malware', - 'network', - 'package', - 'process', - 'registry', - 'session', - 'threat', - 'vulnerability', - 'web', - ]) - ); - }); - - test('it returns an empty array when the `field` does NOT have `allowed_values`', () => { - expect(getValidValues(EcsFlatTyped['host.name'])).toEqual([]); - }); - - test('it returns an empty array when `field` is undefined', () => { - expect(getValidValues(undefined)).toEqual([]); - }); - }); - - describe('getUnallowedValueRequestItems', () => { - test('it returns the expected request items', () => { - expect( - getUnallowedValueRequestItems({ - ecsMetadata: EcsFlatTyped, - indexName: 'auditbeat-*', - }) - ).toEqual([ - { - indexName: 'auditbeat-*', - indexFieldName: 'event.category', - allowedValues: expect.arrayContaining([ - 'authentication', - 'configuration', - 'database', - 'driver', - 'email', - 'file', - 'host', - 'iam', - 'intrusion_detection', - 'malware', - 'network', - 'package', - 'process', - 'registry', - 'session', - 'threat', - 'vulnerability', - 'web', - ]), - }, - { - indexName: 'auditbeat-*', - indexFieldName: 'event.kind', - allowedValues: expect.arrayContaining([ - 'alert', - 'enrichment', - 'event', - 'metric', - 'state', - 'pipeline_error', - 'signal', - ]), - }, - { - indexName: 'auditbeat-*', - indexFieldName: 'event.outcome', - allowedValues: expect.arrayContaining(['failure', 'success', 'unknown']), - }, - { - indexName: 'auditbeat-*', - indexFieldName: 'event.type', - allowedValues: expect.arrayContaining([ - 'access', - 'admin', - 'allowed', - 'change', - 'connection', - 'creation', - 'deletion', - 'denied', - 'end', - 'error', - 'group', - 'indicator', - 'info', - 'installation', - 'protocol', - 'start', - 'user', - ]), - }, - ]); - }); - }); -}); diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/body/index.test.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/body/index.test.tsx deleted file mode 100644 index 595c17e16faaa..0000000000000 --- a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/body/index.test.tsx +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import { render, screen, waitFor } from '@testing-library/react'; -import React from 'react'; - -import { - TestDataQualityProviders, - TestExternalProviders, -} from '../../mock/test_providers/test_providers'; -import { Body } from '.'; - -describe('IndexInvalidValues', () => { - test('it renders the data quality summary', async () => { - render( - - - - - - ); - - await waitFor(() => { - expect(screen.getByTestId('dataQualitySummary')).toBeInTheDocument(); - }); - }); - - describe('patterns', () => { - const patterns = ['.alerts-security.alerts-default', 'auditbeat-*', 'logs-*', 'packetbeat-*']; - - test(`it renders the '${patterns.join(', ')}' patterns`, async () => { - render( - - - - - - ); - - for (const pattern of patterns) { - await waitFor(() => { - expect(screen.getByTestId(`${pattern}PatternPanel`)).toBeInTheDocument(); - }); - } - }); - }); -}); diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/body/index.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/body/index.tsx deleted file mode 100644 index a8ceecdc76c09..0000000000000 --- a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/body/index.tsx +++ /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; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import { EuiFlexGroup, EuiFlexItem, EuiSpacer } from '@elastic/eui'; -import React from 'react'; - -import { DataQualityDetails } from './data_quality_details'; -import { DataQualitySummary } from '../data_quality_summary'; - -const BodyComponent: React.FC = () => { - return ( - - - - - - - - - - - ); -}; - -export const Body = React.memo(BodyComponent); diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/index.test.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/index.test.tsx deleted file mode 100644 index 53d576ccf6f70..0000000000000 --- a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/index.test.tsx +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import { DARK_THEME } from '@elastic/charts'; -import { render, screen } from '@testing-library/react'; -import React from 'react'; - -import { TestExternalProviders } from './mock/test_providers/test_providers'; -import { DataQualityPanel } from '.'; -import { notificationServiceMock } from '@kbn/core-notifications-browser-mocks'; - -const { toasts } = notificationServiceMock.createSetupContract(); - -describe('DataQualityPanel', () => { - beforeEach(() => { - render( - - - - ); - }); - - test('it renders the body', () => { - expect(screen.getByTestId('body')).toBeInTheDocument(); - }); -}); diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/use_mappings/index.test.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/use_mappings/index.test.tsx deleted file mode 100644 index 86b3ef1688e6a..0000000000000 --- a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/use_mappings/index.test.tsx +++ /dev/null @@ -1,138 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import { renderHook } from '@testing-library/react-hooks'; -import React, { FC, PropsWithChildren } from 'react'; - -import { DataQualityProvider } from '../data_quality_panel/data_quality_context'; -import { mockMappingsResponse } from '../mock/mappings_response/mock_mappings_response'; -import { ERROR_LOADING_MAPPINGS } from '../translations'; -import { useMappings, UseMappings } from '.'; -import { notificationServiceMock } from '@kbn/core-notifications-browser-mocks'; -import { Theme } from '@elastic/charts'; - -const mockHttpFetch = jest.fn(); -const mockReportDataQualityIndexChecked = jest.fn(); -const mockReportDataQualityCheckAllClicked = jest.fn(); -const mockTelemetryEvents = { - reportDataQualityIndexChecked: mockReportDataQualityIndexChecked, - reportDataQualityCheckAllCompleted: mockReportDataQualityCheckAllClicked, -}; -const { toasts } = notificationServiceMock.createSetupContract(); - -const ContextWrapper: FC> = ({ children }) => ( - true)} - endDate={null} - formatBytes={jest.fn()} - formatNumber={jest.fn()} - isAssistantEnabled={true} - lastChecked={'2023-03-28T22:27:28.159Z'} - openCreateCaseFlyout={jest.fn()} - patterns={['auditbeat-*']} - setLastChecked={jest.fn()} - startDate={null} - theme={{ - background: { - color: '#000', - }, - }} - baseTheme={ - { - background: { - color: '#000', - }, - } as Theme - } - ilmPhases={['hot', 'warm', 'unmanaged']} - selectedIlmPhaseOptions={[ - { - label: 'Hot', - value: 'hot', - }, - { - label: 'Warm', - value: 'warm', - }, - { - label: 'Unmanaged', - value: 'unmanaged', - }, - ]} - setSelectedIlmPhaseOptions={jest.fn()} - > - {children} - -); - -const pattern = 'auditbeat-*'; - -describe('useMappings', () => { - beforeEach(() => { - jest.clearAllMocks(); - }); - - describe('successful response from the mappings api', () => { - let mappingsResult: UseMappings | undefined; - - beforeEach(async () => { - mockHttpFetch.mockResolvedValue(mockMappingsResponse); - - const { result, waitForNextUpdate } = renderHook(() => useMappings(pattern), { - wrapper: ContextWrapper, - }); - await waitForNextUpdate(); - mappingsResult = await result.current; - }); - - test('it returns the expected mappings', async () => { - expect(mappingsResult?.indexes).toEqual(mockMappingsResponse); - }); - - test('it returns loading: false, because the data has loaded', async () => { - expect(mappingsResult?.loading).toBe(false); - }); - - test('it returns a null error, because no errors occurred', async () => { - expect(mappingsResult?.error).toBeNull(); - }); - }); - - describe('fetch rejects with an error', () => { - let mappingsResult: UseMappings | undefined; - const errorMessage = 'simulated error'; - - beforeEach(async () => { - mockHttpFetch.mockRejectedValue(new Error(errorMessage)); - - const { result, waitForNextUpdate } = renderHook(() => useMappings(pattern), { - wrapper: ContextWrapper, - }); - await waitForNextUpdate(); - mappingsResult = await result.current; - }); - - test('it returns null mappings, because an error occurred', async () => { - expect(mappingsResult?.indexes).toBeNull(); - }); - - test('it returns loading: false, because data loading reached a terminal state', async () => { - expect(mappingsResult?.loading).toBe(false); - }); - - test('it returns the expected error', async () => { - expect(mappingsResult?.error).toEqual( - ERROR_LOADING_MAPPINGS({ details: errorMessage, patternOrIndexName: pattern }) - ); - }); - }); -}); diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/use_mappings/index.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/use_mappings/index.tsx deleted file mode 100644 index f20809a248086..0000000000000 --- a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/use_mappings/index.tsx +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import type { IndicesGetMappingIndexMappingRecord } from '@elastic/elasticsearch/lib/api/types'; -import { useEffect, useState } from 'react'; - -import { useDataQualityContext } from '../data_quality_panel/data_quality_context'; -import { fetchMappings } from './helpers'; -import { useIsMounted } from '../use_is_mounted'; - -export interface UseMappings { - indexes: Record | null; - error: string | null; - loading: boolean; -} - -export const useMappings = (patternOrIndexName: string): UseMappings => { - const { isMountedRef } = useIsMounted(); - const [indexes, setIndexes] = useState | null>(null); - const { httpFetch } = useDataQualityContext(); - const [error, setError] = useState(null); - const [loading, setLoading] = useState(true); - - useEffect(() => { - const abortController = new AbortController(); - - async function fetchData() { - try { - const response = await fetchMappings({ abortController, httpFetch, patternOrIndexName }); - - if (!abortController.signal.aborted) { - if (isMountedRef.current) { - setIndexes(response); - } - } - } catch (e) { - if (!abortController.signal.aborted) { - if (isMountedRef.current) { - setError(e.message); - } - } - } finally { - if (!abortController.signal.aborted) { - if (isMountedRef.current) { - setLoading(false); - } - } - } - } - - fetchData(); - - return () => { - abortController.abort(); - }; - }, [httpFetch, isMountedRef, patternOrIndexName, setError]); - - return { indexes, error, loading }; -}; diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/use_unallowed_values/index.test.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/use_unallowed_values/index.test.tsx deleted file mode 100644 index d2d216fd12293..0000000000000 --- a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/use_unallowed_values/index.test.tsx +++ /dev/null @@ -1,178 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import { renderHook } from '@testing-library/react-hooks'; -import React, { FC, PropsWithChildren } from 'react'; - -import { getUnallowedValueRequestItems } from '../data_quality_panel/allowed_values/helpers'; -import { DataQualityProvider } from '../data_quality_panel/data_quality_context'; -import { mockUnallowedValuesResponse } from '../mock/unallowed_values/mock_unallowed_values'; -import { ERROR_LOADING_UNALLOWED_VALUES } from '../translations'; -import { UnallowedValueRequestItem } from '../types'; -import { useUnallowedValues, UseUnallowedValues } from '.'; -import { notificationServiceMock } from '@kbn/core-notifications-browser-mocks'; -import { EcsFlatTyped } from '../constants'; -import { Theme } from '@elastic/charts'; - -const mockHttpFetch = jest.fn(); -const mockReportDataQualityIndexChecked = jest.fn(); -const mockReportDataQualityCheckAllClicked = jest.fn(); -const mockTelemetryEvents = { - reportDataQualityIndexChecked: mockReportDataQualityIndexChecked, - reportDataQualityCheckAllCompleted: mockReportDataQualityCheckAllClicked, -}; -const { toasts } = notificationServiceMock.createSetupContract(); - -const ContextWrapper: FC> = ({ children }) => ( - true)} - endDate={null} - formatBytes={jest.fn()} - formatNumber={jest.fn()} - isAssistantEnabled={true} - lastChecked={'2023-03-28T22:27:28.159Z'} - openCreateCaseFlyout={jest.fn()} - patterns={['auditbeat-*']} - setLastChecked={jest.fn()} - startDate={null} - theme={{ - background: { - color: '#000', - }, - }} - baseTheme={ - { - background: { - color: '#000', - }, - } as Theme - } - ilmPhases={['hot', 'warm', 'unmanaged']} - selectedIlmPhaseOptions={[ - { - label: 'Hot', - value: 'hot', - }, - { - label: 'Warm', - value: 'warm', - }, - { - label: 'Unmanaged', - value: 'unmanaged', - }, - ]} - setSelectedIlmPhaseOptions={jest.fn()} - > - {children} - -); - -const indexName = 'auditbeat-custom-index-1'; -const requestItems = getUnallowedValueRequestItems({ - ecsMetadata: EcsFlatTyped, - indexName, -}); - -describe('useUnallowedValues', () => { - beforeEach(() => { - jest.clearAllMocks(); - }); - - describe('when requestItems is empty', () => { - const emptyRequestItems: UnallowedValueRequestItem[] = []; - - test('it does NOT make an http request', async () => { - await renderHook( - () => - useUnallowedValues({ - indexName, - requestItems: emptyRequestItems, // <-- empty - }), - { - wrapper: ContextWrapper, - } - ); - - expect(mockHttpFetch).not.toBeCalled(); - }); - }); - - describe('successful response from the unallowed values api', () => { - let unallowedValuesResult: UseUnallowedValues | undefined; - - beforeEach(async () => { - mockHttpFetch.mockResolvedValue(mockUnallowedValuesResponse); - - const { result, waitForNextUpdate } = renderHook( - () => useUnallowedValues({ indexName, requestItems }), - { - wrapper: ContextWrapper, - } - ); - await waitForNextUpdate(); - unallowedValuesResult = await result.current; - }); - - test('it returns the expected unallowed values', async () => { - expect(unallowedValuesResult?.unallowedValues).toEqual({ - 'event.category': [ - { count: 2, fieldName: 'an_invalid_category' }, - { count: 1, fieldName: 'theory' }, - ], - 'event.kind': [], - 'event.outcome': [], - 'event.type': [], - }); - }); - - test('it returns loading: false, because the data has loaded', async () => { - expect(unallowedValuesResult?.loading).toBe(false); - }); - - test('it returns a null error, because no errors occurred', async () => { - expect(unallowedValuesResult?.error).toBeNull(); - }); - }); - - describe('fetch rejects with an error', () => { - let unallowedValuesResult: UseUnallowedValues | undefined; - const errorMessage = 'simulated error'; - - beforeEach(async () => { - mockHttpFetch.mockRejectedValue(new Error(errorMessage)); - - const { result, waitForNextUpdate } = renderHook( - () => useUnallowedValues({ indexName, requestItems }), - { - wrapper: ContextWrapper, - } - ); - await waitForNextUpdate(); - unallowedValuesResult = await result.current; - }); - - test('it returns null unallowed values, because an error occurred', async () => { - expect(unallowedValuesResult?.unallowedValues).toBeNull(); - }); - - test('it returns loading: false, because data loading reached a terminal state', async () => { - expect(unallowedValuesResult?.loading).toBe(false); - }); - - test('it returns the expected error', async () => { - expect(unallowedValuesResult?.error).toEqual( - ERROR_LOADING_UNALLOWED_VALUES({ details: errorMessage, indexName }) - ); - }); - }); -}); diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/use_unallowed_values/index.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/use_unallowed_values/index.tsx deleted file mode 100644 index 7f35da714ecd9..0000000000000 --- a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/use_unallowed_values/index.tsx +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import { useEffect, useState } from 'react'; - -import { useDataQualityContext } from '../data_quality_panel/data_quality_context'; -import { fetchUnallowedValues, getUnallowedValues } from './helpers'; -import type { UnallowedValueCount, UnallowedValueRequestItem } from '../types'; -import { useIsMounted } from '../use_is_mounted'; - -export interface UseUnallowedValues { - unallowedValues: Record | null; - error: string | null; - loading: boolean; - requestTime: number | undefined; -} - -export const useUnallowedValues = ({ - indexName, - requestItems, -}: { - indexName: string; - requestItems: UnallowedValueRequestItem[]; -}): UseUnallowedValues => { - const { isMountedRef } = useIsMounted(); - const [unallowedValues, setUnallowedValues] = useState | null>(null); - const { httpFetch } = useDataQualityContext(); - const [error, setError] = useState(null); - const [loading, setLoading] = useState(true); - const [requestTime, setRequestTime] = useState(); - useEffect(() => { - if (requestItems.length === 0) { - return; - } - - const abortController = new AbortController(); - - async function fetchData() { - const startTime = Date.now(); - - try { - const searchResults = await fetchUnallowedValues({ - abortController, - httpFetch, - indexName, - requestItems, - }); - - const unallowedValuesMap = getUnallowedValues({ - requestItems, - searchResults, - }); - - if (!abortController.signal.aborted) { - if (isMountedRef.current) { - setUnallowedValues(unallowedValuesMap); - } - } - } catch (e) { - if (!abortController.signal.aborted) { - if (isMountedRef.current) { - setError(e.message); - setRequestTime(Date.now() - startTime); - } - } - } finally { - if (!abortController.signal.aborted) { - if (isMountedRef.current) { - setLoading(false); - setRequestTime(Date.now() - startTime); - } - } - } - } - - fetchData(); - - return () => { - abortController.abort(); - }; - }, [httpFetch, indexName, isMountedRef, requestItems, setError]); - - return { unallowedValues, error, loading, requestTime }; -}; diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/use_add_to_new_case/index.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/actions/add_to_new_case/hooks/use_add_to_new_case/index.tsx similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/use_add_to_new_case/index.tsx rename to x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/actions/add_to_new_case/hooks/use_add_to_new_case/index.tsx diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/use_add_to_new_case/translations.ts b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/actions/add_to_new_case/hooks/use_add_to_new_case/translations.ts similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/use_add_to_new_case/translations.ts rename to x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/actions/add_to_new_case/hooks/use_add_to_new_case/translations.ts diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/actions/add_to_new_case/index.test.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/actions/add_to_new_case/index.test.tsx similarity index 98% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/actions/add_to_new_case/index.test.tsx rename to x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/actions/add_to_new_case/index.test.tsx index 1fec0d39fbfd0..ba4aee43c32c7 100644 --- a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/actions/add_to_new_case/index.test.tsx +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/actions/add_to_new_case/index.test.tsx @@ -12,7 +12,7 @@ import { AddToNewCaseAction } from '.'; import { TestDataQualityProviders, TestExternalProviders, -} from '../../../mock/test_providers/test_providers'; +} from '../../mock/test_providers/test_providers'; import userEvent from '@testing-library/user-event'; describe('AddToNewCaseAction', () => { diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/actions/add_to_new_case/index.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/actions/add_to_new_case/index.tsx similarity index 92% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/actions/add_to_new_case/index.tsx rename to x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/actions/add_to_new_case/index.tsx index 537f5b13a0f08..93d5b7ba7e20b 100644 --- a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/actions/add_to_new_case/index.tsx +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/actions/add_to_new_case/index.tsx @@ -9,9 +9,9 @@ import React, { useCallback } from 'react'; import { EuiIcon, EuiLink } from '@elastic/eui'; import { useDataQualityContext } from '../../data_quality_context'; -import { useAddToNewCase } from '../../../use_add_to_new_case'; +import { useAddToNewCase } from './hooks/use_add_to_new_case'; import { StyledLinkText } from '../styles'; -import { ADD_TO_NEW_CASE } from '../../../translations'; +import { ADD_TO_NEW_CASE } from '../../translations'; interface Props { markdownComment: string; diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/actions/chat/index.test.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/actions/chat/index.test.tsx similarity index 93% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/actions/chat/index.test.tsx rename to x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/actions/chat/index.test.tsx index 8d706aad92f1f..33e52a398e3c9 100644 --- a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/actions/chat/index.test.tsx +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/actions/chat/index.test.tsx @@ -12,7 +12,7 @@ import { ChatAction } from '.'; import { TestDataQualityProviders, TestExternalProviders, -} from '../../../mock/test_providers/test_providers'; +} from '../../mock/test_providers/test_providers'; describe('ChatAction', () => { it('should render new chat link', () => { diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/actions/chat/index.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/actions/chat/index.tsx similarity index 98% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/actions/chat/index.tsx rename to x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/actions/chat/index.tsx index ca37bcaad97d5..fb990fc295bbf 100644 --- a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/actions/chat/index.tsx +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/actions/chat/index.tsx @@ -14,7 +14,7 @@ import { DATA_QUALITY_PROMPT_CONTEXT_PILL, DATA_QUALITY_PROMPT_CONTEXT_PILL_TOOLTIP, DATA_QUALITY_SUGGESTED_USER_PROMPT, -} from '../../../translations'; +} from '../../translations'; import { useDataQualityContext } from '../../data_quality_context'; import { ASK_ASSISTANT } from './translations'; diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/actions/chat/translations.ts b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/actions/chat/translations.ts similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/actions/chat/translations.ts rename to x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/actions/chat/translations.ts diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/actions/copy_to_clipboard/index.test.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/actions/copy_to_clipboard/index.test.tsx similarity index 97% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/actions/copy_to_clipboard/index.test.tsx rename to x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/actions/copy_to_clipboard/index.test.tsx index 6e2147293237a..05a44639b08ec 100644 --- a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/actions/copy_to_clipboard/index.test.tsx +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/actions/copy_to_clipboard/index.test.tsx @@ -14,7 +14,7 @@ import { CopyToClipboardAction } from '.'; import { TestDataQualityProviders, TestExternalProviders, -} from '../../../mock/test_providers/test_providers'; +} from '../../mock/test_providers/test_providers'; jest.mock('@elastic/eui', () => { const original = jest.requireActual('@elastic/eui'); diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/actions/copy_to_clipboard/index.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/actions/copy_to_clipboard/index.tsx similarity index 98% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/actions/copy_to_clipboard/index.tsx rename to x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/actions/copy_to_clipboard/index.tsx index abf85203a0db1..23df7dd8ad88e 100644 --- a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/actions/copy_to_clipboard/index.tsx +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/actions/copy_to_clipboard/index.tsx @@ -9,7 +9,7 @@ import React, { useCallback } from 'react'; import { EuiIcon, EuiLink, copyToClipboard } from '@elastic/eui'; import { useDataQualityContext } from '../../data_quality_context'; -import { COPIED_RESULTS_TOAST_TITLE, COPY_TO_CLIPBOARD } from '../../../translations'; +import { COPIED_RESULTS_TOAST_TITLE, COPY_TO_CLIPBOARD } from '../../translations'; import { StyledLinkText } from '../styles'; interface Props { diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/actions/index.test.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/actions/index.test.tsx similarity index 97% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/actions/index.test.tsx rename to x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/actions/index.test.tsx index 55f32280ddb9d..8d3d5954c7a9e 100644 --- a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/actions/index.test.tsx +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/actions/index.test.tsx @@ -12,7 +12,7 @@ import { Actions } from '.'; import { TestDataQualityProviders, TestExternalProviders, -} from '../../mock/test_providers/test_providers'; +} from '../mock/test_providers/test_providers'; describe('Actions', () => { it('renders nothing by default', () => { diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/actions/index.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/actions/index.tsx similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/actions/index.tsx rename to x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/actions/index.tsx diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/actions/styles.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/actions/styles.tsx similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/actions/styles.tsx rename to x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/actions/styles.tsx diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/constants.ts b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/constants.ts similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/constants.ts rename to x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/constants.ts diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/contexts/indices_check_context/index.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/contexts/indices_check_context/index.tsx similarity index 88% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/contexts/indices_check_context/index.tsx rename to x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/contexts/indices_check_context/index.tsx index d6ecacf09ac4e..48863a25e2431 100644 --- a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/contexts/indices_check_context/index.tsx +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/contexts/indices_check_context/index.tsx @@ -7,7 +7,7 @@ import { createContext, useContext } from 'react'; -import { UseIndicesCheckReturnValue } from '../../use_indices_check/types'; +import { UseIndicesCheckReturnValue } from '../../hooks/use_indices_check/types'; export const IndicesCheckContext = createContext(null); diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/contexts/results_rollup_context/index.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/contexts/results_rollup_context/index.tsx similarity index 88% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/contexts/results_rollup_context/index.tsx rename to x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/contexts/results_rollup_context/index.tsx index 7771a06fbf7f8..d60c933768153 100644 --- a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/contexts/results_rollup_context/index.tsx +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/contexts/results_rollup_context/index.tsx @@ -7,7 +7,7 @@ import { createContext, useContext } from 'react'; -import { UseResultsRollupReturnValue } from '../../use_results_rollup/types'; +import { UseResultsRollupReturnValue } from '../../hooks/use_results_rollup/types'; export const ResultsRollupContext = createContext(null); diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/data_quality_context/index.test.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_context/index.test.tsx similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/data_quality_context/index.test.tsx rename to x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_context/index.test.tsx diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/data_quality_context/index.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_context/index.tsx similarity index 98% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/data_quality_context/index.tsx rename to x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_context/index.tsx index 06620ecacd04d..762efef424a10 100644 --- a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/data_quality_context/index.tsx +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_context/index.tsx @@ -12,7 +12,7 @@ import type { IToasts } from '@kbn/core-notifications-browser'; import { PartialTheme, Theme } from '@elastic/charts'; import { EuiComboBoxOptionOption } from '@elastic/eui'; -import type { TelemetryEvents } from '../../types'; +import type { TelemetryEvents } from '../types'; export interface DataQualityProviderProps { httpFetch: HttpHandler; diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/ilm_phases_empty_prompt/index.test.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/ilm_phases_empty_prompt/index.test.tsx similarity index 94% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/ilm_phases_empty_prompt/index.test.tsx rename to x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/ilm_phases_empty_prompt/index.test.tsx index 329ff56cd8326..a20e279e6ac19 100644 --- a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/ilm_phases_empty_prompt/index.test.tsx +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/ilm_phases_empty_prompt/index.test.tsx @@ -8,7 +8,7 @@ import { render, screen } from '@testing-library/react'; import React from 'react'; -import { TestExternalProviders } from '../mock/test_providers/test_providers'; +import { TestExternalProviders } from '../../mock/test_providers/test_providers'; import { IlmPhasesEmptyPrompt } from '.'; describe('IlmPhasesEmptyPrompt', () => { diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/ilm_phases_empty_prompt/index.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/ilm_phases_empty_prompt/index.tsx similarity index 98% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/ilm_phases_empty_prompt/index.tsx rename to x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/ilm_phases_empty_prompt/index.tsx index 1720da6df8be0..c8a6e7385a122 100644 --- a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/ilm_phases_empty_prompt/index.tsx +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/ilm_phases_empty_prompt/index.tsx @@ -15,7 +15,7 @@ import { HOT_DESCRIPTION, UNMANAGED_DESCRIPTION, WARM_DESCRIPTION, -} from '../translations'; +} from '../../translations'; import * as i18n from './translations'; const Ul = styled.ul` diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/ilm_phases_empty_prompt/translations.ts b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/ilm_phases_empty_prompt/translations.ts similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/ilm_phases_empty_prompt/translations.ts rename to x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/ilm_phases_empty_prompt/translations.ts diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/body/data_quality_details/index.test.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/index.test.tsx similarity index 97% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/body/data_quality_details/index.test.tsx rename to x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/index.test.tsx index 399b5705d028d..dfe943215f909 100644 --- a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/body/data_quality_details/index.test.tsx +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/index.test.tsx @@ -11,7 +11,7 @@ import React from 'react'; import { TestDataQualityProviders, TestExternalProviders, -} from '../../../mock/test_providers/test_providers'; +} from '../mock/test_providers/test_providers'; import { DataQualityDetails } from '.'; const ilmPhases = ['hot', 'warm', 'unmanaged']; diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/body/data_quality_details/index.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/index.tsx similarity index 86% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/body/data_quality_details/index.tsx rename to x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/index.tsx index 8f8686f0c03b2..a880d2a7d4f16 100644 --- a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/body/data_quality_details/index.tsx +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/index.tsx @@ -7,11 +7,11 @@ import React, { useCallback, useState } from 'react'; -import { IlmPhasesEmptyPrompt } from '../../../ilm_phases_empty_prompt'; +import { IlmPhasesEmptyPrompt } from './ilm_phases_empty_prompt'; import { IndicesDetails } from './indices_details'; import { StorageDetails } from './storage_details'; -import { SelectedIndex } from '../../../types'; -import { useDataQualityContext } from '../../data_quality_context'; +import { SelectedIndex } from '../types'; +import { useDataQualityContext } from '../data_quality_context'; const DataQualityDetailsComponent: React.FC = () => { const { isILMAvailable, ilmPhases } = useDataQualityContext(); diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/body/data_quality_details/indices_details/index.test.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/index.test.tsx similarity index 83% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/body/data_quality_details/indices_details/index.test.tsx rename to x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/index.test.tsx index ddb17a64d1fc2..65fc799bd3e41 100644 --- a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/body/data_quality_details/indices_details/index.test.tsx +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/index.test.tsx @@ -9,15 +9,15 @@ import numeral from '@elastic/numeral'; import { render, screen, waitFor } from '@testing-library/react'; import React from 'react'; -import { EMPTY_STAT } from '../../../../helpers'; -import { alertIndexWithAllResults } from '../../../../mock/pattern_rollup/mock_alerts_pattern_rollup'; -import { auditbeatWithAllResults } from '../../../../mock/pattern_rollup/mock_auditbeat_pattern_rollup'; -import { packetbeatNoResults } from '../../../../mock/pattern_rollup/mock_packetbeat_pattern_rollup'; +import { EMPTY_STAT } from '../../helpers'; +import { alertIndexWithAllResults } from '../../mock/pattern_rollup/mock_alerts_pattern_rollup'; +import { auditbeatWithAllResults } from '../../mock/pattern_rollup/mock_auditbeat_pattern_rollup'; +import { packetbeatNoResults } from '../../mock/pattern_rollup/mock_packetbeat_pattern_rollup'; import { TestDataQualityProviders, TestExternalProviders, -} from '../../../../mock/test_providers/test_providers'; -import { PatternRollup } from '../../../../types'; +} from '../../mock/test_providers/test_providers'; +import { PatternRollup } from '../../types'; import { Props, IndicesDetails } from '.'; const defaultBytesFormat = '0,0.[0]b'; diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/body/data_quality_details/indices_details/index.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/index.tsx similarity index 85% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/body/data_quality_details/indices_details/index.tsx rename to x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/index.tsx index 426e61513ee14..fd565d8fc7637 100644 --- a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/body/data_quality_details/indices_details/index.tsx +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/index.tsx @@ -9,10 +9,10 @@ import { EuiFlexItem } from '@elastic/eui'; import React from 'react'; import styled from 'styled-components'; -import { useResultsRollupContext } from '../../../../contexts/results_rollup_context'; -import { Pattern } from '../../../pattern'; -import { SelectedIndex } from '../../../../types'; -import { useDataQualityContext } from '../../../data_quality_context'; +import { useResultsRollupContext } from '../../contexts/results_rollup_context'; +import { Pattern } from './pattern'; +import { SelectedIndex } from '../../types'; +import { useDataQualityContext } from '../../data_quality_context'; const StyledPatternWrapperFlexItem = styled(EuiFlexItem)` margin-bottom: ${({ theme }) => theme.eui.euiSize}; diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/error_empty_prompt/index.test.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/error_empty_prompt/index.test.tsx similarity index 89% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/error_empty_prompt/index.test.tsx rename to x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/error_empty_prompt/index.test.tsx index ee3241cd74d8b..aad142baff3a4 100644 --- a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/error_empty_prompt/index.test.tsx +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/error_empty_prompt/index.test.tsx @@ -8,7 +8,7 @@ import { render, screen } from '@testing-library/react'; import React from 'react'; -import { TestExternalProviders } from '../../mock/test_providers/test_providers'; +import { TestExternalProviders } from '../../../../mock/test_providers/test_providers'; import { ErrorEmptyPrompt } from '.'; describe('ErrorEmptyPrompt', () => { diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/error_empty_prompt/index.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/error_empty_prompt/index.tsx similarity index 89% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/error_empty_prompt/index.tsx rename to x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/error_empty_prompt/index.tsx index 3214b704dc685..3bac63944838b 100644 --- a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/error_empty_prompt/index.tsx +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/error_empty_prompt/index.tsx @@ -8,7 +8,7 @@ import { EuiCallOut, EuiCode } from '@elastic/eui'; import React from 'react'; -import * as i18n from '../data_quality_summary/errors_popover/translations'; +import * as i18n from '../../../../data_quality_summary/summary_actions/check_status/errors_popover/translations'; interface Props { title: string; diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/pattern/helpers.test.ts b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/helpers.test.ts similarity index 98% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/pattern/helpers.test.ts rename to x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/helpers.test.ts index f6a01533bcfbf..d2d81348c39ec 100644 --- a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/pattern/helpers.test.ts +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/helpers.test.ts @@ -24,12 +24,12 @@ import { shouldCreateIndexNames, shouldCreatePatternRollup, } from './helpers'; -import { mockIlmExplain } from '../../mock/ilm_explain/mock_ilm_explain'; -import { mockDataQualityCheckResult } from '../../mock/data_quality_check_result/mock_index'; -import { auditbeatWithAllResults } from '../../mock/pattern_rollup/mock_auditbeat_pattern_rollup'; -import { mockStats } from '../../mock/stats/mock_stats'; -import { DataQualityCheckResult } from '../../types'; -import { getIndexNames, getTotalDocsCount } from '../../helpers'; +import { mockIlmExplain } from '../../../mock/ilm_explain/mock_ilm_explain'; +import { mockDataQualityCheckResult } from '../../../mock/data_quality_check_result/mock_index'; +import { auditbeatWithAllResults } from '../../../mock/pattern_rollup/mock_auditbeat_pattern_rollup'; +import { mockStats } from '../../../mock/stats/mock_stats'; +import { DataQualityCheckResult } from '../../../types'; +import { getIndexNames, getTotalDocsCount } from '../../../helpers'; import { IndexSummaryTableItem } from './types'; const hot: IlmExplainLifecycleLifecycleExplainManaged = { diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/pattern/helpers.ts b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/helpers.ts similarity index 98% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/pattern/helpers.ts rename to x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/helpers.ts index ab3e917246f1d..b9aede7d799ef 100644 --- a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/pattern/helpers.ts +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/helpers.ts @@ -15,8 +15,8 @@ import type { PatternRollup, SortConfig, MeteringStatsIndex, -} from '../../types'; -import { getDocsCount, getSizeInBytes } from '../../helpers'; +} from '../../../types'; +import { getDocsCount, getSizeInBytes } from '../../../helpers'; import { IndexSummaryTableItem } from './types'; export const isManaged = ( diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/use_ilm_explain/index.test.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/hooks/use_ilm_explain/index.test.tsx similarity index 96% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/use_ilm_explain/index.test.tsx rename to x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/hooks/use_ilm_explain/index.test.tsx index b8c6092fea0d0..768845f023011 100644 --- a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/use_ilm_explain/index.test.tsx +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/hooks/use_ilm_explain/index.test.tsx @@ -8,9 +8,9 @@ import { renderHook } from '@testing-library/react-hooks'; import React from 'react'; -import { DataQualityProvider } from '../data_quality_panel/data_quality_context'; -import { mockIlmExplain } from '../mock/ilm_explain/mock_ilm_explain'; -import { ERROR_LOADING_ILM_EXPLAIN } from '../translations'; +import { DataQualityProvider } from '../../../../../data_quality_context'; +import { mockIlmExplain } from '../../../../../mock/ilm_explain/mock_ilm_explain'; +import { ERROR_LOADING_ILM_EXPLAIN } from '../../../../../translations'; import { useIlmExplain, UseIlmExplain } from '.'; import { notificationServiceMock } from '@kbn/core-notifications-browser-mocks'; import { Theme } from '@elastic/charts'; diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/use_ilm_explain/index.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/hooks/use_ilm_explain/index.tsx similarity index 89% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/use_ilm_explain/index.tsx rename to x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/hooks/use_ilm_explain/index.tsx index 8477d710fea76..4e46df6c67ccc 100644 --- a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/use_ilm_explain/index.tsx +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/hooks/use_ilm_explain/index.tsx @@ -8,10 +8,10 @@ import type { IlmExplainLifecycleLifecycleExplain } from '@elastic/elasticsearch/lib/api/types'; import { useEffect, useState } from 'react'; -import { useDataQualityContext } from '../data_quality_panel/data_quality_context'; -import { INTERNAL_API_VERSION } from '../helpers'; -import * as i18n from '../translations'; -import { useIsMounted } from '../use_is_mounted'; +import { useDataQualityContext } from '../../../../../data_quality_context'; +import { INTERNAL_API_VERSION } from '../../../../../helpers'; +import * as i18n from '../../../../../translations'; +import { useIsMounted } from '../../../../../hooks/use_is_mounted'; const ILM_EXPLAIN_ENDPOINT = '/internal/ecs_data_quality_dashboard/ilm_explain'; diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/use_stats/index.test.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/hooks/use_stats/index.test.tsx similarity index 96% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/use_stats/index.test.tsx rename to x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/hooks/use_stats/index.test.tsx index c07bf9b8afd76..5982fa715adb9 100644 --- a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/use_stats/index.test.tsx +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/hooks/use_stats/index.test.tsx @@ -8,9 +8,9 @@ import { renderHook } from '@testing-library/react-hooks'; import React, { FC, PropsWithChildren } from 'react'; -import { DataQualityProvider } from '../data_quality_panel/data_quality_context'; -import { mockStatsAuditbeatIndex } from '../mock/stats/mock_stats_packetbeat_index'; -import { ERROR_LOADING_STATS } from '../translations'; +import { DataQualityProvider } from '../../../../../data_quality_context'; +import { mockStatsAuditbeatIndex } from '../../../../../mock/stats/mock_stats_packetbeat_index'; +import { ERROR_LOADING_STATS } from '../../../../../translations'; import { useStats, UseStats } from '.'; import { notificationServiceMock } from '@kbn/core-notifications-browser-mocks'; import { Theme } from '@elastic/charts'; diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/use_stats/index.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/hooks/use_stats/index.tsx similarity index 88% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/use_stats/index.tsx rename to x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/hooks/use_stats/index.tsx index 0de57ccd54568..e2505a6ed2237 100644 --- a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/use_stats/index.tsx +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/hooks/use_stats/index.tsx @@ -8,11 +8,11 @@ import { useEffect, useState } from 'react'; import { HttpFetchQuery } from '@kbn/core/public'; -import { useDataQualityContext } from '../data_quality_panel/data_quality_context'; -import * as i18n from '../translations'; -import { INTERNAL_API_VERSION } from '../helpers'; -import { MeteringStatsIndex } from '../types'; -import { useIsMounted } from '../use_is_mounted'; +import { useDataQualityContext } from '../../../../../data_quality_context'; +import * as i18n from '../../../../../translations'; +import { INTERNAL_API_VERSION } from '../../../../../helpers'; +import { MeteringStatsIndex } from '../../../../../types'; +import { useIsMounted } from '../../../../../hooks/use_is_mounted'; const STATS_ENDPOINT = '/internal/ecs_data_quality_dashboard/stats'; diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/pattern/index.test.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index.test.tsx similarity index 91% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/pattern/index.test.tsx rename to x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index.test.tsx index 9fdd6f3acc606..43054d9afd813 100644 --- a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/pattern/index.test.tsx +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index.test.tsx @@ -9,13 +9,13 @@ import numeral from '@elastic/numeral'; import { render, screen } from '@testing-library/react'; import React, { ComponentProps } from 'react'; -import { EMPTY_STAT } from '../../helpers'; +import { EMPTY_STAT } from '../../../helpers'; import { TestDataQualityProviders, TestExternalProviders, -} from '../../mock/test_providers/test_providers'; +} from '../../../mock/test_providers/test_providers'; import { Pattern } from '.'; -import { getCheckState } from '../../stub/get_check_state'; +import { getCheckState } from '../../../stub/get_check_state'; const indexName = 'auditbeat-custom-index-1'; const defaultBytesFormat = '0,0.[0]b'; @@ -26,7 +26,7 @@ const defaultNumberFormat = '0,0.[000]'; const formatNumber = (value: number | undefined) => value != null ? numeral(value).format(defaultNumberFormat) : EMPTY_STAT; -jest.mock('../../use_stats', () => ({ +jest.mock('./hooks/use_stats', () => ({ useStats: jest.fn(() => ({ stats: {}, error: null, @@ -34,7 +34,7 @@ jest.mock('../../use_stats', () => ({ })), })); -jest.mock('../../use_ilm_explain', () => ({ +jest.mock('./hooks/use_ilm_explain', () => ({ useIlmExplain: jest.fn(() => ({ error: null, ilmExplain: {}, diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/pattern/index.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index.tsx similarity index 93% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/pattern/index.tsx rename to x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index.tsx index 106d9bbe2e433..31db5e84a68f6 100644 --- a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/pattern/index.tsx +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index.tsx @@ -8,7 +8,7 @@ import { EuiSpacer, useGeneratedHtmlId } from '@elastic/eui'; import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react'; -import { ErrorEmptyPrompt } from '../error_empty_prompt'; +import { ErrorEmptyPrompt } from './error_empty_prompt'; import { defaultSort, getIlmExplainPhaseCounts, @@ -24,21 +24,21 @@ import { getTotalPatternIncompatible, getTotalPatternIndicesChecked, getTotalSizeInBytes, -} from '../../helpers'; -import { LoadingEmptyPrompt } from '../loading_empty_prompt'; +} from '../../../helpers'; +import { LoadingEmptyPrompt } from './loading_empty_prompt'; import { PatternSummary } from './pattern_summary'; -import { RemoteClustersCallout } from '../remote_clusters_callout'; -import { SummaryTable } from '../summary_table'; -import { getSummaryTableColumns } from '../summary_table/helpers'; +import { RemoteClustersCallout } from './remote_clusters_callout'; +import { SummaryTable } from './summary_table'; +import { getSummaryTableColumns } from './summary_table/helpers'; import * as i18n from './translations'; -import type { PatternRollup, SelectedIndex, SortConfig } from '../../types'; -import { useIlmExplain } from '../../use_ilm_explain'; -import { useStats } from '../../use_stats'; -import { useDataQualityContext } from '../data_quality_context'; +import type { PatternRollup, SelectedIndex, SortConfig } from '../../../types'; +import { useIlmExplain } from './hooks/use_ilm_explain'; +import { useStats } from './hooks/use_stats'; +import { useDataQualityContext } from '../../../data_quality_context'; import { PatternAccordion, PatternAccordionChildren } from './styles'; import { IndexCheckFlyout } from './index_check_flyout'; -import { useResultsRollupContext } from '../../contexts/results_rollup_context'; -import { useIndicesCheckContext } from '../../contexts/indices_check_context'; +import { useResultsRollupContext } from '../../../contexts/results_rollup_context'; +import { useIndicesCheckContext } from '../../../contexts/indices_check_context'; const EMPTY_INDEX_NAMES: string[] = []; diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/use_current_window_width/index.test.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/hooks/use_current_window_width/index.test.tsx similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/use_current_window_width/index.test.tsx rename to x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/hooks/use_current_window_width/index.test.tsx diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/use_current_window_width/index.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/hooks/use_current_window_width/index.tsx similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/use_current_window_width/index.tsx rename to x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/hooks/use_current_window_width/index.tsx diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/pattern/index_check_flyout/index.test.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index.test.tsx similarity index 92% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/pattern/index_check_flyout/index.test.tsx rename to x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index.test.tsx index b73da31bbcf8c..0b6b1d62ada01 100644 --- a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/pattern/index_check_flyout/index.test.tsx +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index.test.tsx @@ -14,10 +14,10 @@ import { IndexCheckFlyout } from '.'; import { TestDataQualityProviders, TestExternalProviders, -} from '../../../mock/test_providers/test_providers'; -import { mockIlmExplain } from '../../../mock/ilm_explain/mock_ilm_explain'; -import { auditbeatWithAllResults } from '../../../mock/pattern_rollup/mock_auditbeat_pattern_rollup'; -import { mockStats } from '../../../mock/stats/mock_stats'; +} from '../../../../mock/test_providers/test_providers'; +import { mockIlmExplain } from '../../../../mock/ilm_explain/mock_ilm_explain'; +import { auditbeatWithAllResults } from '../../../../mock/pattern_rollup/mock_auditbeat_pattern_rollup'; +import { mockStats } from '../../../../mock/stats/mock_stats'; describe('IndexCheckFlyout', () => { beforeEach(() => { diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/pattern/index_check_flyout/index.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index.tsx similarity index 91% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/pattern/index_check_flyout/index.tsx rename to x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index.tsx index b9d33c51cc495..a08aeaaaff2d8 100644 --- a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/pattern/index_check_flyout/index.tsx +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index.tsx @@ -21,15 +21,15 @@ import { } from '@elastic/eui'; import React, { useCallback, useEffect } from 'react'; import moment from 'moment'; -import { useIndicesCheckContext } from '../../../contexts/indices_check_context'; +import { useIndicesCheckContext } from '../../../../contexts/indices_check_context'; -import { EMPTY_STAT, getDocsCount, getSizeInBytes } from '../../../helpers'; -import { MeteringStatsIndex, PatternRollup } from '../../../types'; -import { useDataQualityContext } from '../../data_quality_context'; -import { IndexProperties } from '../../index_properties'; +import { EMPTY_STAT, getDocsCount, getSizeInBytes } from '../../../../helpers'; +import { MeteringStatsIndex, PatternRollup } from '../../../../types'; +import { useDataQualityContext } from '../../../../data_quality_context'; +import { IndexProperties } from './index_properties'; import { getIlmPhase } from '../helpers'; -import { IndexResultBadge } from '../../index_result_badge'; -import { useCurrentWindowWidth } from '../../../use_current_window_width'; +import { IndexResultBadge } from '../index_result_badge'; +import { useCurrentWindowWidth } from './hooks/use_current_window_width'; import { CHECK_NOW } from './translations'; export interface Props { diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/index_properties/empty_prompt_body.test.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/empty_prompt_body.test.tsx similarity index 88% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/index_properties/empty_prompt_body.test.tsx rename to x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/empty_prompt_body.test.tsx index 19e6c47a2c365..cd16e9870906a 100644 --- a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/index_properties/empty_prompt_body.test.tsx +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/empty_prompt_body.test.tsx @@ -9,7 +9,7 @@ import { render, screen } from '@testing-library/react'; import React from 'react'; import { EmptyPromptBody } from './empty_prompt_body'; -import { TestExternalProviders } from '../../mock/test_providers/test_providers'; +import { TestExternalProviders } from '../../../../../mock/test_providers/test_providers'; describe('EmptyPromptBody', () => { const content = 'foo bar baz @baz'; diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/index_properties/empty_prompt_body.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/empty_prompt_body.tsx similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/index_properties/empty_prompt_body.tsx rename to x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/empty_prompt_body.tsx diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/index_properties/empty_prompt_title.test.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/empty_prompt_title.test.tsx similarity index 89% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/index_properties/empty_prompt_title.test.tsx rename to x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/empty_prompt_title.test.tsx index 760d16f8a87a5..0b146f7b7f123 100644 --- a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/index_properties/empty_prompt_title.test.tsx +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/empty_prompt_title.test.tsx @@ -9,7 +9,7 @@ import { render, screen } from '@testing-library/react'; import React from 'react'; import { EmptyPromptTitle } from './empty_prompt_title'; -import { TestExternalProviders } from '../../mock/test_providers/test_providers'; +import { TestExternalProviders } from '../../../../../mock/test_providers/test_providers'; describe('EmptyPromptTitle', () => { const title = 'What is a great title?'; diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/index_properties/empty_prompt_title.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/empty_prompt_title.tsx similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/index_properties/empty_prompt_title.tsx rename to x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/empty_prompt_title.tsx diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/index_properties/helpers.test.ts b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/helpers.test.ts similarity index 96% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/index_properties/helpers.test.ts rename to x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/helpers.test.ts index 2ef3eb9c1c190..bd193dce23441 100644 --- a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/index_properties/helpers.test.ts +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/helpers.test.ts @@ -10,9 +10,9 @@ import { getSortedPartitionedFieldMetadata, hasAllDataFetchingCompleted, } from './helpers'; -import { mockIndicesGetMappingIndexMappingRecords } from '../../mock/indices_get_mapping_index_mapping_record/mock_indices_get_mapping_index_mapping_record'; -import { mockMappingsProperties } from '../../mock/mappings_properties/mock_mappings_properties'; -import { EcsFlatTyped } from '../../constants'; +import { mockIndicesGetMappingIndexMappingRecords } from '../../../../../mock/indices_get_mapping_index_mapping_record/mock_indices_get_mapping_index_mapping_record'; +import { mockMappingsProperties } from '../../../../../mock/mappings_properties/mock_mappings_properties'; +import { EcsFlatTyped } from '../../../../../constants'; describe('helpers', () => { describe('getSortedPartitionedFieldMetadata', () => { diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/index_properties/helpers.ts b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/helpers.ts similarity index 96% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/index_properties/helpers.ts rename to x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/helpers.ts index c0046da0ea814..4097186be6b73 100644 --- a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/index_properties/helpers.ts +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/helpers.ts @@ -10,15 +10,15 @@ import type { MappingProperty, } from '@elastic/elasticsearch/lib/api/types'; import { sortBy } from 'lodash/fp'; -import { EcsFlatTyped } from '../../constants'; +import { EcsFlatTyped } from '../../../../../constants'; import { getEnrichedFieldMetadata, getFieldTypes, getMissingTimestampFieldMetadata, getPartitionedFieldMetadata, -} from '../../helpers'; -import type { PartitionedFieldMetadata, UnallowedValueCount } from '../../types'; +} from '../../../../../helpers'; +import type { PartitionedFieldMetadata, UnallowedValueCount } from '../../../../../types'; export const ALL_TAB_ID = 'allTab'; export const ECS_COMPLIANT_TAB_ID = 'ecsCompliantTab'; diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/index_properties/index.test.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/index.test.tsx similarity index 95% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/index_properties/index.test.tsx rename to x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/index.test.tsx index 4e991d7878ace..1427b67cd41d3 100644 --- a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/index_properties/index.test.tsx +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/index.test.tsx @@ -9,15 +9,15 @@ import numeral from '@elastic/numeral'; import { render, screen, waitFor } from '@testing-library/react'; import React from 'react'; -import { EMPTY_STAT } from '../../helpers'; -import { auditbeatWithAllResults } from '../../mock/pattern_rollup/mock_auditbeat_pattern_rollup'; +import { EMPTY_STAT } from '../../../../../helpers'; +import { auditbeatWithAllResults } from '../../../../../mock/pattern_rollup/mock_auditbeat_pattern_rollup'; import { TestDataQualityProviders, TestExternalProviders, -} from '../../mock/test_providers/test_providers'; +} from '../../../../../mock/test_providers/test_providers'; import { LOADING_MAPPINGS, LOADING_UNALLOWED_VALUES } from './translations'; import { IndexProperties, Props } from '.'; -import { getCheckState } from '../../stub/get_check_state'; +import { getCheckState } from '../../../../../stub/get_check_state'; const indexName = 'auditbeat-custom-index-1'; const defaultBytesFormat = '0,0.[0]b'; diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/index_properties/index.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/index.tsx similarity index 86% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/index_properties/index.tsx rename to x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/index.tsx index f7b1bb37e36f1..f28d506cda0fa 100644 --- a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/index_properties/index.tsx +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/index.tsx @@ -8,15 +8,15 @@ import React from 'react'; import { EuiSpacer } from '@elastic/eui'; -import { ErrorEmptyPrompt } from '../error_empty_prompt'; -import { LoadingEmptyPrompt } from '../loading_empty_prompt'; -import { getIndexPropertiesContainerId } from '../pattern/helpers'; +import { ErrorEmptyPrompt } from '../../error_empty_prompt'; +import { LoadingEmptyPrompt } from '../../loading_empty_prompt'; +import { getIndexPropertiesContainerId } from '../../helpers'; import * as i18n from './translations'; -import type { IlmPhase, PatternRollup } from '../../types'; -import { useIndicesCheckContext } from '../../contexts/indices_check_context'; +import type { IlmPhase, PatternRollup } from '../../../../../types'; +import { useIndicesCheckContext } from '../../../../../contexts/indices_check_context'; import { IndexCheckFields } from './index_check_fields'; import { IndexStatsPanel } from './index_stats_panel'; -import { useDataQualityContext } from '../data_quality_context'; +import { useDataQualityContext } from '../../../../../data_quality_context'; export interface Props { docsCount: number; diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/index_properties/index_check_fields/index.test.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/index_check_fields/index.test.tsx similarity index 90% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/index_properties/index_check_fields/index.test.tsx rename to x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/index_check_fields/index.test.tsx index e5ab5247ac41e..024a53087efae 100644 --- a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/index_properties/index_check_fields/index.test.tsx +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/index_check_fields/index.test.tsx @@ -12,8 +12,8 @@ import { IndexCheckFields } from '.'; import { TestDataQualityProviders, TestExternalProviders, -} from '../../../mock/test_providers/test_providers'; -import { auditbeatWithAllResults } from '../../../mock/pattern_rollup/mock_auditbeat_pattern_rollup'; +} from '../../../../../../mock/test_providers/test_providers'; +import { auditbeatWithAllResults } from '../../../../../../mock/pattern_rollup/mock_auditbeat_pattern_rollup'; import userEvent from '@testing-library/user-event'; describe('IndexCheckFields', () => { diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/index_properties/index_check_fields/index.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/index_check_fields/index.tsx similarity index 91% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/index_properties/index_check_fields/index.tsx rename to x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/index_check_fields/index.tsx index 8fa4a37ea3ead..db6696e36212a 100644 --- a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/index_properties/index_check_fields/index.tsx +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/index_check_fields/index.tsx @@ -9,11 +9,11 @@ import React, { useMemo, useState } from 'react'; import { EuiButtonGroup, EuiFlexGroup, EuiSpacer } from '@elastic/eui'; import styled from 'styled-components'; -import { useDataQualityContext } from '../../data_quality_context'; -import { useIndicesCheckContext } from '../../../contexts/indices_check_context'; +import { useDataQualityContext } from '../../../../../../data_quality_context'; +import { useIndicesCheckContext } from '../../../../../../contexts/indices_check_context'; import { EMPTY_METADATA, INCOMPATIBLE_TAB_ID } from '../helpers'; -import { IlmPhase, PatternRollup } from '../../../types'; -import { getTabs } from '../../tabs/helpers'; +import { IlmPhase, PatternRollup } from '../../../../../../types'; +import { getTabs } from './tabs/helpers'; const StyledTabFlexGroup = styled(EuiFlexGroup)` width: 100%; diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/tabs/all_tab/index.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/index_check_fields/tabs/all_tab/index.tsx similarity index 77% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/tabs/all_tab/index.tsx rename to x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/index_check_fields/tabs/all_tab/index.tsx index c80d1f615f261..085a865917b42 100644 --- a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/tabs/all_tab/index.tsx +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/index_check_fields/tabs/all_tab/index.tsx @@ -9,12 +9,12 @@ import { EcsVersion } from '@elastic/ecs'; import { EuiCallOut, EuiEmptyPrompt, EuiSpacer } from '@elastic/eui'; import React, { useMemo } from 'react'; -import { CompareFieldsTable } from '../../../compare_fields_table'; -import { getCommonTableColumns } from '../../../compare_fields_table/get_common_table_columns'; -import { EmptyPromptBody } from '../../index_properties/empty_prompt_body'; -import { EmptyPromptTitle } from '../../index_properties/empty_prompt_title'; -import * as i18n from '../../index_properties/translations'; -import type { PartitionedFieldMetadata } from '../../../types'; +import { CompareFieldsTable } from '../compare_fields_table'; +import { getCommonTableColumns } from '../compare_fields_table/get_common_table_columns'; +import { EmptyPromptBody } from '../../../empty_prompt_body'; +import { EmptyPromptTitle } from '../../../empty_prompt_title'; +import * as i18n from '../../../translations'; +import type { PartitionedFieldMetadata } from '../../../../../../../../types'; interface Props { indexName: string; diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/tabs/callouts/custom_callout/index.test.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/index_check_fields/tabs/callouts/custom_callout/index.test.tsx similarity index 80% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/tabs/callouts/custom_callout/index.test.tsx rename to x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/index_check_fields/tabs/callouts/custom_callout/index.test.tsx index 88bb4ef18ac47..b83f1fdc7ca60 100644 --- a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/tabs/callouts/custom_callout/index.test.tsx +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/index_check_fields/tabs/callouts/custom_callout/index.test.tsx @@ -9,12 +9,12 @@ import { EcsVersion } from '@elastic/ecs'; import { render, screen } from '@testing-library/react'; import React from 'react'; -import { ECS_IS_A_PERMISSIVE_SCHEMA } from '../../../index_properties/translations'; +import { ECS_IS_A_PERMISSIVE_SCHEMA } from '../../../../translations'; import { hostNameKeyword, someField, -} from '../../../../mock/enriched_field_metadata/mock_enriched_field_metadata'; -import { TestExternalProviders } from '../../../../mock/test_providers/test_providers'; +} from '../../../../../../../../../mock/enriched_field_metadata/mock_enriched_field_metadata'; +import { TestExternalProviders } from '../../../../../../../../../mock/test_providers/test_providers'; import { CustomCallout } from '.'; describe('CustomCallout', () => { diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/tabs/callouts/custom_callout/index.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/index_check_fields/tabs/callouts/custom_callout/index.tsx similarity index 88% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/tabs/callouts/custom_callout/index.tsx rename to x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/index_check_fields/tabs/callouts/custom_callout/index.tsx index f15e2a108a82c..1d631fa15a371 100644 --- a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/tabs/callouts/custom_callout/index.tsx +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/index_check_fields/tabs/callouts/custom_callout/index.tsx @@ -9,9 +9,9 @@ import { EcsVersion } from '@elastic/ecs'; import { EuiCallOut, EuiSpacer } from '@elastic/eui'; import React from 'react'; -import type { CustomFieldMetadata } from '../../../../types'; +import type { CustomFieldMetadata } from '../../../../../../../../../types'; -import * as i18n from '../../../index_properties/translations'; +import * as i18n from '../../../../translations'; interface Props { customFieldMetadata: CustomFieldMetadata[]; diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/tabs/callouts/incompatible_callout/index.test.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/index_check_fields/tabs/callouts/incompatible_callout/index.test.tsx similarity index 92% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/tabs/callouts/incompatible_callout/index.test.tsx rename to x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/index_check_fields/tabs/callouts/incompatible_callout/index.test.tsx index 7e1d1f9eb3c02..ffb315c266669 100644 --- a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/tabs/callouts/incompatible_callout/index.test.tsx +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/index_check_fields/tabs/callouts/incompatible_callout/index.test.tsx @@ -13,8 +13,8 @@ import { DETECTION_ENGINE_RULES_MAY_NOT_MATCH, MAPPINGS_THAT_CONFLICT_WITH_ECS, PAGES_MAY_NOT_DISPLAY_EVENTS, -} from '../../../index_properties/translations'; -import { TestExternalProviders } from '../../../../mock/test_providers/test_providers'; +} from '../../../../translations'; +import { TestExternalProviders } from '../../../../../../../../../mock/test_providers/test_providers'; import { IncompatibleCallout } from '.'; describe('IncompatibleCallout', () => { diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/tabs/callouts/incompatible_callout/index.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/index_check_fields/tabs/callouts/incompatible_callout/index.tsx similarity index 95% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/tabs/callouts/incompatible_callout/index.tsx rename to x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/index_check_fields/tabs/callouts/incompatible_callout/index.tsx index 6a692e05f8e54..41a69eb69424a 100644 --- a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/tabs/callouts/incompatible_callout/index.tsx +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/index_check_fields/tabs/callouts/incompatible_callout/index.tsx @@ -10,7 +10,7 @@ import { EcsVersion } from '@elastic/ecs'; import { EuiCallOut, EuiSpacer } from '@elastic/eui'; import React from 'react'; -import * as i18n from '../../../index_properties/translations'; +import * as i18n from '../../../../translations'; import { CalloutItem } from '../../styles'; const IncompatibleCalloutComponent: React.FC = () => { diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/tabs/callouts/missing_timestamp_callout/index.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/index_check_fields/tabs/callouts/missing_timestamp_callout/index.tsx similarity index 94% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/tabs/callouts/missing_timestamp_callout/index.tsx rename to x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/index_check_fields/tabs/callouts/missing_timestamp_callout/index.tsx index 1db9e3cb6a494..3e9b1f705d1eb 100644 --- a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/tabs/callouts/missing_timestamp_callout/index.tsx +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/index_check_fields/tabs/callouts/missing_timestamp_callout/index.tsx @@ -8,7 +8,7 @@ import { EuiCallOut, EuiSpacer } from '@elastic/eui'; import React from 'react'; -import * as i18n from '../../../index_properties/translations'; +import * as i18n from '../../../../translations'; import { CalloutItem } from '../../styles'; interface Props { diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/tabs/callouts/same_family_callout/index.test.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/index_check_fields/tabs/callouts/same_family_callout/index.test.tsx similarity index 82% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/tabs/callouts/same_family_callout/index.test.tsx rename to x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/index_check_fields/tabs/callouts/same_family_callout/index.test.tsx index d93b5dab41201..39289f1a9294f 100644 --- a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/tabs/callouts/same_family_callout/index.test.tsx +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/index_check_fields/tabs/callouts/same_family_callout/index.test.tsx @@ -9,10 +9,10 @@ import { EcsVersion } from '@elastic/ecs'; import { render, screen } from '@testing-library/react'; import React from 'react'; -import { FIELDS_WITH_MAPPINGS_SAME_FAMILY } from '../../../index_properties/translations'; -import { TestExternalProviders } from '../../../../mock/test_providers/test_providers'; +import { FIELDS_WITH_MAPPINGS_SAME_FAMILY } from '../../../../translations'; +import { TestExternalProviders } from '../../../../../../../../../mock/test_providers/test_providers'; import { SameFamilyCallout } from '.'; -import { mockPartitionedFieldMetadataWithSameFamily } from '../../../../mock/partitioned_field_metadata/mock_partitioned_field_metadata_with_same_family'; +import { mockPartitionedFieldMetadataWithSameFamily } from '../../../../../../../../../mock/partitioned_field_metadata/mock_partitioned_field_metadata_with_same_family'; describe('SameFamilyCallout', () => { beforeEach(() => { diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/tabs/callouts/same_family_callout/index.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/index_check_fields/tabs/callouts/same_family_callout/index.tsx similarity index 89% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/tabs/callouts/same_family_callout/index.tsx rename to x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/index_check_fields/tabs/callouts/same_family_callout/index.tsx index f89ebdda19889..ba7bab71f228d 100644 --- a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/tabs/callouts/same_family_callout/index.tsx +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/index_check_fields/tabs/callouts/same_family_callout/index.tsx @@ -9,8 +9,8 @@ import { EcsVersion } from '@elastic/ecs'; import { EuiCallOut, EuiSpacer, EuiText } from '@elastic/eui'; import React from 'react'; -import * as i18n from '../../../index_properties/translations'; -import type { EcsBasedFieldMetadata } from '../../../../types'; +import * as i18n from '../../../../translations'; +import type { EcsBasedFieldMetadata } from '../../../../../../../../../types'; interface Props { ecsBasedFieldMetadata: EcsBasedFieldMetadata[]; diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/compare_fields_table/ecs_allowed_values/index.test.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/index_check_fields/tabs/compare_fields_table/ecs_allowed_values/index.test.tsx similarity index 88% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/compare_fields_table/ecs_allowed_values/index.test.tsx rename to x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/index_check_fields/tabs/compare_fields_table/ecs_allowed_values/index.test.tsx index 97b633eff4a64..da16307b9a23b 100644 --- a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/compare_fields_table/ecs_allowed_values/index.test.tsx +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/index_check_fields/tabs/compare_fields_table/ecs_allowed_values/index.test.tsx @@ -8,8 +8,8 @@ import { render, screen } from '@testing-library/react'; import React from 'react'; -import { mockAllowedValues } from '../../mock/allowed_values/mock_allowed_values'; -import { TestExternalProviders } from '../../mock/test_providers/test_providers'; +import { mockAllowedValues } from '../../../../../../../../../mock/allowed_values/mock_allowed_values'; +import { TestExternalProviders } from '../../../../../../../../../mock/test_providers/test_providers'; import { EcsAllowedValues } from '.'; describe('EcsAllowedValues', () => { diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/compare_fields_table/ecs_allowed_values/index.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/index_check_fields/tabs/compare_fields_table/ecs_allowed_values/index.tsx similarity index 89% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/compare_fields_table/ecs_allowed_values/index.tsx rename to x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/index_check_fields/tabs/compare_fields_table/ecs_allowed_values/index.tsx index 8f63047bb91e1..07197641c9788 100644 --- a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/compare_fields_table/ecs_allowed_values/index.tsx +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/index_check_fields/tabs/compare_fields_table/ecs_allowed_values/index.tsx @@ -9,8 +9,8 @@ import { EuiCode, EuiFlexGroup, EuiFlexItem } from '@elastic/eui'; import React from 'react'; import { EMPTY_PLACEHOLDER } from '../helpers'; -import { CodeSuccess } from '../../styles'; -import type { AllowedValue } from '../../types'; +import { CodeSuccess } from '../../../../../../../../../styles'; +import type { AllowedValue } from '../../../../../../../../../types'; interface Props { allowedValues: AllowedValue[] | undefined; diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/compare_fields_table/get_common_table_columns/index.test.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/index_check_fields/tabs/compare_fields_table/get_common_table_columns/index.test.tsx similarity index 96% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/compare_fields_table/get_common_table_columns/index.test.tsx rename to x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/index_check_fields/tabs/compare_fields_table/get_common_table_columns/index.test.tsx index 1695f2587a674..6a7f522aa803f 100644 --- a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/compare_fields_table/get_common_table_columns/index.test.tsx +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/index_check_fields/tabs/compare_fields_table/get_common_table_columns/index.test.tsx @@ -9,13 +9,13 @@ import { render, screen } from '@testing-library/react'; import { omit } from 'lodash/fp'; import React from 'react'; -import { SAME_FAMILY } from '../../data_quality_panel/same_family/translations'; +import { SAME_FAMILY } from '../same_family/translations'; import { eventCategory, someField, eventCategoryWithUnallowedValues, -} from '../../mock/enriched_field_metadata/mock_enriched_field_metadata'; -import { TestExternalProviders } from '../../mock/test_providers/test_providers'; +} from '../../../../../../../../../mock/enriched_field_metadata/mock_enriched_field_metadata'; +import { TestExternalProviders } from '../../../../../../../../../mock/test_providers/test_providers'; import { DOCUMENT_VALUES_ACTUAL, ECS_DESCRIPTION, @@ -24,7 +24,7 @@ import { FIELD, INDEX_MAPPING_TYPE_ACTUAL, } from '../translations'; -import { EnrichedFieldMetadata } from '../../types'; +import { EnrichedFieldMetadata } from '../../../../../../../../../types'; import { EMPTY_PLACEHOLDER, getCommonTableColumns } from '.'; describe('getCommonTableColumns', () => { diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/compare_fields_table/get_common_table_columns/index.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/index_check_fields/tabs/compare_fields_table/get_common_table_columns/index.tsx similarity index 90% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/compare_fields_table/get_common_table_columns/index.tsx rename to x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/index_check_fields/tabs/compare_fields_table/get_common_table_columns/index.tsx index 61762d6fc8182..d4194790589db 100644 --- a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/compare_fields_table/get_common_table_columns/index.tsx +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/index_check_fields/tabs/compare_fields_table/get_common_table_columns/index.tsx @@ -9,13 +9,17 @@ import type { EuiTableFieldDataColumnType } from '@elastic/eui'; import { EuiCode } from '@elastic/eui'; import React from 'react'; -import { SameFamily } from '../../data_quality_panel/same_family'; +import { SameFamily } from '../same_family'; import { EcsAllowedValues } from '../ecs_allowed_values'; -import { getIsInSameFamily } from '../../helpers'; +import { getIsInSameFamily } from '../../../../../../../../../helpers'; import { IndexInvalidValues } from '../index_invalid_values'; -import { CodeDanger, CodeSuccess } from '../../styles'; +import { CodeDanger, CodeSuccess } from '../../../../../../../../../styles'; import * as i18n from '../translations'; -import type { AllowedValue, EnrichedFieldMetadata, UnallowedValueCount } from '../../types'; +import type { + AllowedValue, + EnrichedFieldMetadata, + UnallowedValueCount, +} from '../../../../../../../../../types'; export const EMPTY_PLACEHOLDER = '--'; diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/compare_fields_table/get_incompatible_mappings_table_columns/index.test.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/index_check_fields/tabs/compare_fields_table/get_incompatible_mappings_table_columns/index.test.tsx similarity index 92% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/compare_fields_table/get_incompatible_mappings_table_columns/index.test.tsx rename to x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/index_check_fields/tabs/compare_fields_table/get_incompatible_mappings_table_columns/index.test.tsx index 8a9272a717217..588affcfdbf21 100644 --- a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/compare_fields_table/get_incompatible_mappings_table_columns/index.test.tsx +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/index_check_fields/tabs/compare_fields_table/get_incompatible_mappings_table_columns/index.test.tsx @@ -9,10 +9,10 @@ import { render, screen } from '@testing-library/react'; import { omit } from 'lodash/fp'; import React from 'react'; -import { SAME_FAMILY } from '../../data_quality_panel/same_family/translations'; -import { TestExternalProviders } from '../../mock/test_providers/test_providers'; -import { eventCategory } from '../../mock/enriched_field_metadata/mock_enriched_field_metadata'; -import { EcsBasedFieldMetadata } from '../../types'; +import { SAME_FAMILY } from '../same_family/translations'; +import { TestExternalProviders } from '../../../../../../../../../mock/test_providers/test_providers'; +import { eventCategory } from '../../../../../../../../../mock/enriched_field_metadata/mock_enriched_field_metadata'; +import { EcsBasedFieldMetadata } from '../../../../../../../../../types'; import { getIncompatibleMappingsTableColumns } from '.'; describe('getIncompatibleMappingsTableColumns', () => { diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/compare_fields_table/get_incompatible_mappings_table_columns/index.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/index_check_fields/tabs/compare_fields_table/get_incompatible_mappings_table_columns/index.tsx similarity index 88% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/compare_fields_table/get_incompatible_mappings_table_columns/index.tsx rename to x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/index_check_fields/tabs/compare_fields_table/get_incompatible_mappings_table_columns/index.tsx index 4592e22565d74..ba2e3e2035f68 100644 --- a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/compare_fields_table/get_incompatible_mappings_table_columns/index.tsx +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/index_check_fields/tabs/compare_fields_table/get_incompatible_mappings_table_columns/index.tsx @@ -8,10 +8,10 @@ import type { EuiTableFieldDataColumnType } from '@elastic/eui'; import React from 'react'; -import { SameFamily } from '../../data_quality_panel/same_family'; -import { CodeDanger, CodeSuccess } from '../../styles'; +import { SameFamily } from '../same_family'; +import { CodeDanger, CodeSuccess } from '../../../../../../../../../styles'; import * as i18n from '../translations'; -import type { EcsBasedFieldMetadata } from '../../types'; +import type { EcsBasedFieldMetadata } from '../../../../../../../../../types'; export const EMPTY_PLACEHOLDER = '--'; diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/compare_fields_table/helpers.test.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/index_check_fields/tabs/compare_fields_table/helpers.test.tsx similarity index 98% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/compare_fields_table/helpers.test.tsx rename to x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/index_check_fields/tabs/compare_fields_table/helpers.test.tsx index 2bb1e72c8ac6a..8bf2861402c73 100644 --- a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/compare_fields_table/helpers.test.tsx +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/index_check_fields/tabs/compare_fields_table/helpers.test.tsx @@ -18,8 +18,8 @@ import { eventCategory, eventCategoryWithUnallowedValues, someField, -} from '../mock/enriched_field_metadata/mock_enriched_field_metadata'; -import { TestExternalProviders } from '../mock/test_providers/test_providers'; +} from '../../../../../../../../mock/enriched_field_metadata/mock_enriched_field_metadata'; +import { TestExternalProviders } from '../../../../../../../../mock/test_providers/test_providers'; describe('helpers', () => { describe('getCustomTableColumns', () => { diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/compare_fields_table/helpers.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/index_check_fields/tabs/compare_fields_table/helpers.tsx similarity index 96% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/compare_fields_table/helpers.tsx rename to x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/index_check_fields/tabs/compare_fields_table/helpers.tsx index 2563ced06733c..26e3a038b1ffe 100644 --- a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/compare_fields_table/helpers.tsx +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/index_check_fields/tabs/compare_fields_table/helpers.tsx @@ -11,14 +11,14 @@ import React from 'react'; import { EcsAllowedValues } from './ecs_allowed_values'; import { IndexInvalidValues } from './index_invalid_values'; -import { CodeSuccess } from '../styles'; +import { CodeSuccess } from '../../../../../../../../styles'; import * as i18n from './translations'; import type { AllowedValue, CustomFieldMetadata, EcsBasedFieldMetadata, UnallowedValueCount, -} from '../types'; +} from '../../../../../../../../types'; export const EMPTY_PLACEHOLDER = '--'; diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/compare_fields_table/index.test.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/index_check_fields/tabs/compare_fields_table/index.test.tsx similarity index 79% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/compare_fields_table/index.test.tsx rename to x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/index_check_fields/tabs/compare_fields_table/index.test.tsx index f1dcced85619f..e7344dad4d55e 100644 --- a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/compare_fields_table/index.test.tsx +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/index_check_fields/tabs/compare_fields_table/index.test.tsx @@ -8,9 +8,9 @@ import { render, screen } from '@testing-library/react'; import React from 'react'; -import { INCOMPATIBLE_FIELD_MAPPINGS_TABLE_TITLE } from '../data_quality_panel/tabs/incompatible_tab/translations'; -import { eventCategory } from '../mock/enriched_field_metadata/mock_enriched_field_metadata'; -import { TestExternalProviders } from '../mock/test_providers/test_providers'; +import { INCOMPATIBLE_FIELD_MAPPINGS_TABLE_TITLE } from '../incompatible_tab/translations'; +import { eventCategory } from '../../../../../../../../mock/enriched_field_metadata/mock_enriched_field_metadata'; +import { TestExternalProviders } from '../../../../../../../../mock/test_providers/test_providers'; import { CompareFieldsTable } from '.'; import { getIncompatibleMappingsTableColumns } from './get_incompatible_mappings_table_columns'; diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/compare_fields_table/index.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/index_check_fields/tabs/compare_fields_table/index.tsx similarity index 95% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/compare_fields_table/index.tsx rename to x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/index_check_fields/tabs/compare_fields_table/index.tsx index 460663fb28790..8874bd8594866 100644 --- a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/compare_fields_table/index.tsx +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/index_check_fields/tabs/compare_fields_table/index.tsx @@ -10,7 +10,7 @@ import { EuiInMemoryTable, EuiTitle, EuiSpacer } from '@elastic/eui'; import React, { useMemo } from 'react'; import * as i18n from './translations'; -import type { EnrichedFieldMetadata } from '../types'; +import type { EnrichedFieldMetadata } from '../../../../../../../../types'; const search: Search = { box: { diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/compare_fields_table/index_invalid_values/index.test.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/index_check_fields/tabs/compare_fields_table/index_invalid_values/index.test.tsx similarity index 88% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/compare_fields_table/index_invalid_values/index.test.tsx rename to x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/index_check_fields/tabs/compare_fields_table/index_invalid_values/index.test.tsx index 719c94bd85d58..8a53f4cdaf546 100644 --- a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/compare_fields_table/index_invalid_values/index.test.tsx +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/index_check_fields/tabs/compare_fields_table/index_invalid_values/index.test.tsx @@ -9,8 +9,8 @@ import { render, screen } from '@testing-library/react'; import React from 'react'; import { EMPTY_PLACEHOLDER } from '../helpers'; -import { TestExternalProviders } from '../../mock/test_providers/test_providers'; -import { UnallowedValueCount } from '../../types'; +import { TestExternalProviders } from '../../../../../../../../../mock/test_providers/test_providers'; +import { UnallowedValueCount } from '../../../../../../../../../types'; import { IndexInvalidValues } from '.'; describe('IndexInvalidValues', () => { diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/compare_fields_table/index_invalid_values/index.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/index_check_fields/tabs/compare_fields_table/index_invalid_values/index.tsx similarity index 91% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/compare_fields_table/index_invalid_values/index.tsx rename to x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/index_check_fields/tabs/compare_fields_table/index_invalid_values/index.tsx index 2b58ea98b8b28..7f83876423ba9 100644 --- a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/compare_fields_table/index_invalid_values/index.tsx +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/index_check_fields/tabs/compare_fields_table/index_invalid_values/index.tsx @@ -10,8 +10,8 @@ import React from 'react'; import styled from 'styled-components'; import { EMPTY_PLACEHOLDER } from '../helpers'; -import { CodeDanger } from '../../styles'; -import type { UnallowedValueCount } from '../../types'; +import { CodeDanger } from '../../../../../../../../../styles'; +import type { UnallowedValueCount } from '../../../../../../../../../types'; const IndexInvalidValueFlexItem = styled(EuiFlexItem)` margin-bottom: ${({ theme }) => theme.eui.euiSizeXS}; diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/same_family/index.test.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/index_check_fields/tabs/compare_fields_table/same_family/index.test.tsx similarity index 87% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/same_family/index.test.tsx rename to x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/index_check_fields/tabs/compare_fields_table/same_family/index.test.tsx index d1bea1a3312b3..58889ad1edb2e 100644 --- a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/same_family/index.test.tsx +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/index_check_fields/tabs/compare_fields_table/same_family/index.test.tsx @@ -9,7 +9,7 @@ import { render, screen } from '@testing-library/react'; import React from 'react'; import { SAME_FAMILY } from './translations'; -import { TestExternalProviders } from '../../mock/test_providers/test_providers'; +import { TestExternalProviders } from '../../../../../../../../../mock/test_providers/test_providers'; import { SameFamily } from '.'; describe('SameFamily', () => { diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/same_family/index.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/index_check_fields/tabs/compare_fields_table/same_family/index.tsx similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/same_family/index.tsx rename to x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/index_check_fields/tabs/compare_fields_table/same_family/index.tsx diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/same_family/translations.ts b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/index_check_fields/tabs/compare_fields_table/same_family/translations.ts similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/same_family/translations.ts rename to x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/index_check_fields/tabs/compare_fields_table/same_family/translations.ts diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/compare_fields_table/translations.ts b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/index_check_fields/tabs/compare_fields_table/translations.ts similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/compare_fields_table/translations.ts rename to x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/index_check_fields/tabs/compare_fields_table/translations.ts diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/tabs/custom_tab/helpers.test.ts b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/index_check_fields/tabs/custom_tab/helpers.test.ts similarity index 94% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/tabs/custom_tab/helpers.test.ts rename to x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/index_check_fields/tabs/custom_tab/helpers.test.ts index 424664c314832..1813db953f8a7 100644 --- a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/tabs/custom_tab/helpers.test.ts +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/index_check_fields/tabs/custom_tab/helpers.test.ts @@ -8,7 +8,7 @@ import numeral from '@elastic/numeral'; import { EcsVersion } from '@elastic/ecs'; -import { ECS_IS_A_PERMISSIVE_SCHEMA } from '../../index_properties/translations'; +import { ECS_IS_A_PERMISSIVE_SCHEMA } from '../../../translations'; import { getAllCustomMarkdownComments, getCustomMarkdownComment, @@ -17,9 +17,9 @@ import { import { hostNameKeyword, someField, -} from '../../../mock/enriched_field_metadata/mock_enriched_field_metadata'; -import { mockPartitionedFieldMetadata } from '../../../mock/partitioned_field_metadata/mock_partitioned_field_metadata'; -import { EMPTY_STAT } from '../../../helpers'; +} from '../../../../../../../../mock/enriched_field_metadata/mock_enriched_field_metadata'; +import { mockPartitionedFieldMetadata } from '../../../../../../../../mock/partitioned_field_metadata/mock_partitioned_field_metadata'; +import { EMPTY_STAT } from '../../../../../../../../helpers'; const defaultBytesFormat = '0,0.[0]b'; const formatBytes = (value: number | undefined) => diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/tabs/custom_tab/helpers.ts b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/index_check_fields/tabs/custom_tab/helpers.ts similarity index 88% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/tabs/custom_tab/helpers.ts rename to x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/index_check_fields/tabs/custom_tab/helpers.ts index 55cb4898b7951..4ccebaefaa180 100644 --- a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/tabs/custom_tab/helpers.ts +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/index_check_fields/tabs/custom_tab/helpers.ts @@ -7,7 +7,7 @@ import { EcsVersion } from '@elastic/ecs'; -import { FIELD, INDEX_MAPPING_TYPE } from '../../../compare_fields_table/translations'; +import { FIELD, INDEX_MAPPING_TYPE } from '../compare_fields_table/translations'; import { getSummaryMarkdownComment, getCustomMarkdownTableRows, @@ -15,9 +15,13 @@ import { getMarkdownTable, getTabCountsMarkdownComment, getSummaryTableMarkdownComment, -} from '../../index_properties/markdown/helpers'; -import * as i18n from '../../index_properties/translations'; -import type { CustomFieldMetadata, IlmPhase, PartitionedFieldMetadata } from '../../../types'; +} from '../../../markdown/helpers'; +import * as i18n from '../../../translations'; +import type { + CustomFieldMetadata, + IlmPhase, + PartitionedFieldMetadata, +} from '../../../../../../../../types'; export const getCustomMarkdownComment = ({ customFieldMetadata, diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/tabs/custom_tab/index.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/index_check_fields/tabs/custom_tab/index.tsx similarity index 85% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/tabs/custom_tab/index.tsx rename to x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/index_check_fields/tabs/custom_tab/index.tsx index 8c786216bc55a..2d7437e8f0638 100644 --- a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/tabs/custom_tab/index.tsx +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/index_check_fields/tabs/custom_tab/index.tsx @@ -9,14 +9,14 @@ import { EuiEmptyPrompt, EuiSpacer } from '@elastic/eui'; import React, { useMemo } from 'react'; import { CustomCallout } from '../callouts/custom_callout'; -import { CompareFieldsTable } from '../../../compare_fields_table'; -import { getCustomTableColumns } from '../../../compare_fields_table/helpers'; -import { EmptyPromptBody } from '../../index_properties/empty_prompt_body'; -import { EmptyPromptTitle } from '../../index_properties/empty_prompt_title'; +import { CompareFieldsTable } from '../compare_fields_table'; +import { getCustomTableColumns } from '../compare_fields_table/helpers'; +import { EmptyPromptBody } from '../../../empty_prompt_body'; +import { EmptyPromptTitle } from '../../../empty_prompt_title'; import { getAllCustomMarkdownComments, showCustomCallout } from './helpers'; -import * as i18n from '../../index_properties/translations'; -import type { IlmPhase, PartitionedFieldMetadata } from '../../../types'; -import { useDataQualityContext } from '../../data_quality_context'; +import * as i18n from '../../../translations'; +import type { IlmPhase, PartitionedFieldMetadata } from '../../../../../../../../types'; +import { useDataQualityContext } from '../../../../../../../../data_quality_context'; import { StickyActions } from '../sticky_actions'; interface Props { diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/tabs/ecs_compliant_tab/index.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/index_check_fields/tabs/ecs_compliant_tab/index.tsx similarity index 85% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/tabs/ecs_compliant_tab/index.tsx rename to x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/index_check_fields/tabs/ecs_compliant_tab/index.tsx index 39b932cd88e40..7455ae3f482b9 100644 --- a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/tabs/ecs_compliant_tab/index.tsx +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/index_check_fields/tabs/ecs_compliant_tab/index.tsx @@ -11,14 +11,14 @@ import { EuiCallOut, EuiEmptyPrompt, EuiSpacer } from '@elastic/eui'; import React, { useMemo } from 'react'; import styled from 'styled-components'; -import { CompareFieldsTable } from '../../../compare_fields_table'; -import { getEcsCompliantTableColumns } from '../../../compare_fields_table/helpers'; -import { EmptyPromptBody } from '../../index_properties/empty_prompt_body'; -import { EmptyPromptTitle } from '../../index_properties/empty_prompt_title'; +import { CompareFieldsTable } from '../compare_fields_table'; +import { getEcsCompliantTableColumns } from '../compare_fields_table/helpers'; +import { EmptyPromptBody } from '../../../empty_prompt_body'; +import { EmptyPromptTitle } from '../../../empty_prompt_title'; import { showMissingTimestampCallout } from '../helpers'; import { CalloutItem } from '../styles'; -import * as i18n from '../../index_properties/translations'; -import type { PartitionedFieldMetadata } from '../../../types'; +import * as i18n from '../../../translations'; +import type { PartitionedFieldMetadata } from '../../../../../../../../types'; const EmptyPromptContainer = styled.div` width: 100%; diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/tabs/helpers.test.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/index_check_fields/tabs/helpers.test.tsx similarity index 90% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/tabs/helpers.test.tsx rename to x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/index_check_fields/tabs/helpers.test.tsx index 3891a3d661561..4c30702fcef36 100644 --- a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/tabs/helpers.test.tsx +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/index_check_fields/tabs/helpers.test.tsx @@ -10,9 +10,9 @@ import { omit } from 'lodash/fp'; import { eventCategory, timestamp, -} from '../../mock/enriched_field_metadata/mock_enriched_field_metadata'; -import { mockPartitionedFieldMetadata } from '../../mock/partitioned_field_metadata/mock_partitioned_field_metadata'; -import { mockStatsAuditbeatIndex } from '../../mock/stats/mock_stats_packetbeat_index'; +} from '../../../../../../../mock/enriched_field_metadata/mock_enriched_field_metadata'; +import { mockPartitionedFieldMetadata } from '../../../../../../../mock/partitioned_field_metadata/mock_partitioned_field_metadata'; +import { mockStatsAuditbeatIndex } from '../../../../../../../mock/stats/mock_stats_packetbeat_index'; import { getEcsCompliantBadgeColor, getMissingTimestampComment, diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/tabs/helpers.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/index_check_fields/tabs/helpers.tsx similarity index 95% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/tabs/helpers.tsx rename to x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/index_check_fields/tabs/helpers.tsx index 5220522350b07..6db808d312d13 100644 --- a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/tabs/helpers.tsx +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/index_check_fields/tabs/helpers.tsx @@ -12,7 +12,7 @@ import styled from 'styled-components'; import { AllTab } from './all_tab'; import { CustomTab } from './custom_tab'; import { EcsCompliantTab } from './ecs_compliant_tab'; -import { getIncompatibleStatBadgeColor, getSizeInBytes } from '../../helpers'; +import { getIncompatibleStatBadgeColor, getSizeInBytes } from '../../../../../../../helpers'; import { IncompatibleTab } from './incompatible_tab'; import { ALL_TAB_ID, @@ -20,16 +20,16 @@ import { ECS_COMPLIANT_TAB_ID, INCOMPATIBLE_TAB_ID, SAME_FAMILY_TAB_ID, -} from '../index_properties/helpers'; -import { getMarkdownComment } from '../index_properties/markdown/helpers'; -import * as i18n from '../index_properties/translations'; +} from '../../helpers'; +import { getMarkdownComment } from '../../markdown/helpers'; +import * as i18n from '../../translations'; import { SameFamilyTab } from './same_family_tab'; import type { EcsBasedFieldMetadata, IlmPhase, MeteringStatsIndex, PartitionedFieldMetadata, -} from '../../types'; +} from '../../../../../../../types'; export const getMissingTimestampComment = (): string => getMarkdownComment({ diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/tabs/incompatible_tab/helpers.test.ts b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/index_check_fields/tabs/incompatible_tab/helpers.test.ts similarity index 98% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/tabs/incompatible_tab/helpers.test.ts rename to x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/index_check_fields/tabs/incompatible_tab/helpers.test.ts index 9851da18072a7..e4ee7eb3fdb99 100644 --- a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/tabs/incompatible_tab/helpers.test.ts +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/index_check_fields/tabs/incompatible_tab/helpers.test.ts @@ -18,14 +18,14 @@ import { getIncompatibleValuesFields, showInvalidCallout, } from './helpers'; -import { EMPTY_STAT } from '../../../helpers'; +import { EMPTY_STAT } from '../../../../../../../../helpers'; import { DETECTION_ENGINE_RULES_MAY_NOT_MATCH, MAPPINGS_THAT_CONFLICT_WITH_ECS, PAGES_MAY_NOT_DISPLAY_EVENTS, -} from '../../index_properties/translations'; -import { mockPartitionedFieldMetadata } from '../../../mock/partitioned_field_metadata/mock_partitioned_field_metadata'; -import { PartitionedFieldMetadata } from '../../../types'; +} from '../../../translations'; +import { mockPartitionedFieldMetadata } from '../../../../../../../../mock/partitioned_field_metadata/mock_partitioned_field_metadata'; +import { PartitionedFieldMetadata } from '../../../../../../../../types'; describe('helpers', () => { describe('getIncompatibleFieldsMarkdownComment', () => { diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/tabs/incompatible_tab/helpers.ts b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/index_check_fields/tabs/incompatible_tab/helpers.ts similarity index 94% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/tabs/incompatible_tab/helpers.ts rename to x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/index_check_fields/tabs/incompatible_tab/helpers.ts index c4c6dfd4a2a82..957cf6fcb5344 100644 --- a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/tabs/incompatible_tab/helpers.ts +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/index_check_fields/tabs/incompatible_tab/helpers.ts @@ -16,9 +16,13 @@ import { getSummaryTableMarkdownComment, getTabCountsMarkdownComment, escape, -} from '../../index_properties/markdown/helpers'; -import * as i18n from '../../index_properties/translations'; -import type { EcsBasedFieldMetadata, IlmPhase, PartitionedFieldMetadata } from '../../../types'; +} from '../../../markdown/helpers'; +import * as i18n from '../../../translations'; +import type { + EcsBasedFieldMetadata, + IlmPhase, + PartitionedFieldMetadata, +} from '../../../../../../../../types'; import { INCOMPATIBLE_FIELD_MAPPINGS_TABLE_TITLE, INCOMPATIBLE_FIELD_VALUES_TABLE_TITLE, @@ -29,8 +33,8 @@ import { INDEX_MAPPING_TYPE_ACTUAL, DOCUMENT_VALUES_ACTUAL, ECS_VALUES_EXPECTED, -} from '../../../compare_fields_table/translations'; -import { getIsInSameFamily } from '../../../helpers'; +} from '../compare_fields_table/translations'; +import { getIsInSameFamily } from '../../../../../../../../helpers'; export const getIncompatibleFieldsMarkdownComment = (incompatible: number): string => getMarkdownComment({ diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/tabs/incompatible_tab/index.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/index_check_fields/tabs/incompatible_tab/index.tsx similarity index 87% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/tabs/incompatible_tab/index.tsx rename to x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/index_check_fields/tabs/incompatible_tab/index.tsx index 52559b3d5116c..d24e82192291f 100644 --- a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/tabs/incompatible_tab/index.tsx +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/index_check_fields/tabs/incompatible_tab/index.tsx @@ -9,24 +9,24 @@ import { EuiEmptyPrompt, EuiSpacer } from '@elastic/eui'; import React, { useMemo } from 'react'; import { IncompatibleCallout } from '../callouts/incompatible_callout'; -import { CompareFieldsTable } from '../../../compare_fields_table'; -import { getIncompatibleMappingsTableColumns } from '../../../compare_fields_table/get_incompatible_mappings_table_columns'; -import { getIncompatibleValuesTableColumns } from '../../../compare_fields_table/helpers'; -import { EmptyPromptBody } from '../../index_properties/empty_prompt_body'; -import { EmptyPromptTitle } from '../../index_properties/empty_prompt_title'; +import { CompareFieldsTable } from '../compare_fields_table'; +import { getIncompatibleMappingsTableColumns } from '../compare_fields_table/get_incompatible_mappings_table_columns'; +import { getIncompatibleValuesTableColumns } from '../compare_fields_table/helpers'; +import { EmptyPromptBody } from '../../../empty_prompt_body'; +import { EmptyPromptTitle } from '../../../empty_prompt_title'; import { getAllIncompatibleMarkdownComments, getIncompatibleMappings, getIncompatibleValues, showInvalidCallout, } from './helpers'; -import * as i18n from '../../index_properties/translations'; +import * as i18n from '../../../translations'; import { INCOMPATIBLE_FIELD_MAPPINGS_TABLE_TITLE, INCOMPATIBLE_FIELD_VALUES_TABLE_TITLE, } from './translations'; -import type { IlmPhase, PartitionedFieldMetadata } from '../../../types'; -import { useDataQualityContext } from '../../data_quality_context'; +import type { IlmPhase, PartitionedFieldMetadata } from '../../../../../../../../types'; +import { useDataQualityContext } from '../../../../../../../../data_quality_context'; import { StickyActions } from '../sticky_actions'; interface Props { diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/tabs/incompatible_tab/translations.ts b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/index_check_fields/tabs/incompatible_tab/translations.ts similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/tabs/incompatible_tab/translations.ts rename to x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/index_check_fields/tabs/incompatible_tab/translations.ts diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/tabs/same_family_tab/helpers.test.ts b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/index_check_fields/tabs/same_family_tab/helpers.test.ts similarity index 95% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/tabs/same_family_tab/helpers.test.ts rename to x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/index_check_fields/tabs/same_family_tab/helpers.test.ts index 0af79eda5e312..d5f7101cc8acf 100644 --- a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/tabs/same_family_tab/helpers.test.ts +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/index_check_fields/tabs/same_family_tab/helpers.test.ts @@ -13,9 +13,9 @@ import { getSameFamilyMarkdownComment, getSameFamilyMarkdownTablesComment, } from './helpers'; -import { EMPTY_STAT } from '../../../helpers'; -import { mockPartitionedFieldMetadata } from '../../../mock/partitioned_field_metadata/mock_partitioned_field_metadata'; -import { mockPartitionedFieldMetadataWithSameFamily } from '../../../mock/partitioned_field_metadata/mock_partitioned_field_metadata_with_same_family'; +import { EMPTY_STAT } from '../../../../../../../../helpers'; +import { mockPartitionedFieldMetadata } from '../../../../../../../../mock/partitioned_field_metadata/mock_partitioned_field_metadata'; +import { mockPartitionedFieldMetadataWithSameFamily } from '../../../../../../../../mock/partitioned_field_metadata/mock_partitioned_field_metadata_with_same_family'; describe('helpers', () => { describe('getSameFamilyMarkdownComment', () => { diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/tabs/same_family_tab/helpers.ts b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/index_check_fields/tabs/same_family_tab/helpers.ts similarity index 92% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/tabs/same_family_tab/helpers.ts rename to x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/index_check_fields/tabs/same_family_tab/helpers.ts index d6c8852bb33bb..3c90cb81a5906 100644 --- a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/tabs/same_family_tab/helpers.ts +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/index_check_fields/tabs/same_family_tab/helpers.ts @@ -11,7 +11,7 @@ import { FIELD, ECS_MAPPING_TYPE_EXPECTED, INDEX_MAPPING_TYPE_ACTUAL, -} from '../../../compare_fields_table/translations'; +} from '../compare_fields_table/translations'; import { getSummaryMarkdownComment, getIncompatibleMappingsMarkdownTableRows, @@ -19,10 +19,14 @@ import { getMarkdownTable, getSummaryTableMarkdownComment, getTabCountsMarkdownComment, -} from '../../index_properties/markdown/helpers'; -import * as i18n from '../../index_properties/translations'; +} from '../../../markdown/helpers'; +import * as i18n from '../../../translations'; import { SAME_FAMILY_FIELD_MAPPINGS_TABLE_TITLE } from './translations'; -import type { EcsBasedFieldMetadata, IlmPhase, PartitionedFieldMetadata } from '../../../types'; +import type { + EcsBasedFieldMetadata, + IlmPhase, + PartitionedFieldMetadata, +} from '../../../../../../../../types'; export const getSameFamilyMarkdownComment = (fieldsInSameFamily: number): string => getMarkdownComment({ diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/tabs/same_family_tab/index.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/index_check_fields/tabs/same_family_tab/index.tsx similarity index 90% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/tabs/same_family_tab/index.tsx rename to x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/index_check_fields/tabs/same_family_tab/index.tsx index 37891a4257a5c..8d91e26a0da09 100644 --- a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/tabs/same_family_tab/index.tsx +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/index_check_fields/tabs/same_family_tab/index.tsx @@ -9,12 +9,12 @@ import { EuiSpacer } from '@elastic/eui'; import React, { useMemo } from 'react'; import { SameFamilyCallout } from '../callouts/same_family_callout'; -import { CompareFieldsTable } from '../../../compare_fields_table'; -import { getIncompatibleMappingsTableColumns } from '../../../compare_fields_table/get_incompatible_mappings_table_columns'; -import { useDataQualityContext } from '../../data_quality_context'; +import { CompareFieldsTable } from '../compare_fields_table'; +import { getIncompatibleMappingsTableColumns } from '../compare_fields_table/get_incompatible_mappings_table_columns'; +import { useDataQualityContext } from '../../../../../../../../data_quality_context'; import { getAllSameFamilyMarkdownComments, getSameFamilyMappings } from './helpers'; import { SAME_FAMILY_FIELD_MAPPINGS_TABLE_TITLE } from './translations'; -import type { IlmPhase, PartitionedFieldMetadata } from '../../../types'; +import type { IlmPhase, PartitionedFieldMetadata } from '../../../../../../../../types'; import { StickyActions } from '../sticky_actions'; interface Props { diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/tabs/same_family_tab/translations.ts b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/index_check_fields/tabs/same_family_tab/translations.ts similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/tabs/same_family_tab/translations.ts rename to x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/index_check_fields/tabs/same_family_tab/translations.ts diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/tabs/sticky_actions/index.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/index_check_fields/tabs/sticky_actions/index.tsx similarity index 96% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/tabs/sticky_actions/index.tsx rename to x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/index_check_fields/tabs/sticky_actions/index.tsx index 57b17a7453dd0..1cd2630e720d1 100644 --- a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/tabs/sticky_actions/index.tsx +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/index_check_fields/tabs/sticky_actions/index.tsx @@ -9,7 +9,7 @@ import React, { FC } from 'react'; import { EuiButtonEmpty } from '@elastic/eui'; import styled from 'styled-components'; -import { Actions } from '../../actions'; +import { Actions } from '../../../../../../../../actions'; export const CopyToClipboardButton = styled(EuiButtonEmpty)` margin-left: ${({ theme }) => theme.eui.euiSizeXS}; diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/tabs/styles.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/index_check_fields/tabs/styles.tsx similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/tabs/styles.tsx rename to x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/index_check_fields/tabs/styles.tsx diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/index_properties/index_stats_panel/index.test.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/index_stats_panel/index.test.tsx similarity index 89% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/index_properties/index_stats_panel/index.test.tsx rename to x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/index_stats_panel/index.test.tsx index f878cd9de4f13..b589eb09e8d12 100644 --- a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/index_properties/index_stats_panel/index.test.tsx +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/index_stats_panel/index.test.tsx @@ -9,7 +9,7 @@ import React from 'react'; import { screen, render } from '@testing-library/react'; import { IndexStatsPanel } from '.'; -import { TestExternalProviders } from '../../../mock/test_providers/test_providers'; +import { TestExternalProviders } from '../../../../../../mock/test_providers/test_providers'; describe('IndexStatsPanel', () => { it('renders stats panel', () => { diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/index_properties/index_stats_panel/index.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/index_stats_panel/index.tsx similarity index 88% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/index_properties/index_stats_panel/index.tsx rename to x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/index_stats_panel/index.tsx index 03b20e8a4ce45..9fb1ca590a266 100644 --- a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/index_properties/index_stats_panel/index.tsx +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/index_stats_panel/index.tsx @@ -8,11 +8,12 @@ import { EuiFlexGroup, EuiFlexItem, EuiPanel, EuiSpacer } from '@elastic/eui'; import React from 'react'; import styled from 'styled-components'; + import { DOCS } from '../translations'; -import { ILM_PHASE } from '../../../translations'; -import { SIZE } from '../../summary_table/translations'; -import { Stat } from '../../pattern/pattern_summary/stats_rollup/stat'; -import { getIlmPhaseDescription } from '../../../helpers'; +import { ILM_PHASE } from '../../../../../../translations'; +import { SIZE } from '../../../summary_table/translations'; +import { Stat } from '../../../../../../stat'; +import { getIlmPhaseDescription } from '../../../../../../helpers'; const StyledFlexItem = styled(EuiFlexItem)` border-right: 1px solid ${({ theme }) => theme.eui.euiBorderColor}; diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/index_properties/markdown/helpers.test.ts b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/markdown/helpers.test.ts similarity index 96% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/index_properties/markdown/helpers.test.ts rename to x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/markdown/helpers.test.ts index 8c14a214cabf3..e63044346bd0d 100644 --- a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/index_properties/markdown/helpers.test.ts +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/markdown/helpers.test.ts @@ -11,9 +11,13 @@ import { ECS_MAPPING_TYPE_EXPECTED, FIELD, INDEX_MAPPING_TYPE_ACTUAL, -} from '../../../compare_fields_table/translations'; -import { ERRORS } from '../../data_quality_summary/errors_popover/translations'; -import { ERROR, INDEX, PATTERN } from '../../data_quality_summary/errors_viewer/translations'; +} from '../index_check_fields/tabs/compare_fields_table/translations'; +import { ERRORS } from '../../../../../../data_quality_summary/summary_actions/check_status/errors_popover/translations'; +import { + ERROR, + INDEX, + PATTERN, +} from '../../../../../../data_quality_summary/summary_actions/check_status/errors_popover/errors_viewer/translations'; import { escape, escapePreserveNewlines, @@ -41,27 +45,27 @@ import { getSummaryTableMarkdownRow, getTabCountsMarkdownComment, } from './helpers'; -import { EMPTY_STAT } from '../../../helpers'; -import { mockAllowedValues } from '../../../mock/allowed_values/mock_allowed_values'; +import { EMPTY_STAT } from '../../../../../../helpers'; +import { mockAllowedValues } from '../../../../../../mock/allowed_values/mock_allowed_values'; import { eventCategory, mockCustomFields, mockIncompatibleMappings, sourceIpWithTextMapping, -} from '../../../mock/enriched_field_metadata/mock_enriched_field_metadata'; -import { mockPartitionedFieldMetadata } from '../../../mock/partitioned_field_metadata/mock_partitioned_field_metadata'; +} from '../../../../../../mock/enriched_field_metadata/mock_enriched_field_metadata'; +import { mockPartitionedFieldMetadata } from '../../../../../../mock/partitioned_field_metadata/mock_partitioned_field_metadata'; import { auditbeatNoResults, auditbeatWithAllResults, -} from '../../../mock/pattern_rollup/mock_auditbeat_pattern_rollup'; -import { SAME_FAMILY } from '../../same_family/translations'; -import { INCOMPATIBLE_FIELD_MAPPINGS_TABLE_TITLE } from '../../tabs/incompatible_tab/translations'; +} from '../../../../../../mock/pattern_rollup/mock_auditbeat_pattern_rollup'; +import { SAME_FAMILY } from '../index_check_fields/tabs/compare_fields_table/same_family/translations'; +import { INCOMPATIBLE_FIELD_MAPPINGS_TABLE_TITLE } from '../index_check_fields/tabs/incompatible_tab/translations'; import { EcsBasedFieldMetadata, ErrorSummary, PatternRollup, UnallowedValueCount, -} from '../../../types'; +} from '../../../../../../types'; const errorSummary: ErrorSummary[] = [ { diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/index_properties/markdown/helpers.ts b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/markdown/helpers.ts similarity index 95% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/index_properties/markdown/helpers.ts rename to x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/markdown/helpers.ts index bdbfdba4ddb35..c8181e14dd685 100644 --- a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/index_properties/markdown/helpers.ts +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/markdown/helpers.ts @@ -14,14 +14,20 @@ import { READ, THE_FOLLOWING_PRIVILEGES_ARE_REQUIRED, VIEW_INDEX_METADATA, -} from '../../data_quality_summary/errors_popover/translations'; +} from '../../../../../../data_quality_summary/summary_actions/check_status/errors_popover/translations'; import { EMPTY_STAT, getTotalPatternIncompatible, getTotalPatternIndicesChecked, -} from '../../../helpers'; -import { SAME_FAMILY } from '../../same_family/translations'; -import { HOT, WARM, COLD, FROZEN, UNMANAGED } from '../../../ilm_phases_empty_prompt/translations'; +} from '../../../../../../helpers'; +import { SAME_FAMILY } from '../index_check_fields/tabs/compare_fields_table/same_family/translations'; +import { + HOT, + WARM, + COLD, + FROZEN, + UNMANAGED, +} from '../../../../../ilm_phases_empty_prompt/translations'; import * as i18n from '../translations'; import type { AllowedValue, @@ -34,8 +40,8 @@ import type { PartitionedFieldMetadata, PatternRollup, UnallowedValueCount, -} from '../../../types'; -import { getDocsCountPercent } from '../../summary_table/helpers'; +} from '../../../../../../types'; +import { getDocsCountPercent } from '../../../summary_table/helpers'; import { DOCS, ILM_PHASE, @@ -45,8 +51,8 @@ import { INDICES_CHECKED, RESULT, SIZE, -} from '../../summary_table/translations'; -import { DATA_QUALITY_TITLE } from '../../../translations'; +} from '../../../summary_table/translations'; +import { DATA_QUALITY_TITLE } from '../../../../../../translations'; export const EMPTY_PLACEHOLDER = '--'; diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/index_properties/translations.ts b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/translations.ts similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/index_properties/translations.ts rename to x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/translations.ts diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/pattern/index_check_flyout/translations.ts b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/translations.ts similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/pattern/index_check_flyout/translations.ts rename to x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/translations.ts diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/index_result_badge/helpers.test.ts b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_result_badge/helpers.test.ts similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/index_result_badge/helpers.test.ts rename to x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_result_badge/helpers.test.ts diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/index_result_badge/helpers.ts b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_result_badge/helpers.ts similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/index_result_badge/helpers.ts rename to x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_result_badge/helpers.ts diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/index_result_badge/index.test.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_result_badge/index.test.tsx similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/index_result_badge/index.test.tsx rename to x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_result_badge/index.test.tsx diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/index_result_badge/index.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_result_badge/index.tsx similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/index_result_badge/index.tsx rename to x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_result_badge/index.tsx diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/index_result_badge/translations.ts b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_result_badge/translations.ts similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/index_result_badge/translations.ts rename to x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_result_badge/translations.ts diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/loading_empty_prompt/index.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/loading_empty_prompt/index.tsx similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/loading_empty_prompt/index.tsx rename to x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/loading_empty_prompt/index.tsx diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/pattern/pattern_summary/index.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/pattern_summary/index.tsx similarity index 92% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/pattern/pattern_summary/index.tsx rename to x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/pattern_summary/index.tsx index c30fd3e7dc4ce..db4d95ba48b4f 100644 --- a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/pattern/pattern_summary/index.tsx +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/pattern_summary/index.tsx @@ -8,9 +8,9 @@ import { EuiFlexGroup, EuiFlexItem } from '@elastic/eui'; import React from 'react'; -import type { IlmExplainPhaseCounts } from '../../../types'; +import type { IlmExplainPhaseCounts } from '../../../../types'; import { PatternLabel } from './pattern_label'; -import { StatsRollup } from './stats_rollup'; +import { StatsRollup } from '../../../../stats_rollup'; interface Props { ilmExplainPhaseCounts: IlmExplainPhaseCounts | undefined; diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/pattern/pattern_summary/pattern_label/helpers.test.ts b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/pattern_summary/pattern_label/helpers.test.ts similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/pattern/pattern_summary/pattern_label/helpers.test.ts rename to x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/pattern_summary/pattern_label/helpers.test.ts diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/pattern/pattern_summary/pattern_label/helpers.ts b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/pattern_summary/pattern_label/helpers.ts similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/pattern/pattern_summary/pattern_label/helpers.ts rename to x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/pattern_summary/pattern_label/helpers.ts diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/ilm_phase_counts/index.test.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/pattern_summary/pattern_label/ilm_phase_counts/index.test.tsx similarity index 93% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/ilm_phase_counts/index.test.tsx rename to x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/pattern_summary/pattern_label/ilm_phase_counts/index.test.tsx index 23031b9210df1..f9e04fc707b01 100644 --- a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/ilm_phase_counts/index.test.tsx +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/pattern_summary/pattern_label/ilm_phase_counts/index.test.tsx @@ -13,9 +13,9 @@ import { import { render, screen } from '@testing-library/react'; import React from 'react'; -import { TestExternalProviders } from '../../mock/test_providers/test_providers'; +import { TestExternalProviders } from '../../../../../../mock/test_providers/test_providers'; import { IlmPhaseCounts } from '.'; -import { getIlmExplainPhaseCounts } from '../pattern/helpers'; +import { getIlmExplainPhaseCounts } from '../../../helpers'; const hot: IlmExplainLifecycleLifecycleExplainManaged = { index: '.ds-packetbeat-8.6.1-2023.02.04-000001', diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/ilm_phase_counts/index.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/pattern_summary/pattern_label/ilm_phase_counts/index.tsx similarity index 90% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/ilm_phase_counts/index.tsx rename to x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/pattern_summary/pattern_label/ilm_phase_counts/index.tsx index b24014bb400e6..e755dbd2df8f1 100644 --- a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/ilm_phase_counts/index.tsx +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/pattern_summary/pattern_label/ilm_phase_counts/index.tsx @@ -9,8 +9,8 @@ import { EuiBadge, EuiFlexGroup, EuiFlexItem, EuiToolTip } from '@elastic/eui'; import React from 'react'; import styled from 'styled-components'; -import { getPatternIlmPhaseDescription } from '../../helpers'; -import type { IlmExplainPhaseCounts, IlmPhase } from '../../types'; +import { getPatternIlmPhaseDescription } from '../../../../../../helpers'; +import type { IlmExplainPhaseCounts, IlmPhase } from '../../../../../../types'; const PhaseCountsFlexGroup = styled(EuiFlexGroup)` display: inline-flex; diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/pattern/pattern_summary/pattern_label/index.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/pattern_summary/pattern_label/index.tsx similarity index 92% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/pattern/pattern_summary/pattern_label/index.tsx rename to x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/pattern_summary/pattern_label/index.tsx index 62ff66a873124..03fede1fb7675 100644 --- a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/pattern/pattern_summary/pattern_label/index.tsx +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/pattern_summary/pattern_label/index.tsx @@ -9,10 +9,10 @@ import { EuiTitle, EuiToolTip, EuiFlexGroup, EuiFlexItem } from '@elastic/eui'; import React from 'react'; import { getPatternResultTooltip, showResult } from './helpers'; -import { IlmPhaseCounts } from '../../../ilm_phase_counts'; +import { IlmPhaseCounts } from './ilm_phase_counts'; import * as i18n from '../translations'; -import type { IlmExplainPhaseCounts } from '../../../../types'; -import { IndexResultBadge } from '../../../index_result_badge'; +import type { IlmExplainPhaseCounts } from '../../../../../types'; +import { IndexResultBadge } from '../../index_result_badge'; interface Props { incompatible: number | undefined; diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/pattern/pattern_summary/pattern_label/translations.ts b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/pattern_summary/pattern_label/translations.ts similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/pattern/pattern_summary/pattern_label/translations.ts rename to x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/pattern_summary/pattern_label/translations.ts diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/pattern/pattern_summary/translations.ts b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/pattern_summary/translations.ts similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/pattern/pattern_summary/translations.ts rename to x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/pattern_summary/translations.ts diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/remote_clusters_callout/index.test.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/remote_clusters_callout/index.test.tsx similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/remote_clusters_callout/index.test.tsx rename to x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/remote_clusters_callout/index.test.tsx diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/remote_clusters_callout/index.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/remote_clusters_callout/index.tsx similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/remote_clusters_callout/index.tsx rename to x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/remote_clusters_callout/index.tsx diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/remote_clusters_callout/translations.ts b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/remote_clusters_callout/translations.ts similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/remote_clusters_callout/translations.ts rename to x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/remote_clusters_callout/translations.ts diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/pattern/styles.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/styles.tsx similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/pattern/styles.tsx rename to x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/styles.tsx diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/summary_table/helpers.test.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/summary_table/helpers.test.tsx similarity index 98% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/summary_table/helpers.test.tsx rename to x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/summary_table/helpers.test.tsx index a4227f0631819..022119e4613e5 100644 --- a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/summary_table/helpers.test.tsx +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/summary_table/helpers.test.tsx @@ -16,8 +16,8 @@ import userEvent from '@testing-library/user-event'; import { omit } from 'lodash/fp'; import React from 'react'; -import { TestExternalProviders } from '../../mock/test_providers/test_providers'; -import { EMPTY_STAT } from '../../helpers'; +import { TestExternalProviders } from '../../../../mock/test_providers/test_providers'; +import { EMPTY_STAT } from '../../../../helpers'; import { getDocsCountPercent, getIncompatibleStatColor, @@ -28,8 +28,8 @@ import { getToggleButtonId, } from './helpers'; import { CHECK_INDEX, VIEW_CHECK_DETAILS } from './translations'; -import { IndexSummaryTableItem } from '../pattern/types'; -import { getCheckState } from '../../stub/get_check_state'; +import { IndexSummaryTableItem } from '../types'; +import { getCheckState } from '../../../../stub/get_check_state'; const defaultBytesFormat = '0,0.[0]b'; const formatBytes = (value: number | undefined) => diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/summary_table/helpers.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/summary_table/helpers.tsx similarity index 94% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/summary_table/helpers.tsx rename to x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/summary_table/helpers.tsx index f8e5b8d1b271e..b41b5604d1b98 100644 --- a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/summary_table/helpers.tsx +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/summary_table/helpers.tsx @@ -18,15 +18,15 @@ import moment from 'moment'; import styled from 'styled-components'; import { euiThemeVars } from '@kbn/ui-theme'; -import { EMPTY_STAT, getIlmPhaseDescription } from '../../helpers'; -import { INCOMPATIBLE_INDEX_TOOL_TIP } from '../stat_label/translations'; -import { INDEX_SIZE_TOOLTIP } from '../../translations'; +import { EMPTY_STAT, getIlmPhaseDescription } from '../../../../helpers'; +import { INCOMPATIBLE_INDEX_TOOL_TIP } from '../../../../stat_label/translations'; +import { INDEX_SIZE_TOOLTIP } from '../../../../translations'; import * as i18n from './translations'; -import { IndexSummaryTableItem } from '../pattern/types'; -import { UseIndicesCheckCheckState } from '../../use_indices_check/types'; +import { IndexSummaryTableItem } from '../types'; +import { UseIndicesCheckCheckState } from '../../../../hooks/use_indices_check/types'; import { IndexResultBadge } from '../index_result_badge'; import { getIndexResultToolTip } from '../index_result_badge/helpers'; -import { Stat } from '../pattern/pattern_summary/stats_rollup/stat'; +import { Stat } from '../../../../stat'; const ProgressContainer = styled.div` width: 150px; diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/summary_table/index.test.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/summary_table/index.test.tsx similarity index 86% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/summary_table/index.test.tsx rename to x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/summary_table/index.test.tsx index 24d57f927e6ea..5863649335edb 100644 --- a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/summary_table/index.test.tsx +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/summary_table/index.test.tsx @@ -9,17 +9,17 @@ import numeral from '@elastic/numeral'; import { render, screen } from '@testing-library/react'; import React from 'react'; -import { EMPTY_STAT } from '../../helpers'; +import { EMPTY_STAT } from '../../../../helpers'; import { getSummaryTableColumns } from './helpers'; -import { mockIlmExplain } from '../../mock/ilm_explain/mock_ilm_explain'; -import { auditbeatWithAllResults } from '../../mock/pattern_rollup/mock_auditbeat_pattern_rollup'; -import { mockStats } from '../../mock/stats/mock_stats'; +import { mockIlmExplain } from '../../../../mock/ilm_explain/mock_ilm_explain'; +import { auditbeatWithAllResults } from '../../../../mock/pattern_rollup/mock_auditbeat_pattern_rollup'; +import { mockStats } from '../../../../mock/stats/mock_stats'; import { TestDataQualityProviders, TestExternalProviders, -} from '../../mock/test_providers/test_providers'; -import { getSummaryTableItems } from '../pattern/helpers'; -import { SortConfig } from '../../types'; +} from '../../../../mock/test_providers/test_providers'; +import { getSummaryTableItems } from '../helpers'; +import { SortConfig } from '../../../../types'; import { Props, SummaryTable } from '.'; const defaultBytesFormat = '0,0.[0]b'; diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/summary_table/index.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/summary_table/index.tsx similarity index 91% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/summary_table/index.tsx rename to x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/summary_table/index.tsx index cc09109ea16f9..fad209fb29e54 100644 --- a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/summary_table/index.tsx +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/summary_table/index.tsx @@ -10,11 +10,11 @@ import { EuiInMemoryTable } from '@elastic/eui'; import React, { useCallback, useMemo } from 'react'; import { getShowPagination } from './helpers'; -import { defaultSort, MIN_PAGE_SIZE } from '../pattern/helpers'; -import { SortConfig } from '../../types'; -import { useDataQualityContext } from '../data_quality_context'; -import { IndexSummaryTableItem } from '../pattern/types'; -import { UseIndicesCheckCheckState } from '../../use_indices_check/types'; +import { defaultSort, MIN_PAGE_SIZE } from '../helpers'; +import { SortConfig } from '../../../../types'; +import { useDataQualityContext } from '../../../../data_quality_context'; +import { IndexSummaryTableItem } from '../types'; +import { UseIndicesCheckCheckState } from '../../../../hooks/use_indices_check/types'; export interface Props { getTableColumns: ({ diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/summary_table/translations.ts b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/summary_table/translations.ts similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/summary_table/translations.ts rename to x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/summary_table/translations.ts diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/pattern/translations.ts b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/translations.ts similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/pattern/translations.ts rename to x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/translations.ts diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/pattern/types.ts b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/types.ts similarity index 92% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/pattern/types.ts rename to x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/types.ts index b079976950f1b..e44300859bffd 100644 --- a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/pattern/types.ts +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/types.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { IlmPhase } from '../../types'; +import { IlmPhase } from '../../../types'; export interface IndexSummaryTableItem { docsCount: number; diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/body/data_quality_details/storage_details/helpers.test.ts b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/storage_details/helpers.test.ts similarity index 97% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/body/data_quality_details/storage_details/helpers.test.ts rename to x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/storage_details/helpers.test.ts index 650b70586d19f..e4091d38c20d9 100644 --- a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/body/data_quality_details/storage_details/helpers.test.ts +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/storage_details/helpers.test.ts @@ -8,7 +8,7 @@ import numeral from '@elastic/numeral'; import { euiThemeVars } from '@kbn/ui-theme'; -import { EMPTY_STAT } from '../../../../helpers'; +import { EMPTY_STAT } from '../../helpers'; import { DEFAULT_INDEX_COLOR, getFillColor, @@ -21,10 +21,10 @@ import { getPatternLegendItem, getPatternSizeInBytes, } from './helpers'; -import { alertIndexWithAllResults } from '../../../../mock/pattern_rollup/mock_alerts_pattern_rollup'; -import { auditbeatWithAllResults } from '../../../../mock/pattern_rollup/mock_auditbeat_pattern_rollup'; -import { packetbeatNoResults } from '../../../../mock/pattern_rollup/mock_packetbeat_pattern_rollup'; -import { PatternRollup } from '../../../../types'; +import { alertIndexWithAllResults } from '../../mock/pattern_rollup/mock_alerts_pattern_rollup'; +import { auditbeatWithAllResults } from '../../mock/pattern_rollup/mock_auditbeat_pattern_rollup'; +import { packetbeatNoResults } from '../../mock/pattern_rollup/mock_packetbeat_pattern_rollup'; +import { PatternRollup } from '../../types'; const defaultBytesFormat = '0,0.[0]b'; const formatBytes = (value: number | undefined) => diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/body/data_quality_details/storage_details/helpers.ts b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/storage_details/helpers.ts similarity index 97% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/body/data_quality_details/storage_details/helpers.ts rename to x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/storage_details/helpers.ts index 3eaf493222cb0..456752eef627e 100644 --- a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/body/data_quality_details/storage_details/helpers.ts +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/storage_details/helpers.ts @@ -9,9 +9,9 @@ import type { Datum, Key, ArrayNode } from '@elastic/charts'; import { euiThemeVars } from '@kbn/ui-theme'; import { orderBy } from 'lodash/fp'; -import { getDocsCount, getSizeInBytes } from '../../../../helpers'; -import { getIlmPhase } from '../../../pattern/helpers'; -import { PatternRollup } from '../../../../types'; +import { getDocsCount, getSizeInBytes } from '../../helpers'; +import { getIlmPhase } from '../indices_details/pattern/helpers'; +import { PatternRollup } from '../../types'; export interface LegendItem { color: string | null; diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/body/data_quality_details/storage_details/index.test.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/storage_details/index.test.tsx similarity index 79% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/body/data_quality_details/storage_details/index.test.tsx rename to x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/storage_details/index.test.tsx index 5dd06ad340474..7eff122a3df06 100644 --- a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/body/data_quality_details/storage_details/index.test.tsx +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/storage_details/index.test.tsx @@ -9,15 +9,15 @@ import numeral from '@elastic/numeral'; import { render, screen } from '@testing-library/react'; import React from 'react'; -import { EMPTY_STAT } from '../../../../helpers'; -import { alertIndexWithAllResults } from '../../../../mock/pattern_rollup/mock_alerts_pattern_rollup'; -import { auditbeatWithAllResults } from '../../../../mock/pattern_rollup/mock_auditbeat_pattern_rollup'; -import { packetbeatNoResults } from '../../../../mock/pattern_rollup/mock_packetbeat_pattern_rollup'; +import { EMPTY_STAT } from '../../helpers'; +import { alertIndexWithAllResults } from '../../mock/pattern_rollup/mock_alerts_pattern_rollup'; +import { auditbeatWithAllResults } from '../../mock/pattern_rollup/mock_auditbeat_pattern_rollup'; +import { packetbeatNoResults } from '../../mock/pattern_rollup/mock_packetbeat_pattern_rollup'; import { TestDataQualityProviders, TestExternalProviders, -} from '../../../../mock/test_providers/test_providers'; -import { PatternRollup } from '../../../../types'; +} from '../../mock/test_providers/test_providers'; +import { PatternRollup } from '../../types'; import { Props, StorageDetails } from '.'; const defaultBytesFormat = '0,0.[0]b'; diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/body/data_quality_details/storage_details/index.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/storage_details/index.tsx similarity index 81% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/body/data_quality_details/storage_details/index.tsx rename to x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/storage_details/index.tsx index ff43116c02878..cfde7c0342585 100644 --- a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/body/data_quality_details/storage_details/index.tsx +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/storage_details/index.tsx @@ -7,12 +7,12 @@ import React, { useCallback, useMemo } from 'react'; -import { useResultsRollupContext } from '../../../../contexts/results_rollup_context'; +import { useResultsRollupContext } from '../../contexts/results_rollup_context'; import { getFlattenedBuckets } from './helpers'; -import { StorageTreemap } from '../../../storage_treemap'; -import { DEFAULT_MAX_CHART_HEIGHT } from '../../../tabs/styles'; -import { SelectedIndex } from '../../../../types'; -import { useDataQualityContext } from '../../../data_quality_context'; +import { StorageTreemap } from './storage_treemap'; +import { DEFAULT_MAX_CHART_HEIGHT } from '../indices_details/pattern/index_check_flyout/index_properties/index_check_fields/tabs/styles'; +import { SelectedIndex } from '../../types'; +import { useDataQualityContext } from '../../data_quality_context'; import { DOCS_UNIT } from './translations'; export interface Props { diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/storage_treemap/chart_legend_item/index.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/storage_details/storage_treemap/chart_legend_item/index.tsx similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/storage_treemap/chart_legend_item/index.tsx rename to x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/storage_details/storage_treemap/chart_legend_item/index.tsx diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/storage_treemap/index.test.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/storage_details/storage_treemap/index.test.tsx similarity index 88% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/storage_treemap/index.test.tsx rename to x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/storage_details/storage_treemap/index.test.tsx index 5e22bc185b1c1..6206dfca5742f 100644 --- a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/storage_treemap/index.test.tsx +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/storage_details/storage_treemap/index.test.tsx @@ -11,24 +11,20 @@ import { render, screen } from '@testing-library/react'; import userEvent from '@testing-library/user-event'; import React from 'react'; -import { - FlattenedBucket, - getFlattenedBuckets, - getLegendItems, -} from '../body/data_quality_details/storage_details/helpers'; -import { EMPTY_STAT } from '../../helpers'; -import { alertIndexWithAllResults } from '../../mock/pattern_rollup/mock_alerts_pattern_rollup'; -import { auditbeatWithAllResults } from '../../mock/pattern_rollup/mock_auditbeat_pattern_rollup'; -import { packetbeatNoResults } from '../../mock/pattern_rollup/mock_packetbeat_pattern_rollup'; +import { FlattenedBucket, getFlattenedBuckets, getLegendItems } from '../helpers'; +import { EMPTY_STAT } from '../../../helpers'; +import { alertIndexWithAllResults } from '../../../mock/pattern_rollup/mock_alerts_pattern_rollup'; +import { auditbeatWithAllResults } from '../../../mock/pattern_rollup/mock_auditbeat_pattern_rollup'; +import { packetbeatNoResults } from '../../../mock/pattern_rollup/mock_packetbeat_pattern_rollup'; import { TestDataQualityProviders, TestExternalProviders, -} from '../../mock/test_providers/test_providers'; +} from '../../../mock/test_providers/test_providers'; import type { Props } from '.'; import { StorageTreemap } from '.'; -import { DEFAULT_MAX_CHART_HEIGHT } from '../tabs/styles'; +import { DEFAULT_MAX_CHART_HEIGHT } from '../../indices_details/pattern/index_check_flyout/index_properties/index_check_fields/tabs/styles'; import { NO_DATA_LABEL } from './translations'; -import { PatternRollup } from '../../types'; +import { PatternRollup } from '../../../types'; const defaultBytesFormat = '0,0.[0]b'; const formatBytes = (value: number | undefined) => diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/storage_treemap/index.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/storage_details/storage_treemap/index.tsx similarity index 94% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/storage_treemap/index.tsx rename to x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/storage_details/storage_treemap/index.tsx index e56cbadc66009..fbabe4412e493 100644 --- a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/storage_treemap/index.tsx +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/storage_details/storage_treemap/index.tsx @@ -27,12 +27,15 @@ import { getLayersMultiDimensional, getLegendItems, getPathToFlattenedBucketMap, -} from '../body/data_quality_details/storage_details/helpers'; +} from '../helpers'; import { ChartLegendItem } from './chart_legend_item'; import { NoData } from './no_data'; -import { ChartFlexItem, LegendContainer } from '../tabs/styles'; -import { PatternRollup, SelectedIndex } from '../../types'; -import { useDataQualityContext } from '../data_quality_context'; +import { + ChartFlexItem, + LegendContainer, +} from '../../indices_details/pattern/index_check_flyout/index_properties/index_check_fields/tabs/styles'; +import { PatternRollup, SelectedIndex } from '../../../types'; +import { useDataQualityContext } from '../../../data_quality_context'; export const DEFAULT_MIN_CHART_HEIGHT = 240; // px export const LEGEND_WIDTH = 220; // px diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/storage_treemap/no_data/index.test.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/storage_details/storage_treemap/no_data/index.test.tsx similarity index 88% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/storage_treemap/no_data/index.test.tsx rename to x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/storage_details/storage_treemap/no_data/index.test.tsx index 95503d7f156bd..dbb6dd955c9ea 100644 --- a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/storage_treemap/no_data/index.test.tsx +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/storage_details/storage_treemap/no_data/index.test.tsx @@ -11,7 +11,7 @@ import React from 'react'; import * as i18n from '../translations'; import { NoData } from '.'; -import { TestExternalProviders } from '../../../mock/test_providers/test_providers'; +import { TestExternalProviders } from '../../../../mock/test_providers/test_providers'; describe('NoData', () => { test('renders the expected "no data" message', () => { diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/storage_treemap/no_data/index.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/storage_details/storage_treemap/no_data/index.tsx similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/storage_treemap/no_data/index.tsx rename to x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/storage_details/storage_treemap/no_data/index.tsx diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/storage_treemap/translations.ts b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/storage_details/storage_treemap/translations.ts similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/storage_treemap/translations.ts rename to x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/storage_details/storage_treemap/translations.ts diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/body/data_quality_details/storage_details/translations.ts b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/storage_details/translations.ts similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/body/data_quality_details/storage_details/translations.ts rename to x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/storage_details/translations.ts diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/data_quality_summary/ilm_phase_filter/index.test.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_summary/ilm_phase_filter/index.test.tsx similarity index 98% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/data_quality_summary/ilm_phase_filter/index.test.tsx rename to x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_summary/ilm_phase_filter/index.test.tsx index d2d0a388c465d..4a821d1251ddc 100644 --- a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/data_quality_summary/ilm_phase_filter/index.test.tsx +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_summary/ilm_phase_filter/index.test.tsx @@ -13,7 +13,7 @@ import { IlmPhaseFilter } from '.'; import { TestDataQualityProviders, TestExternalProviders, -} from '../../../mock/test_providers/test_providers'; +} from '../../mock/test_providers/test_providers'; import { COLD_DESCRIPTION, FROZEN_DESCRIPTION, @@ -21,7 +21,7 @@ import { INDEX_LIFECYCLE_MANAGEMENT_PHASES, UNMANAGED_DESCRIPTION, WARM_DESCRIPTION, -} from '../../../translations'; +} from '../../translations'; describe('IlmPhaseFilter', () => { it('renders combobox with ilmPhase label and preselected hot, warm, unmanaged options', () => { diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/data_quality_summary/ilm_phase_filter/index.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_summary/ilm_phase_filter/index.tsx similarity index 93% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/data_quality_summary/ilm_phase_filter/index.tsx rename to x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_summary/ilm_phase_filter/index.tsx index d0411349662fd..0a52777c1ab93 100644 --- a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/data_quality_summary/ilm_phase_filter/index.tsx +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_summary/ilm_phase_filter/index.tsx @@ -14,13 +14,13 @@ import { } from '@elastic/eui'; import React, { useCallback, useMemo } from 'react'; -import { ilmPhaseOptionsStatic } from '../../../constants'; -import { getIlmPhaseDescription } from '../../../helpers'; +import { ilmPhaseOptionsStatic } from '../../constants'; +import { getIlmPhaseDescription } from '../../helpers'; import { ILM_PHASE, INDEX_LIFECYCLE_MANAGEMENT_PHASES, SELECT_ONE_OR_MORE_ILM_PHASES, -} from '../../../translations'; +} from '../../translations'; import { useDataQualityContext } from '../../data_quality_context'; import { StyledFormControlLayout, StyledOption, StyledOptionLabel } from './styles'; diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/data_quality_summary/ilm_phase_filter/styles.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_summary/ilm_phase_filter/styles.tsx similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/data_quality_summary/ilm_phase_filter/styles.tsx rename to x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_summary/ilm_phase_filter/styles.tsx diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/data_quality_summary/index.test.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_summary/index.test.tsx similarity index 86% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/data_quality_summary/index.test.tsx rename to x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_summary/index.test.tsx index 6b8994e0d7919..d3861b46b3e12 100644 --- a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/data_quality_summary/index.test.tsx +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_summary/index.test.tsx @@ -9,15 +9,15 @@ import numeral from '@elastic/numeral'; import { render, screen } from '@testing-library/react'; import React from 'react'; -import { EMPTY_STAT } from '../../helpers'; -import { alertIndexWithAllResults } from '../../mock/pattern_rollup/mock_alerts_pattern_rollup'; -import { auditbeatWithAllResults } from '../../mock/pattern_rollup/mock_auditbeat_pattern_rollup'; -import { packetbeatNoResults } from '../../mock/pattern_rollup/mock_packetbeat_pattern_rollup'; +import { EMPTY_STAT } from '../helpers'; +import { alertIndexWithAllResults } from '../mock/pattern_rollup/mock_alerts_pattern_rollup'; +import { auditbeatWithAllResults } from '../mock/pattern_rollup/mock_auditbeat_pattern_rollup'; +import { packetbeatNoResults } from '../mock/pattern_rollup/mock_packetbeat_pattern_rollup'; import { TestDataQualityProviders, TestExternalProviders, -} from '../../mock/test_providers/test_providers'; -import { PatternRollup } from '../../types'; +} from '../mock/test_providers/test_providers'; +import { PatternRollup } from '../types'; import { DataQualitySummary } from '.'; import { getTotalDocsCount, @@ -25,7 +25,7 @@ import { getTotalIndices, getTotalIndicesChecked, getTotalSizeInBytes, -} from '../../use_results_rollup/helpers'; +} from '../hooks/use_results_rollup/helpers'; const defaultBytesFormat = '0,0.[0]b'; const formatBytes = (value: number | undefined) => diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/data_quality_summary/index.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_summary/index.tsx similarity index 94% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/data_quality_summary/index.tsx rename to x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_summary/index.tsx index eca684ce5c218..09c98c1a84197 100644 --- a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/data_quality_summary/index.tsx +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_summary/index.tsx @@ -9,11 +9,11 @@ import { EuiFlexGroup, EuiFlexItem, EuiPanel } from '@elastic/eui'; import React from 'react'; import styled from 'styled-components'; -import { StatsRollup } from '../pattern/pattern_summary/stats_rollup'; +import { StatsRollup } from '../stats_rollup'; import { SummaryActions } from './summary_actions'; import { IlmPhaseFilter } from './ilm_phase_filter'; import { useDataQualityContext } from '../data_quality_context'; -import { useResultsRollupContext } from '../../contexts/results_rollup_context'; +import { useResultsRollupContext } from '../contexts/results_rollup_context'; const MAX_SUMMARY_ACTIONS_CONTAINER_WIDTH = 400; const MIN_SUMMARY_ACTIONS_CONTAINER_WIDTH = 235; diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/data_quality_summary/summary_actions/check_all/helpers.test.ts b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_summary/summary_actions/check_all/helpers.test.ts similarity index 96% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/data_quality_summary/summary_actions/check_all/helpers.test.ts rename to x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_summary/summary_actions/check_all/helpers.test.ts index 5f96cfa9953a6..2b37622baa655 100644 --- a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/data_quality_summary/summary_actions/check_all/helpers.test.ts +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_summary/summary_actions/check_all/helpers.test.ts @@ -6,7 +6,7 @@ */ import { getAllIndicesToCheck, getIndexDocsCountFromRollup, getIndexToCheck } from './helpers'; -import { mockPacketbeatPatternRollup } from '../../../../mock/pattern_rollup/mock_packetbeat_pattern_rollup'; +import { mockPacketbeatPatternRollup } from '../../../mock/pattern_rollup/mock_packetbeat_pattern_rollup'; const patternIndexNames: Record = { 'packetbeat-*': [ diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/data_quality_summary/summary_actions/check_all/helpers.ts b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_summary/summary_actions/check_all/helpers.ts similarity index 95% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/data_quality_summary/summary_actions/check_all/helpers.ts rename to x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_summary/summary_actions/check_all/helpers.ts index ede3184350e58..fe453dd3a7370 100644 --- a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/data_quality_summary/summary_actions/check_all/helpers.ts +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_summary/summary_actions/check_all/helpers.ts @@ -7,8 +7,8 @@ import { orderBy } from 'lodash/fp'; -import { getDocsCount } from '../../../../helpers'; -import type { IndexToCheck, MeteringStatsIndex, PatternRollup } from '../../../../types'; +import { getDocsCount } from '../../../helpers'; +import type { IndexToCheck, MeteringStatsIndex, PatternRollup } from '../../../types'; export const getIndexToCheck = ({ indexName, diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/data_quality_summary/summary_actions/check_all/index.test.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_summary/summary_actions/check_all/index.test.tsx similarity index 94% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/data_quality_summary/summary_actions/check_all/index.test.tsx rename to x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_summary/summary_actions/check_all/index.test.tsx index 97e93124b84cf..5ebb61152b1ae 100644 --- a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/data_quality_summary/summary_actions/check_all/index.test.tsx +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_summary/summary_actions/check_all/index.test.tsx @@ -10,16 +10,16 @@ import userEvent from '@testing-library/user-event'; import { act, render, screen, waitFor } from '@testing-library/react'; import React from 'react'; -import { mockMappingsResponse } from '../../../../mock/mappings_response/mock_mappings_response'; +import { mockMappingsResponse } from '../../../mock/mappings_response/mock_mappings_response'; import { TestDataQualityProviders, TestExternalProviders, -} from '../../../../mock/test_providers/test_providers'; -import { mockUnallowedValuesResponse } from '../../../../mock/unallowed_values/mock_unallowed_values'; -import { CANCEL, CHECK_ALL } from '../../../../translations'; -import { OnCheckCompleted, UnallowedValueRequestItem } from '../../../../types'; +} from '../../../mock/test_providers/test_providers'; +import { mockUnallowedValuesResponse } from '../../../mock/unallowed_values/mock_unallowed_values'; +import { CANCEL, CHECK_ALL } from '../../../translations'; +import { OnCheckCompleted, UnallowedValueRequestItem } from '../../../types'; import { CheckAll } from '.'; -import { EMPTY_STAT } from '../../../../helpers'; +import { EMPTY_STAT } from '../../../helpers'; const defaultBytesFormat = '0,0.[0]b'; const mockFormatBytes = (value: number | undefined) => @@ -35,16 +35,19 @@ const mockFetchMappings = jest.fn(() => ) ); -jest.mock('../../../../use_mappings/helpers', () => ({ - fetchMappings: (_: { abortController: AbortController; patternOrIndexName: string }) => - mockFetchMappings(), -})); +jest.mock('../../../utils/fetch_mappings', () => { + const original = jest.requireActual('../../../utils/fetch_mappings'); + return { + ...original, + fetchMappings: (_: { abortController: AbortController; patternOrIndexName: string }) => + mockFetchMappings(), + }; +}); const mockFetchUnallowedValues = jest.fn(() => Promise.resolve(mockUnallowedValuesResponse)); -jest.mock('../../../../use_unallowed_values/helpers', () => { - const original = jest.requireActual('../../../../use_unallowed_values/helpers'); - +jest.mock('../../../utils/fetch_unallowed_values', () => { + const original = jest.requireActual('../../../utils/fetch_unallowed_values'); return { ...original, fetchUnallowedValues: (_: { diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/data_quality_summary/summary_actions/check_all/index.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_summary/summary_actions/check_all/index.tsx similarity index 94% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/data_quality_summary/summary_actions/check_all/index.tsx rename to x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_summary/summary_actions/check_all/index.tsx index c8bb58de2ef44..e2851ee4b3761 100644 --- a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/data_quality_summary/summary_actions/check_all/index.tsx +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_summary/summary_actions/check_all/index.tsx @@ -10,12 +10,12 @@ import React, { useCallback, useEffect, useRef, useState } from 'react'; import styled from 'styled-components'; import { v4 as uuidv4 } from 'uuid'; -import { useResultsRollupContext } from '../../../../contexts/results_rollup_context'; -import { checkIndex } from '../../../../utils/check_index'; -import { useDataQualityContext } from '../../../data_quality_context'; import { getAllIndicesToCheck } from './helpers'; -import * as i18n from '../../../../translations'; -import type { IndexToCheck } from '../../../../types'; +import { useResultsRollupContext } from '../../../contexts/results_rollup_context'; +import { checkIndex } from '../../../utils/check_index'; +import { useDataQualityContext } from '../../../data_quality_context'; +import * as i18n from '../../../translations'; +import type { IndexToCheck } from '../../../types'; const CheckAllButton = styled(EuiButton)` width: 112px; diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/data_quality_summary/summary_actions/check_all/translations.ts b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_summary/summary_actions/check_all/translations.ts similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/data_quality_summary/summary_actions/check_all/translations.ts rename to x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_summary/summary_actions/check_all/translations.ts diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/data_quality_summary/errors_viewer/helpers.test.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_summary/summary_actions/check_status/errors_popover/errors_viewer/helpers.test.tsx similarity index 96% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/data_quality_summary/errors_viewer/helpers.test.tsx rename to x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_summary/summary_actions/check_status/errors_popover/errors_viewer/helpers.test.tsx index 4ef8e57bf74b9..13b2e5e88605a 100644 --- a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/data_quality_summary/errors_viewer/helpers.test.tsx +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_summary/summary_actions/check_status/errors_popover/errors_viewer/helpers.test.tsx @@ -10,8 +10,8 @@ import { omit } from 'lodash/fp'; import React from 'react'; import { getErrorsViewerTableColumns } from './helpers'; -import { TestExternalProviders } from '../../../mock/test_providers/test_providers'; -import { ErrorSummary } from '../../../types'; +import { TestExternalProviders } from '../../../../../mock/test_providers/test_providers'; +import { ErrorSummary } from '../../../../../types'; const errorSummary: ErrorSummary[] = [ { diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/data_quality_summary/errors_viewer/helpers.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_summary/summary_actions/check_status/errors_popover/errors_viewer/helpers.tsx similarity index 95% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/data_quality_summary/errors_viewer/helpers.tsx rename to x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_summary/summary_actions/check_status/errors_popover/errors_viewer/helpers.tsx index 35a4a74cca875..a72580e464ad4 100644 --- a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/data_quality_summary/errors_viewer/helpers.tsx +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_summary/summary_actions/check_status/errors_popover/errors_viewer/helpers.tsx @@ -10,7 +10,7 @@ import { EuiCode } from '@elastic/eui'; import React from 'react'; import * as i18n from './translations'; -import type { ErrorSummary } from '../../../types'; +import type { ErrorSummary } from '../../../../../types'; export const EMPTY_PLACEHOLDER = '--'; diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/data_quality_summary/errors_viewer/index.test.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_summary/summary_actions/check_status/errors_popover/errors_viewer/index.test.tsx similarity index 92% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/data_quality_summary/errors_viewer/index.test.tsx rename to x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_summary/summary_actions/check_status/errors_popover/errors_viewer/index.test.tsx index 0354f687cda24..1c605a64d8ab2 100644 --- a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/data_quality_summary/errors_viewer/index.test.tsx +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_summary/summary_actions/check_status/errors_popover/errors_viewer/index.test.tsx @@ -8,9 +8,9 @@ import { render, screen } from '@testing-library/react'; import React from 'react'; -import { TestExternalProviders } from '../../../mock/test_providers/test_providers'; +import { TestExternalProviders } from '../../../../../mock/test_providers/test_providers'; import { ERROR, INDEX, PATTERN } from './translations'; -import { ErrorSummary } from '../../../types'; +import { ErrorSummary } from '../../../../../types'; import { ErrorsViewer } from '.'; interface ExpectedColumns { diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/data_quality_summary/errors_viewer/index.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_summary/summary_actions/check_status/errors_popover/errors_viewer/index.tsx similarity index 95% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/data_quality_summary/errors_viewer/index.tsx rename to x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_summary/summary_actions/check_status/errors_popover/errors_viewer/index.tsx index 2336abe79c651..363127e4f919c 100644 --- a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/data_quality_summary/errors_viewer/index.tsx +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_summary/summary_actions/check_status/errors_popover/errors_viewer/index.tsx @@ -14,7 +14,7 @@ import { ERRORS_CONTAINER_MIN_WIDTH, getErrorsViewerTableColumns, } from './helpers'; -import type { ErrorSummary } from '../../../types'; +import type { ErrorSummary } from '../../../../../types'; const ErrorsViewerContainer = styled.div` max-width: ${ERRORS_CONTAINER_MAX_WIDTH}px; diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/data_quality_summary/errors_viewer/translations.ts b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_summary/summary_actions/check_status/errors_popover/errors_viewer/translations.ts similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/data_quality_summary/errors_viewer/translations.ts rename to x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_summary/summary_actions/check_status/errors_popover/errors_viewer/translations.ts diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/data_quality_summary/errors_popover/index.test.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_summary/summary_actions/check_status/errors_popover/index.test.tsx similarity index 97% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/data_quality_summary/errors_popover/index.test.tsx rename to x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_summary/summary_actions/check_status/errors_popover/index.test.tsx index ecedacc646043..43cd0b7d215c6 100644 --- a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/data_quality_summary/errors_popover/index.test.tsx +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_summary/summary_actions/check_status/errors_popover/index.test.tsx @@ -9,7 +9,7 @@ import userEvent from '@testing-library/user-event'; import { act, render, screen } from '@testing-library/react'; import React from 'react'; -import { TestExternalProviders } from '../../../mock/test_providers/test_providers'; +import { TestExternalProviders } from '../../../../mock/test_providers/test_providers'; import { ErrorsPopover } from '.'; const mockCopyToClipboard = jest.fn((value) => true); diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/data_quality_summary/errors_popover/index.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_summary/summary_actions/check_status/errors_popover/index.tsx similarity index 89% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/data_quality_summary/errors_popover/index.tsx rename to x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_summary/summary_actions/check_status/errors_popover/index.tsx index 8f80e3fa3cab5..a4bb73147e97b 100644 --- a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/data_quality_summary/errors_popover/index.tsx +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_summary/summary_actions/check_status/errors_popover/index.tsx @@ -16,15 +16,15 @@ import { import React, { useCallback, useMemo, useState } from 'react'; import styled from 'styled-components'; -import { ErrorsViewer } from '../errors_viewer'; -import { ERRORS_CONTAINER_MAX_WIDTH } from '../errors_viewer/helpers'; +import { ErrorsViewer } from './errors_viewer'; +import { ERRORS_CONTAINER_MAX_WIDTH } from './errors_viewer/helpers'; import { getErrorsMarkdownTable, getErrorsMarkdownTableRows, -} from '../../index_properties/markdown/helpers'; +} from '../../../../data_quality_details/indices_details/pattern/index_check_flyout/index_properties/markdown/helpers'; import * as i18n from './translations'; -import type { ErrorSummary } from '../../../types'; -import { ERROR, INDEX, PATTERN } from '../errors_viewer/translations'; +import type { ErrorSummary } from '../../../../types'; +import { ERROR, INDEX, PATTERN } from './errors_viewer/translations'; const CallOut = styled(EuiCallOut)` max-width: ${ERRORS_CONTAINER_MAX_WIDTH}px; diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/data_quality_summary/errors_popover/translations.ts b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_summary/summary_actions/check_status/errors_popover/translations.ts similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/data_quality_summary/errors_popover/translations.ts rename to x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_summary/summary_actions/check_status/errors_popover/translations.ts diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/data_quality_summary/check_status/index.test.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_summary/summary_actions/check_status/index.test.tsx similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/data_quality_summary/check_status/index.test.tsx rename to x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_summary/summary_actions/check_status/index.test.tsx diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/data_quality_summary/check_status/index.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_summary/summary_actions/check_status/index.tsx similarity index 96% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/data_quality_summary/check_status/index.tsx rename to x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_summary/summary_actions/check_status/index.tsx index a39c7bbf7cc7d..694bab1b97efe 100644 --- a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/data_quality_summary/check_status/index.tsx +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_summary/summary_actions/check_status/index.tsx @@ -9,10 +9,10 @@ import { EuiFlexGroup, EuiFlexItem, EuiProgress, EuiSpacer, EuiText } from '@ela import React, { useEffect, useState } from 'react'; import moment from 'moment'; -import { ErrorsPopover } from '../errors_popover'; +import { ErrorsPopover } from './errors_popover'; import * as i18n from '../../../translations'; import type { ErrorSummary, IndexToCheck } from '../../../types'; -import { useDataQualityContext } from '../../data_quality_context'; +import { useDataQualityContext } from '../../../data_quality_context'; export const EMPTY_LAST_CHECKED_DATE = '--'; diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/data_quality_summary/summary_actions/index.test.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_summary/summary_actions/index.test.tsx similarity index 88% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/data_quality_summary/summary_actions/index.test.tsx rename to x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_summary/summary_actions/index.test.tsx index d202bdf9b342d..fa813ccfaba71 100644 --- a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/data_quality_summary/summary_actions/index.test.tsx +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_summary/summary_actions/index.test.tsx @@ -10,15 +10,15 @@ import { render, screen } from '@testing-library/react'; import userEvent from '@testing-library/user-event'; import React from 'react'; -import { EMPTY_STAT } from '../../../helpers'; -import { alertIndexWithAllResults } from '../../../mock/pattern_rollup/mock_alerts_pattern_rollup'; -import { auditbeatWithAllResults } from '../../../mock/pattern_rollup/mock_auditbeat_pattern_rollup'; -import { packetbeatNoResults } from '../../../mock/pattern_rollup/mock_packetbeat_pattern_rollup'; +import { EMPTY_STAT } from '../../helpers'; +import { alertIndexWithAllResults } from '../../mock/pattern_rollup/mock_alerts_pattern_rollup'; +import { auditbeatWithAllResults } from '../../mock/pattern_rollup/mock_auditbeat_pattern_rollup'; +import { packetbeatNoResults } from '../../mock/pattern_rollup/mock_packetbeat_pattern_rollup'; import { TestDataQualityProviders, TestExternalProviders, -} from '../../../mock/test_providers/test_providers'; -import { PatternRollup } from '../../../types'; +} from '../../mock/test_providers/test_providers'; +import { PatternRollup } from '../../types'; import { SummaryActions } from '.'; import { getTotalDocsCount, @@ -26,7 +26,7 @@ import { getTotalIndices, getTotalIndicesChecked, getTotalSizeInBytes, -} from '../../../use_results_rollup/helpers'; +} from '../../hooks/use_results_rollup/helpers'; const mockCopyToClipboard = jest.fn((value) => true); jest.mock('@elastic/eui', () => { diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/data_quality_summary/summary_actions/index.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_summary/summary_actions/index.tsx similarity index 91% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/data_quality_summary/summary_actions/index.tsx rename to x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_summary/summary_actions/index.tsx index e0d7233f538d2..71b6cbad9c171 100644 --- a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/data_quality_summary/summary_actions/index.tsx +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_summary/summary_actions/index.tsx @@ -11,9 +11,9 @@ import React, { useCallback, useMemo, useState } from 'react'; import styled from 'styled-components'; import { CheckAll } from './check_all'; -import { CheckStatus } from '../check_status'; -import { ERROR, INDEX, PATTERN } from '../errors_viewer/translations'; -import { ERRORS } from '../errors_popover/translations'; +import { CheckStatus } from './check_status'; +import { ERROR, INDEX, PATTERN } from './check_status/errors_popover/errors_viewer/translations'; +import { ERRORS } from './check_status/errors_popover/translations'; import { getDataQualitySummaryMarkdownComment, getErrorsMarkdownTable, @@ -21,12 +21,15 @@ import { getPatternSummaryMarkdownComment, getSummaryTableMarkdownHeader, getSummaryTableMarkdownRow, -} from '../../index_properties/markdown/helpers'; -import { defaultSort, getSummaryTableItems } from '../../pattern/helpers'; -import type { DataQualityCheckResult, IndexToCheck, PatternRollup } from '../../../types'; -import { getErrorSummaries, getSizeInBytes } from '../../../helpers'; +} from '../../data_quality_details/indices_details/pattern/index_check_flyout/index_properties/markdown/helpers'; +import { + defaultSort, + getSummaryTableItems, +} from '../../data_quality_details/indices_details/pattern/helpers'; +import type { DataQualityCheckResult, IndexToCheck, PatternRollup } from '../../types'; +import { getErrorSummaries, getSizeInBytes } from '../../helpers'; import { useDataQualityContext } from '../../data_quality_context'; -import { useResultsRollupContext } from '../../../contexts/results_rollup_context'; +import { useResultsRollupContext } from '../../contexts/results_rollup_context'; import { Actions } from '../../actions'; const StyledActionsContainerFlexItem = styled(EuiFlexItem)` diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/helpers.test.ts b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/helpers.test.ts similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/helpers.test.ts rename to x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/helpers.test.ts diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/helpers.ts b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/helpers.ts similarity index 99% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/helpers.ts rename to x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/helpers.ts index 9a56e00ba547a..c003da2d5fe70 100644 --- a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/helpers.ts +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/helpers.ts @@ -9,7 +9,7 @@ import type { HttpHandler } from '@kbn/core-http-browser'; import type { IlmExplainLifecycleLifecycleExplain } from '@elastic/elasticsearch/lib/api/types'; import { has, sortBy } from 'lodash/fp'; import { IToasts } from '@kbn/core-notifications-browser'; -import { getIlmPhase } from './data_quality_panel/pattern/helpers'; +import { getIlmPhase } from './data_quality_details/indices_details/pattern/helpers'; import * as i18n from './translations'; diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/use_indices_check/index.test.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/hooks/use_indices_check/index.test.tsx similarity index 96% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/use_indices_check/index.test.tsx rename to x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/hooks/use_indices_check/index.test.tsx index b129102e5516e..f16803936794d 100644 --- a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/use_indices_check/index.test.tsx +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/hooks/use_indices_check/index.test.tsx @@ -9,14 +9,14 @@ import { act, renderHook } from '@testing-library/react-hooks'; import { useIndicesCheck } from '.'; -import * as utilsCheckIndex from '../utils/check_index'; -import { mockUnallowedValuesResponse } from '../mock/unallowed_values/mock_unallowed_values'; -import { mockMappingsResponse } from '../mock/mappings_response/mock_mappings_response'; +import * as utilsCheckIndex from '../../utils/check_index'; +import { mockUnallowedValuesResponse } from '../../mock/unallowed_values/mock_unallowed_values'; +import { mockMappingsResponse } from '../../mock/mappings_response/mock_mappings_response'; import { HttpHandler } from '@kbn/core-http-browser'; -import { MappingsError } from '../use_mappings/helpers'; -import { UnallowedValuesError } from '../use_unallowed_values/helpers'; +import { MappingsError } from '../../utils/fetch_mappings'; +import { UnallowedValuesError } from '../../utils/fetch_unallowed_values'; import { IndicesGetMappingIndexMappingRecord } from '@elastic/elasticsearch/lib/api/types'; -import { UnallowedValueSearchResult } from '../types'; +import { UnallowedValueSearchResult } from '../../types'; import { getInitialCheckStateValue } from './reducer'; const getSpies = () => { diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/use_indices_check/index.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/hooks/use_indices_check/index.tsx similarity index 92% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/use_indices_check/index.tsx rename to x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/hooks/use_indices_check/index.tsx index acbad56a613c5..6ad00aacb338d 100644 --- a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/use_indices_check/index.tsx +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/hooks/use_indices_check/index.tsx @@ -6,10 +6,10 @@ */ import { useReducer, useCallback } from 'react'; -import { OnCheckCompleted } from '../types'; -import { MappingsError } from '../use_mappings/helpers'; -import { UnallowedValuesError } from '../use_unallowed_values/helpers'; -import { checkIndex as _checkIndex, CheckIndexProps } from '../utils/check_index'; +import { OnCheckCompleted } from '../../types'; +import { MappingsError } from '../../utils/fetch_mappings'; +import { UnallowedValuesError } from '../../utils/fetch_unallowed_values'; +import { checkIndex as _checkIndex, CheckIndexProps } from '../../utils/check_index'; import { initialState, reducer } from './reducer'; import { UseIndicesCheckReturnValue } from './types'; import { useIsMounted } from '../use_is_mounted'; diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/use_indices_check/reducer.ts b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/hooks/use_indices_check/reducer.ts similarity index 97% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/use_indices_check/reducer.ts rename to x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/hooks/use_indices_check/reducer.ts index ca596643605ce..73bb4c1a98df1 100644 --- a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/use_indices_check/reducer.ts +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/hooks/use_indices_check/reducer.ts @@ -14,9 +14,9 @@ import { PartitionedFieldMetadata, UnallowedValueCount, UnallowedValueSearchResult, -} from '../types'; -import { MappingsError } from '../use_mappings/helpers'; -import { UnallowedValuesError } from '../use_unallowed_values/helpers'; +} from '../../types'; +import { MappingsError } from '../../utils/fetch_mappings'; +import { UnallowedValuesError } from '../../utils/fetch_unallowed_values'; import { UseIndicesCheckState } from './types'; type Action = { data: { indexName: string } } & ( diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/use_indices_check/types.ts b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/hooks/use_indices_check/types.ts similarity index 86% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/use_indices_check/types.ts rename to x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/hooks/use_indices_check/types.ts index c7f0145f68f15..2b9ecf147e0a3 100644 --- a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/use_indices_check/types.ts +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/hooks/use_indices_check/types.ts @@ -13,10 +13,10 @@ import { PartitionedFieldMetadata, UnallowedValueCount, UnallowedValueSearchResult, -} from '../types'; -import { MappingsError } from '../use_mappings/helpers'; -import { UnallowedValuesError } from '../use_unallowed_values/helpers'; -import { CheckIndexProps } from '../utils/check_index'; +} from '../../types'; +import { MappingsError } from '../../utils/fetch_mappings'; +import { UnallowedValuesError } from '../../utils/fetch_unallowed_values'; +import { CheckIndexProps } from '../../utils/check_index'; export interface UseIndicesCheckCheckState { [indexName: string]: { diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/use_is_mounted/index.test.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/hooks/use_is_mounted/index.test.tsx similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/use_is_mounted/index.test.tsx rename to x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/hooks/use_is_mounted/index.test.tsx diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/use_is_mounted/index.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/hooks/use_is_mounted/index.tsx similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/use_is_mounted/index.tsx rename to x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/hooks/use_is_mounted/index.tsx diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/use_results_rollup/helpers.test.ts b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/hooks/use_results_rollup/helpers.test.ts similarity index 98% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/use_results_rollup/helpers.test.ts rename to x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/hooks/use_results_rollup/helpers.test.ts index c724ee1ae38de..2185ec35cddbb 100644 --- a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/use_results_rollup/helpers.test.ts +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/hooks/use_results_rollup/helpers.test.ts @@ -15,16 +15,16 @@ import { getTotalSameFamily, updateResultOnCheckCompleted, } from './helpers'; -import { auditbeatWithAllResults } from '../mock/pattern_rollup/mock_auditbeat_pattern_rollup'; +import { auditbeatWithAllResults } from '../../mock/pattern_rollup/mock_auditbeat_pattern_rollup'; import { mockPacketbeatPatternRollup, packetbeatNoResults, packetbeatWithSomeErrors, -} from '../mock/pattern_rollup/mock_packetbeat_pattern_rollup'; -import { DataQualityCheckResult, MeteringStatsIndex, PatternRollup } from '../types'; -import { EMPTY_STAT } from '../helpers'; -import { mockPartitionedFieldMetadata } from '../mock/partitioned_field_metadata/mock_partitioned_field_metadata'; -import { alertIndexWithAllResults } from '../mock/pattern_rollup/mock_alerts_pattern_rollup'; +} from '../../mock/pattern_rollup/mock_packetbeat_pattern_rollup'; +import { DataQualityCheckResult, MeteringStatsIndex, PatternRollup } from '../../types'; +import { EMPTY_STAT } from '../../helpers'; +import { mockPartitionedFieldMetadata } from '../../mock/partitioned_field_metadata/mock_partitioned_field_metadata'; +import { alertIndexWithAllResults } from '../../mock/pattern_rollup/mock_alerts_pattern_rollup'; import { EcsVersion } from '@elastic/ecs'; const defaultBytesFormat = '0,0.[0]b'; diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/use_results_rollup/helpers.ts b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/hooks/use_results_rollup/helpers.ts similarity index 92% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/use_results_rollup/helpers.ts rename to x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/hooks/use_results_rollup/helpers.ts index 07f51572b6ba2..4363633b9f530 100644 --- a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/use_results_rollup/helpers.ts +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/hooks/use_results_rollup/helpers.ts @@ -5,16 +5,16 @@ * 2.0. */ -import { getIndexDocsCountFromRollup } from '../data_quality_panel/data_quality_summary/summary_actions/check_all/helpers'; -import { getIlmPhase } from '../data_quality_panel/pattern/helpers'; -import { getAllIncompatibleMarkdownComments } from '../data_quality_panel/tabs/incompatible_tab/helpers'; +import { getIndexDocsCountFromRollup } from '../../data_quality_summary/summary_actions/check_all/helpers'; +import { getIlmPhase } from '../../data_quality_details/indices_details/pattern/helpers'; +import { getAllIncompatibleMarkdownComments } from '../../data_quality_details/indices_details/pattern/index_check_flyout/index_properties/index_check_fields/tabs/incompatible_tab/helpers'; import { getSizeInBytes, getTotalPatternIncompatible, getTotalPatternIndicesChecked, getTotalPatternSameFamily, -} from '../helpers'; -import type { IlmPhase, PartitionedFieldMetadata, PatternRollup } from '../types'; +} from '../../helpers'; +import type { IlmPhase, PartitionedFieldMetadata, PatternRollup } from '../../types'; export const getTotalIndices = ( patternRollups: Record diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/use_results_rollup/index.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/hooks/use_results_rollup/index.tsx similarity index 96% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/use_results_rollup/index.tsx rename to x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/hooks/use_results_rollup/index.tsx index f0c6f9d28e501..0828d496f700d 100644 --- a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/use_results_rollup/index.tsx +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/hooks/use_results_rollup/index.tsx @@ -26,7 +26,7 @@ import type { OnCheckCompleted, PatternRollup, TelemetryEvents, -} from '../types'; +} from '../../types'; import { getDocsCount, getIndexId, @@ -36,13 +36,16 @@ import { postStorageResult, formatStorageResult, formatResultFromStorage, -} from '../helpers'; -import { getIlmPhase, getIndexIncompatible } from '../data_quality_panel/pattern/helpers'; +} from '../../helpers'; +import { + getIlmPhase, + getIndexIncompatible, +} from '../../data_quality_details/indices_details/pattern/helpers'; import { getIncompatibleMappingsFields, getIncompatibleValuesFields, getSameFamilyFields, -} from '../data_quality_panel/tabs/incompatible_tab/helpers'; +} from '../../data_quality_details/indices_details/pattern/index_check_flyout/index_properties/index_check_fields/tabs/incompatible_tab/helpers'; import { UseResultsRollupReturnValue } from './types'; import { useIsMounted } from '../use_is_mounted'; diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/use_results_rollup/types.ts b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/hooks/use_results_rollup/types.ts similarity index 93% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/use_results_rollup/types.ts rename to x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/hooks/use_results_rollup/types.ts index e8f0124cd4a3f..a1e9a27418a89 100644 --- a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/use_results_rollup/types.ts +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/hooks/use_results_rollup/types.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { OnCheckCompleted, PatternRollup } from '../types'; +import { OnCheckCompleted, PatternRollup } from '../../types'; export interface UseResultsRollupReturnValue { onCheckCompleted: OnCheckCompleted; diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/index.test.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/index.test.tsx new file mode 100644 index 0000000000000..b7ea6613dac62 --- /dev/null +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/index.test.tsx @@ -0,0 +1,84 @@ +/* + * 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 { DARK_THEME } from '@elastic/charts'; +import { render, screen } from '@testing-library/react'; +import { notificationServiceMock } from '@kbn/core-notifications-browser-mocks'; +import React from 'react'; + +import { TestExternalProviders } from './mock/test_providers/test_providers'; +import { mockUseResultsRollup } from './mock/use_results_rollup/mock_use_results_rollup'; +import { getCheckState } from './stub/get_check_state'; +import * as useResultsRollup from './hooks/use_results_rollup'; +import * as useIndicesCheck from './hooks/use_indices_check'; +import { DataQualityPanel } from '.'; + +jest.mock('./data_quality_details/indices_details/pattern/hooks/use_stats', () => ({ + useStats: jest.fn(() => ({ + stats: {}, + error: null, + loading: false, + })), +})); + +jest.mock('./data_quality_details/indices_details/pattern/hooks/use_ilm_explain', () => ({ + useIlmExplain: jest.fn(() => ({ + error: null, + ilmExplain: {}, + loading: false, + })), +})); + +jest.spyOn(useResultsRollup, 'useResultsRollup').mockImplementation(() => mockUseResultsRollup); + +jest.spyOn(useIndicesCheck, 'useIndicesCheck').mockImplementation(() => ({ + checkIndex: jest.fn(), + checkState: { + ...getCheckState('auditbeat-*'), + }, +})); + +const { toasts } = notificationServiceMock.createSetupContract(); + +const patterns = ['auditbeat-*']; + +describe('DataQualityPanel', () => { + beforeEach(() => { + jest.clearAllMocks(); + + render( + + + + ); + }); + + it('renders the data quality summary', () => { + expect(screen.getByTestId('dataQualitySummary')).toBeInTheDocument(); + }); + + it(`renders the '${patterns.join(', ')}' patterns`, () => { + for (const pattern of patterns) { + expect(screen.getByTestId(`${pattern}PatternPanel`)).toBeInTheDocument(); + } + }); +}); diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/index.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/index.tsx similarity index 86% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/index.tsx rename to x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/index.tsx index 1fcedc7f76a82..e27bdd26540e9 100644 --- a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/index.tsx +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/index.tsx @@ -11,16 +11,17 @@ import type { PartialTheme, Theme } from '@elastic/charts'; import React, { useCallback, useMemo, useState } from 'react'; import type { IToasts } from '@kbn/core-notifications-browser'; -import { EuiComboBoxOptionOption } from '@elastic/eui'; -import { Body } from './data_quality_panel/body'; -import { DataQualityProvider } from './data_quality_panel/data_quality_context'; +import { EuiComboBoxOptionOption, EuiFlexGroup, EuiFlexItem, EuiSpacer } from '@elastic/eui'; +import { DataQualityProvider } from './data_quality_context'; import { EMPTY_STAT } from './helpers'; import { ReportDataQualityCheckAllCompleted, ReportDataQualityIndexChecked } from './types'; import { ResultsRollupContext } from './contexts/results_rollup_context'; import { IndicesCheckContext } from './contexts/indices_check_context'; -import { useIndicesCheck } from './use_indices_check'; -import { useResultsRollup } from './use_results_rollup'; +import { useIndicesCheck } from './hooks/use_indices_check'; +import { useResultsRollup } from './hooks/use_results_rollup'; import { ilmPhaseOptionsStatic } from './constants'; +import { DataQualitySummary } from './data_quality_summary'; +import { DataQualityDetails } from './data_quality_details'; interface Props { toasts: IToasts; @@ -141,7 +142,16 @@ const DataQualityPanelComponent: React.FC = ({ > - + + + + + + + + + + diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/mock/allowed_values/mock_allowed_values.ts b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/mock/allowed_values/mock_allowed_values.ts similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/mock/allowed_values/mock_allowed_values.ts rename to x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/mock/allowed_values/mock_allowed_values.ts diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/mock/data_quality_check_result/mock_index.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/mock/data_quality_check_result/mock_index.tsx similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/mock/data_quality_check_result/mock_index.tsx rename to x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/mock/data_quality_check_result/mock_index.tsx diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/mock/enriched_field_metadata/mock_enriched_field_metadata.ts b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/mock/enriched_field_metadata/mock_enriched_field_metadata.ts similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/mock/enriched_field_metadata/mock_enriched_field_metadata.ts rename to x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/mock/enriched_field_metadata/mock_enriched_field_metadata.ts diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/mock/ilm_explain/mock_ilm_explain.ts b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/mock/ilm_explain/mock_ilm_explain.ts similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/mock/ilm_explain/mock_ilm_explain.ts rename to x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/mock/ilm_explain/mock_ilm_explain.ts diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/mock/indices_get_mapping_index_mapping_record/mock_indices_get_mapping_index_mapping_record.ts b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/mock/indices_get_mapping_index_mapping_record/mock_indices_get_mapping_index_mapping_record.ts similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/mock/indices_get_mapping_index_mapping_record/mock_indices_get_mapping_index_mapping_record.ts rename to x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/mock/indices_get_mapping_index_mapping_record/mock_indices_get_mapping_index_mapping_record.ts diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/mock/mappings_properties/mock_mappings_properties.ts b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/mock/mappings_properties/mock_mappings_properties.ts similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/mock/mappings_properties/mock_mappings_properties.ts rename to x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/mock/mappings_properties/mock_mappings_properties.ts diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/mock/mappings_response/mock_mappings_response.ts b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/mock/mappings_response/mock_mappings_response.ts similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/mock/mappings_response/mock_mappings_response.ts rename to x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/mock/mappings_response/mock_mappings_response.ts diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/mock/partitioned_field_metadata/mock_partitioned_field_metadata.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/mock/partitioned_field_metadata/mock_partitioned_field_metadata.tsx similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/mock/partitioned_field_metadata/mock_partitioned_field_metadata.tsx rename to x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/mock/partitioned_field_metadata/mock_partitioned_field_metadata.tsx diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/mock/partitioned_field_metadata/mock_partitioned_field_metadata_with_same_family.ts b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/mock/partitioned_field_metadata/mock_partitioned_field_metadata_with_same_family.ts similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/mock/partitioned_field_metadata/mock_partitioned_field_metadata_with_same_family.ts rename to x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/mock/partitioned_field_metadata/mock_partitioned_field_metadata_with_same_family.ts diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/mock/pattern_rollup/mock_alerts_pattern_rollup.ts b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/mock/pattern_rollup/mock_alerts_pattern_rollup.ts similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/mock/pattern_rollup/mock_alerts_pattern_rollup.ts rename to x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/mock/pattern_rollup/mock_alerts_pattern_rollup.ts diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/mock/pattern_rollup/mock_auditbeat_pattern_rollup.ts b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/mock/pattern_rollup/mock_auditbeat_pattern_rollup.ts similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/mock/pattern_rollup/mock_auditbeat_pattern_rollup.ts rename to x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/mock/pattern_rollup/mock_auditbeat_pattern_rollup.ts diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/mock/pattern_rollup/mock_packetbeat_pattern_rollup.ts b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/mock/pattern_rollup/mock_packetbeat_pattern_rollup.ts similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/mock/pattern_rollup/mock_packetbeat_pattern_rollup.ts rename to x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/mock/pattern_rollup/mock_packetbeat_pattern_rollup.ts diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/mock/stats/mock_stats.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/mock/stats/mock_stats.tsx similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/mock/stats/mock_stats.tsx rename to x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/mock/stats/mock_stats.tsx diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/mock/stats/mock_stats_auditbeat_index.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/mock/stats/mock_stats_auditbeat_index.tsx similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/mock/stats/mock_stats_auditbeat_index.tsx rename to x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/mock/stats/mock_stats_auditbeat_index.tsx diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/mock/stats/mock_stats_packetbeat_index.ts b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/mock/stats/mock_stats_packetbeat_index.ts similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/mock/stats/mock_stats_packetbeat_index.ts rename to x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/mock/stats/mock_stats_packetbeat_index.ts diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/mock/test_providers/test_providers.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/mock/test_providers/test_providers.tsx similarity index 95% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/mock/test_providers/test_providers.tsx rename to x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/mock/test_providers/test_providers.tsx index 713b01e8ef71e..922d9b54612a6 100644 --- a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/mock/test_providers/test_providers.tsx +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/mock/test_providers/test_providers.tsx @@ -16,14 +16,11 @@ import { ThemeProvider } from 'styled-components'; import { QueryClient, QueryClientProvider } from '@tanstack/react-query'; import { Theme } from '@elastic/charts'; -import { - DataQualityProvider, - DataQualityProviderProps, -} from '../../data_quality_panel/data_quality_context'; +import { DataQualityProvider, DataQualityProviderProps } from '../../data_quality_context'; import { ResultsRollupContext } from '../../contexts/results_rollup_context'; import { IndicesCheckContext } from '../../contexts/indices_check_context'; -import { UseIndicesCheckReturnValue } from '../../use_indices_check/types'; -import { UseResultsRollupReturnValue } from '../../use_results_rollup/types'; +import { UseIndicesCheckReturnValue } from '../../hooks/use_indices_check/types'; +import { UseResultsRollupReturnValue } from '../../hooks/use_results_rollup/types'; import { getMergeResultsRollupContextProps } from './utils/get_merged_results_rollup_context_props'; import { getMergedDataQualityContextProps } from './utils/get_merged_data_quality_context_props'; import { getMergedIndicesCheckContextProps } from './utils/get_merged_indices_check_context_props'; diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/mock/test_providers/utils/get_merged_data_quality_context_props.ts b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/mock/test_providers/utils/get_merged_data_quality_context_props.ts similarity index 98% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/mock/test_providers/utils/get_merged_data_quality_context_props.ts rename to x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/mock/test_providers/utils/get_merged_data_quality_context_props.ts index d4cac9198e9c8..ac29ac9ac2fd1 100644 --- a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/mock/test_providers/utils/get_merged_data_quality_context_props.ts +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/mock/test_providers/utils/get_merged_data_quality_context_props.ts @@ -7,7 +7,7 @@ import numeral from '@elastic/numeral'; -import { DataQualityProviderProps } from '../../../data_quality_panel/data_quality_context'; +import { DataQualityProviderProps } from '../../../data_quality_context'; import { EMPTY_STAT } from '../../../helpers'; export const getMergedDataQualityContextProps = ( diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/mock/test_providers/utils/get_merged_indices_check_context_props.ts b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/mock/test_providers/utils/get_merged_indices_check_context_props.ts similarity index 95% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/mock/test_providers/utils/get_merged_indices_check_context_props.ts rename to x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/mock/test_providers/utils/get_merged_indices_check_context_props.ts index 28129d7e8155f..74817057ee377 100644 --- a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/mock/test_providers/utils/get_merged_indices_check_context_props.ts +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/mock/test_providers/utils/get_merged_indices_check_context_props.ts @@ -9,7 +9,7 @@ import { getCheckState } from '../../../stub/get_check_state'; import { UseIndicesCheckCheckState, UseIndicesCheckReturnValue, -} from '../../../use_indices_check/types'; +} from '../../../hooks/use_indices_check/types'; export const getMergedIndicesCheckContextProps = ( patternIndexNames: Record, diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/mock/test_providers/utils/get_merged_results_rollup_context_props.ts b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/mock/test_providers/utils/get_merged_results_rollup_context_props.ts similarity index 57% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/mock/test_providers/utils/get_merged_results_rollup_context_props.ts rename to x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/mock/test_providers/utils/get_merged_results_rollup_context_props.ts index bb8e3e6967b4d..352b50ec1ef2a 100644 --- a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/mock/test_providers/utils/get_merged_results_rollup_context_props.ts +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/mock/test_providers/utils/get_merged_results_rollup_context_props.ts @@ -5,8 +5,8 @@ * 2.0. */ -import { UseResultsRollupReturnValue } from '../../../use_results_rollup/types'; -import { auditbeatWithAllResults } from '../../pattern_rollup/mock_auditbeat_pattern_rollup'; +import { UseResultsRollupReturnValue } from '../../../hooks/use_results_rollup/types'; +import { mockUseResultsRollup } from '../../use_results_rollup/mock_use_results_rollup'; export const getMergeResultsRollupContextProps = ( resultsRollupContextProps?: Partial @@ -24,25 +24,7 @@ export const getMergeResultsRollupContextProps = ( updatePatternIndexNames, updatePatternRollup, } = { - onCheckCompleted: jest.fn(), - patternIndexNames: { - 'auditbeat-*': [ - '.ds-auditbeat-8.6.1-2023.02.07-000001', - 'auditbeat-custom-index-1', - 'auditbeat-custom-empty-index-1', - ], - }, - patternRollups: { - 'auditbeat-*': auditbeatWithAllResults, - }, - totalDocsCount: 19127, - totalIncompatible: 4, - totalIndices: 3, - totalIndicesChecked: 3, - totalSameFamily: 0, - totalSizeInBytes: 18820446, - updatePatternIndexNames: jest.fn(), - updatePatternRollup: jest.fn(), + ...mockUseResultsRollup, ...resultsRollupContextProps, }; diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/mock/unallowed_values/mock_unallowed_values.ts b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/mock/unallowed_values/mock_unallowed_values.ts similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/mock/unallowed_values/mock_unallowed_values.ts rename to x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/mock/unallowed_values/mock_unallowed_values.ts diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/mock/use_results_rollup/mock_use_results_rollup.ts b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/mock/use_results_rollup/mock_use_results_rollup.ts new file mode 100644 index 0000000000000..d3259d8c4c6d8 --- /dev/null +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/mock/use_results_rollup/mock_use_results_rollup.ts @@ -0,0 +1,30 @@ +/* + * 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 { auditbeatWithAllResults } from '../pattern_rollup/mock_auditbeat_pattern_rollup'; + +export const mockUseResultsRollup = { + onCheckCompleted: jest.fn(), + patternIndexNames: { + 'auditbeat-*': [ + '.ds-auditbeat-8.6.1-2023.02.07-000001', + 'auditbeat-custom-index-1', + 'auditbeat-custom-empty-index-1', + ], + }, + patternRollups: { + 'auditbeat-*': auditbeatWithAllResults, + }, + totalDocsCount: 19127, + totalIncompatible: 4, + totalIndices: 3, + totalIndicesChecked: 3, + totalSameFamily: 0, + totalSizeInBytes: 18820446, + updatePatternIndexNames: jest.fn(), + updatePatternRollup: jest.fn(), +}; diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/pattern/pattern_summary/stats_rollup/stat/index.test.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/stat/index.test.tsx similarity index 96% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/pattern/pattern_summary/stats_rollup/stat/index.test.tsx rename to x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/stat/index.test.tsx index 6979be1c8af32..0db273d5d3024 100644 --- a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/pattern/pattern_summary/stats_rollup/stat/index.test.tsx +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/stat/index.test.tsx @@ -10,7 +10,7 @@ import { render, screen, waitFor } from '@testing-library/react'; import userEvent from '@testing-library/user-event'; import { Props, Stat, arePropsEqualOneLevelDeep } from '.'; -import { TestExternalProviders } from '../../../../../mock/test_providers/test_providers'; +import { TestExternalProviders } from '../mock/test_providers/test_providers'; describe('Stat', () => { it('renders stat with badge', () => { diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/pattern/pattern_summary/stats_rollup/stat/index.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/stat/index.tsx similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/pattern/pattern_summary/stats_rollup/stat/index.tsx rename to x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/stat/index.tsx diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/stat_label/translations.ts b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/stat_label/translations.ts similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/stat_label/translations.ts rename to x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/stat_label/translations.ts diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/pattern/pattern_summary/stats_rollup/index.test.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/stats_rollup/index.test.tsx similarity index 98% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/pattern/pattern_summary/stats_rollup/index.test.tsx rename to x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/stats_rollup/index.test.tsx index ba470748727bc..6b8106f33c157 100644 --- a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/pattern/pattern_summary/stats_rollup/index.test.tsx +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/stats_rollup/index.test.tsx @@ -12,7 +12,7 @@ import userEvent from '@testing-library/user-event'; import { TestDataQualityProviders, TestExternalProviders, -} from '../../../../mock/test_providers/test_providers'; +} from '../mock/test_providers/test_providers'; import { StatsRollup } from '.'; describe('StatsRollup', () => { diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/pattern/pattern_summary/stats_rollup/index.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/stats_rollup/index.tsx similarity index 93% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/pattern/pattern_summary/stats_rollup/index.tsx rename to x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/stats_rollup/index.tsx index 0a36dbf0e3ab3..47eed189cbd31 100644 --- a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/pattern/pattern_summary/stats_rollup/index.tsx +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/stats_rollup/index.tsx @@ -9,10 +9,10 @@ import { EuiFlexGroup, EuiFlexItem } from '@elastic/eui'; import React from 'react'; import styled from 'styled-components'; -import { EMPTY_STAT, getIncompatibleStatBadgeColor } from '../../../../helpers'; -import { useDataQualityContext } from '../../../data_quality_context'; -import * as i18n from '../../../stat_label/translations'; -import { Stat } from './stat'; +import { EMPTY_STAT, getIncompatibleStatBadgeColor } from '../helpers'; +import { useDataQualityContext } from '../data_quality_context'; +import * as i18n from '../stat_label/translations'; +import { Stat } from '../stat'; const StyledStatWrapperFlexItem = styled(EuiFlexItem)` padding: 0 ${({ theme }) => theme.eui.euiSize}; diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/stub/get_check_state/index.ts b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/stub/get_check_state/index.ts similarity index 84% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/stub/get_check_state/index.ts rename to x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/stub/get_check_state/index.ts index c1ba27ac91376..12f45c192aa25 100644 --- a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/stub/get_check_state/index.ts +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/stub/get_check_state/index.ts @@ -10,11 +10,11 @@ import { IndicesGetMappingIndexMappingRecord } from '@elastic/elasticsearch/lib/ import { getMappingsProperties, getSortedPartitionedFieldMetadata, -} from '../../data_quality_panel/index_properties/helpers'; +} from '../../data_quality_details/indices_details/pattern/index_check_flyout/index_properties/helpers'; import { mockMappingsResponse } from '../../mock/mappings_response/mock_mappings_response'; -import { UseIndicesCheckCheckState } from '../../use_indices_check/types'; -import { getUnallowedValues } from '../../use_unallowed_values/helpers'; -import { getUnallowedValueRequestItems } from '../../data_quality_panel/allowed_values/helpers'; +import { UseIndicesCheckCheckState } from '../../hooks/use_indices_check/types'; +import { getUnallowedValues } from '../../utils/fetch_unallowed_values'; +import { getUnallowedValueRequestItems } from '../../utils/get_unallowed_value_request_items'; import { EcsFlatTyped } from '../../constants'; import { mockUnallowedValuesResponse } from '../../mock/unallowed_values/mock_unallowed_values'; import { UnallowedValueSearchResult } from '../../types'; diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/styles.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/styles.tsx similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/styles.tsx rename to x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/styles.tsx diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/translations.ts b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/translations.ts similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/translations.ts rename to x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/translations.ts diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/types.ts b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/types.ts similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/types.ts rename to x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/types.ts diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/utils/check_index.test.ts b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/utils/check_index.test.ts similarity index 95% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/utils/check_index.test.ts rename to x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/utils/check_index.test.ts index 9ea197360356f..512d26f365238 100644 --- a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/utils/check_index.test.ts +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/utils/check_index.test.ts @@ -13,10 +13,10 @@ import { UnallowedValueRequestItem, UnallowedValueSearchResult } from '../types' import { getMappingsProperties, getSortedPartitionedFieldMetadata, -} from '../data_quality_panel/index_properties/helpers'; +} from '../data_quality_details/indices_details/pattern/index_check_flyout/index_properties/helpers'; import { IndicesGetMappingIndexMappingRecord } from '@elastic/elasticsearch/lib/api/types'; -import { getUnallowedValues } from '../use_unallowed_values/helpers'; -import { getUnallowedValueRequestItems } from '../data_quality_panel/allowed_values/helpers'; +import { getUnallowedValues } from './fetch_unallowed_values'; +import { getUnallowedValueRequestItems } from './get_unallowed_value_request_items'; import { EcsFlatTyped } from '../constants'; let mockFetchMappings = jest.fn( @@ -24,19 +24,23 @@ let mockFetchMappings = jest.fn( Promise.resolve(mockMappingsResponse) ); -jest.mock('../use_mappings/helpers', () => ({ - fetchMappings: ({ - abortController, - patternOrIndexName, - }: { - abortController: AbortController; - patternOrIndexName: string; - }) => - mockFetchMappings({ +jest.mock('./fetch_mappings', () => { + const original = jest.requireActual('./fetch_mappings'); + return { + ...original, + fetchMappings: ({ abortController, patternOrIndexName, - }), -})); + }: { + abortController: AbortController; + patternOrIndexName: string; + }) => + mockFetchMappings({ + abortController, + patternOrIndexName, + }), + }; +}); const mockFetchUnallowedValues = jest.fn( (_: { @@ -46,8 +50,8 @@ const mockFetchUnallowedValues = jest.fn( }) => Promise.resolve(mockUnallowedValuesResponse) ); -jest.mock('../use_unallowed_values/helpers', () => { - const original = jest.requireActual('../use_unallowed_values/helpers'); +jest.mock('./fetch_unallowed_values', () => { + const original = jest.requireActual('./fetch_unallowed_values'); return { ...original, diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/utils/check_index.ts b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/utils/check_index.ts similarity index 91% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/utils/check_index.ts rename to x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/utils/check_index.ts index 8dd282c4121f0..76094c97f5667 100644 --- a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/utils/check_index.ts +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/utils/check_index.ts @@ -12,20 +12,20 @@ import { } from '@elastic/elasticsearch/lib/api/types'; import { v4 as uuidv4 } from 'uuid'; -import { getUnallowedValueRequestItems } from '../data_quality_panel/allowed_values/helpers'; +import { getUnallowedValueRequestItems } from './get_unallowed_value_request_items'; import { getMappingsProperties, getSortedPartitionedFieldMetadata, -} from '../data_quality_panel/index_properties/helpers'; -import * as i18n from '../data_quality_panel/data_quality_summary/summary_actions/check_all/translations'; +} from '../data_quality_details/indices_details/pattern/index_check_flyout/index_properties/helpers'; +import * as i18n from '../data_quality_summary/summary_actions/check_all/translations'; import type { OnCheckCompleted, PartitionedFieldMetadata, UnallowedValueCount, UnallowedValueSearchResult, } from '../types'; -import { fetchMappings } from '../use_mappings/helpers'; -import { fetchUnallowedValues, getUnallowedValues } from '../use_unallowed_values/helpers'; +import { fetchMappings } from './fetch_mappings'; +import { fetchUnallowedValues, getUnallowedValues } from './fetch_unallowed_values'; import { EcsFlatTyped } from '../constants'; export const EMPTY_PARTITIONED_FIELD_METADATA: PartitionedFieldMetadata = { diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/use_mappings/helpers.test.ts b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/utils/fetch_mappings.test.ts similarity index 97% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/use_mappings/helpers.test.ts rename to x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/utils/fetch_mappings.test.ts index b3a31228bb059..b24241b95a510 100644 --- a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/use_mappings/helpers.test.ts +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/utils/fetch_mappings.test.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { fetchMappings } from './helpers'; +import { fetchMappings } from './fetch_mappings'; import { mockMappingsResponse } from '../mock/mappings_response/mock_mappings_response'; describe('helpers', () => { diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/use_mappings/helpers.ts b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/utils/fetch_mappings.ts similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/use_mappings/helpers.ts rename to x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/utils/fetch_mappings.ts diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/use_unallowed_values/helpers.test.ts b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/utils/fetch_unallowed_values.test.ts similarity index 99% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/use_unallowed_values/helpers.test.ts rename to x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/utils/fetch_unallowed_values.test.ts index ade9970277c50..9ceb2869bfa42 100644 --- a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/use_unallowed_values/helpers.test.ts +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/utils/fetch_unallowed_values.test.ts @@ -12,7 +12,7 @@ import { getUnallowedValueCount, getUnallowedValues, isBucket, -} from './helpers'; +} from './fetch_unallowed_values'; import { mockUnallowedValuesResponse } from '../mock/unallowed_values/mock_unallowed_values'; import { UnallowedValueRequestItem, UnallowedValueSearchResult } from '../types'; import { INTERNAL_API_VERSION } from '../helpers'; diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/use_unallowed_values/helpers.ts b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/utils/fetch_unallowed_values.ts similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/use_unallowed_values/helpers.ts rename to x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/utils/fetch_unallowed_values.ts diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/allowed_values/helpers.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/utils/get_unallowed_value_request_items.tsx similarity index 94% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/allowed_values/helpers.tsx rename to x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/utils/get_unallowed_value_request_items.tsx index fd356b9fe60d5..8ce15c11b7000 100644 --- a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/allowed_values/helpers.tsx +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/utils/get_unallowed_value_request_items.tsx @@ -5,8 +5,8 @@ * 2.0. */ -import type { EcsFlatTyped } from '../../constants'; -import type { EcsFieldMetadata, UnallowedValueRequestItem } from '../../types'; +import type { EcsFlatTyped } from '../constants'; +import type { EcsFieldMetadata, UnallowedValueRequestItem } from '../types'; export const hasAllowedValues = ({ ecsMetadata, diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/utils/get_unallowed_values_request_items.test.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/utils/get_unallowed_values_request_items.test.tsx new file mode 100644 index 0000000000000..c2a35bc989625 --- /dev/null +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/utils/get_unallowed_values_request_items.test.tsx @@ -0,0 +1,154 @@ +/* + * 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 { EcsFlatTyped } from '../constants'; +import { + getUnallowedValueRequestItems, + getValidValues, + hasAllowedValues, +} from './get_unallowed_value_request_items'; + +describe('hasAllowedValues', () => { + test('it returns true for a field that has `allowed_values`', () => { + expect( + hasAllowedValues({ + ecsMetadata: EcsFlatTyped, + fieldName: 'event.category', + }) + ).toBe(true); + }); + + test('it returns false for a field that does NOT have `allowed_values`', () => { + expect( + hasAllowedValues({ + ecsMetadata: EcsFlatTyped, + fieldName: 'host.name', + }) + ).toBe(false); + }); + + test('it returns false for a field that does NOT exist in `ecsMetadata`', () => { + expect( + hasAllowedValues({ + ecsMetadata: EcsFlatTyped, + fieldName: 'does.NOT.exist', + }) + ).toBe(false); + }); +}); + +describe('getValidValues', () => { + test('it returns the expected valid values', () => { + expect(getValidValues(EcsFlatTyped['event.category'])).toEqual( + expect.arrayContaining([ + 'authentication', + 'configuration', + 'database', + 'driver', + 'email', + 'file', + 'host', + 'iam', + 'intrusion_detection', + 'malware', + 'network', + 'package', + 'process', + 'registry', + 'session', + 'threat', + 'vulnerability', + 'web', + ]) + ); + }); + + test('it returns an empty array when the `field` does NOT have `allowed_values`', () => { + expect(getValidValues(EcsFlatTyped['host.name'])).toEqual([]); + }); + + test('it returns an empty array when `field` is undefined', () => { + expect(getValidValues(undefined)).toEqual([]); + }); +}); + +describe('getUnallowedValueRequestItems', () => { + test('it returns the expected request items', () => { + expect( + getUnallowedValueRequestItems({ + ecsMetadata: EcsFlatTyped, + indexName: 'auditbeat-*', + }) + ).toEqual([ + { + indexName: 'auditbeat-*', + indexFieldName: 'event.category', + allowedValues: expect.arrayContaining([ + 'authentication', + 'configuration', + 'database', + 'driver', + 'email', + 'file', + 'host', + 'iam', + 'intrusion_detection', + 'malware', + 'network', + 'package', + 'process', + 'registry', + 'session', + 'threat', + 'vulnerability', + 'web', + ]), + }, + { + indexName: 'auditbeat-*', + indexFieldName: 'event.kind', + allowedValues: expect.arrayContaining([ + 'alert', + 'enrichment', + 'event', + 'metric', + 'state', + 'pipeline_error', + 'signal', + ]), + }, + { + indexName: 'auditbeat-*', + indexFieldName: 'event.outcome', + allowedValues: expect.arrayContaining(['failure', 'success', 'unknown']), + }, + { + indexName: 'auditbeat-*', + indexFieldName: 'event.type', + allowedValues: expect.arrayContaining([ + 'access', + 'admin', + 'allowed', + 'change', + 'connection', + 'creation', + 'deletion', + 'denied', + 'end', + 'error', + 'group', + 'indicator', + 'info', + 'installation', + 'protocol', + 'start', + 'user', + ]), + }, + ]); + }); +}); diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/index.ts b/x-pack/packages/security-solution/ecs_data_quality_dashboard/index.ts index 5f9ab020ea21f..1ed64e65a74a6 100644 --- a/x-pack/packages/security-solution/ecs_data_quality_dashboard/index.ts +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/index.ts @@ -5,9 +5,9 @@ * 2.0. */ -export { DataQualityPanel } from './impl/data_quality'; +export { DataQualityPanel } from './impl/data_quality_panel'; -export { getIlmPhaseDescription } from './impl/data_quality/helpers'; +export { getIlmPhaseDescription } from './impl/data_quality_panel/helpers'; export { DATA_QUALITY_PROMPT_CONTEXT_PILL, @@ -18,6 +18,6 @@ export { INDEX_LIFECYCLE_MANAGEMENT_PHASES, SELECT_ONE_OR_MORE_ILM_PHASES, DATA_QUALITY_DASHBOARD_CONVERSATION_ID, -} from './impl/data_quality/translations'; +} from './impl/data_quality_panel/translations'; -export { ECS_REFERENCE_URL } from './impl/data_quality/data_quality_panel/index_properties/markdown/helpers'; +export { ECS_REFERENCE_URL } from './impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/markdown/helpers'; From c52d6912436449b20b29d59a3453f396dffa210d Mon Sep 17 00:00:00 2001 From: Alexey Antonov Date: Mon, 26 Aug 2024 15:48:01 +0300 Subject: [PATCH 6/6] fix: [Home > Applications > Services > Add Data] Ambiguous links (Learn More) (#191072) Part of: https://github.com/elastic/observability-accessibility/issues/129 This PR addresses only the 'Learn More' section of the reported issue. The issue concerning the `Copy` button will be addressed first on the EUI side. # What was changed: 1. `EuiMarkdownFormat` has been removed in favor of using `EuiLink` and `EuiText`. 2. Required `aria-label` attribute was added # Screen image --- .../app/onboarding/introduction.tsx | 45 +++++++++++++------ .../translations/translations/fr-FR.json | 2 +- .../translations/translations/ja-JP.json | 2 +- .../translations/translations/zh-CN.json | 2 +- 4 files changed, 35 insertions(+), 16 deletions(-) diff --git a/x-pack/plugins/observability_solution/apm/public/components/app/onboarding/introduction.tsx b/x-pack/plugins/observability_solution/apm/public/components/app/onboarding/introduction.tsx index dfef9cd56050b..441d7a2f297f3 100644 --- a/x-pack/plugins/observability_solution/apm/public/components/app/onboarding/introduction.tsx +++ b/x-pack/plugins/observability_solution/apm/public/components/app/onboarding/introduction.tsx @@ -5,9 +5,10 @@ * 2.0. */ -import { EuiBetaBadge, EuiImage, EuiMarkdownFormat, EuiPageHeader } from '@elastic/eui'; +import { EuiBetaBadge, EuiImage, EuiPageHeader, EuiLink, EuiText } from '@elastic/eui'; import React from 'react'; import { i18n } from '@kbn/i18n'; +import { FormattedMessage } from '@kbn/i18n-react'; import { useKibanaUrl } from '../../../hooks/use_kibana_url'; interface IntroductionProps { @@ -38,17 +39,6 @@ export function Introduction({ isBeta, guideLink }: IntroductionProps) { />, ]; - const description = i18n.translate('xpack.apm.onboarding.specProvider.longDescription', { - defaultMessage: - 'Application Performance Monitoring (APM) collects in-depth \ -performance metrics and errors from inside your application. \ -It allows you to monitor the performance of thousands of applications in real time. \ -[Learn more]({learnMoreLink}).', - values: { - learnMoreLink: guideLink, - }, - }); - return ( <> } - description={{description}} + description={ + + + {i18n.translate('xpack.apm.onboarding.specProvider.learnMoreLabel', { + defaultMessage: 'Learn more', + })} + + ), + }} + /> + + } rightSideItems={rightSideItems} /> diff --git a/x-pack/plugins/translations/translations/fr-FR.json b/x-pack/plugins/translations/translations/fr-FR.json index 4ed818823f132..ddbd1fcea0ba6 100644 --- a/x-pack/plugins/translations/translations/fr-FR.json +++ b/x-pack/plugins/translations/translations/fr-FR.json @@ -10931,7 +10931,7 @@ "xpack.apm.onboarding.shared_clients.configure.commands.serverUrlHint": "Définir l'URL personnalisée du serveur APM (par défaut : {defaultApmServerUrl}). L'URL doit être complète et inclure le protocole (http ou https) et le port.", "xpack.apm.onboarding.shared_clients.configure.commands.serviceEnvironmentHint": "Le nom de l'environnement dans lequel ce service est déployé, par exemple \"production\" ou \"test\". Les environnements vous permettent de facilement filtrer les données à un niveau global dans l'interface utilisateur APM. Il est important de garantir la cohérence des noms d'environnements entre les différents agents.", "xpack.apm.onboarding.shared_clients.configure.commands.serviceNameHint": "Le nom de service est le filtre principal dans l'interface utilisateur APM et est utilisé pour regrouper les erreurs et suivre les données ensemble. Caractères autorisés : a-z, A-Z, 0-9, -, _ et espace.", - "xpack.apm.onboarding.specProvider.longDescription": "Le monitoring des performances applicatives (APM) collecte les indicateurs et les erreurs de performance approfondies depuis votre application. Cela vous permet de monitorer les performances de milliers d'applications en temps réel. [Learn more]({learnMoreLink}).", + "xpack.apm.onboarding.specProvider.longDescription": "Le monitoring des performances applicatives (APM) collecte les indicateurs et les erreurs de performance approfondies depuis votre application. Cela vous permet de monitorer les performances de milliers d'applications en temps réel. {learnMoreLink}.", "xpack.apm.pages.alertDetails.alertSummary.actualValue": "Valeur réelle", "xpack.apm.pages.alertDetails.alertSummary.expectedValue": "Valeur attendue", "xpack.apm.percentOfParent": "({value} de {parentType, select, transaction { transaction } trace {trace} other {parentType inconnu} })", diff --git a/x-pack/plugins/translations/translations/ja-JP.json b/x-pack/plugins/translations/translations/ja-JP.json index de0a83a8442c7..611c9f3e29085 100644 --- a/x-pack/plugins/translations/translations/ja-JP.json +++ b/x-pack/plugins/translations/translations/ja-JP.json @@ -10920,7 +10920,7 @@ "xpack.apm.onboarding.shared_clients.configure.commands.serverUrlHint": "カスタム APM Server URL(デフォルト:{defaultApmServerUrl})を設定します。URLはプロトコル(httpまたはhttps)とポートを含む完全修飾URLでなければなりません。", "xpack.apm.onboarding.shared_clients.configure.commands.serviceEnvironmentHint": "このサービスがデプロイされている環境の名前(例:「本番」、「ステージング」)。環境では、APM UIでグローバルレベルで簡単にデータをフィルタリングできます。すべてのエージェントで環境の命名方法を統一することが重要です。", "xpack.apm.onboarding.shared_clients.configure.commands.serviceNameHint": "このサービス名はAPM UIの主フィルターであり、エラーとトレースデータをグループ化するために使用されます。使用できる文字はA-Z、0-9、-、_、スペースです。", - "xpack.apm.onboarding.specProvider.longDescription": "アプリケーションパフォーマンスモニタリング(APM)は、アプリケーション内から詳細なパフォーマンスメトリックやエラーを収集します。何千ものアプリケーションのパフォーマンスをリアルタイムで監視できます。[詳細]({learnMoreLink})。", + "xpack.apm.onboarding.specProvider.longDescription": "アプリケーションパフォーマンスモニタリング(APM)は、アプリケーション内から詳細なパフォーマンスメトリックやエラーを収集します。何千ものアプリケーションのパフォーマンスをリアルタイムで監視できます。{learnMoreLink}。", "xpack.apm.pages.alertDetails.alertSummary.actualValue": "実際の値", "xpack.apm.pages.alertDetails.alertSummary.expectedValue": "想定された値", "xpack.apm.percentOfParent": "({value} of {parentType, select, transaction { トランザクション } trace {トレース} other {不明なparentType} })", diff --git a/x-pack/plugins/translations/translations/zh-CN.json b/x-pack/plugins/translations/translations/zh-CN.json index b378296cbf12b..308dbceef62b7 100644 --- a/x-pack/plugins/translations/translations/zh-CN.json +++ b/x-pack/plugins/translations/translations/zh-CN.json @@ -10939,7 +10939,7 @@ "xpack.apm.onboarding.shared_clients.configure.commands.serverUrlHint": "设置定制 APM Server URL(默认值:{defaultApmServerUrl})。此 URL 必须为完全限定 URL,包括协议(http 或 https)和端口。", "xpack.apm.onboarding.shared_clients.configure.commands.serviceEnvironmentHint": "在其中部署此服务的环境的名称,如“生产”或“暂存”。在 APM UI 中,您可以通过环境在全局级别轻松筛选数据。跨代理命名环境时,保持一致至关重要。", "xpack.apm.onboarding.shared_clients.configure.commands.serviceNameHint": "服务名称是 APM UI 中的初级筛选,用于分组错误并跟踪数据。允许使用的字符包括 a-z、A-Z、0-9、-、_ 和空格。", - "xpack.apm.onboarding.specProvider.longDescription": "应用程序性能监测 (APM) 从您的应用程序内收集深入全面的性能指标和错误。其允许您实时监测数以千计的应用程序的性能。[了解详情]({learnMoreLink})。", + "xpack.apm.onboarding.specProvider.longDescription": "应用程序性能监测 (APM) 从您的应用程序内收集深入全面的性能指标和错误。其允许您实时监测数以千计的应用程序的性能。{learnMoreLink}。", "xpack.apm.pages.alertDetails.alertSummary.actualValue": "实际值", "xpack.apm.pages.alertDetails.alertSummary.expectedValue": "预期值", "xpack.apm.percentOfParent": "({parentType, select, transaction {事务} trace {追溯} other {parentType 未知}}的 {value})",