mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 09:48:58 -04:00
[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 <body />. 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  ## After 
This commit is contained in:
parent
56730e86af
commit
dd18bc7c4d
213 changed files with 774 additions and 1227 deletions
|
@ -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',
|
||||
]),
|
||||
},
|
||||
]);
|
||||
});
|
||||
});
|
||||
});
|
|
@ -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(
|
||||
<TestExternalProviders>
|
||||
<TestDataQualityProviders>
|
||||
<Body />
|
||||
</TestDataQualityProviders>
|
||||
</TestExternalProviders>
|
||||
);
|
||||
|
||||
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(
|
||||
<TestExternalProviders>
|
||||
<TestDataQualityProviders dataQualityContextProps={{ patterns }}>
|
||||
<Body />
|
||||
</TestDataQualityProviders>
|
||||
</TestExternalProviders>
|
||||
);
|
||||
|
||||
for (const pattern of patterns) {
|
||||
await waitFor(() => {
|
||||
expect(screen.getByTestId(`${pattern}PatternPanel`)).toBeInTheDocument();
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
|
@ -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 (
|
||||
<EuiFlexGroup data-test-subj="body" direction="column" gutterSize="none">
|
||||
<EuiFlexItem grow={false}>
|
||||
<DataQualitySummary />
|
||||
<EuiSpacer size="l" />
|
||||
</EuiFlexItem>
|
||||
|
||||
<EuiFlexItem>
|
||||
<DataQualityDetails />
|
||||
</EuiFlexItem>
|
||||
</EuiFlexGroup>
|
||||
);
|
||||
};
|
||||
|
||||
export const Body = React.memo(BodyComponent);
|
|
@ -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(
|
||||
<TestExternalProviders>
|
||||
<DataQualityPanel
|
||||
canUserCreateAndReadCases={jest.fn()}
|
||||
defaultBytesFormat={''}
|
||||
defaultNumberFormat={''}
|
||||
httpFetch={jest.fn()}
|
||||
isAssistantEnabled={true}
|
||||
isILMAvailable={true}
|
||||
lastChecked={''}
|
||||
openCreateCaseFlyout={jest.fn()}
|
||||
patterns={[]}
|
||||
reportDataQualityIndexChecked={jest.fn()}
|
||||
setLastChecked={jest.fn()}
|
||||
baseTheme={DARK_THEME}
|
||||
toasts={toasts}
|
||||
/>
|
||||
</TestExternalProviders>
|
||||
);
|
||||
});
|
||||
|
||||
test('it renders the body', () => {
|
||||
expect(screen.getByTestId('body')).toBeInTheDocument();
|
||||
});
|
||||
});
|
|
@ -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<PropsWithChildren<unknown>> = ({ children }) => (
|
||||
<DataQualityProvider
|
||||
httpFetch={mockHttpFetch}
|
||||
telemetryEvents={mockTelemetryEvents}
|
||||
isILMAvailable={true}
|
||||
toasts={toasts}
|
||||
addSuccessToast={jest.fn()}
|
||||
canUserCreateAndReadCases={jest.fn(() => 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}
|
||||
</DataQualityProvider>
|
||||
);
|
||||
|
||||
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 })
|
||||
);
|
||||
});
|
||||
});
|
||||
});
|
|
@ -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<string, IndicesGetMappingIndexMappingRecord> | null;
|
||||
error: string | null;
|
||||
loading: boolean;
|
||||
}
|
||||
|
||||
export const useMappings = (patternOrIndexName: string): UseMappings => {
|
||||
const { isMountedRef } = useIsMounted();
|
||||
const [indexes, setIndexes] = useState<Record<
|
||||
string,
|
||||
IndicesGetMappingIndexMappingRecord
|
||||
> | null>(null);
|
||||
const { httpFetch } = useDataQualityContext();
|
||||
const [error, setError] = useState<string | null>(null);
|
||||
const [loading, setLoading] = useState<boolean>(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 };
|
||||
};
|
|
@ -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<PropsWithChildren<unknown>> = ({ children }) => (
|
||||
<DataQualityProvider
|
||||
httpFetch={mockHttpFetch}
|
||||
telemetryEvents={mockTelemetryEvents}
|
||||
isILMAvailable={true}
|
||||
toasts={toasts}
|
||||
addSuccessToast={jest.fn()}
|
||||
canUserCreateAndReadCases={jest.fn(() => 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}
|
||||
</DataQualityProvider>
|
||||
);
|
||||
|
||||
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 })
|
||||
);
|
||||
});
|
||||
});
|
||||
});
|
|
@ -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<string, UnallowedValueCount[]> | 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<Record<
|
||||
string,
|
||||
UnallowedValueCount[]
|
||||
> | null>(null);
|
||||
const { httpFetch } = useDataQualityContext();
|
||||
const [error, setError] = useState<string | null>(null);
|
||||
const [loading, setLoading] = useState<boolean>(true);
|
||||
const [requestTime, setRequestTime] = useState<number>();
|
||||
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 };
|
||||
};
|
|
@ -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', () => {
|
|
@ -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;
|
|
@ -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', () => {
|
|
@ -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';
|
||||
|
|
@ -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');
|
|
@ -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 {
|
|
@ -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', () => {
|
|
@ -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<UseIndicesCheckReturnValue | null>(null);
|
||||
|
|
@ -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<UseResultsRollupReturnValue | null>(null);
|
||||
|
|
@ -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;
|
|
@ -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', () => {
|
|
@ -15,7 +15,7 @@ import {
|
|||
HOT_DESCRIPTION,
|
||||
UNMANAGED_DESCRIPTION,
|
||||
WARM_DESCRIPTION,
|
||||
} from '../translations';
|
||||
} from '../../translations';
|
||||
import * as i18n from './translations';
|
||||
|
||||
const Ul = styled.ul`
|
|
@ -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'];
|
|
@ -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();
|
|
@ -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';
|
|
@ -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};
|
|
@ -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', () => {
|
|
@ -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;
|
|
@ -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 = {
|
|
@ -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 = (
|
|
@ -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';
|
|
@ -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';
|
||||
|
|
@ -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';
|
|
@ -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';
|
||||
|
|
@ -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: {},
|
|
@ -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[] = [];
|
||||
|
|
@ -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(() => {
|
|
@ -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 {
|
|
@ -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';
|
|
@ -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?';
|
|
@ -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', () => {
|
|
@ -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';
|
|
@ -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';
|
|
@ -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;
|
|
@ -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', () => {
|
|
@ -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%;
|
|
@ -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;
|
|
@ -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', () => {
|
|
@ -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[];
|
|
@ -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', () => {
|
|
@ -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 = () => {
|
|
@ -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 {
|
|
@ -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(() => {
|
|
@ -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[];
|
|
@ -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', () => {
|
|
@ -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;
|
|
@ -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', () => {
|
|
@ -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 = '--';
|
||||
|
|
@ -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', () => {
|
|
@ -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 = '--';
|
||||
|
|
@ -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', () => {
|
|
@ -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 = '--';
|
||||
|
|
@ -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';
|
||||
|
|
@ -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: {
|
|
@ -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', () => {
|
|
@ -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};
|
|
@ -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', () => {
|
|
@ -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) =>
|
|
@ -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,
|
|
@ -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 {
|
|
@ -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%;
|
|
@ -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,
|
|
@ -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({
|
|
@ -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', () => {
|
|
@ -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({
|
|
@ -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 {
|
|
@ -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', () => {
|
|
@ -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({
|
|
@ -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 {
|
|
@ -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};
|
|
@ -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', () => {
|
|
@ -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};
|
|
@ -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[] = [
|
||||
{
|
|
@ -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 = '--';
|
||||
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue