* [SOM] display invalid references in the relationship flyout (#88814)
* return invalid relations and display them in SOM
* add FTR test
* fix mappings for 7.x
* initial commit
* adapt client-side signatures
* more type fixes
* adapt api IT asserts
* fix some unit tests
* fix more test usages
* fix integration tests
* fix FT test assertions
* fix FT test assertions
* add FTR API integ test suite
* create the plugin_api_integration test suite
* adapt and fix flyout tests
* update documentation
* update generated doc
* add unit tests for `executeImportHooks`
* wire resolve_import_errors and add unit tests
* move hooks registration to SO type API
* update generated doc
* design integration
* update generated doc
* Add FTR tests for import warnings
* deletes plugins api integ tests
* self review
* move onImport to management definition
* update license header
* rename actionUrl to actionPath
* 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>
* SavedObjects tagging MVP (#79096)
* create xpack plugin skeleton, start to implement management section
* add tag creation modal
* first implementation of the tags table
* use InMemoryTable
* add edit modal and delete action
* update plugin list
* add tag list, fix types
* add capabilities check on client-side
* add tag combo box component
* add missing i18n keys
* fix privilege FTR tests
* add base structure for FTR tests
* fix feature ftr test
* use string literals for i18n
* create savedObjectsTaggingOss plugin, move API types to oss plugin, start to wire to SO management page.
* update plugin list
* fix types
* allow to use `_find` with multiple references
* add FTR test for _find API on references fields
* add _find integration tests
* update generated doc
* start to implement tag filtering on SO management section
* update generated docs
* wire tagging API to dashboard listing page
* fix i18n namespace
* fix type & tests
* update dashboard listing snapshots
* adapt FTR listingTable service to search for parsable queries
* wite tagging API to visualize listing
* update tagging plugin limits
* add server-side and client-side validation for tag create/edit
* rename title field to name
* fix types
* fix types bis
* add removeReferencesTo API to SOR/SOC
* update generated doc
* add server-side unit test for `savedObjectsTagging` plugin
* move tagging API types to its own file
* add savedObjectsTaggingOss mock
* add tags_cache tests
* add tests for client-side tag client
* extract uiApi to distinct files
* various API improvements
* add more tests
* add link between tag and so management sections + add connection counts
* add base functional test suite for tagging
* add more FTR tests
* improve feature control func test
* update codeowners
* update generated doc
* fix access to proxy modal
* adapt SO save modal to allow to add tag field
* add SO decorator registry and tag implementation
* add unit tests for SO tag decorator
* add functional tests for visualize integration
* add tag SO read permission for vis/dash feature
* add RBAC api integ tests
* add API integration tests
* add test for getTagConnectionsUrl
* add SOM test suite
* add dashboard integration suite
* remove test line
* add missing unit tests
* improve API types doc
* fix create modal save button label
* remove console.log
* improve doc
* self review
* add refresh interval for tag cache
* improve page object doc
* minor cleanup
* address review comments
* small layout fixes
* add initial focus
* use lazy accessor for tag request handler context
* adapt SOM export and export route to handle references
* remove icon from feature config due to master changes
* fix SO table tests
* update generated docs
* sort tags by name in filter dropdown and listing component
* wire SO tagging to dashboard save modal
* fix types
* - add 'create tag' action in tag selector
- add notifications on update/create/delete from management
- delete modal wording
* add description max length validation
* remove real-time validation
* fix i18n bundle id
* update expected size of savedObjectsTagging plugin
* use own useIfMounted
* update limit again, contract components cannot be lazy loaded atm.
* math is hard
* remove single usage of lodash for bundle size
* add async imports for create/edit modal
* add FTR test for 'create tag' action from tag selector
* allow 'create new' option to prepopulate name field
* extract savedObjectToTag
* add advancedSettings read user for security api_integ suite
* add audit login for security client wrapper
* use import type when possible
* wire SO tagging to lens visualization
* fix lens jest test
* Fix `create tag` option being selected when closing the selector dropdown
* add sorting to tag column from getTableColumnDef
* address some of restrry comments
* rename tag selector's setSelected option to onTagsSelected
* fix audit logging even type for saved_object_remove_references
* update plugin size limit to current size
* adapt maxlength validation wording
* remove selection column until we have batch action menu
* remove connections link when user lack read privilege to savedObjectManagement
* forbid registering multiple SO decorators with the same priority
* add so decorator test
* extract getTagFindReferences and create API mock
* update audit-logging ascidoc
* doc nit
* throw conflict error if update returns any failure
* use refresh=true as default
* wording nits
* export: rename `references` to `hasReference`
* update generated doc
* set description max length to 100
* do not initialize tag cache on anonymous pages
* split fetchObjectsToExport into two distinct functions
* change tag client `delete` call order
* tsdoc nits
* more nits
* add README for oss plugin
* add oss plugin start tests
* SavedObject.find: rename `references` to `hasReference`
* change section description label
* remove url prefix constants
* last nits and comments
* update generated doc
# Conflicts:
# .github/CODEOWNERS
# packages/kbn-optimizer/limits.yml
# x-pack/scripts/functional_tests.js
* fix FTR mapping files for 7.x
* mark legacy ES client types as deprecated
* expose es client to plugins and update mocks
* ElasticSearchClientMock --> ElasticsearchClientMock
* expose es client mocks
* expose es client via RequestHandlerContext
* convert test/plugin_functional/config into ts
* convert top_nav test into ts
* add an integration test for the es client
* update comments to refer to the new es client
* fix import paths. do not use extensions
temp
* update docs
* fix other refs
* add test for a custom client
* fix context
* add test for scoped client
* update docs
# Conflicts:
# scripts/functional_tests.js
* adapt retryCallCluster for new ES client
* review comments
* retry on 408 ResponseError
* remove legacy retry functions
* use Migrator Es client in SO migration
* update migration tests
* improve ES typings and mocks
* migrate decorate ES errors
* add repository es client
* use new es client in so repository
* update repository tests
* fix migrator integration tests
* declare _seq_no & _primary_term on get response. _source expect to be a string
* make _sourceIncludes and refresh compatible with the client
* add test for repository_es_client
* move ApiResponse to es client mocks
* TEMP: handle wait_for as true for deleteByNamespace
* add tests for migration_es_client
* TEMP: skip test for deleteByNamespace refresh
* pass ignore as transport option in mget
* log both es client and response errors
* fix update method test failures
* update deleteByNamespace refresh settings
es doesn't support 'refresh: wait_for' for `updateByQuery` endpoint
* update repository tests. we do not allow customising wait_for
* do not delegate retry logic to es client
* fix type errors after master merged
* fix repository tests
* fix security solutions code
SO doesn't throw Error with status code anymore. Always use SO error helpers
* switch error conditions to use SO error helpers
* cleanup
* address comments about mocks
* use isResponseError helper
* address comments
* fix type errors
Co-authored-by: pgayvallet <pierre.gayvallet@elastic.co>
Co-authored-by: pgayvallet <pierre.gayvallet@elastic.co>
* chore(NA): upgrade to lodash@4 (#69868)
* chore(NA): upgrade oss to lodash4
chore(NA): migrate cli, cli_plugin, cli_keystore, dev, test_utils and apm src script to lodash4
chore(NA): missing file for cli plugin
chore(NA): add src core
chore(NA): es archiver and fixtures
chore(NA): try to fix functional test failure
chore(NA): migrate src/legacy entirely to lodash4 except src/legacy/core_plugins
chore(NA): move legacy core plugins to lodash4
chore(NA): upgrade optimize to lodash4
chore(NA): upgrade to lodash4 on advanced_settings, charts, console and dashboard
chore(NA): migrate to lodash4 on dev_tools, discover, embeddable, es_ui)shared, expressions, home plugins
chore(NA): upgrade data plugin to lodash4
chore(NA): upgrade usage_collection, ui_actions, tile_map, telemtry, share, saved_objects, saved_objects_management, region_map and navigation to lodash4
chore(NA): missing data upgrades to lodash4
Revert "chore(NA): upgrade usage_collection, ui_actions, tile_map, telemtry, share, saved_objects, saved_objects_management, region_map and navigation to lodash4"
This reverts commit 137055c5fed2fc52bb26547e0bc1ad2e3d4fe309.
Revert "Revert "chore(NA): upgrade usage_collection, ui_actions, tile_map, telemtry, share, saved_objects, saved_objects_management, region_map and navigation to lodash4""
This reverts commit f7e73688782998513d9fb6d7e8f0765e9beb28d1.
Revert "chore(NA): missing data upgrades to lodash4"
This reverts commit 92b85bf947a89bfc70cc4052738a6b2128ffb076.
Revert "chore(NA): upgrade data plugin to lodash4"
This reverts commit 88fdb075ee1e26c4ac979b6681d8a2b002df74c6.
chore(NA): upgrade idx_pattern_mgt, input_control_vis, inspector, kbn_legacy, kbn_react, kbn_usage_collections, kbn_utils, management and maps_legacy to lodash4
chore(NA): map src plugin data to lodash3
chore(NA): missing lodash.clonedeep dep
chore(NA): change packages kbn-config-schema deps
chore(NA): update renovate config
chore(NA): upgrade vis_type plugins to lodash4
chore(NA): move vis_type_vislib to lodash3
chore(NA): update visualizations and visualize to lodash4
chore(NA): remove lodash 3 types from src and move test to lodash4
chore(NA): move home, usage_collection and management to lodash 3
Revert "chore(NA): move home, usage_collection and management to lodash 3"
This reverts commit f86e8585f02d21550746569af54215b076a79a3d.
chore(NA): move kibana_legacy, saved_objects saved_objects_management into lodash3
chore(NA): update x-pack test to mock lodash4
Revert "chore(NA): move kibana_legacy, saved_objects saved_objects_management into lodash3"
This reverts commit 2d10fe450533e1b36db21d99cfae3ce996a244e0.
* chore(NA): move x-pack and packages to lodash 4
* chore(NA): remove mention to lodash from main package.json
* chore(NA): remove helper alias for lodash4 and make it the default lodash
* chore(NA): fix last failing types in the repo
* chore(NA): fix public api
* chore(NA): fix types for agg_row.tsx
* chore(NA): fix increment of optimizer modules in the rollup plugin
* chore(NA): migrate `src/core/public/http/fetch.ts` (#5)
* omit undefined query props
* just remove merge usage
* fix types
* chore(NA): fixes for feedback from apm team
* chore(NA): recover old behaviour on apm LoadingIndeicatorContext.tsx
* chore(NA): fixes for feedback from watson
* Platform lodash4 tweaks (#6)
* chore(NA): fix types and behaviour on src/core/server/elasticsearch/errors.ts
* Canvas fixes for lodash upgrade
* [APM] Adds unit test for APM service maps transform (#7)
* Adds a snapshot unit test for getConnections and rearranges some code to make testing easier
* reverts `ArrayList` back to `String[]` in the painless script within `fetch_service_paths_from_trace_ids.ts`
* chore(NA): update yarn.lock
* chore(NA): remove any and use a real type for alerts task runner
Co-authored-by: Gidi Meir Morris <github@gidi.io>
* chore(NA): used named import for triggers_actions_ui file
* chore(NA): fix eslint
* chore(NA): fix types
* Delete most uptime lodash references.
* Simplify. Clean up types.
* [Uptime] Delete most uptime lodash references (#8)
* Delete most uptime lodash references.
* Simplify. Clean up types.
* chore(NA): add eslint rule to avoid using lodash3
* chore(NA): apply changes on feedback from es-ui team
* fix some types (#9)
* Clean up some expressions types.
* chore(NA): missing ts-expect-error statements
* Upgrade lodash 4 vislib (#11)
* replace lodash 3 with lodash 4 on vislib plugin
* Further changes
* further replacement of lodash3 to 4
* further work on upgrading to lodash 4
* final changes to update lodash
* chore(NA): upgrade data plugin to lodash4
chore(NA): upgrade data plugin public to lodash4
chore(NA): fix typecheck task
chore(NA): fix agg_config with hasIn
chore(NA): assign to assignIn and has to hasIn
chore(NA): upgrade data plugin server to lodash4
chore(NA): new signature for core api
fix(NA): match behaviour between lodash3 and lodash4 for set in search_source
* chore(NA): remove lodash3 completely from the repo
* chore(NA): fix x-pack/test/api_integration/apis/metrics_ui/snapshot.ts missing content
* chore(NA): fix lodash usage on apm
* chore(NA): fix typecheck for maps
* Patch lodash template (#12)
* Applying changes from https://github.com/elastic/kibana/pull/64985
* Using isIterateeCall, because it seems less brittle
* Also patching `lodash/template` and `lodash/fp/template`
* Reorganizing some files...
* Revising comment
* Ends up `_` is a function also... I hate JavaScript
Co-authored-by: Pierre Gayvallet <pierre.gayvallet@gmail.com>
Co-authored-by: Josh Dover <me@joshdover.com>
Co-authored-by: Clint Andrew Hall <clint.hall@elastic.co>
Co-authored-by: Oliver Gupte <ogupte@users.noreply.github.com>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
Co-authored-by: Gidi Meir Morris <github@gidi.io>
Co-authored-by: Justin Kambic <justin.kambic@elastic.co>
Co-authored-by: Stratoula Kalafateli <stratoula1@gmail.com>
Co-authored-by: Luke Elmers <luke.elmers@elastic.co>
Co-authored-by: Brandon Kobel <brandon.kobel@gmail.com>
Co-authored-by: kobelb <brandon.kobel@elastic.co>
# Conflicts:
# renovate.json5
# x-pack/plugins/apm/public/services/rest/observability_dashboard.ts
# x-pack/plugins/canvas/common/lib/pivot_object_array.ts
# x-pack/plugins/canvas/public/components/workpad_templates/workpad_templates.js
# x-pack/plugins/canvas/server/collectors/custom_element_collector.ts
# x-pack/plugins/canvas/server/collectors/workpad_collector.ts
* chore(NA): updated kbn-pm dist file
* Deserialize bulkCreate response to remove namespace type from id
* Index operations don't return _source in response
* Fix integration tests
* repository: make id generation and seq_no/primary_term spreading more explicit
* API Integration test for bulk create without ids
* Fix copy_to_space snapshot
* Revert "Fix copy_to_space snapshot"
This reverts commit 9c2b7433e3.
* Move test into returns block
* repository.test.js stricter regexp matching
* [Telemetry] oss api tests (#64602)
* Adds telemetry API tests for oss
* Modifies test expectations to match that within oss
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
* Update telemetry_local.js
debugs backport issue
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
* unexpose SavedObjectsManagement from legacy server
* migrate saved object management routes to new plugin
* fix endpoint methods
* adapt code due to rebase
* extract types
* improve findAll params
* adapt existing api integration tests and migrate to TS
* update generated doc
* add API integration tests for /scroll/count
* add unit tests for plugin and routes
* add injectMetaAttributes tests
* extract relation type
* add find_relationships tests
* add find_all tests
* do not complete migrator$ to avoid unhandled promise rejection
* fix data for search endpoint integration tests
* remove falsy comment
* rename plugin folder to match plugin id
* address review comments
* update CODEOWNERS
* add management section to SavedObjectsType
* adapt import/export routes to get types accessor
* add documentation
* update generated doc
* update migration guide
* use request context to access exportable types
* update generated doc
* adapt SavedObjectsManagement to use the registry
* stop magical tricks about the config type, register it as any other so type.
* fix FTR assertions
* fix so_mixin tests
* register the `config` type from the uiSettings service
* nits and comments
* update generated doc
* remove true from dynamic property definition, use force-cast back for config type
* remove obsolete test comment
* [csp] allow blob styles when running from source
* update kbn/pm dist
* add kibanaServer service to saml_api_integration suite
* use common naming
* attempt to use env.packageInfo instead of IS_KIBANA_DISTRIBUTABLE const
* remove mock, clone rules before modifying
* pass env where necessary
* update core api docs
* make env optional in HttpConfig
* add tests for CspConfig changes, base header on this.rules
* fix test snapshot
* make env optional in HttpConfig too
* remove CspConfig.DEFAULT and make env a required constructor arg
* update csp_usage_collector tests
* update core api docs
* fix test name
* rename headerChangedFromDefault back to rulesChangedFromDefault
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
* Revert "Add label and icon to nested fields in the doc table (#54199)"
This reverts commit f77b3620
* Apply label and icon to nested fields in the doc table
* Add nested type to field_icon
* Improve nested test and add comment
* Fix tests
* Always pass the field type
Co-authored-by: Matt Bargar <mbargar@gmail.com>
* Generate legacy vars when rendering all applications
* Move rendering functional tests and add user settings tests
* Make rendering integration tests more robust, get data from page
* Address review nits, fix CI failures
* Remove extraneous file
* Fix type error
* Apply label and icon to nested fields in the doc table
* Include nested fields in the index pattern so we can identify them in the Discover UI
* use color recommended by design
* Fix unit tests
* Update api integration test
* Fix test comment
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
Co-authored-by: Tim Roes <mail@timroes.de>
Co-authored-by: Matt Bargar <mbargar@gmail.com>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
This instructs mapbox-gl to load its workers using a static script. It removes the corresponding child-src CSP-rule from the policy. It retains the worker-src rule as it is required by the ace-editor in Dev-tools.
* [FTR] expose new es client service (#51066)
* always extend all common config and expose new es client service
* replace `es` service with `legacyEs`
* fix one refernce that's unique to 7.x
* initial push
* self code review
* ignore node-fetch type
* usageFetcher api
* user agent metric
* telemetry plugin collector
* remove extra unused method
* remove unused import
* type check
* fix collections tests
* pass kfetch as dep
* add ui metrics integration test for user agent
* dont start ui metrics when not authenticated
* user agent count always 1
* fix broken ui-metric integration tests
* try using config.get
* avoid fetching configs if sending
* type unknown -> string
* check if fetcher is causing the issue
* disable ui_metric from functional tests
* enable ui_metric back again
* ignore keyword above 256
* check requesting app first
* clean up after all the debugging :)
* fix tests
* always return 200 for ui metric reporting
* remove boom import
* logout after removing role/user
* undo some changes in tests
* inside try catch
* prevent potential race conditions in priorities with =
* use snake_case for telemetry plugin collection
* usageFetcher -> sendUsageFrom
* more replacements
* remove extra unused route
* config() -> config
* Update src/legacy/core_plugins/telemetry/index.ts
Co-Authored-By: Mike Côté <mikecote@users.noreply.github.com>
* Update src/legacy/core_plugins/ui_metric/server/routes/api/ui_metric.ts
Co-Authored-By: Mike Côté <mikecote@users.noreply.github.com>
* config() -> config
* fix SO update logic given the current changes
* fix opt in check
* triple check
* check for non boolean
* take into account older settings
* import TelemetryOptInProvider
* update test case
Dismissed @elastic/kibana-app review of import changes.
ts-ignored @ts-ignore
* Moved files to plugins/data/server.
* Renamed IndexPatternsService to IndexPatternsFetcher and created new IndexPatternsService
* Set routerPath.
* Fixed type error.
* Changed beats_management _fields_for_wildcard request with data/public/legacy api.
* Fixed changed paths.
* Fixes crashes after merge.
* Updated path for clarity.
* Applied Plugin interface to service.
* Fixed test failure caused by non camel case local variable name.
* Fixed import to IndexPatternsService to IndexPatternsFetcher.
* use a custom wrapper around chance with longer defaults to avoid conflicts
* fix a reference to chance
* fix another reference to chance service
# Conflicts:
# x-pack/test/saml_api_integration/apis/security/saml_login.ts
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.
* Bug fix:Adds a migration for transforming TSVB visualization split_filters from strings to query:language objects to 7.5
* Changes hard coded migration version to get the version number from the saved object's migrationVersion in failing functional test
* Changes migration number from '7.5.0' to '7.4.2', fixes typo, changes test expectations to more explicit ones
* Hacking it in there, this is obviously not where this belongs
* Moving implementation to a private method
* Adding unit tests, I don't like the way I had to write these
* Adding integration tests
* Test not relying on implementation details...
* No longer using .inject, thanks Mikhail!!!
* Adding comment explaining the long body
* Fixing nesting of describes for api integration tests
* 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