Commit graph

228 commits

Author SHA1 Message Date
Tyler Smalley b593781009
Jest multi-project configuration (#77894)
Signed-off-by: Tyler Smalley <tyler.smalley@elastic.co>
2020-12-02 11:42:23 -08:00
Gidi Meir Morris 6da6db28ac
Revert the Revert of "[Alerting] renames Resolved action group to Recovered (#84123)" (#84662)
Reapplies the #84123 PR:
This PR changes the default term from “Resolved” to “Recovered”, as it fits most use cases and we feel users are most likely to understand its meaning across domains.
2020-12-01 17:30:05 +00:00
Christos Nasikas 636f91c29a
[Security Solution][Detections] Fix labels and issue with mandatory fields (#84525)
* Fix labeling and bugs

* Improve naming
2020-12-01 18:01:37 +02:00
Tyler Smalley 0b5c55c597 Revert "[Alerting] renames Resolved action group to Recovered (#84123)"
This reverts commit 7dcaff5ddd.
2020-12-01 07:10:09 -08:00
Gidi Meir Morris 7dcaff5ddd
[Alerting] renames Resolved action group to Recovered (#84123)
This PR changes the default term from “Resolved” to “Recovered”, as it fits most use cases and we feel users are most likely to understand its meaning across domains.
2020-12-01 10:38:28 +00:00
Yuliia Naumenko 67564b9776
Added default dedupKey value as an {{alertInstanceId}} to provide grouping functionality for PagerDuty incidents. (#84598)
* Added default dedupKey value as an {{alertInstanceId}} to provide grouping functionality for PagerDuty incidents.

* fixed type check
2020-11-30 19:23:26 -08:00
Gidi Meir Morris bc1fd6ceb8
[Alerting] fixes buggy default message behaviour (#84202)
This PR addresses some weird UX we've identified with default values in Action Params components and their inferred defaults when placed inside of an Alerts flyout.
Key changes:

1. Typing of these components has been corrected to reflect that we expect these parameters to only be _partial_, as the form is used to set these values (for example, the `message` field of the Server Log action, might or might not be set, so it should be nullable, but in the typing we treated it as the _final_ valid state, which is message not being nullable).
2. When a default message is set by the params components, the are tracked against the value of the default, which means that if the default changes, then so will the value in the field. Custom values provided by the user will not be overridden when the default changes. This has to be handled by the component itself at the moment (hopefully in the future we can make this a concern of the flyout and not each component).
3. The concept of the "Recovered" action group has been removed from these components - that's an Alerting concern, not actions, and shouldn't appear in the action components' code.
2020-11-30 17:16:04 +00:00
Rudolf Meijering ee5c9bceeb
Upgrade fp-ts to 2.8.6 (#83866)
* Upgrade fp-ts to 2.8.6

* reduce import size from io-ts

* removed unused imports

* remove usage of fpts from alerts

Co-authored-by: Gidi Meir Morris <github@gidi.io>
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2020-11-26 20:34:06 +01:00
Yuliia Naumenko b11f7830cb
[Alerting UI] Replaced AppContextProvider introduced by the plugin with KibanaContextProvider (#83248)
* Replaced AppContextProvider introduced by the plugin with KibanaContextProvider

* Removed unused files

* Fixed jest test

* Removed ActionsConnectorContext

* exposed addConnectorFlyout and editConnectorFlyouts as a plugin start result

* removed rest of unused connectors context

* fixed capabilities

* fixed jest tests

* fixed jest tests

* fixed jest tests

* fixed uptime

* fixed typecheck errors

* fixed typechecks

* fixed jest tests

* fixed type

* fixed uptime settings by pathing the correct plugin dependancy

* fixed security detection rules

* fixed due to commetns

* fixed jest tests

* fixed type check

* removed orig files

* fixed cases UI issues

* fixed due to comments

* fixed due to comments

* fixed kibana crash

* fixed es-lint
2020-11-24 00:07:47 -08:00
Gidi Meir Morris 348f6b6500
Prevents errors in Action and Alert Type UIs from cascading through Alerts Management (#83925)
This PR wraps the components injected by Alert Type and Action in `EuiErrorBoundary` components, which ensures you can still edit the Alert and other Actions when these components fail.
2020-11-23 15:38:42 +00:00
Mikhail Shustov 95861a0fb0
[DX] Prettier v2.2 (#83899)
* update prettier with ts version support

* mute type-error

* run prettier on codebase

* fix examples

* fix errors after master merged
2020-11-23 13:17:05 +01:00
Brian Seeders 21995e6c5f
Revert "Added default dedupKey value as an {{alertInstanceId}} to provide grouping functionality for PagerDuty incidents. (#83226)"
This reverts commit f79188aace.
2020-11-20 17:22:06 -05:00
Yuliia Naumenko f79188aace
Added default dedupKey value as an {{alertInstanceId}} to provide grouping functionality for PagerDuty incidents. (#83226)
* Added default dedupKey value as an {{alertInstanceId}} to provide grouping functionality for PagerDuty incidents. Set default savedObjectId as  {{alertInstanceId}} for ServiceNow, Resilient and Jira

* fixed comment

* fixed due to comments

* fixed doc

* fixed due to comments
2020-11-20 13:04:33 -08:00
ymao1 8ca1e93763
[Actions] Microsoft Teams connector (#83169)
* First cut at adding teams connector

* Getting teams connector working

* Unit tests

* Updating docs

* PR comments

* PR comments

* Changing error to debug log

* Fixing imports

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2020-11-20 11:14:17 -05:00
Gidi Meir Morris 8aa7e13cb5
[Alerting] Adds generic UI for the definition of conditions for Action Groups (#83278)
This PR adds two components to aid in creating a uniform UI for specifying the conditions for Action Groups:
1. `AlertConditions`: A component that generates a container which renders custom component for each Action Group which has had its _conditions_ specified.
2. `AlertConditionsGroup`: A component that provides a unified container for the Action Group with its name and a button for resetting its condition.

This can be used by any Alert Type to easily create the UI for adding action groups with whichever UI is specific to their component.
2020-11-20 09:26:27 +00:00
Patrick Mueller f83e06f718
[alerts] adds action group and date to mustache template variables for actions (#83195)
resolves: https://github.com/elastic/kibana/issues/67389

Adds new variables to the existing set of variables that can be used in mustache templates to be used in action parameters when creating alerts.

- `alertActionGroup` - the action group associated with the alert scheduling actions
- `date` - the current date, in ISO format
2020-11-19 12:01:44 -05:00
Gidi Meir Morris ffdc507668
fixed pagination in connectors list (#83638)
Ensures we specify the page on the EuiTable so that pagination is retain after rerenders.
2020-11-19 12:50:26 +00:00
Christos Nasikas 893b2961c0
[Security Solution][Detections] Fix adding an action to detection rules (#83722) 2020-11-19 10:24:38 +02:00
Aaron Caldwell 0546f98070
[Maps] Add query bar inputs to geo threshold alerts tracked points & boundaries (#80871)
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2020-11-18 14:47:46 -07:00
Yuliia Naumenko 3651748b77
Fixed console error, which appears when saving changes in Edit Alert flyout (#83610) 2020-11-18 13:13:50 -08:00
ymao1 4b603da9c6
Not resetting server log level if level is defined (#83651) 2020-11-18 15:59:26 -05:00
Mikhail Shustov 4917df30b9
Update typescript eslint to v4.8 (#83520)
* update deps

* update rules

use type-aware @typescript-eslint/no-shadow instead of no-shadow. do not use no-undef, rely on TypeScript instead

* fix or mute all lint errors

* react-hooks eslint plugin fails on ? syntax

* fix wrong typings in viz

* remove React as a global type

* fix eslint errors

* update version to 4.8.1

* fix a new error
2020-11-18 18:23:08 +01:00
Greg Thompson 8a7af5bbda
Upgrade EUI to v30.2.0 (#82730)
* eui to v30.2.0

* src snapshot updates

* x-pack euipanel snapshot updates

* x-pack external link updates

* security_solution_cypress external link text

* clean up
2020-11-17 14:29:57 -07:00
ymao1 ee81b5fc04
[Alerting UI] Fix console error when setting connector params (#83333)
* Fixing console errors

* Setting defaults for undefined inputs in text area/field with message variables

* Cleanup

* Cleanup

* Fixing pagerduty timestamp validation

* Fixing test

* Pagerduty params

* Reverting unnecessary changes
2020-11-17 07:29:10 -05:00
Shahzad daa7cc92f4
[Uptime] Monitor status alert use url as instance (#81736)
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2020-11-16 11:54:19 +01:00
Yuliia Naumenko 228387cb6e
[Alerting UI] Added ability to assign alert actions to resolved action group in UI (#83139)
* Added ability to assign alert actions to resolved action group in UI

* Added unit test

* Fixed due to comments
2020-11-15 09:49:17 -08:00
Tyler Smalley aba2068291
Consolidates Jest configuration files and scripts (#82671)
Jest tests are currently organized into main configuration files (src/dev/jest/config.js and x-pack/dev-tools/jest/create_jest_config.js). Both of these are similar, but very slightly due to  previously being in separate repositories. This change consolidates the scripts referenced in those configs and moves them to the `@kbn/test` project.

OSS contained an alias for `test_utils`. Those aliases have been removed in favor of importing these utilities from `@kbn/test/jest`

Blocker to #72569

Signed-off-by: Tyler Smalley <tyler.smalley@elastic.co>
2020-11-12 16:19:56 -08:00
ymao1 3412843958
[Actions] Removing placeholders and updating validation messages on connector forms (#82734)
* Removing placeholders. Updating validation messages

* Splitting out url and protocol validation

* Adding url validation for slack webhook urls

* Fixing test

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2020-11-12 15:07:12 -05:00
Gidi Meir Morris ab72206da3
[Alerting] Moves the Index & Geo Threshold UIs into the Stack Alerts Public Plugin (#82951)
This PR includes the following refactors:
1. Moves the Index Pattern Api from _Stack Alerts_ to the _Server_ plugin of _Trigger Actions UI_. This fixes a potential bug where a user could disable the _Stack Alerts_ plugin and inadvertently break the UI of the _ES Index _ action type.
2. Extracts the UI components for _Index Threshold_ and _Geo Threshold_ from the _Trigger Actions UI_ plugin and moves them into _Stack Alerts_.
2020-11-12 16:39:40 +00:00
DeFazio 2c05957582
Update alert type selection layout to rows instead of grid (#73665)
* Update layout to rows for alert types

* Fix gutter usage

* Update heading, remove icons

* Non-working update to the combo box

* Add incorrect updates with questions to fix

* Fix combo box

* Cleanup changes to specific to this module

* fixed type checks and made combobox always visible

* Added groups by producer

* Added get producer name from kibana features names

* Added search bar with list of alert types

* Added search support functionality

* fixed links to alert type

* added alert type title

* Fixed failing tests

* Design updates to list

* Remove unsed items in import list

* fixed merge issue

* Fixed due to comments

* fixed tests

* Design fixes

Co-authored-by: Yuliia Naumenko <yuliia.naumenko@elastic.com>
2020-11-09 08:38:39 -08:00
Dhruv Bodani c78cf35ba8
Added defaultActionMessage to index threshold alert UI type definition (#80936)
* resolves https://github.com/elastic/kibana/issues/78148

Adds a `defaultActionMessage` to the index threshold alert, so that the `message` parameter for actions will be pre-filled with a useful message
2020-11-09 08:35:05 -05:00
Gidi Meir Morris 3c525d7341
[Alerting] adds an Run When field in the alert flyout to assign the action to an Action Group (#82472)
Adds a `RunsWhen` field to actions in the Alerts Flyout when creating / editing an Alert which allows the user to assign specific actions to a certain Action Groups
2020-11-09 12:56:56 +00:00
Yuliia Naumenko 802c6dccb4
Implemented Alerting health status pusher by using task manager and status pooler for Kibana status plugins 'kibanahost/api/status' (#79056)
* Implemented Alerting health status pusher by using task manager and status pooler for Kibana status plugins 'kibanahost/api/status'

* Exposed health task registration to alerts plugin

* Fixed type error

* Extended health API endpoint with info about decryption failures, added correct health task implementation

* adjusted query

* Tested locally and got it working as expected, fixed tests and type check

* Added unit tests

* Changed AlertExecutionStatusErrorReasons to be enum

* Uppercase the enum

* Replaced string values to enum

* Fixed types

* Extended AlertsClient with getHealth method

* added return type to healthStatus$

* Added configurable health check interval and timestamps

* Extended update core status interval to 5mins

* Fixed failing tests

* Registered alerts config

* Fixed date for ok health state

* fixed jest test

* fixed task state

* Fixed due to comments, moved getHealth to a plugin level

* fixed type checks

* Added sorting to the latest Ok state last update

* adjusted error queries

* Fixed jest tests

* removed unused

* fixed type check
2020-11-06 16:20:39 -08:00
ymao1 dae28519e6
[Alerting] Display Action Group in Alert Details (#82645)
* Adding action group id to event log. Showing action group as part of status in alert details view

* Simplifying getting action group id

* Cleanup

* Adding unit tests

* Updating functional tests

* Updating test

* Fix types check

* Updating test

* PR fixes

* PR fixes
2020-11-06 07:28:08 -05:00
Mike Côté 1ecd12cdf3
Add description and documentation link in alert flyout (#81526)
* Add description and documentation URL in alert flyout

* Add unit tests

* Fix type check

* Add horizontal rule

* Design fixes

* Fix uptime alert link

* Fix uptime urls

* Add anchor tag

* Fix jest test failures

* Fix monitoring links
2020-11-05 19:50:50 -05:00
Christos Nasikas 7abb1e3033
[Security Solution][Case] Case action type (#80870)
* Init connector

* Add test

* Improve comment type

* Add integration tests

* Fix i18n

* Improve tests

* Show unknown when username is null

* Improve comment type

* Pass connector to case client

* Improve type after PR #82125

* Add comment migration test

* Fix integration tests

* Fix reporter on table

* Create case connector ui

* Add connector to README

* Improve casting on executor

* Translate name

* Improve test

* Create comment type enum

* Fix type

* Fix i18n

* Move README to cases

* Filter out case connector from alerting

Co-authored-by: Mike Côté <mikecote@users.noreply.github.com>

Co-authored-by: Mike Côté <mikecote@users.noreply.github.com>
2020-11-04 12:07:17 +02:00
Mike Côté eb43158bdd
Add descriptions to alert types (#81850)
* Initial attempt at adding descriptions to alert types

* Fix typecheck failures

* Fix i18n check

* Fix failing jest test

* Fix i18n check again

* Apply changes for Uptime

* Update x-pack/plugins/apm/public/components/alerting/register_apm_alerts.ts

Co-authored-by: Casper Hübertz <casper@formgeist.com>

* Update x-pack/plugins/apm/public/components/alerting/register_apm_alerts.ts

Co-authored-by: Casper Hübertz <casper@formgeist.com>

* Fix jest test

* Update geo threshold description

* Update description of some alert types based on feedback from Gail

* Update description of some alert types based on feedback from Gail

* Fix i18n

* Fix i18n

* Fix ESLint

* Update some copy

* Update uptime alert description

* Fix typos

Co-authored-by: Casper Hübertz <casper@formgeist.com>
2020-11-03 14:09:41 -05:00
ymao1 ae007c2e8a
[Alerting] Return alert execution status rollup from _find API (#81819)
* wip

* wip

* Adding aggregation option to find function and using those results in UI

* Requesting aggregations from client instead of hard-coding in route

* alert_api test

* i18n fix

* Adding functional test

* Adding unit test for filters

* Splitting into two API endpoints

* Fixing test

* Fixing test

* Adding comment

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2020-11-03 07:26:44 -05:00
Gidi Meir Morris 1482dd41c4
[Actions & Connectors] removes Connector flyouts after usage (#82126)
We've had several bugs over the past few months due to flyouts retaining state between renders.
This ensure we remove these flyouts entirely in between usage to avoid such issues recurring.
2020-11-02 10:53:14 +00:00
Greg Thompson 6fdc7eb1fa
Upgrade EUI to v30.1.1 (#81499)
* eui to v30.0.0

* removed unused RecentLinks component

* update compressed -> display prop

* euiformrow compressed -> display

* euipopover remove withtitle

* euibuttongroup prop updates

* remove euibuttontoggle

* src snapshot updates

* tutorial euibuttongroup update

* x-pack snapshot updates

* euibuttongroup test updates

* TODO

* misc. js file updates

* remove euinavdrawer scss references

* translation removals

* more x-pack snapshot updates

* update data-test-subj lookup

* icons logoAMP -> logoObservability

* cypress selector updates

* update euibuttontoggle onchange, test interaction

* Fix auto-update toggle in Visualize

* some more change -> click test updates

* idtoselectedmap change

* Fix feature table button group

* Remove empty SASS file

* Fix feature table button group II

* Using `compressed` to also dictate dual range row

* Fix a few security labels

* An ML fix

* Apply suggestions from code review

Co-authored-by: Caroline Horn <549577+cchaos@users.noreply.github.com>

* remove unused translation

* update view_type_toggle snapshot

* more snapshot updates

* eui to 30.1.0

* undo temp ts-ignore

* more x-pack snapshot updates

* eui to 30.1.1

* update feature privilege text

* Update x-pack/plugins/security/public/management/roles/edit_role/privileges/kibana/feature_table/sub_feature_form.tsx

Co-authored-by: Joe Portner <5295965+jportner@users.noreply.github.com>

* reuse i18n token

* Adapt log entry action button to new `minWidth` prop

* clean up label

* Combine auto apply strings into one

* ternary fix

* cases status useCallback

Co-authored-by: cchaos <caroline.horn@elastic.co>
Co-authored-by: Caroline Horn <549577+cchaos@users.noreply.github.com>
Co-authored-by: Joe Portner <5295965+jportner@users.noreply.github.com>
Co-authored-by: Felix Stürmer <stuermer@weltenwort.de>
2020-10-30 16:18:27 -06:00
Yuliia Naumenko bb51156c5c
[Alerting UI] Grouped list of alert types using producers in Types filter of Alerts tab (#81876)
* Grouped list of alert types using producers in Types filter of Alerts tab

* Added e2e test

* fixed deps for test utils
2020-10-30 14:46:48 -07:00
Mike Côté 0bf3d6efb0
Add a link to documentation in the alerts and actions management UI (#81909)
* Add a link to documentation in the alerts and actions management UI

* Update label

* Remove usage of any on registries
2020-10-30 08:59:45 -04:00
Gidi Meir Morris d1344b6ecd
added alerting to app directory (#81902)
Adds a link to the  Alerts & Actions from the app directory
2020-10-29 12:33:22 +00:00
ymao1 d6b006ff2f
[Alerting UI] Removing beta labels (#81919)
* Removing beta labels

* i18n fix

* Fixing test
2020-10-29 07:40:18 -04:00
Mikhail Shustov 2782204cc1
Get rid of global types (#81739)
* move global typings to packages/kbn-utility-types

* update all imports

* add tests

* mute error

* update docs

* ok

* rename kbn-utility-types/test --> kbn-utility-types/jest
2020-10-28 11:03:04 +01:00
ymao1 8b1ff4ca59
[Actions] Adding hasAuth to Webhook Configuration to avoid confusing UX (#81778)
* Adding hasAuth to server and client

* Adding migration and fixing tests

* Fixing test

* Adding spacing

* Adding functional test

* Fixing migration

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2020-10-27 13:34:23 -04:00
Yuliia Naumenko 313c026853
Added functional test for alerts list filters by status, alert type and action type. Did a code refactoring and splitting for alerts tests. (#81422)
* Added functional test for alerts list filters by status, alert type and action type. Did a code refactoring and splitting for alerts tests.

* -

* fixed failing tests

* fixed type checks

* minor naming fixes
2020-10-27 08:39:47 -07:00
Ying Mao 9d602e364e Revert "[Actions] Adding hasAuth to Webhook Configuration to avoid confusing UX (#81390)"
This reverts commit fd7f6b5716.
2020-10-27 09:38:36 -04:00
ymao1 fd7f6b5716
[Actions] Adding hasAuth to Webhook Configuration to avoid confusing UX (#81390)
* Adding hasAuth to server and client

* Adding migration and fixing tests

* Fixing test

* Adding spacing

* Adding functional test

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2020-10-27 07:45:02 -04:00
ymao1 7e34bf2dbc
[Alerting UI] Don't wait for health check before showing Create Alert flyout (#80996)
* wip

* Adding health context provider and option to block waiting for health check

* Adding tests

* Removing forced lag

* Fixing action form not rendering pre selected action

* PR fixes

* Updating i18n ids

Co-authored-by: Mike Côté <mikecote@users.noreply.github.com>

* Applying i18n fix

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Mike Côté <mikecote@users.noreply.github.com>
2020-10-26 13:30:27 -04:00