Commit graph

31375 commits

Author SHA1 Message Date
Lisa Cawley
2779d102a4
[DOCS] Edits job creation UI text (#59830) 2020-03-11 08:55:34 -07:00
Kaarina Tungseth
40901496ca
[DOCS] Removed Coordinate and Region Maps (#59828)
* [DOCS] Removed Coordinate and Region Maps

* Review comment

* Added redirect for visualize-maps
2020-03-11 09:25:20 -05:00
Thomas Watson
38717982e3
Clean up .eslintrc.js with better variable naming (#59864) 2020-03-11 15:18:49 +01: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
Kaarina Tungseth
9484012fdf
[DOCS] Removed experimental from KQL (#59896) 2020-03-11 08:58:33 -05:00
Kaarina Tungseth
2f912a3661
[DOCS] Clarification in tutorial (#59088)
* Cl[DOCS] arification in tutorial

* Review comments
2020-03-11 08:53:20 -05: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
Alexey Antonov
bd3f94e458
Vislib legend toggle broken (#59736)
Closes: #59254
2020-03-11 16:31:19 +03:00
Alejandro Fernández Haro
babf81bdc0
[RFC] Pulse (#57108)
* [RFC][skip-ci] Pulse

* Add drawback

* Add Opt-In/Out endpoint

* Add clarification about synched local internal indices

* Update rfcs/text/0008_pulse.md

Co-Authored-By: Josh Dover <me@joshdover.com>

* Add Phased implementation intentions, Security and Integrity challenges and example of use

* Refer to a follow up RFC to talk about security in the future

* Fix wording + add Legacy behaviour

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
Co-authored-by: Josh Dover <me@joshdover.com>
2020-03-11 09:36:12 +00: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
Thomas Watson
1525dbe73d
ci: disable all Mocha rules for tape tests (#59798) 2020-03-11 08:07:06 +01: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
Kaarina Tungseth
9985597ad9
[DOCS] Updated and added jump tables (#59774)
* [DOCS] Updated and added jump tables

* Review comment
2020-03-10 16:46:02 -05:00
Kaarina Tungseth
6e7df195d3
[DOCS] Moved rolled up index content (#59372)
* [DOCS] Moved rolled up index content

* Review comments
2020-03-10 16:37:17 -05:00
Joe Portner
a2c002d130
Regenerate core api docs (#59814) 2020-03-10 17:24:05 -04:00
Marta Bondyra
44eb7c0130
[Lens] remove react warnings (#59574) 2020-03-10 22:10:35 +01:00
Thomas Watson
8478734247
The scripts/backport.js file isn't an executable (#59800) 2020-03-10 22:06:56 +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
Brandon Kobel
29eda20237
Updating svgo -> css-tree -> mdn-data, all so we get mdn-data > 2.0 (#58913)
* Updating svgo -> css-tree -> mdn-data, all so we get mdn-data > 2.0

* fix extra entry in yarn.lock file

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
Co-authored-by: spalger <spalger@users.noreply.github.com>
2020-03-10 12:17:48 -07: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
Spencer
c874df1847
update typescript version in all packages to avoid warnings (#59787)
Co-authored-by: spalger <spalger@users.noreply.github.com>
2020-03-10 11:37:02 -07: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
Brian Seeders
1b0d1f1c51
Add a retry to dashboard test for a sometimes slow async operation (#59600) 2020-03-10 12:45:49 -04: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
Daniil Suleiman
0ed7176e4d
[Vis Editor] Refactoring metrics axes (#59135)
* Fix TS for vislib

* Fix TS

* Revert table changes

* Update unit test

* Refactor code in metrics_axes

Co-authored-by: maryia-lapata <mary.lopato@gmail.com>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-03-10 18:55:45 +03:00
Kaarina Tungseth
5dcba2a566
[DOCS] Changed Discover app to Discover (#59769) 2020-03-10 10:51:53 -05: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
Devon Thomson
06999ecfb3
Enhancement - EUICodeEditor for Visualize JSON (#58679)
Switched out the textfield in the advanced JSON editor for the EUI code editor component. removed legacy import isValidJson in favor of using Ace Editor's default json validation.
2020-03-10 11:31:03 -04: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
Larry Gregory
914df7996d
Update misc dependencies (#59542)
* update deps

* updating to @hapi/good-squeeze

* consolidate fast-safe-stringify deps

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-03-10 08:19:14 -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
Jean-Louis Leysens
03d082c59e
[Console] Remove unused code (#59554)
* Remove unused code

* fix: remove use of undeclared variable

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-03-10 12:45:46 +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
Liza Katz
28d0cf4485
Generate docs from data plugin (#56955)
* Add doc building for data plugin

* Added data server md file

* index file for suggestion component

* Clear out internal imports from public API

* Remove FunctionalComponent usage

* comment out working docs

* Added fixes following @octogonz feedback

* new docs

* Clean up

* Clean up 2

* fix jest

* rename docs script file

* update tasks

* tasks

* update docs
2020-03-10 11:34:06 +02: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
Thomas Watson
a663f65bcc
Harden creation of child processes (#55697)
Add general protection against RCE vulnerabilities similar to the one
described in CVE-2019-7609.

Closes #49605
2020-03-10 07:51:57 +01: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
Nathan Reese
6395dac297
[Maps][docs] add more details to Quantitative data driven styling docs (#59553)
* [Maps][docs] add more details to Quantitative data driven styling

* Update docs/maps/maps-aggregations.asciidoc

Co-Authored-By: Nick Peihl <nickpeihl@gmail.com>

* Update docs/maps/vector-style.asciidoc

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

* Update docs/maps/vector-style.asciidoc

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

* Update docs/maps/vector-style.asciidoc

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

* Update docs/maps/vector-style.asciidoc

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

* Update docs/maps/vector-style.asciidoc

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

* Update docs/maps/vector-style.asciidoc

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

* review feedback

Co-authored-by: Nick Peihl <nickpeihl@gmail.com>
Co-authored-by: gchaps <33642766+gchaps@users.noreply.github.com>
2020-03-09 15:19:25 -06:00
Vadim Dalecky
405b0fa30c
chore: 🤖 hide Drilldowns in master (#59698) 2020-03-09 22:10:46 +01:00
Matthias Wilhelm
e630950a3d
[Discover] Migrate AppState/GlobalState to new app state helpers (#57175)
* Replace AppState

* Replace GlobalState

* Adapt functional test

* Sync initial app state to URL

* Add jest tests

* Refactoring to use use-default-behaviors="true" in kbn-top-nav

* Cleanup code remove unnecessary imports and variables

* Refactor to use syncQueryStateWithUrl & stopSyncingQueryAppStateWithStateContainer

* Remove discoverPersistedState

* Allow indexPattern switch without $route.reload()

* Remove timeRangeObj because it's not needed

* Create new getDefaultQuery in data plugin

* Simplify check for null in sync_state_with_url.ts

* Remove unused stateMonitorFactory

Co-authored-by: Alexey Antonov <alexwizp@gmail.com>
2020-03-09 18:45:14 +01:00