Commit graph

492 commits

Author SHA1 Message Date
Nathan Reese 1cefc8eed0
[Maps] clean up uses of any in redux actions and kibana services (#79737)
* [Maps] clean up uses of any in redux actions and kibana services

* API doc changes and updated IndexPatternSelect type

* tslint errors in OSS code

* API updates

* remove IndexPatternSelectPublicProps and create IndexPatternSelectInternalProps instead

* include changes to index_pattern_select

* API updates

* remove savedObjectClient from IndexPatternSelectProps

* update types for lazy load component

* remove unused import

* export type

* another API clean-up

* revert changes to import in data/public/types

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2020-10-08 07:48:21 -06:00
Joe Portner 0a02ac1327
Rename namespaces to initialNamespaces for create operations (#79682) 2020-10-06 17:01:26 -04:00
Thomas Watson e31ec7eb54
Give user the option to log out if they encounter a 403 (#75538) 2020-10-06 20:40:28 +02:00
Luke Elmers 8ec5ce6861
[data.ui] Lazy load UI components in data plugin. (#78889) 2020-10-06 07:23:58 -06:00
Stratoula Kalafateli 08a4586b14
[Lens] Navigate from discover to lens (#77873)
* Create lens action and unregister the visualize one

* remove console

* Implement Discover to Lens, wip, missing tests

* Add unit tests

* fix embed lens to empty dashboard functional tests

* fix suggestions on save

* Fix bug on save button, query and filters should be transferred from discover

* Add functional test for the navigation from Discover to Lens

* PR update after code review

* unregister visualize action only if the action exists

* Change the test to not be flaky

* Move suggestions to editor frame and hide the emptyWorkspace for visualize field

* Update ui actions docs

* Add a retry to remove test flakiness

* Fix bug of infinite loader when removing the y axis dimension

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2020-10-06 11:15:41 +03:00
Joe Portner caa5da26f0
Add support for sharing saved objects to all spaces (#76132) 2020-10-04 23:28:49 -04:00
Ryland Herrick 7cfdeaeede
[Security Solution][Detections] EQL Validation (#77493)
* WIP: Adding new route for EQL Validation

This is mostly boilerplate with some rough parameter definitions; the
actual implementation of the validation is going to live in our
validateEql function.

A few tests are failing as the mocks haven't yet been implemented, I
need to see the shape of the responses first.

* Cherry-pick Marshall's EQL types

* Implements actual EQL validation

* Performs an EQL search
* filters out non-parsing errors, and returns what remains in the
  response
* Adds mocks for empty EQL responses (we don't yet have a need for
  mocked data, but we will when we unit-test validateEql)

* Adds validation calls to the EQL form input

* Adds EQL Validation response schema,mocks,tests
* Adds frontend function to call our validation endpoint
* Adds hook, useEqlValidation, to call the above function and return
  state
* Adds labels/help text for EQL Query bar
* EqlQueryBar consumes useEqlValidation and marks the field as invalid,
  but does not yet report errors.

* Do not call the validation API if query is not present

This causes a broader error that results in a 400 response; we can (and
do) handle the case of a blank query in the form itself.

* Remove EQL Help Text

It doesn't add any information for the user, and it currently looks bad
when combined with validation errors.

* Flesh out and use our popover for displaying validation errors

* Fixes issue where old errors were persisted after the user had made
  modifications

* Include verification_exception errors as validation errors

These include errors related to index fields and mappings.

* Generalize our validation helpers

We're concerned with validation errors; the source of those errors is an
implementation detail of these functions.

* Move error popover and EQL reference link to footer

This more closely resembles the new Eui Markdown editor, which places
errors and doc links in a footer.

* Fix jest tests following additional prop

* Add icon for EQL Rule card

* Fixes existing EqlQueryBar tests

These were broken by our use of useAppToasts and the EUI theme.

* Add unit tests around error rendering on EQL Query Bar

* Add tests for ErrorPopover

* Remove unused schema type

Decode doesn't do any additional processing, so we can use t.TypeOf here
(the default for buildRouteValidation).

* Remove duplicated header

* Use ignore parameter to prevent EQL validations from logging errors

Without `ignore: [400]` the ES client will log errors and then throw
them. We can catch the error, but the log is undesirable.

This updates the query to use the ignore parameter, along with updating
the validation logic to work with the updated response.

Adds some mocks and tests around these responses and helpers, since
these will exist independent of the validation implementation.

* Include mapping_exceptions during EQL query validation

These include errors for inaccessible indexes, which should be useful to
the rule writer in writing their EQL query.

* Display toast messages for non-validation messages

* fix type errors

This type was renamed.

* Do not request data in our validation request

By not having the cluster retrieve/send any data, this should saves us
a few CPU cycles.

* Move EQL validation to an async form validator

Rather than invoking a custom validation hook (useEqlValidation) at custom times (onBlur) in our EqlQueryBar
component, we can instead move this functionality to a form validation
function and have it be invoked automatically by our form when values
change. However, because we still need to handle the validation messages
slightly differently (place them in a popover as opposed to an
EuiFormRow), we also need custom error retrieval in the form of
getValidationResults.

After much pain, it was determined that the default behavior of
_.debounce does not work with async validator functions, as a debounced
call will not "wait" for the eventual invocation but will instead return
the most recently resolved value. This leads to stale validation
results and terrible UX, so I wrote a custom function (debounceAsync)
that behaves like we want/need; see tests for details.

* Invalidate our query field when index patterns change

Since EQL rules actually validate against the relevant indexes, changing
said indexes should invalidate/revalidate the query.

With the form lib, this is beautifully simple :)

* Set a min-height on our EQL textarea

* Remove unused prop from EqlQueryBar

Index corresponds to the value from the index field; now that our EQL
validation is performed by the form we have no need for it here.

* Update EQL overview link to point to elasticsearch docs

Adds an entry in our doclinks service, and uses that.

* Remove unused prop from stale tests

* Update docLinks documentation with new EQL link

* Fix bug where saved query rules had no type selected on Edit

* Wait for kibana requests to complete before moving between rule tabs

With our new async validation, a user can quickly navigate away from the
Definition tab before the validation has completed, resulting in the
form being invalidated. Any subsequent user actions cause the form to
correct itself, but until I can find a better solution here this really
just gives the validation time to complete and sidesteps the issue.
2020-10-02 13:19:02 -05:00
Pierre Gayvallet 4ee3677898
Add relative path handling to application.navigateToUrl (#78565)
* split application utilities and associated tests to distinct files

* do not match app if path does not start with the basePath

* add relative paths support to `navigateToUrl`

* add null-check error

* update generated doc

* nits on doc
2020-10-01 17:10:09 +02:00
Daniil Suleiman b692c374a2
Timelion visualization renderer (#78540)
* Update styles

* Implement toExpressionAst fn

* Implement renderer

* Update unit tests

* Add unit tests

* Update types

* Remove unused vars

* Fix types

* Update types

* Show error message when no data

* Update ExpressionRenderDefinition api

* Update renderer when there is no data

* Make options component lazy

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-10-01 17:08:12 +03:00
Peter Pisljar 90a6d2924e
Embeddables: basic documentation (#78900) 2020-09-30 21:19:06 +02:00
Peter Pisljar 991e0de226
ui_actions service initial docs (#78902) 2020-09-30 16:44:29 +02:00
Peter Pisljar 8e523edcd6
expression service docs (#78774) 2020-09-30 09:10:28 +02:00
Matthew Kime cdb922f2a2
Move indexPattern.popularizeField into discover (#77668)
Move indexPattern.popularizeField into discover
2020-09-29 20:02:21 -05:00
Luke Elmers ccb789dbdf
[data.search] Expose SearchSource on the server. (#78383) 2020-09-29 12:38:05 -06:00
Liza Katz 689e1e32f1
[Search] Error notification alignment (#77788)
* OSS error alignemnt

* Adjust error messages in xpack

* Add getErrorMessage

* Use showError in vizualize
Add original error to expression exception

* Cleanup

* ts, doc and i18n fixes

* Fix jest tests

* Fix functional test

* functional test

* ts

* Update functional tests

* Add unit tests to interceptor and timeout error

* expose toasts test function

* doc

* typos

* review 1

* Code review

* doc

* doc fix

* visualization type fix

* fix jest

* Fix xpack functional test

* fix xpack test

* code review

* delete debubg flag

* Update texts by @gchaps

* docs and ts

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-09-28 18:33:48 +03:00
Matthew Kime f0a5ec9877
Index pattern class - remove unused methods (#78538)
* remove unused methods
2020-09-28 09:08:21 -05:00
Liza Katz 0e1796acc5
[Search] Generic search request and response types (#78268)
* Improve search types to support EQL strategy

* doc

* Update types.ts

* update demo strategy

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-09-24 18:59:27 +03:00
Matthew Kime 441ebf65f7
make QueryStringInput props explicit (#78336) 2020-09-23 18:53:21 -05:00
Xavier Mouligneau 94a4e38053
[Security Solution] Options to select index patterns (#77192)
* init commit

* lots of cleanup

* starting on tests... problems

* Ready for review

* remove sample data

* remove comment and fix type

* pr changes

* fix type

* scratchy

* sourcerer in timeline

* sourcerer in timeline

* wip

* moving to redux

* working on types

* fixed

* more adjustments, tests fixed

* FF off

* pr ready

* renaming

* url state working, hoc not working

* url state working for timeline and default scope

* script to build fields for beat doc

* refactor sourcerer

* refactor host to useSourcerer

* refactor network to useSourcerer

* refactor overview  to useSourcerer

* refactor detections to useSourcerer

* wip for timelines to remove all useSource

* wip indexes timeline

* do component tests

* start container tests

* start container tests

* update selection widget of index patterns + remove last useWithSource

* add indexeNames in network kpi

* fix type errors

* fix type

* missing merge master

* get existing index from config file

* fixing broken tests

* add saving button to avoid to many queries to be aborted

* reducer timeline tests broke

* need to rewind

* much better

* timeline saving index names + clean up url state to only manage default

* more test fixing

* more test changes

* remove all the useWithSource + deprecated the graphql until we delete it in a new PR + delete all the beat doc

* default timeline to all index when creation + filter index patterns to make sure you do not add one who we do not know

* fix types

* test for stateful timeline render

* we should not have change that

* no chnages + snapshot

* fix test + bugs from review

* fix uncommon processes indexNames

* review III

* change design for main page of the sourcerer from design

* bug fixes when opening old timeline + implementation of new design

* fix circular deps

* remove unused attributes for event details

* design cleanup

* fix api integration test with the new search strategy

* add reset + manage accordion state

* fix bugs + types issues

* cleanup

* update docs

* review -> remove tooltip when popover is open

* cypress fixing

* fix for ml_condition_links and url_state cypress tests

* add cy wait for race condition in pagination tests

* missing plumbing kpi host

Co-authored-by: Steph Milovic <stephanie.milovic@elastic.co>
Co-authored-by: Patryk Kopycinski <contact@patrykkopycinski.com>
2020-09-23 15:49:52 -04:00
Liza Katz 82af937db9
Add response status helpers (#78006)
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-09-23 09:45:06 +03:00
Matthew Kime 9450248ebe
Index pattern - refactor constructor (#77791)
* index pattern - refactor constructor
2020-09-22 20:01:36 -05:00
Matthew Kime 533309dc2c
Remove [key: string]: any; from IIndexPattern (#77968)
* Remove [key: string]: any; from IIndexPattern
2020-09-22 18:03:22 -05:00
Joe Portner d666038c8f
Change saved objects client find to allow partial authorization (#77699) 2020-09-22 12:40:38 -04:00
Diana Derevyankina ed7a630710
[TSVB] Fields dropdowns are not populated if one of the indices is missing (#77363)
* Fields dropdowns are not populated if one of the indices is missing

* Fix tests and accept api changes

* Add indexPatternsService to get default index pattern

* Replace simple error message string with i18n translation

* Remove unnecessary displaying error code

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-09-22 11:13:18 +03:00
Brandon Kobel b4827ace27
Adding KibanaRequest#uuid (#76822)
* Adding KibanaRequest#uuid

* Adding tests

* Fixing test which was mocking uuid.v4() to get expected IDs

* Fixing another mock

* Updating docs

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-09-21 09:41:09 -07:00
Larry Gregory 9f3992f6c2
Grouped features for space management (#74151)
* Grouped features for space management

* Apply suggestions from code review

Co-authored-by: Joe Portner <5295965+jportner@users.noreply.github.com>

* Address PR Feedback

* docs changes

* updating types/docs

* update APM feature name

* Reintroduce extraAction following EUI update

* change ordering of infra features, and render callout for management category

Co-authored-by: Joe Portner <5295965+jportner@users.noreply.github.com>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-09-18 12:30:59 -04:00
Peter Pisljar e361035650
Embeddable telemetry and reference extraction/injection (#74352) 2020-09-18 17:43:00 +02:00
Josh Dover cbf2844d64
Migrate status & stats APIs to KP + remove legacy status lib (#76054)
* Complete migration of legacy status API

* PR comments

* Remove optional auth on stats endpoint

* Regen docs

* PR comments

* PR nits

* Set ReplaySubject buffer to 1

* Fix exclude_usage logic

Co-authored-by: pgayvallet <pierre.gayvallet@elastic.co>
2020-09-17 14:05:59 +02:00
Josh Dover 9b6edc5cd5
Allow legacy imports size respect savedObjects.maxImportPayloadBytes config (#77409) 2020-09-16 08:52:42 -06:00
Pierre Gayvallet ab92bbb726
Move core config service to kbn/config package (#76874)
* move deprecations and raw loader to package

* move config service to package

* start to adapt the usages

* adapt yet more usages

* update generated doc

* move logging types to `@kbn/logging`

* update generated doc

* add yarn.lock symlink

* merge @kbn-logging PR

* adapt Env.createDefault

* update generated doc

* remove mock exports from the main entrypoint to avoid importing it in production code

* use dynamic require to import `REPO_ROOT` from bootstrap file

* move logger mock to kbn-logging package

* address review comments

* import PublicMethodOf from kbn/utility-types

* fix import conflict

* update generated doc

* use the @kbn/std package

* update generated doc

* adapt plugin service mock
2020-09-16 09:17:05 +02:00
Luke Elmers e6d6751852
[data.search.SearchSource] Unify FetchHandler types & add onResponse/callMsearch. (#77430) 2020-09-15 08:05:19 -06:00
Pierre Gayvallet 043ef5e1d7
Create the @kbn/std package (#77329)
* move `src/core/utils` to the @kbn/std package

* update README

* update codeowners and add yarn lock file

* remove export from src/core/public and src/core/server and use package import instead

* update generated doc

* adapt forgotten import

* update `data` plugin doc
2020-09-15 15:21:05 +02:00
Michail Yasonik 61c4e6fd8d
Stacked headers and navigational search (#72331)
Co-authored-by: Poff Poffenberger <poffdeluxe@gmail.com>
Co-authored-by: Ryan Keairns <contactryank@gmail.com>
Co-authored-by: pgayvallet <pierre.gayvallet@elastic.co>
Co-authored-by: cchaos <caroline.horn@elastic.co>
2020-09-14 14:32:30 -05:00
Anton Dosov 4a45dad51f
[Drilldowns] Wire up new links to new docs (#77154)
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-09-14 12:58:22 +02:00
Lukas Olson b99d8af623
[Search] Remove long-running query pop-up (#75385)
* [Search] Remove long-running query pop-up

* Don't timeout if requestTimeout isn't configured

* Remove unused kibanaUtils

* Remove unused kibanaReact

* Re-add reference to kibanaUtils

* Remove unused translations and update documentation

* Add new x-pack advanced setting searchTimeout and use it in the EnhancedSearchInterceptor

* docs

* Re-add toast when queries time out

* Fix types

* Update error message with capabilities

* Update docs

* Update docs

* Move search server routes into a directory.

* Add internal/_msearch route.

* Remove legacy search API, rewrite default search strategy to use internal route.

* Remove legacy es_client code.

* Handle msearch options on server.

* Remove elasticsearch-browser dependency.

* Update generated docs.

* Rely on server timeout in OSS (?)
Use UI setting in xpack.

* Rename function

* Add features to dependencies

* Undefined check

* doc

* Code review fixes

* code review

* doc

* loading count

* simplify code review and fix jest tets

* type check

* Remove esShard from client

* cleanup request parameters from FE

* doc

* doc

* Align request parameters on server,
Remove leftover parameters from client
Shim responses for search and msearch routes

* docs
Stop using toSnakeCase
Updates jest tests

* add management docs

* docs

* Remove import

* Break circular dep + fix msearch test

* Remove deleted type

* Fix jest

* Bring toSnakeCase back

* docs

* fix jest

* Add new x-pack advanced setting searchTimeout and use it in the EnhancedSearchInterceptor

* docs

* Rely on server timeout in OSS (?)
Use UI setting in xpack.

* Rename function

* doc

* Remove esShard from client

* cleanup request parameters from FE

* doc

* doc

* Align request parameters on server,
Remove leftover parameters from client
Shim responses for search and msearch routes

* docs
Stop using toSnakeCase
Updates jest tests

* add management docs

* docs

* Remove import

* Break circular dep + fix msearch test

* Remove deleted type

* Fix jest

* Bring toSnakeCase back

* docs

* fix jest

* Fix merge

* Fix types

* Allow timeout to be undefined

* Fix jest test

* Upldate docs

* Fix msearch jest

* Merge correction

* docs

* Fix rollup search merge

* Fix merge

* Use i18n

Co-authored-by: Liza K <liza.katz@elastic.co>
Co-authored-by: Luke Elmers <luke.elmers@elastic.co>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-09-13 10:20:10 -07:00
Peter Pisljar 177d67e8bc
[Docs] some basic searchsource api docs (#77038) 2020-09-11 08:59:56 +02:00
Joe Portner 52d044c74a
Change saved object bulkUpdate to work across multiple namespaces (#75478) 2020-09-10 22:09:24 -04:00
Marta Bondyra 0c678ebada
[Lens] Filters aggregation (#75635) 2020-09-10 21:16:07 +02:00
Josh Dover a19484abe0
Add plugin status API - take 2 (#76732) 2020-09-09 18:08:48 -06:00
Josh Dover 9bc603e7d9
Move metrics to setup and add cgroup metrics (#76730) 2020-09-09 14:01:29 -06:00
Liza Katz 52c12eac32
[Search] Add a new advanced setting searchTimeout (#75728)
* Add new x-pack advanced setting searchTimeout and use it in the EnhancedSearchInterceptor

* docs

* Rely on server timeout in OSS (?)
Use UI setting in xpack.

* Rename function

* doc

* Remove esShard from client

* cleanup request parameters from FE

* doc

* doc

* Align request parameters on server,
Remove leftover parameters from client
Shim responses for search and msearch routes

* docs
Stop using toSnakeCase
Updates jest tests

* add management docs

* docs

* Remove import

* Break circular dep + fix msearch test

* Remove deleted type

* Fix jest

* Bring toSnakeCase back

* docs

* fix jest

* Fix merge

* Fix types

* Allow timeout to be undefined

* Fix jest test

* Upldate docs

* Fix msearch jest

* docs

* Fix rollup search merge

* docs

Co-authored-by: Lukas Olson <olson.lukas@gmail.com>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-09-09 10:06:45 +03:00
Shamin Meerankutty 194d0b0a3f
Convert map client routing files to TS (#76387)
* Converted maps_router and store operations files

* Converted files in map routes to typescript

* Removed an unwanted ts-expect-error

* Fixed the lint errors from jenkins

* Naming changes, type for mapStateJSON etc.

* More type fixes in map routes

* More type fixes in map routes

* Added back some removed props

* Added types to app state manager

* Autogenerated api documentation

* Type fixes

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-09-08 15:51:28 -06:00
Mikhail Shustov bcaffba12b
Remove legacy SavedObjects (#76852)
* remove legacy SO integration

* cleanup integration in the legacy platorm

* remove so schema

* update docs

* remove leftovers, update docs

* update docs after merge master
2020-09-08 22:01:31 +02:00
Matthew Kime 842bcf4560
Index pattern save => Index pattern service (#76706)
* Index pattern save => Index pattern service
2020-09-08 12:59:02 -05:00
Mikhail Shustov 2f1c0127e2
Deterministic output for doc types (#76890)
* disable incremental builds for public type generation.

They generate non-deterministic types https://github.com/microsoft/rushstack/issues/1958

* do not infer public types
2020-09-08 13:28:29 +02:00
Uladzislau Lasitsa 4788005227
Use Search API in Timelion (sync) (#75115)
* New Search API for timelion

* Using timeout from config

* Use only es strategy)

* Fixed remarks

* Fixed tests

* Fixed fixtures

* Fixed ci

* Fixed typecheck

* Fixed eslint

* Fixed remarks

* Fix changes

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-09-07 18:05:31 +03:00
Spencer 5b853b2326
Test reverting "Add plugin status API (#75819)" (#76707)
Co-authored-by: spalger <spalger@users.noreply.github.com>
2020-09-03 15:21:59 -07:00
Pierre Gayvallet e976bddf81
Remove legacy applications and legacy mode (#75987)
* remove legacy mode and legacy service

* fix tests

* remove txt file

* fix xpack code

* fix types

* remove legacy test

* fix integration tests

* remove legacy reference

* yet another legacy reference

* handle uptime app special case

* update generated doc

* address review comments

* remove legacy fields from ChromeNavLink

* few fixes

* remove legacy API from docTitle service

* ChromeNavLink.href is now mandatory

* update generated doc

* remove legacyMode leftovers

* remove ChromeNavLink.active

* update generated doc
2020-09-03 12:23:57 +02:00
Liza Katz 411048ae09
Replace FetchOptions with ISearchOptions (#76538)
* Replace FetchOptions with ISearchOptions and update usage

* Merge the client and server ISearchOption types into common

* docs
2020-09-03 12:30:31 +03:00
Matthew Kime ee2ceef9bb
Index Pattern class - remove toJSON and toString (#76246)
* remove toJSON

* remove toJSON, toString

* fix ml url

* Update actions_panel.tsx

* fix url

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-09-02 17:20:14 -05:00