Commit graph

25170 commits

Author SHA1 Message Date
Frank Hassanabad a6847564c8
[SIEM] Fix state issues to avoid potential React update issues (#37261)
## Summary

Fixed prevState issues with React setState
  * This will avoid subtle bugs with the react update renderer
  * Enabled one lint rule from warn to error
  * Turned off the other linter issue as it has an open ticket against it.
  * https://github.com/elastic/ingest-dev/issues/468

Summarize your PR. If it involves visual changes include a screenshot or gif.

### Checklist

Use ~~strikethroughs~~ to remove checklist items you don't feel are applicable to this PR.

~~- [ ] This was checked for cross-browser compatibility, [including a check against IE11](https://github.com/elastic/kibana/blob/master/CONTRIBUTING.md#cross-browser-compatibility)~~
~~- [ ] Any text added follows [EUI's writing guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses sentence case text and includes [i18n support](https://github.com/elastic/kibana/blob/master/packages/kbn-i18n/README.md)~~
~~- [ ] [Documentation](https://github.com/elastic/kibana/blob/master/CONTRIBUTING.md#writing-documentation) was added for features that require explanation or tutorials~~
~~- [ ] [Unit or functional tests](https://github.com/elastic/kibana/blob/master/CONTRIBUTING.md#cross-browser-compatibility) were updated or added to match the most common scenarios~~
~~- [ ] This was checked for [keyboard-only and screenreader accessibility](https://developer.mozilla.org/en-US/docs/Learn/Tools_and_testing/Cross_browser_testing/Accessibility#Accessibility_testing_checklist)~~

### For maintainers

~~- [ ] This was checked for breaking API changes and was [labeled appropriately](https://github.com/elastic/kibana/blob/master/CONTRIBUTING.md#release-notes-process)~~
~~- [ ] This includes a feature addition or change that requires a release note and was [labeled appropriately](https://github.com/elastic/kibana/blob/master/CONTRIBUTING.md#release-notes-process)~~
2019-05-28 13:10:53 -06:00
spalger a0d75ea59a update yarn.lock file 2019-05-28 11:56:01 -07:00
Melissa Alvarez e42651823c
[ML] Prevent overflow of large metric values in data visualizer/file data visualizer cards (#36932)
* filedataviz cards - abbrev long numeric values

* add directive for index dataviz values

* Add arg to indicate format. update tests

* truncate with ellipsis

* use eui ellipsis truncation

* increase card content height

* ensure truncation for firefox and safari
2019-05-28 14:41:02 -04:00
Frank Hassanabad 74a2b7f12e
[SIEM] Fixed unescaped HTML entity issue (#37257)
## Summary
  * Turned on linter rule to be an error
  * Removed the extra character
  * https://github.com/elastic/ingest-dev/issues/467

Removes the extra `}` character seen after line 84 below in the screen shot:

<img width="368" alt="Screen Shot 2019-05-28 at 9 39 28 AM" src="https://user-images.githubusercontent.com/1151048/58498271-f4672f00-813a-11e9-8b80-2326db363bb0.png">

### Checklist

Use ~~strikethroughs~~ to remove checklist items you don't feel are applicable to this PR.

~~- [ ] This was checked for cross-browser compatibility, [including a check against IE11](https://github.com/elastic/kibana/blob/master/CONTRIBUTING.md#cross-browser-compatibility)~~
~~- [ ] Any text added follows [EUI's writing guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses sentence case text and includes [i18n support](https://github.com/elastic/kibana/blob/master/packages/kbn-i18n/README.md)~~
~~- [ ] [Documentation](https://github.com/elastic/kibana/blob/master/CONTRIBUTING.md#writing-documentation) was added for features that require explanation or tutorials~~
~~- [ ] [Unit or functional tests](https://github.com/elastic/kibana/blob/master/CONTRIBUTING.md#cross-browser-compatibility) were updated or added to match the most common scenarios~~
~~- [ ] This was checked for [keyboard-only and screenreader accessibility](https://developer.mozilla.org/en-US/docs/Learn/Tools_and_testing/Cross_browser_testing/Accessibility#Accessibility_testing_checklist)~~

### For maintainers

~~- [ ] This was checked for breaking API changes and was [labeled appropriately](https://github.com/elastic/kibana/blob/master/CONTRIBUTING.md#release-notes-process)~~
~~- [ ] This includes a feature addition or change that requires a release note and was [labeled appropriately](https://github.com/elastic/kibana/blob/master/CONTRIBUTING.md#release-notes-process)~~
2019-05-28 12:33:51 -06:00
Xavier Mouligneau ab4d8b18f3
fix persistence of timeline when you pinned or add a note to an event (#37248) 2019-05-28 14:12:06 -04:00
Frank Hassanabad 1cfad73abd
[SIEM] Low impact linter rules to start with (#37137)
## Summary

Low impact linter rules to help catch bugs for back-porting as well as moving into the future. We will slowly turn the warns into errors and fix the errors as we go along. This helps us avoid a "big bang" switch over approach to avoid back-port issues as we are porting bugs aggressively at the beginning.

Added a custom pattern detection rule for determining if the UI is trying to import anything from the server backend since that would cause web-pack front to pull in backend code. Also forbid the use of NodeJS imports on the front end.  

Double checked that I was not duplicating rules from:
* https://github.com/elastic/kibana/blob/master/packages/eslint-config-kibana/typescript.js
* https://github.com/elastic/kibana/blob/master/packages/eslint-config-kibana/javascript.js

### Checklist

Use ~~strikethroughs~~ to remove checklist items you don't feel are applicable to this PR.

~- [ ] This was checked for cross-browser compatibility, [including a check against IE11](https://github.com/elastic/kibana/blob/master/CONTRIBUTING.md#cross-browser-compatibility)~
~- [ ] Any text added follows [EUI's writing guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses sentence case text and includes [i18n support](https://github.com/elastic/kibana/blob/master/packages/kbn-i18n/README.md)~
~- [ ] [Documentation](https://github.com/elastic/kibana/blob/master/CONTRIBUTING.md#writing-documentation) was added for features that require explanation or tutorials~
~- [ ] [Unit or functional tests](https://github.com/elastic/kibana/blob/master/CONTRIBUTING.md#cross-browser-compatibility) were updated or added to match the most common scenarios~
~- [ ] This was checked for [keyboard-only and screenreader accessibility](https://developer.mozilla.org/en-US/docs/Learn/Tools_and_testing/Cross_browser_testing/Accessibility#Accessibility_testing_checklist)~

### For maintainers

~- [ ] This was checked for breaking API changes and was [labeled appropriately](https://github.com/elastic/kibana/blob/master/CONTRIBUTING.md#release-notes-process)~
~- [ ] This includes a feature addition or change that requires a release note and was [labeled appropriately](https://github.com/elastic/kibana/blob/master/CONTRIBUTING.md#release-notes-process)~
2019-05-28 11:14:17 -06:00
Melissa Alvarez ca2a66dd26
return false for each jobId if it does not exist (#37116) 2019-05-28 11:58:43 -04:00
Andrew Goldstein 50bd081722
[SIEM] Fixes timeline notes overflowing the modal (#37134)
## [SIEM] Fixes timeline notes overflowing the modal (#37134)

Beginning in Chrome 74 (see elastic/eui#1902), the timeline notes modal can overflow in some browsers, per the _Before_ gif below.

This fix uses `EuiModal` and other `EUI` components to address the overflow issue across all the browsers tested in the gifs below:

### Before (Chrome `74.0`)

![01-before-chrome](https://user-images.githubusercontent.com/4459398/58355997-4d7d4d00-7e33-11e9-864b-7e77d0635116.gif)

### After (Chrome `74.0`)

![02-after-chrome-74 0](https://user-images.githubusercontent.com/4459398/58356028-6128b380-7e33-11e9-8c7d-3022e45b1f41.gif)

### After (Firefox `67.0`)

![03-after-firefox-67 0](https://user-images.githubusercontent.com/4459398/58356056-6ede3900-7e33-11e9-92ca-a6dd8e0b804b.gif)

### After (Safari `12.1.1`)

![04-after-safari-12 1 1](https://user-images.githubusercontent.com/4459398/58356123-a947d600-7e33-11e9-80ab-d6b3d3c601c0.gif)

### After (IE`11.0.9600`)

![05-after-ie-11](https://user-images.githubusercontent.com/4459398/58356131-aea52080-7e33-11e9-989e-51aab7c4e9da.gif)

https://github.com/elastic/ingest-dev/issues/442
2019-05-28 09:55:52 -06:00
Walter Rafelsberger 149160f261
[ML] Fix to not add configs with names which would result in nesting conflicts (#37212)
Two group-by or aggregation names could result in conflicting nested fields which would return an error for pivot previews. For example, two names like responsetime and responsetime.avg are not allowed.

This PR fixes the issue by extending the tests whether a configuration is allowed to be added to the list of group-by and aggregation configurations. If a conflict is detected, a toast notification gets triggered and the configuration won't be added.
2019-05-28 17:46:04 +02:00
Lisa Cawley 03fe26942e
[DOCS] Facilitates content re-use in the monitoring configuration (#37123) 2019-05-28 08:34:53 -07:00
Walter Rafelsberger 4095908adb
[ML] Fix access denied for data frames. (#37178)
With insufficient privileges, a user would be redirected to the ML plugin's access-denied page which mentions the required user roles to access the pages. Since data frames introduces new user roles these messages were not correct.

This PR fixes it by redirecting to a specific access-denied page for data frames. To avoid to much refactoring as a fix, the page is a copy and port to React of the original one. In a follow up for 7.3, we should merge the two pages and it should have options to display required user roles given a certain context like anomaly detection or data frames.
2019-05-28 17:09:12 +02:00
Liza Katz bc37f86afa
Moved query filter and push filter into filter manager (#36764)
* Moved query filter and push filter from filter bar to filter manager
2019-05-28 17:55:46 +03:00
Brandon Kobel af34b9f3d5
[docs][skip ci] Infrastructure and Logs read only access (#35566)
* Adding a read only access section to the infrastructure docs

* Adjusting where the infrastructure read only access section is and
adding the logs readonly access section

* Fixing grammar
2019-05-28 10:23:08 -04:00
Daniil Suleiman be145478c6
Move all switches to the SwitchParamEditor (#37215) 2019-05-28 17:01:12 +03:00
Walter Rafelsberger 959416a8d4
[ML] Data Frames: Fix to avoid queries for indices with more than 1024 fields. (#37183)
- 7.0 introduced indices.query.bool.max_clause_count which defaults to 1024. This can break certain queries (e.g. simple_query) for indices which have more than 1024 fields (e.g. certain beats indices). The optional data frames query uses simple_query and could therefor break the source index preview as well the pivot preview and pivot job itself given these conditions.
- Originally the default query (* used for simple_query) was always applied for source index previews and pivot previews. A new check isDefaultQuery() will now allow a) the source index preview to use a more efficient match_all query and b) avoid adding the query to the pivot config. This avoids triggering the max_clause_count when no optional query is set.
- If an index has more than 1024 fields, the input form for an optional query will be hidden. A helper text explains the reasoning. This avoids triggering max_clause_count related errors from within the UI. A user can still copy a UI created config to the clipboard and add an optional query in Kibana dev console.
- Additionally, this PR adds a fix to format date fields in the source index preview table using moment-timezone and formatHumanReadableDateTimeSeconds to display dates with the correct timezone.
2019-05-28 15:58:48 +02:00
Dmitry Lemeshko 7c556ca337
TSVB: functional test for color picker, preview disable and series clone (#37186)
* [visualize/_tsvb_chart] test for color picker, changing  preview and cloning series
2019-05-28 14:44:46 +02:00
Matthias Wilhelm 7d21cb1c14
Add automatic alignment to gauge visualisation (#34845)
Add flexibility to alignment of multiple gauge vis by supporting the following alignments: automatic, horizontal, vertical. the default is: automatic, it aligns the gauges depending on screen space to horizontal or vertical

Further Adaptions
- sample data
- migration of saved objects
- removal of jquery as depencency
- adaptions of rendering to prevent clipping
2019-05-28 12:39:01 +02:00
Oliver Gupte 255fc9246e
Closes #36992 by fixing path params bug by checking if serviceName even (#37062)
exists in the current pathname
2019-05-28 00:32:08 -04:00
spalger 288f4715d6 Revert "Fix Canvas fullscreen"
This reverts commit f02c78b8b6
2019-05-27 19:36:11 -07:00
Rashid Khan f02c78b8b6
Fix Canvas fullscreen
Closes #34080

For whatever reason, `Style.it` is unwrapping and dropping the root node of the component it wraps. No idea why. This simply wraps the tree up in a sacrificial `<div/>` for `Style.it` to eat.
2019-05-27 19:25:43 -07:00
Vitali Haradkou ed29276c5f
[TSVB] markdown variables(revert fix) (#34067)
* add markdown tests
2019-05-28 00:26:28 +03:00
Vitali Haradkou 3c0bc3086a
Tsfy screenshot service and comparepng internal lib (#37177) 2019-05-28 00:09:18 +03:00
Alexey Antonov 80d9a255eb
TSVB: selecting the colour picker crashes Kibana (#37176)
Fix: #37115
2019-05-27 15:42:25 +03:00
Dario Gieselaar 57bc4b8334
[APM] Navigate to default transaction sample (#36223)
* [APM] Navigate to default transaction sample

If the distribution data changes, and the currently selected transaction sample is no longer available, we navigate to the default sample of the latest distribution data.

Previously, a displayed sample would "stick" if the new distribution data did not have a default sample.

Readability improvements

Use location primitives

Simplifies hook logic in TransactionDetails/Distribution by only passing the necessary primitives (pathname, hash, search) to the history.replace() call rather than the full location object. Removes the need for memoization w/ useRef too.

Fix lint error

* Remove unused translations

* Simplify redirectToDefaultSample callback

* Use history.location instead of location prop
2019-05-27 09:17:30 +02:00
Mengwei Ding d187ba0242
[Code] improve project status polling management (#36841)
* [Code] improve project status polling management

* [Code] Use make repository status polling cancellable

* change back to 1000ms polling interval

* deduplicate repository status polling runner before run
2019-05-26 16:27:43 -07:00
Mengwei Ding bfadef6daa
[Code] Reset the default search scope (#37014) 2019-05-26 16:27:24 -07:00
Walter Rafelsberger 987b27e381
[ML] Data Frames: Fixes aggregation item overflow. (#37068)
Fixes an issue where long field names would overflow the aggregation item of the pivot config list. This fix was already done for the group-by-items, now brought over to aggregations too.
2019-05-25 18:19:06 +02:00
Dario Gieselaar 58fbf4497e
[APM] Make sure URL hooks are in sync with history.location (#36676)
* [APM] Make sure URL hooks are in sync with history.location

Previously, the `useUrlParams` and `useLocation` hooks were possibly running out of sync with history.location, as they maintained their own state. By listening to history changes, they would re-render their context providers with the updated values. However, the context providers are wrapped by the `Router` component which re-renders the context providers when the location changes. This means that the initial render after a location change would have the updated values in `history.location`, but not in the values returned from the `useUrlParams` and `useLocation` hooks. These hooks would then (both) queue another render with the updated values being passed to the context.

This change lets the hooks piggyback on the re-renders from the `Router` component, and uses `history.location` to pass their derived values to the context. This ensures that the values returned from the hooks and `history.location` are always in sync. It should also remove a few unnecessary renders.

Fix tests

- Passes history as a prop to URLParamsProvider, easier to test and consistent with usage of LocationProvider
- Do not test behaviour of history.replace & re-renders, only whether history.replace was called with the right Location values. This is because re-rendering is no longer a concern of URLParamsProvider, we leave that up to the Router component now.

Address review feedback:

- Use history/location from Router so we have one source of truth for routing info
- For UrlParamsContext, avoid use of history.replace. The behaviour w/ history.replace is incorrect. We now use useRef and trick React into re-rendering with an "empty" state update.
- Unit test for whether useUrlParams does not queue an unnecessary render.

Memoize context value of UrlParamsProvider

* Move infra items back to the top again

Piggybacking on this change to fix an order issue in TransactionActionMenu that was introduced w/ 2e3fbd24a8 (woops).
2019-05-25 17:37:52 +02:00
Walter Rafelsberger 5b03632974
[ML] Data Frames: Fix calendar_interval for date histograms. (#36905)
Fixes the use of calendar_interval instead of interval for date histograms.
2019-05-25 17:10:36 +02:00
Dario Gieselaar 2e3fbd24a8
[APM] Make sure conditions under which transaction menu items are sho… (#37070)
* [APM] Make sure conditions under which transaction menu items are shown are correct

- check for url.domain for uptime link
- always show discover link
- show log link when traceId is set

* Add more tests for TransactionActionMenu
2019-05-25 13:36:11 +02:00
Søren Louv-Jansen 6686b1cce6
[APM] Add useMemo and minor feedback for environment filters (#36970)
* [APM] Add useMemo and minor feedback for environment filters

* Fix types

* Rename to `loadEnvironmentsFilter`
2019-05-25 12:18:49 +02:00
Garrett Spong b393a6e209
[SIEM] Fix for removal of first filter clearing remaining filters (#37135)
## Summary

As outlined in https://github.com/elastic/ingest-dev/issues/419, clearing the first filter within the Timeline Query Builder would result in all the remaining `and`'d filters being cleared as well. This PR fixes that issues, and adds testing to catch a future regressions.

Before:
![filter_query_clear_bug](https://user-images.githubusercontent.com/2946766/58357586-a26f9200-7e38-11e9-8c5e-11bbdfcabfef.gif)


After:
![filter_clear_fix](https://user-images.githubusercontent.com/2946766/58357436-05145e00-7e38-11e9-8a51-b90481afb9b9.gif)


### Checklist

Use ~~strikethroughs~~ to remove checklist items you don't feel are applicable to this PR.

- [x] This was checked for cross-browser compatibility, [including a check against IE11](https://github.com/elastic/kibana/blob/master/CONTRIBUTING.md#cross-browser-compatibility) 
  - IE11 needs this fix to be applicable: https://github.com/elastic/ingest-dev/issues/263
- [ ] ~Any text added follows [EUI's writing guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses sentence case text and includes [i18n support](https://github.com/elastic/kibana/blob/master/packages/kbn-i18n/README.md)~
- [ ] ~[Documentation](https://github.com/elastic/kibana/blob/master/CONTRIBUTING.md#writing-documentation) was added for features that require explanation or tutorials~
- [x] [Unit or functional tests](https://github.com/elastic/kibana/blob/master/CONTRIBUTING.md#cross-browser-compatibility) were updated or added to match the most common scenarios
- [ ] ~This was checked for [keyboard-only and screenreader accessibility](https://developer.mozilla.org/en-US/docs/Learn/Tools_and_testing/Cross_browser_testing/Accessibility#Accessibility_testing_checklist)~

### For maintainers

- [ ] ~This was checked for breaking API changes and was [labeled appropriately](https://github.com/elastic/kibana/blob/master/CONTRIBUTING.md#release-notes-process)~
- [ ] ~This includes a feature addition or change that requires a release note and was [labeled appropriately](https://github.com/elastic/kibana/blob/master/CONTRIBUTING.md#release-notes-process)~
2019-05-24 19:48:53 -06:00
Catherine Liu f78995c055
Fixes check for existing min/max value in axisConfig (#37119) 2019-05-24 17:40:45 -07:00
Catherine Liu 2327a1289a
Remove unused propType (#37138) 2019-05-24 17:39:48 -07:00
Shaunak Kashyap 93970bc222
[Grok Debugger] Trim trailing whitespace in sample data and grok patterns fields (#36245) 2019-05-24 16:57:10 -07:00
spalger d7d392ef32 disable failing test 2019-05-24 16:17:33 -07:00
Todd Kennedy 6d1a8943ce
[feat] add reach-like functionality to object (#37118)
* [feat] add reach-like functionality to object

In #36804 we need to validate a `Partial<HttpConfig>` object which may
or may not have all the required keys attached to it.  This is the type
of use-case for `Joi.reach`, so we should expose a reach-like method on
the object validation class so that you can return the validator for a
specific key on an object.

* [fix] change to validateKey

* [fix] use throw error matcher

* [fix] use same interface for validate

* [fix] change test name]
2019-05-24 15:59:15 -07:00
Chris Roberson 34e6c906b1
[Monitoring] Used fixed_interval explicitly for date_histogram aggregations (#37023)
* Used fixed interval explicitly

* Fix tests
2019-05-24 17:28:04 -04:00
Chris Roberson 1a2ec835e8
Remove improper usage (#37099) 2019-05-24 15:36:27 -04:00
Matthew Kime e390be2f11
No unused vars cleanup set two (#37051)
* no unused vars cleanup
2019-05-24 14:35:21 -05:00
Patrick Mueller 1ec734f715
update CONTRIBUTING.md re: linting with VSCode (#37005)
Adds a note in the Linting section about updating VSCode settings to
see "live" linting for TypeScript.
2019-05-24 15:23:38 -04:00
Lee Drengenberg 67dc8a45aa
Split ciGroup3 and ciGroup5 (#36928)
* split large x-pack ciGroup5 into 3 groups

* split large x-pack ciGroup3 into 2 groups

* Add groups to the jenkins xpack ci group file

* Re-level some more work

* move es_search_source test to new describe block

* move es_search_source to first in ciGroup7
2019-05-24 14:20:43 -05:00
Melissa Alvarez c4277fd1da
[ML] Anomaly explorer query bar - ensure anomalies table results retained after refresh (#37041)
* Don't specify influencers if overall cell selected

* use swimlane type overall constant
2019-05-24 13:26:51 -04:00
Spencer fcf0466a0e
[siem/ui] avoid importing server code in ui (#37103)
* [siem/ui] avoid importing server code in ui

* covert a couple extra imports
2019-05-24 10:18:24 -07:00
Matt Bargar b7b7aa504f
Update QueryBarInput to accept index pattern strings (#36916)
For many use cases a consumer of the QueryBarInput (or QueryBar) might only have an index pattern string in hand. Instead of forcing every consumer to reimplement the fetching logic to get a full pattern object, this PR updates the QueryBarInput to do the fetching itself if the indexPatterns array prop contains any strings. If a string does not exactly match the title of any of the saved objects then we return the default index pattern instead.
2019-05-24 12:09:25 -05:00
igoristic ec1dc71c37
Typecasting the attr boolean to the correct type (#37031) 2019-05-24 11:28:39 -04:00
Corey Robertson 3f4c2c89ec
Revert "[Canvas] Adds telemetry info for custom elements (#36177)" (#37100)
This reverts commit 4fabe6c441.
2019-05-24 10:56:32 -04:00
igoristic 6b26b9c8c6
Swapped the anchor tag with EuiLink (#37020) 2019-05-24 10:05:44 -04:00
Walter Rafelsberger dc228ff2c3
[ML] Data Frames: Fix (error) messages, data field aggs, date picker check. (#36972)
- Layout and message fixes for displaying error messages for the pivot preview in `ml/public/data_frame/components/define_pivot/pivot_preview.tsx
- Fixes list of available date field aggregations.
- Fix to make sure datepicker is always disabled for pivot wizard.
- Fixes incomplete job delete confirm modal message.
2019-05-24 16:05:00 +02:00
Maryia Lapata cdd1a1d829
[Vis] Move propFilter from ui/filter to ui/agg_types/filter (#36875)
* Move propFilter from ui/filter to ui/agg_types/filter

* Return default value

* Make propFilter generic

* Convert propFilter from a mocha test to a jest test
2019-05-24 16:51:10 +03:00