Commit graph

34 commits

Author SHA1 Message Date
Jonathan Budzenski
ca55b003dc skip flaky suite. #107028 2021-09-23 10:23:31 -05:00
Kibana Machine
42b95d44f4
[Canvas] TagCloud (#106858) (#111257)
* Added `tagCloud` to canvas.

* Added `icon` to the `tagCloud` element.

* Added column name support at `tag_cloud`.

* Added condition to `vis_dimension` not to pass invalid index.

Added check of accessor index, if such column exists at vis_dimension.
Removed checks of column existance from TagCloudChart.
Added test for accessing data by column name in addition to a column number.
Updated tag_cloud element in Canvas.
Fixed types. Removed almost all `any` and `as` types.

* Added test suites for `vis_dimension` function.

* Added tests for DatatableColumn accessors at tag_cloud_fn and to_ast.

* Refactored metrics, tagcloud and tests.

Added valid functional tests to metrics and tag_cloud.
Fixed types of metrics_vis.
Added handling of empty data at tag_cloud renderer.

* Added storybook ( still doesn't work ).

* Fixed some mistakes.

* Added working storybook with mocks.

* Added clear storybook for tag_cloud_vis_renderer.

* Updated the location of vis_dimension test after movement of the function.

* Fixed unused type.

* Fixed tests and added handling of the column name at `visualizations/**/*/prepare_log_table.ts`

* Reduced the complexity of checking the accessor at `tag_cloud_chart.tsx`

* Added comments at unclear places of code.

* Added the logic for disabling elements for renderers from disabled plugins.

* removed garbage from `kibana.yml`.

* Fixed element_strings.test error.

* Made changes, based on nits.

* Fixed mistake.

* Removed `disabled` flag for `expression_*` plugins.

* recovered lost comments at the unclear places.

* removed dead code.

* fixed test errors.

* Fixed test error, I hope.

* fixed more tests.

* fixed code, based on nits.

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>

Co-authored-by: Yaroslav Kuznietsov <kuznetsov.yaroslav.yk@gmail.com>
2021-09-06 06:31:10 -04:00
Kibana Machine
870840da18
[Aggregations] Create expression functions for object types used in agg params (#103494) (#107110)
Co-authored-by: Michael Dokolin <mikhail.dokolin@elastic.co>
2021-07-29 03:21:11 -04:00
Kibana Machine
824fd4f8eb
[test] Migrates visualize esArchive to kbnArchiver (#102850) (#103195)
Signed-off-by: Tyler Smalley <tyler.smalley@elastic.co>

Co-authored-by: Tyler Smalley <tyler.smalley@elastic.co>
2021-06-23 23:16:53 -04:00
Kibana Machine
db838743f5
[Lens] Fix time shift bug (#102528) (#102752)
Co-authored-by: Joe Reuter <johannes.reuter@elastic.co>
2021-06-21 12:57:45 -04:00
Spencer
bcdeccb39b
[7.x] [esArchiver] drop support for --dir, use repo-relative paths instead (#101345) (#101676)
* [esArchiver] drop support for --dir, use repo-relative paths instead (#101345)

Co-authored-by: spalger <spalger@users.noreply.github.com>
# Conflicts:
#	test/api_integration/apis/suggestions/suggestions.js
#	test/functional/apps/discover/_large_string.ts
#	test/functional/apps/visualize/index.ts
#	x-pack/test/functional/apps/infra/feature_controls/logs_security.ts
#	x-pack/test/functional/apps/saved_objects_management/import_saved_objects_between_versions_6.x_7.x.ts
#	x-pack/test/functional/apps/upgrade_assistant/upgrade_assistant.ts

* convert references to `saved_objects/basic` archive

* adapt other `saved_objects/*` archives

* update management/saved_obejcts/relationships archives

* replace old monitoring setup() usage

* remove reference to `empty_kibana` archive

Co-authored-by: spalger <spalger@users.noreply.github.com>
2021-06-08 22:45:04 -04:00
Joe Reuter
22fa45a373
[Lens] Time shift metrics (#98781) (#101186) 2021-06-02 14:40:57 -04:00
Peter Pisljar
b388d36971
kql, lucene and timerange functions (#93043) (#94829)
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-03-18 04:40:49 -04:00
Brandon Kobel
57af8462e4
[7.x] Elastic License 2.0 (#90192)
* Updating everything except the license headers themselves

* Applying ESLint rules

* Manually replacing the stragglers
2021-02-03 18:39:13 -08:00
Tyler Smalley
baf56d80c4
[7.x] Updating the License (#88343) (#88745)
* Updating the Licenses, except for applying eslint, building

* Applying ESLint rules,building @kbn/pm, regenerating api docs

Co-authored-by: kobelb <brandon.kobel@elastic.co>
2021-01-19 17:54:11 -08:00
Daniil
ae139f927f
[TileMap][RegionMap] Implement custom renderers and expression builders (#84775) (#88308)
* Convert to typescript

* Move related files directly into plugin

* Implement toExpressionAst

* Remove build_pipeline dedicated fn

* Async import converter

* Create a custom renderer

* Remove ExprVis instance usage in maps visualizations

* Use uiState updates

* Create wrapper component

* Update rendering

* Create region map expression renderer

* Remove resize subscription

* Fix custom visualization expression

* Update interpreter functional tests

* Use types from geojson

Co-authored-by: Alexey Antonov <alexwizp@gmail.com>
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>

Co-authored-by: Alexey Antonov <alexwizp@gmail.com>
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-01-14 16:09:05 +03:00
Luke Elmers
b16834b22d
[7.x] [data.search] Clean up arguments to esaggs. (#84973) (#85578) 2020-12-10 09:33:25 -07:00
Peter Pisljar
d25c84f6f4
removing kibana_datatable in favor of datatable (#80548) (#80875) 2020-10-16 20:59:39 +02:00
Mikhail Shustov
b10e6b14e9
Type safe browser.executeAsync (#69018) (#69154)
* make browserAsync type safe

* adopt tests

* prefer unknown over any

* simplify signature
2020-06-15 17:48:57 +02:00
restrry
2fefd60e90 update code style 2020-05-22 10:35:02 +02:00
Aaron Caldwell
7524f0eae0
[7.x] Migrate Region Maps to NP (#64272) (#65735) 2020-05-07 13:30:38 -06:00
Uladzislau Lasitsa
b9a3f912a0
Migrate test plugins ⇒ NP (kbn_tp_run_pipeline) (#64780) (#65617)
* Migrated kbn_tp_run_pipeline to the new Platform

* Updated config.

* Added tsconfig.

* Updated index.ts for tests

* updated tsconfig

* Updated typescript task

* fixed tests

* Fixed tests

* updated comment

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-05-07 16:27:11 +03:00
Wylie Conlon
643cabe781
[7.x] [Lens] Bind all time fields to the time picker (#63874) (#64857)
* [Lens] Bind all time fields to the time picker (#63874)

* Bind non primary time fields to timepicker

* Fix typescript argument types

* Allow auto interval on all fields

* Remove lens_auto_date function

* Fix existing jest tests and add test todos

* Remove lens_auto_date from esarchives

* Add TimeBuckets jest tests

* Fix typo in esarchiver

* Address review feedback

* Make code a bit better readable

* Fix default time field retrieval

* Fix TS errors

* Add esaggs interpreter tests

* Change public API doc of data plugin

* Add toExpression tests for index pattern datasource

* Add migration stub

* Add full migration

* Fix naming inconsistency in esaggs

* Fix naming issue

* Revert archives to un-migrated version

* Ignore expressions that are already migrated

* test: remove extra spaces and  timeField=\\"products.created_on\\"} to timeField=\"products.created_on\"}

* Rename all timeField -> timeFields

* Combine duplicate functions

* Fix boolean error and add test for it

* Commit API changes

Co-authored-by: Wylie Conlon <wylieconlon@gmail.com>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
Co-authored-by: Marta Bondyra <marta.bondyra@elastic.co>

* fix: fix migration

* types fix

Co-authored-by: Tim Roes <tim.roes@elastic.co>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
Co-authored-by: Marta Bondyra <marta.bondyra@elastic.co>
2020-04-30 13:47:03 -04:00
Vadim Dalecky
c4a2067838
ExecutionContract (#57559) (#57806)
* feat: 🎸 add ExecutionContract class

* test: 💍 add Execution and Executor tests

* feat: 🎸 add .execute() method to ExpressionsService

* refactor: 💡 replace ExpressionDataHandler by ExecutionContract

* fix: 🐛 fix TypeScript typecheck errors

* docs: ✏️ add JSDocs to ExecutionContract

* refactor: 💡 make .ast and .expresions both optional

* test: 💍 fix test

* test: 💍 fix a test

* test: 💍 fix interpreter functional tests
2020-02-17 16:41:19 +01:00
Vadim Dalecky
b9f4eec008
[7.x] Expressions refactor (#54342) (#57366)
* Expressions refactor (#54342)

* feat: 🎸 add UiComponent interface

* feat: 🎸 add adapter for react => ui components and back

* refactor: 💡 move registries to shared /common folder

* feat: 🎸 create expressions service state contaienr

* chore: 🤖 export some symbols

* feat: 🎸 add Executor class

* test: 💍 add simple integration test

* feat: 🎸 move registries into executor

* feat: 🎸 add initial implementation of Execution

* feat: 🎸 move Executor's state container into a signle file

* refactor: 💡 move createError() to /common folder

* feat: 🎸 use Executor in plugin definition

* refactor: 💡 rename handlers to FunctionHandlers

* feat: 🎸 improve function typings

* feat: 🎸 move types and func in sep folder, improve Execution

* refactor: 💡 cleanup expression_types folder

* refactor: 💡 improve typing names of expression types

* refactor: 💡 remove lodash from ExpressionType and improve types

* test: 💍 add ExpressionType tests

* refactor: 💡 remove function wrappers around types

* refactor: 💡 move functions to /common

* test: 💍 improve expression function tests

* feat: 🎸 create /parser folder

* refactor: 💡 move function types into /expression_functions dir

* refactor: 💡 improve parser setup

* refactor: 💡 fix export structure and move args into expr_func

* test: 💍 add ExpressionFunctionParameter tests

* fix: 🐛 fix executor types and imports

* refactor: 💡 move getByAlias to plugin, fix Execution types

* feat: 🎸 add function for argument parsing

* test: 💍 add Executor type tests

* test: 💍 add executor function and context tests

* test: 💍 check that Executor returns Execution

* test: 💍 add basic tests for Execution

* test: 💍 add basic test for execution of a chain of functions

* test: 💍 add "mult" function tot tests

* feat: 🎸 create separate expression_renderer folder

* feat: 🎸 use new executor in public plugin

* feat: 🎸 remove renderers from executor, add result to execution

* fix: 🐛 fix Kibana TypeScript errors

* test: 💍 add file to write integration tests for expr plugin

* refactor: 💡 move state_containers to /common

* refactor: 💡 move /parser to /ast and inline format() function

* refactor: 💡 remove remaining @kbn/interpreter imports

* feat: 🎸 better handling and typing for Executor context

* feat: 🎸 use Executor.run function in plugin

* fix: 🐛 fix TypeScript type errors

* test: 💍 move integration tests into one file

* feat: 🎸 create ExpressionsService

* chore: 🤖 clean up legacy code

* feat: 🎸 use ExpressionsService in /public

* refactor: 💡 move inspector adapters to /common

* feat: 🎸 improve execution

* feat: 🎸 add state to execution state and don't clone AST

* test: 💍 add tests for Execution object

* test: 💍 improve expression test helpers

* test: 💍 add Execution tests

* refactor: 💡 improve required argument checking

* fix: 🐛 fix Kibana TypeScript errors

* test: 💍 add ExpressionsService unit tests

* fix: 🐛 fix Expression plugin TypeScript types

* refactor: 💡 prefix React component with React*

* fix: 🐛 fix X-Pack TypeScript errors

* fix: 🐛 fix test TypeScript errors

* fix: 🐛 fix issues preventing loading

* feat: 🎸 remove getInitialContext() handler

* fix: 🐛 fix TypeScript errors

* chore: 🤖 remove uicomponent interface

* chore: 🤖 remove missing import

* fix: 🐛 correctly handle .query in "kibana" expression function

* refactor: 💡 call first arg in expression functions "input"

* fix: 🐛 do not free Execution state container

* test: 💍 fix tests after refactor

* test: 💍 fix more tests after refactor

* fix: 🐛 remove redundant export

* test: 💍 update intepreter_functional test shapshots

* fix: 🐛 relax "kibana" function throwing on missin gsearch ctx

* refactor: 💡 don't use ExpressionAST interface in Canvas

* docs: ✏️ improve ExpressionRenderer JSDocs

* refactor: 💡 rename context.types to inputTypes in internal fn

* refactor: 💡 replace context.types by unknown in ExprFuncDef

* refactor: 💡 improve expression function definitions in OSS

* fix: 🐛 correctly set name on metric_vis_fn

* refactor: 💡 improve Lens definitions of expression functions

* refactor: 💡 improve Canvas expression function definitions

* test: 💍 add createMockExecutionContext() helper

* refactor: 💡 add some type to events$ observable in expr handler

* feat: 🎸 add types to observables in data handler

* refactor: 💡 use inputTypes in canvas

* fix: 🐛 fix interpreter grammer generation script

* feat: 🎸 allow array in getByAlias

* test: 💍 simplify test function specs

* test: 💍 fix autocomplete tests

* fix: 🐛 use correct expression types and NP getFunctions() API

* refactor: 💡 use NP expressions to get renderer

* fix: 🐛 use context.types on server-side Canvas function defs

* refactor: 💡 use NP API to register Canvas renderers

* feat: 🎸 use NP API to get types

* style: 💄 minor formatting changes

* feat: 🎸 use NP API to get expression functions

* fix: 🐛 fix Canvas workpads

* test: 💍 add missing mock functions

* refactor: 💡 improve Lens func definition argument types

* fix: 🐛 fix Lens type error

* feat: 🎸 make lens datatable work again

* feat: 🎸 bootstrap ExpressionsService on server-side

* feat: 🎸 expose more registry related functions in contract

* feat: 🎸 add environment: server to server-side expressions

* docs: ✏️ add documentation

* test: 💍 add missing Jest mocks

* fix: 🐛 correct TypeScript type

* docs: ✏️ improve documentation

* fix: 🐛 make FunctionHelpDict type contain only Canvas functions

* fix: 🐛 fix merge conflict

* test: 💍 fix expression mocks

* fix: fix TypeScript disabled help type

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-02-12 09:26:48 +01:00
Nick Partridge
dd8eaab229
[Metric] convert mocha tests to jest (#54054) (#55210)
* Add fixtures/* alias to tsconfig and jest config
* Convert metric tests to jest
* Convert remaining js files to ts
2020-01-17 13:33:46 -06:00
Anton Dosov
81a1f56a3c
Expressions service fixes: better error and loading states handling (#51183) (#51800)
1. This pr fixes regression in v7.6 - #51153.

Visualisation which are using ExpressionLoader directly are swallowing render errors in 7.6, because generic error handling is happening only on expression_renderer.tsx level (react component wrapper around renderer).

Now react agnostic render code render.ts, loader.ts:

has it's own default error handler which is toast from notification service.
It also allows to pass custom error handler instead of default one
React expression renderer expression_renderer.tsx:

if consumer wants to render error as react component inline, then the component uses custom error handler from render.ts to wire up react component.

2. This pr fixes issue of loader.ts where initial loading$ was not emitted

Had to change loadingSubject from Subject to BehaviorSubject to remember the last value

3. This pr fixes dependencies in effects of expression_renderer.tsx
# Conflicts:
#	src/plugins/expressions/public/loader.test.ts
2019-11-27 14:00:14 +01:00
Anton Dosov
e74a8066eb
Typescriptify and shim kbn_tp_run_pipeline test plugin (#50645) (#51714)
* Typscriptify and shim kbn_tp_run_pipeline test plugin

* fix imports to not re-export ‘legacy’ from root of plugin
2019-11-26 15:41:45 +01:00
Anton Dosov
2d633dc1e6
Enable expression service screenshot tests (#50472) (#51263)
* Enables interpreter screenshot tests which were disabled in #42842
* Refactors tests to use expression service
* Fixes edge cases in expression service render:
** fixes swallowing of promise rejections from renderer.render()
** fixes swallowing of errors which emitted sync in render()
* Adds default value to colorRange type, as otherwise it fails in runtime if not passed
# Conflicts:
#	src/plugins/expressions/public/loader.test.ts
2019-11-21 14:56:34 +01:00
Peter Pisljar
f4b918da11
remove visualize loader (#46910) (#50319)
# Conflicts:
#	src/legacy/core_plugins/expressions/public/np_ready/public/execute.ts
#	src/legacy/core_plugins/expressions/public/np_ready/public/loader.test.ts
2019-11-12 11:03:25 -05:00
Vadim Dalecky
831d708f25
Improve Interpreter TypeScript typings (#47212) (#47485)
* fix: 🐛 correct createError() implementation and typings

* feat: 🎸 improve expressions service TypeScript types

* perf: ️ improve ExpressionLoader class

* feat: 🎸 improve Interpreter types

* feat: 🎸 improve Interpreter function typings

* feat: 🎸 improve Interepreter test TypeScript typings

* feat: 🎸 TypeScriptify kibana_context expression function

* feat: 🎸 TypeScriptify "kibana" expressions functions

* feat: 🎸 TypeScriptify "visualization" function

* feat: 🎸 TypeScriptify Interpreter initialization

* test: 💍 fix interpreter tests

* feat: 🎸 add TypeScript typing to some of the executor internals

* fix: 🐛 this fixes visualizations; why?

* chore: 🤖 delete redundant files and fix TypeScript error

* perf: ️ use not null assertion for .dataHandler

* refactor: 💡 stricten AnyExpressionFunction type

* fix: 🐛 set correct initial pipeline exec context

* feat: 🎸 improve expression type typings

* test: 💍 call interpreter with correct input from func tests
2019-10-07 22:58:31 +02:00
Dmitry Lemeshko
feb070df6a
bump chromedriver version to 76 (#42468) (#42874)
* bump chromedriver version to 76

* [test/interpreter_functional] update snapshots

* [test/interpreter_functional] skip failing tests

* Revert "[test/interpreter_functional] update snapshots"

This reverts commit 6401554882.

* [test/interpreter_functional] skip snapshot tests
2019-08-08 07:40:37 +02:00
Peter Pisljar
945dde0e85
unskipping interpreter functional tests (#40840) (#40871) 2019-07-22 09:20:44 +02:00
Peter Pisljar
5341d11005
updating metricvis interpreter func arguments (#34532) (#39872) 2019-06-28 08:16:09 +02:00
Spencer
7aea62aa61
[7.x] FTR: add support for Firefox browser (#32509) (#37750)
* skip and adjust functional tests for Firefox

* downgrade geckodriver to 0.22.0

* [ftr] add firefox specific config file

* remove hard coded firefox adjustments

* remove firefox specific screenshot directory

* run functional tests in firefox in x-pack

* pass the logger to readConfigFile()

* rename local var

* skip xpack firefox config

* run xpack firefox functional tests in separate command

* update report name for XPack firefox results

* adjust viz shared item test

* skip shared item test

* [test/feature_controls] increase timeout to 20 sec & use forceLogout

* FF timeout on TSVB, refresh page on failure for url navigation

* [feature_controls/visualize_security] increase timeout to 20 sec

* skip dev_tools_spaces tests on FF

* run all groups 3 times

* skip more func tests

* skip more tests

* skip all feature controls tests for Firefox

* revert back changes in feature controls tests

* rename xpack report for chrome

* skip tile map for FF, wait for render before saving

* Revert "run all groups 3 times"

This reverts commit 12b4f69627.

* revert refresh on login

* apply feedback
2019-05-31 17:18:31 -07:00
spalger
bc5a639796 [interpreter] disable flaky test
(cherry picked from commit bb0e03e09a)
2019-04-18 10:40:17 -07:00
Peter Pisljar
ea1c8d548a
updating tagcloud interpreter func arguments (#33773) (#34536) 2019-04-04 17:52:05 +02:00
Spencer
883ea31bd2
[@kbn/expect] "fork" expect.js into repo (#33761) (#33794)
* [@kbn/expect] "fork" expect.js into repo

* [eslint] autofix references to expect.js

* [tslint] autofix all expect.js imports

* now that expect.js is in strict mode, avoid reassigning fn.length
2019-03-25 13:13:21 -07:00
Peter Pisljar
a0a1b594c6
adding runPipeline tests (#27015) (#33637) 2019-03-21 08:36:39 +01:00