Commit graph

29134 commits

Author SHA1 Message Date
Shahzad
c876dc3e7e
Feature/issue 50665 hide header panel in embeddable panel (#50728)
* added bool option to hide header

* update panel

* added unit test
2019-11-19 10:52:28 +01:00
Tim Roes
483cb9a7d3
Upgrade typescript-eslint to 2.8.0 (#50956)
* Upgrade typescript-eslint to 2.8.0

* merge eslint-utils versions
2019-11-19 10:11:02 +01:00
Pierre Gayvallet
01bbbf4b03
Remove react references from core OverlayService apis (#48431)
* move/rename overlay mount and unmount types from banner to parent module

Signed-off-by: pgayvallet <pierre.gayvallet@elastic.co>

* migrate openModal / modalService

Signed-off-by: pgayvallet <pierre.gayvallet@elastic.co>

fix I18nProvider import path

Signed-off-by: pgayvallet <pierre.gayvallet@elastic.co>

* updates core doc

Signed-off-by: pgayvallet <pierre.gayvallet@elastic.co>

update doc bis

Signed-off-by: pgayvallet <pierre.gayvallet@elastic.co>

* migrate openFlyout / flyout service

Signed-off-by: pgayvallet <pierre.gayvallet@elastic.co>

* remove CoreStart export from kibana-react

Signed-off-by: pgayvallet <pierre.gayvallet@elastic.co>

* adapt some calls to new signature

Signed-off-by: pgayvallet <pierre.gayvallet@elastic.co>

* adapt new calls

Signed-off-by: pgayvallet <pierre.gayvallet@elastic.co>

* adapt js call

Signed-off-by: pgayvallet <pierre.gayvallet@elastic.co>

* add flex layout on mountWrapper component to avoid losing scroll on overlays

Signed-off-by: pgayvallet <pierre.gayvallet@elastic.co>

* create proper flyout/modal services

* update generated doc

* update snapshot on data/query_bar

* use ReactNode instead of ReactElement

* rename mountForComponent to reactMount

* change reactMount usages to toMountPoint

* remove duplicate MountPoint type in overlays

* remove duplicate mount utilities from overlays

* allow to specify custom class name to MountWrapper

* Allow to specialize MountPoint on HTMLElement subtypes

* updates generated doc

* undeprecates openFlyout/openModal & remove direct subservice access from overlayService

* adapt toast api to get i18n context from service

* use MountPoint instead of inline definition
2019-11-19 10:08:16 +01:00
Joe Reuter
600862ef64
Migrate share registry (#50137) 2019-11-19 09:50:54 +01:00
Alexey Antonov
c0d2b29e8b
Move @kbn/es-query into data plugin - remove unused code (#50903) 2019-11-19 11:15:46 +03:00
MadameSheema
a325db07ad
[SIEM] Skip failing tests (#50942)
* skip fields browser tests

* skips conditional links failing tests

* skips pagination failing tests

* skips toggle column failing tests

* skips url state failing tests

* avoids cypress known bug
2019-11-19 08:55:48 +01:00
Chris Mark
e64955128b
Add Traefik Metricbeat module tutorial to Kibana home (#50767) 2019-11-19 09:47:08 +02:00
Katrin Freihofner
2643f18312
Cleans UI up and removes duplicated info (#49208)
These are purely minor visual changes and some fine-tuning of whitespace.
2019-11-19 08:45:55 +01:00
Nathan Reese
d0d565f7a0
Fix filter pill label for filters with negated alias (#50743)
* Fix filter pill label for filters with alias

* restore span ref wrapper for filter pill title

* make valueLabel prop optional
2019-11-18 21:19:44 -07:00
Mike Côté
ce99844d29
Add ability to tag alerts (#49320)
* Add ability to tag alerts

* Add docs

* Use keywords terminology in docs

* Fix broken tests
2019-11-18 20:28:42 -05:00
Tim Sullivan
e20c5961aa
[Telemetry] Fix a corner case where optIn flag was not handled properly (#50990)
* [Telemetry] Fix a corner case where optIn flag was not handled properly

* comment correct
2019-11-18 17:44:20 -07:00
Vadim Dalecky
26077633d6
Expressions fully migrated to the New Platform (#50294)
* chore: 🤖 use "expressions" namespace for expression translation

* feat: 🎸 move Expressions renderer to the New Platform

* feat: 🎸 move Expression executor to the New Platform

* feat: 🎸 move Expressions loader to the New Platform

* feat: 🎸 re-export Expressions setup, remove services.ts

* feat: 🎸 use "expressions" translation namespace

* feat: 🎸 move Expressions start contract to the New Platform

* feat: 🎸 move expressions mocks to the New Platform

* chore: 🤖 clean up NP-ready Expressions plugin

* feat: 🎸 remove Expressions shim, merge prev PV changes

* feat: 🎸 clean up expressions and interpreter plugins

* fix: 🐛 remember exression services

* fix: 🐛 load legacy Interpeter functions using uiExport

* perf: ️ run executer with always the latest functions

* fix: 🐛 load interpreter actions in Kibana, provide functions

* fix: 🐛 load Interpreter uiExport int Lens app

* fix: 🐛 load Interpeter uiExports int Canvas

* refactor: 💡 move esaggs function to data plugin Search service

* refactor: 💡 move visualization registrants to Visualizations pl

* test: 💍 fix Lens Jest test mocks

* fix: 🐛 correct translations for moved registrants

* chore: 🤖 address PR comments

* fix: 🐛 load Expressions CSS, nuke Expressions legacy plugin

* fix: 🐛 stop leaking CSS classes between Expressiosn and Lens

* chore: 🤖 remove expression types from client-side use /common

* chore: 🤖 address review comments

* fix: 🐛 load interpreter ui-exports in dashboard_viewer

* Have ExpressionRenderer accept className prop.

* Fix static positioning class targets
2019-11-18 16:26:13 -08:00
Caroline Horn
3d62c5d216
[Header] Force line-break if username is a solid long string (#50807)
Fixes #50059 by adding a break-word utility class to the username.
2019-11-18 16:57:13 -05:00
Ryland Herrick
02ac9a313b
[SIEM] Shim backend for new platform (#50240)
* Add shims for new platform structure

Defines both our Plugin class and the factory function.

* Simplify server init code path

We were doing some work with server, then dropping into another function
to further mutate it. I'm moving this all to the same level
(initServerWithKibana) to make decoupling from Hapi simpler to follow.

* Remove unnecessary casting

Server has newPlatform on it, now.

* Remove unused arguments

These had their usage removed in #36662 but their signature remained.

Since we're trying to pin down the existing interface with hapi, this is
just noise that should be deleted.

* Remove unneeded destructuring

This was only needed for a type assertion, originally.

* Document current interface with hapi via ServerFacade

This is everything we're using from hapi's server right now. The next
step is moving what we can to the new platform, and abstracting the
rest behind a facade layer.

* Include NP plugin in initialization path

* Instantiates plugin and passes NP modules
  * We're just passing the LoggerFactory from the init context, for now.
* Whitelist functionality from Server, pass through as ServerFacade
  * This will verify our facade at runtime in addition to typechecking
* Uses Pick and Partial to use existing types while shimming properties
  as we go

* Remove redundant logging mechanism

We were logger in two different ways, but we can move to the NP version
now that it's ready.

* Bind server's route function context

This was causing a test failure and needed to be bound similarly to the
register function. Slight rename of variables as well.

* Type Hapi.Request usage via RequestFacade

This is everything we're currently using from Hapi.Request; as we move
things away we can update this interface and let TS tell us what's
broken.

Remove any typing of our request payloads

These _can_ have fields like `variables` and `operationName` from
graphQL, or they might not. In the majority of cases the payload was
typed as any, and to cut down on churn and because I have no confidence
in typing each individual request, we're going to make that the default.

* Inline our GraphQL Hapi plugin

A la uptime, this effectively just moves the call to server.route() into
the function itself, rather than registering a Hapi plugin that
ultimately does the same.

* Remove register from our list of Hapi dependencies

This was only used to register our GraphQL plugin(s), which are now
inlined and use `route`.

* Invoke existing init path from plugin's setup

This isn't the final format as we're eventually doing away with __legacy
entirely, but this makes our plugin 'live' and is a step in the right
direction.

* Remove usage of Pick in favor of a type assertion

The onus here should be on the shim invocation, not the plugin itself.

* Pass existing NP modules into our plugin

Another step toward the proper plugin signature.

We're needlessly destructuring coreContext just to get the logger and
pass it right back in. The other logger usage will be removed momentarily when we change the signature of `initServerWithKibana`.

Also adds core and plugins to our setup method, which are currently
unused.

* Remove dependence on newPlatform property in Server

We now get these through NP's initializerContext, so we do that in the
plugin now instead. The extra parameters are gross but temporary
(initServerWithKibana will eventually go away), and
it's much better to shrink the size of ServerFacade.

* Remove unused mocking fn/logging/tests

These are relics from the initial graphQL implementation and are no
longer used.

* Move log statement into plugin

Makes more sense to decorate the init invocation than to log 'start'
from outside and 'end' from inside.

* Fix shape of our InitializerContext

While PluginInitializerContext type has the env property,  the
newPlatform object on the Server has it in a different shape.

* Ensure our request payloads are typed

Rather than the free-for-all of `any`, let's instead type our payload as
unknown and actually name the request types whose payloads are being
reached into. A type assertion in the resolver for these requests is the
secret sauce here.
2019-11-18 15:44:59 -06:00
Nathan Reese
e2dc9213ca
[Maps] move apply global filter settting from layer to source (#50523)
* [Maps] move apply global filter settting from layer to source

* add checkbox to join UI

* update edit UI for grid and pew-pew source

* add migrations

* update docs

* remove setting of applyGlobalQuery from geojson upload

* upgrade SIEM layer descriptors

* fix jest tests and api integration tests

* fix functional tests

* fix functional test

* i18n

* review feedback

* doc re-wording

* i18n fixes
2019-11-18 13:59:27 -07:00
Andrew Goldstein
e5ef8788bd
[SIEM] Fix: Empty Source / Destination shown when only ports are populated (#50843)
Fixes an issue where an empty `Source` or `Destination` container is rendered by
the Timeline row renderer when events have `source.port` or `destination.port` populated,
but the corresponding `source.ip` or `destination.ip` is not.

### Before Chrome `78.0.3904.97`

![chrome-before](https://user-images.githubusercontent.com/4459398/68985053-fd26ec80-07d0-11ea-99e3-1180a3e9d7fb.png)

### After Chrome `78.0.3904.97`

![chrome-after](https://user-images.githubusercontent.com/4459398/68985058-0912ae80-07d1-11ea-990a-1a66802cad0e.png)

## Details

The following JSON is from the event shown in the screenshots above:

```
  "destination": {
    "port": 53
  },
```

In the JSON above, the `destination.port` field is populated, but the
`destination.ip` field is **not** populated.

The `destination.port` in the event is expected to be rendered in the
"before" screenshot above, but an empty `Destination` label is rendered
instead.

## To reproduce:

1. Create a new timeline with the following KQL:

```
destination.port: * and NOT destination.ip: *
```

**Expected Result**

- The `destination.port` contained in the event is rendered in the `Destination` container

**Actual result**

- An empty `Destination` is rendered, per the "before" screenshot above

## Other Corner Cases

An analysis of real data performed while desk testing this PR revealed other
corner cases in real-world data, including port arrays with `null` values.

The types and implementaion were updated to reflect the reality of the data
found during desk testing. Unit tests were added to cover these cases.

### After Firefox `70.0.1`

![firefox-after](https://user-images.githubusercontent.com/4459398/68985063-10d25300-07d1-11ea-9c17-d962c0f1015e.png)

### After Safari `13.0.3`

![safari-after](https://user-images.githubusercontent.com/4459398/68985067-162f9d80-07d1-11ea-8773-d3e71a84a440.png)

Note: This PR was NOT tested in IE 11, due to unrelated IE 11 issues with dependencies in `master`

* https://github.com/elastic/siem-team/issues/476
2019-11-18 13:14:09 -07:00
Thomas Neirynck
929384b84e
[Maps] Delay vector tile layer syncing until spritesheet is loaded (#48955) 2019-11-18 14:51:58 -05:00
Nathan Reese
37d82db57d
[Maps] prevent users from overflowing URL when filtering by shape (#50747)
* [Maps] prevent users from overflowing URL when filtering by shape

* small fix

* fix jest test

* update warning message

* update overflow error message
2019-11-18 12:38:37 -07:00
DeDe Morton
6729d513d7
[DOCS] Mark Beats central management as discontinued (#49423) 2019-11-18 11:17:40 -08:00
Dmitry Lemeshko
6bc43bb9fd
[page_objects/common_page] convert to ts (#50771)
* [page_objects/common_page] convert to ts

* fix lint errors

* descrease navigation timeouts

* use template literal for log messages
2019-11-18 20:08:22 +01:00
Christiane (Tina) Heiligers
04425ff6cd
[NP Kibana Migrations ] kibana plugin home (#50444)
* [NP:Kibana:homeAPI] initializes a new plugin (WIP)

* Typing

* New plugin tutorials not needing server working

* Retains legacy tutorial registration and adds new route for new platform tutorial plugin registrations

* Adds comment on where to pre-register general non-plugin specific tutorials

* Converts TutorialsPlugin to TutorialsRegistry service in new Home plugin

* Changes call to location of registerTutorial in registerTutorials

* Adds console log for the home plugin that's returning an empty object

* Removes async from setup and start methods in the home plugin and the tutorials service

* Starts writing tests and creating mocks

* Adds basic tests for TutorialRegistry service

* Adds basic tests for TutorialRegistry service

* Adds test for route

* Adds mocks and tests for the home plugin

* Adds home plugin to security plugin and registers scoped tutorials service

* Removes incorrect addition to src core server

* Fixes type errors

* Deletes unused code

* Deletes duplicate golangMetricsSpecProvider registration

* Nests tutorials service in a tutorials key in the home plugin, changes api http routes for legacy platform and NP

* Changes url variable names
2019-11-18 11:47:27 -07:00
Kaarina Tungseth
d04d5e9eef
[DOCS] Shareables naming convention (#50497)
* [DOCS] Shareables

* Updated topic titile
2019-11-18 12:36:11 -06:00
Melissa Alvarez
dd06bfc6c3
[ML] DF Analytics - auto-populate model_memory_limit (#50714)
* create modelMemoryLimit estimation endpoint. add value to form

* add validation for model memory limit field

* update jest tests

* update validateModelMemoryLimitUnitsUtils to be more generic

* add placeholder and validation with helpText to modelMemoryLimit field

* update endpoint name to estimateDataFrameAnalyticsMemoryUsage for clarity

* tweak modelMemoryLimitEmpty check in reducer

* add tests for modelMemoryLimit validation
2019-11-18 13:21:35 -05:00
Mike Côté
10c158b483
Increase alerting test stability and reduce flakiness (#50246)
* Increase alerting test stability

* More changes to test methodology + bug fix in throttling

* Fix comments

* Cleanup

* Typo

* Fix broken tests

* Fix integration tests

* Fix typo
2019-11-18 12:59:21 -05:00
James Gowdy
fb3d2f9324
[ML] Remaning new_job_new folder (#50917) 2019-11-18 16:51:06 +00:00
Joel Griffith
97c2bc9d7b
[Telemetry] Show opt-in changes for OSS users (#50831)
* WIP: Notice banner for OSS folks

* Add telemetryNotifyUserAboutOptInDefault to injected vars

* add userHasSeenNotice check

* More WIP on banner notice component

* Text changes on screens

* make userHasSeenNotice flag work

* Finalzed splash text + checking new flag

* Consolidating banner calls and saving status of opt-in notice

* Conditionally remove the banner and add some code docs

* Fixing prior welcome tests

* api integration test for user has seen opt in

* change post method to put in ui

* unit test for get_telemetry_notify_user_about_optin_default

* Ignore TS woes

* Adding new tests and snapshots for opt-in banner component

* Notice banner test

* Translation miss

* More opt-in tests

* increase types usage

* roll back core server api change

* update snapshot

* Prop name change + snapshot updates
2019-11-18 08:50:32 -08:00
Pete Harverson
aaa3097ba8
[ML] Fix lat_long anomalies table links menu and value formatting (#50916) 2019-11-18 16:41:44 +00:00
Jean-Louis Leysens
0c2c63fabb
[Dev] Fix serialising a really big string (#50915)
* A fix

* limit size of webpack error object
2019-11-18 17:33:58 +01:00
Alejandro Fernández Haro
30269123f0
Better explanation about the Prettier recommendation (extension vs. NPM module) (#50629)
* Better explanation about the Prettier recommendation (extension vs. NPM module)

* Contributing docs: Add side effect from using the Prettier extension
2019-11-18 16:03:55 +00:00
Chris Roberson
c739e2f50b
[Monitoring] Use a basic monitoring user for tests (#47865)
* Use a basic monitoring user for tests

* Rework this a little to fix the issue that the tests aren't working properly

* I think this is what we need to fix the tests

* Switch this order, since these tests cause a weird login loop in the current order
2019-11-18 11:00:40 -05:00
Chris Roberson
f92573ab57
[Monitoring] Gracefully handle issue with filebeat indices (#48929)
* Gracefully handle issue with filebeat indices

* Update translation keys

* Update link

* Add in default, per PR comment
2019-11-18 10:49:33 -05:00
Chris Roberson
66038f5cfd
[Monitoring] Improve permissions required around setup mode (#50421)
* Add error messages when setup mode is not enabled, disable it for users without the necessary permissions, and change one query to relax the privilege requirements

* Fix default value

* PR feedback

* Forgot to update this part

* Fix tests
2019-11-18 10:24:53 -05:00
Joe Portner
bde28957d9
Additional validation for elasticsearch username (#48247)
* Additional validation for elasticsearch username

If "elastic" user is set in config:
* In dev mode, throws an error
* In prod mode, logs a deprecation warning

* Fix user for functional tests

* Revert last two commits

Revert "Fix user for functional tests" and
"Fix user for plugin functional tests in Jenkinsfile"

* Change elasticsearch creds for test server

Now uses "kibana" user instead of "elastic" user

* Fix plugin API functional tests

* Fix PKI API integration test

* Change log messages, now conditional on `dist: false` not `dev: true`
2019-11-18 10:21:11 -05:00
patrykkopycinski
34c99cb1df
Revert changes to use_kibana_ui_setting (#50877) 2019-11-18 15:52:02 +01:00
James Gowdy
eb4c47ef0c
[ML] Injectables refactor (#50512)
* [ML] Injectables refactor

* removing unrelated files

* additional typescript conversion

* more typescript conversion

* adding some return types

* fixing eui errors

* typescripting license checks

* updated based on review

* fixing merge conflict error

* converting tests to jest

* fixing types
2019-11-18 14:36:07 +00:00
Mikhail Shustov
2166044671
remove outdated comment (#50895) 2019-11-18 14:41:15 +01:00
Marta Bondyra
0fa36f8394
Fix: pagination controls should not scroll horizontally for sa… (#50764) 2019-11-18 13:42:14 +01:00
Alexey Antonov
aed59d656b
[SIEM] Add SavedQuery in Timeline - cleanup (#50884) 2019-11-18 14:57:01 +03:00
Alexey Antonov
8f2e2af0e5
plugins/data - cleanup JEST: remove @kbn/expect (#50886) 2019-11-18 14:56:19 +03:00
Robert Oskamp
dca8c24edd
[ML] Add tests to create transforms (#49760) 2019-11-18 12:54:51 +01:00
James Gowdy
6bdcb23c33
[ML] Enabling lat_long detector function in advanced wizard (#50787)
* [ML] Enabling lat_long agg in advanced wizard

* fixing tests
2019-11-18 10:31:39 +00:00
Mikhail Shustov
583500e526
allows plugins to define validation schema for "enabled" flag (#50286)
* validation error message gives a hint about error source

* allows plugins to define validation schema for "enabled" flag
2019-11-18 10:25:21 +01:00
Robert Oskamp
39aeaaa19f
Add retry to find.existsByDisplayedByCssSelector (#48734)
This PR fixes timeout handling in `find.existsByDisplayedByCssSelector` for elements that are found but (not yet) displayed.
2019-11-18 09:37:31 +01:00
Ahmad Bamieh
d577d403e6
[i18n] integrate latest translations (#50864) 2019-11-17 17:52:23 +02:00
sainthkh
d7f2ebc308 ui/resize_checker 👉 src/plugins/kibana_utils (#44750)
* Moved ResizeChecker to kibana_utils.

* Removed ResizeChecker from __LEGACY.
2019-11-17 16:22:03 +02:00
patrykkopycinski
18e587fbfe Fix @reach/router types (#50863)
Merging to fix master build

* Fix @reach/router types

* Update renovate.json5
2019-11-17 14:08:49 +02:00
James Gowdy
429c28dffb
[ML] Adding ML node warning to overview and analytics pages (#50766) 2019-11-17 11:24:46 +00:00
patrykkopycinski
4c33f2a359
Bump storybook dependencies (#50752) 2019-11-16 20:40:06 +01:00
Dario Gieselaar
cae3a472c6
[APM Replace usage of idx with optional chaining (#50849)
Closes #50758
2019-11-16 18:56:37 +01:00
patrykkopycinski
ee7338e82d
[SIEM] Fix eslint errors (#49713) 2019-11-16 18:24:27 +01:00