Commit graph

7596 commits

Author SHA1 Message Date
Yara Tercero f9273cc866
[SIEM][Detections Engine] Add note markdown field to backend (#59796)
* add new note markdown field to DE backend

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-03-11 15:15:38 -04:00
spalger 4223658d27 skip flaky suite (#59030) 2020-03-11 12:10:37 -07:00
Felix Stürmer 07a7caaf2f
[Logs UI] Add expandable rows with category examples (#54586)
Make the category rows expandable to show actual log messages samples from the categories during the selected time frame.
2020-03-11 20:07:55 +01:00
spalger 50471f18ee remove index_management/client integration tests that are being really flaky
refs:
https://github.com/elastic/kibana/issues/59855
https://github.com/elastic/kibana/issues/59934
https://github.com/elastic/kibana/issues/59861
https://github.com/elastic/kibana/issues/59849
https://github.com/elastic/kibana/issues/59859
https://github.com/elastic/kibana/issues/59858
https://github.com/elastic/kibana/issues/59869
https://github.com/elastic/kibana/issues/59863
https://github.com/elastic/kibana/issues/54890
2020-03-11 11:30:09 -07:00
Nathan Reese e4c4b7f1ae
[Maps] Add UI to disable style meta and get top categories from current features (#59707)
* rough start

* remove unused files

* get everything working

* add style options types

* convert DynmaicStyleProperty to TS

* limit scope of PR

* CategoricalFieldMetaPopover

* update label and move functions to IStyleProperty interface

* fix ts lint errors

* replace unknown with IJoin now that its available

* remove duplicate import

* review feedback
2020-03-11 11:47:30 -06:00
Pete Harverson 4e8306271f
[ML] Fixes handling of index pattern with special characters (#59884)
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-03-11 16:24:03 +00:00
Liza Katz 66455316bb
Clear out old rollup strategy (#59423)
* Old search strategy cleanup

* restore rollup strategy

* Remove hasSearchStategyForIndexPattern

* ts

* fix jest tests

* cleanup exports

* pass index pattern type to server for rollups

* merge fix

* Fix types

* ts fixes

* oss strategy error handling

* update translations

* jest test fix

* Use indexType instead of index

* code review 1

* updated docs

* jest test

* jest snapshot

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-03-11 18:03:27 +02:00
Lisa Cawley 2779d102a4
[DOCS] Edits job creation UI text (#59830) 2020-03-11 08:55:34 -07:00
Christos Nasikas e6327d32b0
[SIEM][CASE] ServiceNow executor (#58894)
* Refactor structure

* Init ServiceNow class

* Add constants

* Add configuration scheme

* Refactor configuration schema

* Refactor parameters schema

* Create new types

* Add supported source fields

* Create helpers

* Create ServiceNow lib

* Push incident

* Declare private methods

* Create UpdateIncident type

* Create updateIncident method

* Create executor actions

* Refactor response

* Test helpers

* Remove unnecessary validation

* Fix validation errors

* Throw error for unsupported actions

* Create mock incident

* Test executor

* Test ServiceNow lib

* Convert to camelCase

* Remove caller_id

* Refactor helpers

* Refactor schema

* Remove executorAction

* Test action handlers

* Refactor tests

* Create and update comments

* Remove closure option & change attribute name

* Fix tests

* Change lib structure

* Validate empty mapping

* Fix functional tests

* Fix type

* Change API to only add comments through incident's API

* Add instruction to README

* Change API version

* Test

* Test simulator

* Fix version on tests

* Remove SIEM reference in README
2020-03-11 16:01:07 +02:00
Tyler Smalley d781b3e627
[ML] Updates Jest snapshots (#59897)
https://github.com/elastic/kibana/pull/59782 was merged with failing test.

Signed-off-by: Tyler Smalley <tyler.smalley@elastic.co>
2020-03-11 06:59:32 -07:00
Zacqary Adam Xeper db2a92c61d
[Metrics Alerts] Fix error when a metric reports no data (#59810)
* [Metrics Alerts] Fix error when a metric reports no data

* Clarify no data case handler, add separate error state

* Throw error state when callCluster fails
2020-03-11 08:44:29 -05:00
Walter Rafelsberger ce6029b9b0
[ML] Transforms: Use EuiInMemoryTable instead of custom typed table. (#59782)
Before EuiInMemoryTable had TypeScript support we used our own typings and some state & CSS fixes. This is now all solved by the original EUI component.
- Use EuiInMemoryTable instead of custom typed table.
- Deletes some legacy leftover files.
2020-03-11 09:37:03 +01: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
Marta Bondyra 44eb7c0130
[Lens] remove react warnings (#59574) 2020-03-10 22:10:35 +01:00
Patrick Mueller 7db4196164
[Alerting] add more alert properties to action parameter templating (#59718)
This is a pre-cursor to https://github.com/elastic/kibana/issues/58529

I realized a bit ago that we weren't making quite enough info available
in the action parameter templating that happens when alerts schedule
actions to execute.  Missing were alert name, tags, and spaceId.

For the index threshold alert, I had added them to it's context, but
then every other action would have to do the same if they also
wanted those values.

So I added these as additional top-level variables that can be
used in templates, along with the alert id, alert instance id,
context, and state.  The other bits in RawAlert didn't seem
that interesting, to be used as an action parameter.
2020-03-10 16:50:19 -04:00
dave.snider@gmail.com 8c0da24e6c
[Design] Branding changes in Elastic to focus more towards the Elastic brand (#58160)
Elastic Kibana branding.
2020-03-10 13:33:21 -07:00
MadameSheema 0f71886f83
[SIEM] Adds 'Create new rule' Cypress test (#59790)
* adds 'Creates and activates new rule'

* loads data using es_archive

* refactor test
2020-03-10 21:03:48 +01:00
Greg Thompson 4e52deeca3
Use EUI test environment build with Jest (#55877)
* wip

* dir name

* src snapshot changes

* x-pack snapshots

* svg element lookups

* snapshot updates

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-03-10 13:48:49 -05:00
Steph Milovic ecac63f258
[SIEM] [Case] Insert timeline into case textarea (#59586) 2020-03-10 11:49:55 -06:00
Robert Oskamp 8bc051ac49
[ML] Functional tests - stabilize saved search tests (#59652)
This PR stabilizes the saved search functional UI tests by adding a retry to navigateToApp('ml')
2020-03-10 18:10:59 +01:00
marshallmain 435cb0b959
[Endpoint] Sample data generator for endpoint app (#58936)
* scaffolding and notes.md

* add skeleton event generator to kibana

* add optional entityID param to generateEvent

* add tree generation

* add tests

* working tests

* fix up tests

* fix linting

* fix event types

* make process parent types consistent

* make generator match types

* move test resolver node out of common types

* fix random string generation

* fix typecheck errors

* remove extraneous stuff

* address PR comments

* add test for full resolver tree

* cleanup

* make tests clearer

* add seedrandom to endpoint plugin. contains DONOTMERGE example code

* remove robs test

* start replacing random with seedrandom

* use seeded random for uuidv4

* separate out IP randomization

* typecheck fixes

Co-authored-by: oatkiller <robert.austin@elastic.co>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-03-10 12:31:57 -04:00
Zacqary Adam Xeper 5ad8337634
[Metrics Alerts] Add support for search query and groupBy on alerts (#59388)
* Add filterQuery to metric alert params

* Add groupBy alert support

* Fix typings

* Fix malformed query

* Fix filterQuery merge

* Fix groupBy afterkey insertion, add group name to alert action

* Convert iife to getter

* Fix type check

* Fix type check again

* Remove unnecessary order param
2020-03-10 10:45:57 -05:00
Walter Rafelsberger ec1f46bdbd
[ML] Transforms: Data grid fixes. (#59538)
- Fixes data grid schemas to avoid crashing the page.
- Fixes date formatting.
- Uses data grid for preview table in transform list.
2020-03-10 15:52:17 +01:00
Ryland Herrick b56cd41412
[SIEM] Fix and consolidate handling of error responses in the client (#59438)
* Convert our manual throwing of TypeError to a custom Error

Throwing a TypeError meant that our manual errors were indistinguishable
from, say, trying to invoke a method on undefined. This adds a custom
error, BadRequestError, that disambiguates that situation.

* Present API Error messages to the user

With Core's new HTTP client, an unsuccessful API call will raise an
error containing the body of the response it received. In the case of
SIEM endpoints, this will include a useful error message with
potentially more specificity than e.g. 'Internal Server Error'.

This adds a type predicate to check for such errors, and adds a handling
case in our errorToToaster handler.

If the error does not contain our SIEM-specific message, it will fall
through as normal and the general error.message will be displayed in the
toaster.

* Remove unnecessary use of throwIfNotOk in our client API calls

The new HTTP client raises an error on a 4xx or 5xx response, so there
should not be a case where throwIfNotOk is actually going to throw an
error.

The established pattern on the frontend is to catch errors at the call
site and handle them appropriately, so I'm mainly just verifying that
these are caught where they're used, now.

* Move errorToToaster and ToasterError to general location

These were living in ML since that's where they originated. However, we
have need of it (and already use it) elsewhere.

The basic pattern for error handling on the frontend is:
1) API call throws error
2) caller catches error and dispatches a toast

throwIfNotOk is meant to convert the error into a useful message in 1).
We currently use both errorToToaster and displayErrorToast to display
that in a toaster in 2)

Now that errorToToaster handles a few different types of errors, and
throwIfNotOk is going to be bypassed due to the new client behavior of
throwing on error, we're going to start consolidating on:

1) Api call throws error
2) caller catches error and passes it to errorToToaster

* Refactor Rules API functions to not use throwIfNotOk

* Ensures that all callers of these methods properly catch errors
* Updates error toasterification to use errorToToaster
* Simplifies tests now that we mainly just invoke the http client and
return the result.

throwIfNotOk is not being used in the majority of cases, as the client
raises an error and bypasses that call.

The few cases this might break are where we return a 200 but have errors
within the response. Whether throwIfNotOk handled this or not, I'll need
a simpler helper to accomplish the same behavior.

* Define a type for our BulkRule responses

These can be an array of errors OR rules; typing it as such forces
downstream to deal with both. enableRules was being handled correctly
with the bucketing helper, and TS has confirmed the rest are as well.

This obviates the need to raise from our API calls, as bulk errors are
recoverable and we want to both a) continue on with any successful rules
and b) handle the errors as necessary. This is highly dependent on the
caller and so we can't/shouldn't handle it here.

* Address case where bulk rules errors were not handled

I'm not sure that we're ever using this non-dispatch version, but it was
throwing a type error. Will bring it up in review.

* Remove more throwIfNotOk uses from API calls

These are unneeded as an error response will already throw an error to
be handled at the call site.

* Display an error toaster on newsfeed fetch failure

* Remove dead code

This was left over as a result of #56261

* Remove throwIfNotOk from case API calls

Again, not needed because the client already throws.

* Update use_get_tags for NP

* Gets rid of throwIfNotOK usage
* uses core http fetch

* Remove throwIfNotOk from signals API

* Remove throwIfNotOk

This served the same purpose as errorToToaster, but in a less robust
way. All usages have been replaced, so now we say goodbye.

* Remove custom errors in favor of KibanaApiError and isApiError type predicate

There was no functional difference between these two code paths, and
removing these custom errors allowed us to delete a bunch of associated
code as well..

* Fix test failures

These were mainly related to my swapping any remaining fetch calls with
the core router as good kibana denizens should :salute:

* Replace use of core mocks with our simpler local ones

This is enough to get our tests to pass. We can't use the core mocks for
now since there are circular dependencies there, which breaks our build.

* add signal api unit tests

* privilege unit test api

* Add unit tests on the signals container

* Refactor signals API tests to use core mocks

* Simplifies our mocking verbosity by leveraging core mocks
* Simplifies test setup by isolating a reference to our fetch mock
* Abstracts response structure to pure helper functions

The try/catch tests had some false positives in that nothing would be
asserted if the code did not throw an error. These proved to be masking
a gap in coverage for our get/create signal index requests, which do not
leverage `throwIfNotOk` but instead rely on the fetch to throw an error;
once that behavior is verified we can update those tests to have our
fetchMock throw errors, and we should be all set.

* Simplify signals API tests now that the subjects do less

We no longer re-throw errors, or parse the response, we just return the
result of the client call. Simple!

* Simplify API functions to use implict returns

When possible. Also adds missing error-throwing documentation where
necessary.

* Revert "Display an error toaster on newsfeed fetch failure"

This reverts commit 64213221f5.

* Error property is readonly

* Pull uuid generation into default argument value

* Fix type predicate isApiError

Uses has to properly inspect our errorish object. Turns out we have a
'message' property, not an 'error' property.

* Fix test setup following modification of type predicate

We need a message (via new Error), a body.message, and a
body.status_code to satisfy isApiError.

Co-authored-by: Xavier Mouligneau <189600+XavierM@users.noreply.github.com>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-03-10 09:11:17 -05:00
Nathan Reese eb533c8211
[Maps] convert tooltip classes to typescript (#59589)
* getting started

* fix ts lint errors

* TS es_tooltip_property

* convert ESAggTooltipProperty to TS

* final clean up

* ts lint cleanup

* review feedback

* remove unused import

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-03-10 07:33:20 -06:00
Robert Oskamp 848188e517
[ML] Functional tests - re-activate date_nanos test (#59649)
This PR re-activates the date_nanos functional UI test.
2020-03-10 14:15:20 +01:00
Corey Robertson e982bed7c6
Move canvas to use NP Expressions service (#58387)
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-03-10 09:11:58 -04:00
Anton Dosov 8a3e9c6b32
[Unit Testing] Configure react-testing-library queries to use Kibana's data-test-subj instead of default data-testid (#59445) 2020-03-10 13:16:58 +01:00
Kerry Gallagher 565dd25a8b
[Logs / Metrics UI] Link handling / stop page reloads (#58478)
* Add a hook for seamlessly handling onClick and href props of links, buttons etc

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
Co-authored-by: Felix Stürmer <weltenwort@users.noreply.github.com>
2020-03-10 10:36:13 +00:00
Pierre Gayvallet f1272b5ffe
Add SavedObject management section registration in core (#59291)
* add management section to SavedObjectsType

* adapt import/export routes to get types accessor

* add documentation

* update generated doc

* update migration guide

* use request context to access exportable types

* update generated doc

* adapt SavedObjectsManagement to use the registry

* stop magical tricks about the config type, register it as any other so type.

* fix FTR assertions

* fix so_mixin tests

* register the `config` type from the uiSettings service

* nits and comments

* update generated doc

* remove true from dynamic property definition, use force-cast back for config type

* remove obsolete test comment
2020-03-10 11:13:45 +01:00
Oliver Gupte 35bcb36ee6
Fixes #59513 by hiding one of the symmetric edges rather than omiting it (#59514)
in cytoscape graph. Also selects root nodes with no incoming edges
rather than just unconnected nodes.

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-03-09 23:55:44 -07: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
Vadim Dalecky 405b0fa30c
chore: 🤖 hide Drilldowns in master (#59698) 2020-03-09 22:10:46 +01:00
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
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
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
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
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
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
Felix Stürmer 1a548a1e42
[Logs UI] Speed up stream rendering using memoization (#59163)
This aims to be a quick performance improvement by memoizing the LogEntryRow component.
2020-03-06 00:19:32 +01: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
marshallmain d5497d99b2
[Endpoint] Fix alert list functional test error (#59357)
* fix the functional test error

* fix linting

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-03-05 16:35:54 -05:00
Spencer 4bc9e8b4a8
Fix visual baseline job (#59348)
* Establish Percy baselines

* move Jenkinsfile changed back to `.ci` directory

* rename xpack workers

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-03-05 13:01:42 -07: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
Steph Milovic 91a5b17cfd
[SIEM] [Case] All cases page design updates (#59248) 2020-03-05 11:29:44 -07:00
Thomas Neirynck 46738cfa0a
[Maps] Add field and style-meta types (#58766) 2020-03-05 12:26:28 -05:00
Luke Elmers 87a3d02d44
Remove schemas from agg configs (#58462) 2020-03-05 10:18:12 -07:00
Yuliia Naumenko 4883d4bb2a
Fixed ci type check errors for alerting and actions properties for SIEM RouteHandlerContext (#59400)
* Fixed ci type check errors for alerting and actions optional properties on RouteHandlerContext

* Reverted git revert b83f81458c
2020-03-05 07:52:24 -08:00
Melissa Alvarez d55524c338
[ML] NP Server: make security and spaces plugins optional (#59156)
* make security and spaces plugins optional

* update spacesPlugin name. update current user check
2020-03-05 10:06:36 -05:00
James Gowdy 4371b1ca7d
[ML] Fix advanced wizard datafeed form labels (#59413) 2020-03-05 14:59:58 +00:00
Walter Rafelsberger ce9e887644
[ML] Transforms: Fixed custom KibanaContext deprecation. (#59410)
- Deprecates the custom KibanaContext.
- Where applicable dependencies provided via KibanaContext are now passed on via AppDependencies.
- The main feature of KibanaContext was to populate index pattern and saved search information for the transform wizard. This is now provided via the useSearchItems() custom hook.
2020-03-05 14:52:44 +01:00
Shahzad edfbe03ffa
[Uptime] Improve duration chart (#58404)
* use differential colors for duration chart

* remove duration chart gql

* update type

* type fix

* fix tyoe

* update translation

* update test

* update conflicts

* type checking

* update snaps

* PR feedback

* PR feedback

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-03-05 10:43:55 +01:00
Sébastien Loix a05c3211b9
[Snapshot & Restore] NP migration (#59109) 2020-03-05 15:07:23 +05:30
Pete Harverson b104980b88
[ML] Add support for date_nanos time field in anomaly job wizard (#59017)
* [ML] Add support for date_nanos time field in anomaly job wizard

* [ML] Edits following review

* [ML] Add functional test for creating job off date_nanos data
2020-03-05 09:28:31 +00:00
spalger b83f81458c Revert "Makes alerting and actions optional properties for interface RequestH… (#59264)"
This reverts commit 755439d5e7.
2020-03-04 22:13:11 -07:00
CJ Cenizal bb86bf2ebb
Change remote_clusters ID to remoteClusters (#59246) 2020-03-04 19:53:15 -08:00
Yuliia Naumenko 755439d5e7
Makes alerting and actions optional properties for interface RequestH… (#59264)
* Makes alerting and actions optional properties for interface RequestHandlerContext

* Added an error response result if context for actions and alerting is not registered
2020-03-04 17:30:15 -08:00
Luke Elmers ba5784ac57
Clean up date histogram agg type. (#58805) 2020-03-04 17:03:23 -07:00
Melissa Alvarez 44921e6110
[ML] Management: fix license unsubscribe (#59365)
* check for undefined before unsubscribe.remove skip from test

* use take for observable
2020-03-04 19:00:34 -05: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
patrykkopycinski ac4f8f4ef5
[SIEM] Fix rule delete/duplicate actions (#59306) 2020-03-04 21:31:43 +01:00
spalger ef38287551 Revert "[ML] Transforms: Deprecate custom KibanaContext. (#59133)"
This reverts commit 29975fa614.
2020-03-04 12:50:04 -07:00
Stacey Gammon 543481ba53
Add direct access link registry and dashboard impl and use in ML (#57496)
* Add direct access link registry and dashboard impl and use in ML

* Add example plugin with migration example

* address code review comments

* Fixes, more code review updates

* Readme clean up

* add tests

* remove else

* Rename everything from DirectAccessLinkGenerator to the much short UrlGenerator. also fix the ml # thing and return a relative link from dashboard genrator

* add important text in bold

* Move url generators into share plugin

* add correct i18n prefix

* Fix timeRange url name

* make share plugin optional for dashboard

* fix code owners

* Use base UrlGeneratorState type, add comments

* Fix hash bug and add test that would have caught it
2020-03-04 12:43:09 -05:00
James Gowdy a6d2b57777
[ML] Fixing records and buckets results endpoints (#59313) 2020-03-04 17:04:47 +00:00
Candace Park c58b49c0bf
task/management-details (#58308)
Adds basic details flyout for host management page
2020-03-04 12:02:19 -05:00
Aaron Caldwell 76e3f82754
[Maps] Add missing license to requests in maps embeddables (#59207)
* Pull core service init out into separate function

* Call bind function from embeddable factory constructor

* Move inspector init back to start method. Remove old license check file

* Add TS types
2020-03-04 10:00:01 -07:00
Walter Rafelsberger 29975fa614
[ML] Transforms: Deprecate custom KibanaContext. (#59133)
- Deprecates the custom KibanaContext.
- Where applicable dependencies provided via KibanaContext are now passed on via AppDependencies.
- The main feature of KibanaContext was to populate index pattern and saved search information for the transform wizard. This is now provided via the useSearchItems() custom hook.
2020-03-04 16:56:01 +01:00
Stacey Gammon d2cbc59ad4
Further improve type checking for actions and triggers (#58765)
* wip

* review follow up

* make ACTION a prefix, not SUFFIX

* fix path

* add warnings about casting to ActionType

* Make context  an object in examples, not a string

* require object context, which seems to fix the partial requirement in type and thus the type issue

* mistake

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-03-04 10:27:14 -05:00
Christos Nasikas aea4811750
[SIEM][CASE] Configure cases: Closure Options & Field Mappings UI (#59062)
* Create closure options radio group

* Create closure options component

* Refactor structure

* Create field mapping row

* Create field component

* Show closure options

* Show field mapping

* Translate editUpdate options

* Add more siem fields

* Remove unnecessary export

* Leave spaces between sections

* Fix callbacks

* Better return

* Fix callback

* Move thirdPartyFields to parent component

* Rename constant

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-03-04 17:06:33 +02:00
Chris Roberson 9a1b4b9a6b
[Monitoring] Ensure we use the monitoring cluster for retrieving xpack info (#59075)
* Ensure we use the monitoring cluster for retrieving xpack info

* Remove unnecessary code
2020-03-04 09:27:23 -05:00
Aaron Caldwell c4458ca1b4
[File upload] Move File Upload to New Platform (#58550)
* Move file upload to np. Some additional mods & removals

* Consume file upload from NP in maps and pass to kibana services

* Register telemetry mappings

* Init indexPatternService in start method

* Fix type check issues. Add missing prop to telemetry

* Update i18n path

* Review feedback
2020-03-04 06:44:44 -07:00
patrykkopycinski 7ad083f332
Restores [SIEM] Fix Timeline registerProvider to be called only when it's needed (#59003)
* [SIEM] Fix Timeline registerProvider to be called only when it's needed

* cleanup

* add unit tests

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-03-04 03:31:10 -08:00
Anton Dosov be43518ee3
visualizations plugin np_ready (#59149) 2020-03-04 11:30:45 +01:00
Dario Gieselaar 114c4cb85e
[APM] Make typescript optimization process compatible with NP (#58984)
* [APM] Make typescript optimization process compatible with NP

Rather than creating an extra tsconfig.json file in the APM folder, simply change the one in x-pack root, and include APM files from both legacy + NP.

* Update dev_docs/typescript.md

* Use spread op instead of assign

* Use console.error instead of console.log
2020-03-04 11:25:39 +01:00
James Gowdy eb40046b93
[ML] Fixing licensing after server NP cutover (#59275) 2020-03-04 10:14:11 +00:00
Dima Arnautov 4ce66c6893
[ML] Validate manual model memory input (#59056)
* [ML] validate mml based on estimated value

* [ML] better memoize

* [ML] memoryInputValidator unit tests

* [ML] cache mml errors

* [ML] prevent override

* [ML] fix validators, add unit tests

* [ML] ignore typing issue with numeral

* [ML] fix validateMinMML

* [ML] fix useCreateAnalyticsForm test

* [ML] setEstimatedModelMemoryLimit to the fallback value in case of an error
2020-03-04 11:02:49 +01:00
Aleh Zasypkin 18c3e8caf8
Migrate security chromeless views to Kibana Platform plugin (#54021)
Co-authored-by: Joe Portner <5295965+jportner@users.noreply.github.com>
2020-03-04 09:35:52 +01:00
Joe Reuter cba4f34674
Migrate home app (#58030) 2020-03-04 08:24:42 +01:00
Ryland Herrick 875e2a525e
[SIEM] Migrate DE Routes to NP (#58292)
* Define a very basic SiemClient

We're going to add our client to the route handler context. Currently,
it's sole purpose is to provide us with the signalsIndex to use for the
request.

This will allow us to stop passing around most uses of config and
getSpaceId, as they were used for this same purpose.

* WIP: Convert first DE route to NP

This is one of the more comprehensive routes, so I think we're good to
convert the rest.

* Abstract joi/NP validator to helper

We're gonna need this all over the place. Until our schema can generate
an NP-compatible type, we can use this helper to generate an equivalent
validator.

* Second route down

* Another one

* updateRulesRoute

* Fix exports

* patchRulesRoute

* Normalize request param type names

* findRulesRoute

* addPrepackagedRulesRoute

* getPrepackagedRulesStatusRoute

* createRulesBulkRoute

* updateRulesBulkRoute

* patchRulesBulkRoute

* deleteRulesBulkRoute

* importRulesRoute

* exportRulesRoute

* findRulesStatusesRoute

* setSignalsStatusRoute

* querySignalsRoute

* Remove unused type

* createIndexRoute

* Convert readIndexRoute

Removes support for a HEAD request here, becuase it was only used by the
signal_index_exists script (which is now gone). A GET request will have
the same semantics, with a few more bytes in the response.

* deleteIndexRoute

* readTagsRoute

* readPrivilegesRoute

We're incorrectly accessing request.auth in here still, fixing that
next.

* We are always authenticated until we support optional auth

* Clean up our route initialization

* Remove our now-unused ClientsService
* Remove unused getIndex helper and references
* Remove legacy route initialization (partial application)

All our routing tests are still totally broken. Coming up!

* Reference name property in context registration

This should be replaced with a reference to the constant, but at least
this doesn't add a third way it's being referenced.

* Convert our first route tests to NP

The API for our test utils isn't final, but this at least gets some
tests passing. We'll see how it handles a more complex example.

* Create Rules tests

* Update addPrepackagedRules tests

There were a lot of incorrect tests in here due to some incorrect route
registration: we were asserting a 404 but receiving a false positive
because the route we wanted didn't exist.

* Read Privileges Route tests

* Delete Rules route tests

* Use more permissive validation in request mock

* createRulesBulkRoute tests

* deleteRulesBulkRoute tests

* More explicit result mock

It was very unclear in the tests what this mock represented.

* findRulesRoute tests

* getPrepackagedRulesRoute tests

* PatchRulesBulkRoute tests

* Convert migrated tests to newest interface

* PatchRulesRoute tests

Also fixes a potential false positive in our patch_rule_bulk_route
validation tests by providing a more realistic payload with a single key
missing.

* Rename file for consistency

* UpdateRulesBulkRoute tests

* deleteRulesBulkRoute tests

* findRulesStatusRoute tests

* updateRulesRoute tests

* setSignalStatusRoute tests

* querySignalsRoute tests

This actually caught a bug where we were not resolving our response  before returning

* Update schema tests following rename of type

* Converts Import Rules route tests to NP form

Most of these tests are failing due to our request not being parsed by
Hapi as it previously was. Once we figure out how to generate a
post-middleware request with a file stream, these should be easily
fixed.

* Remove unused import

This was the last remaining reference to hapi in our server plugin. yay!

* Remove unnecessary tests

We're already covering our error paths here.

* Hit success branch of bulk patch route test

* Add test around error path in our route

* Update our router to validate requests by default

This gives us two important behaviors:

1. Requests to inject() will be populated with default values
2. We can test request validation independent of a handler call
  * This allows more straightforward assertions as we don't have to
  disambiguate between a schema rejection and a data rejection.

* Update route validation tests with new interface

We don't need to reach into our route in the test, nor ts-ignore it.

* Update ImportRules route tests for NP testing

Gets rid of the multipart-form processing that Hapi would convert for us
into a Readable stream. Instead, we generate our own post-middleware
requst that's got a stream on it.

* Remove unnecessary router method

A bug in an initial implementation of inject() lead me to believe that
validations were removing the stream from our requests; this turned out
to be false! YAGNI

* Add an adapter for our route responses

This provides a uniform interface of { body, status, calls }, where body
and status come from the highest-status call (in the case of many). In a
case where we build multiple responses, the preference is to return the
most problematic one first. If there's an issue, one can look into the
other calls and see what's going on.

This breaks the tests and is not fully implemented, but this will allow
us to change how we build responses without affecting our tests.

* Fix remaining assertions in one test file

Helped flesh out our adapter a bit more.

* Update our response adapter to represent how NP transforms our errors

Most importantly, we return a statusCode but not a status_code.

* Update tests to interface with our Response type

This makes them robust to framework/implementation changes.

* Generate our error responses with our siemResponse wrapper

This adds the status_code key that we desire in our error responses.

Tests were updated as well, and they're currently failing because they
expect statusCode, not status_code.

* Update test assertions to look for status_code

* Remove unused import

* Return a meaningful error if an invalid request was injected

This ensures we a) mimic platform behavior so that b) we don't risk a
false positive if our invalid request were to somehow succeed.

* Return a useful error when no route has been registered

* Add back POST variant of delete_rules_bulk_route

Some browsers do not support a request body for DELETE requests.

* Allow headers to be passed to our error response

This is used by Apollo to set some cache/allow headers in the case of
specific bad requests.

* Add back our header-passing from Apollo errors

I also inverted the logic here to handle the special case first.

* Add some tests around our error response helper

* Fix types of our error wrapper

* Move router logic into separate function

This could be decomposed further but getRoute becomes more verbose, so
meh.

* Convert our mock server to a class

It makes the shared state (mocks) of these functions more explicit, and also
does away with some dumb tuple-returns I had (a consequence of trying to
make everything pure).

* Remove need for a route spy

Instead of mocking certain router methods with the same spy and then
retrieving its calls, we can simply iterate over the calls of the router
methods we care about. This is a little less logic and a little more
straightforward.

* Update test with updated copy

We're consolidating on "signals index" when referring to the data index
where signals are stored.

* Remove unneeded type assertion from our route validation factory

We implicitly cast our return value here when we provide the generic
type parameter, so there's no reason for the explicit cast.

* Use exact message assertions

* Export our SiemRequestContext type for consumers

This will move to server/index in NP.

* Make our SiemClient properties readonly

We don't want consumers mutating our state.

* Throw error if SiemClientFactory has not been properly set up

* Remove unnecessary spread

* Use reduce's type argument instead of an explicit assertion

* Remove unnecessary optional chaining

This was a holdover from when we captured calls that had no body, but is
now unnecessary.

* Remove unnecessary headers on mock requests

* Remove non-null assertion in favor of constructor assignment

* Prefer type annotations to explicit casting

If we annotate that both incoming pieces of our headers are of the
correct type, then we can spread them into an object of the same type
and avoid the index signature issue.

* Skip test failure do to handling of authentication

We need to thread through the utility that provides us this same
functionality.

* Mock our cluster calls with realistic data

* Remove TODO as this is addressed in a later PR

Co-authored-by: Josh Dover <me@joshdover.com>
2020-03-03 21:47:07 -06:00
Oliver Gupte 5539d6955f
[APM] Service Map Layout (#59020)
* Addresses #55544.
- uses the core breadthfirst cytoscape layout
- rotates elements by -90degrees
- selects rum nodes as roots
- implements hover styles to show connected nodes
- fixes flash of unstyled cytoscape elements on initial load

* PR review feedback

* adds canned response for testing cytoscape layout in storybook

* update dep snapshot for removing cytoscape-dagre
2020-03-03 18:26:28 -08:00
Caroline Horn b12ef02cc4
[Lens] Changing the callout message when there are no fields to list (#59063)
* [Lens] Changing the callout message when there are no fields to list
* Using the same token for filter button label and removing old translations
2020-03-03 20:26:40 -05:00
Jonathan Budzenski 1676421f00
skip test sets isLoading when userNavigatedToPage (#59253) 2020-03-03 19:10:33 -06:00
spalger d9a05af27a skip flaky suite (#59229) 2020-03-03 16:34:27 -07:00
Jonathan Budzenski ff23fa3849
Revert "[ML] Fixing licensing after server NP cutover (#58853)" (#59244)
This reverts commit fd5c6c16cd.
2020-03-03 17:09:29 -06:00
Jonathan Budzenski a5e5122e8e
skip isLoading when userPaginatedPolicyListTable (#59231) 2020-03-03 16:07:56 -06:00
Nathan Reese 1fd343b61f
[Maps] source descriptor types (#58791)
* [Maps] source descriptor types

* make SORT_ORDER an enum

* fix type error

* finish defining descriptors for all sources

* fill out layer descriptor

* fix type

* make some properties optional to avoid type explosions

* make type optional

* nest types a bit more so they better match class structor

* in progress work from pairing with Thomas

* one more thing

* add unit test (#35)

* add functions removed from fields typescript converstion

* move joins from VectorTileLayer constructor to VectorLayer constructor, add mock to fix map_selectors test

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
Co-authored-by: Thomas Neirynck <thomas@elastic.co>
2020-03-03 15:03:05 -07:00
Yuliia Naumenko 5cdb0153dc
Fixed test (#59208) 2020-03-03 13:40:51 -08:00
Steph Milovic 30c9b02045
[SIEM] [Case] Fix flexbox issue in Case View (#59195) 2020-03-03 14:38:06 -07:00
igoristic 5555a6c3d6
[Monitoring] Optimizes pipeline pagination and max buckets errors (#58205)
* Optimized pipelines

* Fixed tests

* Addressed feedback

* Withhold LS stats until there is at least one pipeline

* Fixed logstash stats

* Addressed feedback

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-03-03 15:14:58 -05:00
Dima Arnautov cbf410281a
[ML] Support multi-line JSON notation (#58870)
* [ML] multi-line json support for analytics job editor

* [ML] advanced editor with xjson

* [ML] add jest mock for XJsonMode

* [ML] add xJson mode to the json tab

* [ML] fix mocks
2020-03-03 20:31:13 +01:00
Nathan Reese ea43dcede0
[Maps] add functional test to ensure visualize create menu only shows Maps app (#58746)
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-03-03 12:23:43 -07:00
Yara Tercero 4c2aa0ab3f
[SIEM][Detections Engine] Fixed minor UI bug on all rules table pagination (#59094)
* Fixed minor UI bug on all rules table pagination
2020-03-03 14:00:43 -05:00
James Gowdy fd5c6c16cd
[ML] Fixing licensing after server NP cutover (#58853)
* [ML] Fixing licensing after server NP cutover

* client side refactor

* management refactor

* moving management license check

* adding server side license class

* added common license class

* client sides using license class

* updating server api guards

* fix privileges tests

* updating translations

* fixing disabled tabs on basic license

* refactoring client side license checks

* setting license initialized flag

* fixing license check on index data viz

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-03-03 18:57:40 +00:00
Tyler Smalley 2dcd3cc4c6
[test] Comment out Jest hooks in skipped blocks (#59086)
* [test] Comment out Jest hooks in skipped blocks

Jest will run the hooks regardless of if they are skipped.

Tests skipped in 61c9dc4022
and 420ded8eb2 were still resulting in build failures due to the beforeEach failing.

Signed-off-by: Tyler Smalley <tyler.smalley@elastic.co>

* Additional variables/imports no longer needed

Signed-off-by: Tyler Smalley <tyler.smalley@elastic.co>

* Skip additional flaky ingest tests

Signed-off-by: Tyler Smalley <tyler.smalley@elastic.co>

* Comment out file

Signed-off-by: Tyler Smalley <tyler.smalley@elastic.co>

* Must have one test

Signed-off-by: Tyler Smalley <tyler.smalley@elastic.co>
2020-03-03 10:51:20 -08:00
spalger b95abbae45 skip flaky suite (#58970) 2020-03-03 11:49:27 -07:00
Larry Gregory 74030c97a9
Add support for deprecated roles (#57209)
* Add support for deprecated roles

* address PR feedback

* remove unused import

* copy edits

* fix snapshots

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-03-03 13:23:53 -05:00
Dmitry Lemeshko 464f9071e9
Code coverage: skip failing tests for coverage run (#59121)
* filter out failing tests

* more skipped tests

* fix tests

* move json files to save space
2020-03-03 20:05:13 +03:00
MadameSheema 02f89f04cc
[SIEM] Cypress preparation for Jenkins (#59013)
* updates events viewer test

* updates login tasks

* updates ml conditional links

* updates url state

* updates timeline screen

* updates timeline tasks

* updates test files

* adds jenkins needed files

* ignoring isAttached lines due to a known error in Cypress (https://github.com/cypress-io/cypress/issues/4408)

* updates loop script

* updates readme with new cypress command explanation

* removes skip

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-03-03 17:51:35 +01:00
Marta Bondyra 39a431a247
[Lens] Display field name instead of 'dragging' text when a fi… (#59053) 2020-03-03 17:48:54 +01:00
Walter Rafelsberger 63cb9ff7be
[ML] Use EuiDataGrid for transform wizard. (#52510)
Replaces the custom EuiInMemoryTable component with EuiDataGrid for the transforms wizard.
2020-03-03 17:43:38 +01:00
Justin Juno 417f796693
[Rollups] Fix broken link in Rollup Jobs (#58802) (#58929) 2020-03-03 11:25:59 -05:00
Andrew Cholakian 1995a05c16
[Uptime] Refactor header (#58836)
Cleanup implementation of the header to let pages embed the header rather than the weird sort of control the header works with today. Also uses kibana context in a way that makes more sense, and provide a path forward for #53550 since that will need to add a new header type (and some buttons next to the picker).

Fixes #58835
2020-03-03 08:04:35 -06: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
Justin Kambic bfca202c4f
[Uptime] Add default chart empty state (#57725)
* Add default chart empty state.

* Delete obsolete translations.

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-03-03 07:52:57 -05:00
James Gowdy 4ef594c208
[ML] Adding indices_options to datafeed (#59119)
* [ML] Adding indices_options to datafeed

* adding extra checks to the schema

* updating expand_wildcards
2020-03-03 11:59:35 +00:00
Maryia Lapata e5362d36a3
[NP] Remove visualize reference in saved object save modal (#59016)
* Remove visualize reference in saved object save modal

* Rename attribute

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-03-03 13:58:05 +03:00
Walter Rafelsberger f7dd5fe4d4
[ML] Transforms: Remove beta badges. (#59060)
Transforms will be GA in 7.7. This PR removes the beta related UI elements.
2020-03-03 11:05:57 +01:00
Daniil Suleiman 166716a405
[Visualize] Move linked search to react component (#58590)
* Move linked_search to react

* Use i18n from start contract

* Move linked search to the editor

* Updating layout and fixing truncation

* Fix functional test, add a tooltip

Co-authored-by: Caroline Horn <549577+cchaos@users.noreply.github.com>
2020-03-03 12:39:52 +03:00
Walter Rafelsberger bb55e8a21c
[ML] Transforms: Migrate server plugin to NP. (#58714)
Migrate transform legacy server to NP.
- Create server plugin/index for transform in x-pack/plugins.
- Move all legacy/server files to plugins/transform
2020-03-03 09:01:45 +01:00
Walter Rafelsberger ecbcceb74d
[ML] Transform: Fix advanced editor initialization. (#59006)
Fixes regression introduced by #58015 to correctly initialize the transform wizard advanced editor with the current configuration.
2020-03-03 08:59:00 +01:00
Davis Plumlee ffab68d01b
[Endpoint] Alert Details Overview (#58412) 2020-03-02 19:32:04 -05:00
Nathan L Smith 2378d8a0fd
Service map language icons (#58633)
Add icons as described in #56235.

Also:

* Add double-border and ghost "shadow" on nodes
* Add framework name capability to popover metrics
2020-03-02 17:36:43 -06:00
Steph Milovic 90b3678dff
[SIEM] [Case] Comments to case view (#58315) 2020-03-02 16:04:29 -07:00
Joe Reuter 17b3d80369
improve graph missing workspace error message (#58876) 2020-03-02 20:14:24 +01:00
Nathan Reese 2998ec06fe
[Maps] direct Discover "visualize" to open Maps application (#58549)
* [Maps] direct Discover visualize to Maps application

* pass initial layers to maps app

* add functional test

* fix parentheses messed up by lint fix

* fix i18n expression

* move logic into lib

* fix typescript errors

* use constant for geo_point and geo_shape, more TS noise

* use encode_array in an attempt to make TS happy

* another round of TS changes

* one more thing

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-03-02 11:47:35 -07:00
Peter Pisljar c81e0da584
removing references to visTypes uiExports (#58337) 2020-03-02 12:01:00 -05:00
Andrew Goldstein e9abe735f2
[SIEM] Default the Timeline events filter to show All events (#58953)
## [SIEM] Default the Timeline events filter to show All events

The Timeline events filter introduced in `7.6` to support the [detection engine](https://www.elastic.co/guide/en/siem/guide/current/detection-engine-overview.html) defaulted to filtering by `Raw events`, and thus required manually selecting `All events` or `Signal events` from the dropdown to view signals.

The new default is `All events`, per the screenshots below:

### Before
![event-filter-before](https://user-images.githubusercontent.com/4459398/75593223-ecc61500-5a41-11ea-8d7d-8db5eccb1eb4.png)

### After
![event-filter-after](https://user-images.githubusercontent.com/4459398/75593238-f5b6e680-5a41-11ea-9e12-2fc1232f58d1.png)
2020-03-02 09:36:14 -07:00
Alison Goryachev 323bb21df3
[Remote clusters] Add indexManagement as required plugin (#58915) 2020-03-02 11:27:15 -05:00
Charlie Pichette 74d0e9297f
[Endpoint] [Tests] fixes #57946 flaky endpoint policy list test (#58348)
* endpoint-161-refactor-management-list-test

* fix location of es archive file

* issue 57946 fix flaky endpoint policy list test

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-03-02 10:46:20 -05:00
kqualters-elastic a3be4e2222
[Endpoint] add resolver middleware (#58288)
* Add resolver middleware

* Update types to match events, use sample events in useCamera tests

* add predicate to convert alertdata to legacy endpoint event

* Use mock event generator in tests

* Guard against events not having agent or endpoint fields

Co-authored-by: Robert Austin <robert.austin@elastic.co>
2020-03-02 09:20:21 -05:00
Jean-Louis Leysens ac5e7aa81e
[Upgrade Assistant] Remove "boom" from reindex service (#58715)
* Removed Boom from reindex-service

The reindex service had logic inside it for mapping errors
to HTTP. This has been moved to the route handlers and also
removed Boom.

There is one more instance of Boom use inside of reindex-actions
but that comes from Saved Objects which should probably be removed
at a later stage.

* Fix import path

Specify the full relative import path to the kibana's core
server folder

* Remove unnecessary if statement

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-03-02 11:08:19 +01:00
Nic 45f804c43c
[SIEM] Detection Fix typo in Adobe Hijack Persistence rule (#58804)
Fixes https://github.com/elastic/kibana/issues/58803
2020-03-01 15:30:44 -07:00
Christos Nasikas 5b532ff50f
Restores [SIEM][CASE] Init Configure Case Page (#58121) (#58924)
* [SIEM][CASE] Init configure cases

* [SIEM][CASE] Translate header title

* [SIEM][CASE] Add back link

* [SIEM][CASE] Add default options to header page

* [SIEM][CASE] Create configure cases page redirections and links

* [SIEM][CASE] Add configure cases button

* [SIEM][CASE] Change translation variable

* [SIEM][CASE] Create wrappers

* [SIEM][CASE] Create section wrapper

* [SIEM][CASE] Switch to new wrapper

* [SIEM][CASE] Add translations

* [SIEM][CASE] Add connectors dropdown component

* [SIEM][CASE] Add connectors component

* [SIEM][CASE] Show connectors

* [SIEM][CASE] Create add new connector button

* [SIEM][CASE] Change values

* [SIEM][CASE] Use state for connectors dropdown

* [SIEM][CASE] Remove unnecessary attribute

* [SIEM][CASE] Remove timeline in configuration page

* [SIEM][CASE] Remove text from gear button

* [SIEM][CASE] make show timeline more generic so we can re-use if need it

Co-authored-by: Xavier Mouligneau <189600+XavierM@users.noreply.github.com>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-03-01 13:29:18 +02:00
Tyler Smalley 420ded8eb2 Skips additional failing Ingest Manager integration tests
https://github.com/elastic/kibana/issues/58969
https://github.com/elastic/kibana/issues/58968
https://github.com/elastic/kibana/issues/58967
https://github.com/elastic/kibana/issues/58966

Signed-off-by: Tyler Smalley <tyler.smalley@elastic.co>
2020-02-29 16:39:47 -08:00
Tyler Smalley 61c9dc4022 Skips failing Ingest Manager integration tests
https://github.com/elastic/kibana/issues/58969
https://github.com/elastic/kibana/issues/58968
https://github.com/elastic/kibana/issues/58967
https://github.com/elastic/kibana/issues/58966
https://github.com/elastic/kibana/issues/58961
https://github.com/elastic/kibana/issues/58960
https://github.com/elastic/kibana/issues/58959
https://github.com/elastic/kibana/issues/58958
https://github.com/elastic/kibana/issues/58958
https://github.com/elastic/kibana/issues/58957
https://github.com/elastic/kibana/issues/58956
https://github.com/elastic/kibana/issues/58955
https://github.com/elastic/kibana/issues/58954

Signed-off-by: Tyler Smalley <tyler.smalley@elastic.co>
2020-02-29 16:34:54 -08:00
spalger d55ddd23a1 disable failing suite (#58942) 2020-02-28 14:58:32 -07:00
Kevin Logan b46a335f2b
[Endpoint] Task/add nav bar (#58604)
* Add tabs to the Endpoint app.  Uses EuiTabs and browser history for integration with react-router

Co-authored-by: Paul Tavares <56442535+paul-tavares@users.noreply.github.com>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-02-28 11:25:36 -08:00
Zacqary Adam Xeper 06ebbb3fe0
[Metric Alerts] Add backend support for multiple expressions per alert (#58672)
* Add support for multiple alert expressions

* Rename expressions to criteria

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-02-28 13:11:50 -06:00
Zacqary Adam Xeper b658baf012
[Metrics Alerts] Fix alerting on a rate aggregation (#58789)
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-02-28 13:11:34 -06:00
spalger 0f329f564b disable flaky suite (#55953) 2020-02-28 11:45:25 -07:00
Spencer a3e68a1830
Revert "[SIEM] apollo@3 (#51926)" and "[SIEM][CASE] Init Confi… (#58806)
* Revert "[SIEM] apollo@3 (#51926)"

This reverts commit 320e292ea8.

* Revert "[SIEM][CASE] Init Configure Case Page (#58121)"

This reverts commit 967bef7b38.

* update a snapshot...
2020-02-28 11:42:34 -07:00
Luke Elmers 621fb6606c
[resubmit] Prep agg types for new platform (#58893) 2020-02-28 11:15:43 -07:00
Wylie Conlon 6c6bc1f48a
[Lens] Allow number formatting within Lens (#56253)
* [Lens] Allow custom number formats on dimensions

* Fix merge issues

* Text and decimal changes from review

* Persist number format across operations

* Respond to review comments

* Change label

* Add persistence

* Fix import

* 2 decimals

* Persist number formatting on drop too

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-02-28 13:08:37 -05:00
Brandon Kobel c5d17acab6
Fix privileges flaky test because the order in arrays matters for equality (#58790)
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-02-28 08:58:24 -08:00
Patrick Mueller 5b7270541c
[alerting] initial index threshold alertType and supporting APIs (#57030)
Adds the first built-in alertType for Kibana alerting, an index threshold alert, and associated HTTP endpoint to generate preview data for it.

addresses the server-side requirements for issue  https://github.com/elastic/kibana/issues/53041
2020-02-28 11:48:28 -05:00
Chris Cowan 29fbe395b7
[Metrics UI] Use CPU Usage limits for Kubernetes pods when available (#58424)
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-02-28 09:42:52 -07:00
Dario Gieselaar f86c75893b
[APM] Update tsconfig.json template in optimization script (#58731)
* [APM] Update tsconfig.json template in optimization script

The location of the cypress tests has changed, and those files are no longer excluded in the APM type check. This change updates the tsconfig.json template to exclude the new location.

* Update link in readme
2020-02-28 16:32:46 +01:00
James Gowdy 38067da7ac
[ML] Fixing annotations alias checks (#58722) 2020-02-28 14:30:04 +00:00
Larry Gregory 91330d2493
Spaces - NP updates for usage collection and capabilities (#57693)
* remove kibanaIndex from LegacyAPI

* moving capabilities, adding tests

* moving usage collection

* cleanup

* don't toggle capabilities on unauthenticated routes

* reintroduce exception handling

* pipe dat config

* start addressing PR feedback

* fix CoreSetup's generic type

* fix usage collector tests

* PR review updates

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-02-28 09:06:48 -05:00
Walter Rafelsberger 8f9004b661
[ML] Transforms: NP ui/imports migration (#58469)
- Migrates ui/* imports to NP.
- Uses direct React mounting instead of Angular.
- Service Cleanup.
2020-02-28 14:27:57 +01:00
Christos Nasikas 967bef7b38
[SIEM][CASE] Init Configure Case Page (#58121)
* [SIEM][CASE] Init configure cases

* [SIEM][CASE] Translate header title

* [SIEM][CASE] Add back link

* [SIEM][CASE] Add default options to header page

* [SIEM][CASE] Create configure cases page redirections and links

* [SIEM][CASE] Add configure cases button

* [SIEM][CASE] Change translation variable

* [SIEM][CASE] Create wrappers

* [SIEM][CASE]Create section wrapper

* [SIEM][CASE] Switch to new wrapper

* [SIEM][CASE] Add translations

* [SIEM][CASE] Add connectors dropdown component

* [SIEM][CASE] Add connectors component

* [SIEM][CASE] Show connectors

* [SIEM][CASE] Create add new connector button

* [SIEM][CASE] Change values

* [SIEM][CASE] Use state for connectors dropdown

* [SIEM][CASE] Remove unnecessary attribute

* [SIEM][CASE] Remove timeline in configuration page

* [SIEM][CASE] Remove text from gear button

* [SIEM][CASE] make show timeline more generic so we can re-use if need it

Co-authored-by: Xavier Mouligneau <189600+XavierM@users.noreply.github.com>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-02-28 13:59:43 +02:00
Angela Chuang 5046a3a68d
clean up snapshot (#58724) 2020-02-28 10:13:41 +00:00
Aleh Zasypkin bd92b7d56f
Implement HTTP Authentication provider and allow ApiKey authentication by default. (#58126) 2020-02-28 10:09:41 +01:00
Søren Louv-Jansen 913afb3bad
Update APM readme 2020-02-28 08:54:50 +01:00
spalger 511a9c2bee Revert "Prep agg types for new platform (#57064)"
This reverts commit 0cede6a705.
2020-02-27 22:18:00 -07:00
Nathan Reese 015c7abbca
[Maps] remove getMetricFields from AbstractESSource (#58667)
* [Maps] remove getMetricFields from AbstractESSource

* do not use formaters for count and unique count

* fix jest test
2020-02-27 21:49:33 -07:00
Spencer 4fd3b45b44
fix some missing awaits in functional tests (#58807) 2020-02-27 20:22:42 -07:00
igoristic b6dfcc7ad7
Removed unused indices (#57903)
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-02-27 21:46:45 -05:00
Luke Elmers 0cede6a705
Prep agg types for new platform (#57064) 2020-02-27 19:17:07 -07:00
Melissa Alvarez 8c3d71b370
[ML] NP: migrate server (#58680)
* remove obsolete legacy server deps

* licensePreRoutingFactory uses licensing plugin rather than legacy xpack

* move schemas to dir in routes

* use NP license check method for license check

* store license data in plugin for passing to check

* create server plugin files in NP plugin dir

* remove dependency on legacy xpack plugin

* add sample data links first step

* move all server dirs from legacy to np dir

* fix requiredPlugin spaces name and update import routes

* delete unnecessary files and add sample data links

* update license and privilege check tests

* add routeInit types
2020-02-27 21:15:08 -05:00
spalger 467280232a Revert "[SIEM] Fix Timeline registerProvider to be called only when it's needed (#58051)"
This reverts commit 2a03dffdad.
2020-02-27 17:19:35 -07:00
spalger 07c22f13b7 skip flaky suite (#58785) 2020-02-27 15:23:54 -07:00
Søren Louv-Jansen d474ccf244
[APM] Fix timeout in APM setup (#58727)
* [APM] Fix timeout in APM setup

* Update plugin.ts
2020-02-27 22:55:02 +01:00
patrykkopycinski 2a03dffdad
[SIEM] Fix Timeline registerProvider to be called only when it's needed (#58051) 2020-02-27 22:45:53 +01: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
Chris Roberson f62bda0b17
[Monitoring] Handle setup mode if security is disabled (#53306)
* Handle setup mode if security is disabled

* Rename so the test actually runs, and fix/add tests

* Use es.js api instead of transport.request

* Revert "Use es.js api instead of transport.request"

This reverts commit ae0e48f8bd.

* Explicitly handle security not enabled

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-02-27 15:34:16 -05:00
Alexey Antonov 29e984a61c
[Step 2] ui/persisted_state 👉 src/plugins/visualizations (#58501)
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-02-27 23:10:39 +03:00
Nathan Reese dc2dcd8abe
[Maps] remove agg_types (#58658) 2020-02-27 09:57:48 -07:00
Zacqary Adam Xeper 390165ba03
[Metrics Alerts] Create Metric Threshold Alert Type and Executor (#57606)
* [Infra] Add basic backend for metric threshold alerts

* Define separate fired/recovered action groups

* Allow alerting on arbitrary search fields besides host.name

* Add list and delete endpoioints

* Add groupBy alerts

* Remove extraneous  routes and SavedObject logic

* Remove additional SavedObject code

* Remove renotify logic from executor

* Fix action group type

* Fix scheduledActions typecheck

* Fix i18n

* Migrate alerting to new platform

* Add alerting to infra dependencies

* Add comment about future use

* Adjust alert params tm names to sync with UI; default to Entire Infrastructure alert

* Add support for between comparator

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-02-27 10:47:59 -06:00
Chris Cowan 43be649f50
[Metrics UI] Ensure inventory view buckets never drop below 60 seconds (#58503)
* [Metrics UI] Ensure inventory view buckets never drop below 60 seconds

* Fixing tests

* Fixing tests... again

* Fixing tests... rounding issue?

* Trying to fix the tests... again

* updating test for custom metric

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-02-27 09:32:44 -07:00
Lisa Cawley 2a756bbb81
[DOCS] Fixes outdated monitoring links (#58556) 2020-02-27 08:28:08 -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
Devin W. Hurley a06cc31583
[SIEM] [Detection Engine] Remove unnecessary ts-ignores (#58689)
* fixes from comments on previous PR

* replaces any with unknown, adds test to show how optional chaining of array items can result in undefined even though typescript says its not
2020-02-27 11:09:43 -05:00
Anton Dosov 2b4a9fd7d7
[State Management] State syncing helpers for query service I (#56128)
Before this pr:

Discover, Visualise and Dashboard in setup phase create own state containers which watch for pinned filters, time and refresh interval changes. This watching and state comparisons happen for each plugin separately and not only when a specific app is mounted. So we ended up with a bunch of similar synchronous work which happens every time query services state changes.

After this pr:

Query service exposes observable to watch for changes (state$). Discover, Visualise and Dashboard use this observable for sub url tracking instead of creating its own.
2020-02-27 12:08:08 +01:00
ChanghunKang 0ef17ca0af
[APM] Change naming for pods to "Kubernetes pods". (#54446) (#54538) 2020-02-27 11:03:35 +01:00
patrykkopycinski 320e292ea8
[SIEM] apollo@3 (#51926) 2020-02-27 09:25:37 +01:00
Alexey Antonov 7fdff345a4
[Step 1] ui/persisted_state 👉 src/plugins/visualizations (#58324)
* ui/persisted_state 👉 src/plugins/visualizations

Part of #46926

* fix JEST

* remove sinon from tests

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-02-27 10:19:17 +03:00
Matthias Wilhelm 90cb7a9be9
[Discover] Move discover/saved_searches to Kibana platform (#58476) 2020-02-27 06:17:54 +01:00
Andrew Cholakian 460d39772b
[Uptime] Fix flakey test by await-ing refreshes in tests (#58656)
Fixes https://github.com/elastic/kibana/issues/58541
2020-02-26 20:13:56 -06:00
Devin W. Hurley 47ce54c431
add back the null check to convertToSnakeCase function (#58675) 2020-02-26 20:31:13 -05:00
Madison Caldwell e31f8a3504
[Endpoint] ERT-82 Alert sorting/filtering and cursor-based pagination (#57266)
* Add KQL filtering

* Schema updates

* Cursor-based pagination

* Add alert detail GET api

* A little refactoring ;)

* Add KQL filtering

* Render SearchBar that provides suggestions and executes search

* Schema updates

* Cursor-based pagination

* Bug fix with search_after type

* hook up filters, trying date range

* Multi-filter support

* Add rison encoding/decoding on the backend

* Wire up front-end for new GET request

* tiny bug fix

* use redux for state, disable saved queries

* Remove SearchBar UI code

* Remove Search Bar UI Part 2

* test 1

* test 2

* Finish integrating refactor work

* Fix fromIndex calculation

* Address feedback

* More tweaks

* Add some tests, round 1

* Add Direction enum

* Add next and prev urls for alert details

* refactor

* fixes

* No more AlertDataWrapper, less Maybe types

* change @timestamp to type number, redefine AlertListState

* moved pagination classes, moved types to alerts top level

* remove fake data mappings file

* Fix data location

* remove Maybe type, prev and next have type 'string | null'

* fix functional tests

* Create immutable AlertEvent type and an AlertMetadata type

* test updates

* make tests werk

* Address PR feedback

* No Date Immutable

* Fix test params

* Fix test type-check

Co-authored-by: Pedro Jaramillo <peluja1012@gmail.com>
2020-02-26 18:25:15 -05:00
Nathan L Smith 5fa2d80e12
Service map style tweaks (#56084)
Address all of the requests in #54182.

Also add a story for the Cytoscape component that shows most of these changes.

Fixes #54182.

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-02-26 16:50:46 -06:00
Frank Hassanabad d5eb17528c
[SIEM][Detection Engine] Output schema validations (#58317)
## Summary

* Adds an exact function which allows us to do exact validation rather than allowing arbitrary keys to go through
* Adds a type dependency for parts of validation (gives us feature parity with joi.when())
* Adds several hand spun validations/codecs
* Adds several utilities such as a printer for error validations

### Checklist

Delete any items that are not applicable to this PR.

- [x] [Unit or functional tests](https://github.com/elastic/kibana/blob/master/CONTRIBUTING.md#cross-browser-compatibility) were updated or added to match the most common scenarios
2020-02-26 13:57:37 -07:00
Josh Dover 4cb9bc4472
Add ScopedHistory to AppMountParams (#56705) 2020-02-26 12:43:12 -07:00
Thomas Neirynck 68624da3d5
[Maps] Add XYZTMSSource and TileLayer unit test suites (#58567) 2020-02-26 14:34:44 -05:00
Wylie Conlon 07fec2f725
Documentation for numeral pattern formatting (#57616)
* Documentation for Elastic Numeral formatting

* Tweaks from feedback

* Updates from feedback

* Fix and update examples

* Add TODOs

* Fix typo

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-02-26 14:17:59 -05:00
Manuel de la Peña d27b6c05d3
Migrate existing Cypress tests to Cypress + Cucumber (#57299)
* chore: move gitignore to the cypress directory

* chore: ignore more test files

* fix: do not check the Loading Message

It seems not relevant to the main purpose of these tests

* chore: use cypres + webpack + cucumber scaffolding

See https://github.com/TheBrainFamily/cypress-cucumber-webpack-typescript-example

* chore: add eslint and prettier for code linting

* feat: convert existing Cypress test into BDD style

* feat: add support for using proper Node version in MacOSX

* chore: use tslint

* chore: use old layout

We are keeping cypress as rootDir to follow project's structure. On the other hand,
having a second cypress directory at the 2nd level is the default structure, as shown
in the examples:
- https://github.com/TheBrainFamily/cypress-cucumber-webpack-typescript-example
- a240054d7f/examples/preprocessors__typescript-webpack

* chore: remove prelint script meanwhile we fix TS lint

* chore: move test results to a specific directory

* chore: rename variable following old code

* chore: remove non-needed lints, as we are going to use kibana build

* chore: import snapshot function from cypress

* chore: add readFile utils back from a bad removal

* chore: change format of JSON spec file

It was automatically changed by tests

* chore: move CI directory to the proper layout in order for Jenkins to work

* chore: store test-results from proper dir on Jenkins

* chore: store artifacts properly on Jenkins

* Fix type issues

* chore: rename test application to e2e (end-to-end)

We are keeping the build system within the test application, isolating dependencies

* docs: reorganise docs for APM UI e2e tests

* fix: Use proper cypress support file

* chore: use existing NPM script for running cypress on CI

* chore: update paths in CI scripts

* docs: document how the CI runs the tests

* chore: use Node 10 for tests

* chore: Use kibana's Node version for tests

* chore: run yarn install

* docs: update docs

* fix: path was wrong

* docs: fix paths and flags used to load data

* docs: elasticsearch fix flag

* docs: Bootstrap kibana before running it

* docs: remove outdated info

* chore: move background steps to the scenario

This would avoid not reading the background when the number of scenarios grows

Co-authored-by: Dario Gieselaar <d.gieselaar@gmail.com>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-02-26 11:00:54 -08:00
Elizabet Oliveira fa5400f606
[Maps] Improve Layer Style UI (#58406)
* Improving Layer Style UI

* Removing unnecessary method

* Updating snapshot

* Changing width value to make use of sass variable

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-02-26 18:20:03 +00:00
Maryia Lapata 55fb05c09f
[NP] Move ui/kbn_top_nav/kbn_top_nav to kibana_legacy (#58221)
* Migrate kbn_top_nav.js to kibana_legacy

* Wrap TopNavMenu into i18nContext

* Move the kbnTopNav directive definition to kibana_legacy and remove ui/kbn_top_nav

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-02-26 20:12:23 +03:00
Chris Cowan 0764380ffd
[Metrics UI / Logs UI] Remove field filtering in Source API call (#58553)
* [Metrics UI / Logs UI] Remove field filtering in Source API call.

* Fixing type_check issues
2020-02-26 09:51:47 -07:00
Angela Chuang e97b451cc1
[SIEM] add custom reputation link (#57814)
* add custom reputation link

* fix unit test

* add number of limitation to reputation links

* fix dependency

* apply defaultFieldRendererOverflow to reputation link

* fix unit test

* fix url template

* fix display links

* fix types

* fix for review

* update test case

* update snapshot

* add icons and tooltips

* fix style

* update test

* add external link component

* update test

* fix types

* fix style

* update snapshot

* remove useMemo

* update description

* code review

* review II

* code review

* update description

* fix unit test

* fix unit test

* fix unit test

* fix unit test

* fix types

* fix styles

* fix style

* fix style

* fix review

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-02-26 16:42:15 +00:00
Chris Cowan 8021fd887a
[Metrics UI] Custom Metrics for Inventory View (#58072)
* [Metrics UI] Add custom metrics interface to Inventory View

* WIP

* Adding workflows for editing custom metrics

* Polishing visual design

* Removing extra text

* Fixing types and return values

* fixing i18n

* Adding aria labels for clearity

* Changing custom group by to match same width as custom metric

* updating integration test for custom metrics

* Fixing type def
2020-02-26 09:36:43 -07:00
Pete Harverson 32fb5c1532
[ML] Fixes creation of a watch for an anomaly detection job (#58597) 2020-02-26 16:30:10 +00:00
Nathan Reese 3212754e62
[Maps] add Top term aggregation (#57875)
* [Maps] add Top term aggregation

* update pew-pew source to handle terms agg

* make helper function for pulling values from bucket

* update terms source

* better join labels

* categoricla meta

* remove unused constant

* remove unused changes

* remove unused constant METRIC_SCHEMA_CONFIG

* update jest expect

* fix auto complete suggestions for top term

* get category autocomplete working with style props from joins

* pluck categorical style meta with real field name

* mock MetricsEditor to fix jest test

* review feedback

* es_agg_utils.js to es_agg_utils.ts

* typing updates

* use composit agg to avoid search.buckets limit

* i18n update and functional test fix

* stop paging through results when request is aborted

* remove unused file

* do not use composite agg when no terms sub-aggregations

* clean up

* pass indexPattern to getValueAggsDsl

* review feedback

* more review feedback

* ts-ignore for untyped imports in tests

* more review feedback

* add bucket.hasOwnProperty check

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-02-26 07:50:11 -07:00
Nathan L Smith 2ea4bdfe0d
Server-side license check for APM service map (#58547)
* Factor our the license checking logic and messaging to common
* Add licensing plugin as a dependency of the APM plugin
* Throw a forbidden error on the server if trying to access the service map routes
2020-02-26 07:14:08 -06:00
Joe Reuter dfcd4d1e93
Functional tests: Fix saved object management button click retry (#58218) 2020-02-26 11:34:11 +01:00
Pierre Gayvallet a4e82c4e6d
Adapt es-archiver to call _migrate endpoint instead of creating a migrator (#56971)
* es-archiver call _migrate endpoint instead of creating a migrator

* fix crlf....

* use promise instead of callback accessor

* attempt with disabled authent

* enable security again

* set mapping to dynamic before calling migration endpoint

* rename space data from non-spaced tests

* add documentation on the `rerun` flag

* create router with the `/api/saved_objects` prefix

* add unit test about strict mapping

* add integration test on migrate endpoint

* wrap route handler with handleLegacyErrors

* add remark about limitations of the rerun flag

* Apply suggestions from code review

Co-Authored-By: Aleh Zasypkin <aleh.zasypkin@gmail.com>

* do not return detailed index result

* add access tag to migrate route

* use /internal prefix for migrate endpoint

* fix integ tests

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
Co-authored-by: Josh Dover <me@joshdover.com>
Co-authored-by: Aleh Zasypkin <aleh.zasypkin@gmail.com>
2020-02-26 10:39:16 +01:00
James Gowdy 71254de3c2
[ML] Adding get records endpoint wrapper (#58500) 2020-02-26 09:21:32 +00:00
Søren Louv-Jansen 0e0f114d03
[APM] Improve debug output (#58467) 2020-02-26 07:40:06 +01:00
Xavier Mouligneau b56eead4ac
[SIEM] [Detections] Refactor the all rules page (#58428)
* Refactor the all rules page to be easier to test

* review with Garrett

* bring back utility bar under condition

* fix bugs tags and allow switch to show loading when enable/disable rule

* fix rules selection when trigerring new rules

* fix imports/exports can only use rule_id as learned today

* review I
2020-02-25 21:59:44 -05:00
Mike Côté 24b8ecf74d
Add localization to missing action types (#58554) 2020-02-25 21:47:53 -05:00
Mike Côté 29439789ab
Add migration support to the event log (#58010)
* Initial work

* Add missing file

* Add tests where missing

* Add kibana version to esNames

* Share ILM policy across versions
2020-02-25 18:18:27 -05:00
Lukas Olson ef80ebf1bb
[Search service] Add async search strategy (#53057)
* 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 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

* 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

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-02-25 15:57:40 -07:00
Andrew Cholakian 87f6cd1152
[Uptime] Show only total in snapshot heading (#58376)
This fixes a number of design issues. Fixes https://github.com/elastic/kibana/issues/58372
2020-02-25 16:40:06 -06:00
Ryland Herrick 2501919a8a
Remove support of HEAD request in signals index route (#58489)
Until these are officially supported in new platform, it's best to not
rely on this behavior. We can achieve roughly the same functionality
with a GET request. Modifies the existing script accordingly, in case
anyone's still using it.

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-02-25 15:33:49 -06:00
Larry Gregory ca5fb7fb01
Use links instead of click handlers when switching spaces (#57730)
* use links instead of click handlers when switching spaces

* remove unused imports

* remove use of deprecated injectedMetadata service

* simplify SpacesManager constructor

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-02-25 15:56:28 -05:00
Thomas Neirynck d9e3d744ba
[Maps] Add EPSG-code to docs (#58378) 2020-02-25 14:21:25 -05:00
Nathan Reese 30fb4eb694
[Maps] remove duplicated pagintation text in locked tooltips (#58383) 2020-02-25 11:50:54 -07:00
James Gowdy d50031e721
[ML] Global calendars (#57890)
* [ML] Global calendars

* updating snapshots

* changes based on review

* larger spacer

* updating jest snapshot
2020-02-25 18:02:40 +00:00
Anton Dosov 93556a9bdd
Visualizations plugin np_ready (#57983)
Partially addresses #50897

updates visualizations plugin

makes visualizations/saved_visualizations np_ready
makes visualizations/embeddable np_ready
remove DefaultVisEditor dependency from visualizations
import AggConfigs directly instead of ui/public
Clean up imports from root. use relative imports
Remove bind directive import
2020-02-25 18:31:24 +01:00
Vadim Dalecky 120f03dc06
Add <FormCreateDrilldown> component (#58335)
* refactor: 💡 use .story for Storybook and standartize dir struct

* feat: 🎸 add <FlyoutFrame> component

* feat: 🎸 add <FlyoutCreateDrilldown> component

* refactor: 💡 improve FlyoutCreateDrilldownAction

* test: 💍 add <FlyoutFrame> tests

* docs: ✏️ add @todo for <DrilldownHelloBar>

* feat: 🎸 make name editable in <FormCreateDrilldown>

* test: 💍 add <FormCreateDrilldown> name field tests

* chore: 🤖 change drilldown translation keys
2020-02-25 18:02:25 +01:00
MadameSheema 712c0851a7
[SIEM] Deletes duplicated tests (#58453)
* deletes duplicated test

* deletes duplicated fields browser test
2020-02-25 17:15:31 +01:00
MadameSheema 21d98d787e
skips 'ResizeObserver loop limit exceeded' error (#58465) 2020-02-25 17:10:18 +01:00
Kerry Gallagher b17aa35513
[Logs / Metrics UI] Handle index.scss (#58219)
* Ensure our index.scss file is handled
2020-02-25 15:28:41 +00:00
Devin W. Hurley 10bf90f9f5
[SIEM] [Detection Engine] Increase unit test coverage (#58274)
* updates read privileges route tests

* fixes test for 404 when alertsClient is not present, adds new test for catching errors at the route level for prepackaged rules route

* fixes test for happy path on create rules bulk route (missing mock resulted in 200, but was still throwing an error), adds tests for covering case where a rule with a matching rule id is found to have already existed, adds a test covering the case where createRules throws an error and that error is caught in the catch block, and appears in the response

* adds more jest functions to beforeEach to ensure mockImplementation state used by spyOn is not carried over between tests, increases test coverage for create rules route

* updates unit test coverage for delete rules route and bulk delete

* increase unit test coverage for find_rules_route

* add test case to get_prepackaged_rules where findRules throws an error

* adds unit test for missing alertsClient in patch_rules_bulk route

* adds unit test coverage for transform error and pathRules throwing an error on patch rules route

* adds unit test coverage for rule not found, transform error, and readRules throws an error on read_rules_route

* adds unit test coverage for update rules (bulk) routes

* increases unit test coverage for open close signals route

* updates coverage for signals query route

* adds unit tests for rules status route, updates utils test coverage. Removed unreachable code.

* updates test coverage, removes usage of pipes from ndjson to stream conversion and returns arrays of tranformers to be used in createPromiseFromStreams so that unhandled promise rejections can be handled appropriately.

* fixes type errors

* fix bug on transform when rulestatus saved objects array is empty because we are no longer passing in the current status, we are passing in the whole saved object.

* adds unit test for when readRules throws an error inside of get export by object ids

* adds unit tests for catching errors on read rules and fixes property undefined bug in catch block

* removes unused function from utils

* adds the 'else' clause back to the getTupleDuplicateErrorsAndUniqueRules function and adds a test case for when an attempt to import rules with missing ruleIds is made, and the expected outcome.
2020-02-25 09:34:53 -05:00
Jean-Louis Leysens 899270a108
[Upgrade Assistant] Move out of legacy folder (#58034)
* Create x-pack/plugins skeleton for upgrade assistant

* Move public folder contents

Move the public folder of Upgrade Assistant and migrate public to use HttpSetup (remove axios)

* Include stylesheets in public

* Move server side out of legacy

Begin migration of Reindex worker to new platform

Move imports around so that it satsifies new platform constraints like not importing
server side code (even types) in client.

* Updated the routes with new dependencies and removed server shim

* Fix router unit tests

* Fix server lib tests

After changing function signatures for the reindex server factory (and others) all
of the tests needed to be revisited and brought in line with the new APIs.

Also used core/server mocks where appropriate

* Clean up types issues

* Fix setting credentials on request header

* Removed the security plugin from Upgrade Assistant

The security plugin is a potential future consumer of the Upgrade Assistant's deprecation feature
and we would therefore not want to create a circular depedency here. We pull in the licensing plugin
rather (as it is less likely that we will depend on that) and use it to determine whether security
is available and enabled.

* Migrate to config to new platform config

xpack.upgrade_assistant.enabled

* Remove unused types

* Fix import issue

* Move upgrade assistant back to Elasticsearch management section

* Update dotfiles

Added elasticsearch ui team as upgrade assistant code owner
Updated i18nrc.json path

* Alphabetical ordering in xpack/i18nrc.json

* Implemented PR feedback

Renamed callCluster -> callAsUser to be more consistent
with platform naming.

Added comment about why we are not using security plugin
directly inside of Upgrade Assistant.

Fixed long path imports and use 'src/core/..' throughout.

Fixed import ordering.

Renamed variables inside of telemetry lib.

* Revert to longer import path

In plugin.ts importing from 'kibana/server' or 'src/core/server'
results in a module not found error.

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-02-25 15:31:04 +01:00
Justin Kambic d339740c2d
[Uptime] Migrate server to new platform (#53939)
* Move uptime legacy server to plugins directory.

* Re-add feature registration code.

* Move feature registration back to kibana bootstrap file.

* Delete obsolete test file.

* Remove i18n call from untracked file.

* Implement feedback.

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-02-25 09:27:18 -05:00
patrykkopycinski 418c44a47e
[SIEM] Fix unnecessary re-renders on the Overview page (#56587) 2020-02-25 15:00:50 +01:00
Nathan L Smith afb5d8fa58
Fix service map popover transaction duration (#58422)
It's already microseconds, so not converting it fixes it.

Checked services to see if all metrics match now and they do!

Fixes #55679
2020-02-25 07:43:46 -06:00
James Gowdy b756cc3915
[ML] Adding filebeat config to file dataviz (#58152)
* [ML] Adding filebeat config to file dataviz

* adding extra help text

* removing commented out code

* adding extra blank line to processors section

* cleaning up types

* moving hosts line out of function

* typo in config text

* updating config based on review

* tiny refactor

* translating paths text
2020-02-25 13:39:50 +00:00
Andrew Cholakian 71d6c22114
[Uptime] Improve refresh handling when generating test data (#58285)
When generating test data we refresh excessively, this can fill up the
ES queues and break the tests if we run massive tests. I originally ran
into this with https://github.com/elastic/kibana/pull/58078/ which I
closed due to finding a better approach.

While none of our current tests have the scale to expose this problem,
we certainly will add tests that do later, so we should keep this
change.

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-02-25 07:18:04 -06:00
Alejandro Fernández db276d1894
[Logs / Metrics UI] Remove path prefix from ViewSourceConfigur… (#58238)
In the NP the routes have already the app name on them. Adding it to
this button made the app name double

    /app/metrics/metrics/settings
    /app/logs/logs/settings

The button only needs to go to the settings page within the app where
it's being loaded, so we can safely drop the prefix.

Closes #58233
2020-02-25 13:39:13 +01:00
Robert Oskamp 6fc6cb8b36
[ML] Functional tests - adjust classification model memory (#58445)
This PR increases the model memory setting in the classification creation test.
2020-02-25 13:22:29 +01:00
David Roberts 31cc2015b7
[ML] Use event.timezone instead of beat.timezone in file upload (#58447)
This is because beat.timezone was renamed to event.timezone in
elastic/beats#9458

The corresponding file structure finder change is
elastic/elasticsearch#52720
2020-02-25 12:18:35 +00:00
Felix Stürmer 900a8290fb
[Logs UI] Unskip and stabilitize log column configuration tests (#58392)
This attempts to make the log column configuration tests more robust to inconsistent DOM and interaction timing.

fixes #58059
2020-02-25 11:52:37 +01:00