diff --git a/x-pack/plugins/threat_intelligence/public/modules/indicators/components/indicators_table/actions_row_cell.tsx b/x-pack/plugins/threat_intelligence/public/modules/indicators/components/table/components/actions_row_cell.tsx similarity index 76% rename from x-pack/plugins/threat_intelligence/public/modules/indicators/components/indicators_table/actions_row_cell.tsx rename to x-pack/plugins/threat_intelligence/public/modules/indicators/components/table/components/actions_row_cell.tsx index 2f84b14db0c30..34a4d3cfee753 100644 --- a/x-pack/plugins/threat_intelligence/public/modules/indicators/components/indicators_table/actions_row_cell.tsx +++ b/x-pack/plugins/threat_intelligence/public/modules/indicators/components/table/components/actions_row_cell.tsx @@ -7,10 +7,10 @@ import React, { useContext, VFC } from 'react'; import { EuiFlexGroup } from '@elastic/eui'; -import { InvestigateInTimelineButtonIcon } from '../../../timeline/components/investigate_in_timeline'; -import { Indicator } from '../../../../../common/types/indicator'; -import { OpenIndicatorFlyoutButton } from '../open_indicator_flyout_button/open_indicator_flyout_button'; -import { IndicatorsTableContext } from './context'; +import { InvestigateInTimelineButtonIcon } from '../../../../timeline/components/investigate_in_timeline'; +import { Indicator } from '../../../../../../common/types/indicator'; +import { OpenIndicatorFlyoutButton } from './open_flyout_button'; +import { IndicatorsTableContext } from '../contexts'; const INVESTIGATE_TEST_ID = 'tiIndicatorTableInvestigateInTimelineButtonIcon'; diff --git a/x-pack/plugins/threat_intelligence/public/modules/indicators/components/indicators_table/cell_actions.tsx b/x-pack/plugins/threat_intelligence/public/modules/indicators/components/table/components/cell_actions.tsx similarity index 84% rename from x-pack/plugins/threat_intelligence/public/modules/indicators/components/indicators_table/cell_actions.tsx rename to x-pack/plugins/threat_intelligence/public/modules/indicators/components/table/components/cell_actions.tsx index 9cca631ac3b5f..baed5eda31478 100644 --- a/x-pack/plugins/threat_intelligence/public/modules/indicators/components/indicators_table/cell_actions.tsx +++ b/x-pack/plugins/threat_intelligence/public/modules/indicators/components/table/components/cell_actions.tsx @@ -7,12 +7,12 @@ import React, { VFC } from 'react'; import { EuiDataGridColumnCellActionProps } from '@elastic/eui/src/components/datagrid/data_grid_types'; -import { Indicator } from '../../../../../common/types/indicator'; -import { AddToTimelineCellAction } from '../../../timeline/components/add_to_timeline'; -import { FilterInCellAction } from '../../../query_bar/components/filter_in'; -import { FilterOutCellAction } from '../../../query_bar/components/filter_out'; -import { fieldAndValueValid, getIndicatorFieldAndValue } from '../../utils/field_value'; -import type { Pagination } from '../../services/fetch_indicators'; +import { Indicator } from '../../../../../../common/types/indicator'; +import { AddToTimelineCellAction } from '../../../../timeline/components/add_to_timeline'; +import { FilterInCellAction } from '../../../../query_bar/components/filter_in'; +import { FilterOutCellAction } from '../../../../query_bar/components/filter_out'; +import { fieldAndValueValid, getIndicatorFieldAndValue } from '../../../utils/field_value'; +import type { Pagination } from '../../../services/fetch_indicators'; export const CELL_TIMELINE_BUTTON_TEST_ID = 'tiIndicatorsTableCellTimelineButton'; export const CELL_FILTER_IN_BUTTON_TEST_ID = 'tiIndicatorsTableCellFilterInButton'; diff --git a/x-pack/plugins/threat_intelligence/public/modules/indicators/components/indicators_table/cell_renderer.tsx b/x-pack/plugins/threat_intelligence/public/modules/indicators/components/table/components/cell_renderer.tsx similarity index 78% rename from x-pack/plugins/threat_intelligence/public/modules/indicators/components/indicators_table/cell_renderer.tsx rename to x-pack/plugins/threat_intelligence/public/modules/indicators/components/table/components/cell_renderer.tsx index 394d996d0ce9a..97c37c1598ccd 100644 --- a/x-pack/plugins/threat_intelligence/public/modules/indicators/components/indicators_table/cell_renderer.tsx +++ b/x-pack/plugins/threat_intelligence/public/modules/indicators/components/table/components/cell_renderer.tsx @@ -6,14 +6,13 @@ */ import { EuiDataGridCellValueElementProps } from '@elastic/eui'; -import { useContext, useEffect } from 'react'; -import { euiLightVars as themeLight, euiDarkVars as themeDark } from '@kbn/ui-theme'; -import React from 'react'; -import { useKibana } from '../../../../hooks/use_kibana'; -import { Indicator } from '../../../../../common/types/indicator'; -import { IndicatorFieldValue } from '../indicator_field_value'; -import { IndicatorsTableContext } from './context'; -import { ActionsRowCell } from './actions_row_cell'; +import React, { useContext, useEffect } from 'react'; +import { euiDarkVars as themeDark, euiLightVars as themeLight } from '@kbn/ui-theme'; +import { useKibana } from '../../../../../hooks/use_kibana'; +import { Indicator } from '../../../../../../common/types/indicator'; +import { IndicatorFieldValue } from '../../indicator_field_value'; +import { IndicatorsTableContext } from '../contexts'; +import { ActionsRowCell } from '.'; export const cellRendererFactory = (from: number) => { return ({ rowIndex, columnId, setCellProps }: EuiDataGridCellValueElementProps) => { diff --git a/x-pack/plugins/threat_intelligence/public/modules/indicators/components/indicators_field_browser/indicators_field_browser.test.tsx b/x-pack/plugins/threat_intelligence/public/modules/indicators/components/table/components/field_browser/field_browser.test.tsx similarity index 90% rename from x-pack/plugins/threat_intelligence/public/modules/indicators/components/indicators_field_browser/indicators_field_browser.test.tsx rename to x-pack/plugins/threat_intelligence/public/modules/indicators/components/table/components/field_browser/field_browser.test.tsx index 29e97062cf22d..f8a0e9b9f99c6 100644 --- a/x-pack/plugins/threat_intelligence/public/modules/indicators/components/indicators_field_browser/indicators_field_browser.test.tsx +++ b/x-pack/plugins/threat_intelligence/public/modules/indicators/components/table/components/field_browser/field_browser.test.tsx @@ -8,10 +8,10 @@ import { mockedTriggersActionsUiService, TestProvidersComponent, -} from '../../../../common/mocks/test_providers'; +} from '../../../../../../common/mocks/test_providers'; import { render } from '@testing-library/react'; import React from 'react'; -import { IndicatorsFieldBrowser } from './indicators_field_browser'; +import { IndicatorsFieldBrowser } from '.'; const stub = jest.fn(); diff --git a/x-pack/plugins/threat_intelligence/public/modules/indicators/components/indicators_field_browser/indicators_field_browser.tsx b/x-pack/plugins/threat_intelligence/public/modules/indicators/components/table/components/field_browser/field_browser.tsx similarity index 93% rename from x-pack/plugins/threat_intelligence/public/modules/indicators/components/indicators_field_browser/indicators_field_browser.tsx rename to x-pack/plugins/threat_intelligence/public/modules/indicators/components/table/components/field_browser/field_browser.tsx index 22cada18b84d8..fae02b89cefc3 100644 --- a/x-pack/plugins/threat_intelligence/public/modules/indicators/components/indicators_field_browser/indicators_field_browser.tsx +++ b/x-pack/plugins/threat_intelligence/public/modules/indicators/components/table/components/field_browser/field_browser.tsx @@ -7,7 +7,7 @@ import { BrowserField } from '@kbn/rule-registry-plugin/common'; import { VFC } from 'react'; -import { useKibana } from '../../../../hooks/use_kibana'; +import { useKibana } from '../../../../../../hooks/use_kibana'; export interface IndicatorsFieldBrowserProps { browserFields: Readonly>>; diff --git a/x-pack/plugins/threat_intelligence/public/modules/indicators/components/indicators_field_browser/index.tsx b/x-pack/plugins/threat_intelligence/public/modules/indicators/components/table/components/field_browser/index.ts similarity index 85% rename from x-pack/plugins/threat_intelligence/public/modules/indicators/components/indicators_field_browser/index.tsx rename to x-pack/plugins/threat_intelligence/public/modules/indicators/components/table/components/field_browser/index.ts index 8fefebf88e799..8a6f5ffcfe963 100644 --- a/x-pack/plugins/threat_intelligence/public/modules/indicators/components/indicators_field_browser/index.tsx +++ b/x-pack/plugins/threat_intelligence/public/modules/indicators/components/table/components/field_browser/index.ts @@ -5,4 +5,4 @@ * 2.0. */ -export * from './indicators_field_browser'; +export * from './field_browser'; diff --git a/x-pack/plugins/threat_intelligence/public/modules/indicators/components/table/components/index.ts b/x-pack/plugins/threat_intelligence/public/modules/indicators/components/table/components/index.ts new file mode 100644 index 0000000000000..d4cb33c72afb6 --- /dev/null +++ b/x-pack/plugins/threat_intelligence/public/modules/indicators/components/table/components/index.ts @@ -0,0 +1,12 @@ +/* + * 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 * from './actions_row_cell'; +export * from './cell_actions'; +export * from './cell_renderer'; +export * from './field_browser'; +export * from './open_flyout_button'; diff --git a/x-pack/plugins/threat_intelligence/public/modules/indicators/components/open_indicator_flyout_button/index.tsx b/x-pack/plugins/threat_intelligence/public/modules/indicators/components/table/components/open_flyout_button/index.ts similarity index 84% rename from x-pack/plugins/threat_intelligence/public/modules/indicators/components/open_indicator_flyout_button/index.tsx rename to x-pack/plugins/threat_intelligence/public/modules/indicators/components/table/components/open_flyout_button/index.ts index bc3de03078a92..6e3b46b779a25 100644 --- a/x-pack/plugins/threat_intelligence/public/modules/indicators/components/open_indicator_flyout_button/index.tsx +++ b/x-pack/plugins/threat_intelligence/public/modules/indicators/components/table/components/open_flyout_button/index.ts @@ -5,4 +5,4 @@ * 2.0. */ -export * from './open_indicator_flyout_button'; +export * from './open_flyout_button'; diff --git a/x-pack/plugins/threat_intelligence/public/modules/indicators/components/open_indicator_flyout_button/open_indicator_flyout_button.stories.tsx b/x-pack/plugins/threat_intelligence/public/modules/indicators/components/table/components/open_flyout_button/open_flyout_button.stories.tsx similarity index 85% rename from x-pack/plugins/threat_intelligence/public/modules/indicators/components/open_indicator_flyout_button/open_indicator_flyout_button.stories.tsx rename to x-pack/plugins/threat_intelligence/public/modules/indicators/components/table/components/open_flyout_button/open_flyout_button.stories.tsx index c64e2c5ebc067..d0bcec7068c21 100644 --- a/x-pack/plugins/threat_intelligence/public/modules/indicators/components/open_indicator_flyout_button/open_indicator_flyout_button.stories.tsx +++ b/x-pack/plugins/threat_intelligence/public/modules/indicators/components/table/components/open_flyout_button/open_flyout_button.stories.tsx @@ -8,9 +8,9 @@ import React from 'react'; import { ComponentStory } from '@storybook/react'; import { createKibanaReactContext } from '@kbn/kibana-react-plugin/public'; -import { mockUiSettingsService } from '../../../../common/mocks/mock_kibana_ui_settings_service'; -import { generateMockIndicator, Indicator } from '../../../../../common/types/indicator'; -import { OpenIndicatorFlyoutButton } from './open_indicator_flyout_button'; +import { mockUiSettingsService } from '../../../../../../common/mocks/mock_kibana_ui_settings_service'; +import { generateMockIndicator, Indicator } from '../../../../../../../common/types/indicator'; +import { OpenIndicatorFlyoutButton } from '.'; export default { component: OpenIndicatorFlyoutButton, diff --git a/x-pack/plugins/threat_intelligence/public/modules/indicators/components/open_indicator_flyout_button/open_indicator_flyout_button.test.tsx b/x-pack/plugins/threat_intelligence/public/modules/indicators/components/table/components/open_flyout_button/open_flyout_button.test.tsx similarity index 82% rename from x-pack/plugins/threat_intelligence/public/modules/indicators/components/open_indicator_flyout_button/open_indicator_flyout_button.test.tsx rename to x-pack/plugins/threat_intelligence/public/modules/indicators/components/table/components/open_flyout_button/open_flyout_button.test.tsx index ca46976a379b6..f68be6d7ea553 100644 --- a/x-pack/plugins/threat_intelligence/public/modules/indicators/components/open_indicator_flyout_button/open_indicator_flyout_button.test.tsx +++ b/x-pack/plugins/threat_intelligence/public/modules/indicators/components/table/components/open_flyout_button/open_flyout_button.test.tsx @@ -7,9 +7,9 @@ import React from 'react'; import { render } from '@testing-library/react'; -import { BUTTON_TEST_ID, OpenIndicatorFlyoutButton } from './open_indicator_flyout_button'; -import { generateMockIndicator } from '../../../../../common/types/indicator'; -import { TestProvidersComponent } from '../../../../common/mocks/test_providers'; +import { BUTTON_TEST_ID, OpenIndicatorFlyoutButton } from '.'; +import { generateMockIndicator } from '../../../../../../../common/types/indicator'; +import { TestProvidersComponent } from '../../../../../../common/mocks/test_providers'; const mockIndicator = generateMockIndicator(); diff --git a/x-pack/plugins/threat_intelligence/public/modules/indicators/components/open_indicator_flyout_button/open_indicator_flyout_button.tsx b/x-pack/plugins/threat_intelligence/public/modules/indicators/components/table/components/open_flyout_button/open_flyout_button.tsx similarity index 95% rename from x-pack/plugins/threat_intelligence/public/modules/indicators/components/open_indicator_flyout_button/open_indicator_flyout_button.tsx rename to x-pack/plugins/threat_intelligence/public/modules/indicators/components/table/components/open_flyout_button/open_flyout_button.tsx index 08a27381ce9a7..7ae0584447a5b 100644 --- a/x-pack/plugins/threat_intelligence/public/modules/indicators/components/open_indicator_flyout_button/open_indicator_flyout_button.tsx +++ b/x-pack/plugins/threat_intelligence/public/modules/indicators/components/table/components/open_flyout_button/open_flyout_button.tsx @@ -8,7 +8,7 @@ import React, { VFC } from 'react'; import { EuiButtonIcon, EuiToolTip } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -import { Indicator } from '../../../../../common/types/indicator'; +import { Indicator } from '../../../../../../../common/types/indicator'; export const BUTTON_TEST_ID = 'tiToggleIndicatorFlyoutButton'; diff --git a/x-pack/plugins/threat_intelligence/public/modules/indicators/components/indicators_table/context.ts b/x-pack/plugins/threat_intelligence/public/modules/indicators/components/table/contexts/context.ts similarity index 89% rename from x-pack/plugins/threat_intelligence/public/modules/indicators/components/indicators_table/context.ts rename to x-pack/plugins/threat_intelligence/public/modules/indicators/components/table/contexts/context.ts index 41596a257dc9e..e0125544a6453 100644 --- a/x-pack/plugins/threat_intelligence/public/modules/indicators/components/indicators_table/context.ts +++ b/x-pack/plugins/threat_intelligence/public/modules/indicators/components/table/contexts/context.ts @@ -6,7 +6,7 @@ */ import { createContext, Dispatch, SetStateAction } from 'react'; -import { Indicator } from '../../../../../common/types/indicator'; +import { Indicator } from '../../../../../../common/types/indicator'; export interface IndicatorsTableContextValue { expanded: Indicator | undefined; diff --git a/x-pack/plugins/threat_intelligence/public/modules/indicators/components/table/contexts/index.ts b/x-pack/plugins/threat_intelligence/public/modules/indicators/components/table/contexts/index.ts new file mode 100644 index 0000000000000..e9a2f3ab7be99 --- /dev/null +++ b/x-pack/plugins/threat_intelligence/public/modules/indicators/components/table/contexts/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 * from './context'; diff --git a/x-pack/plugins/threat_intelligence/public/modules/indicators/components/indicators_table/hooks/__snapshots__/use_toolbar_options.test.tsx.snap b/x-pack/plugins/threat_intelligence/public/modules/indicators/components/table/hooks/__snapshots__/use_toolbar_options.test.tsx.snap similarity index 100% rename from x-pack/plugins/threat_intelligence/public/modules/indicators/components/indicators_table/hooks/__snapshots__/use_toolbar_options.test.tsx.snap rename to x-pack/plugins/threat_intelligence/public/modules/indicators/components/table/hooks/__snapshots__/use_toolbar_options.test.tsx.snap diff --git a/x-pack/plugins/threat_intelligence/public/modules/indicators/components/table/hooks/index.ts b/x-pack/plugins/threat_intelligence/public/modules/indicators/components/table/hooks/index.ts new file mode 100644 index 0000000000000..e92a0e6cf055b --- /dev/null +++ b/x-pack/plugins/threat_intelligence/public/modules/indicators/components/table/hooks/index.ts @@ -0,0 +1,9 @@ +/* + * 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 * from './use_column_settings'; +export * from './use_toolbar_options'; diff --git a/x-pack/plugins/threat_intelligence/public/modules/indicators/components/indicators_table/hooks/use_column_settings.test.ts b/x-pack/plugins/threat_intelligence/public/modules/indicators/components/table/hooks/use_column_settings.test.ts similarity index 99% rename from x-pack/plugins/threat_intelligence/public/modules/indicators/components/indicators_table/hooks/use_column_settings.test.ts rename to x-pack/plugins/threat_intelligence/public/modules/indicators/components/table/hooks/use_column_settings.test.ts index 32b1e6998e954..e5df4a3931bd3 100644 --- a/x-pack/plugins/threat_intelligence/public/modules/indicators/components/indicators_table/hooks/use_column_settings.test.ts +++ b/x-pack/plugins/threat_intelligence/public/modules/indicators/components/table/hooks/use_column_settings.test.ts @@ -7,7 +7,7 @@ import { mockedServices, TestProvidersComponent } from '../../../../../common/mocks/test_providers'; import { act, renderHook } from '@testing-library/react-hooks'; -import { useColumnSettings } from './use_column_settings'; +import { useColumnSettings } from '.'; const renderUseColumnSettings = () => renderHook(() => useColumnSettings(), { wrapper: TestProvidersComponent }); diff --git a/x-pack/plugins/threat_intelligence/public/modules/indicators/components/indicators_table/hooks/use_column_settings.ts b/x-pack/plugins/threat_intelligence/public/modules/indicators/components/table/hooks/use_column_settings.ts similarity index 100% rename from x-pack/plugins/threat_intelligence/public/modules/indicators/components/indicators_table/hooks/use_column_settings.ts rename to x-pack/plugins/threat_intelligence/public/modules/indicators/components/table/hooks/use_column_settings.ts diff --git a/x-pack/plugins/threat_intelligence/public/modules/indicators/components/indicators_table/hooks/use_toolbar_options.test.tsx b/x-pack/plugins/threat_intelligence/public/modules/indicators/components/table/hooks/use_toolbar_options.test.tsx similarity index 96% rename from x-pack/plugins/threat_intelligence/public/modules/indicators/components/indicators_table/hooks/use_toolbar_options.test.tsx rename to x-pack/plugins/threat_intelligence/public/modules/indicators/components/table/hooks/use_toolbar_options.test.tsx index ecf1cbf0a477a..8e7d8576e313f 100644 --- a/x-pack/plugins/threat_intelligence/public/modules/indicators/components/indicators_table/hooks/use_toolbar_options.test.tsx +++ b/x-pack/plugins/threat_intelligence/public/modules/indicators/components/table/hooks/use_toolbar_options.test.tsx @@ -7,7 +7,7 @@ import { TestProvidersComponent } from '../../../../../common/mocks/test_providers'; import { renderHook } from '@testing-library/react-hooks'; -import { useToolbarOptions } from './use_toolbar_options'; +import { useToolbarOptions } from '.'; describe('useToolbarOptions()', () => { it('should return correct value for 0 indicators total', () => { diff --git a/x-pack/plugins/threat_intelligence/public/modules/indicators/components/indicators_table/hooks/use_toolbar_options.tsx b/x-pack/plugins/threat_intelligence/public/modules/indicators/components/table/hooks/use_toolbar_options.tsx similarity index 94% rename from x-pack/plugins/threat_intelligence/public/modules/indicators/components/indicators_table/hooks/use_toolbar_options.tsx rename to x-pack/plugins/threat_intelligence/public/modules/indicators/components/table/hooks/use_toolbar_options.tsx index 12bd94951e33c..d1907160e0d31 100644 --- a/x-pack/plugins/threat_intelligence/public/modules/indicators/components/indicators_table/hooks/use_toolbar_options.tsx +++ b/x-pack/plugins/threat_intelligence/public/modules/indicators/components/table/hooks/use_toolbar_options.tsx @@ -5,13 +5,12 @@ * 2.0. */ -import React from 'react'; -import { useMemo } from 'react'; +import React, { useMemo } from 'react'; import { EuiButtonIcon, EuiDataGridColumn, EuiText } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; import { BrowserField } from '@kbn/rule-registry-plugin/common'; import { useInspector } from '../../../../../hooks/use_inspector'; -import { IndicatorsFieldBrowser } from '../../indicators_field_browser'; +import { IndicatorsFieldBrowser } from '../components'; const INSPECT_BUTTON_TEST_ID = 'tiIndicatorsGridInspect'; diff --git a/x-pack/plugins/threat_intelligence/public/modules/indicators/components/indicators_table/index.tsx b/x-pack/plugins/threat_intelligence/public/modules/indicators/components/table/index.tsx similarity index 87% rename from x-pack/plugins/threat_intelligence/public/modules/indicators/components/indicators_table/index.tsx rename to x-pack/plugins/threat_intelligence/public/modules/indicators/components/table/index.tsx index b337d57fe4e1f..0572205ad74e6 100644 --- a/x-pack/plugins/threat_intelligence/public/modules/indicators/components/indicators_table/index.tsx +++ b/x-pack/plugins/threat_intelligence/public/modules/indicators/components/table/index.tsx @@ -5,4 +5,4 @@ * 2.0. */ -export * from './indicators_table'; +export * from './table'; diff --git a/x-pack/plugins/threat_intelligence/public/modules/indicators/components/indicators_table/indicators_table.stories.tsx b/x-pack/plugins/threat_intelligence/public/modules/indicators/components/table/table.stories.tsx similarity index 97% rename from x-pack/plugins/threat_intelligence/public/modules/indicators/components/indicators_table/indicators_table.stories.tsx rename to x-pack/plugins/threat_intelligence/public/modules/indicators/components/table/table.stories.tsx index 95217171cb9e5..f11977145d7a4 100644 --- a/x-pack/plugins/threat_intelligence/public/modules/indicators/components/indicators_table/indicators_table.stories.tsx +++ b/x-pack/plugins/threat_intelligence/public/modules/indicators/components/table/table.stories.tsx @@ -10,9 +10,9 @@ import { DataView } from '@kbn/data-views-plugin/common'; import { mockIndicatorsFiltersContext } from '../../../../common/mocks/mock_indicators_filters_context'; import { StoryProvidersComponent } from '../../../../common/mocks/story_providers'; import { generateMockIndicator, Indicator } from '../../../../../common/types/indicator'; -import { IndicatorsTable } from './indicators_table'; +import { IndicatorsTable } from '.'; import { IndicatorsFiltersContext } from '../../containers/indicators_filters/context'; -import { DEFAULT_COLUMNS } from './hooks/use_column_settings'; +import { DEFAULT_COLUMNS } from './hooks'; export default { component: IndicatorsTable, diff --git a/x-pack/plugins/threat_intelligence/public/modules/indicators/components/indicators_table/indicators_table.test.tsx b/x-pack/plugins/threat_intelligence/public/modules/indicators/components/table/table.test.tsx similarity index 94% rename from x-pack/plugins/threat_intelligence/public/modules/indicators/components/indicators_table/indicators_table.test.tsx rename to x-pack/plugins/threat_intelligence/public/modules/indicators/components/table/table.test.tsx index eb1d4c3411c1f..2d51a75cd2c83 100644 --- a/x-pack/plugins/threat_intelligence/public/modules/indicators/components/indicators_table/indicators_table.test.tsx +++ b/x-pack/plugins/threat_intelligence/public/modules/indicators/components/table/table.test.tsx @@ -7,14 +7,10 @@ import { act, render, screen } from '@testing-library/react'; import React from 'react'; -import { - IndicatorsTable, - IndicatorsTableProps, - TABLE_UPDATE_PROGRESS_TEST_ID, -} from './indicators_table'; +import { IndicatorsTable, IndicatorsTableProps, TABLE_UPDATE_PROGRESS_TEST_ID } from '.'; import { TestProvidersComponent } from '../../../../common/mocks/test_providers'; import { generateMockIndicator, Indicator } from '../../../../../common/types/indicator'; -import { BUTTON_TEST_ID } from '../open_indicator_flyout_button'; +import { BUTTON_TEST_ID } from './components/open_flyout_button'; import { TITLE_TEST_ID } from '../flyout'; import { SecuritySolutionDataViewBase } from '../../../../types'; diff --git a/x-pack/plugins/threat_intelligence/public/modules/indicators/components/indicators_table/indicators_table.tsx b/x-pack/plugins/threat_intelligence/public/modules/indicators/components/table/table.tsx similarity index 95% rename from x-pack/plugins/threat_intelligence/public/modules/indicators/components/indicators_table/indicators_table.tsx rename to x-pack/plugins/threat_intelligence/public/modules/indicators/components/table/table.tsx index 7391003471870..aa1afd0d5b11c 100644 --- a/x-pack/plugins/threat_intelligence/public/modules/indicators/components/indicators_table/indicators_table.tsx +++ b/x-pack/plugins/threat_intelligence/public/modules/indicators/components/table/table.tsx @@ -5,7 +5,7 @@ * 2.0. */ -import React, { VFC, useState, useMemo } from 'react'; +import React, { useMemo, useState, VFC } from 'react'; import { EuiDataGrid, EuiDataGridColumnCellActionProps, @@ -19,15 +19,13 @@ import { import { FormattedMessage } from '@kbn/i18n-react'; import { EuiDataGridColumn } from '@elastic/eui/src/components/datagrid/data_grid_types'; -import { CellActions } from './cell_actions'; +import { CellActions, cellRendererFactory } from './components'; import { BrowserFields, SecuritySolutionDataViewBase } from '../../../../types'; import { Indicator, RawIndicatorFieldId } from '../../../../../common/types/indicator'; -import { cellRendererFactory } from './cell_renderer'; import { EmptyState } from '../../../../components/empty_state'; -import { IndicatorsTableContext, IndicatorsTableContextValue } from './context'; +import { IndicatorsTableContext, IndicatorsTableContextValue } from './contexts'; import { IndicatorsFlyout } from '../flyout'; -import { useToolbarOptions } from './hooks/use_toolbar_options'; -import { ColumnSettingsValue } from './hooks/use_column_settings'; +import { ColumnSettingsValue, useToolbarOptions } from './hooks'; import { useFieldTypes } from '../../../../hooks/use_field_types'; import { getFieldSchema } from '../../utils/get_field_schema'; import { Pagination } from '../../services/fetch_indicators'; diff --git a/x-pack/plugins/threat_intelligence/public/modules/indicators/indicators_page.test.tsx b/x-pack/plugins/threat_intelligence/public/modules/indicators/indicators_page.test.tsx index 7f4db9fa75262..527507584f0e1 100644 --- a/x-pack/plugins/threat_intelligence/public/modules/indicators/indicators_page.test.tsx +++ b/x-pack/plugins/threat_intelligence/public/modules/indicators/indicators_page.test.tsx @@ -13,7 +13,7 @@ import { useAggregatedIndicators } from './hooks/use_aggregated_indicators'; import { useFilters } from '../query_bar/hooks/use_filters'; import moment from 'moment'; import { TestProvidersComponent } from '../../common/mocks/test_providers'; -import { TABLE_TEST_ID } from './components/indicators_table'; +import { TABLE_TEST_ID } from './components/table'; import { mockTimeRange } from '../../common/mocks/mock_indicators_filters_context'; jest.mock('../query_bar/hooks/use_filters'); diff --git a/x-pack/plugins/threat_intelligence/public/modules/indicators/indicators_page.tsx b/x-pack/plugins/threat_intelligence/public/modules/indicators/indicators_page.tsx index fcf690631d740..195bd74238241 100644 --- a/x-pack/plugins/threat_intelligence/public/modules/indicators/indicators_page.tsx +++ b/x-pack/plugins/threat_intelligence/public/modules/indicators/indicators_page.tsx @@ -8,7 +8,7 @@ import React, { FC, VFC } from 'react'; import { QueryClient, QueryClientProvider } from '@tanstack/react-query'; import { IndicatorsBarChartWrapper } from './components/barchart'; -import { IndicatorsTable } from './components/indicators_table/indicators_table'; +import { IndicatorsTable } from './components/table'; import { useIndicators } from './hooks/use_indicators'; import { DefaultPageLayout } from '../../components/layout'; import { useFilters } from '../query_bar/hooks/use_filters'; @@ -16,7 +16,7 @@ import { FiltersGlobal } from '../../containers/filters_global'; import { useSourcererDataView } from './hooks/use_sourcerer_data_view'; import { FieldTypesProvider } from '../../containers/field_types_provider'; import { InspectorProvider } from '../../containers/inspector'; -import { useColumnSettings } from './components/indicators_table/hooks/use_column_settings'; +import { useColumnSettings } from './components/table/hooks'; import { useAggregatedIndicators } from './hooks/use_aggregated_indicators'; import { IndicatorsFilters } from './containers/indicators_filters'; import { useSecurityContext } from '../../hooks/use_security_context';