Commit graph

724 commits

Author SHA1 Message Date
Zacqary Adam Xeper 0d8a4613e4
[Metrics UI] Support percentage format in threshold alerts (#72701)
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-08-20 13:22:04 -05:00
Alejandro Fernández Gómez 96118624de
[Logs UI] Add "View in machine learning" links in the anomaly explorer (#74555)
Co-authored-by: Felix Stürmer <weltenwort@users.noreply.github.com>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-08-19 18:07:33 +02:00
Alejandro Fernández Gómez cf65b6ba8c
Track "view in context" usage (#74752)
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-08-17 17:06:13 +02:00
Felix Stürmer 0f1128281e
[Logs UI] Remove apollo deps from log link-to routes (#74502)
This replaces the use of the old graphql-based `useSource` hook with the new plain JSON `useLogSource` hook.

It also fixes two more problems:

- A rendering problem with the source configuration loading screen and a `setState` race condition in the `useLogSource` hook.
- A non-backwards-compatible change of the `/link-to/:sourceId/logs` route in #61162.
2020-08-14 19:50:20 +02:00
Chris Cowan 1632391f35
[Metrics UI] Remove TSVB dependency from Metrics Explorer APIs (#74804)
* [Metrics UI] Remove TSVB dependency from Metrics Explorer APIs

* Update x-pack/plugins/infra/public/pages/metrics/metrics_explorer/components/chart_title.tsx

Co-authored-by: Zacqary Adam Xeper <Zacqary@users.noreply.github.com>

* Update x-pack/plugins/infra/server/lib/metrics/lib/calculate_bucket_size/calculate_auto.ts

Co-authored-by: Zacqary Adam Xeper <Zacqary@users.noreply.github.com>

* Update x-pack/plugins/infra/server/lib/metrics/lib/calculate_bucket_size/calculate_auto.ts

Co-authored-by: Zacqary Adam Xeper <Zacqary@users.noreply.github.com>

* Update x-pack/plugins/infra/server/lib/metrics/lib/convert_histogram_buckets_to_timeseries.ts

Co-authored-by: Zacqary Adam Xeper <Zacqary@users.noreply.github.com>

* Update x-pack/plugins/infra/server/lib/metrics/lib/convert_histogram_buckets_to_timeseries.ts

Co-authored-by: Zacqary Adam Xeper <Zacqary@users.noreply.github.com>

* Update x-pack/plugins/infra/server/routes/metrics_explorer/lib/find_interval_for_metrics.ts

Co-authored-by: Zacqary Adam Xeper <Zacqary@users.noreply.github.com>

* Fixing some names, changing some units

* Reverting TSVB calculate_auto; fixing names in infra

* Fixing translation names

* Fixing typo

Co-authored-by: Zacqary Adam Xeper <Zacqary@users.noreply.github.com>

Co-authored-by: Zacqary Adam Xeper <Zacqary@users.noreply.github.com>
2020-08-13 18:45:47 -07:00
Zacqary Adam Xeper cdc7d25561
[Metrics UI] Fix inventory footer misalignment (#74707) 2020-08-13 12:21:29 -05:00
Zacqary Adam Xeper 8095c7ba15
[Metrics UI] Add Jest tests for alert previews (#74890) 2020-08-13 09:32:14 -05:00
Kerry Gallagher 2e38f5a705
[Logs UI] Return 403s rather than 500s for ML privilege errors (#74506)
* Add ML privileges error checks to all routes
2020-08-12 15:22:00 +01:00
Zacqary Adam Xeper 8f15621cbd
[Metrics UI] Fix No Data preview pluralization (#74399)
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-08-10 14:35:44 -05:00
Felix Stürmer 152f41c3b0
[Logs UI] Replace deprecated getInjectedVar with NP spaces API (#74280)
* Replace getInjectedVar() with NP spaces API

* Fix typo in comment

* Fix typo in comment

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-08-06 15:18:49 +02:00
Zacqary Adam Xeper 0737241dec
[Metrics UI] Fix validating Metrics Explorer URL (#74311) 2020-08-05 13:13:22 -05:00
Mikhail Shustov 88c0631344
Update @typescript-eslint to ensure compatibility with TypeScript v3.9 (#74091)
* bump @typescript-eslint deps

* update rules

* fix errors in pacakges

* fix src/

* fix x-pack

* fix test

* fix typings

* fix examples

* allow _ as prefix and suffix

* roll back prefix and suffix changes

* add eslint-plugin-eslint-comments

* report unused rules

* remove unused eslint comments from tests

* remove unused eslint comments 2nd pass

* remove unused eslint comments from src/

* remove unused comments in x-pack

* use no-script-url and no-unsanitized/property for ts files

* remove unused eslint comments

* eui/href-or-on-click removed when not complained

* no import/* rules for ts files

* cleanup

* remove the unused eslint-disable

* rollback unnecessary changes

* allow underscore prefix & sufix in type name

* update docs

* fix type error in enterprise search plugin mocks

* rename platform hack __coreProvider --> _coreProvider

* rollback space removal in src/core/public/legacy/legacy_service.test.ts

* fix naming convention in APM
2020-08-05 17:32:19 +02:00
Alejandro Fernández 22d6f09d31
[Logs UI] Correct trial period duration in anomaly splash screen (#74249) 2020-08-05 11:19:41 +02:00
Kerry Gallagher 89dba39273
Handle modifier keys (#74237) 2020-08-04 17:13:32 +01:00
Zacqary Adam Xeper 47d6be3b7e
[Metrics UI] Fix pluralization in Alert Preview (#74160) 2020-08-03 18:36:01 -05:00
Alejandro Fernández 909c9826ff
[Metrics UI] Fix typo on view selector in metrics explorer (#74084) 2020-08-03 18:27:28 +02:00
Chris Cowan 2e37239e50
[Metrics UI] Fix Metrics Explorer TSVB link to use workaround pattern (#73986)
* [Metrics UI] Fix Metrics Explorer TSVB link to use workaround pattern

* Adding link to TSVB bug to comment
2020-07-31 13:20:11 -07:00
Zacqary Adam Xeper 5fa162c699
[Metrics UI] Fix all threshold alert conditions disappearing due to alert prefill (#73708)
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-07-30 22:39:34 -05:00
Zacqary Adam Xeper d3f498af9a
[Metrics UI] Fix alert previews of ungrouped alerts (#73735)
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-07-30 22:37:54 -05:00
Chris Cowan aa668db796
[Metrics UI] Fix alert management to open without refresh (#73739)
* [Metrics UI] Fix alert management to open without refresh

* removing unecessary code

* Deleting unused imports

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-07-30 19:01:46 -07:00
Zacqary Adam Xeper c2d8869cca
[Metrics UI] Fix previewing of No Data results (#73753) 2020-07-30 15:52:32 -05:00
Alejandro Fernández 8307642098
[Logs UI] Tweak logs query for the observability dashboard (#73710) 2020-07-30 14:41:47 +02:00
Zacqary Adam Xeper f8ba95f1fe
[Metrics UI] Fix evaluating rate-aggregated alerts when there's no normalized value (#73545)
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-07-29 13:05:19 -05:00
Zacqary Adam Xeper cbfdb36d9f
[Metrics UI] Fix formatting of values in inventory context.reason (#73155)
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-07-29 13:04:41 -05:00
Zacqary Adam Xeper e202a830d7
[Metrics UI] Fix No Data in Inventory alerts/Snapshot API (#72513)
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-07-29 11:07:41 -05:00
Chris Cowan 631c17c6f2
[Metrics UI] Fix hasData call to ensure it has data not just indices (#72969)
* [Metrics UI] Fix hasData call to ensure it has data not just indices

* Fixing formatting

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-07-29 06:56:25 -07:00
Phillip Burch 78aa24dbd6
Make button appear clickable, change state of empty text (#73496)
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-07-28 19:30:42 -05:00
Zacqary Adam Xeper 48bb7c79c4
[Metrics UI] Fix filterQuery on Inventory alert preview (#73329)
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-07-28 15:56:06 -05:00
Chris Cowan 2d8a41d367
[Metrics UI] Make composite size configurable to avoid max buckets (#72955)
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-07-28 12:39:36 -07:00
Felix Stürmer cdb1c0d9a4
[Logs UI] Check for presence of data instead of presence of indices in overview page fetchers (#73101)
This causes the "has data" check for the observability overview page to not only check for the presence of log indices but also of log entries.
2020-07-28 16:44:27 +02:00
Gidi Meir Morris f4104743e3
[Alerting] Control Alerts Management via feature controls & privileges (#72029)
This PR removes the alerting and actions ui privileges (alerting:show, actions:show, etc...) and instead relies on the standard Kibana feature control model to decide whether management displays the Alerts Management section under management.
2020-07-28 15:20:24 +01:00
Larry Gregory 09b11b61f0
Introduce reserved ml privilege for the apm_user role (#72266)
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-07-28 07:44:37 -04:00
Phillip Burch cc84ee3185
[Metrics UI] Saved views bugs (#72518)
* Add test for logs and metrics telemetry

* wait before you go

* Remove kubenetes

* Fix type check

* Add back kubernetes test

* Remove kubernetes

* Don't allow deleting default default view.

* Fix bug with duplicate loads of data.

Because the load data function takes options.source and the source of options can change, we need to remove it from deps

* Remove unused variable

* Reload when loadData function is changed

* Don't send the request immediately

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-07-27 21:28:39 -05:00
Felix Stürmer aa45ac89b0
[Logs UI] Return empty result sets instead of 500 or 404 for analysis results (#72824)
This changes the analysis results routes to return empty result sets with HTTP status code 200 instead of and inconsistent status codes 500 or 404.
2020-07-27 16:36:25 +02:00
Felix Stürmer ba55ca9e86
[Logs UI] Add missing ML capabilities checks (#72606)
This adds several missing Machine Learning capabilities checks to the UI to make sure the user doesn't run into downstream errors resulting from the lack of permissions. It also updates the messages of the permission prompt screens to refer to the new Kibana Machine Learning permissions instead of the old built-in roles.
2020-07-22 18:32:17 +02:00
Gidi Meir Morris 4abe864f10
Adds Role Based Access-Control to the Alerting & Action plugins based on Kibana Feature Controls (#67157)
This PR adds _Role Based Access-Control_ to the Alerting framework & Actions feature using  Kibana Feature Controls, addressing most of the Meta issue: https://github.com/elastic/kibana/issues/43994

This also closes https://github.com/elastic/kibana/issues/62438

This PR includes the following:

1. Adds `alerting` specific Security Actions (not to be confused with Alerting Actions) to the `security` plugin which allows us to assign alerting specific privileges to users of other plugins using the `features` plugin.
2. Removes the security wrapper from the savedObjectsClient in AlertsClient and instead plugs in the new AlertsAuthorization which performs the privilege checks on each api call made to the AlertsClient.
3. Adds privileges in each plugin that is already using the Alerting Framework which mirror (as closely as possible) the existing api-level tag-based privileges and plugs them into the AlertsClient.
4. Adds feature granted privileges arounds Actions (by relying on Saved Object privileges under the hood) and plugs them into the ActionsClient
5. Removes the legacy api-level tag-based privilege system from both the Alerts and Action HTTP APIs
2020-07-22 14:45:57 +01:00
Zacqary Adam Xeper 85d8ec8905
[Metrics UI] Fix Alert Preview Error design (#71005)
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-07-20 13:18:43 -05:00
Kerry Gallagher 11182c8ef7
Fix match phrase and not match phrase comparators (#71850)
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-07-20 15:51:22 +01:00
Felix Stürmer 44888d3536
[Logs UI] Fix display of dataset values in anomaly and category example rows (#71693)
This removes an unnecessary JSON encoding step of values before they are passed to the field column component used in the log entry example rows in both the Anomalies and Categories tabs.
2020-07-17 15:08:38 +02:00
Thomas Watson fc5bc6b6a2
Add @elastic/safer-lodash-set as an alternative to lodash.set (#67452) 2020-07-15 10:29:57 +02:00
James Gowdy a1e511a727
[ML] Changing all calls to ML endpoints to use internal user (#70487)
* [ML] Changing all calls to ML endpoints to use internal user

* updating alerting

* updating documentation

* [ML] Changing all calls to ML endpoints to use internal user

* updating alerting

* updating documentation

* fixing missed types

* adding authorization headers to endpoint calls

* correcting has privileges call

* updating security tests

* odd eslint error

* adding auth header to module setup

* fixing missing auth argument

* fixing delete DFA job permission checks

* removing debug test tag

* removing additional ml privilege checks

* adding authorization header to _evaluate

* updating alerting cluster client name

* code clean up

* changing authorizationHeader name

* updating alterting documentation

* fixing secondary credentials

* adding management links

* updating SIEM telemetry

* fixing merge conflicts

* granting access to index patterns

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-07-14 15:48:24 +01:00
Kerry Gallagher a91209c92f
[Logs UI] Anomalies page dataset filtering (#71110)
Adds dataset filtering to logs anomalies page
2020-07-14 15:26:22 +01:00
Alejandro Fernández d8204643fe
[Logs UI] Refine log entry row context button (#71260)
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-07-14 13:28:35 +02:00
Zacqary Adam Xeper 6c4fc9ca20
[Logs UI] Remove UUID from Alert Instances (#71340)
* [Logs UI] Remove UUID from Alert Instances

* Fix bad template string

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-07-14 11:55:05 +01:00
Zacqary Adam Xeper 5ef8d3f509
[Metrics UI] Remove UUID from Alert Instance IDs (#71335)
* [Metrics UI] Use alertId instead of uuid for alertInstanceIds
2020-07-14 11:54:29 +01:00
Cauê Marcondes 3374b2d3b0
[Observability] Change appLink passing the date range (#71259)
* changing apm appLink

* changing apm appLink

* removing title from api

* adding absolute and relative times

* addressing pr comments

* addressing pr comments

* addressing pr comments

* fixing TS issues

* addressing pr comments

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-07-14 11:05:48 +02:00
Felix Stürmer ff7b736cc3
[Logs UI] Show log analysis ML jobs in a list (#71132)
This modifies the ML job setup flyout of the anomalies tab to offer a list of the two available modules. Via the list each of the modules' jobs can be created or re-created.
2020-07-13 23:29:55 +02:00
Kerry Gallagher 4db5816459
[Logs UI] Add category anomalies to anomalies page (#70982)
* Add category anomalies to anomalies page

Co-authored-by: Felix Stürmer <weltenwort@users.noreply.github.com>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-07-13 18:09:10 +01:00
Phillip Burch 4bdd31e9c9
[Metrics + Logs UI] Add test for logs and metrics telemetry (#70858)
* Add test for logs and metrics telemetry

* wait before you go

* Remove kubenetes

* Fix type check

* Add back kubernetes test

* Remove kubernetes

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-07-13 08:57:42 -05:00
Zacqary Adam Xeper 66c531d903
[Metrics UI] Round metric threshold time buckets to nearest unit (#71172)
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-07-10 16:26:57 -05:00
Alejandro Fernández c00359ec96
[Logs UI] Limit extendDatemath to valid ranges (#71113)
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-07-10 11:55:56 +02:00
Spencer fa93a81ba6
[kbn/optimizer] implement "requiredBundles" property of KP plugins (#70911)
Co-authored-by: Josh Dover <me@joshdover.com>
Co-authored-by: spalger <spalger@users.noreply.github.com>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-07-09 18:43:17 -07:00
Cauê Marcondes 203fde92ac
Observability overview page (#69141)
* creating overview page and menu

* styling the home page

* adjusting breadcrumb

* renaming isnt working

* renaming isnt working

* renaming isnt working

* fixing import

* fixing scroll when resize window

* fixing eslint errors

* prepending links

* adding target option

* refactoring

* adding dark mode support

* fixing prettier format

* fixing i18n

* reverting some unnecessary changes

* addressing PR comments

* fixing functional tests

* ordering observability menu

* fixing tests

* addressing PR comments

* fixing scroll

* addressing pr comments

* addressing pr comments

* creating overview page

* mocking data

* mocking data

* refactoring

* crearting apm chart

* adding overview page

* adding metric charts

* adding charts

* changing mock data location

* adding mock registry

* adding date picker

* adding route validation

* adding io-ts

* adding io-ts

* adding io-ts support

* fixing imports and mock data

* adding app folder

* creating a section for each plugin

* adding stats

* adding domain min max

* refactoring xcoordinaters

* fixing route

* adding bucket size

* adding group property on logs

* adding home page

* dont break page if location  state is undefined

* each component fetches its own data

* Refactoring

* adding loading indicator to chart

* fixing uptime chart

* adding brush functionality to charts

* fixing refresh button and auto refresh function

* adding horizontal line to accordion section

* adding emptySection to dashboard page

* adding add data button

* adding resources section

* removing margins from horizontal rule

* changing min interval to 60s

* fixing empty section

* removing unnecessary code

* adding unit tests

* fixing imports

* adding initial story book for observability

* removeing uptime mock data

* fixing xDomain to show correct data on x-axis

* fixing empty state alignment

* adding story book and other improvements

* adding news component

* adding support to custom colors on EuiProgress and EuiStats

* removing infra mock data

* adding error message when api throwns an error

* adding alert section

* Adding alerts

* adding alert api call

* addressing PR comments

* adding storybook

* adding feedback button

* addressing PR comments

* chamging plugins return data

* fixing kibana app navigation

* fixing unit test

* fixing ts issues

* addressing PR comments

* using lodash truncate

* adding comment

* updating public documentation

* fixing alerts request

* fixing unit test

* fixing unit test

* aligin beta badge to the center

* adding moment duration to get the units as seconds

* addressing PR comments

* addressing PR comments
2020-07-08 21:52:16 +02:00
Chris Cowan 6e357988a2
[Metrics UI] Performance improvements for Observability Homepage (#70869) 2020-07-07 11:07:52 -07:00
Chris Cowan f946e8e2a9
[Metrics UI] Set includeTimeseries on Observability fetchData request (#70735)
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-07-07 09:47:45 -07:00
Alejandro Fernández e41692e0e7
[Logs UI] Process long running requests in logs overview (#70791) 2020-07-07 17:42:45 +02:00
Zacqary Adam Xeper 5e869b0e77
[Metrics UI] Display Too Many Buckets error when previewing Inventory Alerts (#70508)
* [Metrics UI] Display Too Many Buckets error when previewing Inventory Alerts

* Fix typecheck
2020-07-07 10:05:50 -05:00
Alejandro Fernández 21fc56ed10
[Logs UI] Actions menu in log entry categorization page (#69567) 2020-07-07 16:52:17 +02:00
Zacqary Adam Xeper 11cfe80020
[Metrics UI] Fix a bug in Metric Threshold query filter construction (#70672)
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-07-06 15:33:27 -05:00
Felix Stürmer 2399780d99
[Logs + Metrics UI] Add index names for the new indexing strategy (#70245)
This add support for the new index name patterns `logs-*` and `metrics-*` of the new indexing strategy to the Logs and Metrics UI source configurations in the form of a migration and changed defaults.
2020-07-06 17:37:28 +02:00
Alejandro Fernández b172b5b777
[Logs UI] move ML job setup UI to a flyout (#68366)
Co-authored-by: Felix Stürmer <weltenwort@users.noreply.github.com>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-07-06 17:04:23 +02:00
Kerry Gallagher 7ec48fd966
[Logs UI] Reorganise log rate anomaly table (#69516)
* Remove top level chart

Remove top level anomalies chart

* Refactor table columns to accomodate new formatting

* Tyical vs actual stats in expanded row

* Format message based on actual vs typical

* Start fleshing out log rate examples endpoint and lib methods

* Use the real document ID for expanded rows so React doesn't re-render content

* Add all data fetching resources for log entry rate examples

* Move log entry example and severity indicator components to a shared location

* Render examples for log rate

* Add severity indicator

* Styling tweaks

* Move horizontal button popover menu to a shared components so log rate table can use it

* Revert "Move horizontal button popover menu to a shared components so log rate table can use it"

This reverts commit f80db5984d.

* Add "view in stream" and "view in anomaly explorer" links

* Hook links into the new context menu component

* Add log column headers and add styling tweaks etc

* Fix translations

* Tweak comments

* Chart tweaks

* Update x-pack/plugins/infra/public/pages/logs/log_entry_rate/sections/anomalies/expanded_row.tsx

Co-authored-by: Felix Stürmer <weltenwort@users.noreply.github.com>

* PR amendments

- Pass href to context menu items
- Fix start and end times used for example logs
- Use "fewer" rather than "less"

* Update x-pack/plugins/infra/public/pages/logs/log_entry_rate/sections/anomalies/table.tsx

Co-authored-by: Felix Stürmer <weltenwort@users.noreply.github.com>

* Update x-pack/plugins/infra/public/pages/logs/log_entry_rate/sections/anomalies/log_entry_example.tsx

Co-authored-by: Felix Stürmer <weltenwort@users.noreply.github.com>

* Update x-pack/plugins/infra/public/pages/logs/log_entry_rate/sections/anomalies/log_entry_example.tsx

Co-authored-by: Felix Stürmer <weltenwort@users.noreply.github.com>

* Update x-pack/plugins/infra/public/pages/logs/log_entry_rate/sections/anomalies/table.tsx

Co-authored-by: Felix Stürmer <weltenwort@users.noreply.github.com>

* Update x-pack/plugins/infra/server/routes/log_analysis/results/log_entry_rate_examples.ts

Co-authored-by: Felix Stürmer <weltenwort@users.noreply.github.com>

* Update x-pack/plugins/infra/server/routes/log_analysis/results/log_entry_rate_examples.ts

Co-authored-by: Felix Stürmer <weltenwort@users.noreply.github.com>

* Update x-pack/plugins/infra/server/routes/log_analysis/results/log_entry_rate_examples.ts

Co-authored-by: Felix Stürmer <weltenwort@users.noreply.github.com>

* Update x-pack/plugins/infra/server/routes/log_analysis/results/log_entry_rate_examples.ts

Co-authored-by: Felix Stürmer <weltenwort@users.noreply.github.com>

* PR amendments

- Fix typechecking
- Add an empty log example column header to account for the context menu
- Add anomaly start time to rows

Co-authored-by: Felix Stürmer <weltenwort@users.noreply.github.com>
2020-07-03 16:57:59 +01:00
Alejandro Fernández f3573f3bfd
[Logs UI] Logs overview queries for the observability dashboard (#70413) 2020-07-03 16:59:02 +02:00
Tiago Costa 6c62c686cf
chore(NA): upgrade to lodash@4 (#69868)
* chore(NA): upgrade oss to lodash4

chore(NA): migrate cli, cli_plugin, cli_keystore,  dev, test_utils and apm src script to lodash4

chore(NA): missing file for cli plugin

chore(NA): add src core

chore(NA): es archiver and fixtures

chore(NA): try to fix functional test failure

chore(NA): migrate src/legacy entirely to lodash4 except src/legacy/core_plugins

chore(NA): move legacy core plugins to lodash4

chore(NA): upgrade optimize to lodash4

chore(NA): upgrade to lodash4 on advanced_settings, charts, console and dashboard

chore(NA): migrate to lodash4 on dev_tools, discover, embeddable, es_ui)shared, expressions, home plugins

chore(NA): upgrade data plugin to lodash4

chore(NA): upgrade usage_collection, ui_actions, tile_map, telemtry, share, saved_objects, saved_objects_management, region_map and navigation to lodash4

chore(NA): missing data upgrades to lodash4

Revert "chore(NA): upgrade usage_collection, ui_actions, tile_map, telemtry, share, saved_objects, saved_objects_management, region_map and navigation to lodash4"

This reverts commit 137055c5fed2fc52bb26547e0bc1ad2e3d4fe309.

Revert "Revert "chore(NA): upgrade usage_collection, ui_actions, tile_map, telemtry, share, saved_objects, saved_objects_management, region_map and navigation to lodash4""

This reverts commit f7e73688782998513d9fb6d7e8f0765e9beb28d1.

Revert "chore(NA): missing data upgrades to lodash4"

This reverts commit 92b85bf947a89bfc70cc4052738a6b2128ffb076.

Revert "chore(NA): upgrade data plugin to lodash4"

This reverts commit 88fdb075ee1e26c4ac979b6681d8a2b002df74c6.

chore(NA): upgrade idx_pattern_mgt, input_control_vis, inspector, kbn_legacy, kbn_react, kbn_usage_collections, kbn_utils, management and maps_legacy to lodash4

chore(NA): map src plugin data to lodash3

chore(NA): missing lodash.clonedeep dep

chore(NA): change packages kbn-config-schema deps

chore(NA): update renovate config

chore(NA): upgrade vis_type plugins to lodash4

chore(NA): move vis_type_vislib to lodash3

chore(NA): update visualizations and visualize to lodash4

chore(NA): remove lodash 3 types from src and move test to lodash4

chore(NA): move home, usage_collection and management to lodash 3

Revert "chore(NA): move home, usage_collection and management to lodash 3"

This reverts commit f86e8585f02d21550746569af54215b076a79a3d.

chore(NA): move kibana_legacy, saved_objects saved_objects_management into lodash3

chore(NA): update x-pack test to mock lodash4

Revert "chore(NA): move kibana_legacy, saved_objects saved_objects_management into lodash3"

This reverts commit 2d10fe450533e1b36db21d99cfae3ce996a244e0.

* chore(NA): move x-pack and packages to lodash 4

* chore(NA): remove mention to lodash from main package.json

* chore(NA): remove helper alias for lodash4 and make it the default lodash

* chore(NA): fix last failing types in the repo

* chore(NA): fix public api

* chore(NA): fix types for agg_row.tsx

* chore(NA): fix increment of optimizer modules in the rollup plugin

* chore(NA): migrate `src/core/public/http/fetch.ts` (#5)

* omit undefined query props

* just remove merge usage

* fix types

* chore(NA): fixes for feedback from apm team

* chore(NA): recover old behaviour on apm LoadingIndeicatorContext.tsx

* chore(NA): fixes for feedback from watson

* Platform lodash4 tweaks (#6)

* chore(NA): fix types and behaviour on src/core/server/elasticsearch/errors.ts

* Canvas fixes for lodash upgrade

* [APM] Adds unit test for APM service maps transform (#7)

* Adds a snapshot unit test for getConnections and rearranges some code to make testing easier

* reverts `ArrayList` back to `String[]` in the painless script within `fetch_service_paths_from_trace_ids.ts`

* chore(NA): update yarn.lock

* chore(NA): remove any and use a real type for alerts task runner

Co-authored-by: Gidi Meir Morris <github@gidi.io>

* chore(NA): used named import for triggers_actions_ui file

* chore(NA): fix eslint

* chore(NA): fix types

* Delete most uptime lodash references.

* Simplify. Clean up types.

* [Uptime] Delete most uptime lodash references (#8)

* Delete most uptime lodash references.

* Simplify. Clean up types.

* chore(NA): add eslint rule to avoid using lodash3

* chore(NA): apply changes on feedback from es-ui team

* fix some types (#9)

* Clean up some expressions types.

* chore(NA): missing ts-expect-error statements

* Upgrade lodash 4 vislib (#11)

* replace lodash 3 with lodash 4 on vislib plugin

* Further changes

* further replacement of lodash3 to 4

* further work on upgrading to lodash 4

* final changes to update lodash

* chore(NA): upgrade data plugin to lodash4

chore(NA): upgrade data plugin public to lodash4

chore(NA): fix typecheck task

chore(NA): fix agg_config with hasIn

chore(NA): assign to assignIn and has to hasIn

chore(NA): upgrade data plugin server to lodash4

chore(NA): new signature for core api

fix(NA): match behaviour between lodash3 and lodash4 for set in search_source

* chore(NA): remove lodash3 completely from the repo

* chore(NA): fix x-pack/test/api_integration/apis/metrics_ui/snapshot.ts missing content

* chore(NA): fix lodash usage on apm

* chore(NA): fix typecheck for maps

* Patch lodash template (#12)

* Applying changes from https://github.com/elastic/kibana/pull/64985

* Using isIterateeCall, because it seems less brittle

* Also patching `lodash/template` and `lodash/fp/template`

* Reorganizing some files...

* Revising comment

* Ends up `_` is a function also... I hate JavaScript

Co-authored-by: Pierre Gayvallet <pierre.gayvallet@gmail.com>
Co-authored-by: Josh Dover <me@joshdover.com>
Co-authored-by: Clint Andrew Hall <clint.hall@elastic.co>
Co-authored-by: Oliver Gupte <ogupte@users.noreply.github.com>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
Co-authored-by: Gidi Meir Morris <github@gidi.io>
Co-authored-by: Justin Kambic <justin.kambic@elastic.co>
Co-authored-by: Stratoula Kalafateli <stratoula1@gmail.com>
Co-authored-by: Luke Elmers <luke.elmers@elastic.co>
Co-authored-by: Brandon Kobel <brandon.kobel@gmail.com>
Co-authored-by: kobelb <brandon.kobel@elastic.co>
2020-07-03 01:30:13 +01:00
Spencer f5b280007f
[kbn/optimizer] only build specified themes (#70389)
Co-authored-by: spalger <spalger@users.noreply.github.com>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
Co-authored-by: cchaos <caroline.horn@elastic.co>
2020-07-02 15:06:32 -07:00
Chris Cowan a3e9f39aff
[Metrics UI] Register function for Observability homepage (#70529)
* [Metrics UI] Register function for Observability homepage

* Updating types; removing relative path from appLink

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-07-02 13:01:18 -07:00
Zacqary Adam Xeper 515b5dc66c
[Metrics UI] Fix asynchronicity and error handling in Snapshot API (#70503)
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-07-01 18:07:54 -05:00
James Gowdy eafd2af6aa
[ML] Adding capabilities checks to shared functions (#70069)
* [ML] Adding capabilities checks to shared functions

* small refactor

* disabling capabilities checks for functions called by SIEM alerting

* testing git

* removing comment

* using constant for ml app id

* tiny type clean up

* removing check in ml_capabilities

* fixing types

* removing capabilities checks from ml_capabilities endpoint

* updating types

* better error handling

* improving capabilities check

* adding custom errors

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-07-01 17:45:36 +01:00
Chris Cowan b7f33b94a8
[Metrics UI] Enhance Inventory View Tooltips (#69757)
* [Metrics UI] Enhance Inventory View Tooltips

* Fixing typos

* Removing toMetricOpt

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-07-01 09:45:21 -07:00
Felix Stürmer e70bc81998
[Logs UI] Avoid CCS-incompatible index name resolution (#70179)
This fixes #70048 by avoiding a CCS-incompatible ES API call when determining the existence of log indices.
2020-07-01 14:05:29 +02:00
Zacqary Adam Xeper 0047eeded6
[Metrics UI] Add context.reason and alertOnNoData to Inventory alerts (#70260) 2020-06-30 16:34:38 -05:00
Zacqary Adam Xeper c948e47714
[Metrics UI] Design updates for alert preview results (#69328)
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-06-30 13:00:15 -05:00
Zacqary Adam Xeper 0f78bc9ba5
[Metrics UI] Make alert instance IDs more useful (#70100)
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-06-30 12:59:19 -05:00
Jason Rhodes bb7bc782b2
[Logs and Metrics UI] Initial setup for registering observability overview data fetchers (#69999)
* Switches mount callbacks to only use start deps

Fixes #58014

* Sets up skeleton logs data fetchers for overview

* Fixes type hacks for logs fetcher

* Prevent kibana from crashing on initial load

* Fixes types and linting errors

* Fixes some linting import/export issues

Co-authored-by: Alejandro Fernández Gómez <alejandro.fernandez@elastic.co>
2020-06-30 13:56:35 -04:00
Kerry Gallagher ceb8595151
[Logs UI] [Alerting] "Group by" functionality (#68250)
- Add "group by" functionality to logs alerts
2020-06-30 10:28:54 +01:00
Phillip Burch 470397075f
[Metrics UI] UX improvements for saved views (#69910)
* Works-ish

* Load the default view without throwing error

* Design feedback

* Update Saved Views design on Metrics explorer

* Fix types

* UX improvements when saving and editng

* Only load default view if there is no state from anywhere else.

* Add loading indicator and other polish

* Hide saved view menu when opening modals

* Fix typecheck

* Fix typo

* Fix translations
2020-06-29 16:53:36 -05:00
Pierre Gayvallet fe1c508d8d
Move and rename legacy elasticsearch client (#69797)
* move last snapshot to inline

* move legacy files to legacy subfolder

* move request types out of legacy

* export Headers from http instead of elasticsearch

* renaming - first pass

* renaming - second pass

* fix core mocks

* adapt new calls

* update generated doc

* fix IT test mocks

* fix new usages
2020-06-29 17:43:31 +02:00
Ahmad Bamieh 266f853b0b
[Telemetry] Collector Schema (#64942)
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-06-27 02:52:26 +03:00
Chris Cowan 938733e862
[Metrics UI] Fix EuiTheme type issue (#69735)
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-06-26 12:55:36 -07:00
Zacqary Adam Xeper 3b9bbdb1a0
Fix uncaught typecheck merge conflict (#70001) 2020-06-25 15:03:09 -05:00
Zacqary Adam Xeper 71ea1a05c3
[Metrics UI] Prefill alerts from the global dropdown (#68967)
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-06-25 12:00:58 -05:00
Alejandro Fernández 14ac056be9
[Logs UI] Logs ui context menu (#69915) 2020-06-25 16:27:17 +02:00
Felix Stürmer 44d60c5fd2
[Logs UI] Access ML via the programmatic plugin API (#68905)
This modifies the routes related to log rate and category analysis to use the new programmatic APIs provided by the `ml` plugin to access the results index and job info. Because that access is facilitated via the request context, the log analysis lib was converted from classes to plain functions.

At the same time the routes have been updated to use the most recent validation and error handling patterns.
2020-06-25 15:06:27 +02:00
Alejandro Fernández f6c9ca20ed
[Logs UI] ML log integration splash screen (#69288)
Co-authored-by: Brandon Morelli <bmorelli25@gmail.com>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-06-25 10:18:32 +02:00
Mikhail Shustov 778136f3bf
expose DocLinks API from start only (#68745)
* exose DocLinks API from start only

* update docs

* fix type errors

* update docs

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-06-24 11:42:54 +02:00
Zacqary Adam Xeper 6a016d0b57
[Metrics UI] Add inventory alert preview (#68909)
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-06-23 18:34:17 -05:00
Kerry Gallagher 38a88e1019
Amend export used for default (#69158)
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-06-18 17:32:30 +01:00
Casper Hübertz f27162a213
[Observability] Creates "Add data" links in all Observability app headers (#69016)
* Add data options to all Observability app headers

* Updated failing snapshot

* [Uptime] Update snapshot

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-06-18 09:35:48 +02:00
Zacqary Adam Xeper 1b9ba5d0b0
[Metrics UI] Add preview feature for metric threshold alerts (#67684)
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-06-15 13:17:04 -05:00
Mikhail Shustov f593455a62
Bump TypeScript to v3.9 (#67666)
* add babel support for export type

* bump ts version to 3.9.3

* rebuild kbn-pm

* bump typescript-eslint

* fix error in security plugin UI

* check export as works

* fix app migration type

* use correct test subj attribute

* fix errors from the old PR

* embeddable is already passed in props

* explicitly define type of fetch

* add some types for viz

* fix fetch type p.2

* add null to allow spreading without type errors due to override

* add type guard to fix type error

* cast to any, since cannot assign unknown

* add timestamp to known types

* fix type error in fetch

* fix type error. id is always defined in attibutes

* declare a type

* move ts-ignore to the lines with errors

* declare tuple type explicitly

* mute type error. cannot assign unknown

* fix errors. id is always defined

* fix error type

* fix override errors. id is always defined

* fix error. extends any doesn't work anymore

* fix type error. type is always defined

* env doesn't always contain values

* fix type error

* cast to string

* add: logs is already declared in getNodeLogsUrl

* state is already  passed in props

* fix some errors in timelion

* number of fragments is always defined

* 'absolute' is not just string, but value

* TEMP: option is always defined

* always true if cast to promise manually

* both props are always defined

* explicitly define returned SO type

* workaround type

* bump tslib to be compatible with ts v3.9

* test private property

* rebuild kbn-pm

* Fix ts errors for beats management

* Fix type inference broken by the TS 3.9 upgrade

* Fix ingest manager saved object attributes typings

* Fix TS errors in cross_cluster_replication and index_management.

* Fix TS error in Watcher.

* roll back colorRange wrong type

* fix security plugin types

* TypeScript 3.9 fixes for APM

* Fix ColorRange types.

* fix actions & alerts errors. ByGidi

* fix lists error

* More APM fixes

* Remove paramaterization from `removeEmpty in agent config SettingsPage component (it's only used there and doesn't need to be parameterized.)
* Add option chain for case in registerTransactionDurationAlertType
* Cast `overallValue` in transform_metrics_chart
* Use more specific type for custom link filters
* Add more option chaining for local UI filters buckets response
* Remove unused parameters from routes
* Fix getProjection type parameter
* Use destructuring in serviceNodesLocalFiltersRoute to hide `never` error
* Revert `UnionToIntersection` change in `AggregationResponseMap`

Fixes #67804.

* fix platform type error

* Fix visualizations types.

* Fix data plugin types.

* bump TS version to 3.9.5

* Fix telemetry TS errors

* Fix dashboard code

* Adding Canvas Fixes for TS 3.9

* Fix case and security_solution types

* roll back to the old export syntax. new one might cause problems in api-extractor

* update docs

* Fix timelion code

* Fix meta

* Fix types

* fix type errors om ingest_manager

* bump babel deps

* enable private props & methods syntax

* update kbn-pm dist

* whitelist 0BSD license

* use @babel/plugin-proposal-private-methods in default set as well

* disable new babel plugins

* Revert "disable new babel plugins"

This reverts commit 04d959431d.

* cleanup security_solution types

* Fixes type error for newer TypeScript

* update docs

Co-authored-by: Nicolas Chaulet <nicolas.chaulet@elastic.co>
Co-authored-by: Felix Stürmer <stuermer@weltenwort.de>
Co-authored-by: CJ Cenizal <cj@cenizal.com>
Co-authored-by: Larry Gregory <larry.gregory@elastic.co>
Co-authored-by: Nathan L Smith <smith@nlsmith.com>
Co-authored-by: Walter Rafelsberger <walter@elastic.co>
Co-authored-by: Luke Elmers <luke.elmers@elastic.co>
Co-authored-by: Alejandro Fernández Haro <alejandro.haro@elastic.co>
Co-authored-by: Tim Roes <tim.roes@elastic.co>
Co-authored-by: Clint Andrew Hall <clint.hall@elastic.co>
Co-authored-by: Patryk Kopycinski <contact@patrykkopycinski.com>
Co-authored-by: FrankHassanabad <frank.hassanabad@elastic.co>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-06-11 10:04:09 +02:00
Chris Cowan 89a6007881
[Metrics UI] Fix Inventory View sorting by handling null values (#67889)
* [Metrics UI] Fix Inventory View sorting by handling null values

* Fixing situation where the id is not unique

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-06-10 17:19:31 -07:00
Chris Cowan 951114d66b
[Metrics UI] Fix fatal error when no data is available for Metric Threshold Alerts (#68678)
* [Metrics UI] Fix fatal error when no data is available for Metric
Threshold Alerts

* Adding i18n support for error message

* Adding test
2020-06-10 05:47:04 -07:00
Felix Stürmer 938771a537
[Logs + Metrics UI] Clean up async plugin initialization (#67654)
This refactors the browser-side plugin bootstrap code such that the eagerly loaded bundle `infra.plugin.js` is minimal and the rest of the logs and metrics app bundles are loaded only when the apps are visited.
2020-06-09 23:37:26 +02:00
Phillip Burch e591aa99d3
Add timestamp context variable (#67482)
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-06-08 17:16:01 -05:00
Alejandro Fernández e66eaf74fd
[Logs UI] View in context tweaks (#67777)
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-06-08 15:49:26 +02:00
Cauê Marcondes 07e3c9cb41
[Observability] Landing page for Observability (#67467)
* creating overview page and menu

* styling the home page

* adjusting breadcrumb

* renaming isnt working

* renaming isnt working

* renaming isnt working

* fixing import

* fixing scroll when resize window

* fixing eslint errors

* prepending links

* adding target option

* refactoring

* adding dark mode support

* fixing prettier format

* fixing i18n

* reverting some unnecessary changes

* addressing PR comments

* fixing functional tests

* ordering observability menu

* fixing tests

* addressing PR comments

* fixing test

* fixing scroll

* addressing pr comments

* addressing pr comments

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-06-08 09:07:35 +02:00
Robert Austin c98cfda890
upgrade eslint-plugin-react-hooks from 2.3.0 to 4.0.4 (#68295)
* updates `eslint-plugin-react-hooks` from `v2.3.0` to `v4.0.4`. 
* Disable rules on failing lines
2020-06-05 12:43:55 -04:00
Uladzislau Lasitsa b87eefc753
[uiSettings]: Migrate items owned by app arch to new platform (#66040)
* Migrated uiSettings items to new platform

* API changes

* Fixed translations

* Fixed comment and i18n

* Fixed tests

* Fixed internalization

* Fix karma tests

* made code more explicit

* Fixed plugin

* Added consts for ui settings ids.

* Added id for another settings

* Fixed tests.

* Improved imports

* Fix imports to public which were happening from the server.

* Fixed paths

* Moved styles to plugin.ts

* Moved styles

* Fixed docs

* Fix ci

* Fix ci

* fix documentation

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
Co-authored-by: Alexey Antonov <alexwizp@gmail.com>
Co-authored-by: Luke Elmers <luke.elmers@elastic.co>
2020-06-05 10:55:42 +03:00
Ashik Meerankutty 7027d5bad9
Add whitespace before add actions (#67835)
* Added empty string filter

* Changed operator in empty string filter

* Add space before add condition

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-06-05 03:06:12 -04:00
Chris Cowan 4fde7a69d4
[Metrics UI] Handle event.target properly for Legend Controls (#68029)
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-06-04 16:26:45 -07:00
Phillip Burch a4549a71ed
[Metrics UI] Add back context variables with descriptions (#67487)
* Add context variables for metric, value and threshold with descriptions

* Remove timestamp from this PR

* sentences are hard

* Fix lint rules

* Add more usage examples

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-06-04 15:56:54 -05:00
Chris Cowan 0b8e0c054f
[Metrics UI] Add overrides to Snapshot API to support alert previews (#68125)
* [Metrics UI] Add overrides to Snapshot API to support alert previews

* Renaming tests from infra to metrics_ui; renaming waffle to snapshot; adding tests for overrides

* removing limit and afterKey; removing extra interval

* Setting the minimum value for lookbackSize
2020-06-03 15:25:39 -07:00
Tiago Costa 20d60829b3
chore(NA): avoids imports of server or public code into common (#67231)
* chore(NA): avoids imports of server or public code into common

* chore(NA): fix imports from public or server into common

* chore(NA): fix typechecking for data plugin stubs

* chore(NA): fix types and tests related with licensing plugin

* chore(NA): fix problems on infra plugin

* chore(NA): fix typo on .eslintrc.js

Co-authored-by: Ryland Herrick <ryalnd@gmail.com>

* chore(NA): migrate to license mock usage on security plugin licensing module

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
Co-authored-by: Ryland Herrick <ryalnd@gmail.com>
2020-06-03 20:21:38 +01:00
Alexey Antonov d661d66faa
[New Platform Migration]: Management - Implement NP API (#66781)
* [New Platform Migration]: Management - Implement NP API

Part of #47432

* partial progress on a number of management sections

* fix passing history

* Fixed types

* Fixed routing for Ingest Node Pipelines

* introduce and use react router wrapped eui components

* react router utils

* work in progress => hashRouter to router

* more partial progress

* remove console.log

* use reactRouterNavigate for management_sidebar

* Breadcrumbs will need to make use of the reactRouterNavigate function

* [triggersActions] app. Hash Router -> Router

* Replace /app/kibana#/management urls to /app/management

* remove ui/public/management

* fix some links to management apps

* fix management url for functional tests

* add data-test-subj for EuiSideNavItem

* partial progress

* fix some of ts issues

* Fixed breadcrumbs for data index management

* [kibana/spaces] section

* fix functional test

* [role_management] fix Breadcrumbs

* [api_keys] fix Breadcrumbs and Navigation

* Fixed routing for remote cluster

* [role_mapping] Partial progress

* [users] partial progress

* [watcher] partial progress

* fix eslint issues

* [snapshot_restore] partial progress

* [rollup_jobs] partial progress

* Fixed routing for cross cluster replications (partial progress). Enhanced reactRouterNavigate

* Perf optimization: fix extra re-rendering

* fix TS errors

* x-pack fix config for functional tests

* Fixed routing for index lifecycle management

* fix some broken CI tests

* fix PR comment

* [snapshot_restore] move onClick into reactRouterNavigate

* fix some jest

* fix some functional tests

* fix functiona test: management  scripted fields testing regression for issue

* fix some functional tests

* [licence_management] partial progress

* Fixed x-pack jest tests

* [saved_object_management] partial progress

* Fixed some tests

* fix functional test: should add new role myroleEast

* Reverted part of changes for ml

* [transforms] partial progress

* fix TS errors

* fix functional:  redirects to Kibana home

* add support of Backward compatibility

* fix functional: Saved objects management feature controls saved objects management global visualize all privileges listing redirects to Kibana home

* fix PR comment

* fix TS issues

* Fixed x-pack jest tests

* fix oss JEST

* Fixed functional test

* fix functional test

* fix PR comment

* Fixed i18n

* fix typo

* fix Styles

* Fixed paths for cross_cluster_replication

* fix wrong link

* Fixed jest

* Fixed some comments

* fix sorting

* fix type check

* fixed x-pack jest

* fixed x-pack jest

* reverted using of parentHistory

* Add debugging toasts to CCR.

* Comment out non-CCR functional tests.

* Fix typo.

* Uncomment non-CCR functional tests.

* Enable CCR.

* fix CI

* Add comment to explain why CCR is enabled by default and move config variable back to original location in CCR plugin.

* revert some changes in APM

* add space between index pattern name and tags

* fix function test

* Update x-pack/plugins/security/public/management/management_urls.ts

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

* Update x-pack/plugins/security/public/management/api_keys/api_keys_management_app.tsx

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

* Update x-pack/plugins/spaces/public/management/spaces_management_app.tsx

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

* Update x-pack/plugins/security/public/management/roles/roles_management_app.tsx

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

* Update x-pack/plugins/security/public/management/users/users_management_app.tsx

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

* Update x-pack/plugins/security/public/management/management_urls.ts

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

* Update x-pack/plugins/security/public/management/management_urls.ts

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

* [security] getUrlForApp -> navigateToApp

* [mp] fix Uncaught (in promise) undefined

Co-authored-by: Matt Kime <matt@mattki.me>
Co-authored-by: Uladzislau Lasitsa <Uladzislau_Lasitsa@epam.com>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
Co-authored-by: CJ Cenizal <cj@cenizal.com>
Co-authored-by: Joe Portner <5295965+jportner@users.noreply.github.com>
2020-06-03 18:55:06 +03:00
Alejandro Fernández 77e7e0bb49
[Logs UI] Ensure live stream always gets latest entries (#67935)
LogPositionState doesn't always reevaluate the value of `endTimestamp`
when live stream is on. The [dependencies][1] for it to change rely on the
scroll position to update. If there's less than one scroll page or the
previous API call didn't return any entries, the `endTimestamp` would
not update.

We force `Date.now()` as an `endTimestamp` on the API call to ensure it
always gets the latest entries possible, regardless of the state. This
introduces some inconsistency that will be fixed once work beings on #65493.

[1]: fe4c164681/x-pack/plugins/infra/public/containers/logs/log_position/log_position_state.ts (L160-L173)
2020-06-02 17:36:47 +02:00
Yuliia Naumenko ce45dad8b6
Changed alerting API endpoints urls, bodies and params to follow Kibana STYLEGUIDE (#66838)
* Changed alerting API endpoints urls, bodies and params to follow Kibana STYLEGUIDE

* Changed alerting REST API to keep the pattern 'alerts/alert/{id}'

* fixed tests

* fixed tests

* Fixed jest tests

* Renamed plugin from alerting to alerts

* fixed tests

* fixed tests

* Fixed alert type check error

* Fixed find api

* fixed type checks

* fixed tests security issues

* Fixed view in app

* -

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-06-01 18:45:36 -07:00
Kerry Gallagher 6643b9c191
[Logs UI] [Alerting] Fix time state bug (#67630)
* Read from alertParams state only for timeSize and timeUnit

* Typecheck
2020-05-28 19:31:36 +01:00
Mikhail Shustov 4040c3090b
Mark elasticsearch client exposed via request context as deprecated (#67319)
* add legacy prefix for es client exposed via request handler context

* update src/plugins

* update core mocks and tests

* update test plugins

* update xpack plugins

* include x-pack/mocks.ts

* update after master merge

* update docs

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-05-27 19:00:16 +02:00
Alejandro Fernández b7e393dffb
[Logs UI] Avoid a crash when a highlight term doesn't exist (#67332) 2020-05-27 16:08:41 +02:00
Alejandro Fernández 909d4188f4
[Logs UI] Fix minimap tooltip (#67294) 2020-05-27 12:31:56 +02:00
restrry bf04235dae apply prettier styles 2020-05-22 09:08:58 +02:00
Chris Cowan 78db3eaffe
[Metrics UI] Allow users to configure Inventory View palettes (#66948) 2020-05-21 11:47:08 -07:00
Alejandro Fernández 7f88453242
[Logs UI] Restore call to UsageCollector.countLogs (#67051) 2020-05-20 13:27:34 +02:00
Chris Cowan 59ae529322
[Metrics UI] Add support for multiple groupings to Metrics Explorer (and Alerts) (#66503)
* [Metrics UI] Adding support for multiple groupings to Metrics Explorer

* Adding keys to title parts

* removing commented line

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-05-19 14:42:49 -07:00
Chris Cowan a7c2db73c5
[Metrics UI] Add sorting for name and value to Inventory View (#66644)
* [Metrics UI] Add sorting for name and value to Inventory View

* Fixing saved views

* Fixing overlooked i18n translations

* Fixing type issue

* Fixing i18n paths

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-05-19 12:06:07 -07:00
Chris Cowan 89402acfae
[Metrics UI] Change Metric Threshold Alert charts to use bar charts (#66672)
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-05-19 12:05:39 -07:00
CJ Cenizal bfdeb10c15
Reorganize Management apps into Ingest, Data, Alerts and Insights, Security, Kibana, and Stack groups (#65796) 2020-05-15 16:11:27 -07:00
Rudolf Meijering 795483d9b5
Don't bootstrap core type emits (#66377) 2020-05-15 11:03:46 +02:00
Zacqary Adam Xeper 6b6242a278
[Metrics UI] Fix default metric alert interval for new conditions (#66610) 2020-05-14 18:49:10 -05:00
Phillip Burch d3206cd475
[Metrics UI] Fix alignment and allow clearing metric value (#66589)
* Fix alignment and allow clearing metric value

* Add rds latency formatter

* Simplify css

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-05-14 18:34:50 -05:00
Felix Stürmer e6ef168181
[Logs UI] Validate ML job setup time ranges (#66426)
This adds validation for the time range selection in the log rate and categories setup screens.
2020-05-14 23:26:46 +02:00
Chris Cowan 2b47605255
[Metrics UI] Fixing chart label for ungrouped alerts (#66444) 2020-05-13 12:38:18 -07:00
Chris Cowan 9ab0ad16ef
[Metrics UI] Fix validation for threshold values (#66281)
* [Metrics UI] Fix validation for threshold values

* removing unused dependency

* cleaning up a bit

* Fixing validation to set error message per threshold

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-05-13 12:36:33 -07:00
Joe Reuter b7e87c2c8b
Switch to core application service (#63443) 2020-05-13 09:19:24 +02:00
Yuliia Naumenko 5ed5fda832
Allow registered alert types to be non-editable (#65606)
* Allow registered alert types to be non-editable

* Fixed isUiEditEnabled values

* Fixed due to comments

* fixed failing tests

* Enable alert type selection per alert consumer, only 'alerting' consumer can display other consumers alert types, but in case if it isEditable

* fixed tests

* Removed consumer property from the client side alert type registry and added server side property producer which purpose is to manage a feature logic

* fixed type check

* Fixed tests and type checks

* Removed error message for non registered plugins

* Fixed failing tests

* Fixed due to comments

* fixed test

* -

* revert logic for requiresAppContext

* Added close toast after saving alert
2020-05-12 13:38:22 -07:00
Felix Stürmer 807803c2dc
[Metrics UI] Fix mistake in container ip field name (#66198)
This corrects an apparent mistake in the inventory's container.ip_address field name.
2020-05-12 18:50:26 +02:00
Chris Cowan 9919dff004
[Metrics UI] Fix chart time range and percentile thresholds (#66128) 2020-05-12 08:27:50 -07:00
Chris Cowan 712e917f5e
[Metrics UI] Fixing time picker layout issues on Inventory View (#66094)
* [Metrics UI] Fixing time picker layout issues on Inventory View

* Adding data-test-subj
2020-05-12 08:27:22 -07:00
Phillip Burch 6d95b68c72
Cleanup prefill and edit flow. (#66105) 2020-05-11 19:08:02 -05:00
Zacqary Adam Xeper e2d945ff0b
[Metrics UI] Add framework for recovery messaging to metric threshold alerts (non-functional) (#65339) 2020-05-11 14:04:57 -05:00
Jason Rhodes 0ae5e24d01
Initializes alert form with existing values (for editing) (#65926) 2020-05-11 09:56:37 -04:00
Chris Cowan 1c6e6cb7b7
[Metrics UI] Fix p95/p99 charts and alerting error (#65579)
* [Metrics UI] Fix p95/p99 charts and alerting error

- Fixes #65561

* Fixing open in visualize for percentiles

* Adding test for P95; refactoring to use first consitently
2020-05-08 10:55:43 -07:00
Chris Cowan df0f0c341f
[Metrics UI] Fix isAbove to only display when threshold set (#65540) 2020-05-07 11:49:27 -07:00
Felix Stürmer 8a8647ab95
[Logs + Metrics UI] Prevent component errors from breaking the whole UI (#65456) 2020-05-07 11:33:50 +02:00
Alejandro Fernández f53b147097
[Logs UI] Disable search bar when live stream is on. (#65491) 2020-05-07 11:15:47 +02:00
Alejandro Fernández 8581ba8c38
[Logs UI] Add tests to the log alert executor (#64881) 2020-05-06 17:37:30 +02:00
Michail Yasonik 35e10273d3
New nav (#64018)
Notably, also removes aria-hidden from many visualizations
2020-05-05 23:14:14 -05:00
Spencer ee270c7c3f
disallow external imports to src/core/utils (#64852) 2020-05-05 14:56:22 -07:00
Zacqary Adam Xeper a467fe5ffd
[Metrics UI] Debounce onChange in alert creation UI (#65167) 2020-05-05 13:57:25 -05:00
Chris Cowan 7d5aa80976
[Metrics UI] Migrating Docker network fields (#65133) 2020-05-05 11:34:19 -07:00
Chris Cowan 0b202dc5dd
[Metrics UI] Add 99th and 95th percentiles to Metric Explorer (#64699)
* [Metrics UI] Add 99th and 95th percentiles to Metric Exploer Aggregations

* Removing unused dependency; fixing types
2020-05-05 09:40:34 -07:00
Zacqary Adam Xeper add56be7d6
[Metrics UI] Require filterQuery to be ES JSON (#64937) 2020-05-05 10:33:41 -05:00
Jason Rhodes 9be4ec049b
Removes legacy infra plugin and moves saved objects registration to NP (#64848)
* Removes legacy infra plugin and moves saved objects to NP

* Removes unnecessary legacy getLibs method

* Reverts saved objects to "single" namespace mode
2020-05-05 11:05:02 -04:00
Yuliia Naumenko 2f8906926b
Added support for docLinks plugin in Connectors forms and missing save capabilities for modal dialog (#64986)
* Added support for docLinks plugin in Connectors forms and missing save capabilities for modal dialog

* Fixed tests

* Extended alert context with application capabilities

* Fixed due to comments

* Fixed typecheck

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-05-05 07:52:45 -07:00
Chris Cowan 8adc272f0c
[Metrics UI] Remove APM Hard Dependency (#64952)
* [Metrics UI] Remove APM Hard Dependency

* removing unused variable

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-05-05 05:31:19 -07:00
Dmitry Lemeshko 43205ec8c7
[functional/page_objects] wait for infra ops page is loaded (#65050)
* [functional/page_objects] wait for infra ops page is loaded

* put waiting in PO method
2020-05-05 11:47:55 +03:00
Marco Vettorello 2d4dc801c3
Update dependency @elastic/charts to v19.1.2 (#64759)
* build: upgrade @elastic/charts to 19.0.0

* refactor: onBrushEnd breaking changes

* fix: missing onBrushEnd argument changes

* fix: update ech to 19.1.1

* fix: lens onBrushEnd breaking changes

* update to 19.1.2
2020-05-04 18:42:58 -05:00
Kerry Gallagher 5bcf2c8b89
[Logs UI] [Alerting] Alerts management page enhancements (#64654)
* Ensure adding / editing log alerts works from the alerts management page
2020-05-04 13:03:54 +01:00
Alejandro Fernández 4c57ebb7cc
[Logs UI] Tweak copy in log alerts dialog (#64645) 2020-05-04 13:37:54 +02:00
Felix Stürmer 39e31d6123
[Logs UI] Add dataset filter to ML module setup screen (#64470)
This adds the ability to filter the datasets to be processed by the ML jobs on the setup screen.
2020-05-04 13:29:28 +02:00
Phillip Burch 3cef8e6f30
[Metrics UI] Add inventory metric threshold alerts (#64292)
* Add new inventory metric threshold alert

* Add missed file

* Fix some types

* Convert units on client and executor.

* Move formatters to common. Properly format metrics in alert messages

* Style changes

* Remove unused files

* fix test

* Update create

* Fix signature

* Remove old test. Remove unecessary import

* Pass in filter when clicking create alert from context menu

* Fix filtering

* Fix more types

* Fix tests

* Fix merge

* Fix merge

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-04-30 16:53:56 -05:00
Oliver Gupte 16ba937bae
[APM] Client new platform migration (#64046)
* migrate files from legacy path to new plugin path

* update file paths to reflect migrated files

* move minimal legacy client files back to legacy path in order to run kibana

* Completes the full cutover to the new kibana platform removing all shims and legacy adapters.

* Adds APM to ignored list for casing check.

* - moves public/utils/pickKeys.ts to common/utils/pick_keys.ts
- exposes getTraceUrl as a plugin static export of apm/public and updates import in infra
- fixes FeaturesPluginSetup import in apm/public app
- renames get_apm_index_pattern_titles -> get_apm_index_pattern_title
- getApmIndexPatternTitle is now a synchronous getter function
- removes unused comments and xpack.apm.apmForESDescription i18n translations

* Moves automatic index pattern saved object creation from
plugin start to when the Home screen first renders

* removed unnecessary legacy css imports

* fixed ci issues by:
- moving readOnly badge, and help extension setup to occure only
  when apm app is mounted
- registering saved object types
- also moved createStaticIndexPattern from a react useEffect on the
  APM home screen to when the app is mounted
2020-04-30 13:08:50 -07:00
Chris Cowan 0399f70050
[Metrics UI] Add Charts to Alert Conditions (#64384)
* [Metrics UI] Add Charts to Alert Conditions

- Reorganize files under public/alerting
- Change Metrics Explorer API to force interval
- Add charts to expression rows
- Allow expression rows to be collapsable
- Adding sum aggregation to Metrics Explorer for parity

* Adding interval information to Metrics Eexplorer API

* Moving data hook into the expression charts component

* Revert "Adding interval information to Metrics Eexplorer API"

This reverts commit f6e2fc11be.

* Reducing the opacity for the threshold areas

* Changing darkMode to use alertsContext.uiSettings
2020-04-30 11:52:11 -07:00
Zacqary Adam Xeper c131cb341b
Refactor action messaging to report on No Data state (#64365) 2020-04-30 10:51:05 -05:00
Zacqary Adam Xeper 1669a10441
[Metrics UI] Fix alerting when a filter query is present (#64575) 2020-04-29 15:36:37 -05:00
Tiago Costa 7354ff6676
Revert "chore(NA): add async import into infra plugin to reduce apm bundle size (#63292)" (#64764)
This reverts commit 30439f6df0.
2020-04-29 16:38:41 +01:00
Tiago Costa 30439f6df0
chore(NA): add async import into infra plugin to reduce apm bundle size (#63292)
* chore(NA): async import on infra plugin in order to avoid infra plugin on apm

* chore(NA): add async import into infra plugin to reduce apm bundle size

* docs(NA): including small note

* fix(NA): pass pluginsSetup as an argument

* chore(NA): fix missing type

* chore(NA): split register in two functions

* chore(NA): only register once

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-04-29 01:29:38 +01:00
Chris Cowan 4a04adf812
[Metrics UI] Fixes for editing alerts in alert management (#64597)
* [Metrics UI] Fixes for editing alerts in alert management

* Change EuiFieldSearch to use onChange instead of onSearch

* Fixing groupBy

* Fixing the correct groupBy
2020-04-28 08:33:32 -07:00
Felix Stürmer 2fba7ed9f7
[Logs UI] Reimplement log source configuration routes in plain HTTP+JSON (#64021) 2020-04-28 11:12:50 +02:00
Mike Côté db374fc950
Ability to get scoped call cluster from alerting and action executors (#64432)
* Initial work

* Rename to getScopedCallCluster

* Fix typecheck

* Fix more type check issues

* Add tests

* Add docs

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-04-27 13:46:04 -04:00
Kerry Gallagher 72fba8bf64
[Logs UI] Alerting (#62806)
First iteration of logs alerting
2020-04-27 16:23:14 +01:00
Alejandro Fernández 085c2452d5
[Logs UI] Complete extendDatemath test suite (#64069)
* Add tests for datemath: `after` direction with a negative operator

* Add tests for datemath: `after` direction with a positive operator

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-04-24 22:30:10 +02:00
Alejandro Fernández 53b33bb3cb
[Logs UI] View log in context modal (#62198) 2020-04-24 22:29:04 +02:00
Chris Cowan f37185fd8f
[Metrics UI] Design Refresh: Inventory View, Episode 1 (#64026)
* [Metrics UI] Design Refresh: Inventory View, Episode 1

* Removing unused i18n labels

* Removing obsolete code removed in previous PR

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-04-23 18:00:19 -07:00
Zacqary Adam Xeper 12aae67467
[Metrics Alerts] Add outside range comparator (#63993) 2020-04-22 13:09:09 -05:00
Kerry Gallagher 9a47926b90
[Logs / Metrics UI] Switch to scopedHistory and enhance useLinkProps hook (#61667) 2020-04-22 14:25:39 +01:00
Chris Cowan e32fd2617a
[Metrics UI] Reorganize file layout for Metrics UI (#60049)
* [Metrics UI] Reorganize pages specific files under pages

- Restructuring pages folder
- Renaming metrics_ui to metrics
- Fixing paths in jest mocks
- Fixing AlertsFlyout path
- Fixing bad file paths from the merge

* Fixing typo compontents to components

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-04-20 13:44:19 -07:00
Chris Cowan 96b3fd1fe3
[Metrics UI] Remove remaining field filtering (#63398)
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-04-20 11:04:57 -07:00
Chris Cowan bb49c96167
[Metrics UI] Allow users to create alerts from the central Alerts UI (#63803) 2020-04-17 13:45:26 -07:00
Zacqary Adam Xeper 980e58e5fa
[Metrics Alerts] Fix saving doc count alerts(#63750) 2020-04-17 12:13:29 -05:00
Alexey Antonov 871f7209f9
[Timeseries] remove unused configuration properties (#62543)
* [Timeseries] remove unused configuration properties

* Fix PR comments

* update id of vis_type_timeseries plugin

* metrics -> vis_type_timeseries

* fix wrong plugin id

* update requiredPliugins for infra/kibana.json

* change id

* update plugin id in infra folder

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-04-16 19:28:04 +03:00
Gidi Meir Morris bb9f8845ae
[alerting] Adds an alertServices mock and uses it in siem, monitoring and uptime (#63489)
Work on #61313 has revealed that we don't have amock for AlertServices, which creates coupling between us and any solution depending on us, which makes it harder to make changes in our own code.

This PR adds mocks and uses them in SIEM, Monitoring and Uptime, so that we can make future changes without having to change outside solutions.
2020-04-16 08:45:38 +01:00
Phillip Burch c885ea5379
Because onThreshold is changed even when it hasn't changed add a check (#63555)
* Because onThreshold is changed even when it hasn't changed add a check

* Fix join
2020-04-15 06:43:03 -05:00
Phillip Burch bf63b56f83
Disable adding conditions when in alert management context. (#63514)
* Disable adding conditions when in alert manament context.

* Fix typo

* Change id for i18n string
2020-04-14 18:32:05 -05:00
Phillip Burch 7cb3ee44ea
Add help text to form fields (#63165)
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-04-14 12:13:44 -05:00
Chris Cowan c2f2a79acb
[Metrics UI] Refactor With* containers to hooks (#59503)
* [Metrics UI] Refactor containers to hooks

* clean up depends; move useInterval out of useWaffleTime;

* converting WithWaffleFilters to useWaffleFilters

* Removing WithWaffleOptions

* Refactor WithWaffleViewState to useWaffleViewState

* Removing obsolete files

* Fixing race condition with complext state

* Adding undefined to RisonValue; unwinding changes trying to work around bad type

* Switching to context

* Change assertion to ignore the length of the current URL

* Fixing test frameork to accept urls longer then 230 characters

* Fixes #59395; Refactor WithMetricsTime to hook; Fixes brushing on metric detail page; fixes refresh button on metric detail page

* Fixing tests with adding timeRange

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-04-14 09:01:41 -07:00
Zacqary Adam Xeper cbe479b8bd
[Metrics UI] Invalidate non-count alerts which have no metrics (#62837) 2020-04-08 12:39:59 -05:00
Phillip Burch 18c3f75bfb
The theme doesn't exist on props when used from the alerting management screen (#62811) 2020-04-08 11:38:23 -05:00
Zacqary Adam Xeper 879dadff31
[Metrics Alerts] Dynamically fetch index pattern (#62708)
* Fetch index pattern dynamically from alert executor

* Fix fetching of non-default pattern
2020-04-07 12:55:42 -05:00
Zacqary Adam Xeper cfe519f5a7
[Metrics Alerts] Set default aggregator to "average" instead o… (#62216)
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-04-03 11:04:48 -05:00
Mikhail Shustov cb9d263e85
lazy loading for infra assets (#62363) 2020-04-03 15:54:03 +02:00
Mike Côté 02dad02923
Rename some alert types (#61693)
* Rename some alert types

* Use sentence case for remaining changes + fix jest test

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-04-02 07:48:42 -04:00
Uladzislau Lasitsa addb87d779
Move src/legacy/server/index_patterns to data plugin (server) (Remove step) (#61618)
* Removed legacy index pattern

* fix type

* remove unnecessary import

* Removed old references to indexPatternsServiceFactory

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-04-02 12:53:14 +03:00
Zacqary Adam Xeper 1e47cb21ea
[Metrics Alerts] Fix action variables, default message, and EU… (#62061)
* [Metrics Alerts] Fix action variables, default message, and EUI casing

* i18nize action variables
2020-04-01 11:57:31 -05:00
Patrick Mueller 014ea125cd
[Alerting] add alerting privileges for uptime and metrics (#61113)
resolves https://github.com/elastic/kibana/issues/60135

See the reference issue for how to configure Kibana to test this manually.
There are no automated tests for this ATM.

The basic test scenario is to create a role with just the Uptime space
privilege, make sure it get to the Alerts and Actions management app,
make sure you can create an action (server log), and alert (index threshold),
and that the alert and action run successfully.

Then repeat with just the Metrics space privilege.
2020-04-01 12:09:26 -04:00
Alejandro Fernández 4632f3ef85
[Logs UI] Log stream row rendering (#60773) 2020-03-31 13:12:44 +02:00
Alejandro Fernández c96fb41cf4
[Logs UI] Add context fields to /log_entries/entries API (#60759)
* Add `context` to `logEntryRT`

* Query context fields

* Extract value to prevent type assertion

Co-Authored-By: Felix Stürmer <weltenwort@users.noreply.github.com>

* Add test for the context fields

Co-authored-by: Felix Stürmer <weltenwort@users.noreply.github.com>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-03-30 13:28:25 +02:00
Felix Stürmer 878ab20a7e
[Logs UI] Add category data quality warning based on ML job st… (#60551)
This adds warnings to the categories tab when the stats of the underlying ML job indicate a potential problem with the data quality.

closes #60385
2020-03-27 20:25:09 +01:00
Alejandro Fernández 2b113e1ec8
[Logs UI] Cleanup /log_entries/entries's underlying implemen… (#60764)
* Rename temporary name

* Rename `LogEntryDocument` fields to match `LogEntry`

* Dedupe types

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-03-26 10:51:51 +01:00
Zacqary Adam Xeper d50fe0c985
[Logs / Metrics UI] [NP followup] Cleanup link-to routes (#61162)
* Split link-to into Metrics and Logs routers

* Fix logs stream link-to

* Import fix

* Update snapshots

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-03-25 15:56:35 -05:00
Gidi Meir Morris 18793dbc6c
[Alerting] notifies user when security is enabled but TLS is not (#60270)
This PR:
1. Adds a callout on the Alerting UI when security is enabled but TLS is not
2. Cleans up displayed error message when creation fails due to TLS being switched off
2020-03-24 19:15:27 +00:00
Chris Cowan be1953a4dc
[Metric Alerts] Align date histogram buckets to the last bucket (#60714)
* [Metrics Alert] Align date_histogram to last bucket

- adds extended_bounds to date_histogram
- change range query to use epoch_millis
- add lte to range query
- add offset to date_histogram to realign buckets

* Removing unused import

* Adding note about calculating FROM to be more clear

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-03-24 11:33:29 -07:00
Phillip Burch b0eb79858f
Default duration to minutes, only show alerting on metrics explorer (#61058) 2020-03-24 11:19:04 -05:00
Larry Gregory b82cc6ed4a
Support for sub-feature privileges (#60563)
* initial server-side support for sub-feature privileges (#57507)

* initial server-side support for sub-feature privileges

* start addressing PR feedback

* renaming interfaces

* move privilege id collision check to security plugin

* additional testing

* change featurePrivilegeIterator import location

* fix link assertions following rebase from master

* Initial UI support for sub-feature privileges (#59198)

* Initial UI support for sub-feature privileges

* Address PR feedback

* display deleted spaces correctly in the privilege summary

* additional testing

* update snapshot

* Enables sub-feature privileges for gold+ licenses (#59750)

* enables sub-feature privileges for gold+ licenses

* Address PR feedback

* address platform review feedback
2020-03-24 11:12:49 -04:00
Zacqary Adam Xeper 3c66662630
[Metrics Alerts] Remove metric field from doc count on backend (#60679)
* Remove metric field from doc count on backend

* Fix tests

* Type fix

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-03-23 12:33:00 -05:00
Phillip Burch a790877694
[Metrics UI] Alerting for metrics explorer and inventory (#58779)
* Add flyout with expressions

* Integrate frontend with backend

* Extended AlertContextValue with metadata optional property

* Progress

* Pre-fill criteria with current page filters

* Better validation. Naming for clarity

* Fix types for flyout

* Respect the groupby property in metric explorer

* Fix lint errors

* Fix text, add toast notifications

* Fix tests. Make sure update handles predefined expressions

* Dynamically load source from alert flyout

* Remove unused import

* Simplify and add group by functionality

* Remove unecessary useEffect

* disable exhastive deps

* Remove unecessary useEffect

* change language

* Implement design feedback

* Add alert dropdown to the header and snapshot screen

* Remove icon

* Remove unused props. Code cleanup

* Remove unused values

* Fix formatted message id

* Remove create alert option for now.

* Fix type issue

* Add rate, card and count as aggs

* Fix types

Co-authored-by: Yuliia Naumenko <yuliia.naumenko@elastic.com>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
Co-authored-by: Henry Harding <henry.harding@elastic.co>
2020-03-23 10:02:11 -05:00
Chris Roberson 3a396027f6
[Monitoring] Migrate server to NP (#56675)
* First pass

* First pass

* Add new routes

* Getting closer

* Remove legacy server code, and other fixes

* Register the plugin with xpack

* Pass a legacy client to telemetry

* Suport callWithInternalUser

* Remove this

* More NP work

* Fix some tests

* Fix broken test

* Move over new telemetry changes, and fix other issues

* Fix TODO item

* Reuse the same schema as elasticsearch module

* Use a singular config definition here

* Disable this for now

* Use the right method

* Use custom config again

* Tweak the config to make this optional

* Remove these

* Remove these unnecessary files

* Fix jest test

* Fix some linting issues

* Fix type issue

* Fix localization issues

* Use the elasticsearch config

* Remove todos

* Fix this check

* Move kibana alerting over

* PR feedback

* Use new metrics core service

* Change config for xpack_api_polling_frequency_millis

* Make sure this is disabled for now

* Disable both

* Update this to the new function

* Tighten up legacy api needs

* Check for existence

* Fix jest tests

* Cleaning up the plugin definition

* Create custom type in our plugin

* Revert this change

* Fix CI issues

* Add these tests back

* Just use a different collector type

* Handle errors better

* Use custom type

* PR feedback

* Fix type issues

* PR feedback
2020-03-20 14:02:15 -04:00
Marco Vettorello 88612743a9
Update dependency @elastic/charts to v18.1.0 (#60578) 2020-03-20 17:37:11 +01:00
Zacqary Adam Xeper 431b06fee0
[Metrics Alerts] Add functional and unit tests (#60442)
* Add tests for metric threshold alerts

* Fix count aggregator

* Remove redundant typedefs

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-03-19 14:12:01 -05:00
Alejandro Fernández fe4c164681
[Logs UI] Use the Super date picker in the log stream (#54280) 2020-03-19 17:19:21 +01:00
Felix Stürmer ae0e35041e
[Logs UI] Correctly update the expanded log rate table rows (#60306)
This ensures that the content of the expanded rows in the log rate table reflect the most recent results.

Fixes #60300
2020-03-19 16:42:58 +01:00
Larry Gregory 9318862f19
Allow kbn-config-schema to ignore unknown keys (#59560)
* allow kbn-config-schema to ignore unknown keys

* Consolidate unknown key configuration

* updates following merge

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-03-17 12:30:17 -04:00
Felix Stürmer 6cd888f75f
[Logs UI] Fix log rate table row expansion (#60096)
This fixes the log rate table row expansion button, which broke in #54586 during a refactoring.
2020-03-16 19:47:56 +01:00
Alexey Antonov 9d00427aef
Downgrade to query-string v5.1.1 (#59633)
* Downgrade to query-string v5.1.1

* update lib version for x-pack

* fix JEST

* fix functional tests

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-03-13 17:27:09 +03:00
Felix Stürmer cf5ba6fd55
[Logs UI] Show navigation bar while loading source configurati… (#59997)
This moves the navigation bar and the source configuration loading indicator such that the bar is immediately visible and usable even before the source configuration has finished loading.

closes #56728
2020-03-12 23:26:16 +01:00
Felix Stürmer 07a7caaf2f
[Logs UI] Add expandable rows with category examples (#54586)
Make the category rows expandable to show actual log messages samples from the categories during the selected time frame.
2020-03-11 20:07:55 +01:00
Zacqary Adam Xeper db2a92c61d
[Metrics Alerts] Fix error when a metric reports no data (#59810)
* [Metrics Alerts] Fix error when a metric reports no data

* Clarify no data case handler, add separate error state

* Throw error state when callCluster fails
2020-03-11 08:44:29 -05:00
Zacqary Adam Xeper 5ad8337634
[Metrics Alerts] Add support for search query and groupBy on alerts (#59388)
* Add filterQuery to metric alert params

* Add groupBy alert support

* Fix typings

* Fix malformed query

* Fix filterQuery merge

* Fix groupBy afterkey insertion, add group name to alert action

* Convert iife to getter

* Fix type check

* Fix type check again

* Remove unnecessary order param
2020-03-10 10:45:57 -05:00
Kerry Gallagher 565dd25a8b
[Logs / Metrics UI] Link handling / stop page reloads (#58478)
* Add a hook for seamlessly handling onClick and href props of links, buttons etc

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
Co-authored-by: Felix Stürmer <weltenwort@users.noreply.github.com>
2020-03-10 10:36:13 +00:00
Lukas Olson f511afa729
Use camelCase rather than snakeCase for plugin name (#59461) 2020-03-05 20:46:45 -07:00
Felix Stürmer 1a548a1e42
[Logs UI] Speed up stream rendering using memoization (#59163)
This aims to be a quick performance improvement by memoizing the LogEntryRow component.
2020-03-06 00:19:32 +01:00
Chandler Prall 096dda6f34
Upgrade EUI to v20.0.2 (#59199)
* Updated EUI to 20.0.1; updated typescript usage

* snapshots

* Upgrade to eui 20.0.2, fix one more type

* PR feedback

* Update EUI icon usage to the correct types

* Updated with master
2020-03-05 12:27:52 -07:00
Joe Reuter cba4f34674
Migrate home app (#58030) 2020-03-04 08:24:42 +01:00
Zacqary Adam Xeper 06ebbb3fe0
[Metric Alerts] Add backend support for multiple expressions per alert (#58672)
* Add support for multiple alert expressions

* Rename expressions to criteria

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-02-28 13:11:50 -06:00
Zacqary Adam Xeper b658baf012
[Metrics Alerts] Fix alerting on a rate aggregation (#58789)
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-02-28 13:11:34 -06:00
Chris Cowan 29fbe395b7
[Metrics UI] Use CPU Usage limits for Kubernetes pods when available (#58424)
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-02-28 09:42:52 -07:00
Zacqary Adam Xeper 390165ba03
[Metrics Alerts] Create Metric Threshold Alert Type and Executor (#57606)
* [Infra] Add basic backend for metric threshold alerts

* Define separate fired/recovered action groups

* Allow alerting on arbitrary search fields besides host.name

* Add list and delete endpoioints

* Add groupBy alerts

* Remove extraneous  routes and SavedObject logic

* Remove additional SavedObject code

* Remove renotify logic from executor

* Fix action group type

* Fix scheduledActions typecheck

* Fix i18n

* Migrate alerting to new platform

* Add alerting to infra dependencies

* Add comment about future use

* Adjust alert params tm names to sync with UI; default to Entire Infrastructure alert

* Add support for between comparator

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-02-27 10:47:59 -06:00
Chris Cowan 43be649f50
[Metrics UI] Ensure inventory view buckets never drop below 60 seconds (#58503)
* [Metrics UI] Ensure inventory view buckets never drop below 60 seconds

* Fixing tests

* Fixing tests... again

* Fixing tests... rounding issue?

* Trying to fix the tests... again

* updating test for custom metric

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-02-27 09:32:44 -07:00
Chris Cowan 0764380ffd
[Metrics UI / Logs UI] Remove field filtering in Source API call (#58553)
* [Metrics UI / Logs UI] Remove field filtering in Source API call.

* Fixing type_check issues
2020-02-26 09:51:47 -07:00
Chris Cowan 8021fd887a
[Metrics UI] Custom Metrics for Inventory View (#58072)
* [Metrics UI] Add custom metrics interface to Inventory View

* WIP

* Adding workflows for editing custom metrics

* Polishing visual design

* Removing extra text

* Fixing types and return values

* fixing i18n

* Adding aria labels for clearity

* Changing custom group by to match same width as custom metric

* updating integration test for custom metrics

* Fixing type def
2020-02-26 09:36:43 -07:00
Kerry Gallagher b17aa35513
[Logs / Metrics UI] Handle index.scss (#58219)
* Ensure our index.scss file is handled
2020-02-25 15:28:41 +00:00
Alejandro Fernández db276d1894
[Logs / Metrics UI] Remove path prefix from ViewSourceConfigur… (#58238)
In the NP the routes have already the app name on them. Adding it to
this button made the app name double

    /app/metrics/metrics/settings
    /app/logs/logs/settings

The button only needs to go to the settings page within the app where
it's being loaded, so we can safely drop the prefix.

Closes #58233
2020-02-25 13:39:13 +01:00
Mikhail Shustov d61ef267d5
force savedObject API consumers to define SO type explicitly (#58022)
* force savedObject consumers to define type explicitly

* address comments

* regen docs
2020-02-21 22:11:05 +01:00
Alejandro Fernández 5953e62a72
[Logs UI] Fix column reordering in settings page (#58104)
* Ensure only one element has scroll

Apparently having multiple elements with scroll confuses the
`react-beautiful-dnd` mechanism to determine the position of the
elements. Adding `overflowY` to the app root fixes it.

* Fix upper bound check for log column reordering

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-02-20 17:57:00 +01:00
Oliver Gupte 96a0aa0266
[APM] NP Migration - Moves plugin server files out of legacy (#57532)
* Closes @56832 Migrates uses of the saved objects client to the internal
and context scoped clients exposed in the new platform core setup

* moves apm server, common, and typings dirs to the new plugin directory

* fixes path imports and type errors

* fixes some lint errors

* fixes CI failure. Use internal saved objects client like before.

* uses the context-scoped saved objects client for saving runtime APM indices,
and uses the internal saved objects client when creating apm index
pattern, so that any user who navigates to apm can trigger it

* fixes the type check error by updating import paths

* renamed files and directories to snake_case to pass scripts/check_file_casing

* rebase fixes and commit filename case changes

* moves get_indices_privileges.ts out of legacy path
2020-02-19 13:43:03 -08:00
Kerry Gallagher a4d8bc841b
Add enabled key schema validation (#57935) 2020-02-19 09:02:26 +00:00
Kerry Gallagher 0a6c748cc8
[Logs / Metrics] New Platform migration (full cutover) (#54583)
* Fully migrates metrics and logs to the NP

Co-authored-by: Jason Rhodes <jason.matthew.rhodes@gmail.com>
Co-authored-by: John Schulz <github.com@jfsiii.org>
Co-authored-by: Felix Stürmer <weltenwort@users.noreply.github.com>
2020-02-18 19:22:27 +00:00
Kerry Gallagher 18b5cf9adb
[Logs UI / Metrics UI] New Platform migration server followups (#51615) 2019-12-17 18:52:57 +00:00
Jason Rhodes ab5913d109
Infra server NP shim + config/routing API adoption (#45299)
* Basic cleanup before refactoring for shim work

* shim WIP

* Removes the configuration adapter

* WIP more stuff

* WIP refactoring of shimming work

* WIP continues

* Logging UI now runs on top of new platform shim

* WIP continues

* Removes unused imports and variables

* Basic infra NP server shim in place

* Reimplemented graphql http error handling for infra NP server shim

* Adds new platform infra plugin to handle NP config for legacy server shim

* Basic cleanup before refactoring for shim work

* shim WIP

* Removes the configuration adapter

* WIP more stuff

* WIP refactoring of shimming work

* WIP continues

* Logging UI now runs on top of new platform shim

* WIP continues

* Removes unused imports and variables

* Basic infra NP server shim in place

* Reimplemented graphql http error handling for infra NP server shim

* Adds new platform infra plugin to handle NP config for legacy server shim

* Adds comment about duplicating full config for NP config

* Use New Platform features plugin to registerFeature()

* Re-arranging and relying on request context as uch as possible

* Refactors KibanaRequest for RequestHandlerContext

* fixes types for callWithRequest

* Moves callWithRequest method override types directly into class to get them working, need to fix this when we understand it better

* Fixes callWithRequest framework types

* Removes a few NP_TODO comments

* Fix broken imports

* Ensure GraphQL resolvers are actually passed requestContext and not the raw request, and switch to the savedObjects client via requestContext

* Remove the legacy traces of the savedObjects plugin

* Fixes TSVB access with NP raw requests and requestContext

* Remove unused getUiSettingsService (moved to requestContext)

* Migrate to new Spaces plugin

* Fix calculateMetricInterval after merged changes

* Reinstate and migrate the infrastructure metadata route

* Fix various type check errors

* Amend InfraSources lib unit tests

Mock the savedObjects client differently

* Amend MetricsExplorer API response

Renaming of variable inadvertently broke the response

* Remove GraphQLI references from feature controls tests

* Remove other GraphiQL references

* Fix security / access issue

* Add a framework level registerRoute method which always adds access tags by default

* *Temp* disable test

* Migrate the log rate validation endpoint to the new platform

Fully migrates the [Logs UI] log rate setup index validation #50008 PR to New Platform routing etc

* Amend types

* Example of how to expose APM get indices method in NP

* Fix calls to TSVB bug caused by object mutation
This is a temp fix as the TSVB NP migration will supercede this

* Converts getApmIndices function to accept saved object client, implements usage in infra

* Fix APM setup_request tests

* Fixes some unused references for linting

* Migrate all work from #50730 to NP

* Remove duplicate declaration files for rison_node and add a single source of truth at x-pack/typings/rison_node.d.ts for x-pack uses

* Moved type file back into infra plugin to bypass strange break

* Updates apm indices method signature per feedback from @elastic/apm-ui
2019-12-06 13:35:34 -05:00
Court Ewing 7ac8e4d9cc Move x-pack plugins/server/common to x-pack/legacy 2019-06-20 13:34:48 -04:00
Chris Cowan a9badb9af2
[Infra UI] Fixes 38141 - Allow Metrics Explorer to set KQL filters in TSVB (#38280)
* Change TSVB link to use KQL for filters; Apply filterQuery to TSVB requests

* Add test for filterQuery in TSVB data

* Reverting yarn.lock

* updating tests; removing derivedIndexPattern

* Removing commented out code

* Update x-pack/plugins/infra/server/routes/metrics_explorer/lib/populate_series_with_tsvb_data.ts

Co-Authored-By: Felix Stürmer <weltenwort@users.noreply.github.com>

* Update x-pack/plugins/infra/server/routes/metrics_explorer/lib/populate_series_with_tsvb_data.ts

Co-Authored-By: Felix Stürmer <weltenwort@users.noreply.github.com>

* Update x-pack/plugins/infra/server/routes/metrics_explorer/lib/populate_series_with_tsvb_data.ts

Co-Authored-By: Felix Stürmer <weltenwort@users.noreply.github.com>

* Escaping possible double quotes in id fields and adding test case
2019-06-19 17:47:48 -05:00
Zacqary Adam Xeper e22d7d795a
[Logs UI] Shrink log stream when window is resized (#38937)
* [Logs UI] Shrink log stream when window is resized

* Avoid using window resize events for width
2019-06-19 16:25:50 -05:00
Kerry Gallagher d88d5278c1
Update usage based on recommendations in #36761 (#39090) 2019-06-18 13:43:07 +01:00
Zacqary Adam Xeper d5d4d6bf2c
Change 'Metrics explorer' to 'Metrics Explorer' (#39101) 2019-06-17 13:46:55 -05:00
Kerry Gallagher 22d1786908
Align text overflow styles for Label and Value (#39068) 2019-06-17 16:35:30 +01:00
Marco Vettorello 922e111dd5
Upgrade @elastic/charts to 6.0.1 (#38783)
* Upgrade @elastic/charts to 5.2.0

* Upgrade @elastic/charts to 6.0.1

* Add darkMode theme mock
2019-06-17 15:45:53 +02:00
Felix Stürmer 5b9c231a51
[Infra UI] Make queries more robust against missing indices (#38976)
This fixes several queries that failed when indices didn't exist and were not specified using a wildcard at the same time.
2019-06-17 06:43:04 -04:00
Felix Stürmer 2228863440
[Infra/Logs UI][skip ci] Add infra plugin readme with contribution notes (#38696)
This adds a README file to the `infra` plugin directory with additional contribution notes.

Co-Authored-By: Kerry Gallagher <k.gallagher.05@gmail.com>
2019-06-17 06:33:11 -04:00
Zacqary Adam Xeper 74a90b25c0
[Infra UI] Format arrays as ul elements in LogEntryFieldColumn (#38692)
* [Infra UI] Format arrays as ul elements in LogEntryFieldColumn

* Add enzyme test for LogEntryFieldColumn

* Fix tests

* Swap ul's for comma separation

* Use semantic markup for inline list

* Fix tests

* Use ::after element for comma separation

* Move ::after element to :not(:last-child)

* Hoist CommaSeparatedLi

* Use EuiThemeProvider in tests instead of isEnzyme prop

* Suppress type error with issue link
2019-06-14 10:07:35 -04:00
Kerry Gallagher db7b6878c1
Add a tooltip for name (#38904) 2019-06-14 13:52:30 +01:00
Chris Cowan a8d3caa995
[Infra UI] Support metrics for different docs in Metric Explorer (#38153)
* [Infra UI] Support metrics for different docs in Metric Explorer

* Adding minimum_should_match to query

* Check there are shoulds before setting minimum_should_match
2019-06-11 11:29:55 -07:00
Chris Cowan d16c394028
[Infra UI] Link to node detail page from Metrics Explorer (#37136)
* [Infra UI] Link to Metrics Detail page from Metrics Explorer for compatible group bys

* Adding test for incompatible group bys

* renaming for clearity

* Changing out SourceQuery for SourceConfiguration

* Fixing tests to ensure link it validated

* Make tests more robust

* Update x-pack/plugins/infra/public/components/metrics_explorer/chart_context_menu.tsx

Co-Authored-By: Felix Stürmer <weltenwort@users.noreply.github.com>

* Adding definite assingment operattors

* Fixing flaky test
2019-06-07 14:41:58 -07:00
Chris Cowan 74daed3e7f
[Infra UI] Fixing Metrics Explorer chart title overlapping (#38059)
* [Infra UI] Fixing Metrics Explorer chart title overlapping

* Adding tooltip to title
2019-06-07 08:47:35 -07:00
Chris Cowan 50dc13d8aa
[Infra UI] Fixes Uptime link to display for pod and containers (#38125)
* Fixes uptime link to display for pod and containers

* Making code more readable

* Another round of readability changes

* removing extra truthy check
2019-06-07 08:46:39 -07:00
Chris Cowan 7d944a78ba
[Infra UI] Fixes #37999 - Reset error when IP address changes to valid entry (#38022)
* [Infra UI] Fixes #37999 - Reset error when IP address changes to something valid

* movnig the setError above try/catch
2019-06-06 12:49:26 -07:00
Josh Dover 02ff1adcbd
[new-platform] Simplify the frontend integration with the legacy platform (#37734) 2019-06-05 17:46:03 -05:00
Felix Stürmer 503ec5b175
[Logs UI] Include correct fields in "entries after" query (#37881)
This fixes #37704 by correcting the fields list used in the second part of the `getLogEntriesBetween` library function.
2019-06-04 04:43:45 -04:00
Chris Cowan a5df2ee962
[Infra UI] Fixes #34427 - Add round up to SuperDatePicker 'to' value (#37896)
* [Infra UI] Fixes #34427 - Add round up to SuperDatePicker 'to' value

* Adding test for Today only
2019-06-03 14:48:33 -07:00
Chris Cowan b4833a3c57
[Infra UI] Fixes #37450 - Add check for empty metrics (#37508) 2019-05-31 09:06:03 -07:00
renovate[bot] b39b52eff9 Update hapi related packages (#37555) 2019-05-30 15:17:16 -07:00
Felix Stürmer d8c2757cb9
[Infra + Logs UI] Fix autocomplete overflow in Safari browser (#36820)
This prevents the autocompletion suggestions from overflowing the dropdown in the Infra UI and Logs UI query bar.
2019-05-22 13:55:33 -04:00
Jason Rhodes 66ef20bbd3
[Logs UI] Fixes date picker grid display bug (#36646)
* Fixes display of date picker and streaming button grid

* Removes unused dependency that somehow slipped through the commit hook linter >.<

* Changes streaming button to empty style to de-emphasize a bit

* Updates streaming message to match standard case

* Updates yarn.lock for new core-js version that auto updated during bootstrap

* Removes unnecessary import
2019-05-22 12:15:47 -04:00
Sonja Krause-Harder df6574590d
[Infra UI] Honour space when querying TSVB API (#36765)
* Honour active space for requests to TSVB api.

* Add privilege necessary to make TSVB requests.

* Announce our dependency on TSVB.
2019-05-22 07:27:02 +02:00
Felix Stürmer 03cef2287c
[Logs UI] Add flyout action menu with uptime link (#36721)
* Move log entry flyout and memoize some values

In preparation to the addition of an action menu, the log entry flyout
now lives in a directory.

* Add log entry action menu with uptime link

* Add component tests

* Remove static reference from memoization key

* Improve uptime filter value check

* Use an object as useVisibility return value
2019-05-21 16:39:19 -04:00
Felix Stürmer 066f64d07c
[Logs UI] Add column headers (#36467)
This PR adds column headers to the Logs UI. The header row also contains a quick link to the column configuration flyout. The detail flyout link, which was previously coupled to the `message` field, is now an independent column at the last position.

closes elastic/kibana#35780
closes elastic/kibana#36105
2019-05-20 18:58:24 -04:00
Chris Cowan 2d13071554
[Infra UI] Link-to page for resolving IP to Host Details (#36149)
* Adding link-to page for resolving IP to Host Details

* Adding intl support

* Adding source provider for link to via IP

* removing Source.Provider in favor of useSource hook

* rollback yarn.lock changes

* rollback package.json changes
2019-05-20 14:20:49 -04:00
Chris Roberson c87e8811cb
[Monitoring/Telemetry] Force collectors to indicate when they are ready (#36153)
* Initial code to force collectors to indicate when they are ready

* Add and fix tests

* Remove debug

* Add ready check in api call

* Fix prettier complaints

* Return 503 if not all collectors are ready

* PR feedback

* Add retry logic for  usage collection in the reporting tests

* Fix incorrect boomify usage

* Fix more issues with the tests

* Just add debug I guess

* More debug

* Try and handle this exception

* Try and make the tests more defensive and remove console logs

* Retry logic here too

* Debug for the reporting tests failure

* I don't like this, but lets see if it works

* Move the retry logic into the collector set directly

* Add support for this new collector

* Localize this

* This shouldn't be static on the class, but rather static for the entire runtime
2019-05-20 13:03:24 -04:00
Chris Cowan 8c649d96a3
[Infra UI] Fixes #36618 - Append filterQuery to TSVB filter (#36644)
* Fixes #36618 - Append filterQuery to TSVB filter

* changing and to AND for lucene

* removing export
2019-05-20 11:51:36 -04:00
Chris Cowan 9e8f3f4985
[Infra UI] Remove Joi validation from Metrics Explorer url validation (#36493) 2019-05-20 10:38:03 -04:00
Chris Cowan e115a9aa40
[Infra UI] Brushing for Metrics Explorer Charts (#36235)
* Returning live data

* Adding TSVB data population

* adding tests

* Adding UI

* Adding rough draft of metrics control

* Breaking out metric component; adding useCallback to callbacks; adding intl strings

* seperating out form

* Break metrics form out; change to custom color picker; create custom color palette;

* fixing bug with color picker

* changes to color palette; fix callback issue

* Fixing count label

* Fix chart label to truncate

* Changing by to graph per

* Making the metric popover wider to ease field name truncation

* critical changes to the import order

* Changing metrics behavior

* Hide metrics when choosing document count

* Updating chart tooltip; fixing types;

* Setting intial state to open metrics; Tweaking toolbar sizes

* fixing linting issues

* Allow users to filter by a grouping by clicking on the title

* Change rate to rateMax; add rateMin and rateAvg; fix title text-align

* Use relative paths to fix base path bug

* fixing typescript errors; removing rateAvg and rateMin; removing extranious files;

* Fixing formatting issues

* Fixing i18n linting errors

* Changing to elastic-charts

* fixing typing errors with charts

* Moving afterKey out of URL to fix bug with pagination

* Adding support for multiple axises

* Adding tests for useMetricsExplorerData hook

* breaking up the charting code; removing multi-axis support; changing color palette to use blue and red for first two color

* Adding drop down menu to charts for filtering and linking to TSVB

* Adding more tests for useMetricsExplorerData hook; adding error message; adding chart options to non-groupby charts

* only display groupings that have the metric fields

* Refactor page level state into custom hook; add test for options handlers;

* Fixing linting

* removing color picker

* removing useInterval

* Changing group by to use the pills; Changing context menu button; adding icons to context menu.

* Adding test for color palette

* Adding test for createFormatterForMetric()

* removing tsx extension; adding tests for createMetricLabel()

* removing tsx extension; adding tests for createMetricLabel()

* re-organizing helpers

* Moving helpers from libs to helpers; adding test for metricToFormat

* Fixing bug in tsvb link fn; adding timeRange props; adding createTSVBLink() test

* fixing timeRange fixture import; fixing aria label for action button

* removing some unecessary useCallbacks

* Adding test for MetricsExplorerChartContextMenu component

* Fixing linting issues

* Optimizing test

* Adding empty prompts for no metrics and no data

* Removing duplicate sereis def

* tcs has lost it's mind so I had to copy enzyme_helpers.tsx into our plugin

* Appeasing prettier

* Update x-pack/plugins/infra/public/components/metrics_exploerer/metrics.tsx

Co-Authored-By: simianhacker <chris@chriscowan.us>

* fixing path typo

* Adding supportFiltering to dependicy; change options to be more specific

* remove typo

* Fixing typo

* Adding logColumns to source fixture; fixing typo

* Fixing path to be more sane

* Adding brushing to Metrics Explorer Charts
2019-05-17 15:20:46 -04:00
Jen Huang e2222ce7c3
Snapshot Repositories UI (#34407)
* [SR] Snapshot and restore plugin boilerplate (#32276)

* Initial plugin set up

* Set up client shell

* Add initial repository list routes

* Fix merge issues and some typings

* Decouple server from plugin.ts files, tighten up typings

* Use exported constant for required license

* Translate plugin name, more typings

* Fix more types, move list components under /home

* Remove unused var

* Change scss prefix

* Uncouple unmount logic from routing shim, and some other PR feedback

* [SR] Repository list and details UI (#33367)

* Initial pass at repositories list UI

* Add detail panel for file system repositories, and a generic detail panel with json settings view

* Add detail components for other types

* Add detail panel footer, rename `useStateValue` to `useAppState`

* Fix detail panel footer

* Fix unused vars

* PR feedback

* PR feedback

* [SR] Refactor proposal (#33690)

* Move app dependencies to its own context provider

* Add index.ts barrel file for common types

* Move Enums to constants.ts file

* Refactor function component using `React.FunctionComponent<Props>`

* Refactor service folder structure

* Fix type import

* Move REPOSITORY_DOC_PATHS from common to public constants

* Move AppCore and AppPlugins interfaces back to shim and re-export them from app types

* [SR] Create and edit repositories UI (#34020)

* Add routing and placeholder form

* Fix typings

* Set up edit repository route, and basic form UI

* Add typings for wrapCustomError, and copy extractCausedByChain from CCR wrapEsError

* Throw errors that are already boomified

* Create and edit for basic repository types (fs, url, source)

* Add repository verification UI to table and details

* Create and edit for plugin repository types (hdfs, azure, s3, gcs)

* Fix linting

* Fix test

* Fix test

* Remove unused import

* Fix duplicate i18n key

* Fix details opening on cancel edit, remove unnecessary Fragments, definition file for some EUI components to x-pack, rename saveError

* Remove breaks

* Adjust add and edit repo routes so they don't conflict with list route

* Add repo plugin and types doc links to form

* Bootstrap documentation service

* Bootstrap text service and replace RepositoryTypeName component with it

* Bootstrap breadcrumb service and replace usages

* Bootstrap httpService, remove chrome and http from app dependencies(!)

* Add request creator and replace all instances of useRequest and sendRequest with it

* Fix typo

* Simplify update repository and update repository setting methods

* Adjust copy

* Lint

* Remove unused var

* Remove unused import

* [SR] Add API for retrieving snapshots. (#34598)

* [SR] Single and multiple repository delete (#34593)

* Add single/multi repository delete API and UI

* Address PR feedback

* [SR] Add SnapshotTable and SnapshotDetails. (#34837)

* Remove associations between multiple repositories with a single snapshot.
* Retrieve complete snapshot details in getAllHandler.
* Fix cleanup function bug in useRequest hook.
* Fix bug in useRequest which prevented old data from being cleared when subsequent requests returned errors.
* Add initialValue config option to useRequest.
* Add formatDate service to text module.

* [SR] Fix linting and add (de)serialization for repositories (#35031)

* Fix eslint issues and add (de)serialization for repositories

* Add comment about flattening settings

* [SR] Surface repository errors and index failures more prominently (#35042)

* Add links to repositories from Snapshot Table and Snapshot Details.
- Rename services/breadcrumbs to services/navigation and add linkToRepository function.
- Refactor home component to update active tab when URL was changed.
* Add warning callout to let user know when their repositories contain errors.
* Sort failures by shard and add test for snapshot serialization.
* Sort failures and indices.
* Add filter for filtering snapshots by their repository.
* Surface states with humanized text, icons, and tooltips where necessary.
* Fix pluralization of seconds.
* Surface failures tab even if there are none.
- Display a '-' for missing times and durations.
- Create DataPlaceholder component.

* [SR] Polish repositories UX (#35123)

* Refactor repository detail panel to load repository based directly on route param.
* Display repository detail panel while table is loading.
* Make 'Edit repository' table action a link instead of a button.
* Render disabled EuiSelect as a readonly EuiFieldText.
* Prepend HDFS URI with hdfs:// protocol.
* Present scheme options for Read-Only URL repository as a select.

* [SR] Add client-side validation to repository form and link to snapshots from details (#35238)

* Add client side repository form validation, extract `flatten` into common lib

* Add snapshot count to repository details and link to snapshot list

* Reset validation when changing repository type

* Fix snapshot list filter deep linking for repository names with slashes and spaces

* Fix imports

* PR feedback

* [SR] Design and copywriting fixes (#35591)

* Split repository form into two steps; move `clean_settings.ts` to server

* Default to snapshots tab, adjust snapshot empty prompt, add app description

* Add minimum timeout to list view requests to avoid flicker, use EuiEmptyPrompt for loading screen, add doc link to settings step

* Add information about snapshots to delete repository behavior, add doc link for source only toggle, add size notation help text

* Add main doc link

* Copywriting and i18n fixes, and add some common settings to third party repo types

* Add fields to third party repo detail panel

* More copywriting fixes

* Use spinner for duration and end time if snapshotting is still in progress

* Show all repository type options, mark missing plugins

* Revert "Show all repository type options, mark missing plugins"

This reverts commit e34ee47cec.

* Fix space

* [SR] Add permissions UI and Cloud-specific repository type UI branch (#35833)

* Add missing permissions UI and cloud-specific repository type UI branch

* Add ES UI as owners of /snapshot_restore directory

* Add no repository types callout for Cloud edge case

* Redirect invalid section param to repositories

* Add warning empty prompt if all repositories have errrors

* Replace repository cards with EuiCard

* Add snapshot doc link to repository error empty prompt

* Remove auto-verification from list and get routes, add separate verification route, add manual verification to repository detail panel

* Update copy and remove obsolete test

* Remove unused scss files

* Final changes to repository cards
2019-05-13 07:03:37 -07:00
Felix Stürmer 07824d24ad
[Logs UI] Allow for plugins to inject internal source configurations (#36066)
This exposes an API on the Kibana server object (old platform style) to define internal source configurations, which can not be edited by the user and take precedence above any stored configurations.
2019-05-10 21:23:19 +02:00
Sonja Krause-Harder 0f5532a18d
Fix page title. (#36432) 2019-05-10 16:59:00 +02:00
Chris Cowan 69bbca490b
[Infra UI] Adding links from Infra UI to Uptime (#35993)
* [Infra UI] Adding from Infra UI to Uptime

* Removed unused variable

* Adding tests for link generation

* Sometimes the IP address will be an array with [IPv4, IPv6]

* Ensuring only IPv4 addresses are returned; adding tests;

* only showing uptime link for host's with ip addresses
2019-05-10 07:32:18 -07:00
Kerry Gallagher 2004d953f8
[InfraUI] Change popover position of Node context menu (#36352)
* Change popover position of Node context menu

* Use correct position for table vs map
2019-05-10 10:05:34 +01:00
Sonja Krause-Harder d315ec3057
Enable telemetry for snapshot resolver. (#36354) 2019-05-09 16:49:16 +02:00
Sonja Krause-Harder b8b6ba395e
[Infra UI] Rename 'Snapshot' to 'Inventory'. (#36107)
* Rename 'Snapshot' to 'Inventory'.

* Use new route in functional tests.

* Internationalize tab titles.

* Add old route for bookmark compatibility.
2019-05-09 13:18:13 +02:00
Sonja Krause-Harder de8743ff91
Wait for context menu to appear in functional tests (#36163) 2019-05-09 12:44:14 +02:00
Chris Cowan f632bda105
[Infra UI] Metrics Explorer (#35846)
* Returning live data

* Adding TSVB data population

* adding tests

* Adding UI

* Adding rough draft of metrics control

* Breaking out metric component; adding useCallback to callbacks; adding intl strings

* seperating out form

* Break metrics form out; change to custom color picker; create custom color palette;

* fixing bug with color picker

* changes to color palette; fix callback issue

* Fixing count label

* Fix chart label to truncate

* Changing by to graph per

* Making the metric popover wider to ease field name truncation

* critical changes to the import order

* Changing metrics behavior

* Hide metrics when choosing document count

* Updating chart tooltip; fixing types;

* Setting intial state to open metrics; Tweaking toolbar sizes

* fixing linting issues

* Allow users to filter by a grouping by clicking on the title

* Change rate to rateMax; add rateMin and rateAvg; fix title text-align

* Use relative paths to fix base path bug

* fixing typescript errors; removing rateAvg and rateMin; removing extranious files;

* Fixing formatting issues

* Fixing i18n linting errors

* Changing to elastic-charts

* fixing typing errors with charts

* Moving afterKey out of URL to fix bug with pagination

* Adding support for multiple axises

* Adding tests for useMetricsExplorerData hook

* breaking up the charting code; removing multi-axis support; changing color palette to use blue and red for first two color

* Adding drop down menu to charts for filtering and linking to TSVB

* Adding more tests for useMetricsExplorerData hook; adding error message; adding chart options to non-groupby charts

* only display groupings that have the metric fields

* Refactor page level state into custom hook; add test for options handlers;

* Fixing linting

* removing color picker

* removing useInterval

* Changing group by to use the pills; Changing context menu button; adding icons to context menu.

* Adding test for color palette

* Adding test for createFormatterForMetric()

* removing tsx extension; adding tests for createMetricLabel()

* removing tsx extension; adding tests for createMetricLabel()

* re-organizing helpers

* Moving helpers from libs to helpers; adding test for metricToFormat

* Fixing bug in tsvb link fn; adding timeRange props; adding createTSVBLink() test

* fixing timeRange fixture import; fixing aria label for action button

* removing some unecessary useCallbacks

* Adding test for MetricsExplorerChartContextMenu component

* Fixing linting issues

* Optimizing test

* Adding empty prompts for no metrics and no data

* Removing duplicate sereis def

* tcs has lost it's mind so I had to copy enzyme_helpers.tsx into our plugin

* Appeasing prettier

* Update x-pack/plugins/infra/public/components/metrics_exploerer/metrics.tsx

Co-Authored-By: simianhacker <chris@chriscowan.us>

* fixing path typo

* Adding supportFiltering to dependicy; change options to be more specific

* remove typo

* Fixing typo

* Adding logColumns to source fixture; fixing typo

* Fixing path to be more sane
2019-05-08 09:23:45 -07:00
Felix Stürmer 0153e59539
[Logs UI] Add customizable columns to source configuration (#34916)
This adds options to customize the columns displayed in the log stream to the source configuration flyout.

relates to #31462
2019-05-03 14:59:43 +02:00
Kerry Gallagher dd6c2e2a2e
"View Surrounding Logs" functionality (#35727)
* Add "View Surrounding Logs" functionality

Move Logs Flyout state from Redux to Hooks

* Cleanup unused imports etc

* Amend for Prettier

* Stop live streaming when a filter is applied

* Change tooltip wording

* Compose functions for props higher in the component hierarchy

* Don't make a request at all without a flyoutId

* Handle no response

* Use TimeKey on document

* Appease Prettier

* Clean up unused props

* Use shared InfraTimeKey fragment

* Add semicolon
2019-05-02 22:39:38 +01:00
Caroline Horn 6268ee7e8c
Fix some EuiFlyout and EuiModal usages (#35829)
* Fix maps layer flyout

* Fixing some flyout headers with border and size

* Using euiOverflowShadow to remove warnings

* Fixed up some regular modal usages

* Added danger colors to EuiConfirmModals where necessary
2019-05-01 15:19:55 -04:00
Sonja Krause-Harder 87b0fd1158
[Infra UI] Use new snapshot endpoint (#34938)
* Use new snapshot endpoint

* Remove old nodes endpoint

* Reintroduce NAME_FIELDS for displayable names.

* Use camelCase consistently.

* Distinguish node name and node id correctly.

* Adjust functional tests.

* Make prettier.

* Use exact same date histogram as before.

* Enable test for metric values again.

* Add test for new groupBy behaviour.

* Add 'Service Type' to groupBy fields.

* Fix date histogram offset and adjust tests.

* Always query for all metrics.
2019-04-30 10:32:55 +02:00
Brandon Kobel 5ae5e3d8c6
Feature Controls - Read only badges (#35252)
* Adding readonly badge to the discover application

* Dashboard get a badge

* Visualize gets a badge

* Timelion gets a badge

* Canvas gets a badge

* Maps gets a badge

* Infra gets a badge

* Graph gets a badge

* Dev Tools gets a badge

* Index Patterns get badges

* Advanced Settings get badges

* Infra and i18n are super chill friends

* Using proper i18n prefix for xpack

* Adding badges to the uptime application

* APM gets a badge!

* Adding functional tests for the discover read-only badge

* Functional tests for everyone!

* Removing unused import

* Fixing chrome service mock

* Switching from ChromeBadge | null to ChromeBadge | undefined

* Fixing canvas badge assertst

* Fixing Logs ui capabilities

* More ChromeBrand | null to ChromeBrand | undefined related changes

* Using named badges

* Revert "Using named badges"

This reverts commit c0e341bee1.

* i18n'ing the uptime read-only badges

* Adding ChromeService tests for badges

* Starting to add tests for the legacy badge API

* Changing capitalization of "Read Only" to "Read only"

* Adjusting styles

* Adding $setupBadgeAutoClear tests

* Changing the badge tooltip

* Fixing timelion i18n prefix

* Changing where Canvas sets the breadcrumbs

* Using a read-only badge with an icon

* Update x-pack/plugins/canvas/public/angular/controllers/canvas.js

Co-Authored-By: kobelb <brandon.kobel@gmail.com>

* Update src/legacy/core_plugins/timelion/public/app.js

Co-Authored-By: kobelb <brandon.kobel@gmail.com>

* Changing discover's read-only verbiage

* Removing tests for code that moved to an untested part of Kibana

* Fixing issues introduced with the rebase

* Fixing priv ileges snapshot

* Adding back dropped docs

* Fixing plugin plugin doc

* Ensuring iconType is set as well

* Updating badge api, angular components moved

* graph to Graph

* Fixing linter

* Switching from aria-label to data-test-badge-label for testing

The tabIndex allows screenreaders to work properly

* Fixing eslint error

* Fixing more issues introduced by the merge from master

* APM updates badge in React hook

* Applying changes suggested by Aleh
2019-04-29 12:48:43 -07:00
Chris Cowan e0cf6436f7
Fixes #34606 - Adjust CSS to fix scrolling bug in Waffle Map (#34881) 2019-04-25 09:39:23 -07:00
Larry Gregory e18bfc1497
Feature Controls - Allow telemetry to be toggled with advancedSettings feature privilege (#35250)
* Allow telemetry to be toggled with feature privileges
2019-04-25 11:43:42 -04:00
Sonja Krause-Harder bff10d2258
[Infra UI] Add new graphql endpoint for snapshot data (#34264)
* Add new graphql endpoint for snapshot data

* Polishing.

* Keep type generic that is used outside snapshots

* Keep one more generic type generic

* Use camelCase for consistency.

* Refine type names

* Add return types.

* Use idiomatic javascript.

* Factor out getAllCompositeAggregationData<T>()

* Refine naming.

* More idiomatic JavaScript, more types.
2019-04-18 17:37:31 +02:00
Brandon Kobel f2388dbe6d
When APM is disabled, don't throw an error in Infrastructure (#35030)
* When APM is disabled, we were throwing an error in infra

uiCapabilities.apm is undefined in these situations, so we can't check
uiCapabilities.apm.save

* Fixing tslint issues
2019-04-15 10:28:56 -07:00
Brandon Kobel 80aae6bba8
Feature Controls (#31652)
* Restructure user profile for granular app privs (#23750)

merging to feature branch for further development

* Introducing uiCapabilities, removing config providers & user profile (#25387)

## Summary
Introduces the concept of "UI Capabilities", which allows Kibana applications to declare capabilities via the `uiCapabilities` injected var, and then use them client-side via the `ui/capabilities` module to inform their rendering decisions.

* GAP - Actions Restructured and Extensible (#25347)

* Restructure user profile for granular app privs (#23750)

merging to feature branch for further development

* Fixing saved object capability checking

* Beginning to restructure actions to be used for all action building

* Using actions to build ui capabilities

* dropping /read from client-side userprovide ui capabilities

* Adding some actions

* Using different syntax which will hopefully help with allowing apps to
specify the privileges themselves

* Exposing all saved object operations in the capabilities

* Using actions in security's onPostAuth

* Only loading the default index pattern when it's required

* Only using the navlinks for the "ui capabilities"

* Redirecting from the discover application if the user can't access
kibana:discover

* Redirecting from dashboard if they're hidden

* Features register their privileges now

* Introducing a FeaturesPrivilegesBuilder

* REmoving app from the feature definition

* Adding navlink specific ations

* Beginning to break out the serializer

* Exposing privileges from the authorization service

* Restructuring the privilege/resource serialization to support features

* Adding actions unit tests

* Adding features privileges builders tests

* Adding PrivilegeSerializer tests

* Renaming missed usages

* Adding tests for the privileges serializer

* Adding privileges tests

* Adding registerPrivilegesWithCluster tests

* Better tests

* Fixing authorization service tests

* Adding ResourceSerializer tests

* Fixing Privileges tests

* Some PUT role tests

* Fixing read ui/api actions

* Exposing features from xpackMainPlugin

* Adding navlink:* to the "reserved privileges"

* navlink -> navLink | nav_linknavlink -> navLink | nav_linknavlink ->
navLink | nav_linknavlink -> navLink | nav_linknavlink -> navLink |
nav_linknavlink -> navLink | nav_linknavlink -> navLink |
nav_linknavlink -> navLink | nav_linknavlink -> navLink | nav_link

* Automatically determining navlink based ui capabilities

* Backing out changes that got left behind

* Using ui actions for navlinks

* Adding TODOs

* Ui -> UI

* Deleting unused file

* Removing api: [] as it's not necessary anymore

* Fixing graph saved object privileges

* Privileges are now async

* Pushing the asycnchronicity to the privileges "service"

* Adding TODO

* Providing initial value for reduce

* adds uiCapabilities to test_entry_template

* Adding config to APM/ML feature privileges

* Commenting out obviously failing test so we can get CI greeenn

* Fixing browser tests

* Goodbyyeee

* Adding app actions to the reserved privileges

* update snapshot

* UI/API changes to facilitate disabling features within spaces (#24235)

* Restructure user profile for granular app privs (#23750)

merging to feature branch for further development

* Introducing uiCapabilities, removing config providers & user profile (#25387)

## Summary
Introduces the concept of "UI Capabilities", which allows Kibana applications to declare capabilities via the `uiCapabilities` injected var, and then use them client-side via the `ui/capabilities` module to inform their rendering decisions.

* GAP - Actions Restructured and Extensible (#25347)

* Restructure user profile for granular app privs (#23750)

merging to feature branch for further development

* Fixing saved object capability checking

* Beginning to restructure actions to be used for all action building

* Using actions to build ui capabilities

* dropping /read from client-side userprovide ui capabilities

* Adding some actions

* Using different syntax which will hopefully help with allowing apps to
specify the privileges themselves

* Exposing all saved object operations in the capabilities

* Using actions in security's onPostAuth

* Only loading the default index pattern when it's required

* Only using the navlinks for the "ui capabilities"

* Redirecting from the discover application if the user can't access
kibana:discover

* Redirecting from dashboard if they're hidden

* Features register their privileges now

* Introducing a FeaturesPrivilegesBuilder

* REmoving app from the feature definition

* Adding navlink specific ations

* Beginning to break out the serializer

* Exposing privileges from the authorization service

* Restructuring the privilege/resource serialization to support features

* Adding actions unit tests

* Adding features privileges builders tests

* Adding PrivilegeSerializer tests

* Renaming missed usages

* Adding tests for the privileges serializer

* Adding privileges tests

* Adding registerPrivilegesWithCluster tests

* Better tests

* Fixing authorization service tests

* Adding ResourceSerializer tests

* Fixing Privileges tests

* Some PUT role tests

* Fixing read ui/api actions

* Exposing features from xpackMainPlugin

* Adding navlink:* to the "reserved privileges"

* navlink -> navLink | nav_linknavlink -> navLink | nav_linknavlink ->
navLink | nav_linknavlink -> navLink | nav_linknavlink -> navLink |
nav_linknavlink -> navLink | nav_linknavlink -> navLink |
nav_linknavlink -> navLink | nav_linknavlink -> navLink | nav_link

* Automatically determining navlink based ui capabilities

* Backing out changes that got left behind

* Using ui actions for navlinks

* Adding TODOs

* Ui -> UI

* Deleting unused file

* Removing api: [] as it's not necessary anymore

* Fixing graph saved object privileges

* Privileges are now async

* Pushing the asycnchronicity to the privileges "service"

* Adding TODO

* Providing initial value for reduce

* adds uiCapabilities to test_entry_template

* Adding config to APM/ML feature privileges

* Commenting out obviously failing test so we can get CI greeenn

* Fixing browser tests

* Goodbyyeee

* Adding app actions to the reserved privileges

* Begin to allow features to be disabled within spaces

typescript fixes

additional cleanup

attempt to resolve build error

fix tests

more ts updates

fix typedefs on manage_spaces_button

more import fixes

test fixes

move user profile into xpack common

Restructure space management screen

fix SASS references

design edits

remove Yes/No language from feature toggles

fix casing

removed unused imports

update snapshot

fix sass reference for collapsible panel

Fix sass reference, take 2

* Restructure user profile for granular app privs (#23750)

merging to feature branch for further development

* extract migration logic into testable unit

* Introducing uiCapabilities, removing config providers & user profile (#25387)

## Summary
Introduces the concept of "UI Capabilities", which allows Kibana applications to declare capabilities via the `uiCapabilities` injected var, and then use them client-side via the `ui/capabilities` module to inform their rendering decisions.

* Design edits (#12)

enables customize avatar popover

update tests, and simplify editing space identifier

remove references to user profile

remove unused test suite

remove unnecessary sass import

removes security's capability_decorator

* fix i18n

* updates toggleUiCapabilities to use new feature definitions

* cleanup and testing

* remove references to old feature interface

* readd lost spacer

* adds feature route testing

* additional i18n

* snapshot update

* copy edits

* fix ml app icon

* add missing export

* remove unnecessary sass import

* attempt to fix build

* fix spaces api tests

* esArchiver mapping updates

* rename toggleUiCapabilities -> toggleUICapabilities

* removes shared collapsible_panel component in favor of plugin-specific components

* some copy and style adjustments

* fix test following rebase

* add lost types file

* design edits

* remove stale export

* feature feedback; fixes cached disabled features

* GAP: Security disables UI capabilities (#25809)

* Restructure user profile for granular app privs (#23750)

merging to feature branch for further development

* Fixing saved object capability checking

* Beginning to restructure actions to be used for all action building

* Using actions to build ui capabilities

* dropping /read from client-side userprovide ui capabilities

* Adding some actions

* Using different syntax which will hopefully help with allowing apps to
specify the privileges themselves

* Exposing all saved object operations in the capabilities

* Using actions in security's onPostAuth

* Only loading the default index pattern when it's required

* Only using the navlinks for the "ui capabilities"

* Redirecting from the discover application if the user can't access
kibana:discover

* Redirecting from dashboard if they're hidden

* Features register their privileges now

* Introducing a FeaturesPrivilegesBuilder

* REmoving app from the feature definition

* Adding navlink specific ations

* Beginning to break out the serializer

* Exposing privileges from the authorization service

* Restructuring the privilege/resource serialization to support features

* Adding actions unit tests

* Adding features privileges builders tests

* Adding PrivilegeSerializer tests

* Renaming missed usages

* Adding tests for the privileges serializer

* Adding privileges tests

* Adding registerPrivilegesWithCluster tests

* Better tests

* Restructure user profile for granular app privs (#23750)

merging to feature branch for further development

* Fixing authorization service tests

* Adding ResourceSerializer tests

* Fixing Privileges tests

* Some PUT role tests

* Fixing read ui/api actions

* Introducing uiCapabilities, removing config providers & user profile (#25387)

## Summary
Introduces the concept of "UI Capabilities", which allows Kibana applications to declare capabilities via the `uiCapabilities` injected var, and then use them client-side via the `ui/capabilities` module to inform their rendering decisions.

* Exposing features from xpackMainPlugin

* Adding navlink:* to the "reserved privileges"

* navlink -> navLink | nav_linknavlink -> navLink | nav_linknavlink ->
navLink | nav_linknavlink -> navLink | nav_linknavlink -> navLink |
nav_linknavlink -> navLink | nav_linknavlink -> navLink |
nav_linknavlink -> navLink | nav_linknavlink -> navLink | nav_link

* Automatically determining navlink based ui capabilities

* Backing out changes that got left behind

* Using ui actions for navlinks

* Adding TODOs

* Ui -> UI

* Deleting unused file

* Removing api: [] as it's not necessary anymore

* Fixing graph saved object privileges

* Privileges are now async

* Pushing the asycnchronicity to the privileges "service"

* Adding TODO

* Providing initial value for reduce

* adds uiCapabilities to test_entry_template

* Adding config to APM/ML feature privileges

* Commenting out obviously failing test so we can get CI greeenn

* Fixing browser tests

* First, very crappy implementation

* Adding tests for disabling ui capabilities

* All being set to false no longer requires a clone

* Using _.mapValues makes this a lot more readable

* Checking those privileges dynamically

* Fixing some broken stuff when i introduced checkPrivilegesDynamically

* Adding conditional plugin tests

* Renaming conditional plugin to optional plugin

* Fixing type errors

* GAP - Actions Restructured and Extensible (#25347)

* Restructure user profile for granular app privs (#23750)

merging to feature branch for further development

* Fixing saved object capability checking

* Beginning to restructure actions to be used for all action building

* Using actions to build ui capabilities

* dropping /read from client-side userprovide ui capabilities

* Adding some actions

* Using different syntax which will hopefully help with allowing apps to
specify the privileges themselves

* Exposing all saved object operations in the capabilities

* Using actions in security's onPostAuth

* Only loading the default index pattern when it's required

* Only using the navlinks for the "ui capabilities"

* Redirecting from the discover application if the user can't access
kibana:discover

* Redirecting from dashboard if they're hidden

* Features register their privileges now

* Introducing a FeaturesPrivilegesBuilder

* REmoving app from the feature definition

* Adding navlink specific ations

* Beginning to break out the serializer

* Exposing privileges from the authorization service

* Restructuring the privilege/resource serialization to support features

* Adding actions unit tests

* Adding features privileges builders tests

* Adding PrivilegeSerializer tests

* Renaming missed usages

* Adding tests for the privileges serializer

* Adding privileges tests

* Adding registerPrivilegesWithCluster tests

* Better tests

* Fixing authorization service tests

* Adding ResourceSerializer tests

* Fixing Privileges tests

* Some PUT role tests

* Fixing read ui/api actions

* Exposing features from xpackMainPlugin

* Adding navlink:* to the "reserved privileges"

* navlink -> navLink | nav_linknavlink -> navLink | nav_linknavlink ->
navLink | nav_linknavlink -> navLink | nav_linknavlink -> navLink |
nav_linknavlink -> navLink | nav_linknavlink -> navLink |
nav_linknavlink -> navLink | nav_linknavlink -> navLink | nav_link

* Automatically determining navlink based ui capabilities

* Backing out changes that got left behind

* Using ui actions for navlinks

* Adding TODOs

* Ui -> UI

* Deleting unused file

* Removing api: [] as it's not necessary anymore

* Fixing graph saved object privileges

* Privileges are now async

* Pushing the asycnchronicity to the privileges "service"

* Adding TODO

* Providing initial value for reduce

* adds uiCapabilities to test_entry_template

* Adding config to APM/ML feature privileges

* Commenting out obviously failing test so we can get CI greeenn

* Fixing browser tests

* Goodbyyeee

* Adding app actions to the reserved privileges

* Restructure user profile for granular app privs (#23750)

merging to feature branch for further development

* Introducing uiCapabilities, removing config providers & user profile (#25387)

## Summary
Introduces the concept of "UI Capabilities", which allows Kibana applications to declare capabilities via the `uiCapabilities` injected var, and then use them client-side via the `ui/capabilities` module to inform their rendering decisions.

* GAP - Actions Restructured and Extensible (#25347)

* Restructure user profile for granular app privs (#23750)

merging to feature branch for further development

* Fixing saved object capability checking

* Beginning to restructure actions to be used for all action building

* Using actions to build ui capabilities

* dropping /read from client-side userprovide ui capabilities

* Adding some actions

* Using different syntax which will hopefully help with allowing apps to
specify the privileges themselves

* Exposing all saved object operations in the capabilities

* Using actions in security's onPostAuth

* Only loading the default index pattern when it's required

* Only using the navlinks for the "ui capabilities"

* Redirecting from the discover application if the user can't access
kibana:discover

* Redirecting from dashboard if they're hidden

* Features register their privileges now

* Introducing a FeaturesPrivilegesBuilder

* REmoving app from the feature definition

* Adding navlink specific ations

* Beginning to break out the serializer

* Exposing privileges from the authorization service

* Restructuring the privilege/resource serialization to support features

* Adding actions unit tests

* Adding features privileges builders tests

* Adding PrivilegeSerializer tests

* Renaming missed usages

* Adding tests for the privileges serializer

* Adding privileges tests

* Adding registerPrivilegesWithCluster tests

* Better tests

* Fixing authorization service tests

* Adding ResourceSerializer tests

* Fixing Privileges tests

* Some PUT role tests

* Fixing read ui/api actions

* Exposing features from xpackMainPlugin

* Adding navlink:* to the "reserved privileges"

* navlink -> navLink | nav_linknavlink -> navLink | nav_linknavlink ->
navLink | nav_linknavlink -> navLink | nav_linknavlink -> navLink |
nav_linknavlink -> navLink | nav_linknavlink -> navLink |
nav_linknavlink -> navLink | nav_linknavlink -> navLink | nav_link

* Automatically determining navlink based ui capabilities

* Backing out changes that got left behind

* Using ui actions for navlinks

* Adding TODOs

* Ui -> UI

* Deleting unused file

* Removing api: [] as it's not necessary anymore

* Fixing graph saved object privileges

* Privileges are now async

* Pushing the asycnchronicity to the privileges "service"

* Adding TODO

* Providing initial value for reduce

* adds uiCapabilities to test_entry_template

* Adding config to APM/ML feature privileges

* Commenting out obviously failing test so we can get CI greeenn

* Fixing browser tests

* Goodbyyeee

* Adding app actions to the reserved privileges

* Update x-pack/plugins/security/server/lib/authorization/disable_ui_capabilities.ts

Co-Authored-By: kobelb <brandon.kobel@gmail.com>

* Update x-pack/plugins/security/server/lib/authorization/check_privileges_dynamically.ts

Co-Authored-By: kobelb <brandon.kobel@gmail.com>

* Disabling all ui capabilities if route is anonymous

* More typescript

* Even more typescript

* Updating snapshot

* Less any

* More safer

* Another one

* Restructure user profile for granular app privs (#23750)

merging to feature branch for further development

* Introducing uiCapabilities, removing config providers & user profile (#25387)

## Summary
Introduces the concept of "UI Capabilities", which allows Kibana applications to declare capabilities via the `uiCapabilities` injected var, and then use them client-side via the `ui/capabilities` module to inform their rendering decisions.

* GAP - Actions Restructured and Extensible (#25347)

* Restructure user profile for granular app privs (#23750)

merging to feature branch for further development

* Fixing saved object capability checking

* Beginning to restructure actions to be used for all action building

* Using actions to build ui capabilities

* dropping /read from client-side userprovide ui capabilities

* Adding some actions

* Using different syntax which will hopefully help with allowing apps to
specify the privileges themselves

* Exposing all saved object operations in the capabilities

* Using actions in security's onPostAuth

* Only loading the default index pattern when it's required

* Only using the navlinks for the "ui capabilities"

* Redirecting from the discover application if the user can't access
kibana:discover

* Redirecting from dashboard if they're hidden

* Features register their privileges now

* Introducing a FeaturesPrivilegesBuilder

* REmoving app from the feature definition

* Adding navlink specific ations

* Beginning to break out the serializer

* Exposing privileges from the authorization service

* Restructuring the privilege/resource serialization to support features

* Adding actions unit tests

* Adding features privileges builders tests

* Adding PrivilegeSerializer tests

* Renaming missed usages

* Adding tests for the privileges serializer

* Adding privileges tests

* Adding registerPrivilegesWithCluster tests

* Better tests

* Fixing authorization service tests

* Adding ResourceSerializer tests

* Fixing Privileges tests

* Some PUT role tests

* Fixing read ui/api actions

* Exposing features from xpackMainPlugin

* Adding navlink:* to the "reserved privileges"

* navlink -> navLink | nav_linknavlink -> navLink | nav_linknavlink ->
navLink | nav_linknavlink -> navLink | nav_linknavlink -> navLink |
nav_linknavlink -> navLink | nav_linknavlink -> navLink |
nav_linknavlink -> navLink | nav_linknavlink -> navLink | nav_link

* Automatically determining navlink based ui capabilities

* Backing out changes that got left behind

* Using ui actions for navlinks

* Adding TODOs

* Ui -> UI

* Deleting unused file

* Removing api: [] as it's not necessary anymore

* Fixing graph saved object privileges

* Privileges are now async

* Pushing the asycnchronicity to the privileges "service"

* Adding TODO

* Providing initial value for reduce

* adds uiCapabilities to test_entry_template

* Adding config to APM/ML feature privileges

* Commenting out obviously failing test so we can get CI greeenn

* Fixing browser tests

* Goodbyyeee

* Adding app actions to the reserved privileges

* update snapshot

* Update x-pack/plugins/security/server/lib/authorization/check_privileges.ts

Co-Authored-By: kobelb <brandon.kobel@gmail.com>

* Update x-pack/plugins/security/server/lib/authorization/check_privileges.ts

Co-Authored-By: kobelb <brandon.kobel@gmail.com>

* Fixing type errors

* Only disabling navLinks if a feature is registered for them

* Adding non i18n'ed tooltip

* Making metadata and tooltip optional

* i18n'ing tooltips

* Responding to peer review comments

* GAP - Role API Structure (#26740)

* Updated the role api PUT structure

* Minimum is an array now

* Updating get route to naively support the new structure

* Renaming and removing some serialized methods

* Updating Role PUT api tests

* Fixing PUT jest tests

* Fixing GET tests

* Updating PrivilegeSerializer tests

* Renaming features to feature for the GET, so we're consistent

* Validating features and feature privileges

* Update x-pack/plugins/security/server/lib/authorization/privilege_serializer.test.ts

Co-Authored-By: kobelb <brandon.kobel@gmail.com>

* Update x-pack/plugins/security/server/lib/authorization/privilege_serializer.test.ts

Co-Authored-By: kobelb <brandon.kobel@gmail.com>

* Update x-pack/plugins/security/server/lib/authorization/privilege_serializer.test.ts

Co-Authored-By: kobelb <brandon.kobel@gmail.com>

* Renaming some variables/members of the PrivilegesSerializer

* Fixing privileges serializer tests

* Fixing register privileges with cluster tests

* Fixing the role creation for the api integration tests

* Generalizing regex within the feature registry

* update tests

* [GAP] - Support infra features (#26955)

## Summary
This PR adds the `Infrastructure` and `Logs` apps as toggle-able features via Granular Application Privileges.

* [GAP] - Enables xpack_main to populate UI Capabilities (#27031)

## Summary

Currently, plugins that register features via `xpackMainPlugin.registerFeature({...})` also have to specify their own `uiCapabilities` via `injectDefaultVars`, which is counter-intuitive and cumbersome. We've accepted this complexity for OSS plugins, but x-pack and third-party plugins should not have to concern themselves with such implementation details.

This PR removes that requirement for x-pack and third-party plugins, so all they have to do is register features, and ensure that their feature privileges contain the appropriate UI Capabilities in the `ui` property.

### Notes
This implementation intentionally does not alter UI Capabilities that come in via OSS Kibana. The capabilities defined there should be the source of truth, regardless of which distribution is used.


### Example
<pre>
xpackMainPlugin.registerFeature({
  id: 'graph',
  name: 'Graph',
  icon: 'graphApp',
  <b>navLinkId: 'graph',</b>
  privileges: {
    all: {
      app: [],
      savedObject: { ... },
      <b>ui: ['showWriteControls'],</b>
    },
    read: {
      app: [],
      savedObject: { ... },
      <b>ui: ['someOtherCapability],</b>
    }
  }
});
</pre>

Will be translated to the following UI Capabilities:
```
uiCapabilities: {
  navLinks: {
    graph: true
  },
  graph: {
    showWriteControls: true,
    someOtherCapability: true, 
  }
}
```


xpack_main is **not responsible** for disabling UI capabilities, so this will initialize all capabilities with a value of `true`.

* Hide write controls for the visualization application (#26536)

* Hide write controls for the timelion application (#26537)

* blacklist feature ids (#27493)

* [GAP] - Support management links (#27055)

## Summary

This enables management links to be toggled via UI Capabilities.

## TODO
- [x] Implement spaces controls
- [x] Implement security controls
- [x] Testing
- [ ] (optional) - dedicated display for managing management links?

* Enables the feature catalogue registry to be controlled via uiCapabil… (#27945)

* Enables the feature catalogue registry to be controlled via uiCapabilities

* update snapshot

* xpack_main populates uiCapabilities with the full list of catalogue entries

* builds application privileges using catalogue actions

* prevent 'catalogue' from being registered as a feature id

* fix mocha tests

* fix merge

* update snapshots

* GAP - Discover and NavLinks Functional Testing (#27414)

* Adding very basic Discover tests

* Ensuring discover is visible in both spaces

* Parsing the DOM to determine the uiCapabilities

* Making this.wreck `any` because the type definitions suck

* Specifying auth when requesting ui capabilities

* Beginning architecture to support permutation testing

* Adding documentation of the different configurations we'd like to test

* Fixing type errors

* Beginning to work on the framework to test the combinations

* Adding some factories

* Pushing forward, not a huge fan of what I have right now

* The new-new

* Less weird types

* Revising some things after talking with Larry

* Switching from wreck to axios

* Restructuring some files

* Changing to a space with all features, and a space with no features

* Beginning to add the security only tests

* Adding a navLinksBuilder

* Adding spaces only tests

* Not disabling ui capabilities, or authing app/api access when we
shouldn't be

* Can't get rid of management

* Adding more user types

* More users, this is starting to really suck

* Renaming some things...

* Revising which users we'll test in which ui capabilities "test suite"

* Adding some more user scenarios for the security_only configuration

* Adding security_only user scenarios

* Adding space scenarios

* Fixing type errors

* Udpating the readme for the spaces we're testing with

* Adding global read discover security ui functional tests

* Adding tests to make sure save buttons are shown/hidden

The actual implementation is broken somewhere

* Fixing tests after GIS is added and conflicts happened for infra

* Adding discover ui capability tests

* Fixing navlinks tests

* Adding discover view tests

* Adding UI tests for spaces being disabled

* Fixing tests

* Removing wreck dependency, it's garbage

* Fixing typo

* Updating ui capabilities README.md and adding another user for the
security and spaces ui capability tests

* Updating yarn lock file

* Consolidation some types

* Adding VisualizeDisabledSpace to the scenarios.

* Fixing esArchives with .kibana_2

* Disable features optional again

* Adding ensureCurrentUrl: false

* Fixing space selector tests

* Fixing gis privileges, they use saved objects

* Fixing find's element staleness checks

* Update x-pack/test/functional/es_archives/spaces/disabled_features/data.json

Co-Authored-By: kobelb <brandon.kobel@gmail.com>

* Generalizing logic to get appNavLinksText

* Removing duplicate license header

* Adding GIS mappingst

* Fixing readme

* We love our future selfs

* Adding GisRead scenario

* Whoops

* Adding note about funky syntax for use with exhaustive switches

* Using a centralized list of features

* Give it some time

* Even more time?

* Space Management - accessibility & i18n improvements (#28195)

## Summary

1) Improves the accessibility for the spaces management screen:
    - Customize Space Avatar popover now receives focus when toggled
    - Labels are more descriptive, providing context
    - Delete Space modal correctly focuses

2) Improves i18n support
    - fixed a couple hard-coded strings

3) Adds a "Features" column to the spaces grid page, which shows a brief summary of the number of features enabled for each space:

![image](https://user-images.githubusercontent.com/3493255/50785093-93b78280-127d-11e9-975e-7209d35211ff.png)



Related: https://github.com/elastic/kibana/issues/28184

* Feature Controls - spaces - functional tests (#28213)

* adds tests for /api/features/v1 endpoint

* update failing management test

* Fc/run ui capability tests (#28362)

* Running the UI Capability Tests as part of the normal CI runs

* Adding uptime feature to get these tests passing

* Adding features and sorting

* Adding uptime security_only uiCapability tests, and fixing devTools

* Fixing the docs

* Fixing section panel i18n issue

* Removing unused import

* Updating snapshots

* Feature Controls - The new new role API (#28441)

These changes allow us to build the most recent UI where spaces can be "grouped" and edited at once. This changes the kibana section of the role definition to the following:

```
{
  kibana: [
    {
        base: ['read'],
        feature: {
          discover: ['all'],
          dashboard: ['all']
        },
        spaces: ['*']
    },
    {
        base: ['read'],
        feature: {
          discover: ['all'],
          dashboard: ['all']
        },
        spaces: ['marketing', 'sales']
    }
  ]
}
```

If the `spaces` property isn't provided (for example if the user isn't using Spaces) then it'll default to `['*']`. 

There are a few other stipulations that we're implementing with this approach. 

1. Each "item" can be for 1 to many spaces OR globally. We can't specify both space privileges and global privileges in the same "item" because for Spaces we translate `all` to `space_all`, etc. so we can give them different privileges, and this becomes problematic when trying to serialize/deserialize to ES.
2. Additionally, each space can only appear once. The ES model would allow this, but the role management UI becomes more complicated if we were to allow this when calculating effective privileges.

* Feature Controls - Discover Save Button Test #28500 (#28501)

* Adding some debug logs

* Setting ui settings using the functional services

* Doing the same for the spaces disabled features

* Removing console.log debug statements

* Using save instead of showWriteControls

* Reload when adjusting visible features within the users active space (#28409)

## Summary

Changes to the visible features within a space are not visible until the page is refreshed. Because of this, when a user is editing their active space, their changes are not immediately visible.

This updates the space management screen to force a refresh when updating the visible features inside the active space. It also introduces a modal warning that this will happen:

![image](https://user-images.githubusercontent.com/3493255/50923423-ebd7bb80-141a-11e9-92bd-2779020578a4.png)

* Throwing error if we register a feature after getAll is called (#29030)

* Throwing error if we register a feature after getAll is called

* Fixing some tests

* Fixing feature route tests

* Removing unused imports

* Fixing merge conflict

* Feature Controls - Fixing fallout of removing the legacy fallback (#29141)

* Fixing use of mode.useRbacFoRequest to mode.useRbac

* Fixing ui capability tests

* [Feature Controls] - Fix a11y for customize feature section (#29174)

## Summary

Fixes the displayed and announced text for the "show"/"hide" button of the Customize Visible Features section of the spaces management page.

This was inadvertently broken following a merge from master at some point.

* Feature Controls: Fixing k7's new "nav links" (#29198)

* Fixing k7's new applist for feature controls

* Renaming appSwitcher to appsMenu

* Feature Controls - Dashboard (#29139)

* Using addRouteSetupWork to implement the redirect

* Using centralized addSetupWork

* Fixing dashboard functional feature privileges tests

* Ensuring landing page and create dashboard redirect to the home-page

* Adding more tests to ensure the redirects work properly

* Adding disabled space feature tests for Dashboards

* Update src/ui/public/capabilities/route_setup.ts

Co-Authored-By: kobelb <brandon.kobel@gmail.com>

* Update test/functional/page_objects/common_page.js

Co-Authored-By: kobelb <brandon.kobel@gmail.com>

* Fixing ui capability tests after adding createNew

* Removing unnecessary `return undefined`

* requireUICapabilities -> requireUICapability

* Updating dashboard ui capability tests

* Fixing issue with the selection column appearing on Dashboards

* Fixing ui capability dashboard space only tests

* [FC] - Move management and catalogue entries out of privilege definition (#28354)

* Moves catalogue and management entries from privilege defintion to base feature definition

* Update new management menu to respect items disabled via UI Capabilities

* add test

* re-add index pattern entries

* re-add advanced settings icon

* fix tests

* remove management and catalogue entries from read-only users

* bring it back now y'all

* catalogue updates for xpack plugins

* Introduces 'grantWithBaseRead' flag

* update privileges from all -> read where necessary

* rename feature builder functions

* catalogue and management items should cascade to privileges when not specified

* add catalogue entry for uptime app

* Simplify feature registrations using inherited catalogue/management entries

* consolidate and fix privilege building logic

* rename variables

* remove debug code

* remove duplicate lodash import

* Update x-pack/plugins/xpack_main/server/lib/feature_registry/feature_registry.ts

Co-Authored-By: legrego <lgregorydev@gmail.com>

* [GAP] - Role Management UI (#26840)

 
![image](https://user-images.githubusercontent.com/3493255/51063094-72310080-15c7-11e9-9274-debf0e9b84f1.png)

![image](https://user-images.githubusercontent.com/3493255/51063108-8aa11b00-15c7-11e9-92fc-31c922086e05.png)


![image](https://user-images.githubusercontent.com/3493255/51063165-cb992f80-15c7-11e9-894d-630c109211d3.png)






---------
Edge-case scenarios:
  1) [x] '*' and spaces in the same "entry"
Handled via `_transform_errors` at the API level. Renders a partial read-only view in the UI.
  2) [x] same space appearing in multiple "entries"
Handled via `_transform_errors` at the API level. Renders a partial read-only view in the UI.
  3) [x] base and feature privileges being set on the same "entry"
UI does not allow this to be set, but UI is smart enough to display the correct effective privilege in this case.
  4) [x] multiple base privileges set in the same "entry"
UI does not allow this to be set, but UI is smart enough to apply the most permissive base privilege when displaying and performing privilege calculations.
  5) [x] multiple feature privileges for the same "entry" (ml_all and ml_read)
UI does not allow for this to be set, but UI is smart enough to apply the most permissive base privilege when displaying and performing privilege calculations.


--------

## Summary
This updates the role management UI to allow application privileges to be customized globally and per-space.

## TODO:
- [x] [First Design review](https://github.com/legrego/kibana/pull/13)
- [ ] Second Design review
- [ ] Copy review
- [x] i18n
- [x] Handle deleted/unknown features
- [x] Handle deleted/unknown spaces
- [x] Cleanup & refactoring
- [x] Testing

* [Feature Controls, Spaces] - Don't load bundles for hidden apps (#29617)

## Summary
This enables the spaces plugin to issue a 404 if the requested application is disabled within the users active space.

To enable this functionality, the `app` property was moved to the root feature level, with the option to override at the privilege level. This follows the same logic as `catalogue` and `management` sections.

This will enable automatic app "protections" for those which only specify a single UI application, including:

1) Timelion
2) Canvas
3) Monitoring
4) APM
5) Code (when it merges)
6) GIS
7) Graph
8) ML

* [Feature Controls] - Copy Edits (#29651)

## Summary
Copy edits from today's session

* [Feature Controls] - Rename-a-thon (#29709)

* post-merge cleanup

* [Feature Controls] - fixes from recent merge from master (#29826)

## Summary

this pr will contain any required changes to fix CI from the recent merge from master, which includes the new k7 redesign design and dark mode

* Feature Controls: Adding privileges tooltip for Dev Tools (#30008)

* Adding privileges tooltip for Dev Tools

* appeasing the linter

* [Feature Controls] - Fix displayed space base privilege (#30133)

## Summary
This fixes the displayed space base privilege when a global base privilege is influencing the dropdown control:

1) Add global 'read' privilege
2) Configure space privilege -- note default base privilege of 'read'
3) Change space base privilege to 'custom'

Prior to this fix, the dropdown would not honor the change; it would keep 'read' as the selected option.

* Feature Controls: Adding read privileges for advanced settings and index patterns (#30106)

* Adding read privileges for advanced settings and index patterns

* Fixing the tests and the actual code itself

* Feature Controls - spaces not a security mechanism warning (#29853)

* Changing copy for the spaces not a security mechanism warning

* Using Gail's wording

* [Feature Controls] - Fixes from merging from master (8.0) (#30267)

* improve typings

* fix xpack_main type definitions

* test updates

* Fc/functional test move (#29835)

* Moving dashboard feature control tests to the dashboard application

* Moving more tests around

* Fixing some tests, no longer using uiSettings service, doesn't play
nicely with spaces

* Fixing esarchived issue

* Renaming some files

* [Feature Controls] - Readonly view for Advanced Settings using UICapabilities (#30243)

## Summary
This builds on the work done in https://github.com/elastic/kibana/pull/30106 to enable a read-only mode for the Advanced Settings screen:

- Input fields are disabled
- Save options are not displayed
- "Reset to default" options are not displayed

* Feature Controls: No Wildcards (#30169)

* A poorly named abstraction enters the room

* No more wildcards, starting to move some stuff around

* Splitting out the feature privilege builders

* Using actions instead of relying on their implementation

* We don't need the saved object types any longer

* Explicitly specifying some actions that used to rely on wildcards

* Fixing api integration test for privileges

* Test fixture plugin which adds the globaltype now specifies a feature

* Unauthorized to find unknown types now

* Adding tests for features with no privileges

* Update x-pack/test/saved_object_api_integration/security_and_spaces/apis/find.ts

Co-Authored-By: kobelb <brandon.kobel@gmail.com>

* Adding back accidentally deleted test

* Using the shared XPackMainPlugin definition

* Fixing privileges

* [Feature Controls] - Readonly mode for Canvas using UICapabilities (#29264)

## Summary

Updates Canvas to respect UICapabilities when determining if a user has read or read/write access to the application:

1) Adds a `showWriteControls` UI Capability to the Canvas's `all` privilege.
2) Removes the `setCanUserWrite` Redux action
3) Sets the initial (and only) state for `state.transient.canUserWrite` based on the UI Capability.

Closes https://github.com/elastic/kibana/issues/27695

* [Feature Controls] - Readonly mode for Maps using UICapabilities (#30437)

## Summary

This updates the maps application to support a read-only mode:

1) Removes selection/delete from Maps listing page
2) Removes "save" option

## TODO:
- [x] Functional UI Tests

* Add typings for x-pack/test to support .html imports (#30570)

We're importing `ui/capabilities` from the x-pack/test project, which
implicitly traverses into typings which are potentially importing .html
files, so we have to teach TypeScript about it.

* [Feature Controls] - Readonly mode for Timelion using UICapabilities (#30128)

## Summary

Updates Timelion to respect UICapabilities when determining if a user has read or read/write access to the application.

A previous PR was responsible for hiding the save controls, but this PR adds testing and the appropriate UICapabilities to the registered privilege definition.

* remove stray debug code

* [Feature Controls] - Updates from src/ui move to src/legacy/ui (#30678)

* dummy commit

* fix import path

* update message identifier

* fix snapshot

* remove unused translations

* Feature Controls: Adding read/write privileges for all applications (#30732)

* Adding read/write privileges for all applications

* Using default for advanced settings, canvas, maps and timelion

* Update x-pack/test/ui_capabilities/security_only/tests/canvas.ts

Co-Authored-By: kobelb <brandon.kobel@gmail.com>

* Update x-pack/test/ui_capabilities/security_only/tests/canvas.ts

Co-Authored-By: kobelb <brandon.kobel@gmail.com>

* Update x-pack/test/ui_capabilities/security_only/tests/maps.ts

Co-Authored-By: kobelb <brandon.kobel@gmail.com>

* Update x-pack/test/ui_capabilities/security_only/tests/maps.ts

Co-Authored-By: kobelb <brandon.kobel@gmail.com>

* Update x-pack/test/ui_capabilities/security_only/tests/timelion.ts

Co-Authored-By: kobelb <brandon.kobel@gmail.com>

* [Feature Controls] - Readonly mode for Visualize using UICapabilities (#29714)

* enable read-only view, and enable app redirection for visualize app

* Hide 'Edit Visualization' dashboard context menu item if visualizations are not editable

* Hide 'Add new visualization' button if action is not available

* show 'Visualize' button on discover view only if viz app is available

* update tests

* allow visualizations to be created, but not saved for read-only users

* adds functional tests for visualize

* add tests for showing/hiding the visualize button in the discover app

* fix visualize tests following merge from master

* tests for edit viz feature from dashboards

* cleanup

* remove unnecessary call to set ui settings

* remove unused variables

* reduce flakyness of tsvb tests

* renames visualize.showWriteControls => visualize.save

* fix ui capability tests

* fix tests

* fix references to timePicker page object

* fix ts errors

* adds 'editable' property to embeddable metadata instead of hardcoded capability checks

* Remove unnecessary read-only considerations

* revert unnecessary mock changes

* [Feature Controls] - Adds missing uptime icon (#30716)

## Summary
Adds missing feature icon for Uptime application.

Needs https://github.com/elastic/kibana/pull/30678 to merge before this will go green.

* Feature Controls - Fix branch (#31135)

* Updating snapshot

* Switching visualize to use the default branch of the switch

* Fixing esarchive

* Feature Controls - Graph (#30762)

* Adding graph functional tests

* Fixing Privilieges API test

* Adding graph ui capability tests

* Update x-pack/test/ui_capabilities/security_only/tests/graph.ts

Co-Authored-By: kobelb <brandon.kobel@gmail.com>

* Update x-pack/test/ui_capabilities/security_only/tests/graph.ts

Co-Authored-By: kobelb <brandon.kobel@gmail.com>

* Update x-pack/test/ui_capabilities/security_and_spaces/tests/graph.ts

Co-Authored-By: kobelb <brandon.kobel@gmail.com>

* Update x-pack/test/ui_capabilities/security_only/tests/graph.ts

Co-Authored-By: kobelb <brandon.kobel@gmail.com>

* Update x-pack/test/ui_capabilities/spaces_only/tests/graph.ts

Co-Authored-By: kobelb <brandon.kobel@gmail.com>

* Apply suggestions from code review

Co-Authored-By: kobelb <brandon.kobel@gmail.com>

* Removing hard-coded constants

* Adding Graph delete button

* Fixing ui capability tests

* [Feature Controls] - Fixes page width for spaces management screen (#30723)

## Summary

Fixes the skinny spaces management screen following the redesign of the overall management area.

Needs https://github.com/elastic/kibana/pull/30678 to merge before this will go green.

* Feature Controls - Dev Tools (#30712)

* Adding functional tests

* Addingn Dev_Tools ui capability tests

* Adding some api tests for console's API

* Apply suggestions from code review

Co-Authored-By: kobelb <brandon.kobel@gmail.com>

* Moving uiCapability definition

* Giving user_1 dashboard access to space_2

* Using the default in the switch for devtools/visualize

* Using forceLogout, maps are leaving us on a 404 page

* Fixing privileges API tests

* Feature Controls- Fix Merge Conflicts (#31651)

* Removing duplicated and outdated tests

* Updating snapshot

* Fixing type script errors

* Getting rid of some double quotes

* Adding saved_object:url access to discover temporarily to fix tests

* Fixing dashboard tests, updating snapshots

* Fixing security only find tests

* Removing reduntant test

* Trying to give it more time

* Fixing it 20 seconds to redirect away from the create new dashboard

* Feature Controls - No more route defaults for dashboards (#31767)

* No more route defaults for dashboards

* Verbose logging...

* Changing some ciGroups to try to narrow down the problem

* Revert "Verbose logging..."

This reverts commit 3198e73b61.

* Revert "No more route defaults for dashboards"

This reverts commit 525cd94dc5.

* Chaning the method in which we do the redirect

* Fixing type issue

* Update index.ts

* Update index.ts

* Feature Controls - Only allowing features to register all and read privileges (#31526)

* Only allowing features to register all and read privileges

* Making all and read optional properties required some existence checks

* Using Aleh's superior solution!

* No more unnecessary `as any`

* Feature Controls - Saved Object Management (#31332)

* Adding savedObject uiCapabilities that mirror the savedobject actions

* Using uiCapabilities to limit which types to search for

* Restricting which saved objects can be deleted based on type

* Hiding "view in app" button when we aren't allowed to

* Filtering the saved objects relationships based on the valid saved
object types

* Using dedicated savedObjectsManagement ui capabilities

* Adding readonly mode of viewing an object

* Displaying View In App if you can actually do so

* No more operations

* Moving saved objects ui capability population to kibana plugin

* Updating x-pack jest tests

* Adding security only saved objects management ui capability tests

* Adding security and spaces tests

* Adding spaces only saved objects managment ui capability tests

* Adding saved object management listing page functional tests

* Adding functional tests for edit visualization

* Consolidating canViewInApp and getInAppUrl into the same file

* Fixing imports

* One more stray import/export

* Adding back esFrom source

* Revert "Adding back esFrom source"

This reverts commit dfb626ace3.

* Updating jest snapshots

* Updating privileges

* Adding some logging

* Back to 10 seconds

* Trying to get more logs...

* Back to normal logging levels

* Fixing ui capability tests

* Putting timeouts back.

* Feature Controls - UI capability API integration tests with fixture plugins (#32086)

* Only testing the foo plugin for security and spaces

* Using the foo plugin with the security_only tests

* Changing spaces only tests to use the foo plugin

* Using list of features from api, and fixing bug with the spaces
interceptor

* Adding catalogue tests, which are alluding to another bug

* saved_objects catalogue aren't driven by ui capabilites presently

* Expanding the coverage for the spaces only catalogue tests

* Fixing some catalogue asserts

* Fixing catalogue tests for spaces_only, I had it backwards

* Adjusting Readme, adding "global read" scenario for security only tests

* Responding to PR feedback

* Adding back saved objects tests I accidentally deleted

* Fixing typescript issues, we can't import EUI on the server

* Fixing eslint error

* Updating Jest snapshots, fixing chrome mock

* Fixing dashboard listing test

* Adding missing await and forcing logout for graph functional tests

* Putting i18n string back

* Fixing type script issue

* Fixing canvas assert because of merge

* Fixing saved object api error assertations

* user-action is now a saved object type

* Fixing typescript error

* Fixing saved object actions as a result of the merge

* Feature Controls - Infrastructure and Logging (#31843)

* hide infra/logs apps if disabled via UICapabilities

* adds tests

* adds UICapability tests for infra and log apps

* update expected privilege/action mapping

* adds feature controls security tests for infraHome

* adds infra spaces feature control tests

* remove debug code

* a sample readonly implementation, ignoring 'logs' privileges

* ts fixes

* fix capability expectations

* Removing RequiresUICapability component, since there are no usages

* Driving the source configuration seperately for logs/infrastructure

* Adding infrastructure feature controls security functional tests

* Adding spaces infrastructure tests

* Adding logs functional tests

* Reworking the ui capability tests to be more consistent

* Fixing privileges API

* Forcing logout

* Fixing comma issue introduced by merge

* Fix merge conflicts and loading/unloading esarchives more consistently

* Removing unnecessary !!

* Fixing saved object management tests

* Fixing more tests

* Using the new context APIs

* Revert "Using the new context APIs"

This reverts commit 4776f1fc86.

* Adding future version of ui capabilities react provider

* Switching the order of the HOC's for infra and making the future the
default

* Applying Felix's PR feedback

* Protecting Infra's GraphQL APIs

* Updating privileges list

* Using the introspection query

* No longer using apollo context library, rephrasing test descriptions

* Fixing issue introduced by merge conflict, I forgot a }

* Putting back missplaced data test subj

* Updating jest snapshots

* Feature Controls - Short URLs (#32418)

* Discover is showing creating short urls properly

* Adding Discover functional tests

* When dashboards show the share menu you can always create short urls

* Visualize now displays the short urls link appropriately

* Dashboard all gets access to saved objects and updating privileges api
test

* Updating and adding short url test to url panel content

* Fixing misspelling

* Updating jest snapshot

* Adding comment why allowShortUrl is always true for Dashboards

* Updating snapshots

* Fixing snapshots, mocking chrome.getInjected

* Feature Controls - Uptime (#32577)

* Adding uptime functional tests

* Enabling feature controls for uptime

* Updating the privileges API's actions

* Using a single access tag for limiting API access

* Revising the behavior of maps read-only mode (#33338)

* Feature Controls - APIs (#32915)

* Using HapiJS's scopes to perform authorization on api endpoints

* Revert "Using HapiJS's scopes to perform authorization on api endpoints"

This reverts commit f73810c22d.

* Switching the syntax of the api tags

* Fixing privileges API

* Typescriptifying some dependencies of the api authorization extensions

* Using dedicated typescript file for api post auth filtering

* Adding tests and restructuring the flow of the api authorization

* Adjusting uptime's usage of privileges and the privileges test

* Integrating PR feedback

* Fixing graph test subject, thanks Joe!

* Consolidating hideWriteControls dashboard listing test

* Reusing maps constants

* Adding type to saved object management ui capability tests

* Feature Controls - Index Pattern Management (#33314)

* Enabling feature controls for index patterns

* Updating privileges API tests

* Fixing saved object management's view index patterns in app logic

* Fixing forgotten canViewInApp tests

* Fixing maps spaces functional tests

* Feature Controls - Differentiating the privileges with the same actions (#32266)

* Differentiating the privileges with the same actions

* The types for the lodash.uniqwith packare aren't right, and we need to
customize the isEqual also, so we're gonna do it ourselves

* Fixing dev tools ui capability

* Removing are equivalent privileges prevention, it's not what we really
need

* Requiring all to be more permissive than read on startup

* Transparently differentiating "all" from "read" feature privileges

* Fixing jest tests

* Adding the allHack: action to the space and global base privileges

* Changing actions to be readonly

* Adding JSDoc's for the Actions class and specifically the `allHack`
action

* Making the import of xpack_main types consistent

* Feature Controls: APM (#32812)

* Adding APM read privilege and adding functional UI tests

* Beginning to validate the APM routes are protected properly

* Protecting APM's APIs

* Specifying CI group

* Fixing privileges

* Adding forgotten apm show ui capability

* Fixing apm's privileges

* Fixing merge-conflict with privileges allHack: and APM

* address canvas feedback (#34269)

* [Feature Controls] - Plugin postInit (#29172)

## Summary

Throwing this up as a straw ~man~ person. If we like it, I can split it out and point the OSS changes against master if we'd prefer.

Introduces a `postInit` plugin hook that is called after all plugins have gone through their `preInit` and `init` phases, which allows the security plugin to call `registerPrivilegesWithCluster` after all plugins have had an opportunity to register their features.

* Feature Controls - Adds bulk toggle for showing/hiding features within a space (#34288)

## Summary

Adds a "Change all" option to the spaces management screen to allow all features to be shown/hidden:

![image](https://user-images.githubusercontent.com/3493255/55344105-85db5d00-547a-11e9-9325-136d1c13f40e.png)


Closes #34184

* Feature Controls - Unregistered Applications Authorization (#34122)

* Converting the app authorization to use typescript

* Adding jest tests

* Only authorizing app routes that are registered for features

* Using ProtectedApplications to lazily get feature applications

* Removing unneeded mocked headers as part of the authorization

* Adding some logging for the app authorization

* Fixing imports, thanks tslint --fix!

* Updating snapshots

* Feature Controls - Disable privilege form until spaces are selected (#34386)

## Summary
This disables the privilege selection until one or more spaces are selected in the role management form:

![image](https://user-images.githubusercontent.com/3493255/55432524-1724ff00-5561-11e9-86f6-1589ba3fa701.png)

* Feature Controls - Visualize read-only create new (#34209)

* Allowing users to create new visualizations, even if they can't be saved

* Fixing privileges and tests

* Updating snapshot

* Removing visualize edit ui capability

* Feature Controls - Actions Version Prefix (#34405)

* Prefixing actions with version

* Updating privileges api integration test

* Update x-pack/plugins/security/server/lib/authorization/actions/saved_object.ts

Co-Authored-By: kobelb <brandon.kobel@gmail.com>

* Requiring version to be a not empty string

* Updating jest snapshots

* Changing the 403 messages for the saved object client

* Fixing ui/chrome mock

* Feature Controls - Displaying share menu on dashboards when in read-only mode (#34207)

* Displaying share menu on dashboards when in read-only mode

* Fixing test description, thanks Luke!

* Fixing dashboard view mode tests because the share menu is now visible

* migrate from tslint to eslint

* Feature Controls - Reserved Role Apps (#30525)

* Removing feature privileges from ml/monitoring/apm

* Adding monitoring/ml/apm as hard-coded global privileges

* A poorly named abstraction enters the room

* No more wildcards, starting to move some stuff around

* Splitting out the feature privilege builders

* Using actions instead of relying on their implementation

* We don't need the saved object types any longer

* Explicitly specifying some actions that used to rely on wildcards

* Fixing api integration test for privileges

* Test fixture plugin which adds the globaltype now specifies a feature

* Unauthorized to find unknown types now

* Adding reserved privileges tests

* Adding reserved privileges in a designated reserved bucket

* Fixing ui capability tests

* Adding spaces api tests for apm/ml/monitoring users

* Adding more roles to the security only ui capability tests

* You can put a role with reserved privileges using the API

* Adding support to get roles with _reserved privileges

* Adding APM functional tests

* Adding monitoring functional tests

* Fixing typo

* Ensuring apm_user, monitoring_user alone don't authorize you

* Adding ml functional tests

* Fixing test

* Fixing some type errors

* Updating snapshots

* Fixing privileges tests

* Trying to force this to run from source

* Fixing TS errors

* Being a less noisy neighbor

* Forcing logout for apm/dashboard feature controls security tests

* Fixing the security only ui capability tests

* Removing test that monitoring now tests itself

* Fixing some ui capability tests

* Cleaning up the error page services

* Fixing misspelling in comment

* Using forceLogout for monitoring

* Removing code that never should have been there, sorry Larry

* Less leniency with the get roles

* Barely alphabetical for a bit

* Apply suggestions from code review

Co-Authored-By: kobelb <brandon.kobel@gmail.com>

* Removing errant timeout

* No more hard coded esFrom source

* More nits

* Adding back esFrom source

* APM no longer uses reserved privileges, reserved privileges are
pluggable

* Fixing typescript errors

* Fixing ui capability test themselves

* Displaying reserved privileges for the space aware and simple forms

* Removing ability to PUT roles with _reserved privileges.
Removing ability to GET roles that have entries with both reserved and
feature/base privileges.

* Updating jest snapshots

* Changing the interface for a feature to register a reserved privilege to
include a description as well

* Displaying features with reserved privileges in the feature table

* Adjusting the reserved role privileges unit tests

* Changing usages of expect.js to @kbn/expect

* Changing the CalculatedPrivilege's _reserved property to reserved

* Allowing reserved privileges to be assigned at kibana-*

* Updating forgotten snapshot

* Validating reserved privileges

* Updating imports

* Removing --esFrom flag, we don't need it anymore

* Switching from tslint's ignore to eslint's ignore

* Feature Controls - Adds feature registration to plugin generator (#34537)

## Summary

This updates the plugin generator to allow plugin authors to automatically register their feature with the Feature Registry, for control via Spaces/Security.

Running:
```
elastic-mbp:kibana larry$ node scripts/generate_plugin.js test-plugin
? Provide a short description An awesome Kibana plugin
? What Kibana version are you targeting? master
? Should an app component be generated? Yes
? Should translation files be generated? Yes
? Should a hack component be generated? Yes
? Should a server API be generated? Yes
? Should SCSS be used? Yes
```

Generates the following:
```js
import { resolve } from 'path';
import { existsSync } from 'fs';


import { i18n } from '@kbn/i18n';

import exampleRoute from './server/routes/example';

export default function (kibana) {
  return new kibana.Plugin({
    require: ['elasticsearch'],
    name: 'test_plugin',
    uiExports: {
      app: {
        title: 'Test Plugin',
        description: 'An awesome Kibana plugin',
        main: 'plugins/test_plugin/app',
      },
      hacks: [
        'plugins/test_plugin/hack'
      ],
      styleSheetPaths: [resolve(__dirname, 'public/app.scss'), resolve(__dirname, 'public/app.css')].find(p => existsSync(p)),
    },

    config(Joi) {
      return Joi.object({
        enabled: Joi.boolean().default(true),
      }).default();
    },

    init(server, options) { // eslint-disable-line no-unused-vars
        const xpackMainPlugin = server.plugins.xpack_main;
        if (xpackMainPlugin) {
          const featureId = 'test_plugin';

          xpackMainPlugin.registerFeature({
            id: featureId,
            name: i18n.translate('testPlugin.featureRegistry.featureName', {
              defaultMessage: 'test-plugin',
            }),
            navLinkId: featureId,
            icon: 'discoverApp',
            app: [featureId, 'kibana'],
            catalogue: [],
            privileges: {
              all: {
                api: [],
                savedObject: {
                  all: [],
                  read: ['config'],
                },
                ui: ['show'],
              },
              read: {
                api: [],
                savedObject: {
                  all: [],
                  read: ['config'],
                },
                ui: ['show'],
              },
            },
          });
        }
      // Add server routes and initialize the plugin here
      exampleRoute(server);
    }
  });
}

```

* Updating core system docs

* Fixing infra's dates with data for the functional tests

* [Feature Controls] - Move UICapabilities to the new platform (#30585)

## Summary

This moves the UI Capabilities service into the new platform, shimming into the old platform in a way that is consistent with the `i18n` service.

* Fixing uptime functional api tests

* Removing .only...
2019-04-12 09:16:13 -07:00
Kerry Gallagher 382c95ea23
[InfraUI] [LogsUI] Autocomplete Field: Increase suggestions limit and allow scrolling (#34706)
* Autocomplete_field: Increase suggestions limit and allow scrolling

* Update x-pack/plugins/infra/public/components/autocomplete_field/autocomplete_field.tsx

Co-Authored-By: Kerry350 <k.gallagher.05@gmail.com>
2019-04-11 11:52:37 +01:00
Kerry Gallagher 2fd678c0c7
Tweak metrics time range handling and unit tests (#34869) 2019-04-10 16:30:23 +01:00
Felix Stürmer dc6ecae7fa
[Logs UI] Refactor source configuration as hook for consistent data flow (#34455)
This PR refactors the source configuration state and source configuration form state to hooks. Aside from slightly improved performance due to memoization, it should not lead to visible differences.
2019-04-10 17:03:11 +02:00
Alexey Antonov 3099837678
[TSVB] [Rollup support] exclude unsupported metrics from the Metric Aggregations dropdown (#34165)
* [TSVB] [Rollup support] exclude unsupported metrics from the Metric Aggregations dropdown

Fix: #34047

* TSVB] [Rollup support] exclude unsupported metrics from the Metric Aggregations dropdown - fix broken tests

* [TSVB] [Rollup support] exclude unsupported metrics from the Metric Aggregations dropdown

* [TSVB] [Rollup support] exclude unsupported metrics from the Metric Aggregations dropdown - add filtering for group by

* fix tests

* Fix issue with fetching fields
2019-04-10 13:29:23 +03:00
Chris Cowan 4168f3594c
Fixes bug where tooltip doesn't line up with data (#34749) 2019-04-09 14:15:01 -07:00
Kerry Gallagher a5fb494d84
[InfraUI] Use EuiSuperDatePicker on the Metrics page (#34427)
* Remove custom date picker for Metrics page, replace with EuiSuperDatePicker. Remove redux-observable for metrics-time state, replace with hooks.

Pass through refreshInterval and set it as part of the startMetricsAutoReload action

Refactor metric time controls to use EuiSuperDatePicker

Remove redux / redux-observable usage for MetricsTime, replace with hooks

Add useInterval hook and hook up to auto reloading

Add refresh interval support to the URL

Use more concise syntax

Add small styling

Add tests for metric_time

Add extra test

Add correct typings

Update time range immediately when auto reload is turned on (so we don't wait for the first interval to elapse)

Use stricter typing

Remove custom date range picker

Amend translations after removing custom date range picker

* Amend test for CI sensitivity

* Amend test assertions

* DRY up with useCallback
2019-04-09 12:49:04 +01:00
Felix Stürmer 576283cca9
[Infra + Logs UI] Reactively consume the ui settings (#34615)
Previously, the `theme:darkMode` and `dateFormat` settings were only read once, which made them susceptible to race conditions during initialization. This introduces and uses a new `useKibanaUiSetting` hook to reactively consume the settings.
2019-04-08 15:28:27 +02:00
Tiago Costa ed795d28ee
Migrate from tslint (#33826)
* chore(NA): remove tslint dependencies, configs and enable eslint typescript parser.

* fix(NA): apply recommend eslint typescript rule.s

* chore(NA): upgrade eslint package versions.

* chore(NA): split javascript eslint config in an override section.

* chore(NA): split all eslint configs with overrides.

* chore(NA): remove missing console.log.

* chore(NA): change eslint splits and overrides order.

* chore(NA): replace tslint disable comments with eslint ones.

* chore(NA): solve eslint typescript errors for elastic/kibana-custom/no-default-export

* chore(NA): fixed multiple eslint typescript rule failures.

* chore(NA): add tarfet folder to the eslint ignore.

* chore(NA): apply prettier rule to ts type file.

* chore(NA): remove last mentions to tslint

* chore(NA): add old defined rules

* chore(NA): missing port rules website

* chore(na): ordered rules

* chore(NA): solved eslint typescript problems.

* chore(NA): fix spaced comment problems.

* chore(NA): fix some more eslint typescript rules: import/order no-empty-interface

* chore(NA): fix last rules and comment out what are the ones still failing.

* chore(NA): comment out camelcase rule.

* chore(NA): regenerate kbn pm dist.

* chore(NA): updated snapshots.

* chore(NA): updated snapshots.

* chore(NA): disabled sort-keys rule.

* chore(NA): remove rule prefer-arrow/prefer-arrow-functions.

* chore(NA): fix for @typescript-eslint/no-var-requires rule.

* chore(NA): fixes for @typescript-eslint/camelcase rule.

* chore(NA): fix typo on eslint config kibana typescript.

Co-Authored-By: mistic <tiagoffcc@hotmail.com>

* chore(NA): remove legacy note after the intellij upgrade to 2019.1

* fix(NA): import order plugin.

* chore(NA): fix ts ignore positions after auto fix.

* fix(NA): performance issue with typescript eslint.

* refact(NA): eslint configs organization.

* chore(NA): apply resticted paths to ts files too.

* chore(NA): split comment from eslint ignore.
2019-04-05 17:45:23 +01:00
Wesley Hirsch 65362bb639 [Logs UI] Set [System][auth] program name correctly (#34212)
This fixes an incorrect reference to the `system.auth.program` field.

Fixes #34211
2019-04-03 11:57:37 +02:00
Felix Stürmer 13ea5e68c9
[Logs UI] Reload log entries on container mount (#34099)
This changes two things with how the log entries are loaded:

* This adds a reload action that is triggered when the stream item container is mounted. This is the case when the source configuration is being updated. Previously, the entry list was only loaded during the initialization of the log position url state container (which only happened once).
* This also adds handling of log entry loading failures (e.g. because the configuration has been changed to use an invalid timestamp field) by emptying out the log entry list in the store. Previously, the old log entries would be kept.

fixes #34033
2019-04-02 21:57:01 +02:00
Tyler Smalley 1b95bed2da
[linting] Enforce relative paths for X-Pack modules (#34349)
* Add module-migration support for toRelative

Signed-off-by: Tyler Smalley <tyler.smalley@elastic.co>

* tslint fixes

Signed-off-by: Tyler Smalley <tyler.smalley@elastic.co>

* Move configuration to root

Signed-off-by: Tyler Smalley <tyler.smalley@elastic.co>

* Simplify root definition

Signed-off-by: Tyler Smalley <tyler.smalley@elastic.co>
2019-04-02 10:08:13 -07:00
Felix Stürmer d62513657f
[Infra UI] Add and use typed styled-components theme provider (#33607)
This adds a specialization of the styled-components api, which is correctly typed according to the new theme variable type definitions included in EUI (elastic/eui#1750) and made available in Kibana via #33873.
2019-04-01 20:16:10 +02:00
Christiane (Tina) Heiligers fd3535fdcf
Remove dangerously set inner html (#33976)
Fixes #24781
Replaces dangerouslySetInnerHtml with JSX using FormattedMessage for i18n.
2019-03-28 12:56:36 -07:00
Felix Stürmer 07ad8fdbab
Fix babel initialization for graphql type generation (#33962)
This restores the functionality of the graphql type generation scripts after #33093. In particular, it properly sets up the babel import hook so schemata can once more be imported from `.ts/.tsx` files.
2019-03-27 21:34:48 +01:00
Tiago Costa 20bdf7d4a9
Migration to Babel7 and @babel/preset-typescript (#33093)
* chore(NA): first changes on every package.json order to support new babel 7. chore(NA): build for kbn-pm with babel 7.

* chore(NA): patch babel register to load typescrit

* chore(NA): first working version with babel 7 replacing typescript compiler.

* fix(NA): common preset declaration in order to make it work with babel-loader.

* chore(na): organizing babel preset env package json.

* chore(NA): mocha tests enabled.

* fix(NA): typo on importing

* test(NA): majority of x-pack tests ported to use babel-jest

* fix(NA): report info button test with babel-jest.

* fix(NA): polling service tests.

* test(na): fix server plugins plugin tests.

* test(NA): batch of test fixs for jest tests under babel-jest hoisting.

* chore(NA): add babel plugin to hoist mock prefixed vars on jest tests.

* chore(NA): update yarn.lock file.

* chore(NA): tests passing.

* chore(NA): remove wrong dep

* chore(NA): fix tsconfig

* chore(NA): skip babel for ts-jest.

* chore(NA): selectively apply the plugin to strip off namespace from ts files.

* chore(NA): remove not needed changes from ts tests

* chore(NA): removed ts-jest dependency. chore(NA): migrate ts tests on x-pack to use babel-jest with the new pattern.

* chore(NA): migrate kibana default distribution typescript tests to run with babel-jest and the new test mock pattern.

* chore(NA): merge and solve conflicts with master.

* chore(NA): fix problems reported by eslint

* chore(NA): fix license ovveride for babel-plugin-mock-imports

* chore(NA): update jest integration tests for kbn pm

* chore(NA): update babel jest integration tests for kbn pm.

* test(NA): update jest integration snapshot for kbn pm.

* chore(NA): apply changes according to the pull request reviews.

* chore(NA): apply changes according to the pull request reviews.

* refact(NA): migrate jest tests to the new pattern.

* fix(NA): babel 7 polyfill in the tests bundle.

* chore(NA): restore needed step in order to compile x-pack with typescript.

* chore(NA): change build to compile typescript with babel for the oss code. chore(NA): change transpile typescript task to only transpile types for x-pack. refact(NA): common preset for babel 7

* Revert "chore(NA): change build to compile typescript with babel for the oss code. chore(NA): change transpile typescript task to only transpile types for x-pack. refact(NA): common preset for babel 7"

This reverts commit 2707d538f5.

* fix(NA): import paths for tabConfigConst

* chore(NA): fix transpiling error on browser tests

* chore(NA): simplify kbn babel preset package.

* chore(NA): migrate build to use babel transpiler for typescript excluding xpack.

* fix(NA): introduced error on test quick task.

* fix(NA): fix preset for client side code on build.

* fix(NA): build with babel

* fix(NA): negated patterns in the end.

* fix(NA): kbn_tp_sample_panel_action creation.

* fix(NA): babel typescript transform plugin workaround when exporting interface name.

* refact(NA): remove not needed type cast to any on jest test.

* docs(NA): add developement documentation about jest mocks test pattern.

* chore(NA): missing unmerged path.

* chore(NA): fix jest tests for template.

* [CCR] Client integration tests (table lists) (#33525)

* Force user to re-authenticate if token refresh fails with `400` status code. (#33774)

* Improve performance of the Logstash Pipeline Viewer (#33793)

Resolves #27513.

_This PR is a combination of #31293 (the code changes) + #33570 (test updates). These two PRs were individually reviewed and merged into a feature branch. This combo PR here simply sets up the merge from the feature branch to `master`._

Summary of changes, taken from #31293:

## Before this PR
The Logstash Pipeline Viewer UI would make a single Kibana API call to fetch all the information necessary to render the Logstash pipeline. This included information necessary to render the detail drawer that opens up when a user clicks on an individual vertex in the pipeline.

Naturally, this single API call fetched _a lot_ of data, not just from the Kibana server but also, in turn, from Elasticsearch as well. The "pro" of this approach was that the user would see instantaneous results if they clicked on a vertex in a pipeline and opened the detail drawer for that vertex. The "cons" were the amount of computation Elasticsearch had to perform and the amount of data being transferred over the wire between Elasticsearch and the Kibana server as well as between the Kibana server and the browser.

## With this PR
This PR makes the Kibana API call to fetch data necessary for **initially** rendering the pipeline — that is, with the detail drawer closed — much lighter. When the user clicks on a vertex in a pipeline, a second API call is then made to fetch data necessary for the detail drawer.

## Gains, by the numbers

Based on a simple, 1-input, 1-filter, and 1-output pipeline.

* Before this PR, the Elasticsearch `logstash_stats` API responses (multiple calls were made using the `composite` aggregation over the `date_histogram` aggregation) generated a total of 1228 aggregation buckets (before any `filter_path`s were applied but across all `composite` "pages"). With this PR, the single `logstash_stats` API response (note that this is just for the initial rendering of the pipeline, with the detail drawer closed) generated 12 buckets (also before any `filter_path`s were applied). That's a **99.02% reduction** in number of buckets.

* Before this PR, the Elasticsearch `logstash_stats` API responses added up to 70319 bytes. With this PR, the single `logstash_stats` API response for the same pipeline is 746 bytes. That's a **98.93% reduction** in size.

* Before this PR, the Elasticsearch `logstash_state` API response was 7718 bytes. With this PR, the API response for the same pipeline is 2328 bytes. That's a **69.83% reduction** in size.

* Before this PR the Kibana API response was 51777 bytes. With this PR, the API response for the same pipeline is 2567 bytes (again, note that this is just for the initial rendering of the pipeline, with the detail drawer closed). That's a **95.04% reduction** in size.

* [Maps] split settings into layer and source panels (#33788)

* [Maps] split settings into layer and source panels

* fix SCSS import

* [env] exit if starting as root (#21563)

* [env] exit if starting as root

* fix windows

* s/--allow-root

* Typescript sample panel action (#33602)

* Typescript sample panel action

* Update EUI version to match main cabana version

* update yarn.lock

* add back typings include

* use correct relative path

* Home page "recent links" should communicate saved object type #21896 (#33694)

* adds object type for screen order
* adds object type for pointer hovering
* Update src/legacy/ui/public/chrome/directives/header_global_nav/components/header.tsx

Co-Authored-By: rockfield <philipp.b@ya.ru>
2019-03-26 20:44:03 +00:00
Felix Stürmer 04f816bdd4
[Logs UI] Fix font size references after EUI upstream change (#33411)
This fixes the `small` font scale of the log viewer to correctly reference the EUI font size again. Before this fix, the `small` font scale was rendered larger than `medium`. Similarly, the tick labels of the log minimap were being rendered too large.

Both resulted from a breaking change of the exported variable names in elastic/eui#1590.

fixes #32759
2019-03-18 19:50:56 +01:00
Kerry Gallagher 4b2c2bd63f
[InfraUI] Infrastructure navigation changes (#32892)
* Reorganise primary and sub navigation of Infrastructure

Add routed_tabs component

Amend routing (use an index and nested routes) and reorganise directory structure

Shift hosts / kubernetes / docker selection to subnavigation

Change path

Amend existing URLs

Use proper types

Amend document_title component

Reorganise title / source config button / info text

Maintain compatibility with old URLs

* Remove dead code

* Bump z-index on suggestions panel

* Ensure documentTitle responds to updates

* Use the same noop function and remove disabled option

* Use buttonSize="m" and add "Hosts" translation back

* Remove all "Home" wording

* Remove unused translations with script

* Don't nest <Link /> within a tab

* Comment out metrics-explorer tab until needed

* Don't create duplicate History entries
2019-03-18 14:11:16 +00:00
Felix Stürmer 76eff0afab
[Logs UI] Revert unintended inversion of loading state meaning (#33152)
This fixes a problem introduced with #32009, in which the meaning of the `isLoading` property for the `<ProgressEntry>` component was inverted.
2019-03-18 13:28:15 +01:00
Felix Stürmer 52084705a6
[Logs UI] Use react-intl FormattedRelative instead of a custom component (#33146)
This replaces the custom relative time component in the Logs UI live streaming inline loading indicator with the one from `react-intl`. This was not done at the time of the initial i18n introduction (#25213), because of #26237, which apparently has since been resolved via #26468. Visual changes should be limited to `now` being shown instead of `0s ago`.
2019-03-18 12:18:54 +01:00
Sonja Krause-Harder 7de81920f7
[Infra UI] Add Docker / Metricbeat / Nginx guide (#32898)
* Add Docker / Metricbeat / Nginx guide

* Clarify that metricsets need to be enabled.
2019-03-15 09:26:55 +01:00
Kerry Gallagher c68a45f751
[InfraUI] Fix group by "x" icon keyboard controls (#31960)
* First pass at ensuring click events do not swallow keyUp event, also ensure menu doesn't open / close for no reason

* Add comment

* Add key

* Revert changes

* Remove icons on badges within context menu

* Remove unused translation with script
2019-03-13 13:06:15 +00:00
Felix Stürmer fa5ac68b4e
[Logs UI] Move summary state out of redux (#31834)
This moves the `log_summary` state out of the redux store into a stateful hook in anticipation of the requirements of creating a fully embeddable log viewer.
2019-03-13 13:01:42 +01:00
Felix Stürmer c5f27b3731
[Infra UI] Strictly pick fields sent upon source config creation (#32897)
This picks the specific fields to submit for source configuration creation instead of just passing through the object. Before this, the newly included `message` field configuration would be erroneously included and lead to an error.
2019-03-12 11:39:05 +01:00
Felix Stürmer cd47c97054
[Logs UI] Use log message field configured in the yaml file (#32502)
This fixes the message reconstruction rules to actually use the `xpack.infra.sources.default.fields.message` field configuration from the Kibana config file.

fixes elastic/kibana#31355
2019-03-07 15:17:21 +01:00
Jason Rhodes ae754ac607
Upgrades EUI to 9.x (#32009)
* Fixed a simple argument bug and removed infra date picker EUI types

* Fixes for EUI date picker types

* eui_8.0.0

* fix type errors in query_bar

* Small changes for EUI types

* Updates EUI to 9.0.0 and removes @types/react-datepicker as it now ships with EUI

* Updates to EUI 9.0.1 and removes duplicate types in infra eui.d.ts

* ts-ignore applied to ongoing type error with styled components and EUI

* Changes EuiProgress props to avoid TS errors

* Updates EUI 9.0 snapshots

* Updates kibana root snapshots for EUI 9.0 upgrade

* Update detail_panel.test.js for EUI changes

* Updated functioanl and unit tests to properly inspect EuiTableRowCell rendered values

* Fix docs_level_security_roles.js func tests

* Update EUI to 9.0.2

* Fixed failing snapshot for EUI icon default prop
2019-03-07 07:03:11 -05:00
Chris Cowan cf332bca22
[Infra UI] Add Legend Settings for Waffle Map (#32228)
* Adding legend controls

* Adding url support and finishing feature

* Moving config to right side; setting min/max to data boundries when deactivating auto

* Removing legend from max and min labels

* removing uneseccary unshift(0)

* Change autobounds behavior
2019-03-06 06:42:18 -07:00
Felix Stürmer a9d75988bd
[Logs UI] Slim down local view configuration state (#31723) 2019-03-05 12:32:21 +01:00
Kerry Gallagher ce79bb1a7f
Add Infrastructure and Logs Help content (#32118)
Remove old Feedback link component (removed with K7)

Add a HelpCenterContent component

Add HelpCenterContent to Infrastructure

Add HelpCenterContent to Logs
2019-03-04 15:23:59 +00:00
Mikhail Shustov 8c6b1e5908
Update Typescript to the latest version (#32063)
* bump typescript version to 3.3.3333

* fix tests after updating TS version

* suppress type errors until they fixed appropriately

* address comments

* add type def for UnconnectedKibanaLink

* remove fix @ts-ignore

* fix snapshot test. provide displayName
2019-02-28 17:21:47 +01:00
Aleh Zasypkin b8c9d0afa0
Get rid of Handlebars support in i18n tools. (#32190) 2019-02-28 17:16:59 +02:00
Chris Cowan aeb5f7ba7a
Fixes #32022 - Fix table to display name instead of ID (#32051) 2019-02-27 07:38:35 -07:00
Chris Cowan 32dbb82bf8
[Infra UI] Change waffle map node to button for accessibility (#31764)
* Fixes #28158 - Change waffle map node to button for accessibility

* intl-izing the aria-labels; changing size to eui
2019-02-26 10:09:44 -07:00
Chris Cowan 9fa9e083de
[Infra UI] Auto focus search bar when page mounts for accessibility (#31758)
* Fixes #28154 - Auto focus search bar when page mounts

* Adding check
2019-02-25 15:22:59 -07:00
Chris Cowan 99c11c50fb
Fixes #28155 - Changed EuiKeyPadMenuItem to EuiKeyPadMenuItemButton to support accessibility (#31860) 2019-02-25 15:21:26 -07:00
Chris Cowan 79a7fdf0e3
[Logs UI] Add link-to router for logs (without a node) (#31653)
* [Logs UI] Add link-to router for logs (without a node)

* Fixing snapshots

* Update x-pack/plugins/infra/public/pages/link_to/redirect_to_logs.tsx

Co-Authored-By: simianhacker <chris@chriscowan.us>
2019-02-22 08:01:00 -07:00
Felix Stürmer 3d7a6a19fd
[Logs UI] Fix some filebeat ECS message formats (#31120) 2019-02-21 18:24:19 +01:00
Felix Stürmer 6e31c1d127
Upgrade react to 16.8.3 (#31268) 2019-02-21 11:27:35 +01:00
Chris Cowan 2ac5cf087b
[Logs UI] Add filter as a link-to parameter for logs (#31531)
* Fixes #23316 - Add filter as a link-to parameter for logs

* Add unit test case
2019-02-20 09:31:56 -07:00
Kerry Gallagher 29c1ecd3b7
Honour dateFormat Kibana setting (#31500)
Add a formatted_time component

Pass date_format in the kibana chrome container

Use formatted_time in logs view

Remove formatTime function
2019-02-20 11:35:58 +00:00
Felix Stürmer fc8370fc1e
[Logs UI] Fix pre-ECS filebeat module message reconstruction rules (#30398)
This fixes the message reconstruction for the pre-ECS formats of several filebeat modules by adding appropriate rules.
2019-02-19 19:02:16 +01:00
Felix Stürmer 6eb24c4b91
[Infra UI] Fix server-side retrieval of the kibana version (#31440)
This fixes a problem, which caused the xsrf check of the graphiql client to
fail.
2019-02-19 14:04:10 +01:00
Chris Cowan cb3dad1317
[Infra UI] Clean up Docker and Kubernetes fields for ECS (#31175)
* [Infra UI] Clean up Docker and Kubernetes fields for ECS

* updating tests with latest ecs fields

* Fixing documentation
2019-02-15 11:19:46 -07:00
Kerry Gallagher 036524f182
Add relevant document titles to Infrastructure pages (#31136)
Add a DocumentTitle component

Add DocumentTitle component to Nodes Overview / Metrics / Logs pages

Stylistic / defensive changes

Add I18n support
2019-02-15 15:25:38 +00:00
Chris Cowan 5ee7240add
Fixes #30090 - Change context.system.hostname to host.hostname for contextual menu. (#30884) 2019-02-15 07:47:44 -07:00
Joel Griffith cc6c31cd1c
Removes noreferrer on explicit elastic.co domains (#31008)
* Removes noreferrer on explicit elastic.co domains
2019-02-14 14:52:22 -08:00
Felix Stürmer dcf2a4ff93
[Logs UI] Use stable json stringify for log item values (#30930) 2019-02-14 18:51:23 +01:00
Kerry Gallagher 20f8482e11
[InfraUI] Fix / add context to Metrics error (#30383)
* Add a custom and specific InvalidNode Error so that more helpful information can be displayed on the Metrics page

Add a custom error for an invalid node check

Add a component for displaying help when using an invalid node

Throw the specific error from kibana_metrics_adapter

Add an enum for specific error codes

Look for and handle invalid node error in metrics/index

Amend container to pass Error instance

Add source configuration flyout to metrics/index to facilitate change source config button

* Add explicit type for err parameter

* Remove i18n injection, use FormattedMessage component

* Stylistic index changes

* Move Error typings to common
2019-02-14 13:28:28 +00:00
Chris Cowan 5e92d585c0
[Infra UI] Fixing group by labels by fixing the field names (post ECS migration) (#30416)
* Fixing group by labels by fixing the field names (post ECS migration)

* Fixing the field names for machine type and project id
2019-02-13 13:06:53 -07:00
Kerry Gallagher 3b6409ce91
Remove (to be deprecated) rest_total_hits_as_int parameter (#30826)
Change checkValidNode response parsing

Update type
2019-02-13 12:11:21 +00:00
Chris Cowan 7756ba0cfc
Fixing font size for icon div (#30744) 2019-02-12 09:56:09 -07:00
Court Ewing 2ce51a5be5 Update paths to ui, server, deprecation, plugin_discovery in src/legacy
This commit accompanies the four that precede it. Rather than squash
them altogether, the four previous commits all do nothing except move
files to help avoid conflicts.
2019-02-11 10:41:37 -05:00
Felix Stürmer d64648641b
[Infra UI] Patch the log sample dataset to be compatible with default log sources (#30060)
This adds a `@timestamp` alias to the mapping of the builtin log sample dataset to make it compatible with other log indices. It also adds the index pattern `kibana_sample_data_logs*` to the default `logAlias` setting in order for the sample data to show up in a default setup.

fixes elastic/kibana#29450
2019-02-06 10:51:03 +01:00
Caroline Horn f8c7320277
EUI 6.10.0 & Background color fixes (#30136)
* First foray into turning .application background off

* Hopefully fixing the last few plugins

* Update EUI to 6.9.0

* removing hacks

* last fixes

* Remove a few more `100vh`

* Can I remember to copy & REPLACE

* EUI at 6.10.0
2019-02-05 21:29:30 -05:00
Felix Stürmer fd061abd4a
[Infra UI] Adapt settings ui to saved object version type change (#30082) 2019-02-05 20:30:31 +01:00
Chris Cowan 4cb86aa5bd
Fixes #30104 - Add check to make sure popover needs to be closed (#30105) 2019-02-05 12:28:03 -07:00
Spencer 0aecd79c17
Remove k7design setting (#29565)
Removes support for the k6 navigation style from master. All but the first commit are targeted at a specific section of Kibana. Please take a look at the areas you're familiar with and check it off the list. We'll plan to merge this right before feature freeze.

- [ ] home
- [ ] discover
- [ ] context
- [ ] visualize
- [ ] dashboard
- [ ] devtools 
- [ ] timelion
- [ ] graph
- [x] monitoring 
- [ ] gis 
- [ ] infra 
- [x] ml 
- [ ] security 
- [ ] uptime
- [x] beatscm

@elastic/kibana-app @elastic/kibana-security @elastic/ml-ui @elastic/infrastructure-ui @elastic/kibana-gis @elastic/stack-monitoring @elastic/es-ui
2019-02-05 12:57:13 -06:00
Chris Cowan ddd5dc33e9
Fixes #23821 - Change link to traces (#29972) 2019-02-05 07:38:29 -07:00
Sonja Krause-Harder bbc2ca5138
Tweak z-index. (#30044) 2019-02-05 15:16:03 +01:00
Sonja Krause-Harder 4a4ed6bb55
Honor maxConcurrentShardRequests setting. (#30049) 2019-02-05 15:12:26 +01:00
Felix Stürmer 07add3b9b6
[Infra UI] Remove infrastructure breadcrumb from logs page (#29954)
This removes the Infrastructure breadcrumb prefix from the Logs page.

fixes #29472
2019-02-05 12:03:24 +01:00
Sonja Krause-Harder 70d9f45757
[Infra UI] Let drag-selecting a timerange disable autorefresh (#29947)
* Let drag-selecting a timerange disable autorefresh

* Send action to stop livestreaming at better time.
2019-02-05 08:03:50 +01:00
Spencer b4725b7d34
Remove dependency on doc versions (#29906)
See https://github.com/elastic/elasticsearch/pull/38254

Using the `version` parameter to implement optimistic concurrency is not going to be supported in 7.0, so we need to replace our usage of document version with the new `_seq_no` and `_primary_term` parameters. These fields are returned in the same way that `_version` was returned on all read/write requests except for search, where it needs to be requested by sending `seq_no_primary_term: true` in the body of the search request. These parameters are sent back to Elasticsearch on write requests with the `if_seq_no` and `if_primary_term` parameters, and are functionally equivalent to sending a `version` in a write request before elastic/elasticsearch#38254.

To make these updates I searched the code base for uses of a `version` and `_version`, then triaged each usage, so I'm fairly confident that I got everything but it's possible something slipped through the cracks, so if you know of any usage of the document version field please help me out by double checking that I converted it.

- [x] **Saved Objects**:  @elastic/kibana-platform, @elastic/es-security - for BWC and ergonomics the `version` provided by the Saved Objects client/API was not removed, it was converted from a number to a string whose value is `base64(json([_seq_no, _primary_term]))`. This allows the Saved Objects API and its consumers to remain mostly unmodified, as long as the underlying value in the version field is irrelevant. This was the case for all usages in Kibana, only thing that needed updating was tests and TS types.

- [x] **Reporting/esqueue**: @joelgriffith, @tsullivan - the version parameter was used here specifically for implementing optimistic concurrency, and since its usage was contained within the esqueue module I just updated it to use the new `_seq_no` and `_primary_term` fields.

- [x] **Task Manager**: @tsullivan @njd5475 - Like esqueue this module uses version for optimistic concurrency but the usage is contained with the module so I just updated it to use, store, and request the `_seq_no` and `_primary_term` fields.

- [ ] **ML**: @elastic/ml-ui - Best I could tell the only "version" in the ML code refers to the stack version, 077245fed8

- [ ] **Beats CM**: @elastic/beats - Looks like the references to `_version` in the code is only in the types but not in the code itself. I updated the types to use `_seq_no` and `_primary_term`, and their camelCase equivalents where appropriate. I did find a method that used one of the types referencing version but when investigating its usage it seemed the only consumer of that method was itself so i removed it. 52d890fed7

- [x] **Spaces (tests)**: @elastic/kibana-security - The spaces test helpers use saved objects with versions in a number of places, so I updated them to use the new string versions where the version was predictable, and removed the assertion on version where it wasn't. We test the version in the saved objects code so this should be fine.
2019-02-04 21:13:34 -08:00
Chris Cowan a5aa0dc3e9
[Infra UI] ECS Migration (#28205)
* updating fields

* Migrate to ESC event.dataset

* Migragte fields to ECS fields

* renaming variable

* Reverting back to host.name

* Changing from Top Hits to Terms Agg for getting node name; change host.name back to host.hostname for name.

* Changing back to host.name

* Moving from using the document source to an aggregation for node name

* Updating tests with new data format and data.

* removing unused fields

* adding test data for docker 6.6.0

* Adding docker tests for 6.6.0

* Fixing jest tests

* Fixing tests

* Adding the most critical line of code in the entire project

* Fix ECS-compatible apache rules and restore old ones

* Fix ECS-compatible nginx rules and restore old ones

* Add tests for apache2 in ECS and pre-ECS format

* Add tests for nginx in ECS and pre-ECS format

* removing console.log

* Fixing tests
2019-02-04 09:47:03 -07:00
Sonja Krause-Harder d42a3f484e
[Infra UI] Always pass index patterns as strings. (#29927)
* Always pass index patterns as strings.

* Abide by prettier rules.
2019-02-04 15:17:29 +01:00
Aleh Zasypkin d05437703d
Introduce I18nService core service and I18nContext. (#29379) 2019-02-04 13:38:00 +01:00
Felix Stürmer cc13b77a02
[Infra UI] Add a source settings ui (#26786)
This adds a configuration UI to change various properties of an infrastructure data source. The properties that can be currently changed are:

* name
* index pattern for metrics
* index pattern for logs
* fields like the timestamp, container/host/pod identification

It is meant as a basis for providing configurability for other source properties like outgoing links and formatting rules in the future.
2019-02-04 12:56:02 +01:00
Kerry Gallagher 732915ee2a
[Infra UI] Handle no metrics data gracefully (#29424)
* Use metric_time prefix for metric_time actions

* Add refetch capabilities to with_metrics

* Pass through refetch to index

* Add no data message and refetch button to metrics/index

Next stage: Extract into shared component between metrics and waffle map

* Remove "refetching" and just use "loading"

No need for the explictness, just reuse the loading state, as there's no value to differentiating refetching vs loading here

* Add no_data component

* Amend for Prettier

* Use no_data component

* Change naming to better reflect current components

* Introduce notion of two empty states: no indices and no data

Also changes nodes_overview and logs to use moved component

* Add no_data functionality

* Remove metrics specific no data component, use the new shared component

* Change import order

* Use no_data component in nodes_overview

* Refactor logs to use shared no data component

* Import intl

* Revert testing value

* Pass handler correctly to avoid circular references

* Satisfy type check

* Remove one last unused component
2019-02-04 10:27:26 +00:00
Chris Cowan ff1af3e1ed
Fixing #29778 - Disable add button when field select is empty (#29779) 2019-02-01 10:35:39 -07:00
Chris Cowan fada5d9e15
[Infra UI] Table View for Home Page (#29192)
* Addding initial table implimentation

* Moving waffle map to seperate component; adding contextual menu to nodes; adding filter to groups; adding pagination; adding sorting

* Fixing EUI types for EuiInMemoryTable to work for EVERYONE

* Adding server plugin for tslint for VIM; Fixing tests

* Adding the view switcher

* removing dependency

* updating yarn.lock

* Change padding to use EUI rules

* Rename waffle/index to nodes_overview; move table to nodes_overview

* Adding missed files in last commit

* Adding textOnly to the columns that need special truncation because they are buttons

* Fixed an error in the merge

* Fixing merge issues
2019-01-31 09:53:09 -07:00
Chris Cowan 7e9315a528
[Log UI] Flyout for Log Events (#28885)
* Adding flyout to log viewer

* Adding filtering

* Fixing typescript errors

* Adding a test for graphql; fixing test data for 7.0.0

* Adding terminate_after:1 to logItem request

* fixing test data

* Switching back to old data

* Fixing data for tests

* Adding i18n translations

* changing label from add to set

* Make flyout call more robust; fixing typings

* Adding loading screen to flyout

* Fixing linting errors

* Update x-pack/plugins/infra/public/components/logging/log_flyout.tsx

Co-Authored-By: simianhacker <chris@chriscowan.us>

* Fixing visible mis-spelling

* Fixing types

* Change withLogFlyout to be conditional; Add icon instead of onClick for flyout

* Adding dark mode support

* Adding user-select:none to icon div

* Removing remnants of a failed experiment

* Adding aria-label to view details button

* Fixing padding on date element

* Removing unused variable that somehow got past the linters

* Fixing empty_kibana

* Fixing data for infra

* Fixing merge weirdness
2019-01-31 08:34:09 -07:00
Chris Cowan c66363a376
[Infra UI] Custom Field Grouping for Waffle Map (#28949)
* [Infra UI] Add Support for Grouping By Custom Field

* fixiing typescript errors

* Serializing custom options to url so they persist accross reloads

* Fixing more errors

* removing label; moving custom field to top of menu

* fixing typescript error

* Adding intl formatMessage to strings
2019-01-30 11:39:32 -07:00