Skip to content

[TIP] Cleanup structure and imports for the entire indicators module#142788

Merged
PhilippeOberti merged 2 commits intoelastic:mainfrom
PhilippeOberti:reorg-indicators-module
Oct 13, 2022
Merged

[TIP] Cleanup structure and imports for the entire indicators module#142788
PhilippeOberti merged 2 commits intoelastic:mainfrom
PhilippeOberti:reorg-indicators-module

Conversation

@PhilippeOberti
Copy link
Copy Markdown
Contributor

@PhilippeOberti PhilippeOberti commented Oct 5, 2022

Summary

This PR continues the Threat Intelligence plugin code cleanup (see https://github.com/elastic/security-team/issues/4983) by focusing on the indicators module folder.

There are a lot of file changed but the changes are actually pretty small:

  • rename indicator_field_label to field_label
  • rename indicator_field_value to field_value
  • rename index.tsx to index.ts
  • move indicators_page.tsx under pages folder and rename to indicators.tsx
  • rename use_indicators_filters_context to use_filters_context
  • rename use_indicators_total_count to use_total_count
  • add index.ts at root of indicators module and update imports in other modules accordingly
  • optimize imports

No UI changes.

Here's the folder structure for the entire indicators module folder:

.
├── components
│   ├── barchart
│   │   ├── __snapshots__
│   │   │   └── wrapper.test.tsx.snap
│   │   ├── barchart
│   │   │   ├── __snapshots__
│   │   │   │   └── barchart.test.tsx.snap
│   │   │   ├── barchart.stories.tsx
│   │   │   ├── barchart.test.tsx
│   │   │   ├── barchart.tsx
│   │   │   └── index.ts
│   │   ├── field_selector
│   │   │   ├── __snapshots__
│   │   │   │   └── field_selector.test.tsx.snap
│   │   │   ├── field_selector.stories.tsx
│   │   │   ├── field_selector.test.tsx
│   │   │   ├── field_selector.tsx
│   │   │   ├── index.ts
│   │   │   └── styles.ts
│   │   ├── index.ts
│   │   ├── legend_action
│   │   │   ├── index.ts
│   │   │   └── legend_action.tsx
│   │   ├── wrapper.stories.tsx
│   │   ├── wrapper.test.tsx
│   │   └── wrapper.tsx
│   ├── copy_to_clipboard
│   │   ├── __snapshots__
│   │   │   └── copy_to_clipboard.test.tsx.snap
│   │   ├── copy_to_clipboard.stories.tsx
│   │   ├── copy_to_clipboard.test.tsx
│   │   ├── copy_to_clipboard.tsx
│   │   └── index.ts
│   ├── field_label
│   │   ├── field_label.tsx
│   │   └── index.ts
│   ├── field_value
│   │   ├── __snapshots__
│   │   │   └── field.test.tsx.snap
│   │   ├── field.stories.tsx
│   │   ├── field.test.tsx
│   │   ├── field_value.tsx
│   │   └── index.ts
│   ├── flyout
│   │   ├── empty_prompt
│   │   │   ├── empty_prompt.stories.tsx
│   │   │   ├── empty_prompt.tsx
│   │   │   └── index.ts
│   │   ├── fields_table
│   │   │   ├── fields_table.stories.tsx
│   │   │   ├── fields_table.tsx
│   │   │   └── index.ts
│   │   ├── flyout.stories.tsx
│   │   ├── flyout.test.tsx
│   │   ├── flyout.tsx
│   │   ├── index.ts
│   │   ├── indicator_value_actions
│   │   │   ├── index.ts
│   │   │   └── indicator_value_actions.tsx
│   │   ├── json_tab
│   │   │   ├── index.ts
│   │   │   ├── json_tab.stories.tsx
│   │   │   ├── json_tab.test.tsx
│   │   │   └── json_tab.tsx
│   │   ├── overview_tab
│   │   │   ├── block
│   │   │   │   ├── block.stories.tsx
│   │   │   │   ├── block.tsx
│   │   │   │   └── index.ts
│   │   │   ├── highlighted_values_table
│   │   │   │   ├── highlighted_values_table.tsx
│   │   │   │   └── index.ts
│   │   │   ├── index.ts
│   │   │   ├── overview_tab.stories.tsx
│   │   │   ├── overview_tab.test.tsx
│   │   │   └── overview_tab.tsx
│   │   └── table_tab
│   │       ├── index.tsx
│   │       ├── table_tab.stories.tsx
│   │       ├── table_tab.test.tsx
│   │       └── table_tab.tsx
│   └── table
│       ├── components
│       │   ├── actions_row_cell.tsx
│       │   ├── cell_actions.tsx
│       │   ├── cell_popover_renderer.tsx
│       │   ├── cell_renderer.tsx
│       │   ├── field_browser
│       │   │   ├── field_browser.test.tsx
│       │   │   ├── field_browser.tsx
│       │   │   └── index.ts
│       │   ├── index.ts
│       │   ├── open_flyout_button
│       │   │   ├── index.ts
│       │   │   ├── open_flyout_button.stories.tsx
│       │   │   ├── open_flyout_button.test.tsx
│       │   │   └── open_flyout_button.tsx
│       │   └── styles.ts
│       ├── contexts
│       │   ├── context.ts
│       │   └── index.ts
│       ├── hooks
│       │   ├── __snapshots__
│       │   │   └── use_toolbar_options.test.tsx.snap
│       │   ├── index.ts
│       │   ├── use_column_settings.test.ts
│       │   ├── use_column_settings.ts
│       │   ├── use_toolbar_options.test.tsx
│       │   └── use_toolbar_options.tsx
│       ├── index.tsx
│       ├── table.stories.tsx
│       ├── table.test.tsx
│       └── table.tsx
├── containers
│   └── filters
│       ├── context.ts
│       ├── filters.tsx
│       └── index.ts
├── hooks
│   ├── index.ts
│   ├── use_aggregated_indicators.test.tsx
│   ├── use_aggregated_indicators.ts
│   ├── use_filters_context.ts
│   ├── use_indicators.test.tsx
│   ├── use_indicators.ts
│   ├── use_sourcerer_data_view.ts
│   ├── use_total_count.test.tsx
│   └── use_total_count.tsx
├── index.ts
├── pages
│   ├── index.ts
│   ├── indicators.test.tsx
│   └── indicators.tsx
├── services
│   ├── fetch_aggregated_indicators.test.ts
│   ├── fetch_aggregated_indicators.ts
│   ├── fetch_indicators.test.ts
│   ├── fetch_indicators.ts
│   └── index.ts
└── utils
    ├── display_name.test.ts
    ├── display_name.ts
    ├── field_value.test.ts
    ├── field_value.ts
    ├── get_field_schema.ts
    ├── get_indicator_query_params.ts
    ├── get_runtime_mappings.ts
    ├── index.ts
    ├── search.ts
    ├── unwrap_value.test.ts
    └── unwrap_value.ts

@PhilippeOberti PhilippeOberti requested a review from a team as a code owner October 5, 2022 18:54
@PhilippeOberti PhilippeOberti added release_note:skip Skip the PR/issue when compiling release notes Team: Protections Experience v8.6.0 labels Oct 5, 2022
@PhilippeOberti PhilippeOberti force-pushed the reorg-indicators-module branch from b3a5901 to f34c67b Compare October 10, 2022 17:25
- rename indicator_field_label to field_label
- rename indicator_field_value to field_value
- rename index.tsx to index.ts
- move indicators_page.tsx under pages folder and rename to indicators.tsx
- rename use_indicators_filters_context to use_filters_context
- rename use_indicators_total_count to use_total_count
- add index.ts at root of indicators module and update imports in other modules accordingly
@PhilippeOberti PhilippeOberti force-pushed the reorg-indicators-module branch from f34c67b to 1337689 Compare October 10, 2022 17:57
@kibana-ci
Copy link
Copy Markdown

💚 Build Succeeded

Metrics [docs]

Module Count

Fewer modules leads to a faster build time

id before after diff
threatIntelligence 222 225 +3

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
threatIntelligence 116.0KB 115.9KB -128.0B

Page load bundle

Size of the bundles that are downloaded on every page load. Target size is below 100kb

id before after diff
threatIntelligence 28.6KB 30.0KB +1.4KB

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

@PhilippeOberti PhilippeOberti merged commit 6cb56f1 into elastic:main Oct 13, 2022
@kibanamachine kibanamachine added the backport:skip This PR does not require backporting label Oct 13, 2022
@PhilippeOberti PhilippeOberti deleted the reorg-indicators-module branch October 13, 2022 13:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport:skip This PR does not require backporting release_note:skip Skip the PR/issue when compiling release notes v8.6.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants