Commit graph

25343 commits

Author SHA1 Message Date
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
stevedodson
9463fd8778
[ML] Improve anomalies in Kibana sample data (#36982)
* [ML] Sample ML jobs: Updates to make anomalies clearer

Minor updates to web logs data and ML job
definitions to make anomalous activity more
distinct.

* [ML] Sample ML jobs: Further updates to jobs and data

Adding missing files from previous commit and
changing job naming (removing weblog_* prefix etc.)

* [ML] Resolving PR review comments.

* [ML] Improve anomalies in Kibana sample data

Minor fixes:
- Rename job group to `kibana_sample_data` throughout
- Fix index pattern link in `sample_data_sets.ts`
- Fix log.json.gz count test
2019-05-24 15:32:06 +02:00
Søren Louv-Jansen
673d92ef23
[APM] Fix encoding issue with forward slash in path (#37072) 2019-05-24 15:18:42 +02:00
Artyom Gospodarsky
82fa749d20
[TSVB] Get rid of default export on TSVB (#36872)
The `import/no-default-export` has been turned on for TSVB.

* Get rid of default export on TSVB
* Change eslint rules lines
2019-05-24 16:16:54 +03:00
Chris Roberson
eb2ede6ca2
[Monitoring] Fix 500 error from /api/stats (#36986)
* Fix 500 and add test for it

* Return an empty object so the logic later will still execute

* Update tests
2019-05-24 09:11:05 -04:00
Chris Roberson
3da94ccb0d
Once the buffer has any events, the collector is always ready (#36995) 2019-05-24 09:08:38 -04:00
Corey Robertson
4fabe6c441
[Canvas] Adds telemetry info for custom elements (#36177)
* Adds telemetry info for custom elements

* Addresses PR feedback, converts to TS

* Fix bad equality check

* Fix problem with errored query

* Fix eslint issue with typescript

* Switch from export * to stop eslint complaining

* Fix test

* Clean up TS and tests

* Remove unused imports
2019-05-24 08:40:24 -04:00
Alexey Antonov
9d759a273e
[TSVB] Rollup Search - override index pattern functionality is not working with Rollup search (#36641) 2019-05-24 15:23:50 +03:00
Joe Reuter
3232fc80d1
Expressions service (#36885) 2019-05-24 14:07:26 +02:00
Maryia Lapata
5e59de262b
Remove unused translations (#37069) 2019-05-24 13:22:51 +03:00
Vitali Haradkou
2db82c549f
[TSVB] Table tests (#36762)
* implement table tests
2019-05-24 12:09:35 +03:00
Alexey Antonov
cca9ba8a2c
[TSVB] Fix Rollup Search with auto interval for Rollup Jobs in calendar intervals (#36081)
* auto interval

* [TSVB] Rollup Search - 'auto' interval is not working for Rollup Jobs which were created in Calendar intervals

* [TSVB] Rollup Search - 'auto' interval is not working for Rollup Jobs which were created in Calendar intervals

* fix issue

* fix broken tests

* fix pr comments

* fix pr comments
2019-05-24 11:37:52 +03:00
Maryia Lapata
80193a1f03
[Tagcloud] Allow to send showLabel parameter with false value (#36563)
* Allow to send showLabel parameter with false value

* Add unit test
2019-05-24 08:12:35 +03:00
Peter Pisljar
0259b96242
moves ui out of index patterns service (#36348) 2019-05-24 06:52:21 +02:00
Xavier Mouligneau
8070a1fd59
[SIEM] Remove imports from server folder (#37037)
* remove import from server folder

* the other way around too
2019-05-23 23:48:24 -04:00
WangQianliang
ff514619e0
[Code] fix query string key conflict (#36620)
* fix code query string key conflict

* fix code go to definition url
2019-05-24 11:37:15 +08:00
WangQianliang
8e53461b9b
feature(code/frontend): breadcrumb links to code root and project root (#34252) 2019-05-24 11:26:04 +08:00
Yulong
12291513f7
[Code] refactor launcher code, add unit tests (#36863) 2019-05-24 10:00:57 +08:00
Nathan Reese
f77d67d740
[Maps] update docs for proxyElasticMapsServiceInMaps configuration (#36914)
* [Maps] update docs for proxyElasticMapsServiceInMaps configuration

* Update docs/setup/settings.asciidoc

Co-Authored-By: gchaps <33642766+gchaps@users.noreply.github.com>

* Update docs/setup/settings.asciidoc

Co-Authored-By: gchaps <33642766+gchaps@users.noreply.github.com>

* Update docs/setup/settings.asciidoc

Co-Authored-By: gchaps <33642766+gchaps@users.noreply.github.com>
2019-05-23 14:26:44 -06:00
igoristic
92ebb088d1
Fix sorting of Monitoring nodes on CPU, Throttle, Heap columns (#36125)
* Complete rebase

* Testing

* Retest

* Made the get method more compatible
2019-05-23 13:29:25 -04:00
spalger
82cf671fb8 disable github-checks-reporter temporarily 2019-05-23 10:06:59 -07:00
Gergely Kalapos
deb4eac0cd
Fix minor typo (#35743) 2019-05-23 18:30:39 +02:00
Oliver Gupte
135702b82b
[APM] Global filters: Show service.environment in Services list (#36920)
* [APM] Closes #34918, by listing service environments as badges. When
greater than 2 badges would be shown, condense into a summary badge with
a tooltip

* [APM] add i18n text for environment label
2019-05-23 09:14:19 -07:00
Liza Katz
218c45fb65
Query filter: Remove dependency on config inject (#36109)
* Removed config inject
* retrieve config from new platform
2019-05-23 11:39:18 -04:00
spalger
282c5e184f [kbn-es] retry on all error types while setting up native realm
(cherry picked from commit a578261158)
2019-05-23 07:51:18 -07:00
Andrew Cholakian
29431b216f
[Uptime] Fix accidentally introduced double URL column (#36844)
This came with a merge conflict by mistake
2019-05-23 09:51:08 -05:00
Garrett Spong
4484b17197
[SIEM] Bugfix for Events Table query timestamp regression (#36952)
## Summary

There was a regression that resulted in the `timestamp` field not being returned as part of the Events Table query. This PR fixes that and adds an api integration test that will catch this in the future.

Before Fix:
![image](https://user-images.githubusercontent.com/2946766/58217994-8518b780-7cc2-11e9-8abd-5c54c6d5c67d.png)

After Fix:
![image](https://user-images.githubusercontent.com/2946766/58218059-c3ae7200-7cc2-11e9-9427-b9c16c9be0e0.png)




### Checklist
~- [ ] 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~
- [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-23 08:47:24 -06:00
WangQianliang
572ecb9d2a
disable explore_repository and history functional tests (#36865)
fix code functional test click file tree item
2019-05-23 22:17:20 +08:00