Commit graph

325 commits

Author SHA1 Message Date
ymao1 3704b1d301
[Actions] Back Button on Add Connector Flyout (#80160)
* Adding back button to add connector flyout

* Adding tests

* Adding tests

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2020-10-16 13:15:47 -04:00
ymao1 db4184fe8b
[Alerting UI] Updating 'Add new' wording (#80509)
* Updating 'Add new' wording

* PR fixes

* i18n_check fix

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2020-10-16 12:17:21 -04:00
ymao1 a377204f85
[Alerting UI] Disable "Save" button for Alerts with broken Connectors (#80579)
* Adding check for broken connectors in action form

* Adding check for broken connectors in action form

* Adding unit test

* PR fixes
2020-10-16 07:35:46 -04:00
Christos Nasikas 3e20914394
[Security Solution][Case] Fix Jira's parent issue placeholder (#80619) 2020-10-15 19:07:25 +03:00
ymao1 7b00052c5b
[Alerting] Prompt for confirmation when saving alert with no action (#79892)
* Adding save confirmation for new alerts with no associated actions

* Adding functional tests

* Fixing uptime alert test

* Fixing uptime alert test

* PR fixes

* Updating confirmation modal wording

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2020-10-13 07:36:53 -04:00
Gidi Meir Morris 3bd95d42e8
sort alert instance by status in UI (#80103)
Sorts Alert instances by their status to ensure Active come first.
2020-10-12 14:56:02 +01:00
ymao1 c2f9f0ac84
[Alerting] Selectively update threshold value on threshold comparator change (#79914)
* Only updating threshold value on threshold comparator change when number of required values for comparator changes

* Adding unit test

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2020-10-12 07:33:16 -04:00
Gidi Meir Morris 25c5daa83a
Renames "Built-In Alerts" feature to "Stack Alerts" and "Actions" feature to "Actions and Connectors" (#79513)
Renames "Built-In Alerts" feature to "Stack Alerts" and "Actions" feature to "Actions and Connectors" as we've decided these names make more appropriate and better communicate what these features are.
2020-10-06 17:51:05 +01:00
Aaron Caldwell bb37cc288a
Introduce geo-threshold alerts (#76285) 2020-10-05 17:00:55 -06:00
Saravanan Selvamohan 663175c8c4
Change plugin id for triggers_actions_ui to triggersActionsUi (#78555)
* Rename triggers_actions_ui plugin id to triggersActionsUi

* Rename triggers_actions_ui plugin id to triggersActionsUi

* Removed disable linting line

* ran docs generation script

* Fixed type check issue

* FIxed eslint error

Co-authored-by: Yuliia Naumenko <yuliia.naumenko@elastic.com>
2020-10-05 14:17:06 -07:00
Gidi Meir Morris 4fdf2f1566
[Actions] makes savedObjectId field optional (#79186)
This PR makes the `savedObjectId` parameter optional in the Jira, ServiceNow and IBM Resilient Connectors.
This allows them to execute without this field outside of Alerts, as it is currently populated using the `alertId` which isn't available in other places.
Additionally this adds an optional field in the `Params` Components for all three of the connectors, which allows users to provide a value for the `savedObjectId` field if the so wish.
2020-10-05 18:21:20 +01:00
Yuliia Naumenko 1d9a2a4492
[Alerting UI] Display a banner to users when some alerts have failures, added alert statuses column and filters (#79038)
* Added ui for alert failures banner

* Added UI for alerts statuses

* Adjusted form

* Added banned on the details page

* Fixed failing intern. check and type checks

* Added unit test for displaying alert error banner

* Fixed type check

* Fixed due to comments

* Changes due to comments

* Fixed due to comments

* Fixed text on banners

* Added i18n translations
2020-10-04 15:32:05 -07:00
ymao1 09b0b6630a
Rearranged PagerDuty action params so non-optional params are at the top (#79026) 2020-10-02 07:40:47 -04:00
Patrick Mueller 117b5771dc
[Alerting] formalize alert status and add status fields to alert saved object (#75553)
resolves https://github.com/elastic/kibana/issues/51099

This formalizes the concept of "alert status", in terms of it's execution, with
some new fields in the alert saved object and types used with the alert client
and http APIs.

These fields are read-only from the client point-of-view; they are provided in
the alert structures, but are only updated by the alerting framework itself.
The values will be updated after each run of the alert type executor.

The data is added to the alert as the `executionStatus` field, with the
following shape:

```ts
interface AlertExecutionStatus {
  status: 'ok' | 'active' | 'error' | 'pending' | 'unknown';
  lastExecutionDate: Date;
  error?: {
    reason: 'read' | 'decrypt' | 'execute' | 'unknown';
    message: string;
  };
}
```
2020-10-01 18:06:26 -04:00
Yuliia Naumenko 63ff0606df
Extended Email action configuration with hasAuth property to identify if the connector require user credentials. Improved UX for Email connector (#78235)
* Extended Email action configuration with hasAuth property to identify if the connector require user credentials. Improved UX for Email connector

* Fixed failing tests and comments

* Fixed type check and reverted logic of Add user and password switch button

* Fixed due to the latest design requirenments

* Fixed due to review comments
2020-10-01 13:57:28 -07:00
Mike Côté e83144ee40
Fix alert add and edit flyout to not close when user clicks outside (#78860) 2020-10-01 11:22:08 -04:00
Zacqary Adam Xeper 3599edbea9
[Logs UI] Move alerting components to public/alerting (#79035)
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-10-01 09:42:18 -05:00
Gidi Meir Morris 727d62611b
[Actions] fixes error in UI in the Edit Flyout for PreConfigured Connectors (#78994)
Ensures only User Configured Connectors can be validated and edited by the UI to avoid these kinds of errors in the future.
2020-10-01 14:24:10 +01:00
Christos Nasikas cbc83003d3
[Actions][Jira] Fix bug with Jira sub-task (#79070) 2020-10-01 14:21:34 +03:00
Christos Nasikas 3d9ea52803
[Actions][Jira] Set parent issue for Sub-task issue type (#78772) 2020-10-01 09:34:25 +03:00
Gidi Meir Morris ac18bc0ac3
[Actions] Adds a "Test Connector" button on the Connectors List to make discovery of the Test tab easier (#78746)
Adds a "Test Connector" button on the Connectors List to make discovery of the Test tab easier.
It also adds a "Save & test" button when creating a Connector, which navigates the user straight to the Test tab after saving.

This also fixed a broken behaviour on Main where navigating to the Test tab in Case Management crashes Kibana.
2020-09-30 19:38:28 +01:00
Sushrut Kasture 5cdd93285e
Prevent multiple calls to backend from UI (#77970)
* Prevent multiple call to backend from UI

- Prevent multiple calls to backend from UI on updating the filters

* Committing the fix

- Watch only for the combined change in typesFilter and actionTypesFilter

* UseEffect on string of typeFilter and actionTypeFilter

- We are only concerned about the values of the two
props and not whether the object references change.
In other words, two separate empty arrays should be
same for us.

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-09-29 09:56:01 -07:00
Gidi Meir Morris 8547b32bab
[Actions] avoids setting a default dedupKey on PagerDuty (#77773)
The PagerDuty Action currently defaults to a dedupKey that's shared between all action executions of the same connector.
To ensure we don't group unrelated executions together this PR avoids setting a default, which means each execution will result in its own incident in PD.

As part of this change we've also made the `dedupKey` a required field whenever a `resolve` or `acknowledge` event_action is chosen. This ensure we don't try to resolve without a dedupKey, which would result in an error in PD.

A migration has been introduced to migrate existing alerts which might not have a `dedupKey` configured.
2020-09-28 14:56:20 +01:00
Jean-Louis Leysens 38e63d1029
[ES UI Shared] Remove 'brace' from es_ui_shared public (#78033)
* major wip

* major wip

* fix worker creation leak

* just copy the file over for now

* Remove xjson from static and from es_ui_shared entirely

- moved expand and collapse logic back to es_ui_shared. It has
  nothing to do with ace
- refactor the useXJson hook which bundled XJsonMode with it.
  This was convenient but ultimately inflates the amount of code
  Kibana needs to first load up in the client. Users will need to
  import XJsonMode and instantiate it when they want to use it.
  Updated existing usage.
- Cleaned up Monaco namespace from es_ui_shared because of how
  useXJsonMode was refactored -- no longer exporting an editor
  specific instance means this code does not know about anything
  to do with code editors so it is decoupled from ace and monaco.

* fix export of collapse and expand string literals

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-09-24 16:02:14 +02:00
Yuliia Naumenko 12153a436a
Removed delete confirmation timeout to avoid flaky failing because deletion to be a little slower on CI (#77963)
* Removed delete confirmation timeout to avoid flaky failing because deletion to be a little slower on CI

* Changed delete flow to close confim dialog immediately and set data to the loading state
2020-09-23 09:41:35 -07:00
Gidi Meir Morris 41a7f1a1c2
[Actions] adds a Test Connector tab in the Connectors list (#77365)
Adds a tab in the _Edit Alert_ flyout which allows the user to _test_ their connector by executing it using an example action. The execution relies on the connector being updated, so is only enabled when there are no saved changes in the Connector form itself.
2020-09-22 11:18:33 +01:00
Zacqary Adam Xeper 9cf546f3d0
[Metrics UI] Use Notify Every in Alert Preview (#74401)
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-09-18 14:42:23 -05:00
Gidi Meir Morris c7abea0c51
fixed react warning in Suspense in alert flyout (#77777) 2020-09-18 09:51:18 +01:00
Christos Nasikas 22b4e40ea0
[Alerting][Connectors] Refactor IBM Resilient: Generic Implementation (phase one) (#74357)
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-09-11 10:24:46 +03:00
Christos Nasikas db5652e020
[Alerting][Connectors] Refactor Jira: Generic Implementation (phase one) (#73778) 2020-09-09 16:17:11 +03:00
Shahzad a9adf1061c
Allow add alert Flyout initial values like name, tags (#76906) 2020-09-08 19:36:16 +02:00
Mike Côté 075e75e2f7
Rename status API to instance summary (#76541)
* Rename status API to instance summary

* Remove unused translations

* Fix typos

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-09-08 11:53:21 -04:00
Yuliia Naumenko 60986d4f82
Updated ServiceNow description in docs and actions management UI to contains correct info (#76344)
* Updated ServiceNow description in documentation and Actions management create UI to contains correct info that ServiceNow

* fixed due to comments
2020-09-03 13:07:23 -07:00
Yuliia Naumenko a8b2810629
Added validation to display an error when creating index action in alert with invalid document. (#75929) 2020-08-31 13:55:16 -07:00
Mikhail Shustov 37ec1e1053
Update to TS v4 (#73924)
* bump ts to v4

* MOAR RAM

* fix type errors for OSS

* first pass on x-pack errors

* second pass on x-pack type errors

* 3rd pass on x-pack type-errors

* mute errors if complex cases

* don't delete if spread suffices

* mute other complex cases

* make User fields optional

* fix optional types

* fix tests

* fix typings for time_range

* fix type errors in x-pack/tests

* rebuild kbn-pm

* remove leftovers from master update

* fix alert tests

* [Telemetry Checker] TS4 Fixes

* bump to 4.0.1-rc

* fix new errors in master

* bump typescript-eslint to version supporting TS v4 syntax

* fix merge commit errors

* update to the stable TS version 4.0.2

* bump ts-eslint to version supporting ts v4

* fix typo

* fix type errors after merge

* update ts in another new package.json

* TEMP: remove me

* Revert "TEMP: remove me"

This reverts commit dc0fc3bae6.

* [Telemetry] Update snapshot for new TS4 SyntaxKind

* bump prettier to support TS v4 syntax

* fix prettier rules

* last style change

* fix new type errors

Co-authored-by: Alejandro Fernández Haro <alejandro.haro@elastic.co>
2020-08-27 10:28:02 +02:00
Shahzad a358c5768e
[Uptime] One click simple monitor down alert (#73835)
* WIP

* added anomaly alert

* update types

* update types

* update

* types

* types

* update ML part

* update ML part

* update ML part

* unnecessary change

* icon for disable

* update test

* update api

* update labels

* resolve conflicts

* fix types

* fix editing alert

* fix types

* added actions column

* added code to add alert

* update anomaly message

* added anomaly alert test

* update

* update type

* fix ml legacy scoped client

* update

* WIP

* fix conflict

* added aria label

* Added deleteion loading

* fix type

* update

* update tests

* update

* update type

* fix types

* WIP

* added enabled alerts section

* add data

* update

* update tests

* fix test

* update i18n

* update i18n

* update i18n

* fix

* update message

* update

* update

* update

* revert

* update types

* added component

* update test

* incorporate PR feedback

* fix focus

* update drawer

* handle edge case

* improve btn text

* improve btn text

* use switch instead of icons

* update snapshot

* use compressed form

* fix type

* update snapshot

* update snapshot

* update test

* update test

* PR feedback

* fix test and type

* remove delete action

* remove unnecessary function

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-08-27 07:02:28 +02:00
Patrick Mueller 90f0a294af
[Actions] change routing key refereence in Pager Duty action message to include integration key (#75516)
resolves https://github.com/elastic/kibana/issues/68209

Since routing key figures fairly prominently throughout PagerDuty APIs,
and ours, it seems like it make sense to include it in the single validation
message we have for it, as well as using the term we use for it in the product:
"integration key".

See the referenced issue for more background.
2020-08-25 09:29:55 -04:00
Shahzad de4b502cb3
Fix docs in trigger alerting UI (#75363) 2020-08-19 09:13:40 +02:00
Patrick Mueller 67e28ac8b4
[EventLog] Populate alert instances view with event log data (#68437)
resolves https://github.com/elastic/kibana/issues/57446

Adds a new API (AlertClient and HTTP endpoint) `getAlertStatus()` which returns
alert data calculated from the event log.
2020-08-14 08:34:26 -04:00
Gidi Meir Morris 41e3128ecd
[Alerting] Reload the Alerts List when alerts are deleted (#73715)
Reloads the entire Alerts list when alerts are deleted through the UI.
2020-08-05 18:48:09 +01:00
Mikhail Shustov 88c0631344
Update @typescript-eslint to ensure compatibility with TypeScript v3.9 (#74091)
* bump @typescript-eslint deps

* update rules

* fix errors in pacakges

* fix src/

* fix x-pack

* fix test

* fix typings

* fix examples

* allow _ as prefix and suffix

* roll back prefix and suffix changes

* add eslint-plugin-eslint-comments

* report unused rules

* remove unused eslint comments from tests

* remove unused eslint comments 2nd pass

* remove unused eslint comments from src/

* remove unused comments in x-pack

* use no-script-url and no-unsanitized/property for ts files

* remove unused eslint comments

* eui/href-or-on-click removed when not complained

* no import/* rules for ts files

* cleanup

* remove the unused eslint-disable

* rollback unnecessary changes

* allow underscore prefix & sufix in type name

* update docs

* fix type error in enterprise search plugin mocks

* rename platform hack __coreProvider --> _coreProvider

* rollback space removal in src/core/public/legacy/legacy_service.test.ts

* fix naming convention in APM
2020-08-05 17:32:19 +02:00
Yuliia Naumenko 36f25e66e8
Fixed Alert details does not update page title and breadcrumb (#74214)
* Fixed Alert details does not update page title and breadcrumb

* Added alert name to details breadcrumb as a dynamic title

* Update x-pack/plugins/triggers_actions_ui/public/application/lib/breadcrumb.ts

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

Co-authored-by: Mike Côté <mikecote@users.noreply.github.com>
2020-08-04 16:00:56 -07:00
Shahzad 330c966f4f
[Uptime] Reduce miscellaneous uptime bundle size (#70632)
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-07-28 16:30:58 +02:00
Gidi Meir Morris f4104743e3
[Alerting] Control Alerts Management via feature controls & privileges (#72029)
This PR removes the alerting and actions ui privileges (alerting:show, actions:show, etc...) and instead relies on the standard Kibana feature control model to decide whether management displays the Alerts Management section under management.
2020-07-28 15:20:24 +01:00
Yuliia Naumenko badbfa0eb5
Added more {{context}} fields for Index Threshold alert type (including requested 'threshold' field). Extended action variables UX with tooltip containing variable description. (#71141)
* Added more {{context}} fields for Index Threshold alert type (including requested 'threshold' field). Extended action variables UX with tooltip containing variable description.

* Fixed type checks and failing tests

* fixed type check

* Splited params variables

* Fixed tests and type checks

* Fixed styles

* Fixed type check

* fixed styles

* fixed missing type

* Fixed due to comments

* fixed variables description

* fixed type check

* Fixed due to comments

* fixed typecheck

* Merge remote-tracking branch upstream/master into alerting-additional-context-fields

* fixed type checks and tests

* fixed tests
2020-07-23 08:39:51 -07:00
Gidi Meir Morris 4abe864f10
Adds Role Based Access-Control to the Alerting & Action plugins based on Kibana Feature Controls (#67157)
This PR adds _Role Based Access-Control_ to the Alerting framework & Actions feature using  Kibana Feature Controls, addressing most of the Meta issue: https://github.com/elastic/kibana/issues/43994

This also closes https://github.com/elastic/kibana/issues/62438

This PR includes the following:

1. Adds `alerting` specific Security Actions (not to be confused with Alerting Actions) to the `security` plugin which allows us to assign alerting specific privileges to users of other plugins using the `features` plugin.
2. Removes the security wrapper from the savedObjectsClient in AlertsClient and instead plugs in the new AlertsAuthorization which performs the privilege checks on each api call made to the AlertsClient.
3. Adds privileges in each plugin that is already using the Alerting Framework which mirror (as closely as possible) the existing api-level tag-based privileges and plugs them into the AlertsClient.
4. Adds feature granted privileges arounds Actions (by relying on Saved Object privileges under the hood) and plugs them into the ActionsClient
5. Removes the legacy api-level tag-based privilege system from both the Alerts and Action HTTP APIs
2020-07-22 14:45:57 +01:00
Christos Nasikas 54c3644757
[Alerting][Connectors] Increase the size of the logos (#72419) 2020-07-20 18:35:42 +03:00
Yuliia Naumenko 9da8b768bf
Fixed Webhook connector doesn't retain added HTTP header settings (#71924)
* Fixed Webhook connector doesn't retain added HTTP header settings

* fixed method
2020-07-16 14:43:27 -07:00
Yuliia Naumenko b7bb193cd5
[Actions UI] Fixed Connectors edit flyout retains state after being closed (#71911)
* [Actions UI] Fixed Connectors edit flyout retains state after being closed

* Fixed failing test
2020-07-16 09:08:05 -07:00
Yuliia Naumenko 5c5d75f6b0
Removed filtering for Case owned ServiceNow actions from the Management UI and make it usable for Alerts. Added documentation. (#71579)
* Removed filtering for Case owned ServiceNow actions from the Management UI and make it usable for Alerts. Added documentation.

* extended docs

* Fixed docs

* fixed connector page

* Changed SN variables components

* Fixed issues

* fixed order

* Update docs/user/alerting/action-types/servicenow.asciidoc

Co-authored-by: gchaps <33642766+gchaps@users.noreply.github.com>

* Update docs/user/alerting/action-types/servicenow.asciidoc

Co-authored-by: gchaps <33642766+gchaps@users.noreply.github.com>

* Update docs/user/alerting/action-types/servicenow.asciidoc

Co-authored-by: gchaps <33642766+gchaps@users.noreply.github.com>

* Update docs/user/alerting/action-types/servicenow.asciidoc

Co-authored-by: gchaps <33642766+gchaps@users.noreply.github.com>

* Update docs/user/alerting/action-types/servicenow.asciidoc

Co-authored-by: gchaps <33642766+gchaps@users.noreply.github.com>

* Update docs/user/alerting/action-types/servicenow.asciidoc

Co-authored-by: gchaps <33642766+gchaps@users.noreply.github.com>

* Update docs/user/alerting/action-types/servicenow.asciidoc

Co-authored-by: gchaps <33642766+gchaps@users.noreply.github.com>

* Update docs/user/alerting/action-types/servicenow.asciidoc

Co-authored-by: gchaps <33642766+gchaps@users.noreply.github.com>

* -

* fixed tests

Co-authored-by: gchaps <33642766+gchaps@users.noreply.github.com>
2020-07-15 11:01:34 -07:00
Chris Roberson 06b1820df7
[Monitoring] Out of the box alerting (#68805)
* First draft, not quite working but a good start

* More working

* Support configuring throttle

* Get the other alerts working too

* More

* Separate into individual files

* Menu support as well as better integration in existing UIs

* Red borders!

* New overview style, and renamed alert

* more visual updates

* Update cpu usage and improve settings configuration in UI

* Convert cluster health and license expiration alert to use legacy data model

* Remove most of the custom UI and use the flyout

* Add the actual alerts

* Remove more code

* Fix formatting

* Fix up some errors

* Remove unnecessary code

* Updates

* add more links here

* Fix up linkage

* Added nodes changed alert

* Most of the version mismatch working

* Add kibana mismatch

* UI tweaks

* Add timestamp

* Support actions in the enable api

* Move this around

* Better support for changing legacy alerts

* Add missing files

* Update alerts

* Enable alerts whenever any page is visited in SM

* Tweaks

* Use more practical default

* Remove the buggy renderer and ensure setup mode can show all alerts

* Updates

* Remove unnecessary code

* Remove some dead code

* Cleanup

* Fix snapshot

* Fixes

* Fixes

* Fix test

* Add alerts to kibana and logstash listing pages

* Fix test

* Add disable/mute options

* Tweaks

* Fix linting

* Fix i18n

* Adding a couple tests

* Fix localization

* Use http

* Ensure we properly handle when an alert is resolved

* Fix tests

* Hide legacy alerts if not the right license

* Design tweaks

* Fix tests

* PR feedback

* Moar tests

* Fix i18n

* Ensure we have a control over the messaging

* Fix translations

* Tweaks

* More localization

* Copy changes

* Type
2020-07-14 17:50:22 -04:00
Matthew Kime b26e3198b3
Management API - simpler interface, remove app context usage (#71144)
Management API - simpler interface, remove app context usage, consolidate rendeing
2020-07-14 11:30:01 -05:00
Pierre Gayvallet f0fe9b1908
Fix ScopedHistory mock and adapt usages (#71404)
* Fix mock and adapt usages

* fix snapshots

* add comment about forcecast

* remove mock overrides
2020-07-14 09:40:27 +02:00
Yuliia Naumenko 2009447ab8
Added help text where needed on connectors and alert actions UI (#69601)
* Added help text where needed on connectors and alert actions UI

* fixed ui form

* Added index action type examples, fixed slack link

* Fixed email connector docs and links

* Additional cleanup on email

* Removed autofocus to avoid twice link click for opening in the new page

* Extended documentation for es index action type

* Fixed tests

* Fixed doc link

* fixed due to comments

* fixed due to comments

* Update docs/user/alerting/action-types/email.asciidoc

Co-authored-by: gchaps <33642766+gchaps@users.noreply.github.com>

* Update docs/user/alerting/action-types/email.asciidoc

Co-authored-by: gchaps <33642766+gchaps@users.noreply.github.com>

* Update docs/user/alerting/action-types/email.asciidoc

Co-authored-by: gchaps <33642766+gchaps@users.noreply.github.com>

* Update docs/user/alerting/action-types/email.asciidoc

Co-authored-by: gchaps <33642766+gchaps@users.noreply.github.com>

* Update docs/user/alerting/action-types/email.asciidoc

Co-authored-by: gchaps <33642766+gchaps@users.noreply.github.com>

* Update docs/user/alerting/action-types/email.asciidoc

Co-authored-by: gchaps <33642766+gchaps@users.noreply.github.com>

* Update docs/user/alerting/action-types/email.asciidoc

Co-authored-by: gchaps <33642766+gchaps@users.noreply.github.com>

* Update x-pack/plugins/actions/README.md

Co-authored-by: gchaps <33642766+gchaps@users.noreply.github.com>

* Update x-pack/plugins/actions/README.md

Co-authored-by: gchaps <33642766+gchaps@users.noreply.github.com>

* Update x-pack/plugins/triggers_actions_ui/README.md

Co-authored-by: gchaps <33642766+gchaps@users.noreply.github.com>

* Update docs/user/alerting/action-types/email.asciidoc

Co-authored-by: gchaps <33642766+gchaps@users.noreply.github.com>

* Update docs/user/alerting/action-types/email.asciidoc

Co-authored-by: gchaps <33642766+gchaps@users.noreply.github.com>

* Update docs/user/alerting/action-types/email.asciidoc

Co-authored-by: gchaps <33642766+gchaps@users.noreply.github.com>

* Update docs/user/alerting/action-types/email.asciidoc

Co-authored-by: gchaps <33642766+gchaps@users.noreply.github.com>

* Update docs/user/alerting/action-types/index.asciidoc

Co-authored-by: gchaps <33642766+gchaps@users.noreply.github.com>

* Update docs/user/alerting/action-types/slack.asciidoc

Co-authored-by: gchaps <33642766+gchaps@users.noreply.github.com>

* Fixed due to comments

Co-authored-by: gchaps <33642766+gchaps@users.noreply.github.com>
2020-07-13 19:53:37 -07:00
Spencer fa93a81ba6
[kbn/optimizer] implement "requiredBundles" property of KP plugins (#70911)
Co-authored-by: Josh Dover <me@joshdover.com>
Co-authored-by: spalger <spalger@users.noreply.github.com>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-07-09 18:43:17 -07:00
Yuliia Naumenko 438e905800
Added UI validation when creating a Webhook connector with invalid URL (#70025)
* Added UI validation when creating a Webhook connector with invalid URL

* fixed tests

* Fixed due to comments

* fixed type check and extended error message for invalid URL

* Fixed whitelisting of URL

* fixed failing tests

* fixed str
2020-07-06 17:35:47 -07:00
Yuliia Naumenko 57915e1641
ServiceNow push to Incident generic implementation (supporting both Case specific and generic Alerts) (#68464)
* Draft ServiceNow generic implementation

* simple working servicenow incident per alert

* fixed running times

* rely on externalId for update incident on the next execution

* Added consumer to the action type to be able to split ServiceNow for Cases and Alerts

* Added subActions support for ServiceNow action form

* Basic version for Alerts part for ServiceNow

* Keep Case ServiceNow functionality working

* Revert changes on app_router

* Fixed type checks

* Fixed language check issues

* Fixed actions unit tests

* Fixed functional tests

* Fixed jest tests

* fixed tests

* Copied case mappings to alerting plugin

* made consumer optional

* Cleanup tests

* more cleanup

* Fixed jest tests and type checks

* fixed tests

* fixed servicenow validation tests

* Added ServiceNow unit tests

* Removed consumer for actions

* fixed client side isCaseOwned support

* fixed failing tests

* fixed jest tests

* Fixed URL validation

* fixed due to comments

* fixed tests

* fixed jest tests

* Fixed due to comments. Moved ServiceNow filtering in case plugin to server side

* fixed mock for ServiceNow

* fixed consumer config

* fixed test

* fixed type check

* Fixed jest test

* fixed type check
2020-07-06 16:38:45 -07:00
Yuliia Naumenko 21efd235f7
Fixed adding an extra space character on selecting alert variable in action text fields (#70028)
* Fixed adding an extra space character on selecting alert variable in action text fields.

* Made components for variables to be able to insert the variable by the cursor position

* cleanup

* Added variables support for all components

* update on handle selections for text

* Fixed functional tests
2020-07-02 18:08:14 -07:00
Tiago Costa 6c62c686cf
chore(NA): upgrade to lodash@4 (#69868)
* chore(NA): upgrade oss to lodash4

chore(NA): migrate cli, cli_plugin, cli_keystore,  dev, test_utils and apm src script to lodash4

chore(NA): missing file for cli plugin

chore(NA): add src core

chore(NA): es archiver and fixtures

chore(NA): try to fix functional test failure

chore(NA): migrate src/legacy entirely to lodash4 except src/legacy/core_plugins

chore(NA): move legacy core plugins to lodash4

chore(NA): upgrade optimize to lodash4

chore(NA): upgrade to lodash4 on advanced_settings, charts, console and dashboard

chore(NA): migrate to lodash4 on dev_tools, discover, embeddable, es_ui)shared, expressions, home plugins

chore(NA): upgrade data plugin to lodash4

chore(NA): upgrade usage_collection, ui_actions, tile_map, telemtry, share, saved_objects, saved_objects_management, region_map and navigation to lodash4

chore(NA): missing data upgrades to lodash4

Revert "chore(NA): upgrade usage_collection, ui_actions, tile_map, telemtry, share, saved_objects, saved_objects_management, region_map and navigation to lodash4"

This reverts commit 137055c5fed2fc52bb26547e0bc1ad2e3d4fe309.

Revert "Revert "chore(NA): upgrade usage_collection, ui_actions, tile_map, telemtry, share, saved_objects, saved_objects_management, region_map and navigation to lodash4""

This reverts commit f7e73688782998513d9fb6d7e8f0765e9beb28d1.

Revert "chore(NA): missing data upgrades to lodash4"

This reverts commit 92b85bf947a89bfc70cc4052738a6b2128ffb076.

Revert "chore(NA): upgrade data plugin to lodash4"

This reverts commit 88fdb075ee1e26c4ac979b6681d8a2b002df74c6.

chore(NA): upgrade idx_pattern_mgt, input_control_vis, inspector, kbn_legacy, kbn_react, kbn_usage_collections, kbn_utils, management and maps_legacy to lodash4

chore(NA): map src plugin data to lodash3

chore(NA): missing lodash.clonedeep dep

chore(NA): change packages kbn-config-schema deps

chore(NA): update renovate config

chore(NA): upgrade vis_type plugins to lodash4

chore(NA): move vis_type_vislib to lodash3

chore(NA): update visualizations and visualize to lodash4

chore(NA): remove lodash 3 types from src and move test to lodash4

chore(NA): move home, usage_collection and management to lodash 3

Revert "chore(NA): move home, usage_collection and management to lodash 3"

This reverts commit f86e8585f02d21550746569af54215b076a79a3d.

chore(NA): move kibana_legacy, saved_objects saved_objects_management into lodash3

chore(NA): update x-pack test to mock lodash4

Revert "chore(NA): move kibana_legacy, saved_objects saved_objects_management into lodash3"

This reverts commit 2d10fe450533e1b36db21d99cfae3ce996a244e0.

* chore(NA): move x-pack and packages to lodash 4

* chore(NA): remove mention to lodash from main package.json

* chore(NA): remove helper alias for lodash4 and make it the default lodash

* chore(NA): fix last failing types in the repo

* chore(NA): fix public api

* chore(NA): fix types for agg_row.tsx

* chore(NA): fix increment of optimizer modules in the rollup plugin

* chore(NA): migrate `src/core/public/http/fetch.ts` (#5)

* omit undefined query props

* just remove merge usage

* fix types

* chore(NA): fixes for feedback from apm team

* chore(NA): recover old behaviour on apm LoadingIndeicatorContext.tsx

* chore(NA): fixes for feedback from watson

* Platform lodash4 tweaks (#6)

* chore(NA): fix types and behaviour on src/core/server/elasticsearch/errors.ts

* Canvas fixes for lodash upgrade

* [APM] Adds unit test for APM service maps transform (#7)

* Adds a snapshot unit test for getConnections and rearranges some code to make testing easier

* reverts `ArrayList` back to `String[]` in the painless script within `fetch_service_paths_from_trace_ids.ts`

* chore(NA): update yarn.lock

* chore(NA): remove any and use a real type for alerts task runner

Co-authored-by: Gidi Meir Morris <github@gidi.io>

* chore(NA): used named import for triggers_actions_ui file

* chore(NA): fix eslint

* chore(NA): fix types

* Delete most uptime lodash references.

* Simplify. Clean up types.

* [Uptime] Delete most uptime lodash references (#8)

* Delete most uptime lodash references.

* Simplify. Clean up types.

* chore(NA): add eslint rule to avoid using lodash3

* chore(NA): apply changes on feedback from es-ui team

* fix some types (#9)

* Clean up some expressions types.

* chore(NA): missing ts-expect-error statements

* Upgrade lodash 4 vislib (#11)

* replace lodash 3 with lodash 4 on vislib plugin

* Further changes

* further replacement of lodash3 to 4

* further work on upgrading to lodash 4

* final changes to update lodash

* chore(NA): upgrade data plugin to lodash4

chore(NA): upgrade data plugin public to lodash4

chore(NA): fix typecheck task

chore(NA): fix agg_config with hasIn

chore(NA): assign to assignIn and has to hasIn

chore(NA): upgrade data plugin server to lodash4

chore(NA): new signature for core api

fix(NA): match behaviour between lodash3 and lodash4 for set in search_source

* chore(NA): remove lodash3 completely from the repo

* chore(NA): fix x-pack/test/api_integration/apis/metrics_ui/snapshot.ts missing content

* chore(NA): fix lodash usage on apm

* chore(NA): fix typecheck for maps

* Patch lodash template (#12)

* Applying changes from https://github.com/elastic/kibana/pull/64985

* Using isIterateeCall, because it seems less brittle

* Also patching `lodash/template` and `lodash/fp/template`

* Reorganizing some files...

* Revising comment

* Ends up `_` is a function also... I hate JavaScript

Co-authored-by: Pierre Gayvallet <pierre.gayvallet@gmail.com>
Co-authored-by: Josh Dover <me@joshdover.com>
Co-authored-by: Clint Andrew Hall <clint.hall@elastic.co>
Co-authored-by: Oliver Gupte <ogupte@users.noreply.github.com>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
Co-authored-by: Gidi Meir Morris <github@gidi.io>
Co-authored-by: Justin Kambic <justin.kambic@elastic.co>
Co-authored-by: Stratoula Kalafateli <stratoula1@gmail.com>
Co-authored-by: Luke Elmers <luke.elmers@elastic.co>
Co-authored-by: Brandon Kobel <brandon.kobel@gmail.com>
Co-authored-by: kobelb <brandon.kobel@elastic.co>
2020-07-03 01:30:13 +01:00
Nick Partridge f8ba824ebc
Fix discover, tsvb and Lens chart theming issues (#69695) 2020-07-02 09:02:30 -05:00
Zacqary Adam Xeper 71ea1a05c3
[Metrics UI] Prefill alerts from the global dropdown (#68967)
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-06-25 12:00:58 -05:00
Yuliia Naumenko 29714aa614
Disabled multiple select for preconfigured connectors to avoid requesting bulk delete on them (#69459) 2020-06-23 12:12:39 -07:00
patrykkopycinski cc4c1729d1
Bump jest related packages (#58095) 2020-06-20 21:05:09 +02:00
Spencer 7e328417ab
[kbn/optimizer] share all plugin bundles (#68986)
Co-authored-by: spalger <spalger@users.noreply.github.com>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-06-15 22:15:31 -07:00
Andrea Del Rio b57149ccb2
[Alerting] Update Index Threshold to use columns in EuiExpression (#69051) 2020-06-15 11:43:19 -07:00
Yuliia Naumenko f6e93a19d3
Fixed pre-configured docs link points to the wrong page and functional tests configs (#68606)
* Fixed pre-configured docs link points to the wrong page and functional tests configs

* Fixed doc link
2020-06-09 07:00:31 -07:00
Mike Côté c8e6855281
Hide action types in action form that don't have actionParamsFields set (#68171)
* Hide action types in alert flyout that don't have actionParamsFields set

* Fix jest tests
2020-06-04 15:58:48 -04:00
Xavier Mouligneau 1216b0f7cd
[SECURITY] Rename siem plugin to security_solution (#67902)
* rename siem to security_solution

* rename siem to security solution inside of code

* rename translation keys

* fix snapshot

* replace siem for security solution in tutorial

* missing translation to be renamed

* fix types for api test integration

* updates runner file to match the new path

* change category for kibana settings

* miss renaming in advance settings

* fixes cypress tests

* fix api integration test

* fix new translation

* fix unit test

* update translation i18n

* update translation i18n II

Co-authored-by: Gloria Hornero <snootchie.boochies@gmail.com>
2020-06-04 05:35:13 -04:00
Alexey Antonov d661d66faa
[New Platform Migration]: Management - Implement NP API (#66781)
* [New Platform Migration]: Management - Implement NP API

Part of #47432

* partial progress on a number of management sections

* fix passing history

* Fixed types

* Fixed routing for Ingest Node Pipelines

* introduce and use react router wrapped eui components

* react router utils

* work in progress => hashRouter to router

* more partial progress

* remove console.log

* use reactRouterNavigate for management_sidebar

* Breadcrumbs will need to make use of the reactRouterNavigate function

* [triggersActions] app. Hash Router -> Router

* Replace /app/kibana#/management urls to /app/management

* remove ui/public/management

* fix some links to management apps

* fix management url for functional tests

* add data-test-subj for EuiSideNavItem

* partial progress

* fix some of ts issues

* Fixed breadcrumbs for data index management

* [kibana/spaces] section

* fix functional test

* [role_management] fix Breadcrumbs

* [api_keys] fix Breadcrumbs and Navigation

* Fixed routing for remote cluster

* [role_mapping] Partial progress

* [users] partial progress

* [watcher] partial progress

* fix eslint issues

* [snapshot_restore] partial progress

* [rollup_jobs] partial progress

* Fixed routing for cross cluster replications (partial progress). Enhanced reactRouterNavigate

* Perf optimization: fix extra re-rendering

* fix TS errors

* x-pack fix config for functional tests

* Fixed routing for index lifecycle management

* fix some broken CI tests

* fix PR comment

* [snapshot_restore] move onClick into reactRouterNavigate

* fix some jest

* fix some functional tests

* fix functiona test: management  scripted fields testing regression for issue

* fix some functional tests

* [licence_management] partial progress

* Fixed x-pack jest tests

* [saved_object_management] partial progress

* Fixed some tests

* fix functional test: should add new role myroleEast

* Reverted part of changes for ml

* [transforms] partial progress

* fix TS errors

* fix functional:  redirects to Kibana home

* add support of Backward compatibility

* fix functional: Saved objects management feature controls saved objects management global visualize all privileges listing redirects to Kibana home

* fix PR comment

* fix TS issues

* Fixed x-pack jest tests

* fix oss JEST

* Fixed functional test

* fix functional test

* fix PR comment

* Fixed i18n

* fix typo

* fix Styles

* Fixed paths for cross_cluster_replication

* fix wrong link

* Fixed jest

* Fixed some comments

* fix sorting

* fix type check

* fixed x-pack jest

* fixed x-pack jest

* reverted using of parentHistory

* Add debugging toasts to CCR.

* Comment out non-CCR functional tests.

* Fix typo.

* Uncomment non-CCR functional tests.

* Enable CCR.

* fix CI

* Add comment to explain why CCR is enabled by default and move config variable back to original location in CCR plugin.

* revert some changes in APM

* add space between index pattern name and tags

* fix function test

* Update x-pack/plugins/security/public/management/management_urls.ts

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

* Update x-pack/plugins/security/public/management/api_keys/api_keys_management_app.tsx

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

* Update x-pack/plugins/spaces/public/management/spaces_management_app.tsx

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

* Update x-pack/plugins/security/public/management/roles/roles_management_app.tsx

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

* Update x-pack/plugins/security/public/management/users/users_management_app.tsx

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

* Update x-pack/plugins/security/public/management/management_urls.ts

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

* Update x-pack/plugins/security/public/management/management_urls.ts

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

* [security] getUrlForApp -> navigateToApp

* [mp] fix Uncaught (in promise) undefined

Co-authored-by: Matt Kime <matt@mattki.me>
Co-authored-by: Uladzislau Lasitsa <Uladzislau_Lasitsa@epam.com>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
Co-authored-by: CJ Cenizal <cj@cenizal.com>
Co-authored-by: Joe Portner <5295965+jportner@users.noreply.github.com>
2020-06-03 18:55:06 +03:00
Yuliia Naumenko ce45dad8b6
Changed alerting API endpoints urls, bodies and params to follow Kibana STYLEGUIDE (#66838)
* Changed alerting API endpoints urls, bodies and params to follow Kibana STYLEGUIDE

* Changed alerting REST API to keep the pattern 'alerts/alert/{id}'

* fixed tests

* fixed tests

* Fixed jest tests

* Renamed plugin from alerting to alerts

* fixed tests

* fixed tests

* Fixed alert type check error

* Fixed find api

* fixed type checks

* fixed tests security issues

* Fixed view in app

* -

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-06-01 18:45:36 -07:00
Yuliia Naumenko d09bd63786
Changed actions API endpoints urls to follow Kibana STYLEGUIDE (#65936)
* Changed actions API endpoints urls to follow Kibana STYLEGUIDE

* Fixed tests

* fixed test

* fixed test

* resolved conflicts

* Fixed siem tests

* Fixed failing test

* fixed readme and test

* Changed actions api urls to follow the template 'api/{plugin}/{type}/{id}

* Fixed type checks

* Fixed tests and API

* fixed tests

* Fixed type checks

* fixed type check
2020-05-24 20:27:42 -07:00
restrry bf04235dae apply prettier styles 2020-05-22 09:08:58 +02:00
CJ Cenizal bfdeb10c15
Reorganize Management apps into Ingest, Data, Alerts and Insights, Security, Kibana, and Stack groups (#65796) 2020-05-15 16:11:27 -07:00
patrykkopycinski 9df3d9faab
[SIEM][Detection Engine] Add validation for Rule Actions (#63332) 2020-05-15 17:15:24 +02:00
Yuliia Naumenko 5ed5fda832
Allow registered alert types to be non-editable (#65606)
* Allow registered alert types to be non-editable

* Fixed isUiEditEnabled values

* Fixed due to comments

* fixed failing tests

* Enable alert type selection per alert consumer, only 'alerting' consumer can display other consumers alert types, but in case if it isEditable

* fixed tests

* Removed consumer property from the client side alert type registry and added server side property producer which purpose is to manage a feature logic

* fixed type check

* Fixed tests and type checks

* Removed error message for non registered plugins

* Fixed failing tests

* Fixed due to comments

* fixed test

* -

* revert logic for requiresAppContext

* Added close toast after saving alert
2020-05-12 13:38:22 -07:00
Gidi Meir Morris eef9ecefe0
[Alerting] Adds lazy loading to AlertType and Flyout components (#65678)
This PR:
1. Adds support for lazy loading AlertType components and migrates the built-in IndexThreshold components to lazy load.
2. Adds lazy loading of the components contained in the flyout so that only the wrapper component is imported by other plugins and the internal components are loaded when needed.
2020-05-12 17:05:46 +01:00
Mike Côté 68432daa9f
Fix flaky end to end test for alert edit (#65893)
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-05-12 08:29:07 -04:00
Mike Côté 5e5ad194f6
Fix edit alert flyout to update initialAlert after edit (#65359) 2020-05-09 12:32:26 -04:00
Gidi Meir Morris a79ab6db35
[Alerting] adds lazy loading of alerting UI components (#65060)
This PR adds code splitting into the Alerting Trigger UI by lazy loading the React Components needed for this plugin.

This include two key changes:

1. The plugin lazy loads its routes so that they don't get loaded at setup time.
2. This changes the way in which plugins can register their ActionType Components so they have to specify a lazy loaded component rather than a regular React component - this allows us to avoid loading all these components at setup time and defer this to when the Flyout/Triggers UI is loaded.
2020-05-07 17:44:45 +01:00
Yuliia Naumenko bb9eaf78a6
Fixed create new connector from alert flyout form throw an error messages in external plugins. (#65539)
* Fixed create new connector from alert flyout form throw an error messages in external plugins.

* Fixed due to comments
2020-05-06 16:06:40 -07:00
Yuliia Naumenko 2f8906926b
Added support for docLinks plugin in Connectors forms and missing save capabilities for modal dialog (#64986)
* Added support for docLinks plugin in Connectors forms and missing save capabilities for modal dialog

* Fixed tests

* Extended alert context with application capabilities

* Fixed due to comments

* Fixed typecheck

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-05-05 07:52:45 -07:00
Shahzad 6d9c59da60
[Uptime] Filters in create alert flyout (#64753) 2020-05-05 11:35:07 +02:00
Andrea Del Rio cf64454574
[Alerting] Alert Details and Alert List design improvements (#64839)
* added labels

* cleaned up flex elements in alert details view

* replace eye icon with mute switch

* removed Actions columns from Connectors list

* fix keypadmenuitems layout in action selection section

* fixed error

* more cleanup

* added back Actions column for Connectors List but with new name

* fix some tests

* fix another test

* removed unneeded lodash from  test file

* fix  test in details.ts

* removed unused translations

* removed Alerts (Actions) column from Connectors table"

* removed translation

* removed EuiBadge from connectors list

* updated test in connectors.ts

* fix function tests

* fix more function tests

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
Co-authored-by: Patrick Mueller <pmuellr@gmail.com>
2020-05-04 23:03:24 -07:00
Patrick Mueller 4788754419
[Alerting] only show trial upgrade when running with basic license (#64865)
resolves https://github.com/elastic/kibana/issues/64245

Prior to this PR, the "Upgrade your license" banner in the connectors list
was displayed for gold licenses because the Service Now action requires
platinum, and the check only looked for any actions disabled by license.

Rather than display a different message for gold users, this PR changes the
banner display logic to check for any actions disabled by license that
also have a minimum required license of gold.  That means gold+ users
won't see the message, even for actions with a minimum required license of
platinum+.  Another perk of the gold license!

This will continue to display the banner for basic users, but will no longer
display it for gold users.  It also continues to not display it for trial,
platinum and enterprise users.
2020-05-04 14:23:35 -04:00
Patrick Mueller cb00e5e7bb
[Alerting] fix labels and links in PagerDuty action ui and docs (#64032)
resolves #63222, resolves #63768, resolves #63223

ui changes:

- adds an "(optional)" label after the API URL label
- changes help link to go to alerting docs and not watcher docs
- changes the label "Routing key" to "Integration key" to match other docs
- changes the order of the severity options to match other docs

doc changes:

- changes the reference of "Routing key" to "Integration key" to match other docs
- makes clearer that the API URL is optional
2020-05-04 08:48:57 -04:00
Yuliia Naumenko f4db1c2b92
Fixed alert Edit flyout shows the error message when one of this actions has a preconfigured action type (#64742)
* Fixed alert Edit flyout shows the error message when one of this actions has a preconfigured action type

* Added tests

* fixed config

* fixed tests

* Fixed browser error about memory

* Fixed type check

* Fixed func tests

* fixed more tests

* fixed tests
2020-04-30 21:26:08 -07:00
Yuliia Naumenko 7e5be981d8
Fixed AddAlert flyout does not immediately update state to reflect new props (#64927)
* Fixed `AddAlert` flyout does not immediately update state to reflect new props

* fixed add form

* Fixed type check
2020-04-30 18:07:23 -07:00
Mike Côté b140ad7194
Remove edit alert button from alerts list (#64643)
* Remove edit alert button from alerts list

* Remove unused code

* Cleanup translation files

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-04-30 08:56:15 -04:00
Yuliia Naumenko 75fa843652
[Alerting] Implemented ability to edit an alert from the alert details page (#64273)
* Implemented ability to edit an alert from the alert details page

* Fixed refresh and tests

* fixed jest tests
2020-04-27 11:07:29 -07:00
Yuliia Naumenko 6bf0e731b6
Extended existing alerting functionality to support preconfigured only action types (#64030)
* Extended existing alerting functionality to support preconfigured only action types

* fixed functional test

* Adding documentation

* Fixed UI part due to comments

* added missing tests

* fixed action type execution

* Fixed documentation

* Fixed due to comments

* fixed type checks

* extended isActionExecutable to check exact action id if it is in the preconfigured list
2020-04-24 14:38:28 -07:00
Chandler Prall 126d187429
Upgrade to EUI v22.3.0 (#62963)
* snapshot updates

* bump to eui 22.3.0

* snapshots

* Fix css selector in test to match EUI internal DOM change

* Updated snapshots

* Insert react-beautiful-dnd@10 into top-level kibana to force siem's node_modules to hold its correct version

* More snapshot updates, resolved a typescript issue

* Move react-beautiful-dnd dependency around to make things happy again

* Use SearchFilterConfig from the top-level eui export

* Swallow 'ResizeObserver error does not have an err object' error in canvas

* Swallow ResizeObserver error cross-browser
2020-04-22 11:01:49 -06:00
Yuliia Naumenko 28313c4890
[Alerting] Fixed bug with no possibility to edit the index name after adding (#64033)
* Fixed bug with no possibility to edit the index name after adding

* fixed test

* fixed test

* fixed selector

* Move the testing to unit tests
2020-04-21 17:00:55 -07:00
Gidi Meir Morris 02d55db6cd
[Alerting] Improve validation and errors handling in PagerDuty action (#63954)
Improves the messaging when the Pager Duty action has trouble parsing the timestamp field and adds trimming on the timestamp's field to make us more flexible in handling the parsing and hence more likely to be forgiving of the input by the user.

As the timestamp relies on context variables provided via mustcahe templates, we can't reliably validate this field at alert creation time.
We address by:
1. Trimming the edges, which is required when parsing a date, should help prevent accidental spaces from breaking the parsing.
2. Checking for a mustache template on the client side and if there are none - we validate for a valid timestamp when the action is created.
2020-04-21 12:32:14 +01:00
Yuliia Naumenko 055d1fb7d4
[Alerting] Documentation for how to pre-configure connectors. (#63807)
* [Alerting] Documentation for how to pre-configure connectors.

* small fix

* Adjusted titles

* Fixed wrong link

* fixed warning

* Fixed ci issues

* [DOCS] Edits preconfigured connector docs

* Replaced words 'pre-configured' with 'preconfigured'

Co-authored-by: gchaps <chappell_5@yahoo.com>
2020-04-17 17:04:02 -07:00
Andrea Del Rio c13a026b01
[Alerting] "Create alert" and alert list design improvements (#63515)
* added header to actions section

* adjusted some spacing in Create Alert

* lighter text in Actions section headings

* fixed bulk actions dropdown

* improve alert collapsed item actions

* improve dropdown and adjust some buttos

* adjust font size of steps to match hierarchy

* need to check master

* improve collapsed actions menu

* added periods to help texts

* going back to EuiButtonEmpty to be able to use isLoading

* fix prop

* remove Fragment

* remove translations we're not using

* Fix functional tests

Co-authored-by: Mike Cote <mikecote@users.noreply.github.com>
2020-04-17 12:15:04 -07:00
Yuliia Naumenko 560e01a38f
[Alerting] Fixed issue when connectors dropdown not showing all available connectors (#63636) 2020-04-16 07:39:35 -07:00
Mike Côté bb0d03fe11
Fix alerting UI flaky tests (#62817)
* Use of testSubjects.setValue

* Add waitForEditAlertFlyout

* Fix some extra flakiness

* Test half second sleep to confirm cause of flakiness

* Revert 02417961f9

* Try clearWithKeyboard

* Fix test failures

* Fix uptime tests

* Revert uptime changes
2020-04-15 11:16:14 -04:00
Yuliia Naumenko 6f1fe676f2
Fixed inability to clear numeric field in a "Group over top docs" condition (#63543) 2020-04-15 06:43:17 -07:00
Yuliia Naumenko 0c09a7756f
Added connectors loading spinner to show the actions forms only when connectors is loaded (#63211)
* Added connectors loading spinner to show the actions forms only when connectors is loaded

* Added warning message for actions with removed connectors

* Fixed loading connectors spinner
2020-04-13 09:47:03 -07:00
Yuliia Naumenko 53ee20b306
Changed alerting wrong param name for help xpack.encrypted_saved_objects.encryptionKey to xpack.encryptedSavedObjects.encryptionKey (#63307) 2020-04-10 19:18:19 -07:00
Yuliia Naumenko fbd15ec867
Added UI for pre-configured connectors. (#63074)
* Added UI for pre-configured connectors.

* fixed due to comments

* Fixed jest tests

* Fixed due to comments and added some functional tests

* test fix

* Fixed failed checks

* Fixed functional tests failing
2020-04-10 14:55:03 -07:00
Jean-Louis Leysens d662cb5f45
[ESUI] Move XJson Mode to src/plugins/es_ui_shared (#62758)
* Move XJson to x-pack/es_ui_shared

Also convert files to TS and clean up use of @ts-ignore

* Move console_lang to public

* Proper use of mocks

* Globally mock out .ace.worker.js modules

Having worker code exported in `public` of es_ui_shared poisoned
a lot of Jest tests with the need to mock out the ace worker.

Instead of adding mocks everywhere we handle the importing in
Jest by adding an entry to module mapper.

* Remove manual imports of mocks

* Delete es_ui_shared/public/mocks for now

* Put useXJson code in single place

* Import and instantiate xJsonMode

* Remove language mocks imports

Besides the fact that these paths are wrong these are no longer
needed because we mock at use Jest module mapper

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-04-10 12:58:18 +02:00
Frank Hassanabad 834306458a
Fixes a needed import that was coming from APM but now isolates things better for optimization import builds
## Summary

Adds a single line to work with ts config optimizers. What is happening is that this is relying on an import from here:

```
x-pack/legacy/plugins/apm/public/utils/testHelpers.tsx
```

when really it should be isolated and imported within this file.

Testing is just to go to siem and run these commands:

```ts
cd /projects/kibana
node x-pack/legacy/plugins/siem/scripts/optimize_tsconfig.js
node scripts/type_check.js --project x-pack/tsconfig.json
```

Ensure you don't see any errors.
2020-04-09 13:52:02 -06:00
Yuliia Naumenko 80384c3209
Exposed AddMessageVariables as separate component (#63007)
* Exposed AddMessageVariables as separate component and added styles to allow to handle bigger list of messageVariables

* Fixed failing tests and styles

* Fixed due to comments
2020-04-09 07:50:11 -07:00
Gidi Meir Morris e3bd04fcb0
[Alerting] Displays warning when a permanent encryption key is missing and hides alerting UI appropriately (#62772)
Removes the Security flyout and instead replaces the Alerting List, Connectors List and Alert Flyout with suitable messaging.
Verifies that a permanent Encryption Key has been configured and if it hasn't displays a suitable warning in place, or along side the TLS warning, as needed.
2020-04-08 22:36:33 +01:00
Zacqary Adam Xeper 941a4879ae
[Alerting] Fix validation support for nested IErrorObjects (#62833)
* [Alerting] Add validation support for nested IErrorObjects

* Typecheck fix

* Fix recursion crash when errors are strings

* Typecheck fix
2020-04-08 12:40:27 -05:00
Yuliia Naumenko 730dcbf638
Implemented actions server API for supporting preconfigured connectors (#62382)
* Implemented actions server API for supporting preconfigured connectors defined in kibana.yaml

* Fixed type check

* Fixed due to comments and extended functional tests

* Fixed tests and renamed connectors

* fixed jest tests

* Fixed type checks

* Fixed failing alert save

* Fixed alert client tests

* fixed type checks

* Fixed language check error

* Fixed jest tests

* Added missing comments and docs

* fixed due to comments

* Fixed json config for preconfigured

* fixed type check, reverted config

* config experiment with json stringify

* revert experiment

* Removed the spaces from connector names in config
2020-04-08 09:54:42 -07:00
Yuliia Naumenko a8f84f87af
Improve UX for index document code editor to have similar UX as webhook (#62724)
* Improve UX for index document code editor to have similar UX as webhook's

* Fixed jest tests

* Fixed codestyle issue
2020-04-07 10:56:48 -07:00
Mike Côté 02dad02923
Rename some alert types (#61693)
* Rename some alert types

* Use sentence case for remaining changes + fix jest test

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-04-02 07:48:42 -04:00
Patrick Mueller 014ea125cd
[Alerting] add alerting privileges for uptime and metrics (#61113)
resolves https://github.com/elastic/kibana/issues/60135

See the reference issue for how to configure Kibana to test this manually.
There are no automated tests for this ATM.

The basic test scenario is to create a role with just the Uptime space
privilege, make sure it get to the Alerts and Actions management app,
make sure you can create an action (server log), and alert (index threshold),
and that the alert and action run successfully.

Then repeat with just the Metrics space privilege.
2020-04-01 12:09:26 -04:00
Gidi Meir Morris 12a588986b
[Alerting] Add "Start trial" button for connectors (#61774)
When Kibana is certain actions (connectors) disabled due to insufficient licensing we now display buttons that lead to both the Subscriptions page and the License Management page (where the user can start a trial).
2020-04-01 14:50:17 +01:00
Mike Côté dd70c81a7d
Fix validation for index threshold when selecting an index (#61615)
* Fix validation for index threshold when selecting an index

* Ensure timeField gets validation message

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-04-01 08:44:49 -04:00
Mike Côté 7d97ead26e
Adding PagerDuty icon to connectors cards (#60805)
* adding PagerDuty icon to connectors cards

* Fix jest

* remove unnecessary global typings from canvas and sync global typings in xpack with oss

Co-authored-by: Andrea Del Rio <delrio.andre@gmail.com>
Co-authored-by: spalger <spalger@users.noreply.github.com>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-03-31 13:41:00 -04:00
Yuliia Naumenko 81e1dca2c8
Added styles to make combobox list items wider for alerting flyout (#61894)
* Added styles to make combobox list items wider for alerting flyout

* Fixed width for OF expression popover

* Fixed due to comments

* Fixed due to comments

* Resized
2020-03-31 08:49:08 -07:00
Mike Côté d1214f8893
Add close button to expression popovers (#61352)
* Add X to trigger expression popovers

* Fix jest tests

* PR feedback

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-03-27 13:37:22 -04:00
Gidi Meir Morris 1246dc35a3
updated es index labels (#61504)
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-03-27 15:34:22 +00:00
Gidi Meir Morris 67397f944d
[Alerting] fixes styling of loading indicator (#61430)
Aligns the loading indicator with the middle of the form and adds some margins from the edges.

This has been done on both the alerts list and the connectors list.
2020-03-27 15:33:54 +00:00
Gidi Meir Morris 3f80d89eb5
[Alerting] Makes the tooltips in the ES Index Action a little clearer. (#61301)
Made the tooltips in the ES Action flyout a little clearer.
2020-03-26 09:29:23 +00:00
Josh Dover 37c92ca476
Fix plugin enabled config options (#60998) 2020-03-25 15:09:04 -06:00
Patrick Mueller aa73e2aee3
[Alerting] change index action config executionTimeField to nullable (#61127)
resolves https://github.com/elastic/kibana/issues/61056

When the index action params moved into config, the `schema.maybe()` on the
`executionTimeField` should have been changed to `schema.nullable()`, otherwise
you can never "unset" the field, once it's set.

Changes rippled down to the UI as well.

To be extra safe, we also check that the `executionTimeField` isn't an empty
string when trimmed, as ES will not accept a document with a property that is
the empty string.
2020-03-24 23:19:56 -04:00
Yuliia Naumenko 8d45ead109
Fixed issue on delete single or multiple alerts from the list cancel button doesn't work (#61187) 2020-03-24 18:08:41 -07:00
Yuliia Naumenko f9088ebcec
Remove "Upgrade" badge on disabled action types in the create connector flyout (#61111)
* Remove "Upgrade" badge on disabled action types in the create connector flyout

* Fix height of disabled cards

Co-authored-by: defazio <michael.defazio@elastic.co>
2020-03-24 12:49:17 -07:00
Gidi Meir Morris 18793dbc6c
[Alerting] notifies user when security is enabled but TLS is not (#60270)
This PR:
1. Adds a callout on the Alerting UI when security is enabled but TLS is not
2. Cleans up displayed error message when creation fails due to TLS being switched off
2020-03-24 19:15:27 +00:00
Yuliia Naumenko 5ff4c4ca6e
UI changes due to the text review (#61019)
* Fixed UI due to text review

* Fixed due to comments

* Fixed due to review comments
2020-03-24 10:11:36 -07:00
Gidi Meir Morris 8657caaffd
allow users to unset the throttle of an alert (#60964) 2020-03-24 14:51:15 +00:00
Gidi Meir Morris 4dbcb3c0e9
[Alerting] removes unimplemented buttons from Alert Details page (#60934)
Removed the "Edit" and "View in Activity Log" buttons as they have not yet been implemented.
2020-03-24 10:52:00 +00:00
Dario Gieselaar 85c0be357a
[APM] Threshold alerts (#59566)
* Add alerting/actions permissions for APM

* Export TIME_UNITS, getTimeUnitLabel from triggers actions UI plugin

* Add APM alert types and UI

* Review feedback

* Use Expression components for triggers

* Update alert name for transaction duration

* Change defaults for error rate trigger
2020-03-24 11:15:10 +01:00
Patrick Mueller 72bc0eae32
[Alerting] allow email action to not require auth (#60839)
resolves https://github.com/elastic/kibana/issues/57143

Currently, the built-in email action requires user/password properties to be
set in it's secrets parameters.  This PR changes that requirement, so they
are no longer required.
2020-03-23 19:02:28 -04:00
Yuliia Naumenko 0390251f69
Fixed UI/UX issues: alerts delete confirmation, combobox behaviors (#60703)
* Fixed UI/UX issues: alerts delete confirmation

* Fixed 4. Popover disappears when clearing the field selector

* Fixed tests

* Fixed due to comments

* fixed tests

* Fixed test
2020-03-20 21:29:06 -07:00
Yuliia Naumenko 67a01a71bd
Removed restriction on adding multiple connectors of the same action type to an alert (#60720)
* Allows multiple action under the same connector for alert

* Fixed due to comments

* fixed ui issue
2020-03-20 12:14:32 -07:00
Gidi Meir Morris ce0722b558
[Alerting] retains empty AlertsList when filter has removed all items (#60501)
Ensure that when the filtering on the AlertList removes all items we show the empty list rather than the Create Your First Alert CTA
2020-03-20 18:49:16 +00:00
Gidi Meir Morris da2ec4bf40
[alerting] fixes View In App Functional test (#60606)
Enables the FT that tests the View inApp functionality.
It addresses an issue that causes a race condition on CI where the ViewInApp button was thought to be enabled when it was, in fact, still disabled.
This meant that the click on the button didn't trigger the handler which, in turn, made the test fail.
2020-03-20 17:42:25 +00:00
Marco Vettorello 88612743a9
Update dependency @elastic/charts to v18.1.0 (#60578) 2020-03-20 17:37:11 +01:00
Gidi Meir Morris 4c19cad11b
[Alerting] prevent flickering when fields are updated in an alert (#60666)
This addresses the flickering in the graph when updating the Alert Add & Edit forms and adds an automatic refresh of the graph every 5 seconds.
2020-03-20 14:50:35 +00:00
Mike Côté 851b8a82a5
License checks for actions plugin (#59070)
* Define minimum license required for each action type (#58668)

* Add minimum required license

* Require at least gold license as a minimum license required on third party action types

* Use strings for license references

* Ensure license type is valid

* Fix some tests

* Add servicenow to gold

* Add tests

* Set license requirements on other built in action types

* Use jest.Mocked<ActionType> instead

* Change servicenow to platinum

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>

* Make actions config mock and license state mock use factory pattern and jest mocks (#59370)

* Add license checks to action HTTP APIs (#59153)

* Initial work

* Handle errors in update action API

* Add unit tests for APIs

* Make action executor throw when action type isn't enabled

* Add test suite for basic license

* Fix ESLint errors

* Fix failing tests

* Attempt 1 to fix CI

* ESLint fixes

* Create sendResponse function on ActionTypeDisabledError

* Make disabled action types by config return 403

* Remove switch case

* Fix ESLint

* Add license checks within alerting / actions framework (#59699)

* Initial work

* Handle errors in update action API

* Add unit tests for APIs

* Verify action type before scheduling action task

* Make actions plugin.execute throw error if action type is disabled

* Bug fixes

* Make action executor throw when action type isn't enabled

* Add test suite for basic license

* Fix ESLint errors

* Stop action task from re-running when license check fails

* Fix failing tests

* Attempt 1 to fix CI

* ESLint fixes

* Create sendResponse function on ActionTypeDisabledError

* Make disabled action types by config return 403

* Remove switch case

* Fix ESLint

* Fix confusing assertion

* Add comment explaining double mock

* Log warning when alert action isn't scheduled

* Disable action types in UI when license doesn't support it (#59819)

* Initial work

* Handle errors in update action API

* Add unit tests for APIs

* Verify action type before scheduling action task

* Make actions plugin.execute throw error if action type is disabled

* Bug fixes

* Make action executor throw when action type isn't enabled

* Add test suite for basic license

* Fix ESLint errors

* Stop action task from re-running when license check fails

* Fix failing tests

* Attempt 1 to fix CI

* ESLint fixes

* Return enabledInConfig and enabledInLicense from actions get types API

* Disable cards that have invalid license in create connector flyout

* Create sendResponse function on ActionTypeDisabledError

* Make disabled action types by config return 403

* Remove switch case

* Fix ESLint

* Disable when creating alert action

* Return minimumLicenseRequired in /types API

* Disable row in connectors when action type is disabled

* Fix failing jest test

* Some refactoring

* Card in edit alert flyout

* Sort action types by name

* Add tooltips to create connector action type selector

* Add tooltips to alert flyout action type selector

* Add get more actions link in alert flyout

* Add callout when creating a connector

* Typos

* remove float right and use flexgroup

* replace pixels with eui variables

* turn on sass lint for triggers_actions_ui dir

* trying to add padding around cards

* Add callout in edit alert screen when some actions are disabled

* improve card selection for Add Connector flyout

* Fix cards for create connector

* Add tests

* ESLint issue

* Cleanup

* Cleanup pt2

* Fix type check errors

* moving to 3-columns cards for connector selection

* Change re-enable to enable terminology

* Revert "Change re-enable to enable terminology"

This reverts commit b497dfd6b6.

* Add re-enable comment

* Remove unecessary fragment

* Add type to actionTypeNodes

* Fix EuiLink to not have opacity of 0.7 when not hovered

* design cleanup in progress

* updating classNames

* using EuiIconTip

* Remove label on icon tip

* Fix failing jest test

Co-authored-by: Andrea Del Rio <delrio.andre@gmail.com>

* Add index to .index action type test

* PR feedback

* Add isErrorThatHandlesItsOwnResponse

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
Co-authored-by: Andrea Del Rio <delrio.andre@gmail.com>
2020-03-20 10:49:37 -04:00
Yuliia Naumenko 64e09af107
Implemented ability to clear and properly validate alert interval (#60571)
* Implemented ability to clear and properly validate alert interval

* Fixed due to comments

* Fixed additional request for the last field

* Fixed failing test
2020-03-20 07:18:54 -07:00
Mike Côté 05a0625048
Clear changes when canceling an edit to an alert (#60518)
* Clear alerting edit flyout after canceling an edit

* Add functional test

* Fix merge conflicts
2020-03-19 10:40:22 -04:00
Mike Côté 4efeeac560
Sort by name when fetching alerts and connectors (#60506)
* Sort by name when fetching alerts and connectors

* Fix jest tests

* Add functional test

* Fix failing jest test
2020-03-19 08:06:51 -04:00
Gidi Meir Morris 8fd317c55a
[Alerting] Adds navigation by consumer and alert type to alerting (#58997)
Adds Navigation APIs to Alerting.

Parts to this PR:

Adds a client side (Public) plugin to Alerting, including two APIs: registerNavigation & registerDefaultNavigation. These allow a plugin to register navigation handlers for any alerts which it is the consumer of- one for specific AlertTypes and one for a default handler for all AlertTypes created by the plugin.
The Alert Details page now uses these navigation handlers for the View In App button. If there's an AlertType specific handler it uses that, otherwise it uses a default one and if the consumer has not registered a handler - it remains disabled.
A generic Alerting Example plugin that demonstrates usage of these APIs including two AlertTypes - one that always fires, and another that checks how many people are in Outer Space and allows you to trigger based on that. 😉 To enable the plugin run yarn start --ssl --run-examples
2020-03-19 09:49:05 +00:00
Yuliia Naumenko 3600f5b90b
Fixed default message for index threshold includes both threshold values (#60545)
* Fixed default message for index threshold includes both threshold values even if not used

* fixed due to review comments

* Fixed validation errors with ability to clear input
2020-03-18 16:43:22 -07:00
Yuliia Naumenko 2d44870e06
Solved the issue for a GROUP BY expression validation (#60558)
* Solved the issue for a GROUP BY expression validation

* fixed labels
2020-03-18 14:29:40 -07:00
Yuliia Naumenko 18aa8245b7
Fixed errors which are happening if switch between alert types (#60453) 2020-03-18 09:48:10 -07:00
Mike Côté a97ecaae69
Fix create alert button from not showing in alerts list (#60444) 2020-03-18 08:31:03 -04:00
Yuliia Naumenko 2207e0ab26
Index Action - Moved index params fields to connector config (#60349)
* Moved index params fields to connector config

* Fixed type check issue

* Fixing functional tests

* Fixed due to comments

* Fixed functional tests

* Fixed tests and type check
2020-03-17 18:20:00 -07:00
Yuliia Naumenko 2e6c76fda7
Disabled edit alert button on management ui for non registered UI alert types (#60439) 2020-03-17 16:33:37 -07:00
Yuliia Naumenko 90f3778bc6
Added variables button for text fields in Pagerduty component. (#60189)
* Added variables button for text fields in Pagerduty component. Fixed bugs mentioned in https://github.com/elastic/kibana/issues/60067

* Fixed due to comments

* fixed language check issue

* Fixed tests

* Fixed due to comments
2020-03-16 19:39:21 -07:00
Yuliia Naumenko 4ebdc4edad
Added message variables button for Webhook body form field (#60174)
* Added message variables button for Webhook body form field

* Fixed test issue
2020-03-16 17:02:41 -07:00
Patrick Mueller ce1836b2af
[Alerting] extend Alert Type with names/descriptions of action variables (#59756)
resolves https://github.com/elastic/kibana/issues/58529

This PR extends alertType with an `actionVariables` property, which
describes the properties of the context object passed when scheduling
actions, and the current state.  These property descriptions are used
by the web ui for the alert create and edit forms, to allow the properties
to be added to action parameters as mustache template variables.
2020-03-12 23:17:29 -04:00
Yuliia Naumenko d3f53f6f6b
Adds telemetry support to alerting and actions plugins (#58081)
* Added base telemetry functionality

* Fixed actions collector due to NP plugin changes

* Fixed type checks

* Fixed alerting plugin usage collector

* Added actions and alerting telemetry tasks

* Fixed failing tests and resolved comments

* Extended telemetry for alerts by adding aggregations for throttle, schedule and connectors count

* Fixed tests

* Refactored using callCluster aggregations

* Fixed compare

* Fixed time convertion
2020-03-12 10:46:24 -07:00
Gidi Meir Morris fa16b2b849
Alerting/fix flaky instance test (#58994)
The Alert Instances list calculates duration on each page load, which makes it hard for the test runner to know what the correct value should be.
In the PR we expose the epoch used by the duration calculation in such a way that the test runner can read it and asses the duration correctly.
2020-03-11 08:34:22 +00:00
Mike Côté c51d287862
Fix UX in alerting UI forms when errors occur (#59444)
* Fix UX in UI forms when errors occur

* Create connector modal won't change

* ESLint fixes

* Fix type check

* Add some tests

* Remove if checks

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-03-10 21:11:18 -04:00
Patrick Mueller 3f365a82f8
[Alerting] replace watcher http APIs used by index threshold Alerting (#59475)
Prior to this PR, the alerting UI used two HTTP endpoints provided by the
Kibana watcher plugin, to list index and field names.  There are now two HTTP
endpoints in the alerting_builtins plugin which will be used instead.

The code for the new endpoints was largely copied from the existing watcher
endpoints, and the HTTP request/response bodies kept pretty much the same.

resolves https://github.com/elastic/kibana/issues/53041
2020-03-09 19:30:20 -04:00
Andrea Del Rio 55fa3d6f42
[Alerting] "Create alert" graph visualization design improvements (#59399) 2020-03-06 18:29:17 -08:00
Patrick Mueller ba40d25d46
[Alerting] replace index threshold graph usage of watcher APIs with new API (#59385)
Changes the alerting UI to use the new time series query HTTP endpoint provided by the builtin index threshold alertType; previously it used a watcher HTTP endpoint.

This is part of the ongoing index threshold work tracked in https://github.com/elastic/kibana/issues/53041
2020-03-06 10:26:52 -05:00
Yuliia Naumenko 5ff13ada6b
Add custom action to registry and show actions list in siem (#58395)
* Add custom action to registry and show actions list in siem

* Exposed action form as reusable component

* Fixed few small bugs

* Fixed red ci

* Fixed type checks

* Fixed failed tests

* Fixed due to comments

* Fixed type check errors

* Fixed plugin check

* Rebalancing CI groups according to #58930

* Fixed merge issues
2020-03-05 17:47:08 -08:00
Yuliia Naumenko e869695d73
Added possibility to embed connectors create and edit flyouts (#58514)
* Added possibility to embed connectors flyout

* Fixed type checks and removed example from siem start page

* Fixed jest tests

* Fixed failing tests

* fixed type check

* Added config for siem tests

* Fixed failing tests

* Fixed due to comments

* Added missing documentation
2020-03-05 14:57:32 -08:00
Yuliia Naumenko 26aed8dc30
Extended AlertContextValue with metadata optional property (#59391)
* Extended AlertContextValue with metadata optional property

* Made metadata generic
2020-03-05 11:55:30 -08:00
Chandler Prall 096dda6f34
Upgrade EUI to v20.0.2 (#59199)
* Updated EUI to 20.0.1; updated typescript usage

* snapshots

* Upgrade to eui 20.0.2, fix one more type

* PR feedback

* Update EUI icon usage to the correct types

* Updated with master
2020-03-05 12:27:52 -07:00
Yuliia Naumenko daf622687e
Edit alert flyout (#58964)
* Implemented edit alert functionality

* Added unit tests

* Added functional test for edit alert

* Fixed failed tests

* Fixed edit api

* Fixed due to comments

* Fixed functional test

* Fixed tests

* Fixed add alert

* Small type fix

* Fixed jest test

* Fixed type check

* Fixed bugs with interval and throttle + index threshold expression
2020-03-04 12:56:34 -08:00
Yuliia Naumenko 5cdb0153dc
Fixed test (#59208) 2020-03-03 13:40:51 -08:00
spalger b95abbae45 skip flaky suite (#58970) 2020-03-03 11:49:27 -07:00
Patrick Mueller 388705509f
[Alerting]: get type-checking, tests, and ui working for index threshold (#59064)
This is a follow-on to https://github.com/elastic/kibana/pull/57030 ,
"[alerting] initial index threshold alertType and supporting APIs",
to get it working with the existing alerting UI.  The parameter shape
was different between the two, so the alertType was changed to fix
the existing UI shapes expected.
2020-03-03 08:28:31 -05:00
Yuliia Naumenko a896515195
Add beta badge to alert and actions UI components (#58691)
* Added Beta badge to Alerts and Actions UI components

* Fixed failing test

* Fixed FT

* Fixed labels
2020-02-27 12:43:23 -08:00
Yuliia Naumenko 515348438b
Fixed connector and alerts view flashing empty state before loading list (#58693) 2020-02-27 08:14:45 -08:00
Yuliia Naumenko 1eb0176036
Added UI support for the default action group for Alert Type Model (#57603)
* Added UI support for the default action group for Alert Type Model

* Fixed set default on  alert type select

* Fixed type check

* Moved setting of default alert type to the server api

* Added default value for actionGroups if it is empty in register alert type functions

* Fixed type check

* Fixed due to comments	aed89377b9	Yuliia Naumenko <yuliia.naumenko@elastic.com>	Feb 20, 2020 at 12:40 PM

* Renamed defaultActionGroup to defaultActionGroupId

* Fixed failing tests
2020-02-21 13:58:54 -08:00
Gidi Meir Morris 85097d5fad
adds pagination on Alert Instances list on Alert Details page (#57524)
* added pagination on alert instances page

* extracted default page size to a constant for alerting UI as a whole

* Fix test failure

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
Co-authored-by: Mike Côté <mikecote@users.noreply.github.com>
2020-02-19 10:08:01 -05:00
Yuliia Naumenko 1b15872ab8
Guide for creating alert / action types in the UI (#55963)
* Guide for creating alert type UI

* Type fixed

* Extended documentation for alert type and expression components usage

* fixed merge issues

* Added info for embedding create alert flyout

* Added alert type registration details

* Fixed table definition

* Fixed the rest of the tables styles

* Added builtin action types description

* Added example for action type

* Extended action create description

* Fixed some parts

* Fixed review comments

* Update x-pack/plugins/triggers_actions_ui/README.md

Co-Authored-By: gchaps <33642766+gchaps@users.noreply.github.com>

* Update x-pack/plugins/triggers_actions_ui/README.md

Co-Authored-By: gchaps <33642766+gchaps@users.noreply.github.com>

* Update x-pack/plugins/triggers_actions_ui/README.md

Co-Authored-By: gchaps <33642766+gchaps@users.noreply.github.com>

* Update x-pack/plugins/triggers_actions_ui/README.md

Co-Authored-By: gchaps <33642766+gchaps@users.noreply.github.com>

* Update x-pack/plugins/triggers_actions_ui/README.md

Co-Authored-By: gchaps <33642766+gchaps@users.noreply.github.com>

* Update x-pack/plugins/triggers_actions_ui/README.md

Co-Authored-By: gchaps <33642766+gchaps@users.noreply.github.com>

* Update x-pack/plugins/triggers_actions_ui/README.md

Co-Authored-By: gchaps <33642766+gchaps@users.noreply.github.com>

* Update x-pack/plugins/triggers_actions_ui/README.md

Co-Authored-By: gchaps <33642766+gchaps@users.noreply.github.com>

* Update x-pack/plugins/triggers_actions_ui/README.md

Co-Authored-By: gchaps <33642766+gchaps@users.noreply.github.com>

* Update x-pack/plugins/triggers_actions_ui/README.md

Co-Authored-By: gchaps <33642766+gchaps@users.noreply.github.com>

* Update x-pack/plugins/triggers_actions_ui/README.md

Co-Authored-By: gchaps <33642766+gchaps@users.noreply.github.com>

* Update x-pack/plugins/triggers_actions_ui/README.md

Co-Authored-By: gchaps <33642766+gchaps@users.noreply.github.com>

* Update x-pack/plugins/triggers_actions_ui/README.md

Co-Authored-By: gchaps <33642766+gchaps@users.noreply.github.com>

* Update x-pack/plugins/triggers_actions_ui/README.md

Co-Authored-By: gchaps <33642766+gchaps@users.noreply.github.com>

* Update x-pack/plugins/triggers_actions_ui/README.md

Co-Authored-By: gchaps <33642766+gchaps@users.noreply.github.com>

* Update x-pack/plugins/triggers_actions_ui/README.md

Co-Authored-By: gchaps <33642766+gchaps@users.noreply.github.com>

* Update x-pack/plugins/triggers_actions_ui/README.md

Co-Authored-By: gchaps <33642766+gchaps@users.noreply.github.com>

* Update x-pack/plugins/triggers_actions_ui/README.md

Co-Authored-By: gchaps <33642766+gchaps@users.noreply.github.com>

* Update x-pack/plugins/triggers_actions_ui/README.md

Co-Authored-By: gchaps <33642766+gchaps@users.noreply.github.com>

* Fixed review comments

Co-authored-by: gchaps <33642766+gchaps@users.noreply.github.com>
2020-02-18 11:12:07 -08:00
Yuliia Naumenko c07ff7174e
Alerting plugin migrate to Kibana platform (#57635)
* Moved alerting plugin to new platform

* Fixed type checks

* Fixed failing tests

* Fixed functional tests

* Fixed plugin context initialization

* small typo

* Fixed type checks

* Fixed create alert schema

* Moved alerting files to Kibana platform folder

* Fixed duration validation

* Fixed find page size

* Fixed type check

* Fixed due to comments

* Fixed merge issues

* Added missing

* Fixed alerting functional tests

* Fixed tests

* Fixed update schema validation

* Added throttle update

* Fixed failing tests

* test

* fixed setup alerting dependencies for siem and monitoring plugins

* Fixed siem setup dependancies
2020-02-18 09:05:56 -08:00
Andrea Del Rio 0faab4aa48
[Alerting] Create alert design cleanup (#56929) 2020-02-12 14:58:15 -08:00
Gidi Meir Morris fd193fdf59
[Alerting] make actionGroup name's i18n-able (#57404)
We want to make the Action Group i18n-able for display in the AlertDetails page, so instead of just a list of ids, the AlertType now registers an object where key is the id and value is the human readable, and translatable, value.
2020-02-13 10:21:48 +13:00
Gidi Meir Morris 3effcdb94a
displays Alert Instance state on Alert Details page (#56842)
Adds a list of Alert Instances to the Alert Details page based off of the current state of the Alert.
2020-02-12 11:53:06 +13:00
Peter Schretlen bb7e152211
Webhook action - make user and password secrets optional (#56823) 2020-02-10 17:08:56 -05:00
Liza Katz 09c6f25ce5
Field Formats namespace (#56975)
* Field Formats namespace

* Export IFieldFormatsRegistry and FieldFormatsRegistry separately.

* remove field_formats export from data plugin and adjust lens test

* Updated doc return types

* Cleanup fieldFormat namespace and define it index.ts

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-02-10 16:45:43 +02:00
Yuliia Naumenko 2e0d09ba27
Exposed common EuiExpressions to separate components be able to reuse for building new for Alert Types (#56466)
* Exposed common Expression to separate components be able to reuse

* Expressions with unit tests

* Fixed type check

* Fixed merge issues

* Fixed due to review

* Cleaned up some not used params and added position popover definition

* fixed type check

* Unbinded alerting reusable components from application context

* Added consumer and alertTypeId with enable change alert type button props

* Fixed case for default alert type id was set

* Fixed chart visualization issues

* Exposed registry in triggers and actions ui

* Fixed alert_list to enable charts

* Fixed due to comments and simplified props
2020-02-06 18:30:57 -08:00
Mike Côté 8951424f82
Convert triggers and actions UI to Kibana Platform (#56388)
* Convert triggers and actions UI to Kibana Platform

* Copy ui/time_buckets over

* Fix i18n

* Fix scss

* Fix UI from not loading anymore
2020-02-06 10:50:26 -05:00