Commit graph

41388 commits

Author SHA1 Message Date
Joe Reuter 52a1ce1723
[Lens] Runtime field editor (#91882) 2021-03-18 08:21:39 +01:00
Joe Reuter 90e3013449
add mocks for Lens plugin (#94593)
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-03-18 08:18:59 +01:00
Xavier Mouligneau 051be90763
[SECURITY SOLUTIONS][Alerts Actions] Fix migration from 7.11.0/7.11.1 to 7.12 (#94722)
* do not modify connector with the right structure

* review trying to bring back incident to live when we can

* manage custom action

* fix cypress test

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-03-17 23:52:52 -04:00
Nicolas Chaulet 85d5f40d0c
[Fleet] Fix version on agent details screen (#94867) 2021-03-17 23:50:08 -04:00
John Schulz 34b6267893
Collapse two unenroll functions into one (#94848)
## Summary

Refactoring in progress towards https://github.com/elastic/kibana/issues/90437 

Collapse `forceUninstallAgents` into `uninstallAgents` into one function with an option. The pseudocode diff is

```diff
- function uninstallAgents() {
-   // filtering logic A
-   // side effects A
- }
- function forceUninstallAgents() {
-   // filtering logic A
-   // side effects B
- }

+ function uninstallAgents({ flag: boolean}) {
+   // filtering logic A
+   // if flag: side effects B
+   // else: side effects A
+ }
```

actually, there is [_one difference_](5564f25383 (diff-ecc3c625f2366949f1723e56b8477f6afb552ccfbcf3a71e0c28b2062fd05195)) in the filtering logic
 
### Checklist
- [x] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios
2021-03-17 23:46:03 -04:00
Constance f4da06349d
[Curation] Add promoted/hidden documents section & logic + Restore defaults button (#94769)
* Set up promoted & hidden documents logic

* Set up result utility for converting CurationResult to Result

* Set up AddResultButton in documents sections

- not hooked up to anything right now, but will be in the next PR

* Add HiddenDocuments section

* Add PromotedDocuments section w/ draggable results

* Update OrganicDocuments results with promote/hide actions

* Add the Restore Defaults button+logic

* PR feedback: key ID

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-03-17 20:01:50 -07:00
Aaron Caldwell ad18739de7
[Maps] Add endpoint to server for creating empty index & index pattern (#94028)
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-03-17 21:40:51 -04:00
John Dorlus 6df27f322f
Re-Enabling Grok Debugger Functional UI Tests (#91274)
* Adding .only clause for testing purposes.

* Removing .only and reenabling test. Also changing back to group 13.

* Removing .only and reenabling test. Also changing back to group 13.

* Removed comment mentioning github issue.

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-03-17 21:13:01 -04:00
spalger a4c41851e8 skip flaky suite (#93188) 2021-03-17 17:42:17 -07:00
Scotty Bollinger e1371b3d33
[Workplace Search] Fix confirm modal (#94844)
This PR addresses an issue where the confirmation modal when removing a content source connector was brokedn. The issue was that the component was not passed the props to render correctly
2021-03-17 19:55:35 -04:00
Christiane (Tina) Heiligers 28942df094
[core.logging] Deprecates legacy logging dest, json, verbosity and rotate configurations (#94238)
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-03-17 16:49:59 -07:00
Vadim Yakhin 1b65ea91e5
Remove custom styles (#94839)
* Replace custom margin style with EuiFlexGroup gutter

* Replace custom padding style with EuiFlexGroup gutter

* Remove custom wrapper around Loading on Overview page (alpha)

* Replace custom range value output with EuiRange's showInput prop

* Remove custom style

I'll refer the correct handling of this to design pass

* Remove "euiPanel--inset" className, as it doesn't do anything in Amsterdam theme

* Remove unused className `euiPanel--noShadow`

We're already using hasShadow={false} prop that does the same

* Remove `euiPanel--outline` className, as it doesn't do anything in Amsterdam theme

* Inline classNames declaration with the goal to remove them later

They don't do anything in Amsterdam theme, but I'm not removing them to keep context for design pass.

* Remove `eui-textNoWrap` className from buttons, as it's already included in button styles

* Remove classNames with no styles attached

* Replace custom padding in content_section with EuiSpacer

* Remove source-row styles

Most of the classNames were redundant and not needed anymore. The ones that were actually used were either replaced with EUI props or deleted, so we could apply EUI styles during design pass.

* Replace source_icon styles with EUI components and props

* Replace source-card icon styles with EUI prop

* Remove className declarations with no styles attached to classes

* Fix tests

* Increase space between source overview panels

* Use smaller icons on source prioritization and connectors pages

* Invert SourceIcon default size and size provided via props

The default size was "xxl", now it's "m". "m" size is default in EUI, so it's more consistent.

* Get rid of &nbsp; as horizontal spacer
2021-03-17 18:26:50 -04:00
Scotty Bollinger 74b604608a
[Workplace Search] Add conditional props for Gmail (#94855)
THis PR adds conditional query params that gmail sends when doing an oauth redirect.
2021-03-17 18:22:59 -04:00
spalger 3ec9a17e2e skip failing suite (#94854) 2021-03-17 14:16:12 -07:00
James Rodewig 631608e05e
[DOCS] Migrate ingest pipeline docs to ES reference (#94625) 2021-03-17 17:09:34 -04:00
Pierre Gayvallet 5669fac030
remove legacy doc links file (#94274)
* remove legacy doc links file

* remove entry from watch paths

* remove unused invalid link

* fix alerting.indexThreshold link

* fix more links

* update generated doc

* update generated doc
2021-03-17 22:05:02 +01:00
Spencer 6242c7ed4b
[kbn/optimizer] report timings when run from CLI or build (#94764)
Co-authored-by: spalger <spalger@users.noreply.github.com>
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-03-17 17:04:28 -04:00
Brandon Morelli 645545ebdf
[APM] docs: correlations feedback (#94750) 2021-03-17 13:02:49 -07:00
Tim Sullivan 0d1a1af57d
[Reporting/UI Settings] Validation for the Reporting UI Setting Custom Logo (#94746)
* Validation for the Reporting UI Setting Custom Logo

* add more validations

* check if image is too large

* fix i18n

* clean redundant

* large test strings not necessary

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-03-17 10:39:49 -07:00
Spencer 37ff43b0c3
[theme] default to v8 theme (#94370)
Co-authored-by: spalger <spalger@users.noreply.github.com>
2021-03-17 09:49:39 -07:00
Alison Goryachev 238610491b
[Component templates] Fix failing API test (#94831)
* fix failing component templates  test

* temporarily skip test
2021-03-17 09:21:02 -07:00
Melissa Alvarez e9627510fd
[ML] Data Frame Analytics creation: ensure job config validity persists when switching from/to form/editor (#94654)
* persisted validation form state  when switching from editor to form

* persist complete form state when switching from json editor
2021-03-17 12:14:45 -04:00
Tiago Costa 881b9a5246
chore(NA): disable preserve symlinks on tsconfig.json (#94775) 2021-03-17 09:03:01 -07:00
Peter Pisljar 4db72b96d4
kql, lucene and timerange functions (#93043) 2021-03-17 16:57:06 +01:00
Liza Katz 2ef7f3bd0c
use index patterns and search services for autocomplete (#92861)
* use index patterns and search services for autocomplete

* imports

* extend DataRequestHandlerContext

* Catch error if index patterns service can't be created.

* doc

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-03-17 17:16:01 +02:00
Lisa Cawley ff165507a7
[DOCS] Re-add glossary links (#94748) 2021-03-17 08:14:42 -07:00
Liza Katz e2f77240ba
Fix 89878 (#94793) 2021-03-17 17:02:21 +02:00
Christos Nasikas 78ac6f9713
[Cases] Add SIR connector in case connector schema (#94786) 2021-03-17 11:01:43 -04:00
Alejandro Fernández Haro f62a3153cd
Define schema for monitoring-sourced telemetry (#94434)
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-03-17 10:54:12 -04:00
James Rodewig 7cc9f01843
Update doc links for ingest pipelines app (#94742) 2021-03-17 10:14:42 -04:00
Anton Dosov 4ed09420ce
[QueryBar] a11y improvements, focus glitches fixes, unskip tests (#94148) 2021-03-17 15:02:37 +01:00
Tim Roes 34f8f62d4a
Cleanup advanced settings (#93437)
* Cleanup advanced settings

* Fix translations/telemetry settings

* Fix telemetry settings

* Fix discover api docs

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-03-17 14:44:55 +01:00
Marco Liberati 6479e410d7
[Lens] Expose ES errors in workspace (#94606)
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-03-17 14:26:43 +01:00
Joe Portner fc45b2007c
Fix invalid integration test data (#94616) 2021-03-17 08:56:07 -04:00
Pierre Gayvallet 25e586acd0
Migrate the optimizer mixin to core (#94272)
* migrate optimizer mixin to core apps

* fix core_app tests

* add integration tests, extract selectCompressedFile

* add CoreApp unit test

* more unit tests

* unit tests for bundle_route

* more unit tests

* remove /src/optimize/ from codeowners

* fix case

* NIT
2021-03-17 10:16:18 +01:00
Diana Derevyankina bdcd2ec859
Replace EuiCodeBlock with JsonCodeEditor in DiscoverGrid (#92442)
* Replace EuiCodeBlock with JsonCodeEditor in DiscoverGrid

* Add optional "hasLineNumbers" property to JsonCodeEditor and removed line numbers from the popover

* Update json_code_editor snapshot

* Add functional test for cell expanded content popover

* Remove unused code

* Fix geo point case and refactor some code

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-03-17 11:17:48 +03:00
Walter Rafelsberger 83c6bcc554
[ML] Anomaly Detection: Migrate validation messages links to use docLinks. (#94568)
- To make use of the docsLinks service which is only usable in client side code, Anomaly Detection's validation messages are not fully returned from the server anymore. Instead just the message ID and necessary metadata to parse the message template gets returned.
- getMessages() no longer uses inline hard coded documentation links but picks links from the docsLinks service.
- The code that rendered the messages originally on the server has been move to a function parseMessages() which can now be used on the client side and accepts the docsLinks services to get URLs to documentation from it.
- This means we no longer need to get the current version/branch information for the server side code.
- Tests have been updated to reflect the changes: API integration tests only check for the now reduced messages containing only message IDs and metadata. The expected results of the API integration tests are used as mocks for the client side function parseMessages(), this allows use to cover the same code and messages as previously.
2021-03-17 07:53:46 +01:00
Yara Tercero bbee40c819
[Lists][Exceptions] - Adding basic linting, i18n and storybook support (#94772)
### Summary

In preparation for moving all the exceptions UI components into the lists plugin adds some linting, adds the lists plugin to the i18n config and adds storybook support. Tried to add a bit stricter linting than exists in the security solution right now, rules that we've talked about wanting to enable.
2021-03-16 21:46:20 -04:00
John Schulz 044a94ac46
[Fleet] Add test/fix for invalid/missing ids in bulk agent reassign (#94632)
## Problem
While working on changes for bulk reassign https://github.com/elastic/kibana/issues/90437, I found that the server has a runtime error and returns a 500 if given an invalid or missing id.

<details><summary>server error stack trace</summary>

```
   │ proc [kibana] server    log   [12:21:48.953] [error][fleet][plugins] TypeError: Cannot read property 'policy_revision_idx' of undefined
   │ proc [kibana]     at map (/Users/jfsiii/work/kibana/x-pack/plugins/fleet/server/services/agents/helpers.ts:15:34)
   │ proc [kibana]     at Array.map (<anonymous>)
   │ proc [kibana]     at getAgents (/Users/jfsiii/work/kibana/x-pack/plugins/fleet/server/services/agents/crud.ts:191:32)
   │ proc [kibana]     at runMicrotasks (<anonymous>)
   │ proc [kibana]     at processTicksAndRejections (internal/process/task_queues.js:93:5)
   │ proc [kibana]     at Object.reassignAgents (/Users/jfsiii/work/kibana/x-pack/plugins/fleet/server/services/agents/reassign.ts:91:9)
   │ proc [kibana]     at postBulkAgentsReassignHandler (/Users/jfsiii/work/kibana/x-pack/plugins/fleet/server/routes/agent/handlers.ts:314:21)
   │ proc [kibana]     at Router.handle (/Users/jfsiii/work/kibana/src/core/server/http/router/router.ts:272:30)
   │ proc [kibana]     at handler (/Users/jfsiii/work/kibana/src/core/server/http/router/router.ts:227:11)
   │ proc [kibana]     at exports.Manager.execute (/Users/jfsiii/work/kibana/node_modules/@hapi/hapi/lib/toolkit.js:60:28)
   │ proc [kibana]     at Object.internals.handler (/Users/jfsiii/work/kibana/node_modules/@hapi/hapi/lib/handler.js:46:20)
   │ proc [kibana]     at exports.execute (/Users/jfsiii/work/kibana/node_modules/@hapi/hapi/lib/handler.js:31:20)
   │ proc [kibana]     at Request._lifecycle (/Users/jfsiii/work/kibana/node_modules/@hapi/hapi/lib/request.js:370:32)
   │ proc [kibana]     at Request._execute (/Users/jfsiii/work/kibana/node_modules/@hapi/hapi/lib/request.js:279:9)
```
</details>

<details><summary>see test added in this PR fail on master</summary>

```
1)    Fleet Endpoints
       reassign agent(s)
         bulk reassign agents
           should allow to reassign multiple agents by id -- some invalid:

      Error: expected 200 "OK", got 500 "Internal Server Error"
```
</details>

## Root cause
Debugging runtime error in `searchHitToAgent` found some TS type mismatches for the ES values being returned. Perhaps from one or more of the recent changes to ES client & Fleet Server. Based on `test:jest` and `test:ftr`, it appears the possible types are `GetResponse` or `SearchResponse`, instead of only an `ESSearchHit`.

https://github.com/elastic/kibana/pull/94632/files#diff-254d0f427979efc3b442f78762302eb28fb9c8857df68ea04f8d411e052f939cL11

While a `.search` result will include return matched values, a `.get` or `.mget` will return a row for each input and a `found: boolean`. e.g. `{ _id: "does-not-exist", found: false }`. The error occurs when [`searchHitToAgent`](1702cf98f0/x-pack/plugins/fleet/server/services/agents/helpers.ts (L11)) is run on a get miss instead of a search hit.

## PR Changes
* Added a test to ensure it doesn't fail if invalid or missing IDs are given
* Moved the `bulk_reassign` tests to their own test section
* Filter out any missing results before calling `searchHitToAgent`, to match current behavior
* Consolidate repeated arguments into and code for getting agents into single [function](https://github.com/elastic/kibana/pull/94632/files#diff-f7377ed9ad56eaa8ea188b64e957e771ccc7a7652fd1eaf44251c25b930f8448R70-R87):  and [TS type](https://github.com/elastic/kibana/pull/94632/files#diff-f7377ed9ad56eaa8ea188b64e957e771ccc7a7652fd1eaf44251c25b930f8448R61-R68)
* Rename some agent service functions to be more explicit (IMO) but behavior maintained. Same API names exported.

This moves toward the "one result (success or error) per given id" approach for https://github.com/elastic/kibana/issues/90437

### Checklist
- [x] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios
2021-03-16 20:51:57 -04:00
Steph Milovic c497239d55
[Security Solution] [Cases] Move create page components and dependencies to Cases (#94444) 2021-03-16 16:05:30 -06:00
Melissa Alvarez 769243cc98
[ML] Data Frame Analytics accessibility tests: fix flaky outlier creation test (#94735)
* ensure callouts exist before moving to continue button

* unskip ml accessibility suite
2021-03-16 17:49:24 -04:00
Frank Hassanabad 3afaebc49b
[Security Solutions] Remove commented out old linter rules (#94753)
## Summary

Cleanup .. 

* Removes commented out old linter rules from 2+ years ago. The project is very large and a lot of people are in the code base now and the comments are not relevant.
* Removes ts config optimize we don't use anymore
* Removes old script for rules we don't use anymore with elastic searches.
2021-03-16 17:40:09 -04:00
Scotty Bollinger 4aa7036d77
[App Search] Role mappings migration part 2 (#94461)
* Add engines mock and fix mock role mapping

The original asRoleMapping was merely for a smoke test in the shared component. Refactored to work better in App Search component

* Add RoleMappingsLogic

* Fix test description

Co-authored-by: Jason Stoltzfus <jastoltz24@gmail.com>

* Fix test description

Co-authored-by: Jason Stoltzfus <jastoltz24@gmail.com>

* Add flash messages when creating, updating or deleting

* Add path and resetState calls

Refactoring the tests showed me that some parts of the state weren’t being reset.

* Refactor handleAuthProviderChange logic

I some how got the test coverage at 100% with my wrong way of doing tests before (scary). When I fixed it I noticed that noting I could do would trigger the fallback of just returning the `[ANY_AUTH_PROVIDER]` array. After talking with Constance, we could not come up with a way to trigger it either, given the conditions.

She had suggested removing the first return statement but that caused an empty array being returned sometimes.

Ultimately, I was able to get it working and covered with these changes.

* Refactor tests per PR feedback

The places where `role: 'superuser’` was deleted in the listeners was a side effect of using `setRoleMappingData` and not `mount`

* Add back deleted assertion

* Copy nit

Co-authored-by: Constance <constancecchen@users.noreply.github.com>

Co-authored-by: Jason Stoltzfus <jastoltz24@gmail.com>
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Constance <constancecchen@users.noreply.github.com>
2021-03-16 17:06:21 -04:00
Brian Seeders 7e1f18f7f9
[CI] Update Backport action inputs to match updated ones (#94721) 2021-03-16 16:29:36 -04:00
Alejandro Fernández Haro eb21f53df6
[chore] Remove the infra team from CODEOWNERS (#94740) 2021-03-16 21:00:12 +01:00
Yuliia Naumenko 25baa3b558
[Connectors UI] Make UI use new connector APIs (#94180)
* [Connectors UI] Make UI use new connector APIs

* fixed tests

* fixed due to comment

* fixed due to comment

* fixed test

* fixed test

* fixed test

* moved rewrite_request_case to the common folder

* fixed due to comments
2021-03-16 12:59:46 -07:00
James Gowdy 4914acc0d1
[ML] Use indices options in anomaly detection job wizards (#91830)
* [ML] WIP Datafeed preview refactor

* adding indices options to ad job creation searches

* update datafeed preview schema

* updating types

* recalculating wizard time range on JSON edit save

* updating endpoint docs

* fixing types

* more type fixes

* fixing missing runtime fields

* using isPopulatedObject

* adding indices options schema

* fixing test

* fixing schema

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-03-16 19:54:56 +00:00
Jen Huang 2374af3011
Remove string as a valid registry var type value (#94174)
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-03-16 12:32:02 -07:00
Yuliia Naumenko 21587dc79e
[Alerts] Replaces legacy es client with the ElasticsearchClient for alerts and triggers_actions_ui plugins. (#93364)
* [Alerts] Replaces legasy es client with the ElasticsearchClient

* fixed build

* fixed build

* fixed ci build

* fixed ci build

* fixed infra callCLuster

* fixed infra callCLuster

* fixed infra callCLuster

* fixed ci build

* fixed ci build

* fixed ci build

* fixed infra tests

* fixed security tests

* fixed security tests

* fixed security tests

* fixed tests

* fixed monitoring unit tests

* fixed monitoring unit tests

* fixed type checks

* fixed type checks

* fixed type checks

* migrated lists plugin

* fixed type checks

* fixed tests

* fixed security tests

* fixed type checks

* fixed tests

* fixed type checks

* fixed tests

* fixed tests

* fixed tests

* fixed due to comments

* fixed tests

* fixed comment

* fixed tests

* fixed tests

* fixed searh

* fixed searh

* fixed test

* fixed due to comment

* fixed detections failing test and replaces scopedClusterClient exposure with IScopedClusterClient instead of ElasticsearchClient asCurrentUser

* fixed test

* fixed test

* fixed test

* fixed typecheck

* fixed typecheck

* fixed typecheck

* fixed merge
2021-03-16 12:03:24 -07:00
Tim Sullivan ec41ae3c49
[Reporting-CSV Export] Re-write CSV Export using SearchSource (#88303)
* [Reporting-CSV Export] Re-write CSV Export using SearchSource

* replace PIT solution with scan-and-scroll

* update tests

* cleanup

* simplify pr

* update docs

* update docs

* update telemetry schema

* use getSearchRequestBody instead of flatten

* Revert "update docs"

This reverts commit ab9f4d9642.

* optimize some async calls

* cleanup

* --wip-- [skip ci]

* fix telemetry schema

* fix telemetry tests

* fix snapshot

* api docs

* api doc updates

* use import type

* format the data through chains of maps

* add another saved search to reporting/ecommerce_kibana

* add a failing test

* add error logging to query failures

* put clear scroll in a finally so the ES error can be captured

* log dat error

* set dat fieldsFromSource

* --wip-- [skip ci]

* Revert "add another saved search to reporting/ecommerce_kibana"

This reverts commit 6edf26eff2.

* functional test fixes

* clean up ecommerce test archive

* add test for new search with fieldsFromSource set

* add tests and refactor tests

* cleanup redundant conditionals

* add GenerateCsv.getFields

* fix some tests

* fix double-escaping

* fix test snapshots and refactoring

* fix other tests

* fix test

* fix default index pattern in functional tests

* fix ts and sort fields when they come from API response

* --wip-- [skip ci]

* fix formatting and increase maxSizeBytes for testing

* remove client-side logic for sanitizing fields

* do not prepend timefield name if it already is a column

* test the logic to prepend timeField

* test the logic to sort the fields

* fix functional test

* preserve the error from data.search

* add functional test for ES returning an error

* fix snapshot

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-03-16 11:54:47 -07:00