* [Security Solution] Remove a data fetching hook from the add to timeline action component (#124331)
* Fetch alert ecs data in actions.tsx and not a hook in every table row
* Add error handling and tests for theshold timelines
* Fix bad merge
* Remove unused imports
* Actually remove unused file
* Remove usage of alertIds and dead code from cases
* Add basic sanity tests that ensure no extra network calls are being made
* Remove unused operator
* Remove unused imports
* Remove unused mock
(cherry picked from commit e312c36e4c)
# Conflicts:
# x-pack/plugins/cases/public/components/case_view/case_view_page.tsx
# x-pack/plugins/cases/public/components/user_actions/types.ts
# x-pack/plugins/security_solution/public/cases/pages/index.tsx
# x-pack/plugins/security_solution/public/timelines/components/side_panel/event_details/footer.tsx
* Fix types
* Fix failing tests
* Update reporter fto use username instead of full name
* Fix test for username
Co-authored-by: Kristof-Pierre Cummings <kristofpierre.cummings@elastic.co>
# Conflicts:
# x-pack/plugins/cases/public/components/all_cases/all_cases_list.test.tsx
* [Security Solutions] Removes tech debt of exporting all from linter rule for cases plugin in the common section (#120310)
See: https://github.com/elastic/kibana/issues/110903, https://github.com/elastic/kibana/issues/120234
This removes as many top level API `export *` spots from:
* `cases` plugin within the common section
as we can. This reduces the number of metrics and warning about undocumented functions and reduces the page load size from `cases/common/index.ts`. Look at the metrics from the build below and you will see drop off numbers across the board for required API documentation to the page load size.
In the file `cases/common/index.ts` I now put the advice of:
```
// Careful of exporting anything from this file as any file(s) you export here will cause your page bundle size to increase.
// If you're using functions/types/etc... internally or within integration tests it's best to import directly from their paths
// than expose the functions/types/etc... here. You should _only_ expose functions/types/etc... that need to be shared with other plugins here.
// When you do have to add things here you might want to consider creating a package such as kbn-cases-constants to share with
// other plugins instead as packages are easier to break down and you do not have to carry the cost of extra plugin weight on
// first download since the other plugins/areas of your code can directly pull from the package in their async imports.
// For example, constants below could eventually be in a "kbn-cases-constants" instead.
// See: https://docs.elastic.dev/kibana-dev-docs/key-concepts/platform-intro#public-plugin-api
```
Some of those that are exposed such as `throwErrors` might actually be small simple mistakes as `security_solution` is using it but it has a "copy" of the same utility within just its server section rather than within its common section. That can be done in a different cleanup PR and cases team can decide what to do moving forward with their API before or post 8.0.0 release.
For the metric increasing of:
| id | [before](f01106c100) | [after](f2e5d6a848) | diff |
| --- | --- | --- | --- |
| `cases` | 16 | 22 | +6 |
Running that suggestion:
```sh
node --max-old-space-size=6096 scripts/build_api_docs --plugin cases --stats exports
```
I see this:
<img width="1851" alt="Screen Shot 2021-12-03 at 9 30 45 AM" src="https://user-images.githubusercontent.com/1151048/144638952-43d50478-ea12-4ce1-8f73-585c735772b4.png">
I don't know if there is a way just yet to mark undocumented public API's but I don't feel concerned with it at the moment and if the case team wants to re-expose those or are going to support API's through documentation they can decide what to do. This PR is more about just removing as much as possible to start with and then go the other direction where the individual teams can decide what to expose and if the download weight is worth it or if it's just `export type` and holds no weight, etc...
* Updated staged files
* Fixed prettier issues
* [kbn/rule-data-utils] add submodules and require public use them
* fix lint errors
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Spencer <email@spalger.com>
* fixed line wrapping
* Prevent title from breaking word on wrap.
* remove extra padding
* Fixes "Cases" double header. Actions on same row.
* remove leftover code / fix check
* fix i18n check
Co-authored-by: Henry Harding <henry.harding@elastic.co>
* [Cases] [108671] Fix faulty status api call, if selection is same
* Add unit test to ensure selecting same status message does not call api
Co-authored-by: Kristof-Pierre Cummings <kristofpierre.cummings@elastic.co>
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Kristof C <kpac.ja@gmail.com>
Co-authored-by: Kristof-Pierre Cummings <kristofpierre.cummings@elastic.co>
* replace any with unknown in http client and types (#114265)
# Conflicts:
# x-pack/plugins/enterprise_search/public/applications/app_search/components/curations/components/suggestions_logic.tsx
# x-pack/plugins/enterprise_search/public/applications/app_search/components/curations/views/curation_suggestion/curation_suggestion_logic.ts
# x-pack/plugins/enterprise_search/public/applications/app_search/components/curations/views/curations_settings/curations_settings_logic.ts
# x-pack/plugins/triggers_actions_ui/public/application/components/builtin_action_types/resilient/api.ts
* commit using @elastic.co
* Fix add to case functionality
* Use appropriate owner when attaching an alert to a case
* Use field name constants
* Gotta reskip the test
* Better error handling
* Fix type errors
* Fix tests
Co-authored-by: Madison Caldwell <madison.rey.caldwell@gmail.com>
* POC
* Before and after saving connector callbacks
* Draft callbacks on SN
* Migrate legacy connectors
* Add deprecated connector
* Fix callbacks types
* Pass isEdit to connector forms
* Get application info hook
* Validate instance on save
* Support both legacy and new app
* Seperate SIR
* Log application version & and throw otherwise
* Deprecated tooltip cases
* Deprecated tooltip alerts
* Improve message
* Improve translation
* Change to elastic table & fix types
* Add callbacks to add modal
* Pass new props to tests
* Change health api url to production
* Better installation message
* Migrate connectors functionality
* Change migration version to 7.16
* Fix bug
* Improve message
* Use feature flag
* Create credentials component
* Add form to migration modal
* Improve installation callout
* Improve deprecated callout
* Improve modal
* Improve application required modal
* Improve SN form
* Support both connectors
* Support correlation attributes
* Use same component for SIR
* Prevent using legacy connectors when creating a case
* Add observables
* Unique observables
* Push only if there are observables
* Change labels to plural
* Pass correlation ID and value
* Show errors on the callout
* Improve alerts tooltip
* Improve cases tooltip
* Warning callout on cases configuration page
* Fix tooltip content
* Add help text
* Change from string to array
* Fix i18n
* Fix spelling
* Update incidents for ITSM
* Update incidents for SIR
* Fix types
* Fix backend tests
* Fix frontend tests
* Add service tests
* Fix i18n
* Fix cypress test
* Improve ServiceNow intergration tests
* Fix cases integration tests
* Fix triggers actions ui end to end test
* Fix tests
* Rename modal
* Show error message on modal
* Create useOldConnector helper
* Show the update incident toggle only on new connectors
* Add observables for old connectors
* Fix error when obs are empty
* Enable SIR for alerts
* Fix types
* Improve combineObservables
* Add test for the sir api
* Add test for the sir service
* Add documentation
* PR feedback
* Improve cases deprecated callouts
* Improve observables format
* Add integration tests for SIR
* Fix doc error
* Add config tests
* Add getIncident tests
* Add util tests
* Add migration tests
* Add tests for connectors and improve callouts
* Add more tests
* Add more UI tests
* update connector modal to flyout
* PR feedback
* Test CI
* restore auth callout
* edit connector form spacing
* Improve integration tests
* Add 8 pixels to the left of the connector icon
* update switch to checkboxes
* case detail ui
* Seperate ServiceNow integration tests
* Remove observables fields
* Add correlation values
* Fix merge
* add deprecated text in the dropdown
* update card icon to the right
* new update connetor test and other tests fixes
* PR feedback
* Remove observables from docs
* Remove unused translations
* Using eui theme for styling
* Content feeback
* Add more unit tests
* Fix i18n
* Fix types
* Fixes
* Fixes
* test properly
* fix duplicated translation
* Simplify tooltip
* Writing feedback
Co-authored-by: Christos Nasikas <christos.nasikas@elastic.co>
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Jonathan Buttner <jonathan.buttner@elastic.co>
* backend implementation
* front UI changes to manage all resolve outcomes
* add spaces dependency to o11y
* tests fixed
* hack removed
* added resolve api integration test
* unit tests for the front changes
* add base resolve cypress test
* non-null assertions removed
* add resolve operation for logging
* eslint fix new rule
* create test snapshot
* migration resolve functional test
* Making progress
* Fleshing out the extraction logic
* Finishing migration logic and starting more tests
* Finishing migration unit tests
* Making progress on services
* Finishing transform to es schema
* Finishing transform functionality and unit tests
* reverting migration data updates
* Cleaning up type errors
* fixing test error
* Working migration tests
* Refactoring retrieval of connector fields
* Refactoring connector id in and tests in frontend
* Fixing tests and finished refactoring parse string
* Fixing integration test
* Fixing integration tests
* Removing some duplicate code and updating test name
* Fixing create connector user action bug
* Addressing feedback and logging error
* Moving parsing function to common
* Fixing type errors
* Fixing type errors
* Addressing feedback
* Fixing lint errors
* Adjusting import for user action changes
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
* Making progress
* Fleshing out the extraction logic
* Finishing migration logic and starting more tests
* Finishing migration unit tests
* Making progress on services
* Finishing transform to es schema
* Finishing transform functionality and unit tests
* reverting migration data updates
* Cleaning up type errors
* fixing test error
* Working migration tests
* Refactoring retrieval of connector fields
* Refactoring connector id in and tests in frontend
* Fixing tests and finished refactoring parse string
* Fixing integration test
* Fixing integration tests
* Removing some duplicate code and updating test name
* Fixing create connector user action bug
* Addressing feedback and logging error
* Moving parsing function to common
* Fixing type errors
* Fixing type errors
* Addressing feedback
* Fixing lint errors
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>