Commit graph

31375 commits

Author SHA1 Message Date
Robert Austin
12a3ccf565
Use HTTP request schemas to create types, use those types in the client (#59340)
* wip

* wip

* wip

* will this work?

* wip but it works

* pedro

* remove thing

* remove TODOs

* fix type issue

* add tests to check that alert index api works

* Revert "add tests to check that alert index api works"

This reverts commit 5d40ca18337cf8deb63a0291150780ec094db016.

* Moved schema

* undoing my evils

* fix comments. fix incorrect import

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-03-09 13:23:22 -04:00
Thomas Neirynck
6e5e8c815e
[Maps] Support categorical styling for numbers and dates (#57908) 2020-03-09 13:22:30 -04:00
Robert Oskamp
4bd7b36431
[ML] Functional API tests - bucket span estimation with custom search.max_buckets (#59665)
This PR adds functional API tests for the bucket span estimation endpoint with a transient or persistent `search.max_buckets` setting.
2020-03-09 18:03:47 +01:00
CJ Cenizal
239ca74fc9
Fix slm_ui setting by changing camel case back to snake case. (#59663) 2020-03-09 09:55:59 -07:00
Ben Skelker
51fb32bbf3
removes beta tag (#59618) 2020-03-09 17:58:13 +02:00
Kaarina Tungseth
84f6885c36
[DOCS] Removed spatial references (#59595)
* [DOCS] Removed ss above spatial references

* Removed above from n numeral formatting page
2020-03-09 10:29:25 -05:00
Joe Reuter
da3c9d968c
fix outdated docs (#58729) 2020-03-09 16:22:52 +01:00
James Gowdy
8a4bb61f05
[ML] Fixes bucket span estimators loading of max_buckets setting (#59639)
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-03-09 14:43:23 +00:00
James Gowdy
92cc04c7df
[ML] Refactoring anomaly detector job types (#59556)
* [ML] Refactoring anomaly detector job types

* removing calendar type

* update validateCardinality

* fixing test

* updating  types in functional tests

* using state constants
2020-03-09 13:51:07 +00:00
Jean-Louis Leysens
492a97e288
[Upgrade Assistant] Better handling of closed indices (#58890)
* Exclude disallowed, private setting at index creation

* Remove intl from tabs component

* Added logic for checking the current index status

* Added ES contract integration test

Using _cluster/state is considered internal. This adds an integration
test for checking the contract in CI.

* Add the client side notification for closed indices

* First version of end-to-end functionality working

* Clean up unused, incorrect type information

* Fix type issues and added a comment about the new reindex options

* Fixed server side tests, added comments and logic updates

Updated the handling of reindexOptions to make it more
backwards compatible (treat it as if it could be undefined).

Also update the logic for checking for open or closed indices.
No optional chaining! It should break if the response does not
exactly match.

* Clean up unused code

* Improved idempotency of test and check explicitly for "close".

Rather check for the specific value we want, as this is what is
also gauranteed by the tests. In this way, the information we
send back to the client is also more accurate regarding the index
status. If, in future, more index states are introduced this will
need to be revisited if it affects the ability for an index to be
re-indexed.

* Update client-side tests

* Fix types

* Handle a case where the index name provided may be an alias

* Fix types

* merge-conflict: finish merge conflict resolution

* Update x-pack/plugins/upgrade_assistant/public/application/components/tabs/checkup/deprecations/reindex/closed_warning_icon.tsx

Co-Authored-By: Alison Goryachev <alisonmllr20@gmail.com>

* merge-conflict: Remove duplicate import

VSCode does not auto-save as expected :sigh:

* ui: Revisit the UI

Moved the warning icon to inside of the button and tooltip to
on the button.

Added a callout to the reindex flyout for when an index is closed.

* logic: slight update to when the index closed callout is shown

We only show the index closed callout in the flyout when the
reindex operation is not considered "completed"

* tests: fix jest tests

* refactor: remove "openAndClose" from reindex endpoints

"openAndClose" should just happen automatically. The user should
not have to pass the flag in, that would be a weird API. We just
need to warn the user about that reindexing a closed index will
take more resources

* test: update upgrade assistant integration test

* fix: types

* copy: use sentence case

* refactor: use the in scope declaration of reindex op

* test: Clean up tests

Reindexing test was generating index name, could just get it from
server response. Also removed openAndClose from all integration
tests

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
Co-authored-by: Alison Goryachev <alisonmllr20@gmail.com>
2020-03-09 14:11:31 +01:00
Peter Pisljar
a6489aa70e
additional visualizations plugin cleanup before moving to NP (#59318) 2020-03-09 13:11:05 +01:00
Alexey Antonov
f0e063c9f5
In scripted fields, unable to switch the Type - getting a console error which says - Class constructor DecoratedFieldFormat cannot be invoked without 'new' (#59285)
Closes: #58763

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-03-09 14:47:53 +03:00
Daniil Suleiman
1d0697a1cc
[Visualize] Remove global state in visualize (#58352)
* Remove global state in visualize

* Fix saved query

* Update saved query handling

* Resolve merge conflicts

* Use new state syncing helpers

* Fix state behavior

* Prevent loosing the global state

* Update state syncing with url

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-03-09 13:45:25 +03:00
Pierre Gayvallet
1f8da9dd77
Reset the metrics after each emission (#59551)
* reset the metrics after each emission

* add test comment
2020-03-09 11:03:46 +01:00
Liza Katz
3be4560092
explicit exports (#59620) 2020-03-09 10:53:51 +02:00
Mikhail Shustov
5c436534d6
Add an optional authentication mode for HTTP resources (#58589)
* add authRequred: 'optional'

* expose auth status via request context

* update security plugin to use notHandled auth outcome

* capabilities service uses optional auth

* update tests

* attach security headers only to unauthorised response

* add isAuthenticated tests for 'optional' auth mode

* security plugin relies on http.auth.isAuthenticated to calc capabilities

* generate docs

* reword test suit names

* update tests

* update test checking isAuth on optional auth path

* address Oleg comments

* add test for auth: try

* fix

* pass isAuthenticted as boolean via context

* remove response header from notHandled

* update docs

* add redirected for auth interceptor

* security plugin uses t.redirected to be compat with auth: optional

* update docs

* require location header in the interface

* address comments #1

* declare isAuthenticated on KibanaRequest

* remove auth.isAuthenticated from scope

* update docs

* remove unnecessary comment

* do not fail on FakrRequest

* small improvements
2020-03-07 11:55:20 +01:00
Matthew Kime
74f9b448f7
Implement embeddable drilldown menu options (#59232)
* Implement embeddable drilldown menu options
2020-03-06 20:58:24 -06:00
Andrea Del Rio
55fa3d6f42
[Alerting] "Create alert" graph visualization design improvements (#59399) 2020-03-06 18:29:17 -08:00
Yuliia Naumenko
b960c6aff7
Alerting update route throttle property is missing (#59580)
* Added throttle property to update method of alertClient

* Fixed failing snapshot

* Fixed type check errors

* Fixed null update for siem throttle
2020-03-06 17:21:21 -08:00
MadameSheema
9ab4aa027c
[SIEM] Adds 'Load prebuilt rules' Cypress test (#59529)
* adds 'load prebuilt rules'

* fixes typecheck issue

* updates jest snapshot
2020-03-06 22:41:05 +01:00
Liza Katz
5db1b0a18d
Show error if field is not found during filter rendering (#59298)
* Show error if field is not found

* Errored filter state

* Design adjustments

* Fixing class names and making look similar to disabled

* code review fixes

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
Co-authored-by: cchaos <caroline.horn@elastic.co>
2020-03-06 23:32:42 +02:00
Brian Seeders
ac9c192234
Navigate back to discover app during test, because the saved search from the preceding test has major performance problems when used with this test (#59571) 2020-03-06 16:04:11 -05:00
Brian Seeders
dd9999bf5d
Check for alert dialog when doing a force logout (#59329) 2020-03-06 16:03:41 -05:00
Spencer
76c205cd1e
ensure fs deletes are not cwd dependent (#59570)
Co-authored-by: spalger <spalger@users.noreply.github.com>
2020-03-06 11:54:49 -07:00
Nathan L Smith
0d3dd97691
Empty message for APM service map (#59518)
When only one node is displayed, show an empty message.

Also:

* Start adding a basic Jest test for the ServiceMap component
* Fix bug where EuiDocsLink was rendering "children" instead of the actual children

Closes #59326.
Closes #59128.
2020-03-06 12:54:28 -06:00
Anton Dosov
3c4cf56008
[Drilldowns] <ActionWizard/> Component (#59032) 2020-03-06 19:46:47 +01:00
Tim Sullivan
fbbb3f8091
[Reporting] Improve the page exit error messages (#59351)
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-03-06 11:43:15 -07:00
Brian Seeders
8fa9962641
Ensure logged out starting state for tests that need it (#59322) 2020-03-06 12:16:06 -05:00
Pierre Gayvallet
45fb6f38b8
Hide input value from kbn-config-schema error messages (#58843)
* use inline snapshots instead of snapshots

* hide input value from error messages

* update core snapshots

* update xpack snapshots

* fix ftr assertions

* fix new snapshots

* hide values for byte_size and duration

* update new snapshots

* remove another byte_size value reference

* fix yet another value references in error messages

* update xpack snapshots

* update xpack ftr assertions
2020-03-06 17:47:28 +01:00
Walter Rafelsberger
f4f956dfeb
[ML] Transforms: Migrate client plugin to NP. (#59443)
Migrates the client side plugin of transforms to NP.
- Gets rid of the last parts of the shim (http, documentation links)
- Moves the plugin from x-pack/legacy/plugins/transform/public to x-pack/plugins/transform
- Creates a custom mock for appDependencies based on NP services
- Fixes jest tests to get rid of all act() related warnings
2020-03-06 17:44:35 +01:00
Robert Oskamp
708d92a00e [ML] Disable failing functional tests 2020-03-06 16:55:57 +01:00
Andrew Goldstein
060b9fb10e
[SIEM] Update Timeline to use the latest euiFlyoutBody style (#59524)
## [SIEM] Update Timeline to use the latest euiFlyoutBody style

[A recent update to EUI](https://github.com/elastic/eui/pull/2837) requires an update to Timeline to restore its original padding, per the before / after screenshots below:

### Before

The previous code, which was using the `euiFlyoutBody__overflow` style, has extra padding (before this PR):

![timeline-padding-before-chrome](https://user-images.githubusercontent.com/4459398/76060425-81e37500-5f3e-11ea-8083-a58297afee85.png)

### After Chrome `80.0.3987.132`

The new code in this PR uses `euiFlyoutBody__overflowContent`, which restores the Timeline's original padding:

![timeline-paddng-after-chrome-default-theme](https://user-images.githubusercontent.com/4459398/76060436-8b6cdd00-5f3e-11ea-80d6-9ff0e74722c3.png)

![timeline-padding-after-chrome-dark-theme](https://user-images.githubusercontent.com/4459398/76060601-dedf2b00-5f3e-11ea-8a46-1008d7defe09.png)

### After Firefox `73.0.1`

![timeline-padding-after-firefox](https://user-images.githubusercontent.com/4459398/76060692-18b03180-5f3f-11ea-8277-31b6f9dbf211.png)

### After Safari `13.0.5`

![timeline-padding-after-safari](https://user-images.githubusercontent.com/4459398/76060744-38475a00-5f3f-11ea-9b04-cdd45fa41702.png)
2020-03-06 08:45:08 -07:00
Alex Holmansky
07757eae84
Temporarily remove the project mappings for PR labels (#59493)
* Use diagnostics-enable action in the workflow. Issue: #56526

* Update workflow to use v1.0.2 of the action

* Adding a new test workflow that uses a personal access token

* Remove an extra coma

* Updated project-assigner action version and access key

* Deleted the test workflow

* Temporarily commenting out project mappings while we debug the permissions issues

* Temporarily commenting out project mappings while we debug the permissions issues

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-03-06 10:31:47 -05: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
Dima Arnautov
d969c08a00
[ML] Show view series link in anomalies table for machine_learning_user role (#59549) 2020-03-06 16:19:03 +01:00
Corey Robertson
9a3d0a5229
Move build_embeddable_filters into public (#59087)
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-03-06 10:12:05 -05:00
Jonathan Buttner
2e41a27c46
[Endpoint] Unifying the test index name for resolver and alerts (#59073)
* Unifying the test index name for resolver and alerts

* Endpoint isn't sending the agent field so check for it

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-03-06 09:43:52 -05:00
Marta Bondyra
4977e57a3e
[Lens] Remove warnings in tests in EditorFrame (#59447)
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-03-06 13:06:41 +01:00
Joe Reuter
44a35ecdbd
Move timelion app hiding to new platform (#58740) 2020-03-06 12:40:57 +01:00
Dima Arnautov
3a53fe8e45
[ML] Use Kibana's HttpHandler for HTTP requests (#59320)
* [ML] use kibana http

* [ML] fromHttpHandler

* [ML] remove __LEGACY, update asSystemRequest header

* [ML] transform with NP http
2020-03-06 11:34:19 +01:00
Cauê Marcondes
2817d6e3a8
[APM] Create settings page to manage Custom Links (#57788)
* creating custom action index

* reverting service form to service section

* creating useForm hooks and fields section

* adding react-hook-form

* refactoring

* validating filters

* fixing imports

* refactoring to NP and creating save custom action

* creating basic apis for custom actions

* refactoring

* changing custom action filters type

* adding delete option

* removing useForm

* fixing flyout view

* filters are invalid when selecting the default value

* ui fixes

* ui fixes

* fixing typescript

* fixing typescript

* fixing labels and adding space btw components

* refactoring filters structure

* removing reach-hook-form

* removing reach-hook-form

* adding unit tests

* adding unit tests

* create custom action index

* adding filter option

* refactoring create index, creating filter links

* creating list api

* rename custom action to custom link

* fixing unit tests

* adding unit tests

* refactoring callApmApi

* removing useCallApmApi hook

* Rename Flyoutfooter.tsx to FlyoutFooter.tsx

* removing unused import

* fixing typescript errors

* fixing duplicate messages

* removing filters

* fixing save functionality

* fixing pr comments

* fixing pr comments
2020-03-06 11:06:16 +01:00
Jean-Louis Leysens
651d0a9739
[Upgrade Assistant] Server-side batch reindexing (#58598)
* Added server side logic for handling batch reindex

* Remove literal string interpolation from translation

* Refactor return value of batch endpoint

"sucesses" does not communicate accurately what has happened.
"started" more closely reflects what has happened.

* First iteration of batch queues

* Single queue

Changed the batchqueues implementation to only using a single queue
 - since there is only one ES that it is interacting with.

Before continuing with this work, just making sure that these pre-
cautions are necessary!

* Clean up old batch queue implementation

* Slight refactor

* Revert batch queues implementation

* Introduction of QueueSettings

Queue settings can be set on a reindex operation and set a
timemstamp value on the reindex operation for the scheduler
to use down the line for ordering operations and running them
in series

* Updated worker logic to handle items in queue in series

* Refactor /batch endpoint response to "enqueued" not "started"

* Fixed jest tests

* Refactor worker refresh operations for readability

Created a new file op_utils where logic repsonsible for sorting
and ordering reindex operation saved objects is.

* Add batch API integration test

Also assert that reindexing is happening in the expected order

* Added a new endpoint: GET batch/queue

This allows users of the API to see what the current queue state
is for visibility. Using the queue endpoint int he API integration
tests for batch too.

* Reset the queuedAt timestamp on resume

If a reindexOperation is being resumed and put in a queue we
also need to reset the queuedAt timestamp to respect the new
batch queue ordering.

* Fix jest test

Added 'undefined' as the second optional param to
resumeIndexOperation call.

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-03-06 10:18:21 +01:00
MadameSheema
8220999c12
completes navigation test (#59141)
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-03-06 08:42:18 +01:00
Andrew Goldstein
4db7f49608
[SIEM] Fixes dragging entries to the Timeline while data is loading may trigger a partial page reload (#59476)
## [SIEM] Fixes dragging entries to the Timeline while data is loading may trigger a partial page reload

The `react-beautiful-dnd` library, upgraded during the `7.6` stack release from
`10.0.1` to `12.2.0`, includes a breaking change to the way [errors are handled](https://github.com/atlassian/react-beautiful-dnd/blob/v12.0.0/docs/guides/setup-problem-detection-and-error-recovery.md)
and recovered. As a result of this change, an uncaught error may trigger a
an effect that feels (from the perspective of a user) like a partial page
reload.

The most common condition where this can occur is when dragging entries to the
Timeline while data is loading, per the animated gif below:

![refresh-error](https://user-images.githubusercontent.com/4459398/76016029-59755f80-5ed9-11ea-858d-cb1189d22ea9.gif)

## Reproduction steps

1. Navigate to the Hosts page
2. Open the Timeline
3. Drag a host to the Timeline
4. While data is still loading, drag a different host to the Timeline to create an `or` query

**Expected Results**
* The page does not appear to reload
* In development mode, a single error is logged to the JS console

**Actual Results**
* The page appears to reload
* In development mode, two errors are logged to the JS console

**Error 1**
```
react-beautiful-dnd
Invariant failed: Cannot find droppable entry with id [droppableId.content.event-details-value-default-draggable-plain-column-renderer-formatted-field-value-timeline-1-kLGooXABOOUskGlPiQw5-@timestamp-1583260131000]👷<200d> This is a development only message. It will be removed in production builds.
    in Draggable (created by ConnectFunction)
    in ConnectFunction (created by PrivateDraggable)
    in PrivateDraggable (created by PublicDraggable)
    in PublicDraggable (created by Droppable)
    in Droppable (created by ConnectFunction)
    in ConnectFunction
```

**Error 2**
```
react-beautiful-dnd
Invariant failed: Cannot find droppable entry with id [droppableId.content.event-details-value-default-draggable-plain-column-renderer-formatted-field-value-timeline-1-kLGooXABOOUskGlPiQw5-@timestamp-1583260131000]👷<200d> This is a development only message. It will be removed in production builds.
    in ErrorBoundary (created by DragDropContext)
    in DragDropContext (created by Anonymous)
    in Anonymous
```

### Desk testing

Tested locally in:
* Chrome `80.0.3987.122`
* Firefox `73.0.1`
* Safari `13.0.5`

Fixes https://github.com/elastic/kibana/issues/59466
2020-03-05 23:08:56 -07:00
Tim Sullivan
893d8da1d8
[Reporting/Screenshots] Handle page setup errors and capture the page, don't fail the job (#58683)
* [Reporting] Handle error if intercepted request could not be continued

* [Reporting/Screenshots] Handle page setup errors and capture the page with errors shown

* show warnings in UI

* i18n todos

* Cleanup an old troubleshooting task

* set the default for all new timeout settings to 30 seconds

* fix some tests

* update error strings

* Cleanup 2

* fix tests 2

* polish the job info map status items

* More error message updating

* Log the error that was caught

* Oops fix ts

* add documentation

* fix i18n

* fix mocha test

* use the openUrl timeout as the default for navigation

* fix comment

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-03-05 22:26:36 -07:00
Xavier Mouligneau
c29ef14656
[SIEM] [CASES] API with io-ts validation (#59265)
* refactor to use io-ts, to be able to have ressource with sub, add total comments via comment_ids, be able to delete multiple cases/comments

* fix test

* adapt UI to refactor of the API

* put it back the way it was

* clean up to get cases

* review I

* review II - bring back url  parameter

* fix merge

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-03-05 23:29:55 -05:00
Lukas Olson
f511afa729
Use camelCase rather than snakeCase for plugin name (#59461) 2020-03-05 20:46:45 -07:00
Nathan Reese
578137fb20
[Maps] top term percentage field property (#59386)
* [Maps] top term percentage property

* populate percentage in feature properties

* TS work

* clean up TS

* fix all type errors

* unit test for esAggFieldsFactory

* clean up

* i18n cleanup

* do not show decimal place for perentage

* fix jest expects

* fix eslint errors

* tslint errors

* handle empty top bucket aggregation

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-03-05 19:58:22 -07: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
Lukas Olson
c4b385dfd5
[Search service] Add enhanced ES search strategy (#59224)
* Add async search strategy

* Add async search

* Fix async strategy and add tests

* Move types to separate file

* Revert changes to demo search

* Update demo search strategy to use async

* Add async es search strategy

* Return response as rawResponse

* Poll after initial request

* Add cancellation to search strategies

* Add tests

* Simplify async search strategy

* Move loadingCount to search strategy

* Update abort controller library

* Bootstrap

* Abort when the request is aborted

* Add utility and update value suggestions route

* Fix bad merge conflict

* Update tests

* Move to data_enhanced plugin

* Remove bad merge

* Revert switching abort controller libraries

* Revert package.json in lib

* Move to previous abort controller

* Add support for frozen indices

* Fix test to use fake timers to run debounced handlers

* Revert changes to example plugin

* Fix loading bar not going away when cancelling

* Call getSearchStrategy instead of passing  directly

* Add async demo search strategy

* Fix error with setting state

* Update how aborting works

* Fix type checks

* Add test for loading count

* Attempt to fix broken example test

* Revert changes to test

* Fix test

* Update name to camelCase

* Fix failing test

* Don't require data_enhanced in example plugin

* Actually send DELETE request

* Use waitForCompletion parameter

* Use default search params

* Add support for rollups

* Only make changes needed for frozen indices/rollups

* Fix tests/types

* Don't include skipped in loaded/total

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-03-05 16:47:45 -07:00