Commit graph

76 commits

Author SHA1 Message Date
Tyler Smalley d5a760cfd9
[test] Migrates visualize esArchive to kbnArchiver (#102850)
Signed-off-by: Tyler Smalley <tyler.smalley@elastic.co>
2021-06-23 21:12:56 -04:00
Matthias Wilhelm 12aa46fad9
[Discover] Unskip Discover large field number test (#100692) 2021-06-23 09:58:10 +02:00
Pierre Gayvallet 59d7f33115
add isExportable SO export API (#101860)
* add `isExportable` SO export API

* add warning when export contains excluded objects

* add FTR test

* fix API integration assertions

* lint

* fix assertions again

* doc

* update generated doc

* fix esarchiver paths

* use maps instead of objects

* SavedObjectsExportablePredicate is no longer async

* more docs

* generated doc

* use info instead of warning when export contains excluded objects

* try/catch on isExportable call and add exclusion reason

* add FTR test for errored objects

* log error if isExportable throws
2021-06-21 10:06:54 +02:00
Tyler Smalley 9c37a6798f
[esArchives] Persist migrated Kibana archives (#101950)
Signed-off-by: Tyler Smalley <tyler.smalley@elastic.co>
2021-06-10 20:47:09 -07:00
Tyler Smalley ec212c0618
[es-archiver] Use alias for Kibana mappings (#101537)
In 7.x, when saved objects point to an index and not an alias it will
assume it's pre-6.8 and perform a legacy migration. This causes issues
with the removal of oss builds. This update prevents that from happening
by using an alias.

Signed-off-by: Tyler Smalley <tyler.smalley@elastic.co>
2021-06-08 08:48:43 -07:00
Matthias Wilhelm 65251051fd
[Discover] Deangularize discover controller (#96766)
Co-authored-by: Tim Roes <mail@timroes.de>
2021-06-08 11:27:00 +02:00
Pierre Gayvallet aa8aa7f23d
Saved object export: apply export hooks to referenced / nested objects (#100769)
* execute export transform for nested references

* fix sort

* fix duplicate references

* add FTR test
2021-06-04 14:46:05 +02:00
Tre 6f95145d28
[QA] Switch tests to use importExport - visualize (#98063)
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-05-13 14:32:58 -06:00
Spencer 9e2e8b9f19
[ftr/esArchiver] disable geo_shape field of maps saved objects in archives (#99119)
Co-authored-by: spalger <spalger@users.noreply.github.com>
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-05-04 10:36:28 -07:00
Pierre Gayvallet 9dae1ef5b1
SOM: hide actions for hidden types (#98290)
* SOM: hide actions for hidden types

* fix FTR tests

* add and fix tests

* fix unit tests

* fix test types

* fix FTR test assertions

* add more FTR tests

* delete old file
2021-04-28 07:58:45 +02:00
Mikhail Shustov e6ba8ccdc2
Rewriting SO id during migration (#97222)
* some typos

* implement an alternative client-side migration algorithm

required to enforce idempotent id generation for SO

* update tests

* lol

* remove unnecessary param from request generic

* remove unused parameter

* optimize search when quierying SO for migration

* fix wrong type in fixtures

* try shard_doc asc

* add an integration test

* cleanup

* track_total_hits: false to improve perf

* add happy path test for transformDocs action

* remove unused types

* fix wrong typing

* add cleanup phase

* add an integration test for cleanup phase

* add unit-tests for cleanup function

* address comments

* Fix functional test

* set defaultIndex before each test. otherwise it is deleted in the first test file during cleanup phase

* sourceIndex: Option.some<> for consistency

* Revert "set defaultIndex before each test. otherwise it is deleted in the first test file during cleanup phase"

This reverts commit a128d7b7c0.

* address comments from Pierre

* fix test

* Revert "fix test"

This reverts commit 97315b6dc2.

* revert min convert version back to 8.0

Co-authored-by: Matthias Wilhelm <matthias.wilhelm@elastic.co>
2021-04-26 15:57:29 +02:00
Tre 1832259757
[QA] Switch tests to use importExport - discover (#94006)
Switch es archiver for kbn archiver everywhere possible

Partially closes #93797
2021-04-21 10:17:58 -06:00
Ahmad Bamieh a67aa97989
[Core] create deprecations service (#94845)
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-03-30 19:20:23 +03:00
Wylie Conlon c33987d929
Support for number, date and IP range data types (#76971)
* Support for number, date and IP ranges

* Update tests

* Ranges don't work with range agg

* Fix test case

* Allow Discover to create range filters

* Supports ranges in Visualize, KQL, remove Lens support

* Fix test mappings

* Bring back field cache to work around bug

* Fix some tests

* Fix test expectation

* Respond to review comments

* Fix type error

* Remove added sample data

* Fix api_docs

* Fix test
2021-03-08 15:50:36 -05:00
Rashmi Kulkarni a0881f90e2
Test huge fields functional test (#93334)
* fixes https://github.com/elastic/kibana/issues/74449

* fix for unskipping test huge fields functional test

* fix eslint
2021-03-03 09:01:54 -08:00
Spencer 0aabc317ec
[kbn/test] add import/export support to KbnClient (#92526)
Co-authored-by: Tre' Seymour <wayne.seymour@elastic.co>
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: spalger <spalger@users.noreply.github.com>
2021-02-25 16:13:27 -07:00
Ahmad Bamieh c1d1b2b453
[Saved Objects] Allow exporting and importing hidden types (#90178)
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-02-14 19:05:36 +02:00
Maja Grubic c37b0e1474
[Discover] Minor cleanup (#90260) 2021-02-04 15:00:22 +00:00
Maja Grubic c6be748a97
[Discover] Add support for unmapped fields using the fields API (#89074)
* Add search source to example plugin.

* Add uiSetting for fields API.

* Update SearchSource to support fields API.

* [PoC] reading from the fields API in Discover

* Add N fields as a default column

* Make fields column non-removeable

* Do not add 'fields' to state

* Remove fields from app state and read from source when needed

* Remove fields column if a new column is added

* Add search source to example plugin.

* Add uiSetting for fields API.

* Update SearchSource to support fields API.

* Improve error handling in search examples plugin.

* Add unit tests for legacy behavior.

* Remove uiSettings feature flag; add fieldsFromSource config.

* Rewrite flatten() based on final API design.

* Update example app based on final API design.

* Update maps app to use legacy fieldsFromSource.

* Update Discover to use legacy fieldsFromSource.

* Rename source filters to field filters.

* Address feedback.

* Update generated docs.

* Update maps functional test.

* Formatting fields column similar to _source

* Moving logic for using search API to updating search source

* Fix small merge error

* Move useSource switch to Discover section of advanced settings

* Do not use fields and source at the same time

* Remove unmapped fields switch

* Add basic support for grouping multifields

* Remove output.txt

* Fix some merge leftovers

* Fix some merge leftovers

* Fix merge errors

* Fix typescript errors and update nested fields logic

* Add a unit test

* Fixing field formats

* Fix multifield selection logic

* Request all fields from source

* Fix eslint

* Fix default columns when switching between _source and fields

* More unit tests

* Update API changes

* Add unit test for discover field details footer

* Remove unused file

* Remove fields formatting from index pattern

* Remove unnecessary check

* Addressing design comments

* Fixing fields column display and renaming it to Document

* Adding more unit tests

* Adding a missing check for useNewFieldsAPI; minor fixes

* Fixing typescript error

* Remove unnecessary console statement

* Add missing prop

* Fixing import order

* Adding functional test to test fields API

* [Functional test] Clean up in after

* Fixing context app

* Addressing PR comments

* Add support for unmapped fields

* Add data migration

* Add toggle unmapped fields logic

* Adding more unit tests

* Some cleanup

* More unit tests

* Fixing failing snapshot

* Add tooltip next to unmapped switch

* Add functional test for the feature

* Fixing a typo in a functional test

* Refetch data when unmapped fields value changes

* Updating mapping

* Support for fields API in search embeddable

* Addressing PR comments

* Fix failing unit test

* Updating the text

Co-authored-by: Luke Elmers <luke.elmers@elastic.co>
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-02-03 15:04:55 +00:00
Pierre Gayvallet 84d49f1123
[SOM] display invalid references in the relationship flyout (#88814)
* return invalid relations and display them in SOM

* add FTR test
2021-02-01 11:03:44 +01:00
Uladzislau Lasitsa e8e8f78b39
[Vega] Use mapbox instead of leaflet (#88605)
* [WIP][Vega] Use mapbox instead of leaflet #78395

add MapServiceSettings class

some work

add tms_raster_layer

add LayerParameters type

clenup view.ts

some cleeanup

fix grammar

some refactoring and add attribution control

Some refactoring

Add some validation for zoom settings and destroy handler

Some refactoring

some work

fix bundle size

Move getZoomSettings to the separate file

update licence

some work

move logger to createViewConfig

add throttling for updating vega layer

* move EMSClient to a separate bundle

* [unit testing] add tests for validation_helper.ts

* [Bundle optimization] lazy loading of '@elastic/ems-client' only if user open map layer

* [Map] fix cursor: crosshair -> auto

* [unit testing] add tests for tms_raster_layer.test

* [unit testing] add tests for vega_layer.ts

* VSI related code was moved into a separate file / unit tests were added

* Add functional test for vega map

* [unit testing] add tests for map_service_setting.ts

* Add unload in function test and delete some unneeded code from test

* road_map -> road_map_desaturated

* [unit testing] add more tests for map_service_settings.test.ts

* Add unit tests for view.ts

* Fix some remarks

* Fix unit tests

* remove tms_tile_layers enum

* [unit testing] fix map_service_settings.test.ts

* Fix unit test for view.ts

* Fix some comments

* Fix type check

* Fix CI

Co-authored-by: Alexey Antonov <alexwizp@gmail.com>
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-01-29 16:49:51 +03:00
Pierre Gayvallet 477d0bbe21
add SavedObject export hooks (#87807)
* initial POC

* fix spaces UT

* address POC feedback, add tests for applyExportTransforms

* add sorting for transforms

* add type validation in SOTR

* add FTR tests

* update documentation

* add explicit so type export for client-side

* update generated doc

* add exporter test

* update license headers

* update generated doc

* fix so import... imports

* update generated doc

* nits

* update generated doc

* rename test plugins

* adding FTR tests on export failures
2021-01-21 15:27:28 +01:00
Maja Grubic 9b22789c3c
[Discover] Use fields API to retrieve fields (#83891)
* Add search source to example plugin.

* Add uiSetting for fields API.

* Update SearchSource to support fields API.

* [PoC] reading from the fields API in Discover

* Add N fields as a default column

* Make fields column non-removeable

* Do not add 'fields' to state

* Remove fields from app state and read from source when needed

* Remove fields column if a new column is added

* Add search source to example plugin.

* Add uiSetting for fields API.

* Update SearchSource to support fields API.

* Improve error handling in search examples plugin.

* Add unit tests for legacy behavior.

* Remove uiSettings feature flag; add fieldsFromSource config.

* Rewrite flatten() based on final API design.

* Update example app based on final API design.

* Update maps app to use legacy fieldsFromSource.

* Update Discover to use legacy fieldsFromSource.

* Rename source filters to field filters.

* Address feedback.

* Update generated docs.

* Update maps functional test.

* Formatting fields column similar to _source

* Moving logic for using search API to updating search source

* Fix small merge error

* Move useSource switch to Discover section of advanced settings

* Do not use fields and source at the same time

* Remove unmapped fields switch

* Add basic support for grouping multifields

* Remove output.txt

* Fix some merge leftovers

* Fix some merge leftovers

* Fix merge errors

* Fix typescript errors and update nested fields logic

* Add a unit test

* Fixing field formats

* Fix multifield selection logic

* Request all fields from source

* Fix eslint

* Fix default columns when switching between _source and fields

* More unit tests

* Update API changes

* Add unit test for discover field details footer

* Remove unused file

* Remove fields formatting from index pattern

* Remove unnecessary check

* Addressing design comments

* Fixing fields column display and renaming it to Document

* Adding more unit tests

* Adding a missing check for useNewFieldsAPI; minor fixes

* Fixing typescript error

* Remove unnecessary console statement

* Add missing prop

* Fixing import order

* Adding functional test to test fields API

* [Functional test] Clean up in after

* Fixing context app

* Addressing PR comments

* Updating failed snapshot

* Addressing PR comments

* Fixing i18n translations, updating type

* Addressing PR comments

* Updating a functional test

* Add a separate functional test for fields API

* Read fields from source in a functional test

* Skip buggy test

* Use default behavior in functional tests

* Fixing remaining failing tests

* Fixing date-nanos test

* Updating FLS test

* Fixing yet another functional test

* Skipping non-relevant tests

* Fixing more tests

* Update stub import in test

* Fix import

* Fix invalid import

Co-authored-by: Luke Elmers <luke.elmers@elastic.co>
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-01-15 14:47:35 +00:00
Matthew Kime 48ac9f706e
[index patterns] Field custom name => custom label (#83717)
* custom name => custom label
2020-11-19 16:03:05 -06:00
Matthias Wilhelm 0a7f462939
[Discover] Allow custom name for fields via index pattern field management (#70039)
Co-authored-by: Matt Kime <matt@mattki.me>
2020-11-17 13:18:07 +01:00
Matthias Wilhelm b44a0e5b02
[Discover] Unskip flaky tests based on discover fixture index pattern (#82991) 2020-11-12 05:45:17 +01:00
Pierre Gayvallet 210d6f2df1
Legacy SO import: Fix bug causing multiple overrides to only show the last confirm modal (#76482)
* Legacy SO import: Fix bug causing multiple overrides to only show the last confirm modal

* eslint

* fix for loops
2020-09-03 08:50:03 +02:00
Matthias Wilhelm 7f6cd5148a
[Discover] Improve histogram tests (#72235) 2020-07-21 07:09:25 +02:00
Liza Katz 52b42a81fa
Allow creating filters from fields with null values in discover (#70936)
* Fix bug #7189

* typo

* Test adjustments

* wait for load complete

* Fine tune test

* Update src/plugins/data/public/query/filter_manager/lib/generate_filters.ts

Co-authored-by: Lukas Olson <olson.lukas@gmail.com>

* Fix filtering by an array of nulls
Allow filtering by a non existing field in the doc
simplify flatten hit logic

Co-authored-by: Lukas Olson <olson.lukas@gmail.com>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-07-09 11:58:22 +03:00
Liza Katz 537d2f2de1
[FIX] Allow filters without index (#68225)
* Allow filters without index

* Explicitly return true from isFilterApplicable id no index patterns were provided

* Adjust test result
2020-06-04 20:42:52 +03:00
Liza Katz fbcb74ce28
Add error if filter index pattern is missing (#66979)
* add error if filter index pattern is gone

* docs change - why?

* Fix i18n

* Added a functional test for broken filters (field + index pattern)

* Clarify readme

* Moved readme

* New warning status

* Remove getAll

* git pull upstream master

* Fix translation files

* Fix merge

* added filterbar texts

* disabled correction

* Disable check in maps test until #64861 is resolved

* Fix tests, warning state is not disabled.

* Adjust warning filter - ignore filters from "foreign" index pattern, that are still applicable

* Add an additional unrelaeted filter test

* Update src/plugins/data/public/ui/filter_bar/_global_filter_item.scss

Co-authored-by: Caroline Horn <549577+cchaos@users.noreply.github.com>

* Update src/plugins/data/public/ui/filter_bar/_global_filter_item.scss

Co-authored-by: Caroline Horn <549577+cchaos@users.noreply.github.com>

* Fixed test data

* Revert mapping

* Update data with missing test

* Update test to match data

* Code review

Co-authored-by: Caroline Horn <549577+cchaos@users.noreply.github.com>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-06-03 09:35:44 +03:00
Anton Dosov 13138c05c4
Fix "Could not locate that index-pattern" recreate link is not working (#67280)
added a functional test, because we've recently fixed this link and it regressed again
2020-05-27 14:56:45 +02:00
Pierre Gayvallet 61936a1870
[SOM] Preserve saved object references when saving the object (#66584)
* create field for references and add comments

* add FTR test

* remove comments

* address comments

* use real reference in dataset and assert against it.
2020-05-16 09:08:45 +02:00
Matthias Wilhelm 2a1c8d8de4
[Discover] Hide time picker when an indexpattern without timefield is selected (#62134)
* Assign valid value whether the timepicker should be displayed

* Add functional tests
2020-04-09 14:30:21 +02:00
DziyanaDzeraviankina f29a5dd05b
Auto interval on date histogram is getting displayed as timestamp per… (#59171)
* Auto interval on date histogram is getting displayed as timestamp per 0 milliseconds when x-axis bucket is collapsed

Closes #57822

* Fixed incorrect interval label displaying while scaling the chart.

* Updated agg.test.tsx snapshot

* Got rid of context and refactored agg hooks

* Fixed agg.type.name check

* Added functional tests to cover the date histogram interval editing

* Fixed some expected values in tests

* Updated some test cases

* Added a new visualization to visualize archive

* Added testSubjects service to replace find where possible

* Updated tests to match updated behavior

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-03-31 17:17:09 +03:00
Maryia Lapata 45a5ad55bc
[Default editor] Catch invalid calendar exception (#60494)
* Catch invalid calendar exception

* Use isValidEsInterval directly

* Show field error message right away

* Fix for the case 2w

* Update time_interval.tsx

* Restructure validation

* Rename fn to isValidCalendarInterval

* Refactoring

* Update time_interval.tsx

* Add functional tests

* Add functional tests for interval

* Update _area_chart.js

* Don't show error when value is empty

* Use error message from InvalidEsCalendarIntervalError

* Update _area_chart.js

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-03-26 18:24:03 +03:00
Lee Drengenberg afca33b520
add relationship test on Saved Objects (#59968)
* just a demo of function to return saved object table elements

* fix esArchive data, extend import objects test case for relationships

* improved data-test-subjs

* update snapshot for jest test

* unskip other half of the tests

* removed commented-out code

* use new findByTestSubject methods

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-03-23 14:18:35 -05:00
Pierre Gayvallet 395d621249
migrate saved objects management edition view to react/typescript/eui (#59490)
* migrate so management edition view to react

* fix bundle name + add forgotten data-test-subj

* add FTR tests for edition page

* EUIfy react components

* wrap form with EuiPanel + caps btns labels

* Wrapping whole view in page content panel and removing legacy classes

* improve delete confirmation modal

* update translations

* improve delete popin

* add unit test on view components

* remove kui classes & address comments

* extract createFieldList and add tests

* disable form submit during submition

Co-authored-by: cchaos <caroline.horn@elastic.co>
2020-03-19 14:09:44 +01:00
Matthias Wilhelm c42d23347a
[Discover] Fix context view for date_nanos format with custom timestamps (#54089)
* Switch from _source to fields when fetching anchor records with date_nanos timestamps

* Add testdata

* Add functional test
2020-01-14 15:15:30 +01:00
Brian Seeders d6e0e9a314
Revert "Merge branch 'savedExportImportTest'"
This reverts commit 97612ba44c, reversing
changes made to 60660fcd1e.
2019-12-20 10:34:14 -05:00
bhavyarm fdf3ed97d5 data files for saved objects 2019-12-16 10:15:17 -05:00
Matt Bargar 1dcec9d210
Add nested field support to KQL (#47070)
This PR adds a new syntax to KQL for querying nested fields.

Nested fields can be queried in two different ways:

Parts of the query may only match a single nested doc (bool inside nested). This is what most people want when querying on a nested field.
Parts of the query may match different nested docs (nested inside bool). This is how a regular object field works but nested fields can be queried in the same way. Although generally less useful, there are occasions where one might want to query a nested field in this way.
The new KQL syntax supports both.
2019-10-30 13:07:43 -04:00
Matthias Wilhelm 7ef41387b6
Add numeric_type option for correct sort order on mixed date and date_nanos fields (#44212)
* Implement getSortForSearchSource for add-on of 'numeric_type' to the ES request. Then sorting on a field that can be of date or date_nanos type works correctly

* Add functional test
2019-09-20 07:38:41 +02:00
Matt Bargar e233e419cf
Implement saved queries and filters (#39140)
Introduces "saved queries". Saved queries are a new saved object type similar to saved searches but more limited in scope. They allow users to store the the query string in the query bar and optionally the set of filters and timefilter in order to reload them anywhere a query is expected: Discover, Visualize, Dashboard, anywhere that uses our full SearchBar component.
2019-08-21 16:53:19 -04:00
Dmitry Lemeshko 9b9801f470
functional tests for input control range (#42483)
* [apps/visualize] functional tests for input control range

* update jest test to have 100% combined coverage with functional
2019-08-21 17:22:54 +02:00
Matthias Wilhelm a33201cf39
Support for date_nanos type timestamps in context view (#38023)
* Reenable context view for time_nanos based index patterns
2019-06-11 15:04:54 +02:00
Nathan Reese 8dbfbddb53
Fetch options for input control child select boxes (#38148) 2019-06-07 06:57:56 -06:00
Matthias Wilhelm 953930be49
Support Elasticsearch date_nanos datatype (#36111)
* Add date_nanos to date type in kibana field types
* date_nanos by default is formatted by "Date Nanos" format
* Format computed date_nanos field to strict_date_time to prevent rounding
* Hide Discover - "View surrounding documents" btn for date_nanos (will be subject of another PR)
* Append number of nano seconds to formatted timeField
* Add new key dateNanosFormat to UI setting defaults
2019-05-31 08:52:32 +02:00
Marco Vettorello 57b66c6085
Fix filling x axis values for date histogram (#35247)
The interval parameter is used to fill the gaps between missing buckets. If we are using a calendar interval it not always correspond correctly to his milliseconds representation. E.g. 1y interval can correspond to 365 or 366 days depending on the interval and. If transformed to milliseconds it can get one of those two values depending of the interval start and end. The same happens for months.

Add a new esarchive with 7 years of data, used for those functional tests

Removed angular dependency from zero injection
2019-04-24 07:37:11 +02:00
John Dorlus e79959273f
Removed createIndexPattern via UI and used ES Archiver. (#35374) 2019-04-23 10:50:04 -04:00