Commit graph

844 commits

Author SHA1 Message Date
Spencer 674d65bb58
Upgrade to TypeScript 3 (#22792) (#22927)
LGTM 🎉 🎉 🎉
2018-09-11 14:14:17 -07:00
Stacey Gammon 753cfad195
Typings for chromium driver (#22688) (#22839)
* Typings for chromium driver

* buffer => base64

* remove unused param. consolidate imports
2018-09-08 08:05:54 -04: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
Aleh Zasypkin b0767168af
[6.x] Implement LegacyService. Use core to start legacy Kibana. (#22769)
* Implement `LegacyService`. Use `core` to start legacy Kibana.

* Fix Worker tests

* Do not rely on kbnServer when testing mixins.
2018-09-07 07:56:43 +03:00
Felix Stürmer 3b2823d433
Update redux, react-redux and corresponding types (#22442) (#22487) 2018-08-29 18:59:39 +02:00
Spencer 0d00b4088f
[ftr] capture test output and only log on failure (#21903) (#22436)
This is an attempt to write a log capture integration for the functional test runner that will collect all log output written during a test, prevent it from being written to stdout to lower the amount of work Jenkins master has to do and include the entire log output for each test in the junit report. I'm slightly concerned about the amount of memory we'll be using to store a copy of the logs for each test, but streaming the XML report isn’t easy and there doesn’t seem to be a library out there to help. If we decide it’s torally necessary we might be able to figure it out.
2018-08-27 21:21:08 -07: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
Leanid Shutau c6309b91e8
Add ability to skip file writing for messages extraction tool (#21588) (#22247)
* Add ability to skip 'en.json' file writing for default messages extraction tool

* Update default messages extractor

* Add namespace validation

* Update tests

* Fix i18n config file

* Add ability to choose output JSON format

* Update output json properties keys
2018-08-22 16:48:15 +03:00
Jonathan Budzenski e2a43a9316
Bump node to 8.11.4 (#22045) 2018-08-16 13:05:05 -05:00
dave.snider@gmail.com a3d1b83d98
EUI 3.6.1 (#22034) (#22038) 2018-08-15 18:58:16 -07: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
Jonathan Budzenski 225ee1ff49
Bump chromedriver to 2.41.0 (#21798) 2018-08-15 13:32:13 -05: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
Jonathan Budzenski e5d110cc55
[build] more cleaning (#21746) (#21934)
* [build] remove npm

* remove angular-ui-bootstrap

* fix

* remove bodyParser, fetch mock to dev

* remove more packages

* remove check-hash;

* remove babel-eslint

* remove marked-text-renderer

* move fetch-mock to dev dependencies

* Revert "remove babel-eslint"

This reverts commit 37d3df9146cdab24661022b9edf4aa2fd3b14e30.

* fix npm path

* fix again

* remove entire node_modules dir

* CleanNodeTask -> CleanNodeBuildsTask

* move to node folder

* remove more
2018-08-13 14:18:19 -05:00
Tyler Smalley db6e384cfa
[scss] Adds autoprefixer support and improves watcher (#21656) (#21897)
This adds support for autoprefixer which we have been using in Webpack.

Additionally, we have improved the watching functionality and now update builds based directly on their dependencies an not an assumption that the files are children.

Signed-off-by: Tyler Smalley <tyler.smalley@elastic.co>
2018-08-12 10:30:12 -07:00
Stacey Gammon e9273cdb1e
typescript more dashboard panel code (#21810) (#21905)
* typescript more dashboard panel code

* use ? instead of | undefined
2018-08-12 08:38:07 -04:00
Spencer 70b1ed6737
[TypeScript] add type-check script (#19325) (#21868)
* [TypeScript] add type-check script

* [ci] run scripts/type_check after linting

* [ts] improve filterProjectsByFlag readability

* fix typo

* simplify type signature
2018-08-10 10:20:19 -07:00
Tyler Smalley fef8355653
Upgrade uglifyJS webpack plugin, disabling compress and enabling parallel (#21809) (#21822) 2018-08-08 18:39:47 -07:00
Brandon Kobel c88b5674e1
[6.x] Switching from jade to pug (#21047) (#21338)
* Switching from jade to pug (#21047)

* Upgrading pug

* Switching .jade to .pug and fixing templates

* Renaming the I18N usages of jade to pug

* No more jade in I18N

* Renaming root_redirect to .pug
2018-08-07 10:21:05 -04:00
Leanid Shutau 8c708f0108
Implement a build tool for default messages extraction (#19620) (#21580)
* Implement a build tool for default messages extraction

* Refactor extraction tool, resolve review comments, fix bugs

* Resolve comments, refactor extraction tool, fix bugs

* Add context to messages extraction tool

* Resolve comments

* Fix bugs

* Add messages extraction from .jade files, refactor code

* Add template literals parsing

* Return defaultMessages.json to plain structure

* Refactor utils

* Fix bugs

* Refactor code, resolve review comments, fix bugs

* Fix minor bug

* Get rid of '@babel/traverse' and add its native implementation

* Add handlebars messages extraction

* Fix mkdir on macOS

* Fix bugs, inject default formats, finalize the tool

* Fix filsystem permissions

* Refactor nodes traversal

* Update code style

* Downgrade @babel/types to fix build issues

* Resolve comments

* Fix minor bugs
2018-08-02 15:18:12 +03:00
Leanid Shutau 1d0e4381dd
Add draft implementation of I18n engine (#19555) (#21473)
* Add draft implementation of I18n engine

* Add i18n loader

* kbn-i18n refactoring

* Fix react i18n context and update doc

* i18n engine refactoring

* Fix locales data loading and add more jsdoc comments

* Fix verify_translations task

* I18n tests refactoring

* Add build scripts to kbn-i18n package

* Fix some bugs

* Move uiI18nMixin into ui_i18n folder

* Add 'browser' field to kbn-i18n package.json

* Get rid of "showError" method

* Make i18n and i18nLoader a singleton object

* Add default locale as fallback if translation files were not registered

* Update yarn.lock

* kbn-i18n fix

* Add default formats

* Try to fix build

* Add more examples into kbn-i18n/README.md

* kbn-i18n fix

* Fix app_bootstrap tests

* Add links to issues in TODO comments
2018-08-01 14:17:07 +03:00
Felix Stürmer 3c68efd2d1
[6.x] Upgrade prettier to version 1.14.0 (#21466) (#21482)
Backports the following commits to 6.x:
 - Upgrade prettier to version 1.14.0  (#21466)
2018-07-31 18:27:22 +02:00
Spencer 519a9300ba
Migrate ui/notify/fatal_error to new platform (#20752) (#21452)
Fixes #20695

Extracts the "fatal error" handling logic from the `ui/notify` module and reimplements it in the new platform, using EUI for the fatal error page and continuing to support the `fatalError()` and `addFatalErrorCallback()` methods exported by the `ui/notify` module.

![image](https://user-images.githubusercontent.com/1329312/43032175-d37fbafc-8c65-11e8-8f1f-da71f0dac014.png)
2018-07-30 18:04:09 -07:00
Nathan Reese 72a4df5b25
backport (#21455) 2018-07-30 18:22:00 -06:00
dave.snider@gmail.com 44f5fa7d48
EUI@3.0.3 (#21363) (#21366) 2018-07-30 12:23:14 -07:00
Nathan Reese a4e0fa1bd4
add mutation observer polyfill for jest test env (#20996) (#21409)
* add mutation observer polyfill for jest test env

* use polyfill from npm

* set bluebird scheduler

* use correct version in comment about bluebird
2018-07-30 10:05:03 -06:00
Brandon Kobel 2b2e65298f
Updating minimatch (#21050) (#21340) 2018-07-27 09:38:29 -04:00
Tyler Smalley 860daa257a
Bump to 6.5.0 (#21210)
Signed-off-by: Tyler Smalley <tyler.smalley@elastic.co>
2018-07-25 08:25:05 -07:00
archana 725782ebb7 Deprecate test:ui commands (#21092)
* Deprecate test:ui commands
2018-07-23 14:49:21 -05:00
Søren Louv-Jansen 6013c7641d
Bump backport to 4.2.0 (#21083) (#21088) 2018-07-23 20:05:53 +02:00
Spencer 801e5c0b2f
[kfetch] TypeScript-ify (#20914) (#20983)
In order to make the awesome new kfetch api easier to consume in purely TypeScript projects, and since it's a pretty small module with very few dependencies, I converted it to TypeScript.

Along with kfetch I also started a type definition file for `ui/chrome` that we can extend as we go, but will likely be unnecessary after #19992
2018-07-19 15:37:25 -07:00
Tim Roes 6a9b2f975c
Move del to dependencies (#20921) (#20926) 2018-07-18 15:19:49 +02:00
Stacey Gammon 2355bb10c3
Bump eui (#20774) (#20909)
* bump eui

* Fixed breaking `EuiPage` changes

Mainly adding `EuiPageBody`’s where there were none

* bump to 3.0, remove duplicate declaration of EuiFlyoutBody, update jest snapshots

* bump eui

* bump to 3.0, remove duplicate declaration of EuiFlyoutBody, update jest snapshots

* Update jest snapshots in xpack
2018-07-17 20:45:11 -04:00
Felix Stürmer 021ca43849
Upgrade typescript to 2.9.2 (#20757) (#20865)
This upgrades TypeScript to version 2.9.2. My main motivation is the support for generic type arguments in JSX elements and tagged templates (e.g. for `styled-components`).

Problems arising from breaking changes in the new TypeScript version have been mitigated by:

* setting the `keyofStringsOnly` option until impacted code has been
  future-proofed
* Restricting some joi-related generics

See the [release notes](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-2-9.html) for details.

Some follow-up tasks should be:

* Update EUI to support the new `keyof` behaviour
* Update new platform TypeScript code to support new `keyof` behaviour
* Remove `keyofStringsOnly` setting
2018-07-17 11:23:09 +02:00
Tiago Costa 3fab7f6aa7
chore(NA): bump chalk version dependencies and update lock files. (#20629) 2018-07-13 00:27:23 +01:00
CJ Cenizal 3d2a1613ae
Add ability to abort a kfetch call. (#20700) (#20748)
* Split kfetch module into kfetch and kfetchAbortable sub-modules.
* Add abortcontroller-polyfill.
2018-07-12 16:20:59 -07:00
Aleh Zasypkin f88d0b92a2
Integrate new platform (core) server side into Kibana (#20661)
Co-authored-by: Kim Joar Bekkelund <kjbekkelund@gmail.com>
Co-authored-by: archana <archanid@users.noreply.github.com>
Co-authored-by: Spencer <spalger@users.noreply.github.com>
Co-authored-by: Court Ewing <court@epixa.com>
2018-07-11 13:12:33 +03:00
Tim Roes a2c33a5b33
Typescriptify ResizeChecker and render complete (#20531) (#20550)
* Typescriptify ResizeChecker and render complete

* Simplify getSize method
2018-07-09 13:41:21 +02:00
Nathan Reese a0add1bf5b
Upgrade to EUI 1.1.0 (#20411) (#20529)
* Upgrade to EUI 1.0.1

* upgraded to eui 1.1.0

* fix setInspectorTablePageSize function in functional tests

* better comment about basic table pagination buttons
2018-07-06 13:33:27 -06:00
CJ Cenizal 0da5bacd28
Adding firefox to test suite (#17195) (#20282)
* Created general driver to accept an argument select the driver to run.

* Added environment variable for driver, changed package.json to use custim leadfoot, and made changes to browserdriver to use any driver.

* Made changes per PR.

* Fixed all nits.
2018-06-27 19:46:35 -07:00
Tim Roes 89e001aaff
Update makelogs to 4.1.0 (#20232) (#20260) 2018-06-27 15:49:44 +02:00
Aleh Zasypkin 99f157b83f
Upgrade rxjs: 6.1.0 ---> 6.2.1. (#20214) 2018-06-25 21:30:49 +02:00
Tim Roes e477a7b412
Add AggTypeFilters to filter out aggs in editor (#19913) (#20196)
* Add AggTypeFilters to filter out aggs in editor

* Add documentation

* Implement CJ's feedback

* Add link to missing vis variable

* Fix for RxJS 6

* Add babel-core types and fix tests

* Pass index pattern instead of vis

* Fix documentation
2018-06-25 11:49:08 +02:00
Tyler Smalley a1b5a56f94
Adds SCSS support for plugins (#19643) (#20137)
Signed-off-by: Tyler Smalley <tyler.smalley@elastic.co>
2018-06-22 08:03:14 -07:00
Stacey Gammon 17ebccbf28
Typescript-ify screenshot stitcher code in reporting (#20061) (#20149)
* typescript screenshot stitcher

* Throw an error if the data captured is not of the expected width and height.

* Import babel-core types

* Add babel-core types to x-pack package.json

* Dimensions => Rectangle
2018-06-22 10:53:00 -04:00
Shaunak Kashyap 17f483a432 Updating EUI to 0.0.55 (#20126) 2018-06-21 16:21:33 -07:00
Tim Roes 9ba0689dcd
[6.x] Replace spy panels by Inspector (#16387) | Fix one inspector test (#20072) (#20076)
* Replace spy panels by Inspector (#16387)

* Add Inspector feature

* So long, and thanks for all the fish, spy panel

* Fix several functional tests

* Fix unit tests

* Fix spy panel button tests

* Replace old spy panel documentation

* Disable test temporarily until we have dashboard triggers

* Enter edit mode for dark theme test

* Fix some more functional tests

* Fix more functional tests

* More test fixing

* Fix more functional tests

* Allow opening the inspector via loader handler

* Refactor InspectorViewChooser, remove unused CSS

* Remove dead code

* Fix data download button style

* Remove redundant code

* Load inspectorViews for dashboard_viewer

* Extract inspector views to custom core_plugin

* Switch API to TypeScript 🎉

* Design changes

* Remove icons from views

* Design changes

* Improve typings of API

* Add typing to all adapters

* Show loading spinner in request selector

* Rewrite InspectorView to TypeScript

* Fix help text for data view

* Remove deprecated React lifecycle methods

* Embed inspector into dashboard panel actions

* Remove temporary inspector trigger

* Remove old CSS

* Fix dashboard trigger for new panel action

* Add tests for InspectorPanel and DataAdapter

* Produce a hierarchical table if the vis is hierarchical

* Remove allowJs option again

* Add missing Apache license headers

* Close inspector on dashboard when navigating away

* Use proper title for dashboard panels

* Fix functional tests

* Skip broken test for now

* Flush view chooser button

* Add request adapter tests

* Skip more tests, broken due to typescript

* Add Request Time description

* Add description for courier request

* Fix tests

* Replace icon by new (not yet released) icon

* Finalize design of inspector

* Remove discover test, that relied on spy panels

* Change API to be properly mockable in tests

* Add aria-live region for request status

* Replace old method in functional tests

* Replace abitrary magic number

* Use object destructuring in vis

* Fix issue with crashing requests view

* Add request time tooltip

* Get request body of correct search source

* Make filter buttons properly keyboard accessible

* Follow Dave's design suggestions

* Remove redundant request from name

* Remove unneeded comments

* WIP raw-formatted values

* Fix filtering issue

* Fix tests and more license headers

* Add data view tests

* Remove search from table

* Fix typos

* Implement review suggestion

* Remove artificial delays for testing

* Fix new panel action structure

* Minor design adjustments

* Fix failing functional test

* Update failing snapshot test

* Implement final wording

* Apply new EUI styling

* Fix closing inspector in tests

* Fix sorting of table

* Align punctuation between tooltips

* Fix test that doesn't exist on master

* Fix one inspector test (#20072)

* Remove file that came accidentally back due to merging

* Fix accidental merge paste

* Fix 6.4 test failures
2018-06-21 11:45:13 +02:00
Tim Roes 508df9e67e
Update EUI to 0.0.53 (#20005) (#20042)
* Update to EUI 0.0.53

* Remove input vis specific styling

* remove double close button in dashboard add panel flyout (#2)

* Fix functional tests

* fix x-pack snapshots

* EUI 0.0.53 no longer closes combo box when clear btn is pressed (#3)
2018-06-19 18:57:42 +02:00
Stacey Gammon edb6b8d460
Typescriptify dashboard redux code (#19857) (#20038)
* Typescriptify dashboard redux code

* Address code review comments

* minor fixes

* move all type dependencies to dev
2018-06-19 11:11:01 -04:00
Spencer 8a7ed713fd
[6.x] [npm] upgrade to RxJS 6 (#18885) (#20006)
* [npm] upgrade to RxJS 6 (#18885)

This PR upgrades RxJS to version 6 and switches to a fork of `stream-to-observable` which includes an updated version of `any-observable` that supports RxJS 6 until https://github.com/jamestalmage/stream-to-observable/pull/10 is merged. The primary change in this version of RxJS is the movement of stream operators from `Obersable.prototype` to the `rxjs/operators` module. Some of the operators, like `catch` and `do`, have been renamed (`catchError`, and `tap`). The Obsevable factories have also been moved from static methods on the `Observable` class to named exports of the root `rxjs` module. Some of those factories have also changed slightly, like `fromEvent` which now emits arrays if the event handler is called with multiple arguments.

```js
// import the Rx namespace to get the Observable factories
import * as Rx from 'rxjs';
// import the operators as named imports
import { map, tap, switchMap } from 'rxjs/operators';
```

* [rxjs/dev-utils] fix old operator usage

* [rxjs/dev-utils] remove one more old operator
2018-06-18 12:47:51 -07:00