Commit graph

188 commits

Author SHA1 Message Date
Larry Gregory
632c63ab21
[6.x] Spaces Phase 1 (#21408) (#23639)
Backports the following commits to 6.x:
 - Spaces Phase 1  (#21408)
2018-10-01 09:53:43 -04:00
Walter Rafelsberger
dfe08d1d9b
[ML] Fix view link regression. (#23604) (#23607)
Fixes a regression introduced in #23494. The view link was broken because it expects a callback with an action instead of just the link.
2018-10-01 13:02:37 +02:00
Walter Rafelsberger
6e4ffe9228
[ML] Improve Explorer Chart labels. (#23494) (#23597)
Improves the display of the Explorer Chart labels to fix the following issues:
- Long chart labels could be cut off, so it's not possible to tell what entity fields a chart is referring to. A workaround is to hover the info icon tooltip but that's really slow and cumbersome if you have to do it for every chart.
- The list of entity fields and its values is an unformatted text blob which makes it hard to read and tell which values refer to which field.

Changes:
- If any of the chart labels is longer than 60 chars, the entity fields will wrap to a new line (for all charts to a achieve a consistent look).
- Entity fields use EuiBadge and some custom formatting to make it easier to see field/value pairs.
- If the detector description is too long, it still uses ellipsis for text-overflow:
- If the entity badges are too long, they will be just cut off to the right. There's no simple CSS fix for that, we cannot use ellipsis and we don't want to wrap those badges again because then multiple charts could have different heights. I experimented with gradients but that turned out to be somewhat unreliable. I still consider this a good enough improvement compare to the previous version and would like to leave a tweak for that to a follow up PR.
- If there are mixed detectors with and without entity fields and the existing one wrap, multiple charts are aligned considered the height of the entity fields on display:
- Additionally, this changes the link to the single series viewer from custom code using a Font Awesome icon to use EuiButtonEmpty with the same EUI based icon and a tooltip.
2018-09-28 11:34:27 +02:00
Walter Rafelsberger
1e0f9d005f
[ML] Fixes Anomaly Explorer IE11 issues (#23558) (#23576)
Fixes two issues in IE11 for Anomaly Explorer:
- The format of the string returned from element.attr('transform') is different in IE11 so the regex based on it would fail. This fixes the issue and adds tests for the different formats. The code was also changed to gracefully return NaN in case the regex wouldn't return results, the previous version triggered a JS error.
- The migration of the swimlanes to React caused the cell selection to malfunction in IE11. This fixes it by updating the dragSelect library to use the new method setSelectables. The previous method we used (addSelectables) didn't play well with how React rerenders the swimlanes. Note this lib update using the new method will require to run yarn kbn bootstrap.
2018-09-27 21:11:39 +02:00
James Gowdy
9f42042aec
[ML] Fixing duplicate influencers when cloning a job via a wizard (#23484) (#23495) 2018-09-26 09:42:22 +01:00
Melissa Alvarez
61e4a1bbdb
Add context to job picker for accessibility (#23483) (#23496) 2018-09-25 18:38:05 +01:00
James Gowdy
59ca4666b5
[ML] Fixing issue when editing script fields in advanced job creator (#23475) (#23485) 2018-09-25 17:41:51 +01:00
pavel06081991
4c331b1348
Update versions of @babel/parser and @babel/types (#23268) (#23469)
Update versions of @babel/parser, @babel/types, eslint, babel-eslint
2018-09-25 16:18:05 +03:00
James Gowdy
faf538369d
[ML] Fixing missing field when cloning a distinct count job (#23439) (#23454) 2018-09-25 13:37:10 +01:00
Walter Rafelsberger
93383c8457
[ML] Fix Limit Dropdown, simplify state management of Anomaly Explorer. (#23388) (#23440)
- This fixes the limit dropdown behavior. The fix for that is actually just the $scope.appState.fetch(); statements in explorer_controller.js, they avoid to run the information stored in appState across modules out of sync.
- Additionally, the aim of this PR is to simplify the state management of Anomaly Explorer in the context of selecting cells in the swimlanes and updating the influencers list, charts and table accordingly.
2018-09-24 18:33:12 +02:00
Walter Rafelsberger
40d2dcda12
[ML] Fixes Anomaly Explorer resize listener. (#23427) (#23429)
Fixes the cleanup of the resize listener once you change to another page within the ML plugin.
2018-09-24 15:37:32 +02:00
James Gowdy
848de4dbfb
[ML] Fixing various issues when cloning a job using a wizard (#23368) (#23412) 2018-09-22 11:44:49 +01:00
Tyler Smalley
b93b868b0f
Moves styleSheetPath to uiExports (#23007) (#23385)
This was previously defined in uiExports.app, which limited plugins which are not an app of providing a stylesheet. This allows any plugin to define a stylesheet which will be available on page load.
2018-09-20 20:42:04 -07:00
Pete Harverson
bee1f84170
[ML] Moves custom URL editor Add button and form to top of flyout (#23326) (#23352)
* [ML] Moves custom URL editor Add button and form to top of flyout

* [ML] Edits to custom URL editor class name
2018-09-20 15:06:35 +01:00
Walter Rafelsberger
cd743dcc94
[ML] Fixes a race condition where the chart tooltip could be hidden even if it should be shown. (#23270) (#23308)
- Even with the check if fadeTimeout was set in show(), I could reproduce race conditions where a new tooltip would disappear again, because a previous fadeTimeout would trigger and set the new tooltips display to none.
- This PR fixes it by adding a non-asynchronous visible flag to mlChartTooltipService to check if the tooltip should stay visible if fadeTimeout triggers.
2018-09-20 08:55:57 +02:00
Pete Harverson
4ac2d08595
[ML] Fix bug in Explorer chart range if selection has too many points (#23267) (#23275)
* [ML] Fix bug in Explorer chart range if selection has too many points

* [ML] Remove unnecessary newline added in calculateChartRange
2018-09-19 09:27:59 +01:00
Pete Harverson
063c1ec27f
[ML] Removes job ID from detector description for duplicates (#23192) (#23224) 2018-09-17 13:02:16 +01:00
Pete Harverson
050b9a4b3d
[ML] Fixes z-index of Explorer severity combo box for job picker (#23189) (#23195) 2018-09-17 09:34:46 +01:00
Walter Rafelsberger
677f749a8e
[ML] Deprecates the use of jQuery for rendering Anomaly Explorer Swimlanes (#23000) (#23193)
- This refactor gets rid of jQuery as a requirement for the Anomaly Explorer Swimlanes. All the DOM manipulation previously done by jQuery is now done by d3.
- The primary aim here is to replace jQuery with d3. To avoid refactoring regressions, this PR sticks as much as possible to the original structure. Overall, this could be done in a more "d3"-way, but it's a good start.
- The resulting DOM is a bit different: The structure is exactly the same, just how we use certain data-attributes changed.
- Instead of using jQuery's data-feature for storing click event data, that data is now directly stored on DOM nodes. Again, this could be done in a more "d3"-way but would require quite some further refactoring.
2018-09-17 09:48:02 +02:00
Joe Fleming
1346d1aeda
[6.x] Chore: canvas in xpack 6x (#22695) (#23201)
* chore: merge canavs into x-pack

squashed, since 6.x history isn't important and i want to be able to rebase...

* chore: eslint fixes in canvas

adds license headers and includes project linting overrides

* Chore: Reorg the x-pack gulp tasks (#22785)

- Removes deprecated, non-functional lint scripts
- Removes some unused (and barely used) dependencies
- Replaces deprecated `gulp-util` dependency
- Adds eslint rule to prevent future use of deprecated `gulp-util` dependency
- Moves all gulp tasks into `tasks` path
- Moves `gulp_helpers` into `tasks/helpers`
- All tasks in `gulpfile.js` were moved into `tasks` and broken up by domain

This is basically a no-op moving files around PR. All the existing tasks appear to work the same with these changes.

<img width="334" alt="screenshot 2018-09-06 15 42 45" src="https://user-images.githubusercontent.com/404731/45188971-8618c000-b1eb-11e8-9b26-b072ccc7ddb7.png">

* chore: rename files to match rules

* chore: copy canvas dependencies

* chore: reduce package.json to essentials

* chore: make canvas work in xpack

* chore: make browser tests work

* chore: fix include paths

node_modules is in a different relative path

* chore: fix ml tests with canvas code in x-pack

explicitely enable state management so the mlStateFactory tests pass

* chore: fix RBAC tests with canvas

* chore: split up the xpack prepare scripts

* chore: canvas tasks - dev, peg, and plugins

get dev, peg, and plugin building tasks working

* chore: canvas tasks - local tests

* chore: additional file cleanup

* chore: yarn lockfiles and eslint fixes

license headers and some small formatting stuff
2018-09-14 16:26:56 -07:00
dave.snider@gmail.com
9846e026b4
[6.x] Backport EUI@4.0.1 #23009 (#23203) 2018-09-14 14:10:43 -07:00
Caroline Horn
acd01a4881
Resolve conflicts (#23197) 2018-09-14 15:28:25 -04:00
Pete Harverson
067e162aa8
[ML] Add links to rule editor for quick edit of value or filter (#22990) (#22997)
* [ML] Add links to rule editor for quick edit of value or filter

* [ML] Updates to rule editor quick links following review
2018-09-13 20:25:32 +01:00
Walter Rafelsberger
ecfbfa7281
[ML] Fix reloading anomaly charts on resize. (#22967) (#22995)
- Fixes a regression introduced in #22814. Because of the stricter checking for scope/props updates, resizing the browser window would miss updating the Anomaly Explorer Charts widths. This fixes it by adding a check to trigger anomalyDataChange in redrawOnResize().
- Additionally, if only one chart is up for display, this update makes sure a single chart always spans across the full available width.
2018-09-13 17:31:10 +02:00
Walter Rafelsberger
49bfcc6d63
[ML] Fixes loading the influencers for Anomaly Explorer. (#22963) (#22989)
- This fixes a regression introduced in #22814. The influencer list wouldn't update if no cell in the swimlanes was selected.
- Renames getTopInfluencers to loadTopInfluencers to be in line with the other functions loadDataForCharts and loadAnomaliesTableData
- Changes the order of arguments for loadDataForCharts so they are the same like in loadTopInfluencers.
2018-09-13 14:18:57 +02:00
Walter Rafelsberger
7a788a219d
[ML] Explorer Chart Tweaks (#22955) (#22957)
- The aim of this is to more clearly visualize how the timerange of the cell selected in the swimlane relates to the time span shown in the charts.
- The most important change is that the vertical date axis ticks no longer are randomly positioned by d3. Instead they are aligned with the cell interval of the swimlane. This way, the date information shown in the swimlane tooltip will always align with the date tick shown left of the emphasized area in the chart.
- The highlighted area now features a gray rounded border to resemble the styling of the selected cell in the swimlane.
- The chart also fixes where to long chart headers would wrap the "View" link to a new line.
- The x/y axis labels blackness has been reduced to reduce emphasis on the labels.
2018-09-12 15:06:59 +02:00
Walter Rafelsberger
704667feb8
[ML] Fixes Anomaly Explorer Swimlane race condition, adds tests. (#22814) (#22923)
This PR addresses parts of #22642:
- It gets rid of the use of var that = this;.
- dragSelect's action strings are moved to a constants file.
- Adds jest tests for the ExplorerSwimlane component.

This also fixes the following bugs:
- The way we subscribe listeners to the events of the dragSelect library could result in the same event being triggered multiple times. This in turn could cause race conditions when on each event new data gets fetched but in between angular's scope gets updated and could end up in a non-intended way. The result of this were view-by swimlanes not updating correctly or anomaly charts showing non-related charts. This PR fixes it by filtering out consecutive swimlane click events.
- When the angular based chart container wrapper directive gets destroyed/re-esetup when using the job pick, it missed unmounting the react component, it didn't trigger componentWillUnmount()and didn't unsubscribe from dragSelectListener.
2018-09-11 14:14:30 +02:00
Spencer
9a7fa9a938
Upgrade to Jest 23.5.0 (#22791) (#22846)
I'd really like to upgrade to Typescript 3 for its `unknown` type, but we need to upgrade to `jest@23` to support a recent version of `ts-jest@23`.

The [jest changelog](https://github.com/facebook/jest/blob/master/CHANGELOG.md) breaks down the breaking changes in 23.x, but I found it to be slightly incomplete so I've broken down the changes that actually caused breaks for us here, and addressed each in individual commits to make review a little easier:

- the `testURL` config default was changed from `about:blank` to `http://localhost`
    - this cause some XHR requests powered by JSdom to start failing. It seems these requests just do nothing in master but start to fail when JSdom is initialized with an actual URL... I think we would ideally stop sending meaningless XHR requests in the tests, but it was a lot easier to just set the config to `about:blank` for now, and we can worry about cleanup later if necessary
- `expect(...).toThrow()` only passes if an actual error was thrown.
     - In two places in the index pattern code we were throwing strings, which broke the assertions. Fortunately/Unfortunately the errors are not being consumed by anything, so I was able to wrap them in `new Error()` without causing any issues.
- snapshots of mock functions now include a `results` array, detailing the return values of the function
- React fragments are now serialized as `<React.Fragment>` instead of `<UNDEFINED>`
- undefined props in React components are now stripped from snapshots
- minor changes to the ordering of mocks, imports resolution, and before hooks caused the uiSettings API tests to start breaking, but I'm replacing them with totally new tests in #22694 so I just deleted them here
- mocks created with `jest.spyOn()` that are restored now have their `mock.calls` reset, so some of the kbn-pm tests stated failing. This was fixed by restoring them with `jest.restoreAllMocks()` rather than trying to do it before the assertions
2018-09-07 20:30:49 -07:00
James Gowdy
e3865d5e93
[ML] Disabling single metric viewer links for non-applicable jobs (#22809) (#22822)
* [ML] Disabling single metric viewer links for non-applicable jobs

* renaming variable

* renaming variable again
2018-09-07 18:09:15 +01:00
Walter Rafelsberger
e571490e7c
[ML] Anomaly Explorer Charts jest tests. (#22759) (#22796)
After the migration to React in #22622, this PR adds more test coverage based on jest to the Anomaly Explorer charts. This is done as preparation for some further refactoring (#22626) and the integration of the support for charts for the rare detector (#21163). The tests use mock data based on a standard multi-metric job using the farequote dataset.
Besided the tests this PR includes the following changes:
- In explore_series.js the path is no longer a concatenanted string but now using a template literal
- The exploreSeries() function is no longer calling window.open by itself, it just returns the link
because of the above, renamed exploreSeries() to getExploreSeriesLink() and moved it to chart_utils.js
- explorer_charts_container_service.js is no longer requiring jQuery itself, it now receiving the required element as a factory argument. Further work on this is planned to get rid of jQuery.
2018-09-07 13:23:43 +02:00
Pete Harverson
80520e0b3a
[ML] Makefield type icon component keyboard accessible (#22708) (#22736) 2018-09-06 09:11:41 +01:00
James Gowdy
2a95660bd1
[ML] Fixing issue with incorrect timezones in jobs list (#22714) (#22721)
* [ML] Fixing issue with incorrect timezones in jobs list

* refactoring min and max calculation

* changes based on review

* changing TimeStamp to Timestamp
2018-09-05 19:57:42 +01:00
Tim Roes
46709c62b0
Move timezone settings into autoload file (#22623) (#22706)
* Move timezone settings into autoload file

* Remove applying setting from timelion

* Remove manual set from ML

* Remove manual set from monitoring

* Remove now obsolete code from embedding test plugin
2018-09-05 12:03:59 +02:00
James Gowdy
3095ddad81
[ML] Removing calendars from job when cloning (#22667) (#22677) 2018-09-05 09:18:57 +01:00
James Gowdy
ffd7095bb1
[ML] Adding milliseconds to watch start and end times (#22659) (#22673) 2018-09-04 21:26:40 +01:00
James Gowdy
4e991bbc78
[ML] Fixing links to results for obs with no results (#22650) (#22671) 2018-09-04 21:26:20 +01:00
Walter Rafelsberger
52fdc1118b
[ML] Migrates Anomaly Explorer Swimlanes to React (#22641) (#22651)
- This PR migrates the Anomaly Explorer Swimlanes from angularjs to React.
- The approach is similar to the one from #22622: Try to refactor as little of the actual logic as possible, just make sure everything works inside the React component lifecycle. So as a guide for the review: No actual code within all the functions/methods changed, only the bits and pieces which needed to be tied into the React component lifecycle.
- The remaining wrapping angular directive is now only listening for data changes and passes its scope and other necessary data on as props to the React component.
2018-09-04 17:16:36 +02:00
Walter Rafelsberger
4cda7caf95
[ML] Migrate Explorer Charts to React. (#22622) (#22632)
This migrates the Anomaly Explorer charts to React. The PR aims to change as little of the actual logic to create and render the charts.
2018-09-04 10:58:49 +02:00
James Gowdy
6b4383a509
[ML] Adding string type check to jobs list search (#22627) (#22629) 2018-09-04 08:55:18 +01:00
Larry Gregory
df453a6383
Bump EUI to 3.7.0 (#22287) (#22392)
Upgrades EUI from 3.6.1 => 3.7.0
2018-08-25 11:02:13 -04:00
Pete Harverson
0218afc961
[ML] Fixes position of Single Metric markers for long agg intervals (#22055) (#22063) 2018-08-16 15:30:54 +01:00
Pete Harverson
a7b26dba1b
[ML] Add validation of label and time range when editing custom URLs (#21960) (#21993)
* [ML] Add validation of label and time range when editing custom URLs

* [ML] Edits to custom URL validation following review
2018-08-16 11:28:21 +01:00
James Gowdy
685aa37234
[ML] Fix painless script in ML watch (#21998) (#22014) 2018-08-16 09:37:43 +01:00
Nathan Reese
182cf2fd7f
Eui 3.6.0 (#21968) (#22019)
* bump EUI to 3.6.0

* replace CopyButton with EuiCopy

* remove snapshot file from deleted CopyButton component
2018-08-15 15:35:44 -06:00
Jen Huang
f48d6c8618
Upgrade to EUI 3.4.0 (#21870) (#21964)
* Upgrade to EUI 3.4.0
* Update snapshots
2018-08-15 10:43:53 -07:00
Pete Harverson
660775ca63
[ML] Add aria-label to calendar and jobs list buttons (#21922) (#21959)
* [ML] Add aria-label to calendar and jobs list buttons

* [ML] Simplify building of Jobs List expanded row icon aria-label
2018-08-14 15:41:30 +01:00
dave.snider@gmail.com
c046140fcf
Convert all Less files to Sass in discover, use EUI variable scope (#21290) (#21943)
Discover now uses sass for its styling
2018-08-13 15:54:18 -07:00
Pete Harverson
adec070f9b
[ML] Disable auto focus on job wizard select index or search page (#21913) (#21915) 2018-08-13 14:14:34 +01:00
Walter Rafelsberger
4284d9ed27
[ML] Fix bucket span estimation for machine learning admin user. (#21866) (#21912)
This fixes bucket span estimation for the machine learning admin user when security is enabled. The original issue was that the machine learning admin by default doesn't have the necessary permissions to call cluster.getSettings to get the settings search.max_buckets. This is now fixed by using callWithInternalUser() and additional permissions checks.
2018-08-13 12:40:54 +02:00
James Gowdy
af1904c8d6
[ML] Adding group selector to jobs management (#21780) (#21814)
* [ML] [WIP] Adding group selector to jobs management

* adding group name validation

* removing comment

* adding keyboard events

* moving new group input to its own component

* changes based on review

* adding tooltip

* adding better error reporting
2018-08-09 09:46:33 +01:00