Commit graph

61 commits

Author SHA1 Message Date
Greg Thompson 82e30f6eff
Upgrade EUI to v27.4.1 (#75240)
* eui to 27.4.1

* src snapshot updates

* x-pack snapshot updates

* remove increased default timeout

* revert date change

* delete default_timeout file

* reinstate storyshot

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-08-21 10:48:04 -06:00
Spencer cf93604e43
[jest] temporarily extend default test timeout (#75118)
* [jest] temporarily extend default test timeout

* fix, 30 seconds

Co-authored-by: spalger <spalger@users.noreply.github.com>
2020-08-15 13:31:37 -07:00
Greg Thompson 9537a823eb
Upgrade EUI to v26.3.1 (#70243)
* eui to 26.1.0

* Breadcrumb -> EuiBreadcrumb

* keyCode -> key

* src snapshot updates

* update header variables file location

* keyCode -> key in tests

* x-pack simple snapshot updates

* euitooltip updates

* euioverlaymask updates

* testbed keycode -> key

* fixed header sass mixin

* euidatagrid test workaround

* euioverlapmask mock

* euipaginationbutton markup

* nav snapshot update

* eui to 26.3.0

* flyout z-index fix

* euiflyout snapshot updates

* style snapshot updates

* table actions have machine readable text

* table actions have machine readable text

* core api docs update

* table actions snapshot update

* eui to 26.3.1

* update table actions type

* mock issue links; timeout done

* breadcrumb -> euibreadcrumb

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-07-09 19:51:45 -07:00
Thomas Watson ad01223c5a
chore: improve support for mjs file extension (#70186) 2020-06-30 16:13:28 +02:00
Dmitry Lemeshko 8e524477bc
[code coverage] exclude folders: test_helpers, tests_bundle (#70199) 2020-06-29 23:55:29 +02:00
Aleh Zasypkin 33fb3e832c
Support deep links inside of RelayState for SAML IdP initiated login. (#69401) 2020-06-24 08:05:02 +02:00
patrykkopycinski cc4c1729d1
Bump jest related packages (#58095) 2020-06-20 21:05:09 +02:00
Brandon Kobel e616935d0b
Using re2 for Timelion regular expressions (#67416)
* Revert "Revert "Using re2 for Timelion regular expressions (#55208)""

This reverts commit c90293d03f.

* Updating re2 to 1.14.0. Still need to update build patching

* Extract the gzip to the destination, supporting multiple extract methods

* Adding 'node' to jest's moduleFileExtensions

'node' is in the defaults, not sure why we aren't using the defaults...
https://jestjs.io/docs/en/configuration#modulefileextensions-arraystring

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-06-10 09:55:42 -07:00
Dmitry Lemeshko 5064ae4a4c
[QA] Code coverage: unskip tests, collect tests results, exclude bundles from report (#64477)
* custom nyc configs, run all tests

* copy tests results back to original folder
2020-06-05 09:34:25 -06:00
Jean-Louis Leysens 1346b154ad
[ES UI Shared] Monaco XJSON (#67485)
* First iteration of xjson in monaco

* Throwaway implementation in painless lab - THIS MUST BE REVERTED

* WiP on build process for new kbn-lang package

* new @kbn/langs package and update ui-shared-deps

* Update jest config for new work files

* Update painless lab -- REVERT THIS COMMIT

* Create shared useXJson mode hook

* Final update to using the new shared useXJsonMode hook -- REVERT

* Created @kbn/monaco and share through shared deps

* always access monaco through `@kbn/monaco`

* use path.resolve to create path

* add basic readme

* remove console.log call

* remove typescript support from ui-shared-deps webpack config

* use `@kbn/babel-preset`

* include the monaco styles in the kbn-ui-shared-deps

* sort package.json

* build worker at bootstrap rather than commiting to repo

* only build worker, don't pre-bundle monaco

* fix type check errors

* remove section from readme about committed dist

* keep editor.worker.js postfix

* forgot to save update to import

* license package as apache-2.0

* Added regenerator runtime for worker bundle

* revert changes to painless lab

Co-authored-by: spalger <spalger@users.noreply.github.com>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-06-04 13:43:21 +02:00
Nathan L Smith 78d5026fbd
APM-specific Jest configuration (#67858)
Update the x-pack `createJestConfig` function to take the `rootDir` as an argument, which allows for easier overriding of the Jest configuration for a specific directory.

Previously we would run Jest in development from the x-pack directory by running something like:

```
node scripts/jest.js --testPathPattern=plugins/apm --watch
```

Currently (for me anyway) this is failing with:

```
Error: EMFILE: too many open files, watch
    at FSEvent.FSWatcher._handle.onchange (internal/fs/watchers.js:123:28)
```

and it would sometimes not correctly test only the changed files when a change in APM was made. It was also difficult to configure correctly with the [VSCode Jest extension](https://marketplace.visualstudio.com/items?itemName=Orta.vscode-jest).

Add a jest.config.js for APM. This makes running with `--watch` better about which files it chooses to re-run and makes the VSCode extension work (including coverage mapping) with minimal configuration.
2020-06-01 20:38:53 -05:00
restrry bf04235dae apply prettier styles 2020-05-22 09:08:58 +02:00
Tiago Costa 32a7f8134a
chore(NA): add module name mapper for src plugins on x-pack (#67103) 2020-05-20 16:24:15 +01:00
Cauê Marcondes ff1d129813
Fixing jest when running it with --watchAll (#66384) 2020-05-13 17:12:22 +02:00
Dmitry Lemeshko bac638a37e
Update jest config for coverage (#64648)
* set files to track for coverage collection

* increase timeout to 4h

* trying to add detectOpenHandles to avoid worker stuck

* update config

* make config paths more common

* update configs

* update jest oss config

* exclude 'tests' folder for coverage
2020-04-29 20:00:14 +03:00
Tiago Costa e1d787ae83
chore(NA): add file-loader into jest moduleNameMapper (#64330)
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-04-23 21:14:51 +01:00
Jean-Louis Leysens d662cb5f45
[ESUI] Move XJson Mode to src/plugins/es_ui_shared (#62758)
* Move XJson to x-pack/es_ui_shared

Also convert files to TS and clean up use of @ts-ignore

* Move console_lang to public

* Proper use of mocks

* Globally mock out .ace.worker.js modules

Having worker code exported in `public` of es_ui_shared poisoned
a lot of Jest tests with the need to mock out the ace worker.

Instead of adding mocks everywhere we handle the importing in
Jest by adding an entry to module mapper.

* Remove manual imports of mocks

* Delete es_ui_shared/public/mocks for now

* Put useXJson code in single place

* Import and instantiate xJsonMode

* Remove language mocks imports

Besides the fact that these paths are wrong these are no longer
needed because we mock at use Jest module mapper

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-04-10 12:58:18 +02:00
Greg Thompson 4e52deeca3
Use EUI test environment build with Jest (#55877)
* wip

* dir name

* src snapshot changes

* x-pack snapshots

* svg element lookups

* snapshot updates

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-03-10 13:48:49 -05:00
Anton Dosov 8a3e9c6b32
[Unit Testing] Configure react-testing-library queries to use Kibana's data-test-subj instead of default data-testid (#59445) 2020-03-10 13:16:58 +01:00
Jean-Louis Leysens bb37b0f613
[Watcher] Move out of legacy (#54752)
* Moved out of legacy folder

* First iteration of watcher plugin that renders

* Move create Timebuckets to plugin root
Update route registration and fix license checking for NP

* Re-enable Component integration tests

* Minor fix for data deserializer in api.ts

* Slight logic refactor, more defensive plugin startup

* Re-add legacy folder for SCSS pipeline

* Remove duplicate style sheet

* Fix type issue with TimeBuckets export

* Update license management routing logic (issued warning for using basepath on navigating away from license management)
Remove commented out code in watcher

* More defensive plugin registration

* Fix i18n issues and restore registration of feature on home view

* Remove watcher license error check copy

* Restore license error message in watcher

* Fix mock context value

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-01-23 15:35:36 +01:00
Nick Partridge 119eabe271
[Metric] convert mocha tests to jest (#54054)
* Add fixtures/* alias to tsconfig and jest config
* Convert metric tests to jest
* Convert remaining js files to ts
2020-01-17 12:00:35 -06:00
Larry Gregory e6e1373db2
Security - Role Mappings UI (#53620)
* Initial role mappings UI

* apply design edits

* address PR feedback

* fix type cast for number field

* Update x-pack/legacy/plugins/security/public/views/management/role_mappings/edit_role_mapping/components/mapping_info_panel/mapping_info_panel.tsx

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

* Cleanup FTR configuration, and handle role mapping 404 errors properly

* align naming of role mappings feature check

* Apply suggestions from code review

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

* add missing test assertions

* inlining feature check logic

* switch to using snapshot

* use href instead of onClick

* adding delete unit test

* consolidate href building

* unify page load error handling

* simplify initial loading state

* documenting unconditional catch blocks

* use nodes.info instead of transport.request

* Apply suggestions from code review

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

* move model out of LP into NP

* convert except_field_rule to except_any_rule

* docs, take 1

* update gif

Co-authored-by: Joe Portner <5295965+jportner@users.noreply.github.com>
Co-authored-by: Brandon Kobel <brandon.kobel@gmail.com>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-01-11 13:26:31 -05:00
Dmitry Lemeshko 26ce6104a9
Code coverage setup on CI (#49003)
* running code coverage in CI

* apply review feedback

* add custom function to upload merged coverage reports

* fix artifacts upload without coverage

* add file extension to fix validation

* Check code_coverage is set

* run oss tests via grunt task

* review fixes

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-01-08 21:08:48 +01:00
spalger 8e9a8a84dc autofix all violations 2019-12-13 23:17:13 -07:00
Jean-Louis Leysens aa31b535d1
[Watcher] New Platform (NP) Migration (#50908)
* First iteration of watch public -> new platform
Still need to switch to np ready version of use_request

* - Switched to using np ready request
- Some updates after API changes

* First attempt at server shim

* Rename file and re-enable react hooks linting

* Fix some public types and react hooks lint rules

* Fix types

* More ES lint react hooks fixes

* Migrated server lib -> ts. Part way done with migrating routes to NP router and TS

* Big subset of routes to TS and NP router - almost there

* Delete legacy error wrappers and moved last set of routes to TS and NP router

* Remove @ts-ignore's and update route registration to use shim with http router

* Added routes validations, fixes for hooks and fixes for types

* Fix more types and finish testing API routes

* Fix usage of feature catalogue and fix time buckets types

* Fix error message shape [skip ci]

* Split legacy from new platform dependencies server-side

* Refactor: Seperate client legacy and NP dependencies

* Add file: added types file

* Fix UISettings client type import

* Update license pre-routing factory spec

* Update variable names, use of I18nContext (use NP) and docs

* Use NP elasticsearchclient

* Simplify is_es_error_factory

* Fix types

* Improve code legibility and remove second use of `useAppContext`

* Use @kbn/config-schema (not validate: false) on routes!

* Fix watch create JSON spec

* Create threshold test working

* Unskip watch_edit.test.ts

* Unskip watch_list.test.ts

* Done re-enabling component integration tests

* TimeBuckets typo + remove unnecessary // @ts-ignore
2019-12-11 09:54:42 +01:00
Sébastien Loix 439708a6f9 [Dependencies]: upgrade react to latest v16.12.0 (#51145) 2019-11-28 10:56:47 +01:00
patrykkopycinski a10bae2dd6
Update styled-components to latest version (#49679) 2019-11-21 10:53:58 +01:00
Pierre Gayvallet e04adbe34b
Remove react references from core Notifications apis (#49573)
* add reactMount util to kibana_react

(kibana-react) properly export reactMount

* add MountPoint types and utility

* adapt toast API to no longer accept react elements

(toast API) properly export new Toast type

* adapt calls by using reactMount

createNotifications: do not wrap if text

* update generated doc

* add custom snapshot serializer for reactMount

* fix unit tests

fix xpack unit tests

* adapt non-ts calls

* do not add __reactMount__ property in production

* remove string check on createNotifications

* fix typo and small fix using obj spread

* improve react mount snapshot serializer

* simplify convertToEui

* rename reactMount to toMountPoint

* adapt newly added calls

* move mount types to proper file

* use new Mount types for OverlayBanner apis

* fixing typo

* adapt new calls

* use destructured imports
2019-11-14 08:40:14 +01:00
Brandon Kobel a149497b73
NP Security HTTP Interceptors (#39477)
* We have a NP plugin! :celebration:

* Redirecting to login on all 401s

* Adding commented out code for when credentials are omitted

* Fixing types

* Respond 403 when user changes password with incorrect current password

* Adding AnonymousPaths where we ignore all 401s

* Adding anonymous path tests

* Extracted a dedicated SessionExpires class and added tests

* Fixing plugin after refactoring to add SessionExpired

* Beginning to work on the session timeout interceptor

* Fixing UnauthorizedResponseInterceptor anonymous path test

* Removing test anonymous path

* Trying to improve readability

* Displaying session logout warning

* Mocking out the base path

* Revert "Mocking out the base path"

This reverts commit 824086c168.

* Changing coreMock to use a concrete instance of BasePath

* Adding session timeout interceptor tests

* Adding session timeout tests

* Adding more tests for short session timeouts

* Moving some files to a session folder

* More thrashing around: renaming and reorganizing

* Renaming Interceptor to HttpInterceptor

* Fixing some type errors

* Fixing legacy chrome API tests

* Fixing other tests to use the concrete instance of BasePath

* Adjusting some types

* Putting DeeplyMocked back, I don't get how DeeplyMockedKeys works

* Moving anonymousPaths to public core http

* Reading sessionTimeout from injected vars and supporting null timeout

* Doesn't extend session when there is no response

* Updating docs and snapshots

* Casting sessionTimeout injectedVar to "number | null"

* Fixing i18n issues

* Update x-pack/plugins/security/public/plugin.ts

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

* Adding milliseconds postfix to SessionTimeout private fields

* Even better anonymous paths, with some validation

* Adjusting public method docs for IAnonymousPaths

* Adjusting spelling of base-path to basePath

* Update x-pack/plugins/security/public/session/session_timeout.tsx

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

* Update src/core/public/http/anonymous_paths.ts

Co-Authored-By: Josh Dover <me@joshdover.com>

* Update src/core/public/http/anonymous_paths.ts

Co-Authored-By: Josh Dover <me@joshdover.com>

* AnonymousPaths implements IAnonymousPaths and uses IBasePath

* Removing DeeplyMocked

* Removing TODOs

* Fixing types...

* Now, ever more normal
2019-10-24 08:59:45 -07:00
Clint Andrew Hall 27cbdf5f50
[feature][Canvas] Share Workpads in other Websites (#46278)
* [Canvas] Embedding Workpads in other Websites (#42545)

* Testing for Workpad Snapshots

* Rename Snapshots to Shareables; update documentation. (#46513)

* [canvas][shareables] Add Localization + Tweaks (#46632)

* Add localization + tweak naming

* Fix duplicate key

* Update storyshots

* [shareables] Unsupported Renderer Warning (#46862)

* [shareables] Unsupported Renderer Warning

* Update snapshots; add test

* Addressing Feedback

* [canvas][shareables] Simplify and complete testing (#47328)

* Simplify

* Updates

* Finishing up

* A few tweaks

* Fix eslint errors; how would those happen??

* Fix CI build of runtime; assorted visual tweaks

* Update x-pack/legacy/plugins/canvas/shareable_runtime/test/index.ts

Co-Authored-By: Spencer <email@spalger.com>

* Addressing feedback

* Remove null-loader from root package

* re-add null-loader until mitigation is found

* [perf] Fix unsupported renderers performance issue (#47769)

* [perf] Fix perf issue with unsupported renderers

* Fixing snapshots

* Addressing review feedback (#47775)

* Addressing feedback

* Addressing feedback (#47883)

* Branding Changes (#47913)

* Branding Changes

* Update snapshots
2019-10-11 12:15:41 -05:00
Oliver Gupte 3c68c98e2c
[APM] Average page load duration by country chart (#43567)
* [APM] Adds chart for page load averages by country in RUM page-load view

* [APM] Simplified and refined ChoroplethMap. Added legend labels.

* - Replaced Map legend slices with smooth gradient
- fixed issue with map rendering multiple times
- renamed initial props to start with 'initial'
- added some more code comments

* use correct i18n ids

* - base color progression calc directly on euiColorPrimary
- check that a layer exists before querying features

* Addressed code review feedback

* - fixes issue where min/max was not a finite value
- cleans up mouseover handler, which updates on state changes
- formats doc count for display
- style improvements

* addressed PR feedback & updated renovate.json5

* - Removed the Legend from the ChoroplethMap
- Only render tooltip when there's data

* - fix hover state not clearing properly
- add better typing around Geojson propertier for world countries

* added missing css import
2019-08-29 15:29:12 -07:00
Poff Poffenberger ebe22f468b
[Canvas] Add Monaco to the Canvas Expression Editor (#41790)
* First version of Editor component and integration with the expression editor

* Adding resize detector

* Remove blue border on editor select

* Adding types for the react resize detector

* Adding worker and a few more monaco plugins

* Suggestion completion rework

* Add resize detector types as well as an IE11 full width bug fix

* Adding correct types for function definitions and monaco

* change CSS class names, add border to input

* Adding boolean styling

* Slight refactor of canvas function/arg types and adding first pass of hover

* Fixing hover interaction for functions and arguments

* Namespacing Code monaco css overrides

* Styling cleanup and simple README

* Setting up tests including some storyshots for the ExpressionInput component and Editor component

* Prop documentation for both the ExpressionInput and Editor components

* Adding Editor snapshots

* tiny cleanup

* Moving language registration, adding autocomplete suggestion types, and cleaning up editor

* Some documentation and cleanup from PR feedback

* Fixing types, adding documentation

* clean up editor, remove autocomplete toggle

* More PR cleanup

* Test fix, type fix

* fix issues around errors. code cleanup
2019-08-26 09:31:07 -05:00
Dmitry Lemeshko 304f702764
jest & mocha test coverage reporting (#43742)
* grunt task to get mocha tests coverage

* update jest x-pack config to save report in target

* update report path to match /target/kibana-* pattern
2019-08-24 16:48:08 +02:00
Larry Gregory 6a9844c223
Spaces - Copy Saved Objects to Spaces UI (#39002) 2019-08-23 14:24:53 -04:00
Larry Gregory 608e2391d0
Copy Saved Objects to Spaces API (#38014) 2019-08-21 17:27:55 -04:00
Rudolf Meijering e137477b5a
[Core] Public saved objects client (#39891)
* Move SavedObjectClient files to core/public

* Initial SavedObjectsService in public Core

* Public SavedObjectsClient tests

* Import SimpleSavedObject from src/core/public

* Use types from source files for kibana.d.ts

* Add html raw loader to x-pack/jest

* Cleanup

* Drop case utilities and improve test coverage

* Update types and documentation

* Fix build breaking when importing directly from /server in /public

* Ensure that all option paramaters are picked and renamed

* Fix option mapping and introduce stronger types

* Eslint: allow imports from src/core/*/types

* Add compatibility layer for kfetch vs http.fetch error responses

* Improve documentation

* Expose SavedObjectsMigrationLogger

* Documentation and type tweaks

* Revert type changes from 73e601f and update api docs

* Refactor request into savedObjectFetch + test

* Make legacy SavedObject compatible with http.fetch exceptions

* Fix types and tests

* simple_saved_object import from src/core/server

* server imports from root instead of server/types

* Make SavedObjectsService a class

* Don't pick unkown keys from server response

* Rename SavedObjectsFindResponse to SavedObjectsFindResponsePublic

* Remove err.response from SavedObjects fetch errors

* Revert "Remove err.response from SavedObjects fetch errors"

This reverts commit 61705ca361.

* Don't introduce err.response until we deprecate err.res
2019-08-06 20:53:05 +02:00
Nicolas Chaulet 1aa21c123d
[Tests] Setup contract tests in x-pack (#42345) 2019-08-05 11:15:03 -04:00
Chandler Prall da99d4520b
Upgraded EUI 13.0.0 -> 13.1.1 (#42298)
* Upgraded EUI 13.0.0 -> 13.1.0

* Bump to 13.1.1

* Reset MutationObserver polyfill to original operation

* Reset x-pack's MutationObserver polyfill to original operation
2019-08-02 12:42:07 -06:00
dave.snider@gmail.com c2b926e2e7
EUI 13.0.0 (#41723) 2019-07-23 15:09:16 -07:00
Aleh Zasypkin 01f6efac02
Include new platform x-pack plugin paths to Jest roots. (#40422) 2019-07-05 16:07:10 +02:00
Tim Roes c722440f49
Fix typo in x-pack jest config (#40174) 2019-07-03 13:41:56 +02:00
CJ Cenizal c2a14e75f3 EUIfy Watcher (#35301) 2019-06-29 07:05:55 -04:00
Tim Roes 850e7fb163
Add dateHistogramInterval utility (#39091)
* Add dateHistogramInterval utility

* Fix editor bug

* Fix tests

* FIx imports to temporary solution

* Remove wrongly merged translations

* Remove old static.ts file
2019-06-25 09:32:43 +02:00
Court Ewing 2d171c92f5 Fix path references into and out of x-pack/legacy 2019-06-20 13:34:48 -04:00
Tim Roes 2d37b05a43
Improve jest mocking infrastructure (#38760)
* Always mock metadata/chrome in OSS

* Enable jest env in jest mocks

* Exclude jest mocks in karma bundles

* Use setupFilesAfterEnv in config

* Remove chrome/metadata mock from x-pack

* Remove kuery mock

* Add missing mock to SIEM test

* Fix typo in mock import

* Remove top level capabilities x-pack mock

* Move kfetch mock to ui/public

* Move moment-timezone to mocks file

* Unmock kfetch in kfetch specific tests

* Make kfetch mock manual

* Removed unnecessary jest.mock

* Remove kfetch unmocks
2019-06-14 23:36:51 +02:00
Chandler Prall 86fea48875
Upgrade EUI to 11.0.1; support dynamic import() calls in UI code + eui (#36316)
* Upgrade EUI to 11.0.1; support dynamic import() calls in UI code + eui

* update snaps

* Clicking on the svg itself once loaded

* updated snaps

* update icon in snapshots

* Fix snapshot
2019-06-03 12:01:01 -04:00
Mikhail Shustov 37d907f2d6
allow x-pack plugins to import core service mocks (#36771)
using relative imports from x-pack to kibana core doesn't work atm.
although we cannot use absolute imports, because jest cannot match
them internally.
2019-05-21 18:57:11 +02: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
Spencer d58b663813
[junit] use default rootDirectory for project (#32256) 2019-03-01 13:56:53 -08:00
Tiago Costa 514673c46e
Improve dll plugin relation with webpackshims (#30129)
* chore(NA): remove specific watch for x-pack webpackShims folder.

* chore(NA): remove xpack security plugin angular-ui-select webpackShim.

* chore(NA): bump ui-select version on x-pack to match the one used on oss kibana

* chore(NA): remove manual searching for webpackShim imports into the dll plugin. chore(NA): explicit avoid max dll compilations in all environments for the dll plugin. chore(NA): explicit throw an error and list all the not allowed modules bundled into the dll bundle.

* refact(NA): move ui related actions inside webpackShims to proper ui related files

* chore(NA): move angular ui dependencies from webpackShims to kibana core module.

* test(NA): enable xpack jest tests to be able to resolve plugins/xpack_main/*. refact(NA): rewrite code for the old xpack jquery flot webpackShim.

* refact(NA): use the already declared ui module get to list the dependencies for the kibana legacy core plugin.

* chore(NA): move angular ui requires to a better centralized place.

* refact(NA): rename areMaxCompilationsPerformed to assertMaxCompilations.

* refact(NA): remove unnecessary promise resolve on async function.

* refact(NA): remove unnecessary promise resolve on async function.

* refact(NA): apply changes according pr review.

* refact(NA): change from requires to imports in xpack_main plugin jquery flots.

* refact(NA): jquery flots missing statements.

* fix(na): linting problems.

* chore(na): re add jquery flot requires instead of imports.

* refact(NA): moving jquery flots from require to import. test(NA): fix mock for jquery_flot.

* feat(na): allow dynamic dll plugin public modules on dll bundle.

* feat(NA): step verification to not allow modules from xpack source.

* chore(NA): fix linting problems.
2019-02-22 01:45:42 +00:00