Commit graph

31185 commits

Author SHA1 Message Date
Lee Drengenberg
07edafdfa7
fixes 'management scripted fields preview should display additional fields' when run with a HEAD (#59213)
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-03-04 12:23:58 -06: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
Lee Drengenberg
455b2f5047
Have to click save after resetting advanced setting to default (#59216)
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-03-04 11:28:59 -06: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
Liza Katz
c769b6313b
[Bug fix] Can't modify a custom filter without label (#59296)
* Show filter value if nothing else is available for label value

* Add label max width

* Revert "Add label max width"

This reverts commit 9537968110.
2020-03-04 16:00:42 +00: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
Matthias Wilhelm
b2616df34c
[TSVB] Fixes color rules operate variable automatically set to undefinded (#58719)
* Fixes operate variable (string) automatically set to undefinded

* Add test
2020-03-04 16:40:39 +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
Bhavya RM
2361fe62cd
calling exitFullScreenMode in test (#59238)
exitFullScreenMode in fullscreen dashboard test
2020-03-04 09:41:32 -05: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
Pierre Gayvallet
82032b65fe
use observables instead of delay when possible (#59283) 2020-03-04 14:53:26 +01: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
Walter Rafelsberger
7e25301698
[ML] Updated ML and transform CODEOWNERS for NP. (#59286)
Updates CODEOWNERS to include NP plugin paths for the ML and transform plugin.
2020-03-04 13:02:42 +01: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
Pierre Gayvallet
7130a0405f
Expose savedObject import / export utility methods (#58882)
* add getImportExportObjectLimit to so setup

* expose static method for so import / export

* improve functions naming

* fix mocked reference
2020-03-04 12:10:29 +01:00
Maryia Lapata
80db96b823
Fix TS for vis_type_vislib (#58345)
* Fix TS for vislib

* Fix TS

* Revert table changes

* Update unit test

* Refactor updateAxisTitle

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-03-04 13:57:16 +03:00
Liza Katz
01e4b96492
Use new search strategy service for search requests (#58990)
* Use new search strategy

* Update jest test

* fix painless error

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-03-04 10:46:12 +00: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
MadameSheema
3d4d03d2d1
activates SIEM Cypress tests in Jenkins (#59181)
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-03-04 10:35:05 +01:00
Marcin Tojek
3d06a623ed
Add Redis Enterprise to home tutorial (#59136) 2020-03-04 10:24:03 +01:00
Liza Katz
45efc11a0a
Edits to filter's custom label are ignored (#59169)
* Fix filter alias field

* Test for alias comparison

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-03-04 08:48:35 +00:00
Uladzislau Lasitsa
faf2bbe760
[vis_filters]: Convert to TS/Jest, write tests (#58488)
* Converted files to TS. Added tests.

* Removed ts-ignore

* Fixed comments and tests

* Fixed error

* Fixed tests

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-03-04 11:37:22 +03: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
Jean-Louis Leysens
5a21805078
[Console] Fix overriding of host header name (#59143)
* fix: only override hostname if none was provided

Copy the behaviour or Wreck.request from 7.4. This is a regression
for setting the Host header value.

* Refactor variable name

* [skip ci] Fix comment
2020-03-04 08:42:45 +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
Spencer
692c1d0713
[ci] add Jenkinsfile for visual baseline job (#52154)
* [ci] add Jenkinsfile for visual baseline job

* fixup the jenkinsfile

* update jenkinsfile syntax
2020-03-03 18:15:44 -07: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
Spencer
992e223700
[test-es-cluster] remove random cluster name (#58762)
* [test-es-cluster] remove random cluster name

* make cluster names unique in parallel test groups

* specify default customEsArgs

* share ci parallel prefix logic to avoid use of wrong env var

* remove - postfix from tag, add docs with explaination

* fix file name

* ci parallel process prefix doesn't need to be exported so don't

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-03-03 14:47:23 -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
Maja Grubic
3a7aa58c41
Fixing a small typo (#59185) 2020-03-03 20:43:32 +00:00
Joe Reuter
e4f4ac7cfa
stabilize dashboard snapshot toast closing (#58709) 2020-03-03 21:39:22 +01:00
Joe Reuter
5d6248d9d9
make remove filter work (#58871) 2020-03-03 21:39:13 +01: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