Commit graph

10822 commits

Author SHA1 Message Date
Scotty Bollinger
137aadb830
[Enterprise Search] Upgrade to Kea 2.2-rc.4 (#76206)
* Add Kea 2.20.rc.3

* Remove Kea declarations

* Convert AppLogic files to use new syntax

- Utilizes MakeLogicType to type the logic file and remove bespoke typings
- Use object syntax for actions and reducers, instead of functions
- Add return types to actions in interface
- Remove interfaces from component (Kea does this automagically now)

- Also renamed IAppLogic* to IApp*

* Convert Workplace Search Overview files to use new syntax

- Utilizes MakeLogicType to type the logic file and remove bespoke typings
- Use object syntax for actions and reducers, instead of functions
- Add return types to actions in interface
- Remove interfaces from component (Kea does this automagically now)

- Also renamed mockLogic* to mockApp*

* Convert HttpLogic files to use new syntax

- Utilizes MakeLogicType to type the logic file and remove bespoke typings
- Use object syntax for actions and reducers, instead of functions
- Add return types to actions in interface
- Remove interfaces from component (Kea does this automagically now)

- Also renamed IHttpLogic* to IHttp*

* Convert FlashMessages files to use new syntax

- Utilizes MakeLogicType to type the logic file and remove bespoke typings
- Use object syntax for actions and reducers, instead of functions
- Add return types to actions in interface
- Remove interfaces from component (Kea does this automagically now)

* Remove hand-rolled Kea types

Bye-bye pretty code

* Upgrade to rc4 per author

From Kea author: “I’d suggest upgrading to rc.4 before merging though, as I seem to have committed some optional chaining operators ("?.") into the compiled JS output, which will cause errors if anyone is using an older browser. You can also wait for 2.2.0 final, but that might still be a week or more away…”

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-08-31 09:52:37 -05:00
Nathan L Smith
9b5912203f
Use platform history (#74328)
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
Co-authored-by: cauemarcondes <caue.marcondes@elastic.co>
2020-08-31 08:43:35 -05:00
Alison Goryachev
833d76442f
[Ingest pipelines] Tests for pipeline debugging enhancement (#75606) 2020-08-31 09:34:39 -04:00
Cauê Marcondes
647f397c50
[APM] Chart units don't update when toggling the chart legends (#74931)
* changing unit when legend is disabled

* changing unit when legend is disabled

* show individual units in the tooltip

* addressing PR comment

* increasing duration threshold

* change formatter based on available legends

* addressing PR comment

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-08-31 11:46:29 +02:00
Jean-Louis Leysens
aac57fb1a8
[ILM] Add support for frozen phase in UI (#75968)
* ILM public side changes to support frozen phase

This is a very faithful duplication of the cold phase. We are
also excluding the snapshot action as well as the unfollow action
as these are features that require higher than basic license
privilege.

* added "frozen" to the server side schema

* add frozen phases component

* fix i18n and update jest tests

* Slight restructuring to phase types and fix copy paste issues.

- also fixed TS error introduced after TS v4 upgrade (delete)

* fix hot phase type and remove type constraint from error messages

* update validation logic

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-08-31 11:45:57 +02:00
Stratoula Kalafateli
9ddd49a9f0
Hides advanced json for count metric (#74636)
* remove advanced json for count agg

* Remove only advanced json from count agg

* use Constant from data plugin

* add the logic to data plugin

* remove json arg from function definition

* remove unecessary translations

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-08-31 12:40:44 +03:00
Pierre Gayvallet
5f781dcfec
add client-side feature usage API (#75486)
* add client-side feature_usage API

* use route context for notify feature usage route
2020-08-31 08:44:27 +02:00
Nathan Reese
1e20cd4cf4
[Maps] add drilldown support map embeddable (#75598)
* [Maps] add drilldown support

* filter actions view

* use i18n getter

* remove unused changed

* tslint fixes

* more tslint changes

* clean-up and API doc changes

* update snapshots

* do not show first drilldown in tooltip

* add light grey line to seperate feature property rows

* Improving tooltip row styles (#36)

* Improving tooltip actions row styles

* Removind unecessary comment

* update snapshot and add functional test

* switch UiActionsActionDefinition to Action and remove unneeded checks

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
Co-authored-by: Elizabet Oliveira <elizabet.oliveira@elastic.co>
2020-08-28 11:04:24 -06:00
Constance
641a5ad77f
[Enterprise Search] Request handler refactors/enhancements + update existing routes to use shared handler (#76106)
* Refactor enterprise_search_request_handler to a class that stores config/log

- So that routes don't have to continuously pass it in - just params that actually change (paths, queries)

+ misc refactors/lint fixes from code review

* Update mocks/dependencies so other tests pass type checks

* Update /api/workplace_search/overview endpoint to use new request handler

* Update /api/app_search/engines route to use new handler

- This required updating the shared handler to accept custom params set by the route, since the engines route transmutes some param names
- createRequest mock also had to be updated to correctly reflect a curried function in order to get tests passing

* DRY out hasValidData to a reusable/cleaner call

* Update shared handler to output specific message for auth errors

- Check for /login URL (indicates auth issue)
- Refactor final catch return to allow being passed messages from previous throw
- Change hasValidData fallback to only log (potentially sensitive?) JSON data to server, not to client
- Minor test cleanup - move error tests to single describe block, minor URL/newline cleanup

* Update handler to pass method & body requests + pass back response code

- This will support future POST requests as well as support (e.g.) 404 responses

Minor test refactors:
- Set up new request defaults (method, empty body) + expected output & convert KibanaAuthHeader to string since they're set so close to one another
- group request pass tests into a describe block, remove response body portion of their tests (since we don't really care about that for those tests)
- group response tests into describe block
- clarify how passed handler params arg overrides request.params

* PR feedback: Update custom params arg to take an object instead of a query string
2020-08-28 08:38:23 -07:00
Robert Austin
3fc3f58c62
[Resolver] model location.search in redux (#76140)
Read location.search from the redux store instead of a hook so that the entire view has a single (synchronized) source of truth.

Also, no longer pass `pushToQueryParams` function to various components.
2020-08-28 08:53:04 -04:00
Cauê Marcondes
712c4bdde7
[APM] Prevent imports of public in server code (#75979)
* renaming test file

* removing eslint rule

* restructuring observability types

* refactoring fetchOptions type
2020-08-28 12:43:49 +02:00
spalger
86870d22b8 fix eslint issue 2020-08-27 23:02:57 -07:00
spalger
f078672c54 skip flaky suite (#76223) 2020-08-27 23:01:53 -07:00
Oliver Gupte
b1cb8b8c7f
[APM] Transaction duration anomaly alerting integration (#75719)
* Closes #72636. Adds alerting integration for APM transaction duration anomalies.

* Code review feedback

* Display alert summary with the selected anomaly severity label instead of the anomaly score.

* - refactored ALL_OPTION and NOT_DEFINED_OPTION to be shared from common/environment_filter_values
- utilize getEnvironmentLabel in the alerting trigger components and added support for the 'All' label

* refactor get_all_environments to minimize exports and be more consistent and clean

* - Reorg the alerts menu for different alert types (threshold/anomaly)
- default environment alert settings to the selected filter

* - Filters default transaction type to only those supported in the APM anomaly detection jobs
- Removes Service name and transaction type from the set of expressions in the alerting setup

* - remove bell icon from alerts menu

* Adds target service back into the anomaly alert setup as a ready-only expression

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-08-27 21:19:36 -07:00
Lisa Cawley
1b75690b73
[Transforms] Avoid using "Are you sure" (#75932) 2020-08-27 18:56:31 -07:00
Yara Tercero
69599e0b49
[Security Solution][Exceptions] - Fix bug of alerts not updating after closure from exceptions modal (#76145)
## Summary

Fixes bug found in 7.9.

**Current behavior:** 
  - Go to alerts page
  - Select action to add exception item
  - Select checkbox to close all alerts matching exception
  - Click `Add exception`
  - Note that the alerts table does not update until after you refresh or toggle between `Closed` and `Open` 

**New behavior:** 
  - Go to alerts page
  - Select action to add exception item
  - Select checkbox to close all alerts matching exception
  - Click `Add exception`
  - Note that the alerts table updates
2020-08-27 20:00:42 -04:00
Spencer
64311d306f
[plugin-helpers] improve 3rd party KP plugin support (#75019)
Co-authored-by: Tyler Smalley <tylersmalley@me.com>
Co-authored-by: spalger <spalger@users.noreply.github.com>
2020-08-27 14:56:48 -07:00
Michael Olorunnisola
280fb8b3ed
[Security_Solution][Resolver] Resolver loading and error state (#75600) 2020-08-27 14:42:21 -06:00
Chris Cressman
905c76242d
Fixes App Search documentation links (#76133)
Two links to App Search docs are pointing to outdated versions.

Update the URLs.
2020-08-27 16:11:18 -04:00
Mike Côté
50193eaabb
Fix alerts unable to create / update when the name has trailing whitepace(s) (#76079)
* Trim alert name in API key name

* Add API integration tests
2020-08-27 16:00:03 -04:00
Robert Austin
31507f82b6
[Resolver] Fix useSelector usage (#76129)
In some cases we have selectors returning thunks. The thunks need to be
called inside `useSelector` in order for a rerender to be reliably
triggered.

`useSelector` triggers a re-render if its return value changes. By calling the thunk inside of the selector passed to `useSelector`, we will trigger re-renders when needed.
2020-08-27 15:43:52 -04:00
Scotty Bollinger
ca94923900
[Enterprise Search] Migrate util and components from ent-search (#76051)
* Migrate useDidUpdateEffect hook

Migrates https://github.com/elastic/ent-search/blob/master/app/javascript/shared/utils/useDidUpdateEffect.ts with test added.

* Migrate TruncateContent component

* Migrate TableHeader component

* Remove unused deps

* Fix test name

* Remove custom type in favor of DependencyList

* Add stylesheet for truncated content

* Actually import stylesheet

🤦🏼‍♂️

* Replace legacy mixin

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-08-27 14:34:28 -05:00
Rashmi Kulkarni
e2e9d96df6
accessibility test for Painless lab (#75688)
* accessibility test for painless lab

* skipped a test due to aria-violation

* skipped tests due to aria-violation and added datatestsubj

* removed the unwanted import

* incorporate review comments

* feedback incorporated

* review comments incorporated

* removed unwanted expect
2020-08-27 12:15:47 -07:00
Constance
a7b0f7a102
[Enterprise Search] Add reusable FlashMessages helper (#75901)
* Set up basic shared FlashMessages & FlashMessagesLogic

* Add top-level FlashMessagesProvider and history listener

- This ensures that:
  - Our FlashMessagesLogic is a global state that persists throughout the entire app and only unmounts when the app itself does (allowing for persistent messages if needed)
  - history.listen enables the same behavior as previously, where flash messages would be cleared between page views

* Set up queued messages that appear on page nav/load

* [AS] Add FlashMessages component to Engines Overview

+ add Kea/Redux context/state to mountWithContext (in order for tests to pass)

* Fix missing type exports, replace previous IFlashMessagesProps

* [WS] Remove flashMessages state in OverviewLogic

- in favor of either connecting it or using FlashMessagesLogic directly in the future

* PR feedback: DRY out EUI callout color type def

* PR Feedback: make flashMessages method names more explicit

* PR Feedback: Shorter FlashMessagesLogic type names

* PR feedback: Typing

Co-authored-by: Byron Hulcher <byronhulcher@gmail.com>

Co-authored-by: Byron Hulcher <byronhulcher@gmail.com>
2020-08-27 12:03:20 -07:00
Quynh Nguyen
1bd8f41275
[ML] Add indicator if there are stopped partitions in categorization job wizard (#75709) 2020-08-27 13:50:15 -05:00
Joe Portner
c31acce649
Fix more broken usages of bulkCreate (#76005) 2020-08-27 13:54:09 -04:00
Brent Kimmel
ebfba81ba5
[Security Solution][Resolver] break/wrap for process detail (#76095)
* [Security Solution][Resolver]break/wrap for process detail

* add an enzyme test to check for the breakers
2020-08-27 13:25:01 -04:00
Nathan Reese
12f4f6d74a
[Maps] fix read only badge is no longer shown in nav for users with read-only permission (#76091) 2020-08-27 10:53:16 -06:00
Bhavya RM
d556c79481
Test user assignment to maps tests - 2 (#75890)
and removing unused data from fullscreen maps.js
2020-08-27 12:03:53 -04:00
Tim Sullivan
69a8d06129
[Reporting/Download CSV] Get the file name from savedSearch data (#76031)
* [Reporting/Download CSV] provide title even if panel \titles are hidden in the dashboard

* add functional test

* Update embeddable_panel.tsx

* Update download_csv.ts
2020-08-27 08:40:56 -07:00
Brandon Kobel
bf25e16a8b
Skip creating SpacesClient when not needed in auth interceptor (#75706)
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-08-27 08:23:07 -07:00
Zacqary Adam Xeper
b98e2e4f3d
[Metrics UI] Replace uses of any introduced by Lodash 4 (#75507)
Co-authored-by: Felix Stürmer <weltenwort@users.noreply.github.com>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-08-27 10:06:55 -05:00
Nathan Reese
b2939618f4
do not advance beneathMbLayerId if bottomMbLayer could not be found for a layer (#76007)
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-08-27 08:15:37 -06:00
Larry Gregory
54bbd6a910
Adds authenticaton_type as expected property on ES authentication response (#75808)
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-08-27 10:09:20 -04:00
Justin Kambic
d457d53001
[Uptime] Translate bare strings (#75918)
* Translate a bare string.

* Remove unneeded translation.
2020-08-27 09:02:32 -04:00
Jason Stoltzfus
f065191a75
[Enterprise Search] Added an App Search route for listing Credentials (#75487)
In addition to a route for listing Credentials, this also adds a
utility function which helps create API routes which simply proxy
the App Search API.

The reasoning for this is as follows;
1. Creating new routes takes less effort and cognitive load if we
can simply just create proxy routes that use the APIs as is.
2. It keeps the App Search API as the source of truth. All logic is
implemented in the underlying API.
3. It makes unit testing routes much simpler. We do not need to verify
any connectivity to the underlying App Search API, because that is
already tested as part of the utility.
2020-08-27 08:44:41 -04:00
Yulia Čech
b802af8002
[ILM] Fix json in request flyout (#75971)
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-08-27 14:15:59 +02:00
Sébastien Loix
ec1516064c
[Form lib] Correctly add field to form on component mount (#75796)
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-08-27 14:02:03 +02:00
Mikhail Shustov
37ec1e1053
Update to TS v4 (#73924)
* bump ts to v4

* MOAR RAM

* fix type errors for OSS

* first pass on x-pack errors

* second pass on x-pack type errors

* 3rd pass on x-pack type-errors

* mute errors if complex cases

* don't delete if spread suffices

* mute other complex cases

* make User fields optional

* fix optional types

* fix tests

* fix typings for time_range

* fix type errors in x-pack/tests

* rebuild kbn-pm

* remove leftovers from master update

* fix alert tests

* [Telemetry Checker] TS4 Fixes

* bump to 4.0.1-rc

* fix new errors in master

* bump typescript-eslint to version supporting TS v4 syntax

* fix merge commit errors

* update to the stable TS version 4.0.2

* bump ts-eslint to version supporting ts v4

* fix typo

* fix type errors after merge

* update ts in another new package.json

* TEMP: remove me

* Revert "TEMP: remove me"

This reverts commit dc0fc3bae6.

* [Telemetry] Update snapshot for new TS4 SyntaxKind

* bump prettier to support TS v4 syntax

* fix prettier rules

* last style change

* fix new type errors

Co-authored-by: Alejandro Fernández Haro <alejandro.haro@elastic.co>
2020-08-27 10:28:02 +02:00
Dima Arnautov
e488c087fc
[ML] fix tooltip content for scheduled events (#75973)
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-08-27 09:03:36 +02:00
Shahzad
a358c5768e
[Uptime] One click simple monitor down alert (#73835)
* WIP

* added anomaly alert

* update types

* update types

* update

* types

* types

* update ML part

* update ML part

* update ML part

* unnecessary change

* icon for disable

* update test

* update api

* update labels

* resolve conflicts

* fix types

* fix editing alert

* fix types

* added actions column

* added code to add alert

* update anomaly message

* added anomaly alert test

* update

* update type

* fix ml legacy scoped client

* update

* WIP

* fix conflict

* added aria label

* Added deleteion loading

* fix type

* update

* update tests

* update

* update type

* fix types

* WIP

* added enabled alerts section

* add data

* update

* update tests

* fix test

* update i18n

* update i18n

* update i18n

* fix

* update message

* update

* update

* update

* revert

* update types

* added component

* update test

* incorporate PR feedback

* fix focus

* update drawer

* handle edge case

* improve btn text

* improve btn text

* use switch instead of icons

* update snapshot

* use compressed form

* fix type

* update snapshot

* update snapshot

* update test

* update test

* PR feedback

* fix test and type

* remove delete action

* remove unnecessary function

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-08-27 07:02:28 +02:00
Brent Kimmel
42942327e5
[Security Solution][Resolver] Word-break long titles in related event… (#75926)
* [Security Solution][Resolver] Word-break long titles in related event description lists

* word-break long titles at non-word boundaries

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-08-26 21:06:38 -04:00
Rashmi Kulkarni
c08bf7f3ca
using test_user with minimum privileges for canvas functional ui tests (#75917)
* incorporating test_user wth specific roles for the canvas functional ui tests

* additional checks - removed comments

* changes to incorporate code comments

* lint check

* incorporate code reviews

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-08-26 17:21:16 -07:00
spalger
4289f9d8b1 skip all tests that rely on es authentication type 2020-08-26 16:15:09 -07:00
Yara Tercero
043382d686
[Security Solution][Exceptions] - Improve UX for missing exception list associated with rule (#76012)
## Summary

**Current behavior:**
  - **Scenario 1:** User is in the exceptions viewer flow, they select to edit an exception item, but the list the item is associated with has since been deleted (let's say by another user) - a user is able to open modal to edit exception item and on save, an error toaster shows but no information is given to the user to indicate the issue.
  - **Scenario 2:** User exports rules from space 'X' and imports into space 'Y'. The exception lists associated with their newly imported rules do not exist in space 'Y' - a user goes to add an exception item and gets a modal with an error, unable to add any exceptions. 
  - **Workaround:** current workaround exists only via API - user would need to remove the exception list from their rule via API

**New behavior:**
  - **Scenario 1:** User is still able to oped edit modal, but on save they see an error explaining that the associated exception list does not exist and prompts them to remove the exception list --> now they're able to add exceptions to their rule
  - **Scenario 2:** User navigates to exceptions after importing their rule, tries to add  exception, modal pops up with error informing them that they need to remove association to missing exception list, button prompts them to do so --> now can continue adding exceptions to rule
2020-08-26 18:46:15 -04:00
Wylie Conlon
8364d8d67a
[Lens] Decouple visualizations from specific operations (#75703)
* [Lens] Decouple visualizations from specific operations

* Remove unused mock
2020-08-26 18:27:40 -04:00
Devin W. Hurley
979d1dbca8
[Security Solution] [Detections] Updates rules routes to validate "from" param on rules (#76000)
* updates validation on 'from' param to prevent malformed datemath strings from being accepted

* fix imports

* copy paste is not my friend

* missed type check somehow

* forgot to mock common utils

* updates bodies for request validation tests
2020-08-26 18:18:39 -04:00
Scotty Bollinger
35b8d50ccd
[Enterprise Search] Adds app logic file to Workplace Search (#76009)
* Add new Workplace Search initial data properties

* Add app logic

* Refactor index to match App Search

Adds the easier-to-read ComponentConfigured and ComponentUnconfigured FCs with a ternary in the root compoenent

* Remove ‘Logic’ from interface names

* Extract initial data from WS into interface

This allows for breaking apart the app-specific data and also having an interface to extend in the app_logic file

* Destructuring FTW
2020-08-26 16:21:11 -05:00
Devon Thomson
fd39f094cc
Duplicate title warning wording (#75908)
Changed wording on duplicate title warning.
2020-08-26 17:19:30 -04:00
Davis Plumlee
deb71ecbb7
[Security Solution][Exceptions Modal] Switches modal header (#76016) 2020-08-26 17:13:38 -04:00