diff --git a/.eslintrc.js b/.eslintrc.js
index 9b00135df5bac7..087d6276cd33ff 100644
--- a/.eslintrc.js
+++ b/.eslintrc.js
@@ -82,12 +82,6 @@ module.exports = {
'react-hooks/exhaustive-deps': 'off',
},
},
- {
- files: ['src/legacy/core_plugins/vis_type_table/**/*.{js,ts,tsx}'],
- rules: {
- 'react-hooks/exhaustive-deps': 'off',
- },
- },
{
files: [
'src/legacy/core_plugins/vis_default_editor/public/components/controls/**/*.{ts,tsx}',
diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS
index 51433f598ac16e..b924c7a1a2c297 100644
--- a/.github/CODEOWNERS
+++ b/.github/CODEOWNERS
@@ -179,6 +179,8 @@
/x-pack/legacy/plugins/rollup/ @elastic/es-ui
/x-pack/plugins/searchprofiler/ @elastic/es-ui
/x-pack/legacy/plugins/snapshot_restore/ @elastic/es-ui
+/x-pack/legacy/plugins/upgrade_assistant/ @elastic/es-ui
+/x-pack/plugins/upgrade_assistant/ @elastic/es-ui
/x-pack/plugins/watcher/ @elastic/es-ui
# Endpoint
diff --git a/docs/apm/api.asciidoc b/docs/apm/api.asciidoc
new file mode 100644
index 00000000000000..b520cc46bef8d3
--- /dev/null
+++ b/docs/apm/api.asciidoc
@@ -0,0 +1,260 @@
+[role="xpack"]
+[[apm-api]]
+== API
+
+Some APM app features are provided via a REST API:
+
+* <
- ClusterClient
but exposes additional callAsCurrentUser
method that doesn't use credentials of the Kibana internal user (as callAsInternalUser
does) to request Elasticsearch API, but rather passes HTTP headers extracted from the current user request to the API.See [ScopedClusterClient](./kibana-plugin-server.scopedclusterclient.md). |
## Enumerations
@@ -108,6 +109,7 @@ The plugin integrates with the core system via lifecycle events: `setup`
| [RouteValidatorOptions](./kibana-plugin-server.routevalidatoroptions.md) | Additional options for the RouteValidator class to modify its default behaviour. |
| [SavedObject](./kibana-plugin-server.savedobject.md) | |
| [SavedObjectAttributes](./kibana-plugin-server.savedobjectattributes.md) | The data for a Saved Object is stored as an object in the attributes
property. |
+| [SavedObjectMigrationContext](./kibana-plugin-server.savedobjectmigrationcontext.md) | Migration context provided when invoking a [migration handler](./kibana-plugin-server.savedobjectmigrationfn.md) |
| [SavedObjectMigrationMap](./kibana-plugin-server.savedobjectmigrationmap.md) | A map of [migration functions](./kibana-plugin-server.savedobjectmigrationfn.md) to be used for a given type. The map's keys must be valid semver versions.For a given document, only migrations with a higher version number than that of the document will be applied. Migrations are executed in order, starting from the lowest version and ending with the highest one. |
| [SavedObjectReference](./kibana-plugin-server.savedobjectreference.md) | A reference to another saved object. |
| [SavedObjectsBaseOptions](./kibana-plugin-server.savedobjectsbaseoptions.md) | |
@@ -143,7 +145,7 @@ The plugin integrates with the core system via lifecycle events: `setup`
| [SavedObjectsRawDoc](./kibana-plugin-server.savedobjectsrawdoc.md) | A raw document as represented directly in the saved object index. |
| [SavedObjectsRepositoryFactory](./kibana-plugin-server.savedobjectsrepositoryfactory.md) | Factory provided when invoking a [client factory provider](./kibana-plugin-server.savedobjectsclientfactoryprovider.md) See [SavedObjectsServiceSetup.setClientFactoryProvider](./kibana-plugin-server.savedobjectsservicesetup.setclientfactoryprovider.md) |
| [SavedObjectsResolveImportErrorsOptions](./kibana-plugin-server.savedobjectsresolveimporterrorsoptions.md) | Options to control the "resolve import" operation. |
-| [SavedObjectsServiceSetup](./kibana-plugin-server.savedobjectsservicesetup.md) | Saved Objects is Kibana's data persistence mechanism allowing plugins to use Elasticsearch for storing and querying state. The SavedObjectsServiceSetup API exposes methods for creating and registering Saved Object client wrappers. |
+| [SavedObjectsServiceSetup](./kibana-plugin-server.savedobjectsservicesetup.md) | Saved Objects is Kibana's data persistence mechanism allowing plugins to use Elasticsearch for storing and querying state. The SavedObjectsServiceSetup API exposes methods for registering Saved Object types, creating and registering Saved Object client wrappers and factories. |
| [SavedObjectsServiceStart](./kibana-plugin-server.savedobjectsservicestart.md) | Saved Objects is Kibana's data persisentence mechanism allowing plugins to use Elasticsearch for storing and querying state. The SavedObjectsServiceStart API provides a scoped Saved Objects client for interacting with Saved Objects. |
| [SavedObjectsType](./kibana-plugin-server.savedobjectstype.md) | |
| [SavedObjectsTypeMappingDefinition](./kibana-plugin-server.savedobjectstypemappingdefinition.md) | Describe a saved object type mapping. |
@@ -195,6 +197,7 @@ The plugin integrates with the core system via lifecycle events: `setup`
| [ICustomClusterClient](./kibana-plugin-server.icustomclusterclient.md) | Represents an Elasticsearch cluster API client created by a plugin. It allows to call API on behalf of the internal Kibana user and the actual user that is derived from the request headers (via asScoped(...)
).See [ClusterClient](./kibana-plugin-server.clusterclient.md). |
| [IsAuthenticated](./kibana-plugin-server.isauthenticated.md) | Returns authentication status for a request. |
| [ISavedObjectsRepository](./kibana-plugin-server.isavedobjectsrepository.md) | See [SavedObjectsRepository](./kibana-plugin-server.savedobjectsrepository.md) |
+| [ISavedObjectTypeRegistry](./kibana-plugin-server.isavedobjecttyperegistry.md) | See [SavedObjectTypeRegistry](./kibana-plugin-server.savedobjecttyperegistry.md) for documentation. |
| [IScopedClusterClient](./kibana-plugin-server.iscopedclusterclient.md) | Serves the same purpose as "normal" ClusterClient
but exposes additional callAsCurrentUser
method that doesn't use credentials of the Kibana internal user (as callAsInternalUser
does) to request Elasticsearch API, but rather passes HTTP headers extracted from the current user request to the API.See [ScopedClusterClient](./kibana-plugin-server.scopedclusterclient.md). |
| [KibanaRequestRouteOptions](./kibana-plugin-server.kibanarequestrouteoptions.md) | Route options: If 'GET' or 'OPTIONS' method, body options won't be returned. |
| [KibanaResponseFactory](./kibana-plugin-server.kibanaresponsefactory.md) | Creates an object containing request response payload, HTTP headers, error details, and other data transmitted to the client. |
@@ -226,7 +229,7 @@ The plugin integrates with the core system via lifecycle events: `setup`
| [RouteValidatorFullConfig](./kibana-plugin-server.routevalidatorfullconfig.md) | Route validations config and options merged into one object |
| [SavedObjectAttribute](./kibana-plugin-server.savedobjectattribute.md) | Type definition for a Saved Object attribute value |
| [SavedObjectAttributeSingle](./kibana-plugin-server.savedobjectattributesingle.md) | Don't use this type, it's simply a helper type for [SavedObjectAttribute](./kibana-plugin-server.savedobjectattribute.md) |
-| [SavedObjectMigrationFn](./kibana-plugin-server.savedobjectmigrationfn.md) | A migration function defined for a [saved objects type](./kibana-plugin-server.savedobjectstype.md) used to migrate it's |
+| [SavedObjectMigrationFn](./kibana-plugin-server.savedobjectmigrationfn.md) | A migration function for a [saved object type](./kibana-plugin-server.savedobjectstype.md) used to migrate it to a given version |
| [SavedObjectSanitizedDoc](./kibana-plugin-server.savedobjectsanitizeddoc.md) | |
| [SavedObjectsClientContract](./kibana-plugin-server.savedobjectsclientcontract.md) | Saved Objects is Kibana's data persisentence mechanism allowing plugins to use Elasticsearch for storing plugin state.\#\# SavedObjectsClient errorsSince the SavedObjectsClient has its hands in everything we are a little paranoid about the way we present errors back to to application code. Ideally, all errors will be either:1. Caused by bad implementation (ie. undefined is not a function) and as such unpredictable 2. An error that has been classified and decorated appropriately by the decorators in [SavedObjectsErrorHelpers](./kibana-plugin-server.savedobjectserrorhelpers.md)Type 1 errors are inevitable, but since all expected/handle-able errors should be Type 2 the isXYZError()
helpers exposed at SavedObjectsErrorHelpers
should be used to understand and manage error responses from the SavedObjectsClient
.Type 2 errors are decorated versions of the source error, so if the elasticsearch client threw an error it will be decorated based on its type. That means that rather than looking for error.body.error.type
or doing substring checks on error.body.error.reason
, just use the helpers to understand the meaning of the error:\`\`\`js if (SavedObjectsErrorHelpers.isNotFoundError(error)) { // handle 404 }if (SavedObjectsErrorHelpers.isNotAuthorizedError(error)) { // 401 handling should be automatic, but in case you wanted to know }// always rethrow the error unless you handle it throw error; \`\`\`\#\#\# 404s from missing indexFrom the perspective of application code and APIs the SavedObjectsClient is a black box that persists objects. One of the internal details that users have no control over is that we use an elasticsearch index for persistance and that index might be missing.At the time of writing we are in the process of transitioning away from the operating assumption that the SavedObjects index is always available. Part of this transition is handling errors resulting from an index missing. These used to trigger a 500 error in most cases, and in others cause 404s with different error messages.From my (Spencer) perspective, a 404 from the SavedObjectsApi is a 404; The object the request/call was targeting could not be found. This is why \#14141 takes special care to ensure that 404 errors are generic and don't distinguish between index missing or document missing.\#\#\# 503s from missing indexUnlike all other methods, create requests are supposed to succeed even when the Kibana index does not exist because it will be automatically created by elasticsearch. When that is not the case it is because Elasticsearch's action.auto_create_index
setting prevents it from being created automatically so we throw a special 503 with the intention of informing the user that their Elasticsearch settings need to be updated.See [SavedObjectsClient](./kibana-plugin-server.savedobjectsclient.md) See [SavedObjectsErrorHelpers](./kibana-plugin-server.savedobjectserrorhelpers.md) |
| [SavedObjectsClientFactory](./kibana-plugin-server.savedobjectsclientfactory.md) | Describes the factory used to create instances of the Saved Objects Client. |
diff --git a/docs/development/core/server/kibana-plugin-server.savedobjectmigrationcontext.log.md b/docs/development/core/server/kibana-plugin-server.savedobjectmigrationcontext.log.md
new file mode 100644
index 00000000000000..4e4eaa3ca91e67
--- /dev/null
+++ b/docs/development/core/server/kibana-plugin-server.savedobjectmigrationcontext.log.md
@@ -0,0 +1,13 @@
+
+
+[Home](./index.md) > [kibana-plugin-server](./kibana-plugin-server.md) > [SavedObjectMigrationContext](./kibana-plugin-server.savedobjectmigrationcontext.md) > [log](./kibana-plugin-server.savedobjectmigrationcontext.log.md)
+
+## SavedObjectMigrationContext.log property
+
+logger instance to be used by the migration handler
+
+Signature:
+
+```typescript
+log: SavedObjectsMigrationLogger;
+```
diff --git a/docs/development/core/server/kibana-plugin-server.savedobjectmigrationcontext.md b/docs/development/core/server/kibana-plugin-server.savedobjectmigrationcontext.md
new file mode 100644
index 00000000000000..77698b37cd3c90
--- /dev/null
+++ b/docs/development/core/server/kibana-plugin-server.savedobjectmigrationcontext.md
@@ -0,0 +1,20 @@
+
+
+[Home](./index.md) > [kibana-plugin-server](./kibana-plugin-server.md) > [SavedObjectMigrationContext](./kibana-plugin-server.savedobjectmigrationcontext.md)
+
+## SavedObjectMigrationContext interface
+
+Migration context provided when invoking a [migration handler](./kibana-plugin-server.savedobjectmigrationfn.md)
+
+Signature:
+
+```typescript
+export interface SavedObjectMigrationContext
+```
+
+## Properties
+
+| Property | Type | Description |
+| --- | --- | --- |
+| [log](./kibana-plugin-server.savedobjectmigrationcontext.log.md) | SavedObjectsMigrationLogger
| logger instance to be used by the migration handler |
+
diff --git a/docs/development/core/server/kibana-plugin-server.savedobjectmigrationfn.md b/docs/development/core/server/kibana-plugin-server.savedobjectmigrationfn.md
index 629d748083737e..838fa55a7f0894 100644
--- a/docs/development/core/server/kibana-plugin-server.savedobjectmigrationfn.md
+++ b/docs/development/core/server/kibana-plugin-server.savedobjectmigrationfn.md
@@ -4,10 +4,27 @@
## SavedObjectMigrationFn type
-A migration function defined for a [saved objects type](./kibana-plugin-server.savedobjectstype.md) used to migrate it's
+A migration function for a [saved object type](./kibana-plugin-server.savedobjectstype.md) used to migrate it to a given version
Signature:
```typescript
-export declare type SavedObjectMigrationFn = (doc: SavedObjectUnsanitizedDoc, log: SavedObjectsMigrationLogger) => SavedObjectUnsanitizedDoc;
+export declare type SavedObjectMigrationFn = (doc: SavedObjectUnsanitizedDoc, context: SavedObjectMigrationContext) => SavedObjectUnsanitizedDoc;
```
+
+## Example
+
+
+```typescript
+const migrateProperty: SavedObjectMigrationFn = (doc, { log }) => {
+ if(doc.attributes.someProp === null) {
+ log.warn('Skipping migration');
+ } else {
+ doc.attributes.someProp = migrateProperty(doc.attributes.someProp);
+ }
+
+ return doc;
+}
+
+```
+
diff --git a/docs/development/core/server/kibana-plugin-server.savedobjectsclientwrapperoptions.md b/docs/development/core/server/kibana-plugin-server.savedobjectsclientwrapperoptions.md
index dfff863898a2b3..67746126e79b4c 100644
--- a/docs/development/core/server/kibana-plugin-server.savedobjectsclientwrapperoptions.md
+++ b/docs/development/core/server/kibana-plugin-server.savedobjectsclientwrapperoptions.md
@@ -18,4 +18,5 @@ export interface SavedObjectsClientWrapperOptions
| --- | --- | --- |
| [client](./kibana-plugin-server.savedobjectsclientwrapperoptions.client.md) | SavedObjectsClientContract
| |
| [request](./kibana-plugin-server.savedobjectsclientwrapperoptions.request.md) | KibanaRequest
| |
+| [typeRegistry](./kibana-plugin-server.savedobjectsclientwrapperoptions.typeregistry.md) | ISavedObjectTypeRegistry
| |
diff --git a/docs/development/core/server/kibana-plugin-server.savedobjectsclientwrapperoptions.typeregistry.md b/docs/development/core/server/kibana-plugin-server.savedobjectsclientwrapperoptions.typeregistry.md
new file mode 100644
index 00000000000000..afd68986993841
--- /dev/null
+++ b/docs/development/core/server/kibana-plugin-server.savedobjectsclientwrapperoptions.typeregistry.md
@@ -0,0 +1,11 @@
+
+
+[Home](./index.md) > [kibana-plugin-server](./kibana-plugin-server.md) > [SavedObjectsClientWrapperOptions](./kibana-plugin-server.savedobjectsclientwrapperoptions.md) > [typeRegistry](./kibana-plugin-server.savedobjectsclientwrapperoptions.typeregistry.md)
+
+## SavedObjectsClientWrapperOptions.typeRegistry property
+
+Signature:
+
+```typescript
+typeRegistry: ISavedObjectTypeRegistry;
+```
diff --git a/docs/development/core/server/kibana-plugin-server.savedobjectsservicesetup.md b/docs/development/core/server/kibana-plugin-server.savedobjectsservicesetup.md
index 9981bfee0cb7d6..b6f2e7320c48ad 100644
--- a/docs/development/core/server/kibana-plugin-server.savedobjectsservicesetup.md
+++ b/docs/development/core/server/kibana-plugin-server.savedobjectsservicesetup.md
@@ -4,7 +4,7 @@
## SavedObjectsServiceSetup interface
-Saved Objects is Kibana's data persistence mechanism allowing plugins to use Elasticsearch for storing and querying state. The SavedObjectsServiceSetup API exposes methods for creating and registering Saved Object client wrappers.
+Saved Objects is Kibana's data persistence mechanism allowing plugins to use Elasticsearch for storing and querying state. The SavedObjectsServiceSetup API exposes methods for registering Saved Object types, creating and registering Saved Object client wrappers and factories.
Signature:
@@ -14,11 +14,9 @@ export interface SavedObjectsServiceSetup
## Remarks
-Note: The Saved Object setup API's should only be used for creating and registering client wrappers. Constructing a Saved Objects client or repository for use within your own plugin won't have any of the registered wrappers applied and is considered an anti-pattern. Use the Saved Objects client from the [SavedObjectsServiceStart\#getScopedClient](./kibana-plugin-server.savedobjectsservicestart.md) method or the [route handler context](./kibana-plugin-server.requesthandlercontext.md) instead.
+When plugins access the Saved Objects client, a new client is created using the factory provided to `setClientFactory` and wrapped by all wrappers registered through `addClientWrapper`.
-When plugins access the Saved Objects client, a new client is created using the factory provided to `setClientFactory` and wrapped by all wrappers registered through `addClientWrapper`. To create a factory or wrapper, plugins will have to construct a Saved Objects client. First create a repository by calling `scopedRepository` or `internalRepository` and then use this repository as the argument to the [SavedObjectsClient](./kibana-plugin-server.savedobjectsclient.md) constructor.
-
-## Example
+## Example 1
```ts
@@ -34,10 +32,26 @@ export class Plugin() {
```
+## Example 2
+
+
+```ts
+import { SavedObjectsClient, CoreSetup } from 'src/core/server';
+import { mySoType } from './saved_objects'
+
+export class Plugin() {
+ setup: (core: CoreSetup) => {
+ core.savedObjects.registerType(mySoType);
+ }
+}
+
+```
+
## Properties
| Property | Type | Description |
| --- | --- | --- |
| [addClientWrapper](./kibana-plugin-server.savedobjectsservicesetup.addclientwrapper.md) | (priority: number, id: string, factory: SavedObjectsClientWrapperFactory) => void
| Add a [client wrapper factory](./kibana-plugin-server.savedobjectsclientwrapperfactory.md) with the given priority. |
+| [registerType](./kibana-plugin-server.savedobjectsservicesetup.registertype.md) | (type: SavedObjectsType) => void
| Register a [savedObjects type](./kibana-plugin-server.savedobjectstype.md) definition.See the [mappings format](./kibana-plugin-server.savedobjectstypemappingdefinition.md) and [migration format](./kibana-plugin-server.savedobjectmigrationmap.md) for more details about these. |
| [setClientFactoryProvider](./kibana-plugin-server.savedobjectsservicesetup.setclientfactoryprovider.md) | (clientFactoryProvider: SavedObjectsClientFactoryProvider) => void
| Set the default [factory provider](./kibana-plugin-server.savedobjectsclientfactoryprovider.md) for creating Saved Objects clients. Only one provider can be set, subsequent calls to this method will fail. |
diff --git a/docs/development/core/server/kibana-plugin-server.savedobjectsservicesetup.registertype.md b/docs/development/core/server/kibana-plugin-server.savedobjectsservicesetup.registertype.md
new file mode 100644
index 00000000000000..89102d292d6341
--- /dev/null
+++ b/docs/development/core/server/kibana-plugin-server.savedobjectsservicesetup.registertype.md
@@ -0,0 +1,60 @@
+
+
+[Home](./index.md) > [kibana-plugin-server](./kibana-plugin-server.md) > [SavedObjectsServiceSetup](./kibana-plugin-server.savedobjectsservicesetup.md) > [registerType](./kibana-plugin-server.savedobjectsservicesetup.registertype.md)
+
+## SavedObjectsServiceSetup.registerType property
+
+Register a [savedObjects type](./kibana-plugin-server.savedobjectstype.md) definition.
+
+See the [mappings format](./kibana-plugin-server.savedobjectstypemappingdefinition.md) and [migration format](./kibana-plugin-server.savedobjectmigrationmap.md) for more details about these.
+
+Signature:
+
+```typescript
+registerType: (type: SavedObjectsType) => void;
+```
+
+## Remarks
+
+The type definition is an aggregation of the legacy savedObjects `schema`, `mappings` and `migration` concepts. This API is the single entry point to register saved object types in the new platform.
+
+## Example
+
+
+```ts
+// src/plugins/my_plugin/server/saved_objects/my_type.ts
+import { SavedObjectsType } from 'src/core/server';
+import * as migrations from './migrations';
+
+export const myType: SavedObjectsType = {
+ name: 'MyType',
+ hidden: false,
+ namespaceAgnostic: true,
+ mappings: {
+ properties: {
+ textField: {
+ type: 'text',
+ },
+ boolField: {
+ type: 'boolean',
+ },
+ },
+ },
+ migrations: {
+ '2.0.0': migrations.migrateToV2,
+ '2.1.0': migrations.migrateToV2_1
+ },
+};
+
+// src/plugins/my_plugin/server/plugin.ts
+import { SavedObjectsClient, CoreSetup } from 'src/core/server';
+import { myType } from './saved_objects';
+
+export class Plugin() {
+ setup: (core: CoreSetup) => {
+ core.savedObjects.registerType(myType);
+ }
+}
+
+```
+
diff --git a/docs/development/core/server/kibana-plugin-server.savedobjectsservicestart.gettyperegistry.md b/docs/development/core/server/kibana-plugin-server.savedobjectsservicestart.gettyperegistry.md
new file mode 100644
index 00000000000000..82e67bb307588f
--- /dev/null
+++ b/docs/development/core/server/kibana-plugin-server.savedobjectsservicestart.gettyperegistry.md
@@ -0,0 +1,13 @@
+
+
+[Home](./index.md) > [kibana-plugin-server](./kibana-plugin-server.md) > [SavedObjectsServiceStart](./kibana-plugin-server.savedobjectsservicestart.md) > [getTypeRegistry](./kibana-plugin-server.savedobjectsservicestart.gettyperegistry.md)
+
+## SavedObjectsServiceStart.getTypeRegistry property
+
+Returns the [registry](./kibana-plugin-server.isavedobjecttyperegistry.md) containing all registered [saved object types](./kibana-plugin-server.savedobjectstype.md)
+
+Signature:
+
+```typescript
+getTypeRegistry: () => ISavedObjectTypeRegistry;
+```
diff --git a/docs/development/core/server/kibana-plugin-server.savedobjectsservicestart.md b/docs/development/core/server/kibana-plugin-server.savedobjectsservicestart.md
index ad34d76bb33f45..293255bb33c2a2 100644
--- a/docs/development/core/server/kibana-plugin-server.savedobjectsservicestart.md
+++ b/docs/development/core/server/kibana-plugin-server.savedobjectsservicestart.md
@@ -20,4 +20,5 @@ export interface SavedObjectsServiceStart
| [createScopedRepository](./kibana-plugin-server.savedobjectsservicestart.createscopedrepository.md) | (req: KibanaRequest, extraTypes?: string[]) => ISavedObjectsRepository
| Creates a [Saved Objects repository](./kibana-plugin-server.isavedobjectsrepository.md) that uses the credentials from the passed in request to authenticate with Elasticsearch. |
| [createSerializer](./kibana-plugin-server.savedobjectsservicestart.createserializer.md) | () => SavedObjectsSerializer
| Creates a [serializer](./kibana-plugin-server.savedobjectsserializer.md) that is aware of all registered types. |
| [getScopedClient](./kibana-plugin-server.savedobjectsservicestart.getscopedclient.md) | (req: KibanaRequest, options?: SavedObjectsClientProviderOptions) => SavedObjectsClientContract
| Creates a [Saved Objects client](./kibana-plugin-server.savedobjectsclientcontract.md) that uses the credentials from the passed in request to authenticate with Elasticsearch. If other plugins have registered Saved Objects client wrappers, these will be applied to extend the functionality of the client.A client that is already scoped to the incoming request is also exposed from the route handler context see [RequestHandlerContext](./kibana-plugin-server.requesthandlercontext.md). |
+| [getTypeRegistry](./kibana-plugin-server.savedobjectsservicestart.gettyperegistry.md) | () => ISavedObjectTypeRegistry
| Returns the [registry](./kibana-plugin-server.isavedobjecttyperegistry.md) containing all registered [saved object types](./kibana-plugin-server.savedobjectstype.md) |
diff --git a/docs/development/core/server/kibana-plugin-server.savedobjecttyperegistry.getalltypes.md b/docs/development/core/server/kibana-plugin-server.savedobjecttyperegistry.getalltypes.md
new file mode 100644
index 00000000000000..d71b392c408403
--- /dev/null
+++ b/docs/development/core/server/kibana-plugin-server.savedobjecttyperegistry.getalltypes.md
@@ -0,0 +1,17 @@
+
+
+[Home](./index.md) > [kibana-plugin-server](./kibana-plugin-server.md) > [SavedObjectTypeRegistry](./kibana-plugin-server.savedobjecttyperegistry.md) > [getAllTypes](./kibana-plugin-server.savedobjecttyperegistry.getalltypes.md)
+
+## SavedObjectTypeRegistry.getAllTypes() method
+
+Return all [types](./kibana-plugin-server.savedobjectstype.md) currently registered.
+
+Signature:
+
+```typescript
+getAllTypes(): SavedObjectsType[];
+```
+Returns:
+
+`SavedObjectsType[]`
+
diff --git a/docs/development/core/server/kibana-plugin-server.savedobjecttyperegistry.getindex.md b/docs/development/core/server/kibana-plugin-server.savedobjecttyperegistry.getindex.md
new file mode 100644
index 00000000000000..3479600456c47b
--- /dev/null
+++ b/docs/development/core/server/kibana-plugin-server.savedobjecttyperegistry.getindex.md
@@ -0,0 +1,24 @@
+
+
+[Home](./index.md) > [kibana-plugin-server](./kibana-plugin-server.md) > [SavedObjectTypeRegistry](./kibana-plugin-server.savedobjecttyperegistry.md) > [getIndex](./kibana-plugin-server.savedobjecttyperegistry.getindex.md)
+
+## SavedObjectTypeRegistry.getIndex() method
+
+Returns the `indexPattern` property for given type, or `undefined` if the type is not registered.
+
+Signature:
+
+```typescript
+getIndex(type: string): string | undefined;
+```
+
+## Parameters
+
+| Parameter | Type | Description |
+| --- | --- | --- |
+| type | string
| |
+
+Returns:
+
+`string | undefined`
+
diff --git a/docs/development/core/server/kibana-plugin-server.savedobjecttyperegistry.gettype.md b/docs/development/core/server/kibana-plugin-server.savedobjecttyperegistry.gettype.md
new file mode 100644
index 00000000000000..b32301a2537319
--- /dev/null
+++ b/docs/development/core/server/kibana-plugin-server.savedobjecttyperegistry.gettype.md
@@ -0,0 +1,24 @@
+
+
+[Home](./index.md) > [kibana-plugin-server](./kibana-plugin-server.md) > [SavedObjectTypeRegistry](./kibana-plugin-server.savedobjecttyperegistry.md) > [getType](./kibana-plugin-server.savedobjecttyperegistry.gettype.md)
+
+## SavedObjectTypeRegistry.getType() method
+
+Return the [type](./kibana-plugin-server.savedobjectstype.md) definition for given type name.
+
+Signature:
+
+```typescript
+getType(type: string): SavedObjectsType | undefined;
+```
+
+## Parameters
+
+| Parameter | Type | Description |
+| --- | --- | --- |
+| type | string
| |
+
+Returns:
+
+`SavedObjectsType | undefined`
+
diff --git a/docs/development/core/server/kibana-plugin-server.savedobjecttyperegistry.ishidden.md b/docs/development/core/server/kibana-plugin-server.savedobjecttyperegistry.ishidden.md
new file mode 100644
index 00000000000000..956ba2cbc1dbde
--- /dev/null
+++ b/docs/development/core/server/kibana-plugin-server.savedobjecttyperegistry.ishidden.md
@@ -0,0 +1,24 @@
+
+
+[Home](./index.md) > [kibana-plugin-server](./kibana-plugin-server.md) > [SavedObjectTypeRegistry](./kibana-plugin-server.savedobjecttyperegistry.md) > [isHidden](./kibana-plugin-server.savedobjecttyperegistry.ishidden.md)
+
+## SavedObjectTypeRegistry.isHidden() method
+
+Returns the `hidden` property for given type, or `false` if the type is not registered.
+
+Signature:
+
+```typescript
+isHidden(type: string): boolean;
+```
+
+## Parameters
+
+| Parameter | Type | Description |
+| --- | --- | --- |
+| type | string
| |
+
+Returns:
+
+`boolean`
+
diff --git a/docs/development/core/server/kibana-plugin-server.savedobjecttyperegistry.isnamespaceagnostic.md b/docs/development/core/server/kibana-plugin-server.savedobjecttyperegistry.isnamespaceagnostic.md
new file mode 100644
index 00000000000000..e6e578d8936480
--- /dev/null
+++ b/docs/development/core/server/kibana-plugin-server.savedobjecttyperegistry.isnamespaceagnostic.md
@@ -0,0 +1,24 @@
+
+
+[Home](./index.md) > [kibana-plugin-server](./kibana-plugin-server.md) > [SavedObjectTypeRegistry](./kibana-plugin-server.savedobjecttyperegistry.md) > [isNamespaceAgnostic](./kibana-plugin-server.savedobjecttyperegistry.isnamespaceagnostic.md)
+
+## SavedObjectTypeRegistry.isNamespaceAgnostic() method
+
+Returns the `namespaceAgnostic` property for given type, or `false` if the type is not registered.
+
+Signature:
+
+```typescript
+isNamespaceAgnostic(type: string): boolean;
+```
+
+## Parameters
+
+| Parameter | Type | Description |
+| --- | --- | --- |
+| type | string
| |
+
+Returns:
+
+`boolean`
+
diff --git a/docs/development/core/server/kibana-plugin-server.savedobjecttyperegistry.md b/docs/development/core/server/kibana-plugin-server.savedobjecttyperegistry.md
new file mode 100644
index 00000000000000..3daad35808624b
--- /dev/null
+++ b/docs/development/core/server/kibana-plugin-server.savedobjecttyperegistry.md
@@ -0,0 +1,25 @@
+
+
+[Home](./index.md) > [kibana-plugin-server](./kibana-plugin-server.md) > [SavedObjectTypeRegistry](./kibana-plugin-server.savedobjecttyperegistry.md)
+
+## SavedObjectTypeRegistry class
+
+Registry holding information about all the registered [saved object types](./kibana-plugin-server.savedobjectstype.md).
+
+Signature:
+
+```typescript
+export declare class SavedObjectTypeRegistry
+```
+
+## Methods
+
+| Method | Modifiers | Description |
+| --- | --- | --- |
+| [getAllTypes()](./kibana-plugin-server.savedobjecttyperegistry.getalltypes.md) | | Return all [types](./kibana-plugin-server.savedobjectstype.md) currently registered. |
+| [getIndex(type)](./kibana-plugin-server.savedobjecttyperegistry.getindex.md) | | Returns the indexPattern
property for given type, or undefined
if the type is not registered. |
+| [getType(type)](./kibana-plugin-server.savedobjecttyperegistry.gettype.md) | | Return the [type](./kibana-plugin-server.savedobjectstype.md) definition for given type name. |
+| [isHidden(type)](./kibana-plugin-server.savedobjecttyperegistry.ishidden.md) | | Returns the hidden
property for given type, or false
if the type is not registered. |
+| [isNamespaceAgnostic(type)](./kibana-plugin-server.savedobjecttyperegistry.isnamespaceagnostic.md) | | Returns the namespaceAgnostic
property for given type, or false
if the type is not registered. |
+| [registerType(type)](./kibana-plugin-server.savedobjecttyperegistry.registertype.md) | | Register a [type](./kibana-plugin-server.savedobjectstype.md) inside the registry. A type can only be registered once. subsequent calls with the same type name will throw an error. |
+
diff --git a/docs/development/core/server/kibana-plugin-server.savedobjecttyperegistry.registertype.md b/docs/development/core/server/kibana-plugin-server.savedobjecttyperegistry.registertype.md
new file mode 100644
index 00000000000000..4e6d62ccd28d06
--- /dev/null
+++ b/docs/development/core/server/kibana-plugin-server.savedobjecttyperegistry.registertype.md
@@ -0,0 +1,24 @@
+
+
+[Home](./index.md) > [kibana-plugin-server](./kibana-plugin-server.md) > [SavedObjectTypeRegistry](./kibana-plugin-server.savedobjecttyperegistry.md) > [registerType](./kibana-plugin-server.savedobjecttyperegistry.registertype.md)
+
+## SavedObjectTypeRegistry.registerType() method
+
+Register a [type](./kibana-plugin-server.savedobjectstype.md) inside the registry. A type can only be registered once. subsequent calls with the same type name will throw an error.
+
+Signature:
+
+```typescript
+registerType(type: SavedObjectsType): void;
+```
+
+## Parameters
+
+| Parameter | Type | Description |
+| --- | --- | --- |
+| type | SavedObjectsType
| |
+
+Returns:
+
+`void`
+
diff --git a/docs/management/advanced-options.asciidoc b/docs/management/advanced-options.asciidoc
index 80c9053dc5ae6f..9d4052bbd0156a 100644
--- a/docs/management/advanced-options.asciidoc
+++ b/docs/management/advanced-options.asciidoc
@@ -62,8 +62,6 @@ mentioned use "\_default_".
`histogram:maxBars`:: Date histograms are not generated with more bars than the value of this property, scaling values
when necessary.
`history:limit`:: In fields that have history, such as query inputs, show this many recent values.
-`indexPattern:fieldMapping:lookBack`:: For index patterns containing timestamps in their names,
-look for this many recent matching patterns from which to query the field mapping.
`indexPattern:placeholder`:: The default placeholder value to use in Management > Index Patterns > Create Index Pattern.
`metaFields`:: Fields that exist outside of `_source`. Kibana merges these fields
into the document when displaying it.
diff --git a/docs/setup/settings.asciidoc b/docs/setup/settings.asciidoc
index c1f06aff722b52..2d4d00b7301099 100644
--- a/docs/setup/settings.asciidoc
+++ b/docs/setup/settings.asciidoc
@@ -231,7 +231,7 @@ This setting does not impact <
+ Array test setting
+
+
+ }
>
-
- Array test setting
-
-
- }
- >
-
- Array test setting
-
-
- }
- >
-
+ Array test setting
+
+
+ }
+>
+
+ Array test setting
+
+ }
>
-
- Array test setting
-
- }
- >
-
+ Array test setting
+
+
+ }
>
-
- Array test setting
-
-
- }
- >
-
+ Array test setting
+
+ }
+>
+
+ Setting is currently not saved. +
+
-
-
-
-
-
-
-
+ {unsavedChanges.error + ? unsavedChanges.error + : i18n.translate('advancedSettings.field.settingIsUnsaved', { + defaultMessage: 'Setting is currently not saved.', + })} +
+{this.renderCountOfUnsaved()}
+
- {i18n.translate('xpack.apm.serviceMap.licensePromptBody', {
- defaultMessage:
- "In order to access Service Maps, you must be subscribed to an Elastic Platinum license. With it, you'll have the ability to visualize your entire application stack along with your APM data."
- })}
- {invalidLicenseMessage}
+
+
+ {username === null ? (
+
{i18n.translate('xpack.apm.serviceMap.licensePromptTitle', {
diff --git a/x-pack/legacy/plugins/apm/public/components/app/ServiceMap/Popover/Contents.tsx b/x-pack/legacy/plugins/apm/public/components/app/ServiceMap/Popover/Contents.tsx
index 378ad9509c2170..f1c53673c87552 100644
--- a/x-pack/legacy/plugins/apm/public/components/app/ServiceMap/Popover/Contents.tsx
+++ b/x-pack/legacy/plugins/apm/public/components/app/ServiceMap/Popover/Contents.tsx
@@ -14,7 +14,7 @@ import cytoscape from 'cytoscape';
import React from 'react';
import { Buttons } from './Buttons';
import { Info } from './Info';
-import { ServiceMetricList } from './ServiceMetricList';
+import { ServiceMetricFetcher } from './ServiceMetricFetcher';
const popoverMinWidth = 280;
@@ -49,7 +49,7 @@ export function Contents({
- {listItems.map(({ title, description }) => (
-
>
diff --git a/x-pack/legacy/plugins/apm/public/components/app/ServiceMap/index.tsx b/x-pack/legacy/plugins/apm/public/components/app/ServiceMap/index.tsx
index 5fea4be9ca0da5..b14ecaa803f6d4 100644
--- a/x-pack/legacy/plugins/apm/public/components/app/ServiceMap/index.tsx
+++ b/x-pack/legacy/plugins/apm/public/components/app/ServiceMap/index.tsx
@@ -17,12 +17,14 @@ import React, {
useState
} from 'react';
import { toMountPoint } from '../../../../../../../../src/plugins/kibana_react/public';
+import { isValidPlatinumLicense } from '../../../../../../../plugins/apm/common/service_map';
// eslint-disable-next-line @kbn/eslint/no-restricted-paths
import { ServiceMapAPIResponse } from '../../../../../../../plugins/apm/server/lib/service_map/get_service_map';
import { useApmPluginContext } from '../../../hooks/useApmPluginContext';
import { useCallApmApi } from '../../../hooks/useCallApmApi';
import { useDeepObjectIdentity } from '../../../hooks/useDeepObjectIdentity';
import { useLicense } from '../../../hooks/useLicense';
+import { useLoadingIndicator } from '../../../hooks/useLoadingIndicator';
import { useLocation } from '../../../hooks/useLocation';
import { useUrlParams } from '../../../hooks/useUrlParams';
import { Controls } from './Controls';
@@ -31,7 +33,6 @@ import { getCytoscapeElements } from './get_cytoscape_elements';
import { PlatinumLicensePrompt } from './PlatinumLicensePrompt';
import { Popover } from './Popover';
import { useRefHeight } from './useRefHeight';
-import { useLoadingIndicator } from '../../../hooks/useLoadingIndicator';
interface ServiceMapProps {
serviceName?: string;
@@ -195,13 +196,13 @@ export function ServiceMap({ serviceName }: ServiceMapProps) {
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [elements]);
- const isValidPlatinumLicense =
- license?.isActive &&
- (license?.type === 'platinum' || license?.type === 'trial');
-
const [wrapperRef, height] = useRefHeight();
- return isValidPlatinumLicense ? (
+ if (!license) {
+ return null;
+ }
+
+ return isValidPlatinumLicense(license) ? (
+ {i18n.translate('xpack.fileUpload.jsonIndexFilePicker.coordinateSystemAccepted', {
+ defaultMessage: 'Coordinates must be in EPSG:4326 coordinate reference system.',
+ })}{' '}
)
}
diff --git a/x-pack/legacy/plugins/graph/public/application.ts b/x-pack/legacy/plugins/graph/public/application.ts
index 80a797b7f07243..7bd18f841b4787 100644
--- a/x-pack/legacy/plugins/graph/public/application.ts
+++ b/x-pack/legacy/plugins/graph/public/application.ts
@@ -24,7 +24,6 @@ import {
configureAppAngularModule,
createTopNavDirective,
createTopNavHelper,
- addAppRedirectMessageToUrl,
} from './legacy_imports';
// @ts-ignore
import { initGraphApp } from './app';
@@ -37,6 +36,7 @@ import { checkLicense } from '../../../../plugins/graph/common/check_license';
import { NavigationPublicPluginStart as NavigationStart } from '../../../../../src/plugins/navigation/public';
import { createSavedWorkspacesLoader } from './services/persistence/saved_workspace_loader';
import { Storage } from '../../../../../src/plugins/kibana_utils/public';
+import { addAppRedirectMessageToUrl } from '../../../../../src/plugins/kibana_legacy/public';
/**
* These are dependencies of the Graph app besides the base dependencies
diff --git a/x-pack/legacy/plugins/graph/public/legacy_imports.ts b/x-pack/legacy/plugins/graph/public/legacy_imports.ts
index ac518d34551dba..84fafdb580abe3 100644
--- a/x-pack/legacy/plugins/graph/public/legacy_imports.ts
+++ b/x-pack/legacy/plugins/graph/public/legacy_imports.ts
@@ -8,6 +8,4 @@ import 'ace';
// @ts-ignore
export { createTopNavDirective, createTopNavHelper } from 'ui/kbn_top_nav/kbn_top_nav';
-// @ts-ignore
-export { addAppRedirectMessageToUrl } from 'ui/notify';
export { configureAppAngularModule } from '../../../../../src/plugins/kibana_legacy/public';
diff --git a/x-pack/legacy/plugins/index_lifecycle_management/__jest__/extend_index_management.test.js b/x-pack/legacy/plugins/index_lifecycle_management/__jest__/extend_index_management.test.js
index bcbae7e093f465..d2619778617c3e 100644
--- a/x-pack/legacy/plugins/index_lifecycle_management/__jest__/extend_index_management.test.js
+++ b/x-pack/legacy/plugins/index_lifecycle_management/__jest__/extend_index_management.test.js
@@ -27,8 +27,10 @@ initHttp(axios.create({ adapter: axiosXhrAdapter }), path => path);
initUiMetric(() => () => {});
jest.mock('ui/new_platform');
-jest.mock('../../index_management/public', async () => {
- const { indexManagementMock } = await import('../../index_management/public/mocks.ts');
+jest.mock('../../../../plugins/index_management/public', async () => {
+ const { indexManagementMock } = await import(
+ '../../../../plugins/index_management/public/mocks.ts'
+ );
return indexManagementMock.createSetup();
});
diff --git a/x-pack/legacy/plugins/index_lifecycle_management/plugin.ts b/x-pack/legacy/plugins/index_lifecycle_management/plugin.ts
index 8d7f937039203f..38d1bea45ce070 100644
--- a/x-pack/legacy/plugins/index_lifecycle_management/plugin.ts
+++ b/x-pack/legacy/plugins/index_lifecycle_management/plugin.ts
@@ -41,14 +41,14 @@ export class Plugin {
registerPoliciesRoutes(server);
registerTemplatesRoutes(server);
- const serverPlugins = server.plugins as any;
+ const serverPlugins = server.newPlatform.setup.plugins as any;
if (
server.config().get('xpack.ilm.ui.enabled') &&
- serverPlugins.index_management &&
- serverPlugins.index_management.addIndexManagementDataEnricher
+ serverPlugins.indexManagement &&
+ serverPlugins.indexManagement.indexDataEnricher
) {
- serverPlugins.index_management.addIndexManagementDataEnricher(indexLifecycleDataEnricher);
+ serverPlugins.indexManagement.indexDataEnricher.add(indexLifecycleDataEnricher);
}
}
}
diff --git a/x-pack/legacy/plugins/index_lifecycle_management/public/legacy.ts b/x-pack/legacy/plugins/index_lifecycle_management/public/legacy.ts
index 3c21a644c0f783..f7f924add2c514 100644
--- a/x-pack/legacy/plugins/index_lifecycle_management/public/legacy.ts
+++ b/x-pack/legacy/plugins/index_lifecycle_management/public/legacy.ts
@@ -20,7 +20,9 @@ import { addAllExtensions } from './np_ready/extend_index_management';
if (chrome.getInjected('ilmUiEnabled')) {
// We have to initialize this outside of the NP lifecycle, otherwise these extensions won't
// be available in Index Management unless the user visits ILM first.
- addAllExtensions();
+ if ((npSetup.plugins as any).indexManagement) {
+ addAllExtensions((npSetup.plugins as any).indexManagement.extensionsService);
+ }
// This method handles the cleanup needed when route is scope is destroyed. It also prevents Angular
// from destroying scope when route changes and both old route and new route are this same route.
diff --git a/x-pack/legacy/plugins/index_lifecycle_management/public/np_ready/application/sections/policy_table/components/policy_table/policy_table.js b/x-pack/legacy/plugins/index_lifecycle_management/public/np_ready/application/sections/policy_table/components/policy_table/policy_table.js
index 83d32eae1097d7..903161fe094fc3 100644
--- a/x-pack/legacy/plugins/index_lifecycle_management/public/np_ready/application/sections/policy_table/components/policy_table/policy_table.js
+++ b/x-pack/legacy/plugins/index_lifecycle_management/public/np_ready/application/sections/policy_table/components/policy_table/policy_table.js
@@ -37,7 +37,7 @@ import {
import { RIGHT_ALIGNMENT } from '@elastic/eui/lib/services';
-import { getIndexListUri } from '../../../../../../../../index_management/public/application/services/navigation';
+import { getIndexListUri } from '../../../../../../../../../../plugins/index_management/public';
import { BASE_PATH } from '../../../../../../../common/constants';
import { UIM_EDIT_CLICK } from '../../../../constants';
import { getPolicyPath } from '../../../../services/navigation';
diff --git a/x-pack/legacy/plugins/index_lifecycle_management/public/np_ready/extend_index_management/index.js b/x-pack/legacy/plugins/index_lifecycle_management/public/np_ready/extend_index_management/index.js
index 0e662b78b2c180..69658d31695bce 100644
--- a/x-pack/legacy/plugins/index_lifecycle_management/public/np_ready/extend_index_management/index.js
+++ b/x-pack/legacy/plugins/index_lifecycle_management/public/np_ready/extend_index_management/index.js
@@ -9,7 +9,6 @@ import { get, every, any } from 'lodash';
import { i18n } from '@kbn/i18n';
import { EuiSearchBar } from '@elastic/eui';
-import { extensionsService } from '../../../../index_management/public';
import { init as initUiMetric } from '../application/services/ui_metric';
import { init as initNotification } from '../application/services/notification';
import { retryLifecycleForIndex } from '../application/services/api';
@@ -238,7 +237,7 @@ export const ilmFilterExtension = indices => {
}
};
-export const addAllExtensions = () => {
+export const addAllExtensions = extensionsService => {
extensionsService.addAction(retryLifecycleActionExtension);
extensionsService.addAction(removeLifecyclePolicyActionExtension);
extensionsService.addAction(addLifecyclePolicyActionExtension);
diff --git a/x-pack/legacy/plugins/index_management/index.ts b/x-pack/legacy/plugins/index_management/index.ts
index c92b38c0d94be8..9eba98a526d2bc 100644
--- a/x-pack/legacy/plugins/index_management/index.ts
+++ b/x-pack/legacy/plugins/index_management/index.ts
@@ -4,36 +4,9 @@
* you may not use this file except in compliance with the Elastic License.
*/
-import { resolve } from 'path';
-import { Legacy } from 'kibana';
-import { PLUGIN } from './common/constants';
-import { plugin as initServerPlugin, Dependencies } from './server';
-
-export type ServerFacade = Legacy.Server;
-
export function indexManagement(kibana: any) {
return new kibana.Plugin({
- id: PLUGIN.id,
+ id: 'index_management',
configPrefix: 'xpack.index_management',
- publicDir: resolve(__dirname, 'public'),
- require: ['kibana', 'elasticsearch', 'xpack_main'],
-
- uiExports: {
- styleSheetPaths: resolve(__dirname, 'public/index.scss'),
- managementSections: ['plugins/index_management'],
- },
-
- init(server: ServerFacade) {
- const coreSetup = server.newPlatform.setup.core;
- const coreInitializerContext = server.newPlatform.coreContext;
- const pluginsSetup: Dependencies = {
- licensing: server.newPlatform.setup.plugins.licensing as any,
- };
-
- const serverPlugin = initServerPlugin(coreInitializerContext as any);
- const serverPublicApi = serverPlugin.setup(coreSetup, pluginsSetup);
-
- server.expose('addIndexManagementDataEnricher', serverPublicApi.indexDataEnricher.add);
- },
});
}
diff --git a/x-pack/legacy/plugins/index_management/public/index.html b/x-pack/legacy/plugins/index_management/public/index.html
deleted file mode 100644
index 0e9ac6fa0bc977..00000000000000
--- a/x-pack/legacy/plugins/index_management/public/index.html
+++ /dev/null
@@ -1,3 +0,0 @@
-
+
+
@@ -128,39 +133,59 @@ export const CalendarForm = ({