Commit graph

77 commits

Author SHA1 Message Date
Peter Pisljar 800cfb504c
[expressions] select_filter and remove_filter functions (#113533) 2021-10-21 11:03:53 +02:00
Matthew Kime a935f6b723
[data views] DataViewBase now requires a title (#115082)
* dataViewBase now requires a title
2021-10-15 05:06:47 -05:00
Matthew Kime 202980e887
[data views] clarify field subtype typescript types (#112499)
* separate out multi and nested subTypes

* separate out multi and nested subTypes

* add undefined checks

* remove expect error statements

* use helper functions in es-query

* simplify changes with helper functions

* checking existence instead of getting value x2

* simplify types and revert discover changes

* update discover sidebar with helper methods

* try helpers with group_fields file

* try different helper with group_fields file

* revert group field changes, try nested field helpers

* revert nested field changes, try field_name.tsx helpers

* fix maps jest test

* use helpers in discover instead of setting types

* fix field_name.tsx

* Update index_pattern_util.test.ts

* lint  fix

* fix common exports

* reduce data_views plugin bundle size

* reduce data_views plugin bundle size

* remove discover reliance on es-query package

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-10-06 23:13:21 -05:00
Peter Pisljar 1a577dfbfa
filter types (#111269) 2021-10-06 17:46:54 +02:00
Tyler Smalley 4681a80317
[DX] Upgrade prettier to v2.4.0 (#112359)
Signed-off-by: Tyler Smalley <tyler.smalley@elastic.co>
2021-09-19 22:34:30 -07:00
Tiago Costa 7c4e4f507b
chore(NA): replace babel config files by inline presets by default in the jsts_transpiler rule (#110620)
* chore(NA): replace babel config files by inline presets by default in the js_ts_transpiler rule

* chore(NA): update @kbn/ace build to exclude worker file

* chore(NA): remove config file support

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-09-03 21:17:46 +01:00
Matthew Kime 75c6afe112
[data views] deprecate indexPattern exports, provide dataView exports (#109987)
* first pass at renaming exports

* type fixes

* fix jest test

* look for correct error type

* remove transitional error

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-08-30 18:04:03 -05:00
Liza Katz 268a279930
[Data][Es Query] Use ES types in Filters (#108378)
* es-query types

* jest and lint

* cc

* options

* type

* types for kuery FUNCTIONS

* doc

* types for filters

* sec fixes

* filtersss

* typey type

* typey type

* comparator options

* test typescript

* test

* fixes

* test types

* test

* cr

* cleanup a bit more

* Jest fix + types

* Remove geo bounding box and geo polygon filters

* delete geo filters

* geo

* geo

* Fix tests \_0_/

* doc

* types and fixes

* jests

* ts

* Remove geo bounding box and geo polygon filters

* delete geo filters

* delete geo filters

* geo

* remove geo docs

* ts

* plg ts

* types

* cast

* Update types.ts

* Update create_threat_signal.ts

* Update packages/kbn-es-query/src/es_query/migrate_filter.ts

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

* Code review

* revert change

* docs

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Lukas Olson <olson.lukas@gmail.com>
2021-08-24 11:28:22 +02:00
Liza Katz 6a1a1afd3a
[Data cleanup] Remove geo filters (#109097)
* Remove geo bounding box and geo polygon filters

* delete geo filters

* delete geo filters

* geo

* remove geo docs
2021-08-18 17:08:42 +02:00
Mikhail Shustov 94f35087b0
fix another conflict in test file (#108905) 2021-08-17 15:29:02 +02:00
Mikhail Shustov 609bd90785
mute incorrect types in es-query (#108898)
* mute incorrect types in es-query

* fix another conflict
2021-08-17 15:21:14 +02:00
Liza Katz 9d1a8a87f8
[Data][Es Query] Use ES types in Kuery functions (#108367)
* es-query types

* jest and lint

* cc

* options

* type

* types for kuery FUNCTIONS

* doc

* sec fixes

* typey type

* test typescript

* test

* fixes

* test

* cr

* cleanup a bit more

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-08-17 11:49:16 +02:00
Liza Katz e91baea5dc
[Data][Es Query] Use ES types instead of DslQuery (#108290)
* es-query types

* jest and lint

* cc

* options

* type

* type
2021-08-12 21:23:33 +02:00
Lukas Olson a2347b2d77
Add scoring support to KQL (#103727)
* Add ability to generate KQL filters in the "must" clause
Also defaults search source to generate filters in the must clause if _score is one of the sort fields

* Update docs

* Review feedback

* Fix tests

* update tests

* Fix merge error

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-08-11 21:45:01 -07:00
Spencer c0395c9ef6
[build_ts_refs] improve caches, allow building a subset of projects (#107981)
* [build_ts_refs] improve caches, allow building a subset of projects

* cleanup project def script and update refs in type check script

* rename browser_bazel config to avoid kebab-case

* remove execInProjects() helper

* list references for tsconfig.types.json for api-extractor workload

* disable composite features of tsconfig.types.json for api-extractor

* set declaration: true to avoid weird debug error

* fix jest tests

Co-authored-by: spalger <spalger@users.noreply.github.com>
2021-08-10 22:12:45 -07:00
Liza Katz 204efae5bf
[Data cleanup] unify serializable state (#107745)
* Use Serializable from package

* Rename to align with core

* fix

* more replacements

* docssss

* fix

* Move it to @kbn/utility-types and remove core export

* buildy build

* tests

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-08-10 13:03:48 +02:00
Liza Katz c048f71626
[Data] Cleanup filter docs (#107169)
* Move more utils to package and cleanup API

* docs and imports

* better imports

* change comment

* Better docs

* typos

* typo

* fixes

* casting

* Code review

* Update meta_filter.ts

* fix

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-08-02 12:14:19 +02:00
Tiago Costa e0ea3233d9
chore(NA): moving @kbn/es-query to babel transpiler (#107281)
* chore(NA): moving @kbn/es-query to babel transpiler

* chore(NA): update limits
2021-07-30 18:38:02 +01:00
Liza Katz eeb88b0833
[Data][Filters] Move more filter utils to package and cleanup API (#106566)
* Move more utils to package and cleanup API

* docs and imports

* better imports

* change comment

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-07-28 13:29:32 +02:00
Liza Katz a6af9d5050
[Es query] Move to package (#103530)
May the forces of bootstrapping helps us 🙏🏻 😉
2021-07-21 17:10:55 +02:00
Alexey Antonov c415311221 Move @kbn/es-query into data plugin (#51014) 2019-11-26 13:28:04 -07:00
Alexey Antonov c0d2b29e8b
Move @kbn/es-query into data plugin - remove unused code (#50903) 2019-11-19 11:15:46 +03:00
Alexey Antonov 9769be3a28
Move @kbn/es-query into data plugin - es-query folder (#50182)
* Move @kbn/es-query into data plugin - es-query

* fix eslint issues

* Fix PR comments

* fix CI

* fix Ci

* remove extra ts-ignore

* fix imports

* fix imports

* Test importing from data/public and casting to ES Field Types.

* Test importing from data/public and casting to ES Field Types.
2019-11-15 23:35:21 +03:00
Alexey Antonov c3951e9374 Move @kbn/es-query into data plugin - filters folder (#49843)
Dismissing reviews from ml and canvas as this is only an import change. 


* Move @kbn/es-query into data plugin - filters folder

* fix PR comments
2019-11-07 22:02:49 -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
renovate[bot] 5b375df8e9 Update moment related packages (#46849)
* Update moment related packages

* unify moment version in yarn.lock

* adapt ro pluralization fixes

* update some bad pluralization in fixtures/snapshots
2019-10-28 12:07:35 -07:00
Spencer a859577b40
Remove rimraf (#48985)
* Update dependency del to v5

* unify del/rimraf usage with del v5

* update yarn.lock

* update kbn-pm distributable

* remove poorly transformed code

* force some deletes from tmp

* mock less of the fs module

* force tmp deletion in a few more suites

* please make this the last force
2019-10-24 06:29:43 -07:00
Matt Bargar b5b8b4d87c
Stop generating filters with old invalid match phrase query syntax (#48033)
We've migrated the old syntax at query time for a long time, but when creating a phrase filter we still used the old (now invalid) syntax. This could be confusing to users since the raw query DSL is viewable in the filter editor. Also, since map_phrase.ts only expected the old syntax, it wouldn't detect a match_phrase filter if the user entered the new syntax into the raw DSL editor.

This PR updates all of the filter generation code that I know of to use the new syntax, and it updates the map_phrase.ts file to accept both syntaxes.
2019-10-22 13:46:44 -04:00
Lukas Olson 3c7b1603f5
Refactor, deangularize courier/search source (#45235)
* Initial refactor of search source

* Add abort signal to search source fetch and remove cancel queued

* Remove usages of Angular Promises

* Remove usages of angular "sessionId" service

* Remove config as dependency

* Update deps on config and esShardTimeout

* Remove remaining angular dependencies from SearchSource

* Fix Karma tests

* Separate callClient and handleResponse and add tests for each

* Add tests for fetchSoon

* Add back search source test and convert to jest

* Create search strategy registry test

* Revert empty test

* Remove filter predicates from search source

* Update typings and throw response errors

* Fix proxy to properly return response from ES

* Update jest snapshots

* Remove unused translations

* Don't pass search request to onRequestStart, create it afterwards

* Fix search source & get search params tests

* Fix issue with angular scope not firing after setting state on vis

* Fix tag cloud vis

* Fix setting of visConfig to not happen async

* Remove unused snapshots

* Remove unused reference to IPrivate
2019-10-18 11:38:09 -07:00
Rudolf Meijering 3d28467d00
Server saved objects client through request context (#44143)
* Expose Saved Objects client in request context

* API Integration test for savedobjects in req context

* SavedObjectsClient docs

* SavedObjectsClient#find remove dependency on indexPatterns

And use the saved objects mappings instead

* Review comments

* Review comments, fixes and tests

* Use correct type for KQL syntax check
2019-10-16 10:36:40 +02:00
Alexey Antonov 8837faebde
Convert ui/agg_types/buckets to TypeScript / Jest (#47730)
* Convert `ui/agg_types/buckets` to TypeScript / Jest

* fix eslint issues

* fix CI

* fix JEST test

* fix mocha tests

* Fix PR comments
2019-10-15 21:18:34 +03:00
Liza Katz 338851f5d3
Remove indexPatterns dependency from filter service (#47471)
* Get rid of addFiltersAndChangeTimeFilter

* ts fix

* remove timefilter dependency from filter manager

* code review change

* Fixed bug in tests

* changeTimeFilter

* Refactored mappers and filter service to have no dependency on indexPatterns by generating the filter disaplyName in the relevant components.

* Fix map and flatten test

* Fixed filter state manager test

* Remove async from addFIlters and setFilters

* Fixed saved objects test - removed (display)value from url

* Make removeAll sync

* defer setFilters and removeAll in dashboard controller - temp hack

* fixed translation in filter view

* update strings

* Fixed range rendering

* map range converter
2019-10-15 15:23:24 +03:00
Wylie Conlon ab05bbd94e
[lens] Use top nav in Lens app (#46190)
* [lens] Use top nav in Lens app

* Add tests for saved query, pass filters around more places

* Fix filter passing

* Add unit test for field popover making correct queries

* Respond to review feedback

* Fix type errors

* Respond to all review comments

* Remove commented code

* Top nav should be compatible as angular directive

* Fix rendering issue with filter updates

* Respond to review comments and add onChange test

* Add specific test for the index pattern bug from Tina
2019-10-03 11:24:45 -04:00
Xavier Mouligneau d95c47f776
Add KQL functionality in the find function of the saved objects (#41136)
* Add KQL functionality in the find function of the saved objects

wip

rename variable from KQL to filter, fix unit test + add new ones

miss security pluggins

review I

fix api changes

refactor after reviewing with Rudolf

fix type

review III

review IV

for security put back allowed logic back to return empty results

remove StaticIndexPattern

review V

fix core_api_changes

fix type

* validate filter to match requirement type.attributes.key or type.savedObjectKey

* Fix types

* fix a bug + add more api integration test

* fix types in test until we create package @kbn/types

* fix type issue

* fix api integration test

* export nodeTypes from packages @kbn/es-query instead of the function buildNodeKuery

* throw 400- bad request when validation error in find

* fix type issue

* accept api change

* renove _ to represent private

* fix unit test + add doc

* add comment to explain why we removed the private
2019-10-02 18:23:44 -04:00
Alexey Antonov 905d021c5a
Convert filter_manager/lib to TypeScript / Jest (#45785)
* Convert filter_manager/lib to TypeScript / Jest

Fix: #44952

* Update map_query_string.ts

* remove extra ts-ignore

* formatting

* fix PR comments

* Fix PR comments

* fix PR comments

* fix PR comments

* fix merge conflicts

* revert logic

* Fix PR commnets

* add tests for compare_filters

* fix PR comments
2019-09-27 15:22:29 +03:00
renovate[bot] 0001c74370 Update dependency del to ^4.1.1 (#44806) 2019-09-04 13:15:59 -07:00
renovate[bot] 572274b779 Update babel related packages (#43595)
* upgrade all babel related modules, and bump lodash minors

* update kbn-pm dist

* update fetch-mock, necessary to use core-js 3

* use regenerator transform in jest tests, as required by EUI

* disable useBuiltIns rather than using regenerator plugin

* remove extra regenerator-runtime import
2019-08-22 18:40:57 -07:00
renovate[bot] b178de1975 Update dependency supports-color to v7 (#43064) 2019-08-12 12:43:27 -06:00
Matt Bargar dd75d831fe
Put filters back in the filter context where they belong (#42095)
Filters were never really meant to take part in scoring in the first place. This PR puts filters back in the filter context where they were in 4.x so they can benefit from the filter cache.
2019-08-01 17:43:01 -04:00
Peter Pisljar ba8a453112 Initial conversion of Index Patterns service to TypeScript. 2019-07-30 08:26:42 -06:00
Spencer 06b9853925
[autoprefixer] upgrade to 9.6.1, unify browserslist handling (#41038)
* [autoprefixer] upgrade to 9.6.1, unify browserslist handling

* remove debug option from datemath babel config
2019-07-15 09:33:33 -07:00
Brandon Kobel 174102c70c
Updating lodash (#40702)
* Updating to @elastic/lodash to 3.10.1-npm-kibana2

* Updating lodash to 4.17.13

There's a stray dependency to lodash 4.17.11 via cypress which doesn't
use "^". This is a dev dependency, so we can ignore it for a bit while
they update their package.json

* Updating some forgotten references to @elastic/lodash@3.10.1-kibana1

* Updating lodash-es to 4.17.13

* Updating to @elastic/lodash to 3.10.1-npm-kibana3

* Using the root resolutions to update cypress's version of lodash.

Thanks @spalger!!!
2019-07-12 10:32:45 -07:00
Spencer 415e3bca27
[ts] upgrade to 3.5.3 (#40228)
* [ts] upgrade to 3.5.2

* [ts] run from cwd so that relative paths are correct

* move eslint-disable-line comment into jsx attribute

* autofix eslint violations

* avoid generic type, it's not necessary and problematic

* make elasticsearch.cluster optional, many instances don't have them

* remove invalid prop

* expand AllowUnknownProperties to cleanly handle arrays

* esfilter values can sometimes be an array of strings

* allow exception objects to have unknown properties

* define accumulator as a boolean

* fix return type

* return a 404 if beat isn't found after update

* use Object.values for better types

* define return type of get() call

* define value type for Set

* define return value of get()

* define State property type

* use less get(), so ts can infer types

* define Set item type

* map state type

* make default_operator optional, since it's not always defined

* remove seemingly unused prop

* define return type of get() fn

* define inner type for state

* don't define base types are objects with index signatues

* regenerate public api docs

* make indices privileges optional too

* remove unnecessary index-signature from Exception interface

* use variadic _arg instead

* [core/plugin] use Record<string, any> rather than {}

* replace a couple more instances of {}

* revert some unnecessary changes

* remove unused types

* [reporting] output, payload, and meta are required properties

* bump to latest patch version
2019-07-10 12:26:23 -07:00
Peter Pisljar 444bafbe0e
updating metricvis interpreter func arguments (#34532) 2019-06-28 05:44:43 +02:00
Matt Bargar c703ef1499
Enable use of KQL and autocomplete in filters agg editor (#37287)
This PR updates the filters agg editor to use the full QueryBar component, enabling use of KQL and autocomplete inside the editor for this aggregation in Visualize.
2019-06-07 11:09:31 -05:00
Stacey Gammon 8d78f64391
Typescript dashboard app code. (#37527)
* Typescript dashboard app code. Pulls out part of the massive embeddable API PR.

I typscripted this code as part of that PR because it helped me find errors, but really unnecessarily blew up the size of that PR. So pulling out.

* User filter types from kbn-es-query

* Address code review feedback

* Replace require with import
2019-06-06 09:14:02 -04:00
renovate[bot] c60e3491a2 chore(deps): update dependency del to v4 (#37466)
* chore(deps): update dependency del to v4

* remove @types/del since they ship with the package now
2019-05-30 13:40:35 -07:00
renovate[bot] 830bd1f0ca Update babel related packages (#37464) 2019-05-30 13:40:23 -07:00
renovate[bot] 9256c74fdf Pin dependencies (#37406)
* Pin dependencies

* include core-js in babel packages

* specify core-js version when using `useBuiltIns`

* dedupe @babel/types to avoid "range of null" problem
2019-05-30 00:31:01 -07:00
Nikita Glashenko 34cab97307 Fix histogram range update when x axis is scripted field (#25379) 2019-05-23 11:35:18 +02:00