diff --git a/.backportrc.json b/.backportrc.json
index 731f49183dba5..0894909d2aac4 100644
--- a/.backportrc.json
+++ b/.backportrc.json
@@ -3,6 +3,7 @@
"targetBranchChoices": [
{ "name": "master", "checked": true },
{ "name": "7.x", "checked": true },
+ "7.8",
"7.7",
"7.6",
"7.5",
diff --git a/.eslintrc.js b/.eslintrc.js
index dde0ce010d4d4..56c06902e062b 100644
--- a/.eslintrc.js
+++ b/.eslintrc.js
@@ -238,6 +238,7 @@ module.exports = {
],
from: [
'(src|x-pack)/plugins/**/(public|server)/**/*',
+ '!(src|x-pack)/plugins/**/(public|server)/mocks/index.{js,ts}',
'!(src|x-pack)/plugins/**/(public|server)/(index|mocks).{js,ts,tsx}',
],
allowSameFolder: true,
diff --git a/.i18nrc.json b/.i18nrc.json
index be3c043b6e52f..3b2e628f7226f 100644
--- a/.i18nrc.json
+++ b/.i18nrc.json
@@ -43,7 +43,7 @@
"src/plugins/telemetry",
"src/plugins/telemetry_management_section"
],
- "tileMap": "src/legacy/core_plugins/tile_map",
+ "tileMap": "src/plugins/tile_map",
"timelion": ["src/legacy/core_plugins/timelion", "src/plugins/vis_type_timelion"],
"uiActions": "src/plugins/ui_actions",
"visDefaultEditor": "src/plugins/vis_default_editor",
diff --git a/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.iindexpattern.md b/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.iindexpattern.md
index 24b56a9b98621..a79244a24acf5 100644
--- a/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.iindexpattern.md
+++ b/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.iindexpattern.md
@@ -21,3 +21,9 @@ export interface IIndexPattern
| [title](./kibana-plugin-plugins-data-server.iindexpattern.title.md) | string | |
| [type](./kibana-plugin-plugins-data-server.iindexpattern.type.md) | string | |
+## Methods
+
+| Method | Description |
+| --- | --- |
+| [getTimeField()](./kibana-plugin-plugins-data-server.iindexpattern.gettimefield.md) | |
+
diff --git a/docs/management/alerting/images/alerts-and-actions-ui.png b/docs/management/alerting/images/alerts-and-actions-ui.png
index acf3f3b1f0be9..d46df21e6f6b0 100644
Binary files a/docs/management/alerting/images/alerts-and-actions-ui.png and b/docs/management/alerting/images/alerts-and-actions-ui.png differ
diff --git a/docs/management/alerting/images/alerts-details-instance-muting.png b/docs/management/alerting/images/alerts-details-instance-muting.png
index 9d26fad419e4f..fd59e79d07279 100644
Binary files a/docs/management/alerting/images/alerts-details-instance-muting.png and b/docs/management/alerting/images/alerts-details-instance-muting.png differ
diff --git a/docs/management/alerting/images/alerts-details-instances-active.png b/docs/management/alerting/images/alerts-details-instances-active.png
index d6895bd4952b8..7506d1cb8c65e 100644
Binary files a/docs/management/alerting/images/alerts-details-instances-active.png and b/docs/management/alerting/images/alerts-details-instances-active.png differ
diff --git a/docs/management/alerting/images/alerts-details-instances-inactive.png b/docs/management/alerting/images/alerts-details-instances-inactive.png
index b049b4ba082f6..a757d59e12360 100644
Binary files a/docs/management/alerting/images/alerts-details-instances-inactive.png and b/docs/management/alerting/images/alerts-details-instances-inactive.png differ
diff --git a/docs/management/alerting/images/alerts-details-muting.png b/docs/management/alerting/images/alerts-details-muting.png
index 9b47d82a74639..29cdf707b4912 100644
Binary files a/docs/management/alerting/images/alerts-details-muting.png and b/docs/management/alerting/images/alerts-details-muting.png differ
diff --git a/docs/management/alerting/images/alerts-filter-by-action-type.png b/docs/management/alerting/images/alerts-filter-by-action-type.png
index 94336a20e1d6c..c0e495a87ecd3 100644
Binary files a/docs/management/alerting/images/alerts-filter-by-action-type.png and b/docs/management/alerting/images/alerts-filter-by-action-type.png differ
diff --git a/docs/management/alerting/images/alerts-filter-by-type.png b/docs/management/alerting/images/alerts-filter-by-type.png
index 75ffb3ff69bab..859274e9b6613 100644
Binary files a/docs/management/alerting/images/alerts-filter-by-type.png and b/docs/management/alerting/images/alerts-filter-by-type.png differ
diff --git a/docs/management/alerting/images/individual-mute-disable.png b/docs/management/alerting/images/individual-mute-disable.png
index ca00240a4af61..dc187c97de309 100644
Binary files a/docs/management/alerting/images/individual-mute-disable.png and b/docs/management/alerting/images/individual-mute-disable.png differ
diff --git a/docs/user/alerting/action-types.asciidoc b/docs/user/alerting/action-types.asciidoc
index 8794c389d72bc..09878b3059ac8 100644
--- a/docs/user/alerting/action-types.asciidoc
+++ b/docs/user/alerting/action-types.asciidoc
@@ -43,11 +43,10 @@ see https://www.elastic.co/subscriptions[the subscription page].
[[create-connectors]]
=== Preconfigured connectors and action types
-You can create connectors for actions in <> or via the action API.
-For out-of-the-box and standardized connectors, you can <>
+For out-of-the-box and standardized connectors, you can <>
before {kib} starts.
-Action type with only preconfigured connectors could be specified as a <>.
+If you preconfigure a connector, you can also <>.
include::action-types/email.asciidoc[]
include::action-types/index.asciidoc[]
@@ -56,4 +55,3 @@ include::action-types/server-log.asciidoc[]
include::action-types/slack.asciidoc[]
include::action-types/webhook.asciidoc[]
include::pre-configured-connectors.asciidoc[]
-include::pre-configured-action-types.asciidoc[]
diff --git a/docs/user/alerting/action-types/email.asciidoc b/docs/user/alerting/action-types/email.asciidoc
index 794fc14005f2f..689d870d9cadc 100644
--- a/docs/user/alerting/action-types/email.asciidoc
+++ b/docs/user/alerting/action-types/email.asciidoc
@@ -19,6 +19,37 @@ Username:: username for 'login' type authentication.
Password:: password for 'login' type authentication.
[float]
+[[Preconfigured-email-configuration]]
+==== Preconfigured action type
+
+[source,text]
+--
+ id: 'my-email'
+ name: preconfigured-email-action-type
+ actionTypeId: .email
+ config:
+ from: testsender@test.com <1.1>
+ host: validhostname <1.2>
+ port: 8080 <1.3>
+ secure: false <1.4>
+ secrets:
+ user: testuser <2.1>
+ password: passwordkeystorevalue <2.2>
+--
+
+`config` defines the action type specific to the configuration and contains the following properties:
+
+<1.1> `from:` is an email address and correspond to *Sender*.
+<1.2> `host:` is a string and correspond to *Host*.
+<1.3> `port:` is a number and correspond to *Port*.
+<1.4> `secure:` is a boolean and correspond to *Secure*.
+
+`secrets` defines action type sensitive configuration:
+
+<2.1> `user:` is a string and correspond to *User*.
+<2.2> `password:` is a string and correspond to *Password*. Should be stored in the <>.
+
+
[[email-action-configuration]]
==== Action configuration
diff --git a/docs/user/alerting/action-types/index.asciidoc b/docs/user/alerting/action-types/index.asciidoc
index 625b8f704b7c6..4f5254e3311d8 100644
--- a/docs/user/alerting/action-types/index.asciidoc
+++ b/docs/user/alerting/action-types/index.asciidoc
@@ -15,6 +15,28 @@ Index:: The {es} index to be written to.
Refresh:: Setting for the {ref}/docs-refresh.html[refresh] policy for the write request.
Execution time field:: This field will be automatically set to the time the alert condition was detected.
+[float]
+[[Preconfigured-index-configuration]]
+==== Preconfigured action type
+
+[source,text]
+--
+ id: 'my-index'
+ name: action-type-index
+ actionTypeId: .index
+ config:
+ index: .kibana <1>
+ refresh: true <2>
+ executionTimeField: somedate <3>
+--
+
+`config` defines the action type specific to the configuration and contains the following properties:
+
+<1> `index:` is a string and correspond to *Index*.
+<2> `refresh:` is a boolean and correspond to *Refresh*.
+<3> `executionTimeField:` is a string and correspond to *Execution time field*.
+
+
[float]
[[index-action-configuration]]
==== Action configuration
diff --git a/docs/user/alerting/action-types/pagerduty.asciidoc b/docs/user/alerting/action-types/pagerduty.asciidoc
index 673b4f6263e18..957c035b028f6 100644
--- a/docs/user/alerting/action-types/pagerduty.asciidoc
+++ b/docs/user/alerting/action-types/pagerduty.asciidoc
@@ -135,6 +135,29 @@ Name:: The name of the connector. The name is used to identify a connector
API URL:: An optional PagerDuty event URL. Defaults to `https://events.pagerduty.com/v2/enqueue`. If you are using the <> setting, make sure the hostname is whitelisted.
Integration Key:: A 32 character PagerDuty Integration Key for an integration on a service, also referred to as the routing key.
+[float]
+[[Preconfigured-pagerduty-configuration]]
+==== Preconfigured action type
+
+[source,text]
+--
+ id: 'my-pagerduty'
+ name: preconfigured-pagerduty-action-type
+ actionTypeId: .pagerduty
+ config:
+ apiUrl: https://test.host <1.1>
+ secrets:
+ routingKey: testroutingkey <2.1>
+--
+
+`config` defines the action type specific to the configuration and contains the following properties:
+
+<1.1> `apiUrl:` is URL string and correspond to *API URL*.
+
+`secrets` defines action type sensitive configuration:
+
+<2.1> `routingKey:` is a string and correspond to *Integration Key*.
+
[float]
[[pagerduty-action-configuration]]
==== Action configuration
diff --git a/docs/user/alerting/action-types/server-log.asciidoc b/docs/user/alerting/action-types/server-log.asciidoc
index 8f888785626c9..f08dbe5542f0f 100644
--- a/docs/user/alerting/action-types/server-log.asciidoc
+++ b/docs/user/alerting/action-types/server-log.asciidoc
@@ -12,6 +12,17 @@ Server log connectors have the following configuration properties:
Name:: The name of the connector. The name is used to identify a connector in the management UI connector listing, or in the connector list when configuring an action.
+[float]
+[[Preconfigured-server-log-configuration]]
+==== Preconfigured action type
+
+[source,text]
+--
+ id: 'my-server-log'
+ name: test
+ actionTypeId: .server-log
+--
+
[float]
[[server-log-action-configuration]]
==== Action configuration
diff --git a/docs/user/alerting/action-types/slack.asciidoc b/docs/user/alerting/action-types/slack.asciidoc
index c0965d65bfdbe..195093536bc04 100644
--- a/docs/user/alerting/action-types/slack.asciidoc
+++ b/docs/user/alerting/action-types/slack.asciidoc
@@ -13,6 +13,24 @@ Slack connectors have the following configuration properties:
Name:: The name of the connector. The name is used to identify a connector in the management UI connector listing, or in the connector list when configuring an action.
Webhook URL:: The URL of the incoming webhook. See https://api.slack.com/messaging/webhooks#getting_started[Slack Incoming Webhooks] for instructions on generating this URL. If you are using the <> setting, make sure the hostname is whitelisted.
+[float]
+[[Preconfigured-slack-configuration]]
+==== Preconfigured action type
+
+[source,text]
+--
+ id: 'my-slack'
+ name: preconfigured-slack-action-type
+ actionTypeId: .slack
+ config:
+ webhookUrl: 'https://hooks.slack.com/services/abcd/efgh/ijklmnopqrstuvwxyz' <1>
+--
+
+`config` defines the action type specific to the configuration and contains the following properties:
+
+<1> `webhookUrl:` is URL string and correspond to *Webhook URL*.
+
+
[float]
[[slack-action-configuration]]
==== Action configuration
diff --git a/docs/user/alerting/action-types/webhook.asciidoc b/docs/user/alerting/action-types/webhook.asciidoc
index 64bfa6a1d6364..f4c108426642d 100644
--- a/docs/user/alerting/action-types/webhook.asciidoc
+++ b/docs/user/alerting/action-types/webhook.asciidoc
@@ -17,6 +17,36 @@ Headers:: A set of key-value pairs sent as headers with the request
User:: An optional username. If set, HTTP basic authentication is used. Currently only basic authentication is supported.
Password:: An optional password. If set, HTTP basic authentication is used. Currently only basic authentication is supported.
+[float]
+[[Preconfigured-webhook-configuration]]
+==== Preconfigured action type
+
+[source,text]
+--
+ id: 'my-webhook'
+ name: preconfigured-webhook-action-type
+ actionTypeId: .webhook
+ config:
+ url: https://test.host <1.1>
+ method: POST <1.2>
+ headers: <1.3>
+ testheader: testvalue
+ secrets:
+ user: testuser <2.1>
+ password: passwordkeystorevalue <2.2>
+--
+
+`config` defines the action type specific to the configuration and contains the following properties:
+
+<1.1> `url:` is URL string and correspond to *URL*.
+<1.2> `method:` is a string and correspond to *Method*.
+<1.3> `headers:` is Record and correspond to *Headers*.
+
+`secrets` defines action type sensitive configuration:
+
+<2.1> `user:` is a string and correspond to *User*.
+<2.2> `password:` is a string and correspond to *Password*. Should be stored in the <>.
+
[float]
[[webhook-action-configuration]]
==== Action configuration
diff --git a/docs/user/alerting/defining-alerts.asciidoc b/docs/user/alerting/defining-alerts.asciidoc
index f05afac34e595..d05a727016455 100644
--- a/docs/user/alerting/defining-alerts.asciidoc
+++ b/docs/user/alerting/defining-alerts.asciidoc
@@ -22,12 +22,12 @@ image::images/alert-flyout-sections.png[The three sections of an alert definitio
All alert share the following four properties in common:
[role="screenshot"]
-image::images/alert-flyout-general-details.png[All alerts have name, tags, check every, and re-notify every properties in common]
+image::images/alert-flyout-general-details.png[alt='All alerts have name, tags, check every, and notify every properties in common']
Name:: The name of the alert. While this name does not have to be unique, the name can be referenced in actions and also appears in the searchable alert listing in the management UI. A distinctive name can help identify and find an alert.
Tags:: A list of tag names that can be applied to an alert. Tags can help you organize and find alerts, because tags appear in the alert listing in the management UI which is searchable by tag.
Check every:: This value determines how frequently the alert conditions below are checked. Note that the timing of background alert checks are not guaranteed, particularly for intervals of less than 10 seconds. See <> for more information.
-Re-notify every:: This value limits how often actions are repeated when an alert instance remains active across alert checks. See <> for more information.
+Notify every:: This value limits how often actions are repeated when an alert instance remains active across alert checks. See <> for more information.
[float]
[[defining-alerts-type-conditions]]
diff --git a/docs/user/alerting/images/alert-flyout-action-type-selection.png b/docs/user/alerting/images/alert-flyout-action-type-selection.png
index e4448ca5f3fcd..2df2a031c6661 100644
Binary files a/docs/user/alerting/images/alert-flyout-action-type-selection.png and b/docs/user/alerting/images/alert-flyout-action-type-selection.png differ
diff --git a/docs/user/alerting/images/alert-flyout-alert-conditions.png b/docs/user/alerting/images/alert-flyout-alert-conditions.png
index f3e8f42ff0f37..8e0eff0224363 100644
Binary files a/docs/user/alerting/images/alert-flyout-alert-conditions.png and b/docs/user/alerting/images/alert-flyout-alert-conditions.png differ
diff --git a/docs/user/alerting/images/alert-flyout-alert-type-selection.png b/docs/user/alerting/images/alert-flyout-alert-type-selection.png
index a0a25dc5f1bbc..ccd3f07f07c94 100644
Binary files a/docs/user/alerting/images/alert-flyout-alert-type-selection.png and b/docs/user/alerting/images/alert-flyout-alert-type-selection.png differ
diff --git a/docs/user/alerting/images/alert-flyout-general-details.png b/docs/user/alerting/images/alert-flyout-general-details.png
index db56c16c1c308..883c2348ecc8a 100644
Binary files a/docs/user/alerting/images/alert-flyout-general-details.png and b/docs/user/alerting/images/alert-flyout-general-details.png differ
diff --git a/docs/user/alerting/images/alert-types-index-threshold-conditions.png b/docs/user/alerting/images/alert-types-index-threshold-conditions.png
index 356732dfb9777..5d66123ac733e 100644
Binary files a/docs/user/alerting/images/alert-types-index-threshold-conditions.png and b/docs/user/alerting/images/alert-types-index-threshold-conditions.png differ
diff --git a/docs/user/alerting/images/alert-types-index-threshold-example-aggregation.png b/docs/user/alerting/images/alert-types-index-threshold-example-aggregation.png
index fc40da7436547..055b643ec3458 100644
Binary files a/docs/user/alerting/images/alert-types-index-threshold-example-aggregation.png and b/docs/user/alerting/images/alert-types-index-threshold-example-aggregation.png differ
diff --git a/docs/user/alerting/images/alert-types-index-threshold-example-grouping.png b/docs/user/alerting/images/alert-types-index-threshold-example-grouping.png
index ea3a3849c8927..5be81b45612bc 100644
Binary files a/docs/user/alerting/images/alert-types-index-threshold-example-grouping.png and b/docs/user/alerting/images/alert-types-index-threshold-example-grouping.png differ
diff --git a/docs/user/alerting/images/alert-types-index-threshold-example-index.png b/docs/user/alerting/images/alert-types-index-threshold-example-index.png
index 8f818f7001278..b13201ce5d38a 100644
Binary files a/docs/user/alerting/images/alert-types-index-threshold-example-index.png and b/docs/user/alerting/images/alert-types-index-threshold-example-index.png differ
diff --git a/docs/user/alerting/images/alert-types-index-threshold-example-preview.png b/docs/user/alerting/images/alert-types-index-threshold-example-preview.png
index b5d9c38d99810..70e1355004c47 100644
Binary files a/docs/user/alerting/images/alert-types-index-threshold-example-preview.png and b/docs/user/alerting/images/alert-types-index-threshold-example-preview.png differ
diff --git a/docs/user/alerting/images/alert-types-index-threshold-example-threshold.png b/docs/user/alerting/images/alert-types-index-threshold-example-threshold.png
index 9c51807b8d219..7e9432d8c8678 100644
Binary files a/docs/user/alerting/images/alert-types-index-threshold-example-threshold.png and b/docs/user/alerting/images/alert-types-index-threshold-example-threshold.png differ
diff --git a/docs/user/alerting/images/alert-types-index-threshold-example-timefield.png b/docs/user/alerting/images/alert-types-index-threshold-example-timefield.png
index 24e4e03f829ce..4b1eaa631dc98 100644
Binary files a/docs/user/alerting/images/alert-types-index-threshold-example-timefield.png and b/docs/user/alerting/images/alert-types-index-threshold-example-timefield.png differ
diff --git a/docs/user/alerting/images/alert-types-index-threshold-example-window.png b/docs/user/alerting/images/alert-types-index-threshold-example-window.png
index 5405415958485..b4b272d2a241a 100644
Binary files a/docs/user/alerting/images/alert-types-index-threshold-example-window.png and b/docs/user/alerting/images/alert-types-index-threshold-example-window.png differ
diff --git a/docs/user/alerting/images/alert-types-index-threshold-preview.png b/docs/user/alerting/images/alert-types-index-threshold-preview.png
index 3709f162b612b..b3b868dbc41e8 100644
Binary files a/docs/user/alerting/images/alert-types-index-threshold-preview.png and b/docs/user/alerting/images/alert-types-index-threshold-preview.png differ
diff --git a/docs/user/alerting/images/alert-types-index-threshold-select.png b/docs/user/alerting/images/alert-types-index-threshold-select.png
index 0c2776e01b962..18c28a703e966 100644
Binary files a/docs/user/alerting/images/alert-types-index-threshold-select.png and b/docs/user/alerting/images/alert-types-index-threshold-select.png differ
diff --git a/docs/user/alerting/images/alerting-overview.png b/docs/user/alerting/images/alerting-overview.png
index 383bc8c2ce015..b4ec6f3df6028 100644
Binary files a/docs/user/alerting/images/alerting-overview.png and b/docs/user/alerting/images/alerting-overview.png differ
diff --git a/docs/user/alerting/images/pre-configured-action-type-select-type.png b/docs/user/alerting/images/pre-configured-action-type-select-type.png
index 5f555f851cd81..29e5a29edc7c0 100644
Binary files a/docs/user/alerting/images/pre-configured-action-type-select-type.png and b/docs/user/alerting/images/pre-configured-action-type-select-type.png differ
diff --git a/docs/user/alerting/pre-configured-action-types.asciidoc b/docs/user/alerting/pre-configured-action-types.asciidoc
deleted file mode 100644
index 780a2119037b1..0000000000000
--- a/docs/user/alerting/pre-configured-action-types.asciidoc
+++ /dev/null
@@ -1,61 +0,0 @@
-[role="xpack"]
-[[pre-configured-action-types]]
-
-== Preconfigured action types
-
-A preconfigure an action type has all the information it needs prior to startup.
-A preconfigured action type offers the following capabilities:
-
-- Requires no setup. Configuration and credentials needed to execute an
-action are predefined.
-- Has only <>.
-- Connectors of the preconfigured action type cannot be edited or deleted.
-
-[float]
-[[preconfigured-action-type-example]]
-=== Creating a preconfigured action
-
-In the `kibana.yml` file:
-
-. Exclude the action type from `xpack.actions.enabledActionTypes`.
-. Add all its connectors.
-
-The following example shows a valid configuration of preconfigured action type with one out-of-the box connector.
-
-```js
- xpack.actions.enabledActionTypes: ['.slack', '.email', '.index'] <1>
- xpack.actions.preconfigured: <2>
- - id: 'my-server-log'
- actionTypeId: .server-log
- name: 'Server log #xyz'
-```
-
-<1> `enabledActionTypes` should exclude preconfigured action type to prevent creating and deleting connectors.
-<2> `preconfigured` is the setting for defining the list of available connectors for the preconfigured action type.
-
-[float]
-[[pre-configured-action-type-alert-form]]
-=== Attaching a preconfigured action to an alert
-
-To attach an action to an alert,
-select from a list of available action types, and
-then select the *Server log* type. This action type was configured previously.
-
-[role="screenshot"]
-image::images/pre-configured-action-type-alert-form.png[Create alert with selected Server log action type]
-
-[float]
-[[managing-pre-configured-action-types]]
-=== Managing preconfigured actions
-
-Connectors with preconfigured actions appear in the connector list, regardless of which space the user is in.
-They are tagged as “preconfigured” and cannot be deleted.
-
-[role="screenshot"]
-image::images/pre-configured-action-type-managing.png[Connectors managing tab with pre-cofigured]
-
-Clicking *Create connector* shows the list of available action types.
-Preconfigured action types are not included because you can't create a connector with a preconfigured action type.
-
-[role="screenshot"]
-image::images/pre-configured-action-type-select-type.png[Pre-configured connector create menu]
diff --git a/docs/user/alerting/pre-configured-connectors.asciidoc b/docs/user/alerting/pre-configured-connectors.asciidoc
index 4c408da92f579..5ff4ea15df561 100644
--- a/docs/user/alerting/pre-configured-connectors.asciidoc
+++ b/docs/user/alerting/pre-configured-connectors.asciidoc
@@ -1,11 +1,10 @@
[role="xpack"]
-[[pre-configured-connectors]]
+[[pre-configured-action-types-and-connectors]]
-== Preconfigured connectors
+== Preconfigured connectors and action types
-You can preconfigure an action connector to have all the information it needs prior to startup
+You can preconfigure an action type or a connector to have all the information it needs prior to startup
by adding it to the `kibana.yml` file.
-Sensitive configuration information, such as credentials, can use the {kib} keystore.
Preconfigured connectors offer the following capabilities:
@@ -14,11 +13,15 @@ action are predefined, including the connector name and ID.
- Appear in all spaces because they are not saved objects.
- Cannot be edited or deleted.
+Sensitive configuration information, such as credentials, can use the <>.
+
+A preconfigured action types has only preconfigured connectors. Preconfigured connectors can belong to either the preconfigured action type or to the regular action type.
+
[float]
[[preconfigured-connector-example]]
-=== Example of a preconfigured connector
+=== Creating a preconfigured connector
-The following example shows a valid configuration 2 out-of-the box connector.
+The following example shows a valid configuration of two out-of-the box connectors: <> and <>.
```js
xpack.actions.preconfigured:
@@ -49,26 +52,30 @@ The following example shows a valid configuration 2 out-of-the box connector.
[NOTE]
==============================================
-Sensitive properties, such as passwords, can also be stored in the {kib} keystore.
+Sensitive properties, such as passwords, can also be stored in the <>.
==============================================
[float]
-[[pre-configured-connector-alert-form]]
-=== Creating an alert with a preconfigured connector
+[[preconfigured-action-type-example]]
+=== Creating a preconfigured action type
-When attaching an action to an alert,
-select from a list of available action types, and
-then select the Slack or Webhook type. Those action types were configured previously.
-The preconfigured connector is installed and is automatically selected.
+In the `kibana.yml` file:
-[role="screenshot"]
-image::images/alert-pre-configured-slack-connector.png[Create alert with selected Slack action type]
+. Exclude the action type from `xpack.actions.enabledActionTypes`.
+. Add all its preconfigured connectors.
-The dropdown is populated with additional preconfigured Slack connectors.
-The `preconfigured` label distinguishes them from space-aware connectors that use saved objects.
+The following example shows a valid configuration of preconfigured action type with one out-of-the box connector.
-[role="screenshot"]
-image::images/alert-pre-configured-connectors-dropdown.png[Dropdown list with pre-cofigured connectors]
+```js
+ xpack.actions.enabledActionTypes: ['.slack', '.email', '.index'] <1>
+ xpack.actions.preconfigured: <2>
+ - id: 'my-server-log'
+ actionTypeId: .server-log
+ name: 'Server log #xyz'
+```
+
+<1> `enabledActionTypes` should exclude preconfigured action type to prevent creating and deleting connectors.
+<2> `preconfigured` is the setting for defining the list of available connectors for the preconfigured action type.
[float]
[[managing-pre-configured-connectors]]
@@ -85,3 +92,37 @@ A message indicates that this is a preconfigured connector.
[role="screenshot"]
image::images/pre-configured-connectors-view-screen.png[Pre-configured connector view details]
+
+The connector details preview is disabled for preconfigured connectors.
+
+[role="screenshot"]
+image::images/pre-configured-action-type-managing.png[Connectors managing tab with pre-cofigured]
+
+
+[float]
+[[managing-pre-configured-action-types]]
+=== Managing preconfigured action types
+
+Clicking *Create connector* shows the list of available action types.
+Disabled action types are not included.
+
+[role="screenshot"]
+image::images/pre-configured-action-type-select-type.png[Pre-configured connector create menu]
+
+[float]
+[[pre-configured-connector-alert-form]]
+=== Alert with a preconfigured connector
+
+When attaching an action to an alert,
+select from a list of available action types, and
+then select the Slack or Webhook type. Those action types were configured previously.
+The preconfigured connector is installed and is automatically selected.
+
+[role="screenshot"]
+image::images/alert-pre-configured-slack-connector.png[Create alert with selected Slack action type]
+
+The dropdown is populated with additional preconfigured Slack connectors.
+The `preconfigured` label distinguishes them from space-aware connectors that use saved objects.
+
+[role="screenshot"]
+image::images/alert-pre-configured-connectors-dropdown.png[Dropdown list with pre-cofigured connectors]
diff --git a/docs/visualize/timelion.asciidoc b/docs/visualize/timelion.asciidoc
index 852c3e1ecdeca..9e41cce561454 100644
--- a/docs/visualize/timelion.asciidoc
+++ b/docs/visualize/timelion.asciidoc
@@ -32,7 +32,9 @@ To start tracking the real-time percentage of CPU, enter the following in the *T
[source,text]
----------------------------------
-.es(index=metricbeat-*, timefield='@timestamp', metric='avg:system.cpu.user.pct')
+.es(index=metricbeat-*,
+ timefield='@timestamp',
+ metric='avg:system.cpu.user.pct')
----------------------------------
[role="screenshot"]
@@ -70,7 +72,12 @@ To easily distinguish between the two data sets, add the label names:
[source,text]
----------------------------------
-.es(offset=-1h,index=metricbeat-*, timefield='@timestamp', metric='avg:system.cpu.user.pct').label('last hour'), .es(index=metricbeat-*, timefield='@timestamp', metric='avg:system.cpu.user.pct').label('current hour') <1>
+.es(offset=-1h,index=metricbeat-*,
+ timefield='@timestamp',
+ metric='avg:system.cpu.user.pct').label('last hour'),
+.es(index=metricbeat-*,
+ timefield='@timestamp',
+ metric='avg:system.cpu.user.pct').label('current hour') <1>
----------------------------------
<1> `.label()` adds custom labels to the visualization.
diff --git a/src/core/public/chrome/ui/_loading_indicator.scss b/src/core/public/chrome/ui/_loading_indicator.scss
index 026c23b93b040..ad934717b4b76 100644
--- a/src/core/public/chrome/ui/_loading_indicator.scss
+++ b/src/core/public/chrome/ui/_loading_indicator.scss
@@ -11,7 +11,7 @@ $kbnLoadingIndicatorColor2: tint($euiColorAccent, 60%);
top: 0; // 1
left: 0; // 1
right: 0; // 1
- z-index: $euiZLevel1; // 1
+ z-index: $euiZLevel2; // 1
overflow: hidden; // 2
height: $euiSizeXS / 2;
@@ -28,7 +28,7 @@ $kbnLoadingIndicatorColor2: tint($euiColorAccent, 60%);
right: 0;
bottom: 0;
position: absolute;
- z-index: $euiZLevel1 + 1;
+ z-index: $euiZLevel2 + 1;
visibility: visible;
display: block;
animation: kbn-animate-loading-indicator 2s linear infinite;
diff --git a/src/core/server/saved_objects/migrations/types.ts b/src/core/server/saved_objects/migrations/types.ts
index 85f15b4c18b66..5e55a34193a96 100644
--- a/src/core/server/saved_objects/migrations/types.ts
+++ b/src/core/server/saved_objects/migrations/types.ts
@@ -88,5 +88,5 @@ export interface SavedObjectMigrationContext {
* @public
*/
export interface SavedObjectMigrationMap {
- [version: string]: SavedObjectMigrationFn;
+ [version: string]: SavedObjectMigrationFn;
}
diff --git a/src/core/server/server.api.md b/src/core/server/server.api.md
index 62d11ee7cf9a7..bd6046b5ec281 100644
--- a/src/core/server/server.api.md
+++ b/src/core/server/server.api.md
@@ -1735,7 +1735,7 @@ export type SavedObjectMigrationFn;
}
// @public
diff --git a/src/dev/typescript/projects.ts b/src/dev/typescript/projects.ts
index a13f61af60173..5019c8bd22341 100644
--- a/src/dev/typescript/projects.ts
+++ b/src/dev/typescript/projects.ts
@@ -50,6 +50,9 @@ export const PROJECTS = [
...glob
.sync('test/plugin_functional/plugins/*/tsconfig.json', { cwd: REPO_ROOT })
.map(path => new Project(resolve(REPO_ROOT, path))),
+ ...glob
+ .sync('test/interpreter_functional/plugins/*/tsconfig.json', { cwd: REPO_ROOT })
+ .map(path => new Project(resolve(REPO_ROOT, path))),
];
export function filterProjectsByFlag(projectFlag?: string) {
diff --git a/src/legacy/core_plugins/kibana/public/__tests__/vis_type_vega/vega_visualization.js b/src/legacy/core_plugins/kibana/public/__tests__/vis_type_vega/vega_visualization.js
index 9f5f4b764f9b0..691318e32245b 100644
--- a/src/legacy/core_plugins/kibana/public/__tests__/vis_type_vega/vega_visualization.js
+++ b/src/legacy/core_plugins/kibana/public/__tests__/vis_type_vega/vega_visualization.js
@@ -21,6 +21,9 @@ import Bluebird from 'bluebird';
import expect from '@kbn/expect';
import ngMock from 'ng_mock';
import $ from 'jquery';
+
+import 'leaflet/dist/leaflet.js';
+import 'leaflet-vega';
// Will be replaced with new path when tests are moved
// eslint-disable-next-line @kbn/eslint/no-restricted-paths
import { createVegaVisualization } from '../../../../../../plugins/vis_type_vega/public/vega_visualization';
@@ -100,6 +103,39 @@ describe('VegaVisualizations', () => {
setSavedObjects(npStart.core.savedObjects);
setNotifications(npStart.core.notifications);
+ const mockMapConfig = {
+ includeElasticMapsService: true,
+ proxyElasticMapsServiceInMaps: false,
+ tilemap: {
+ deprecated: {
+ config: {
+ options: {
+ attribution: '',
+ },
+ },
+ },
+ options: {
+ attribution: '',
+ minZoom: 0,
+ maxZoom: 10,
+ },
+ },
+ regionmap: {
+ includeElasticMapsService: true,
+ layers: [],
+ },
+ manifestServiceUrl: '',
+ emsFileApiUrl: 'https://vector.maps.elastic.co',
+ emsTileApiUrl: 'https://tiles.maps.elastic.co',
+ emsLandingPageUrl: 'https://maps.elastic.co/v7.7',
+ emsFontLibraryUrl: 'https://tiles.maps.elastic.co/fonts/{fontstack}/{range}.pbf',
+ emsTileLayerId: {
+ bright: 'road_map',
+ desaturated: 'road_map_desaturated',
+ dark: 'dark_map',
+ },
+ };
+
beforeEach(ngMock.module('kibana'));
beforeEach(
ngMock.inject(() => {
@@ -127,7 +163,7 @@ describe('VegaVisualizations', () => {
return 'not found';
}
});
- const serviceSettings = new ServiceSettings();
+ const serviceSettings = new ServiceSettings(mockMapConfig, mockMapConfig.tilemap);
vegaVisualizationDependencies = {
serviceSettings,
core: {
diff --git a/src/legacy/core_plugins/kibana/public/kibana.js b/src/legacy/core_plugins/kibana/public/kibana.js
index ad67a74121cc9..4e97d46ab1773 100644
--- a/src/legacy/core_plugins/kibana/public/kibana.js
+++ b/src/legacy/core_plugins/kibana/public/kibana.js
@@ -45,7 +45,6 @@ import 'ui/autoload/all';
import './management';
import './dev_tools';
import { showAppRedirectNotification } from '../../../../plugins/kibana_legacy/public';
-import 'leaflet';
import { localApplicationService } from './local_application_service';
npSetup.plugins.kibanaLegacy.registerLegacyAppAlias('doc', 'discover', { keepPrefix: true });
diff --git a/src/legacy/core_plugins/region_map/public/__tests__/region_map_visualization.js b/src/legacy/core_plugins/region_map/public/__tests__/region_map_visualization.js
index 87592cf4e750e..7271f39debb39 100644
--- a/src/legacy/core_plugins/region_map/public/__tests__/region_map_visualization.js
+++ b/src/legacy/core_plugins/region_map/public/__tests__/region_map_visualization.js
@@ -20,6 +20,7 @@
import expect from '@kbn/expect';
import ngMock from 'ng_mock';
import _ from 'lodash';
+
import ChoroplethLayer from '../choropleth_layer';
import { ImageComparator } from 'test_utils/image_comparator';
import worldJson from './world.json';
@@ -103,31 +104,29 @@ describe('RegionMapsVisualizationTests', function() {
let getManifestStub;
beforeEach(
ngMock.inject(() => {
+ const mapConfig = {
+ emsFileApiUrl: '',
+ emsTileApiUrl: '',
+ emsLandingPageUrl: '',
+ };
+ const tilemapsConfig = {
+ deprecated: {
+ config: {
+ options: {
+ attribution: '123',
+ },
+ },
+ },
+ };
setInjectedVarFunc(injectedVar => {
switch (injectedVar) {
- case 'mapConfig':
- return {
- emsFileApiUrl: '',
- emsTileApiUrl: '',
- emsLandingPageUrl: '',
- };
- case 'tilemapsConfig':
- return {
- deprecated: {
- config: {
- options: {
- attribution: '123',
- },
- },
- },
- };
case 'version':
return '123';
default:
return 'not found';
}
});
- const serviceSettings = new ServiceSettings();
+ const serviceSettings = new ServiceSettings(mapConfig, tilemapsConfig);
const regionmapsConfig = {
includeElasticMapsService: true,
layers: [],
diff --git a/src/legacy/core_plugins/region_map/public/choropleth_layer.js b/src/legacy/core_plugins/region_map/public/choropleth_layer.js
index 4ea9cc1f7bfbf..f8c48958a1b9b 100644
--- a/src/legacy/core_plugins/region_map/public/choropleth_layer.js
+++ b/src/legacy/core_plugins/region_map/public/choropleth_layer.js
@@ -18,7 +18,6 @@
*/
import $ from 'jquery';
-import L from 'leaflet';
import _ from 'lodash';
import d3 from 'd3';
import { i18n } from '@kbn/i18n';
@@ -86,6 +85,7 @@ export default class ChoroplethLayer extends KibanaMapLayer {
this._layerName = name;
this._layerConfig = layerConfig;
+ // eslint-disable-next-line no-undef
this._leafletLayer = L.geoJson(null, {
onEachFeature: (feature, layer) => {
layer.on('click', () => {
@@ -96,6 +96,7 @@ export default class ChoroplethLayer extends KibanaMapLayer {
mouseover: () => {
const tooltipContents = this._tooltipFormatter(feature);
if (!location) {
+ // eslint-disable-next-line no-undef
const leafletGeojson = L.geoJson(feature);
location = leafletGeojson.getBounds().getCenter();
}
@@ -428,6 +429,7 @@ CORS configuration of the server permits requests from the Kibana application on
const { min, max } = getMinMax(this._metrics);
+ // eslint-disable-next-line no-undef
const boundsOfAllFeatures = new L.LatLngBounds();
return {
leafletStyleFunction: geojsonFeature => {
@@ -435,6 +437,7 @@ CORS configuration of the server permits requests from the Kibana application on
if (!match) {
return emptyStyle();
}
+ // eslint-disable-next-line no-undef
const boundsOfFeature = L.geoJson(geojsonFeature).getBounds();
boundsOfAllFeatures.extend(boundsOfFeature);
diff --git a/src/legacy/core_plugins/tile_map/index.ts b/src/legacy/core_plugins/tile_map/index.ts
deleted file mode 100644
index 27f019318a82b..0000000000000
--- a/src/legacy/core_plugins/tile_map/index.ts
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * Licensed to Elasticsearch B.V. under one or more contributor
- * license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright
- * ownership. Elasticsearch B.V. licenses this file to you under
- * the Apache License, Version 2.0 (the "License"); you may
- * not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-import { resolve } from 'path';
-import { Legacy } from 'kibana';
-
-import { LegacyPluginApi, LegacyPluginInitializer } from '../../../../src/legacy/types';
-
-const tileMapPluginInitializer: LegacyPluginInitializer = ({ Plugin }: LegacyPluginApi) =>
- new Plugin({
- id: 'tile_map',
- require: ['kibana', 'elasticsearch'],
- publicDir: resolve(__dirname, 'public'),
- uiExports: {
- styleSheetPaths: resolve(__dirname, 'public/index.scss'),
- hacks: [resolve(__dirname, 'public/legacy')],
- injectDefaultVars: server => {
- const serverConfig = server.config();
- const mapConfig: Record = serverConfig.get('map');
-
- return {
- emsTileLayerId: mapConfig.emsTileLayerId,
- };
- },
- },
- config(Joi: any) {
- return Joi.object({
- enabled: Joi.boolean().default(true),
- }).default();
- },
- } as Legacy.PluginSpecOptions);
-
-// eslint-disable-next-line import/no-default-export
-export default tileMapPluginInitializer;
diff --git a/src/plugins/dashboard/public/application/__snapshots__/dashboard_empty_screen.test.tsx.snap b/src/plugins/dashboard/public/application/__snapshots__/dashboard_empty_screen.test.tsx.snap
index 1bc85fa110ca0..698c124d2d805 100644
--- a/src/plugins/dashboard/public/application/__snapshots__/dashboard_empty_screen.test.tsx.snap
+++ b/src/plugins/dashboard/public/application/__snapshots__/dashboard_empty_screen.test.tsx.snap
@@ -301,7 +301,7 @@ exports[`DashboardEmptyScreen renders correctly with readonly mode 1`] = `
>
@@ -995,7 +995,7 @@ exports[`DashboardEmptyScreen renders correctly without visualize paragraph 1`]
>
diff --git a/src/plugins/dashboard/public/application/dashboard_empty_screen.tsx b/src/plugins/dashboard/public/application/dashboard_empty_screen.tsx
index 8bf205b8cb507..955d5244ce190 100644
--- a/src/plugins/dashboard/public/application/dashboard_empty_screen.tsx
+++ b/src/plugins/dashboard/public/application/dashboard_empty_screen.tsx
@@ -50,8 +50,8 @@ export function DashboardEmptyScreen({
}: DashboardEmptyScreenProps) {
const IS_DARK_THEME = uiSettings.get('theme:darkMode');
const emptyStateGraphicURL = IS_DARK_THEME
- ? '/plugins/kibana/home/assets/welcome_graphic_dark_2x.png'
- : '/plugins/kibana/home/assets/welcome_graphic_light_2x.png';
+ ? '/plugins/home/assets/welcome_graphic_dark_2x.png'
+ : '/plugins/home/assets/welcome_graphic_light_2x.png';
const linkToVisualizeParagraph = (
}
description={
diff --git a/src/legacy/core_plugins/kibana/public/home/assets/illustration_elastic_heart.png b/src/plugins/home/public/assets/illustration_elastic_heart.png
similarity index 100%
rename from src/legacy/core_plugins/kibana/public/home/assets/illustration_elastic_heart.png
rename to src/plugins/home/public/assets/illustration_elastic_heart.png
diff --git a/src/legacy/core_plugins/kibana/public/home/sample_data_resources/ecommerce/dashboard.png b/src/plugins/home/public/assets/sample_data_resources/ecommerce/dashboard.png
similarity index 100%
rename from src/legacy/core_plugins/kibana/public/home/sample_data_resources/ecommerce/dashboard.png
rename to src/plugins/home/public/assets/sample_data_resources/ecommerce/dashboard.png
diff --git a/src/legacy/core_plugins/kibana/public/home/sample_data_resources/ecommerce/dashboard_dark.png b/src/plugins/home/public/assets/sample_data_resources/ecommerce/dashboard_dark.png
similarity index 100%
rename from src/legacy/core_plugins/kibana/public/home/sample_data_resources/ecommerce/dashboard_dark.png
rename to src/plugins/home/public/assets/sample_data_resources/ecommerce/dashboard_dark.png
diff --git a/src/legacy/core_plugins/kibana/public/home/sample_data_resources/flights/dashboard.png b/src/plugins/home/public/assets/sample_data_resources/flights/dashboard.png
similarity index 100%
rename from src/legacy/core_plugins/kibana/public/home/sample_data_resources/flights/dashboard.png
rename to src/plugins/home/public/assets/sample_data_resources/flights/dashboard.png
diff --git a/src/legacy/core_plugins/kibana/public/home/sample_data_resources/flights/dashboard_dark.png b/src/plugins/home/public/assets/sample_data_resources/flights/dashboard_dark.png
similarity index 100%
rename from src/legacy/core_plugins/kibana/public/home/sample_data_resources/flights/dashboard_dark.png
rename to src/plugins/home/public/assets/sample_data_resources/flights/dashboard_dark.png
diff --git a/src/legacy/core_plugins/kibana/public/home/sample_data_resources/logs/dashboard.png b/src/plugins/home/public/assets/sample_data_resources/logs/dashboard.png
similarity index 100%
rename from src/legacy/core_plugins/kibana/public/home/sample_data_resources/logs/dashboard.png
rename to src/plugins/home/public/assets/sample_data_resources/logs/dashboard.png
diff --git a/src/legacy/core_plugins/kibana/public/home/sample_data_resources/logs/dashboard_dark.png b/src/plugins/home/public/assets/sample_data_resources/logs/dashboard_dark.png
similarity index 100%
rename from src/legacy/core_plugins/kibana/public/home/sample_data_resources/logs/dashboard_dark.png
rename to src/plugins/home/public/assets/sample_data_resources/logs/dashboard_dark.png
diff --git a/src/legacy/core_plugins/kibana/public/home/assets/welcome_graphic_dark_2x.png b/src/plugins/home/public/assets/welcome_graphic_dark_2x.png
similarity index 100%
rename from src/legacy/core_plugins/kibana/public/home/assets/welcome_graphic_dark_2x.png
rename to src/plugins/home/public/assets/welcome_graphic_dark_2x.png
diff --git a/src/legacy/core_plugins/kibana/public/home/assets/welcome_graphic_light_2x.png b/src/plugins/home/public/assets/welcome_graphic_light_2x.png
similarity index 100%
rename from src/legacy/core_plugins/kibana/public/home/assets/welcome_graphic_light_2x.png
rename to src/plugins/home/public/assets/welcome_graphic_light_2x.png
diff --git a/src/plugins/home/server/services/sample_data/data_sets/ecommerce/index.ts b/src/plugins/home/server/services/sample_data/data_sets/ecommerce/index.ts
index 3e16187c44343..b0cc2e2db3cc9 100644
--- a/src/plugins/home/server/services/sample_data/data_sets/ecommerce/index.ts
+++ b/src/plugins/home/server/services/sample_data/data_sets/ecommerce/index.ts
@@ -36,8 +36,8 @@ export const ecommerceSpecProvider = function(): SampleDatasetSchema {
id: 'ecommerce',
name: ecommerceName,
description: ecommerceDescription,
- previewImagePath: '/plugins/kibana/home/sample_data_resources/ecommerce/dashboard.png',
- darkPreviewImagePath: '/plugins/kibana/home/sample_data_resources/ecommerce/dashboard_dark.png',
+ previewImagePath: '/plugins/home/assets/sample_data_resources/ecommerce/dashboard.png',
+ darkPreviewImagePath: '/plugins/home/assets/sample_data_resources/ecommerce/dashboard_dark.png',
overviewDashboard: '722b74f0-b882-11e8-a6d9-e546fe2bba5f',
appLinks: initialAppLinks,
defaultIndex: 'ff959d40-b880-11e8-a6d9-e546fe2bba5f',
diff --git a/src/plugins/home/server/services/sample_data/data_sets/flights/index.ts b/src/plugins/home/server/services/sample_data/data_sets/flights/index.ts
index d63ea8f7fb493..fc3cb6094b5ea 100644
--- a/src/plugins/home/server/services/sample_data/data_sets/flights/index.ts
+++ b/src/plugins/home/server/services/sample_data/data_sets/flights/index.ts
@@ -36,8 +36,8 @@ export const flightsSpecProvider = function(): SampleDatasetSchema {
id: 'flights',
name: flightsName,
description: flightsDescription,
- previewImagePath: '/plugins/kibana/home/sample_data_resources/flights/dashboard.png',
- darkPreviewImagePath: '/plugins/kibana/home/sample_data_resources/flights/dashboard_dark.png',
+ previewImagePath: '/plugins/home/assets/sample_data_resources/flights/dashboard.png',
+ darkPreviewImagePath: '/plugins/home/assets/sample_data_resources/flights/dashboard_dark.png',
overviewDashboard: '7adfa750-4c81-11e8-b3d7-01146121b73d',
appLinks: initialAppLinks,
defaultIndex: 'd3d7af60-4c81-11e8-b3d7-01146121b73d',
diff --git a/src/plugins/home/server/services/sample_data/data_sets/logs/index.ts b/src/plugins/home/server/services/sample_data/data_sets/logs/index.ts
index bb6e2982f59a0..d8f205dff24e8 100644
--- a/src/plugins/home/server/services/sample_data/data_sets/logs/index.ts
+++ b/src/plugins/home/server/services/sample_data/data_sets/logs/index.ts
@@ -36,8 +36,8 @@ export const logsSpecProvider = function(): SampleDatasetSchema {
id: 'logs',
name: logsName,
description: logsDescription,
- previewImagePath: '/plugins/kibana/home/sample_data_resources/logs/dashboard.png',
- darkPreviewImagePath: '/plugins/kibana/home/sample_data_resources/logs/dashboard_dark.png',
+ previewImagePath: '/plugins/home/assets/sample_data_resources/logs/dashboard.png',
+ darkPreviewImagePath: '/plugins/home/assets/sample_data_resources/logs/dashboard_dark.png',
overviewDashboard: 'edf84fe0-e1a0-11e7-b6d5-4dc382ef7f5b',
appLinks: initialAppLinks,
defaultIndex: '90943e30-9a47-11e8-b64d-95841ca0b247',
diff --git a/src/plugins/maps_legacy/config.ts b/src/plugins/maps_legacy/config.ts
new file mode 100644
index 0000000000000..13a0ad6b393a3
--- /dev/null
+++ b/src/plugins/maps_legacy/config.ts
@@ -0,0 +1,67 @@
+/*
+ * Licensed to Elasticsearch B.V. under one or more contributor
+ * license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright
+ * ownership. Elasticsearch B.V. licenses this file to you under
+ * the Apache License, Version 2.0 (the "License"); you may
+ * not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import { schema, TypeOf } from '@kbn/config-schema';
+import { configSchema as tilemapSchema } from '../tile_map/config';
+
+// TODO: Pull this portion from region_map
+export const regionmapSchema = schema.object({
+ includeElasticMapsService: schema.boolean({ defaultValue: true }),
+ layers: schema.arrayOf(
+ schema.object({
+ url: schema.string(),
+ format: schema.object({
+ type: schema.string({ defaultValue: 'geojson' }),
+ }),
+ meta: schema.object({
+ feature_collection_path: schema.string({ defaultValue: 'data' }),
+ }),
+ attribution: schema.string(),
+ name: schema.string(),
+ fields: schema.arrayOf(
+ schema.object({
+ name: schema.string(),
+ description: schema.string(),
+ })
+ ),
+ }),
+ { defaultValue: [] }
+ ),
+});
+
+export const configSchema = schema.object({
+ includeElasticMapsService: schema.boolean({ defaultValue: true }),
+ proxyElasticMapsServiceInMaps: schema.boolean({ defaultValue: false }),
+ tilemap: tilemapSchema,
+ regionmap: regionmapSchema,
+ manifestServiceUrl: schema.string({ defaultValue: '' }),
+ emsFileApiUrl: schema.string({ defaultValue: 'https://vector.maps.elastic.co' }),
+ emsTileApiUrl: schema.string({ defaultValue: 'https://tiles.maps.elastic.co' }),
+ emsLandingPageUrl: schema.string({ defaultValue: 'https://maps.elastic.co/v7.7' }),
+ emsFontLibraryUrl: schema.string({
+ defaultValue: 'https://tiles.maps.elastic.co/fonts/{fontstack}/{range}.pbf',
+ }),
+ emsTileLayerId: schema.object({
+ bright: schema.string({ defaultValue: 'road_map' }),
+ desaturated: schema.string({ defaultValue: 'road_map_desaturated' }),
+ dark: schema.string({ defaultValue: 'dark_map' }),
+ }),
+});
+
+export type ConfigSchema = TypeOf;
diff --git a/src/plugins/maps_legacy/kibana.json b/src/plugins/maps_legacy/kibana.json
index d66be2b156bb9..cd503883164ac 100644
--- a/src/plugins/maps_legacy/kibana.json
+++ b/src/plugins/maps_legacy/kibana.json
@@ -2,5 +2,7 @@
"id": "mapsLegacy",
"version": "8.0.0",
"kibanaVersion": "kibana",
- "ui": true
+ "configPath": ["map"],
+ "ui": true,
+ "server": true
}
diff --git a/src/plugins/maps_legacy/public/__tests__/map/kibana_map.js b/src/plugins/maps_legacy/public/__tests__/map/kibana_map.js
index 83b5359362e4c..1002a8e9eedc8 100644
--- a/src/plugins/maps_legacy/public/__tests__/map/kibana_map.js
+++ b/src/plugins/maps_legacy/public/__tests__/map/kibana_map.js
@@ -20,7 +20,6 @@
import expect from '@kbn/expect';
import { KibanaMap } from '../../map/kibana_map';
import { KibanaMapLayer } from '../../map/kibana_map_layer';
-import L from 'leaflet';
describe('kibana_map tests', function() {
let domNode;
@@ -218,6 +217,7 @@ describe('kibana_map tests', function() {
function makeMockLayer(attribution) {
const layer = new KibanaMapLayer();
layer._attribution = attribution;
+ // eslint-disable-next-line no-undef
layer._leafletLayer = L.geoJson(null);
return layer;
}
diff --git a/src/plugins/maps_legacy/public/index.ts b/src/plugins/maps_legacy/public/index.ts
index 17cecab9f7459..3fe377fbdc41f 100644
--- a/src/plugins/maps_legacy/public/index.ts
+++ b/src/plugins/maps_legacy/public/index.ts
@@ -17,12 +17,15 @@
* under the License.
*/
-import { CoreSetup } from 'kibana/public';
-import { bindSetupCoreAndPlugins, MapsLegacyPlugin } from './plugin';
// @ts-ignore
-import * as colorUtil from './map/color_util';
+import { CoreSetup, PluginInitializerContext } from 'kibana/public';
+// @ts-ignore
+import { L } from './leaflet';
// @ts-ignore
import { KibanaMap } from './map/kibana_map';
+import { bindSetupCoreAndPlugins, MapsLegacyPlugin } from './plugin';
+// @ts-ignore
+import * as colorUtil from './map/color_util';
// @ts-ignore
import { KibanaMapLayer } from './map/kibana_map_layer';
// @ts-ignore
@@ -41,8 +44,15 @@ import {
// @ts-ignore
import { mapTooltipProvider } from './tooltip_provider';
-export function plugin() {
- return new MapsLegacyPlugin();
+export interface MapsLegacyConfigType {
+ emsTileLayerId: string;
+ includeElasticMapsService: boolean;
+ proxyElasticMapsServiceInMaps: boolean;
+ tilemap: any;
+}
+
+export function plugin(initializerContext: PluginInitializerContext) {
+ return new MapsLegacyPlugin(initializerContext);
}
/** @public */
@@ -59,6 +69,7 @@ export {
FileLayer,
TmsLayer,
mapTooltipProvider,
+ L,
};
// Due to a leaflet/leaflet-draw bug, it's not possible to consume leaflet maps w/ draw control
diff --git a/src/plugins/maps_legacy/public/leaflet.js b/src/plugins/maps_legacy/public/leaflet.js
new file mode 100644
index 0000000000000..e36da2c52b8c5
--- /dev/null
+++ b/src/plugins/maps_legacy/public/leaflet.js
@@ -0,0 +1,36 @@
+/*
+ * Licensed to Elasticsearch B.V. under one or more contributor
+ * license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright
+ * ownership. Elasticsearch B.V. licenses this file to you under
+ * the Apache License, Version 2.0 (the "License"); you may
+ * not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+export let L;
+
+if (!window.hasOwnProperty('L')) {
+ require('leaflet/dist/leaflet.css');
+ window.L = require('leaflet/dist/leaflet.js');
+ window.L.Browser.touch = false;
+ window.L.Browser.pointer = false;
+
+ require('leaflet-vega');
+ require('leaflet.heat/dist/leaflet-heat.js');
+ require('leaflet-draw/dist/leaflet.draw.css');
+ require('leaflet-draw/dist/leaflet.draw.js');
+ require('leaflet-responsive-popup/leaflet.responsive.popup.css');
+ require('leaflet-responsive-popup/leaflet.responsive.popup.js');
+} else {
+ L = window.L;
+}
diff --git a/src/plugins/maps_legacy/public/map/kibana_map.js b/src/plugins/maps_legacy/public/map/kibana_map.js
index c7cec1b14159a..85dafc318db8d 100644
--- a/src/plugins/maps_legacy/public/map/kibana_map.js
+++ b/src/plugins/maps_legacy/public/map/kibana_map.js
@@ -19,15 +19,16 @@
import { EventEmitter } from 'events';
import { createZoomWarningMsg } from './map_messages';
-import L from 'leaflet';
import $ from 'jquery';
import _ from 'lodash';
import { zoomToPrecision } from './zoom_to_precision';
import { i18n } from '@kbn/i18n';
import { ORIGIN } from '../common/constants/origin';
import { getToasts } from '../kibana_services';
+import { L } from '../leaflet';
function makeFitControl(fitContainer, kibanaMap) {
+ // eslint-disable-next-line no-undef
const FitControl = L.Control.extend({
options: {
position: 'topleft',
@@ -63,6 +64,7 @@ function makeFitControl(fitContainer, kibanaMap) {
}
function makeLegendControl(container, kibanaMap, position) {
+ // eslint-disable-next-line no-undef
const LegendControl = L.Control.extend({
options: {
position: 'topright',
@@ -123,11 +125,13 @@ export class KibanaMap extends EventEmitter {
maxZoom: options.maxZoom,
center: options.center ? options.center : [0, 0],
zoom: options.zoom ? options.zoom : 2,
+ // eslint-disable-next-line no-undef
renderer: L.canvas(),
zoomAnimation: false, // Desaturate map tiles causes animation rendering artifacts
zoomControl: options.zoomControl === undefined ? true : options.zoomControl,
};
+ // eslint-disable-next-line no-undef
this._leafletMap = L.map(containerNode, leafletOptions);
this._leafletMap.attributionControl.setPrefix('');
@@ -228,10 +232,11 @@ export class KibanaMap extends EventEmitter {
}
if (!this._popup) {
- this._popup = L.responsivePopup({ autoPan: false });
+ // eslint-disable-next-line no-undef
+ this._popup = new L.ResponsivePopup({ autoPan: false });
this._popup.setLatLng(event.position);
this._popup.setContent(event.content);
- this._popup.openOn(this._leafletMap);
+ this._leafletMap.openPopup(this._popup);
} else {
if (!this._popup.getLatLng().equals(event.position)) {
this._popup.setLatLng(event.position);
@@ -335,6 +340,7 @@ export class KibanaMap extends EventEmitter {
}
setCenter(latitude, longitude) {
+ // eslint-disable-next-line no-undef
const latLong = L.latLng(latitude, longitude);
if (latLong.equals && !latLong.equals(this._leafletMap.getCenter())) {
this._leafletMap.setView(latLong);
@@ -461,6 +467,7 @@ export class KibanaMap extends EventEmitter {
circlemarker: false,
},
};
+ // eslint-disable-next-line no-undef
this._leafletDrawControl = new L.Control.Draw(drawOptions);
this._leafletMap.addControl(this._leafletDrawControl);
}
@@ -470,6 +477,7 @@ export class KibanaMap extends EventEmitter {
return;
}
+ // eslint-disable-next-line no-undef
const fitContainer = L.DomUtil.create('div', 'leaflet-control leaflet-bar leaflet-control-fit');
this._leafletFitControl = makeFitControl(fitContainer, this);
this._leafletMap.addControl(this._leafletFitControl);
@@ -621,6 +629,7 @@ export class KibanaMap extends EventEmitter {
}
_getTMSBaseLayer(options) {
+ // eslint-disable-next-line no-undef
return L.tileLayer(options.url, {
minZoom: options.minZoom,
maxZoom: options.maxZoom,
@@ -640,7 +649,8 @@ export class KibanaMap extends EventEmitter {
};
return typeof options.url === 'string' && options.url.length
- ? L.tileLayer.wms(options.url, wmsOptions)
+ ? // eslint-disable-next-line no-undef
+ L.tileLayer.wms(options.url, wmsOptions)
: null;
}
diff --git a/src/plugins/maps_legacy/public/map/service_settings.js b/src/plugins/maps_legacy/public/map/service_settings.js
index 8e3a0648e99d4..437b78a3c3472 100644
--- a/src/plugins/maps_legacy/public/map/service_settings.js
+++ b/src/plugins/maps_legacy/public/map/service_settings.js
@@ -27,10 +27,10 @@ import { ORIGIN } from '../common/constants/origin';
const TMS_IN_YML_ID = 'TMS in config/kibana.yml';
export class ServiceSettings {
- constructor() {
+ constructor(mapConfig, tilemapsConfig) {
const getInjectedVar = getInjectedVarFunc();
- this.mapConfig = getInjectedVar('mapConfig');
- this.tilemapsConfig = getInjectedVar('tilemapsConfig');
+ this._mapConfig = mapConfig;
+ this._tilemapsConfig = tilemapsConfig;
const kbnVersion = getInjectedVar('version');
this._showZoomMessage = true;
@@ -38,9 +38,9 @@ export class ServiceSettings {
language: i18n.getLocale(),
appVersion: kbnVersion,
appName: 'kibana',
- fileApiUrl: this.mapConfig.emsFileApiUrl,
- tileApiUrl: this.mapConfig.emsTileApiUrl,
- landingPageUrl: this.mapConfig.emsLandingPageUrl,
+ fileApiUrl: this._mapConfig.emsFileApiUrl,
+ tileApiUrl: this._mapConfig.emsTileApiUrl,
+ landingPageUrl: this._mapConfig.emsLandingPageUrl,
// Wrap to avoid errors passing window fetch
fetchFunction: function(...args) {
return fetch(...args);
@@ -57,10 +57,10 @@ export class ServiceSettings {
// TMS attribution
const attributionFromConfig = _.escape(
- markdownIt.render(this.tilemapsConfig.deprecated.config.options.attribution || '')
+ markdownIt.render(this._tilemapsConfig.deprecated.config.options.attribution || '')
);
// TMS Options
- this.tmsOptionsFromConfig = _.assign({}, this.tilemapsConfig.deprecated.config.options, {
+ this.tmsOptionsFromConfig = _.assign({}, this._tilemapsConfig.deprecated.config.options, {
attribution: attributionFromConfig,
});
}
@@ -92,7 +92,7 @@ export class ServiceSettings {
}
async getFileLayers() {
- if (!this.mapConfig.includeElasticMapsService) {
+ if (!this._mapConfig.includeElasticMapsService) {
return [];
}
@@ -121,7 +121,7 @@ export class ServiceSettings {
*/
async getTMSServices() {
let allServices = [];
- if (this.tilemapsConfig.deprecated.isOverridden) {
+ if (this._tilemapsConfig.deprecated.isOverridden) {
//use tilemap.* settings from yml
const tmsService = _.cloneDeep(this.tmsOptionsFromConfig);
tmsService.id = TMS_IN_YML_ID;
@@ -129,11 +129,11 @@ export class ServiceSettings {
allServices.push(tmsService);
}
- if (this.mapConfig.includeElasticMapsService) {
+ if (this._mapConfig.includeElasticMapsService) {
const servicesFromManifest = await this._emsClient.getTMSServices();
const strippedServiceFromManifest = await Promise.all(
servicesFromManifest
- .filter(tmsService => tmsService.getId() === this.mapConfig.emsTileLayerId.bright)
+ .filter(tmsService => tmsService.getId() === this._mapConfig.emsTileLayerId.bright)
.map(async tmsService => {
//shim for compatibility
return {
@@ -173,7 +173,7 @@ export class ServiceSettings {
async _getAttributesForEMSTMSLayer(isDesaturated, isDarkMode) {
const tmsServices = await this._emsClient.getTMSServices();
- const emsTileLayerId = this.mapConfig.emsTileLayerId;
+ const emsTileLayerId = this._mapConfig.emsTileLayerId;
let serviceId;
if (isDarkMode) {
serviceId = emsTileLayerId.dark;
@@ -200,13 +200,13 @@ export class ServiceSettings {
if (tmsServiceConfig.origin === ORIGIN.EMS) {
return this._getAttributesForEMSTMSLayer(isDesaturated, isDarkMode);
} else if (tmsServiceConfig.origin === ORIGIN.KIBANA_YML) {
- const config = this.tilemapsConfig.deprecated.config;
+ const config = this._tilemapsConfig.deprecated.config;
const attrs = _.pick(config, ['url', 'minzoom', 'maxzoom', 'attribution']);
return { ...attrs, ...{ origin: ORIGIN.KIBANA_YML } };
} else {
//this is an older config. need to resolve this dynamically.
if (tmsServiceConfig.id === TMS_IN_YML_ID) {
- const config = this.tilemapsConfig.deprecated.config;
+ const config = this._tilemapsConfig.deprecated.config;
const attrs = _.pick(config, ['url', 'minzoom', 'maxzoom', 'attribution']);
return { ...attrs, ...{ origin: ORIGIN.KIBANA_YML } };
} else {
diff --git a/src/plugins/maps_legacy/public/plugin.ts b/src/plugins/maps_legacy/public/plugin.ts
index acc7655a5e263..78c2498b9ee90 100644
--- a/src/plugins/maps_legacy/public/plugin.ts
+++ b/src/plugins/maps_legacy/public/plugin.ts
@@ -18,14 +18,15 @@
*/
// @ts-ignore
-import { CoreSetup, CoreStart, Plugin } from 'kibana/public';
+import { CoreSetup, CoreStart, Plugin, PluginInitializerContext } from 'kibana/public';
// @ts-ignore
import { setToasts, setUiSettings, setInjectedVarFunc } from './kibana_services';
// @ts-ignore
import { ServiceSettings } from './map/service_settings';
// @ts-ignore
import { getPrecision, getZoomPrecision } from './map/precision';
-import { MapsLegacyPluginSetup, MapsLegacyPluginStart } from './index';
+import { MapsLegacyConfigType, MapsLegacyPluginSetup, MapsLegacyPluginStart } from './index';
+import { ConfigSchema } from '../config';
/**
* These are the interfaces with your public contracts. You should export these
@@ -45,13 +46,22 @@ export interface MapsLegacySetupDependencies {}
export interface MapsLegacyStartDependencies {}
export class MapsLegacyPlugin implements Plugin {
+ readonly _initializerContext: PluginInitializerContext;
+
+ constructor(initializerContext: PluginInitializerContext) {
+ this._initializerContext = initializerContext;
+ }
+
public setup(core: CoreSetup, plugins: MapsLegacySetupDependencies) {
bindSetupCoreAndPlugins(core);
+ const config = this._initializerContext.config.get();
+
return {
- serviceSettings: new ServiceSettings(),
+ serviceSettings: new ServiceSettings(config, config.tilemap),
getZoomPrecision,
getPrecision,
+ config,
};
}
diff --git a/src/legacy/core_plugins/tile_map/public/legacy.ts b/src/plugins/maps_legacy/server/index.ts
similarity index 54%
rename from src/legacy/core_plugins/tile_map/public/legacy.ts
rename to src/plugins/maps_legacy/server/index.ts
index dd8d4c6e9311e..18f58189fc607 100644
--- a/src/legacy/core_plugins/tile_map/public/legacy.ts
+++ b/src/plugins/maps_legacy/server/index.ts
@@ -17,19 +17,33 @@
* under the License.
*/
+import { PluginConfigDescriptor } from 'kibana/server';
import { PluginInitializerContext } from 'kibana/public';
-import { npSetup, npStart } from 'ui/new_platform';
+import { configSchema, ConfigSchema } from '../config';
-import { TileMapPluginSetupDependencies } from './plugin';
-import { plugin } from '.';
-
-const plugins: Readonly = {
- expressions: npSetup.plugins.expressions,
- visualizations: npSetup.plugins.visualizations,
- mapsLegacy: npSetup.plugins.mapsLegacy,
+export const config: PluginConfigDescriptor = {
+ exposeToBrowser: {
+ includeElasticMapsService: true,
+ proxyElasticMapsServiceInMaps: true,
+ tilemap: true,
+ regionmap: true,
+ manifestServiceUrl: true,
+ emsFileApiUrl: true,
+ emsTileApiUrl: true,
+ emsLandingPageUrl: true,
+ emsFontLibraryUrl: true,
+ emsTileLayerId: true,
+ },
+ schema: configSchema,
};
-const pluginInstance = plugin({} as PluginInitializerContext);
-
-export const setup = pluginInstance.setup(npSetup.core, plugins);
-export const start = pluginInstance.start(npStart.core);
+export const plugin = (initializerContext: PluginInitializerContext) => ({
+ setup() {
+ // @ts-ignore
+ const config$ = initializerContext.config.create();
+ return {
+ config: config$,
+ };
+ },
+ start() {},
+});
diff --git a/src/plugins/tile_map/config.ts b/src/plugins/tile_map/config.ts
new file mode 100644
index 0000000000000..435e52103d156
--- /dev/null
+++ b/src/plugins/tile_map/config.ts
@@ -0,0 +1,47 @@
+/*
+ * Licensed to Elasticsearch B.V. under one or more contributor
+ * license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright
+ * ownership. Elasticsearch B.V. licenses this file to you under
+ * the Apache License, Version 2.0 (the "License"); you may
+ * not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import { schema, TypeOf } from '@kbn/config-schema';
+
+export const configSchema = schema.object({
+ url: schema.maybe(schema.string()),
+ deprecated: schema.any({
+ defaultValue: {
+ config: {
+ options: {
+ attribution: '',
+ },
+ },
+ },
+ }),
+ options: schema.object({
+ attribution: schema.string({ defaultValue: '' }),
+ minZoom: schema.number({ defaultValue: 0, min: 0 }),
+ maxZoom: schema.number({ defaultValue: 10 }),
+ tileSize: schema.maybe(schema.number()),
+ subdomains: schema.maybe(schema.arrayOf(schema.string())),
+ errorTileUrl: schema.maybe(schema.string()),
+ tms: schema.maybe(schema.boolean()),
+ reuseTiles: schema.maybe(schema.boolean()),
+ bounds: schema.maybe(schema.arrayOf(schema.number({ min: 2 }))),
+ default: schema.maybe(schema.boolean()),
+ }),
+});
+
+export type ConfigSchema = TypeOf;
diff --git a/src/plugins/tile_map/kibana.json b/src/plugins/tile_map/kibana.json
new file mode 100644
index 0000000000000..71ae0bb29d17f
--- /dev/null
+++ b/src/plugins/tile_map/kibana.json
@@ -0,0 +1,14 @@
+{
+ "id": "tileMap",
+ "version": "8.0.0",
+ "kibanaVersion": "kibana",
+ "configPath": ["map", "tilemap"],
+ "ui": true,
+ "server": true,
+ "requiredPlugins": [
+ "visualizations",
+ "expressions",
+ "mapsLegacy",
+ "data"
+ ]
+}
diff --git a/src/legacy/core_plugins/tile_map/package.json b/src/plugins/tile_map/package.json
similarity index 100%
rename from src/legacy/core_plugins/tile_map/package.json
rename to src/plugins/tile_map/package.json
diff --git a/src/legacy/core_plugins/tile_map/public/__snapshots__/tilemap_fn.test.js.snap b/src/plugins/tile_map/public/__snapshots__/tilemap_fn.test.js.snap
similarity index 100%
rename from src/legacy/core_plugins/tile_map/public/__snapshots__/tilemap_fn.test.js.snap
rename to src/plugins/tile_map/public/__snapshots__/tilemap_fn.test.js.snap
diff --git a/src/legacy/core_plugins/tile_map/public/__tests__/blues.png b/src/plugins/tile_map/public/__tests__/blues.png
similarity index 100%
rename from src/legacy/core_plugins/tile_map/public/__tests__/blues.png
rename to src/plugins/tile_map/public/__tests__/blues.png
diff --git a/src/legacy/core_plugins/tile_map/public/__tests__/coordinate_maps_visualization.js b/src/plugins/tile_map/public/__tests__/coordinate_maps_visualization.js
similarity index 85%
rename from src/legacy/core_plugins/tile_map/public/__tests__/coordinate_maps_visualization.js
rename to src/plugins/tile_map/public/__tests__/coordinate_maps_visualization.js
index bce2e157ebbc8..303ce67be7102 100644
--- a/src/legacy/core_plugins/tile_map/public/__tests__/coordinate_maps_visualization.js
+++ b/src/plugins/tile_map/public/__tests__/coordinate_maps_visualization.js
@@ -23,37 +23,37 @@ import { ImageComparator } from 'test_utils/image_comparator';
import dummyESResponse from './dummy_es_response.json';
import initial from './initial.png';
import blues from './blues.png';
-import shadedGeohashGrid from './shadedGeohashGrid.png';
+import shadedGeohashGrid from './shaded_geohash_grid.png';
import heatmapRaw from './heatmap_raw.png';
// eslint-disable-next-line @kbn/eslint/no-restricted-paths
-import EMS_CATALOGUE from '../../../../../plugins/maps_legacy/public/__tests__/map/ems_mocks/sample_manifest.json';
+import EMS_CATALOGUE from '../../../maps_legacy/public/__tests__/map/ems_mocks/sample_manifest.json';
// eslint-disable-next-line @kbn/eslint/no-restricted-paths
-import EMS_FILES from '../../../../../plugins/maps_legacy/public/__tests__/map/ems_mocks/sample_files.json';
+import EMS_FILES from '../../../maps_legacy/public/__tests__/map/ems_mocks/sample_files.json';
// eslint-disable-next-line @kbn/eslint/no-restricted-paths
-import EMS_TILES from '../../../../../plugins/maps_legacy/public/__tests__/map/ems_mocks/sample_tiles.json';
+import EMS_TILES from '../../../maps_legacy/public/__tests__/map/ems_mocks/sample_tiles.json';
// eslint-disable-next-line @kbn/eslint/no-restricted-paths
-import EMS_STYLE_ROAD_MAP_BRIGHT from '../../../../../plugins/maps_legacy/public/__tests__/map/ems_mocks/sample_style_bright';
+import EMS_STYLE_ROAD_MAP_BRIGHT from '../../../maps_legacy/public/__tests__/map/ems_mocks/sample_style_bright';
// eslint-disable-next-line @kbn/eslint/no-restricted-paths
-import EMS_STYLE_ROAD_MAP_DESATURATED from '../../../../../plugins/maps_legacy/public/__tests__/map/ems_mocks/sample_style_desaturated';
+import EMS_STYLE_ROAD_MAP_DESATURATED from '../../../maps_legacy/public/__tests__/map/ems_mocks/sample_style_desaturated';
// eslint-disable-next-line @kbn/eslint/no-restricted-paths
-import EMS_STYLE_DARK_MAP from '../../../../../plugins/maps_legacy/public/__tests__/map/ems_mocks/sample_style_dark';
+import EMS_STYLE_DARK_MAP from '../../../maps_legacy/public/__tests__/map/ems_mocks/sample_style_dark';
import { createTileMapVisualization } from '../tile_map_visualization';
import { createTileMapTypeDefinition } from '../tile_map_type';
// eslint-disable-next-line @kbn/eslint/no-restricted-paths
-import { ExprVis } from '../../../../../plugins/visualizations/public/expressions/vis';
+import { ExprVis } from '../../../visualizations/public/expressions/vis';
// eslint-disable-next-line @kbn/eslint/no-restricted-paths
-import { BaseVisType } from '../../../../../plugins/visualizations/public/vis_types/base_vis_type';
+import { BaseVisType } from '../../../visualizations/public/vis_types/base_vis_type';
import {
getPrecision,
getZoomPrecision,
// eslint-disable-next-line @kbn/eslint/no-restricted-paths
-} from '../../../../../plugins/maps_legacy/public/map/precision';
+} from '../../../maps_legacy/public/map/precision';
// eslint-disable-next-line @kbn/eslint/no-restricted-paths
-import { ServiceSettings } from '../../../../../plugins/maps_legacy/public/map/service_settings';
+import { ServiceSettings } from '../../../maps_legacy/public/map/service_settings';
// eslint-disable-next-line @kbn/eslint/no-restricted-paths
-import { setInjectedVarFunc } from '../../../../../plugins/maps_legacy/public/kibana_services';
-import { getBaseMapsVis } from '../../../../../plugins/maps_legacy/public';
+import { setInjectedVarFunc } from '../../../maps_legacy/public/kibana_services';
+import { getBaseMapsVis } from '../../../maps_legacy/public';
function mockRawData() {
const stack = [dummyESResponse];
@@ -91,24 +91,22 @@ describe('CoordinateMapsVisualizationTest', function() {
beforeEach(ngMock.module('kibana'));
beforeEach(
ngMock.inject((Private, $injector) => {
+ const mapConfig = {
+ emsFileApiUrl: '',
+ emsTileApiUrl: '',
+ emsLandingPageUrl: '',
+ };
+ const tilemapsConfig = {
+ deprecated: {
+ config: {
+ options: {
+ attribution: '123',
+ },
+ },
+ },
+ };
setInjectedVarFunc(injectedVar => {
switch (injectedVar) {
- case 'mapConfig':
- return {
- emsFileApiUrl: '',
- emsTileApiUrl: '',
- emsLandingPageUrl: '',
- };
- case 'tilemapsConfig':
- return {
- deprecated: {
- config: {
- options: {
- attribution: '123',
- },
- },
- },
- };
case 'version':
return '123';
default:
@@ -125,7 +123,7 @@ describe('CoordinateMapsVisualizationTest', function() {
getInjectedVar: () => {},
},
};
- const serviceSettings = new ServiceSettings();
+ const serviceSettings = new ServiceSettings(mapConfig, tilemapsConfig);
const BaseMapsVisualization = getBaseMapsVis(coreSetupMock, serviceSettings);
const uiSettings = $injector.get('config');
diff --git a/src/legacy/core_plugins/tile_map/public/__tests__/dummy_es_response.json b/src/plugins/tile_map/public/__tests__/dummy_es_response.json
similarity index 100%
rename from src/legacy/core_plugins/tile_map/public/__tests__/dummy_es_response.json
rename to src/plugins/tile_map/public/__tests__/dummy_es_response.json
diff --git a/src/legacy/core_plugins/tile_map/public/__tests__/geohash_layer.js b/src/plugins/tile_map/public/__tests__/geohash_layer.js
similarity index 96%
rename from src/legacy/core_plugins/tile_map/public/__tests__/geohash_layer.js
rename to src/plugins/tile_map/public/__tests__/geohash_layer.js
index bdf9cd806eb8b..a288e78ef00c1 100644
--- a/src/legacy/core_plugins/tile_map/public/__tests__/geohash_layer.js
+++ b/src/plugins/tile_map/public/__tests__/geohash_layer.js
@@ -20,12 +20,12 @@
import expect from '@kbn/expect';
import { GeohashLayer } from '../geohash_layer';
// import heatmapPng from './heatmap.png';
-import scaledCircleMarkersPng from './scaledCircleMarkers.png';
+import scaledCircleMarkersPng from './scaled_circle_markers.png';
// import shadedCircleMarkersPng from './shadedCircleMarkers.png';
import { ImageComparator } from 'test_utils/image_comparator';
import GeoHashSampleData from './dummy_es_response.json';
// eslint-disable-next-line @kbn/eslint/no-restricted-paths
-import { KibanaMap } from '../../../../../plugins/maps_legacy/public/map/kibana_map';
+import { KibanaMap } from '../../../maps_legacy/public/map/kibana_map';
describe('geohash_layer', function() {
let domNode;
diff --git a/src/legacy/core_plugins/tile_map/public/__tests__/heatmap.png b/src/plugins/tile_map/public/__tests__/heatmap.png
similarity index 100%
rename from src/legacy/core_plugins/tile_map/public/__tests__/heatmap.png
rename to src/plugins/tile_map/public/__tests__/heatmap.png
diff --git a/src/legacy/core_plugins/tile_map/public/__tests__/heatmap_raw.png b/src/plugins/tile_map/public/__tests__/heatmap_raw.png
similarity index 100%
rename from src/legacy/core_plugins/tile_map/public/__tests__/heatmap_raw.png
rename to src/plugins/tile_map/public/__tests__/heatmap_raw.png
diff --git a/src/legacy/core_plugins/tile_map/public/__tests__/initial.png b/src/plugins/tile_map/public/__tests__/initial.png
similarity index 100%
rename from src/legacy/core_plugins/tile_map/public/__tests__/initial.png
rename to src/plugins/tile_map/public/__tests__/initial.png
diff --git a/src/legacy/core_plugins/tile_map/public/__tests__/scaledCircleMarkers.png b/src/plugins/tile_map/public/__tests__/scaled_circle_markers.png
similarity index 100%
rename from src/legacy/core_plugins/tile_map/public/__tests__/scaledCircleMarkers.png
rename to src/plugins/tile_map/public/__tests__/scaled_circle_markers.png
diff --git a/src/legacy/core_plugins/tile_map/public/__tests__/shadedCircleMarkers.png b/src/plugins/tile_map/public/__tests__/shaded_circle_markers.png
similarity index 100%
rename from src/legacy/core_plugins/tile_map/public/__tests__/shadedCircleMarkers.png
rename to src/plugins/tile_map/public/__tests__/shaded_circle_markers.png
diff --git a/src/legacy/core_plugins/tile_map/public/__tests__/shadedGeohashGrid.png b/src/plugins/tile_map/public/__tests__/shaded_geohash_grid.png
similarity index 100%
rename from src/legacy/core_plugins/tile_map/public/__tests__/shadedGeohashGrid.png
rename to src/plugins/tile_map/public/__tests__/shaded_geohash_grid.png
diff --git a/src/legacy/core_plugins/tile_map/public/_tile_map.scss b/src/plugins/tile_map/public/_tile_map.scss
similarity index 100%
rename from src/legacy/core_plugins/tile_map/public/_tile_map.scss
rename to src/plugins/tile_map/public/_tile_map.scss
diff --git a/src/legacy/core_plugins/tile_map/public/components/tile_map_options.tsx b/src/plugins/tile_map/public/components/tile_map_options.tsx
similarity index 95%
rename from src/legacy/core_plugins/tile_map/public/components/tile_map_options.tsx
rename to src/plugins/tile_map/public/components/tile_map_options.tsx
index 1efb0b2f884f8..f7fb4daff63f0 100644
--- a/src/legacy/core_plugins/tile_map/public/components/tile_map_options.tsx
+++ b/src/plugins/tile_map/public/components/tile_map_options.tsx
@@ -22,13 +22,8 @@ import { EuiPanel, EuiSpacer } from '@elastic/eui';
import { i18n } from '@kbn/i18n';
import { VisOptionsProps } from 'src/plugins/vis_default_editor/public';
-import {
- BasicOptions,
- RangeOption,
- SelectOption,
- SwitchOption,
-} from '../../../../../plugins/charts/public';
-import { WmsOptions, TileMapVisParams, MapTypes } from '../../../../../plugins/maps_legacy/public';
+import { BasicOptions, RangeOption, SelectOption, SwitchOption } from '../../../charts/public';
+import { WmsOptions, TileMapVisParams, MapTypes } from '../../../maps_legacy/public';
export type TileMapOptionsProps = VisOptionsProps;
diff --git a/src/legacy/core_plugins/tile_map/public/css_filters.js b/src/plugins/tile_map/public/css_filters.js
similarity index 100%
rename from src/legacy/core_plugins/tile_map/public/css_filters.js
rename to src/plugins/tile_map/public/css_filters.js
diff --git a/src/legacy/core_plugins/tile_map/public/geohash_layer.js b/src/plugins/tile_map/public/geohash_layer.js
similarity index 98%
rename from src/legacy/core_plugins/tile_map/public/geohash_layer.js
rename to src/plugins/tile_map/public/geohash_layer.js
index f0261483d302d..dbe64871265b1 100644
--- a/src/legacy/core_plugins/tile_map/public/geohash_layer.js
+++ b/src/plugins/tile_map/public/geohash_layer.js
@@ -17,10 +17,9 @@
* under the License.
*/
-import L from 'leaflet';
import { min, isEqual } from 'lodash';
import { i18n } from '@kbn/i18n';
-import { KibanaMapLayer, MapTypes } from '../../../../plugins/maps_legacy/public';
+import { L, KibanaMapLayer, MapTypes } from '../../maps_legacy/public';
import { HeatmapMarkers } from './markers/heatmap';
import { ScaledCirclesMarkers } from './markers/scaled_circles';
import { ShadedCirclesMarkers } from './markers/shaded_circles';
diff --git a/src/legacy/core_plugins/tile_map/public/index.scss b/src/plugins/tile_map/public/index.scss
similarity index 90%
rename from src/legacy/core_plugins/tile_map/public/index.scss
rename to src/plugins/tile_map/public/index.scss
index 767a71225a7d8..4ce500b2da4d2 100644
--- a/src/legacy/core_plugins/tile_map/public/index.scss
+++ b/src/plugins/tile_map/public/index.scss
@@ -7,4 +7,4 @@
// tlmChart__legend--small
// tlmChart__legend-isLoading
-@import './tile_map';
+@import 'tile_map';
diff --git a/src/legacy/core_plugins/tile_map/public/index.ts b/src/plugins/tile_map/public/index.ts
similarity index 93%
rename from src/legacy/core_plugins/tile_map/public/index.ts
rename to src/plugins/tile_map/public/index.ts
index 3d0d970e4dc20..d2b9a15a6ad3c 100644
--- a/src/legacy/core_plugins/tile_map/public/index.ts
+++ b/src/plugins/tile_map/public/index.ts
@@ -17,7 +17,7 @@
* under the License.
*/
-import { PluginInitializerContext } from '../../../../core/public';
+import { PluginInitializerContext } from 'kibana/public';
import { TileMapPlugin as Plugin } from './plugin';
export function plugin(initializerContext: PluginInitializerContext) {
diff --git a/src/legacy/core_plugins/tile_map/public/markers/geohash_grid.js b/src/plugins/tile_map/public/markers/geohash_grid.js
similarity index 96%
rename from src/legacy/core_plugins/tile_map/public/markers/geohash_grid.js
rename to src/plugins/tile_map/public/markers/geohash_grid.js
index 406a50ccde966..0150f6d2c54c9 100644
--- a/src/legacy/core_plugins/tile_map/public/markers/geohash_grid.js
+++ b/src/plugins/tile_map/public/markers/geohash_grid.js
@@ -17,8 +17,8 @@
* under the License.
*/
-import L from 'leaflet';
import { ScaledCirclesMarkers } from './scaled_circles';
+import { L } from '../../../maps_legacy/public';
export class GeohashGridMarkers extends ScaledCirclesMarkers {
getMarkerFunction() {
diff --git a/src/legacy/core_plugins/tile_map/public/markers/heatmap.js b/src/plugins/tile_map/public/markers/heatmap.js
similarity index 98%
rename from src/legacy/core_plugins/tile_map/public/markers/heatmap.js
rename to src/plugins/tile_map/public/markers/heatmap.js
index 0ae26bfcf032b..ed9dbccbfbcde 100644
--- a/src/legacy/core_plugins/tile_map/public/markers/heatmap.js
+++ b/src/plugins/tile_map/public/markers/heatmap.js
@@ -17,10 +17,10 @@
* under the License.
*/
-import L from 'leaflet';
import _ from 'lodash';
import d3 from 'd3';
import { EventEmitter } from 'events';
+import { L } from '../../../maps_legacy/public';
/**
* Map overlay: canvas layer with leaflet.heat plugin
@@ -34,7 +34,7 @@ export class HeatmapMarkers extends EventEmitter {
super();
this._geojsonFeatureCollection = featureCollection;
const points = dataToHeatArray(featureCollection, max);
- this._leafletLayer = L.heatLayer(points, options);
+ this._leafletLayer = new L.HeatLayer(points, options);
this._tooltipFormatter = options.tooltipFormatter;
this._zoom = zoom;
this._disableTooltips = false;
diff --git a/src/legacy/core_plugins/tile_map/public/markers/scaled_circles.js b/src/plugins/tile_map/public/markers/scaled_circles.js
similarity index 97%
rename from src/legacy/core_plugins/tile_map/public/markers/scaled_circles.js
rename to src/plugins/tile_map/public/markers/scaled_circles.js
index f39de6ca7d179..028d3de515ae7 100644
--- a/src/legacy/core_plugins/tile_map/public/markers/scaled_circles.js
+++ b/src/plugins/tile_map/public/markers/scaled_circles.js
@@ -17,13 +17,12 @@
* under the License.
*/
-import L from 'leaflet';
import _ from 'lodash';
import d3 from 'd3';
import $ from 'jquery';
import { EventEmitter } from 'events';
-import { colorUtil } from '../../../../../plugins/maps_legacy/public';
-import { truncatedColorMaps } from '../../../../../plugins/charts/public';
+import { L, colorUtil } from '../../../maps_legacy/public';
+import { truncatedColorMaps } from '../../../charts/public';
export class ScaledCirclesMarkers extends EventEmitter {
constructor(
diff --git a/src/legacy/core_plugins/tile_map/public/markers/shaded_circles.js b/src/plugins/tile_map/public/markers/shaded_circles.js
similarity index 97%
rename from src/legacy/core_plugins/tile_map/public/markers/shaded_circles.js
rename to src/plugins/tile_map/public/markers/shaded_circles.js
index e21d753f7001a..745d0422856c6 100644
--- a/src/legacy/core_plugins/tile_map/public/markers/shaded_circles.js
+++ b/src/plugins/tile_map/public/markers/shaded_circles.js
@@ -17,9 +17,9 @@
* under the License.
*/
-import L from 'leaflet';
import _ from 'lodash';
import { ScaledCirclesMarkers } from './scaled_circles';
+import { L } from '../../../maps_legacy/public';
export class ShadedCirclesMarkers extends ScaledCirclesMarkers {
getMarkerFunction() {
diff --git a/src/legacy/core_plugins/tile_map/public/plugin.ts b/src/plugins/tile_map/public/plugin.ts
similarity index 68%
rename from src/legacy/core_plugins/tile_map/public/plugin.ts
rename to src/plugins/tile_map/public/plugin.ts
index aa1460a7e2890..e55f7189929df 100644
--- a/src/legacy/core_plugins/tile_map/public/plugin.ts
+++ b/src/plugins/tile_map/public/plugin.ts
@@ -22,9 +22,9 @@ import {
Plugin,
PluginInitializerContext,
IUiSettingsClient,
-} from '../../../../core/public';
-import { Plugin as ExpressionsPublicPlugin } from '../../../../plugins/expressions/public';
-import { VisualizationsSetup } from '../../../../plugins/visualizations/public';
+} from 'kibana/public';
+import { Plugin as ExpressionsPublicPlugin } from '../../expressions/public';
+import { VisualizationsSetup } from '../../visualizations/public';
// TODO: Determine why visualizations don't populate without this
import 'angular-sanitize';
@@ -32,7 +32,13 @@ import 'angular-sanitize';
import { createTileMapFn } from './tile_map_fn';
// @ts-ignore
import { createTileMapTypeDefinition } from './tile_map_type';
-import { getBaseMapsVis, MapsLegacyPluginSetup } from '../../../../plugins/maps_legacy/public';
+import { getBaseMapsVis, MapsLegacyPluginSetup } from '../../maps_legacy/public';
+import { DataPublicPluginStart } from '../../data/public';
+import { setFormatService, setQueryService } from './services';
+
+export interface TileMapConfigType {
+ tilemap: any;
+}
/** @private */
interface TileMapVisualizationDependencies {
@@ -50,7 +56,18 @@ export interface TileMapPluginSetupDependencies {
}
/** @internal */
-export class TileMapPlugin implements Plugin, void> {
+export interface TileMapPluginStartDependencies {
+ data: DataPublicPluginStart;
+}
+
+export interface TileMapPluginSetup {
+ config: any;
+}
+// eslint-disable-next-line @typescript-eslint/no-empty-interface
+export interface TileMapPluginStart {}
+
+/** @internal */
+export class TileMapPlugin implements Plugin {
initializerContext: PluginInitializerContext;
constructor(initializerContext: PluginInitializerContext) {
@@ -72,9 +89,16 @@ export class TileMapPlugin implements Plugin, void> {
expressions.registerFunction(() => createTileMapFn(visualizationDependencies));
visualizations.createBaseVisualization(createTileMapTypeDefinition(visualizationDependencies));
+
+ const config = this.initializerContext.config.get();
+ return {
+ config,
+ };
}
- public start(core: CoreStart) {
- // nothing to do here yet
+ public start(core: CoreStart, { data }: TileMapPluginStartDependencies) {
+ setFormatService(data.fieldFormats);
+ setQueryService(data.query);
+ return {};
}
}
diff --git a/test/plugin_functional/plugins/core_provider_plugin/index.ts b/src/plugins/tile_map/public/services.ts
similarity index 62%
rename from test/plugin_functional/plugins/core_provider_plugin/index.ts
rename to src/plugins/tile_map/public/services.ts
index 01f3a67c6b554..fd075a041ac9b 100644
--- a/test/plugin_functional/plugins/core_provider_plugin/index.ts
+++ b/src/plugins/tile_map/public/services.ts
@@ -17,20 +17,13 @@
* under the License.
*/
-import { resolve } from 'path';
-import { Legacy } from '../../../../kibana';
+import { createGetterSetter } from '../../kibana_utils/public';
+import { DataPublicPluginStart } from '../../data/public';
-// eslint-disable-next-line import/no-default-export
-export default function CoreProviderPlugin(kibana: any) {
- const config: Legacy.PluginSpecOptions = {
- id: 'core-provider',
- require: [],
- publicDir: resolve(__dirname, 'public'),
- init: (server: Legacy.Server) => ({}),
- uiExports: {
- hacks: [resolve(__dirname, 'public/index')],
- },
- };
+export const [getFormatService, setFormatService] = createGetterSetter<
+ DataPublicPluginStart['fieldFormats']
+>('vislib data.fieldFormats');
- return new kibana.Plugin(config);
-}
+export const [getQueryService, setQueryService] = createGetterSetter<
+ DataPublicPluginStart['query']
+>('Query');
diff --git a/src/legacy/core_plugins/tile_map/public/tile_map_fn.js b/src/plugins/tile_map/public/tile_map_fn.js
similarity index 95%
rename from src/legacy/core_plugins/tile_map/public/tile_map_fn.js
rename to src/plugins/tile_map/public/tile_map_fn.js
index 5ad4a2c33db25..5f43077bcb24b 100644
--- a/src/legacy/core_plugins/tile_map/public/tile_map_fn.js
+++ b/src/plugins/tile_map/public/tile_map_fn.js
@@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
-import { convertToGeoJson } from '../../../../plugins/maps_legacy/public';
+import { convertToGeoJson } from '../../maps_legacy/public';
import { i18n } from '@kbn/i18n';
export const createTileMapFn = () => ({
diff --git a/src/legacy/core_plugins/tile_map/public/tile_map_type.js b/src/plugins/tile_map/public/tile_map_type.js
similarity index 95%
rename from src/legacy/core_plugins/tile_map/public/tile_map_type.js
rename to src/plugins/tile_map/public/tile_map_type.js
index ca6a586d22008..aa0160f3f5a9d 100644
--- a/src/legacy/core_plugins/tile_map/public/tile_map_type.js
+++ b/src/plugins/tile_map/public/tile_map_type.js
@@ -19,12 +19,12 @@
import React from 'react';
import { i18n } from '@kbn/i18n';
-import { convertToGeoJson, MapTypes } from '../../../../plugins/maps_legacy/public';
-import { Schemas } from '../../../../plugins/vis_default_editor/public';
+import { convertToGeoJson, MapTypes } from '../../maps_legacy/public';
+import { Schemas } from '../../vis_default_editor/public';
import { createTileMapVisualization } from './tile_map_visualization';
import { TileMapOptions } from './components/tile_map_options';
import { supportsCssFilters } from './css_filters';
-import { truncatedColorSchemas } from '../../../../plugins/charts/public';
+import { truncatedColorSchemas } from '../../charts/public';
export function createTileMapTypeDefinition(dependencies) {
const CoordinateMapsVisualization = createTileMapVisualization(dependencies);
diff --git a/src/legacy/core_plugins/tile_map/public/tile_map_visualization.js b/src/plugins/tile_map/public/tile_map_visualization.js
similarity index 95%
rename from src/legacy/core_plugins/tile_map/public/tile_map_visualization.js
rename to src/plugins/tile_map/public/tile_map_visualization.js
index 6a7bda5e18883..f96c7291b34cf 100644
--- a/src/legacy/core_plugins/tile_map/public/tile_map_visualization.js
+++ b/src/plugins/tile_map/public/tile_map_visualization.js
@@ -19,13 +19,8 @@
import { get } from 'lodash';
import { GeohashLayer } from './geohash_layer';
-import { npStart } from 'ui/new_platform';
-import { getFormat } from '../../../ui/public/visualize/loader/pipeline_helpers/utilities';
-import {
- scaleBounds,
- geoContains,
- mapTooltipProvider,
-} from '../../../../plugins/maps_legacy/public';
+import { getFormatService, getQueryService } from './services';
+import { scaleBounds, geoContains, mapTooltipProvider } from '../../maps_legacy/public';
import { tooltipFormatter } from './tooltip_formatter';
export const createTileMapVisualization = dependencies => {
@@ -183,7 +178,9 @@ export const createTileMapVisualization = dependencies => {
const newParams = this._getMapsParams();
const metricDimension = this._params.dimensions.metric;
const metricLabel = metricDimension ? metricDimension.label : '';
- const metricFormat = getFormat(metricDimension && metricDimension.format);
+ const metricFormat = getFormatService().deserialize(
+ metricDimension && metricDimension.format
+ );
return {
label: metricLabel,
@@ -213,7 +210,7 @@ export const createTileMapVisualization = dependencies => {
filter[filterName] = { ignore_unmapped: true };
filter[filterName][field] = filterData;
- const { filterManager } = npStart.plugins.data.query;
+ const { filterManager } = getQueryService();
filterManager.addFilters([filter]);
this.vis.updateState();
diff --git a/src/legacy/core_plugins/tile_map/public/tilemap_fn.test.js b/src/plugins/tile_map/public/tilemap_fn.test.js
similarity index 90%
rename from src/legacy/core_plugins/tile_map/public/tilemap_fn.test.js
rename to src/plugins/tile_map/public/tilemap_fn.test.js
index 6da37f4c5ef86..8fa12c9f9dbbe 100644
--- a/src/legacy/core_plugins/tile_map/public/tilemap_fn.test.js
+++ b/src/plugins/tile_map/public/tilemap_fn.test.js
@@ -18,11 +18,10 @@
*/
// eslint-disable-next-line
-import { functionWrapper } from '../../../../plugins/expressions/common/expression_functions/specs/tests/utils';
+import { functionWrapper } from '../../expressions/common/expression_functions/specs/tests/utils';
import { createTileMapFn } from './tile_map_fn';
-jest.mock('ui/new_platform');
-jest.mock('../../../../plugins/maps_legacy/public', () => ({
+jest.mock('../../maps_legacy/public', () => ({
convertToGeoJson: jest.fn().mockReturnValue({
featureCollection: {
type: 'FeatureCollection',
@@ -37,7 +36,7 @@ jest.mock('../../../../plugins/maps_legacy/public', () => ({
}),
}));
-import { convertToGeoJson } from '../../../../plugins/maps_legacy/public';
+import { convertToGeoJson } from '../../maps_legacy/public';
describe('interpreter/functions#tilemap', () => {
const fn = functionWrapper(createTileMapFn());
diff --git a/src/legacy/core_plugins/tile_map/public/tooltip_formatter.js b/src/plugins/tile_map/public/tooltip_formatter.js
similarity index 100%
rename from src/legacy/core_plugins/tile_map/public/tooltip_formatter.js
rename to src/plugins/tile_map/public/tooltip_formatter.js
diff --git a/test/interpreter_functional/plugins/kbn_tp_run_pipeline/public/np_ready/index.ts b/src/plugins/tile_map/server/index.ts
similarity index 70%
rename from test/interpreter_functional/plugins/kbn_tp_run_pipeline/public/np_ready/index.ts
rename to src/plugins/tile_map/server/index.ts
index d7a764b581c01..3381553fe9364 100644
--- a/test/interpreter_functional/plugins/kbn_tp_run_pipeline/public/np_ready/index.ts
+++ b/src/plugins/tile_map/server/index.ts
@@ -17,12 +17,19 @@
* under the License.
*/
-import { PluginInitializer, PluginInitializerContext } from 'src/core/public';
-import { Plugin, StartDeps } from './plugin';
-export { StartDeps };
+import { PluginConfigDescriptor } from 'kibana/server';
+import { configSchema, ConfigSchema } from '../config';
-export const plugin: PluginInitializer = (
- initializerContext: PluginInitializerContext
-) => {
- return new Plugin(initializerContext);
+export const config: PluginConfigDescriptor = {
+ exposeToBrowser: {
+ url: true,
+ deprecated: true,
+ options: true,
+ },
+ schema: configSchema,
};
+
+export const plugin = () => ({
+ setup() {},
+ start() {},
+});
diff --git a/src/plugins/vis_type_vega/public/plugin.ts b/src/plugins/vis_type_vega/public/plugin.ts
index b52dcfbd914f9..1bce7ac92e564 100644
--- a/src/plugins/vis_type_vega/public/plugin.ts
+++ b/src/plugins/vis_type_vega/public/plugin.ts
@@ -27,6 +27,7 @@ import {
setInjectedVars,
setUISettings,
setKibanaMapFactory,
+ setMapsLegacyConfig,
} from './services';
import { createVegaFn } from './vega_fn';
@@ -76,6 +77,7 @@ export class VegaPlugin implements Plugin, void> {
});
setUISettings(core.uiSettings);
setKibanaMapFactory(getKibanaMapFactoryProvider(core));
+ setMapsLegacyConfig(mapsLegacy.config);
const visualizationDependencies: Readonly = {
core,
diff --git a/src/plugins/vis_type_vega/public/services.ts b/src/plugins/vis_type_vega/public/services.ts
index f81f87d7ad2e1..f2fddb41cf72b 100644
--- a/src/plugins/vis_type_vega/public/services.ts
+++ b/src/plugins/vis_type_vega/public/services.ts
@@ -21,6 +21,7 @@ import { SavedObjectsStart } from 'kibana/public';
import { NotificationsStart, IUiSettingsClient } from 'src/core/public';
import { DataPublicPluginStart } from '../../data/public';
import { createGetterSetter } from '../../kibana_utils/public';
+import { MapsLegacyConfigType } from '../../maps_legacy/public';
export const [getData, setData] = createGetterSetter('Data');
@@ -43,6 +44,10 @@ export const [getInjectedVars, setInjectedVars] = createGetterSetter<{
emsTileLayerId: unknown;
}>('InjectedVars');
+export const [getMapsLegacyConfig, setMapsLegacyConfig] = createGetterSetter(
+ 'MapsLegacyConfig'
+);
+
export const getEsShardTimeout = () => getInjectedVars().esShardTimeout;
export const getEnableExternalUrls = () => getInjectedVars().enableExternalUrls;
-export const getEmsTileLayerId = () => getInjectedVars().emsTileLayerId;
+export const getEmsTileLayerId = () => getMapsLegacyConfig().emsTileLayerId;
diff --git a/src/plugins/vis_type_vega/public/vega_view/vega_map_layer.js b/src/plugins/vis_type_vega/public/vega_view/vega_map_layer.js
index 8e4009eab8488..bc1cb4e4734c7 100644
--- a/src/plugins/vis_type_vega/public/vega_view/vega_map_layer.js
+++ b/src/plugins/vis_type_vega/public/vega_view/vega_map_layer.js
@@ -17,9 +17,7 @@
* under the License.
*/
-import L from 'leaflet';
-import 'leaflet-vega';
-import { KibanaMapLayer } from '../../../maps_legacy/public';
+import { KibanaMapLayer, L } from '../../../maps_legacy/public';
export class VegaMapLayer extends KibanaMapLayer {
constructor(spec, options) {
@@ -28,7 +26,6 @@ export class VegaMapLayer extends KibanaMapLayer {
// Used by super.getAttributions()
this._attribution = options.attribution;
delete options.attribution;
-
this._leafletLayer = L.vega(spec, options);
}
diff --git a/src/plugins/vis_type_vega/public/vega_view/vega_map_view.js b/src/plugins/vis_type_vega/public/vega_view/vega_map_view.js
index 895d496a896aa..4cd3eea503cb0 100644
--- a/src/plugins/vis_type_vega/public/vega_view/vega_map_view.js
+++ b/src/plugins/vis_type_vega/public/vega_view/vega_map_view.js
@@ -102,6 +102,7 @@ export class VegaMapView extends VegaBaseView {
// let maxBounds = null;
// if (mapConfig.maxBounds) {
// const b = mapConfig.maxBounds;
+ // eslint-disable-next-line no-undef
// maxBounds = L.latLngBounds(L.latLng(b[1], b[0]), L.latLng(b[3], b[2]));
// }
diff --git a/test/functional/apps/timelion/index.js b/test/functional/apps/timelion/index.js
index 3b5167addf4e6..021fa24397850 100644
--- a/test/functional/apps/timelion/index.js
+++ b/test/functional/apps/timelion/index.js
@@ -28,7 +28,7 @@ export default function({ getService, loadTestFile }) {
before(async function() {
log.debug('Starting timelion before method');
- browser.setWindowSize(1280, 800);
+ await browser.setWindowSize(1280, 800);
await esArchiver.loadIfNeeded('logstash_functional');
await kibanaServer.uiSettings.replace({ defaultIndex: 'logstash-*' });
});
diff --git a/test/functional/page_objects/settings_page.ts b/test/functional/page_objects/settings_page.ts
index 81d22838d1e8b..b7a6e10efd7dc 100644
--- a/test/functional/page_objects/settings_page.ts
+++ b/test/functional/page_objects/settings_page.ts
@@ -33,7 +33,7 @@ export function SettingsPageProvider({ getService, getPageObjects }: FtrProvider
class SettingsPage {
async clickNavigation() {
- find.clickDisplayedByCssSelector('.app-link:nth-child(5) a');
+ await find.clickDisplayedByCssSelector('.app-link:nth-child(5) a');
}
async clickLinkText(text: string) {
@@ -110,7 +110,7 @@ export function SettingsPageProvider({ getService, getPageObjects }: FtrProvider
}
async toggleAdvancedSettingCheckbox(propertyName: string) {
- testSubjects.click(`advancedSetting-editField-${propertyName}`);
+ await testSubjects.click(`advancedSetting-editField-${propertyName}`);
await PageObjects.header.waitUntilLoadingHasFinished();
await testSubjects.click(`advancedSetting-saveButton`);
await PageObjects.header.waitUntilLoadingHasFinished();
diff --git a/test/functional/services/find.ts b/test/functional/services/find.ts
index 312668b718dc0..bdcc5ba95e9fb 100644
--- a/test/functional/services/find.ts
+++ b/test/functional/services/find.ts
@@ -476,7 +476,7 @@ export async function FindProvider({ getService }: FtrProviderContext) {
value: string
): Promise {
log.debug(`Find.waitForAttributeToChange('${selector}', '${attribute}', '${value}')`);
- retry.waitFor(`${attribute} to equal "${value}"`, async () => {
+ await retry.waitFor(`${attribute} to equal "${value}"`, async () => {
const el = await this.byCssSelector(selector);
return value === (await el.getAttribute(attribute));
});
diff --git a/test/functional/services/remote/webdriver.ts b/test/functional/services/remote/webdriver.ts
index 1b7ef2c1855d0..df79db50b8683 100644
--- a/test/functional/services/remote/webdriver.ts
+++ b/test/functional/services/remote/webdriver.ts
@@ -17,7 +17,8 @@
* under the License.
*/
-import { delimiter } from 'path';
+import { delimiter, resolve } from 'path';
+import Fs from 'fs';
import * as Rx from 'rxjs';
import { mergeMap, map, takeUntil } from 'rxjs/operators';
@@ -37,6 +38,7 @@ import { Executor } from 'selenium-webdriver/lib/http';
import { getLogger } from 'selenium-webdriver/lib/logging';
import { installDriver } from 'ms-chromium-edge-driver';
+import { REPO_ROOT } from '@kbn/dev-utils';
import { pollForLogEntry$ } from './poll_for_log_entry';
import { createStdoutSocket } from './create_stdout_stream';
import { preventParallelCalls } from './prevent_parallel_calls';
@@ -50,6 +52,13 @@ const certValidation: string = process.env.NODE_TLS_REJECT_UNAUTHORIZED as strin
const SECOND = 1000;
const MINUTE = 60 * SECOND;
const NO_QUEUE_COMMANDS = ['getLog', 'getStatus', 'newSession', 'quit'];
+const downloadDir = resolve(REPO_ROOT, 'target/functional-tests/downloads');
+const chromiumDownloadPrefs = {
+ prefs: {
+ 'download.default_directory': downloadDir,
+ 'download.prompt_for_download': false,
+ },
+};
/**
* Best we can tell WebDriver locks up sometimes when we send too many
@@ -112,6 +121,7 @@ async function attemptToCreateCommand(
chromeCapabilities.set('goog:chromeOptions', {
w3c: true,
args: chromeOptions,
+ ...chromiumDownloadPrefs,
});
chromeCapabilities.set('unexpectedAlertBehaviour', 'accept');
chromeCapabilities.set('goog:loggingPrefs', { browser: 'ALL' });
@@ -150,6 +160,10 @@ async function attemptToCreateCommand(
edgeOptions.setEdgeChromium(true);
// @ts-ignore internal modules are not typed
edgeOptions.setBinaryPath(edgePaths.browserPath);
+ const options = edgeOptions.get('ms:edgeOptions');
+ // overriding options to include preferences
+ Object.assign(options, chromiumDownloadPrefs);
+ edgeOptions.set('ms:edgeOptions', options);
const session = await new Builder()
.forBrowser('MicrosoftEdge')
.setEdgeOptions(edgeOptions)
@@ -185,6 +199,14 @@ async function attemptToCreateCommand(
firefoxOptions.set('moz:firefoxOptions', {
prefs: { 'devtools.console.stdout.content': true },
});
+ firefoxOptions.setPreference('browser.download.folderList', 2);
+ firefoxOptions.setPreference('browser.download.manager.showWhenStarting', false);
+ firefoxOptions.setPreference('browser.download.dir', downloadDir);
+ firefoxOptions.setPreference(
+ 'browser.helperApps.neverAsk.saveToDisk',
+ 'application/comma-separated-values, text/csv, text/plain'
+ );
+
if (headlessBrowser === '1') {
// See: https://developer.mozilla.org/en-US/docs/Mozilla/Firefox/Headless_mode
firefoxOptions.headless();
@@ -308,6 +330,9 @@ export async function initWebDriver(
log.verbose(entry.message);
});
+ // create browser download folder
+ Fs.mkdirSync(downloadDir, { recursive: true });
+
// download Edge driver only in case of usage
if (browserType === Browsers.ChromiumEdge) {
edgePaths = await installDriver();
diff --git a/test/interpreter_functional/config.ts b/test/interpreter_functional/config.ts
index 0fe7df4d50715..d3cfcea9823e9 100644
--- a/test/interpreter_functional/config.ts
+++ b/test/interpreter_functional/config.ts
@@ -50,6 +50,9 @@ export default async function({ readConfigFile }: FtrConfigProviderContext) {
...functionalConfig.get('kbnTestServer'),
serverArgs: [
...functionalConfig.get('kbnTestServer.serverArgs'),
+
+ // Required to load new platform plugins via `--plugin-path` flag.
+ '--env.name=development',
...plugins.map(
pluginDir => `--plugin-path=${path.resolve(__dirname, 'plugins', pluginDir)}`
),
diff --git a/test/interpreter_functional/plugins/kbn_tp_run_pipeline/index.ts b/test/interpreter_functional/plugins/kbn_tp_run_pipeline/index.ts
deleted file mode 100644
index 1d5564ec06e4e..0000000000000
--- a/test/interpreter_functional/plugins/kbn_tp_run_pipeline/index.ts
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * Licensed to Elasticsearch B.V. under one or more contributor
- * license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright
- * ownership. Elasticsearch B.V. licenses this file to you under
- * the Apache License, Version 2.0 (the "License"); you may
- * not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-import { Legacy } from 'kibana';
-import {
- ArrayOrItem,
- LegacyPluginApi,
- LegacyPluginSpec,
- LegacyPluginOptions,
-} from 'src/legacy/plugin_discovery/types';
-
-// eslint-disable-next-line import/no-default-export
-export default function(kibana: LegacyPluginApi): ArrayOrItem {
- const pluginSpec: Partial = {
- id: 'kbn_tp_run_pipeline',
- uiExports: {
- app: {
- title: 'Run Pipeline',
- description: 'This is a sample plugin to test running pipeline expressions',
- main: 'plugins/kbn_tp_run_pipeline/legacy',
- },
- },
-
- init(server: Legacy.Server) {
- // The following lines copy over some configuration variables from Kibana
- // to this plugin. This will be needed when embedding visualizations, so that e.g.
- // region map is able to get its configuration.
- server.injectUiAppVars('kbn_tp_run_pipeline', async () => {
- return server.getInjectedUiAppVars('kibana');
- });
- },
- };
- return new kibana.Plugin(pluginSpec);
-}
diff --git a/test/interpreter_functional/plugins/kbn_tp_run_pipeline/kibana.json b/test/interpreter_functional/plugins/kbn_tp_run_pipeline/kibana.json
new file mode 100644
index 0000000000000..f0c1c3a34fbc0
--- /dev/null
+++ b/test/interpreter_functional/plugins/kbn_tp_run_pipeline/kibana.json
@@ -0,0 +1,13 @@
+{
+ "id": "kbn_tp_run_pipeline",
+ "version": "0.0.1",
+ "kibanaVersion": "kibana",
+ "requiredPlugins": [
+ "data",
+ "savedObjects",
+ "kibanaUtils",
+ "expressions"
+ ],
+ "server": false,
+ "ui": true
+}
diff --git a/test/interpreter_functional/plugins/kbn_tp_run_pipeline/package.json b/test/interpreter_functional/plugins/kbn_tp_run_pipeline/package.json
index 338e85038922d..ebc74be937ef0 100644
--- a/test/interpreter_functional/plugins/kbn_tp_run_pipeline/package.json
+++ b/test/interpreter_functional/plugins/kbn_tp_run_pipeline/package.json
@@ -1,6 +1,7 @@
{
"name": "kbn_tp_run_pipeline",
"version": "1.0.0",
+ "main": "target/test/interpreter_functional/plugins/kbn_tp_run_pipeline",
"kibana": {
"version": "kibana",
"templateVersion": "1.0.0"
@@ -10,5 +11,13 @@
"@elastic/eui": "22.3.1",
"react": "^16.12.0",
"react-dom": "^16.12.0"
+ },
+ "scripts": {
+ "kbn": "node ../../../../scripts/kbn.js",
+ "build": "rm -rf './target' && tsc"
+ },
+ "devDependencies": {
+ "@kbn/plugin-helpers": "9.0.2",
+ "typescript": "3.7.2"
}
}
diff --git a/test/interpreter_functional/plugins/kbn_tp_run_pipeline/public/np_ready/app/app.tsx b/test/interpreter_functional/plugins/kbn_tp_run_pipeline/public/app/app.tsx
similarity index 100%
rename from test/interpreter_functional/plugins/kbn_tp_run_pipeline/public/np_ready/app/app.tsx
rename to test/interpreter_functional/plugins/kbn_tp_run_pipeline/public/app/app.tsx
diff --git a/test/interpreter_functional/plugins/kbn_tp_run_pipeline/public/np_ready/app/components/main.tsx b/test/interpreter_functional/plugins/kbn_tp_run_pipeline/public/app/components/main.tsx
similarity index 99%
rename from test/interpreter_functional/plugins/kbn_tp_run_pipeline/public/np_ready/app/components/main.tsx
rename to test/interpreter_functional/plugins/kbn_tp_run_pipeline/public/app/components/main.tsx
index a50248a5b6fa3..ace2af2b4f0cf 100644
--- a/test/interpreter_functional/plugins/kbn_tp_run_pipeline/public/np_ready/app/components/main.tsx
+++ b/test/interpreter_functional/plugins/kbn_tp_run_pipeline/public/app/components/main.tsx
@@ -21,7 +21,7 @@ import React from 'react';
import { EuiPage, EuiPageBody, EuiPageContent, EuiPageContentHeader } from '@elastic/eui';
import { first } from 'rxjs/operators';
import { IInterpreterRenderHandlers, ExpressionValue } from 'src/plugins/expressions';
-import { RequestAdapter, DataAdapter } from '../../../../../../../../src/plugins/inspector';
+import { RequestAdapter, DataAdapter } from '../../../../../../../src/plugins/inspector';
import { Adapters, ExpressionRenderHandler } from '../../types';
import { getExpressions } from '../../services';
diff --git a/test/interpreter_functional/plugins/kbn_tp_run_pipeline/public/index.ts b/test/interpreter_functional/plugins/kbn_tp_run_pipeline/public/index.ts
index c4cc7175d6157..d7a764b581c01 100644
--- a/test/interpreter_functional/plugins/kbn_tp_run_pipeline/public/index.ts
+++ b/test/interpreter_functional/plugins/kbn_tp_run_pipeline/public/index.ts
@@ -17,4 +17,12 @@
* under the License.
*/
-export * from './np_ready';
+import { PluginInitializer, PluginInitializerContext } from 'src/core/public';
+import { Plugin, StartDeps } from './plugin';
+export { StartDeps };
+
+export const plugin: PluginInitializer = (
+ initializerContext: PluginInitializerContext
+) => {
+ return new Plugin(initializerContext);
+};
diff --git a/test/interpreter_functional/plugins/kbn_tp_run_pipeline/public/legacy.ts b/test/interpreter_functional/plugins/kbn_tp_run_pipeline/public/legacy.ts
deleted file mode 100644
index a7cd313038d69..0000000000000
--- a/test/interpreter_functional/plugins/kbn_tp_run_pipeline/public/legacy.ts
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * Licensed to Elasticsearch B.V. under one or more contributor
- * license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright
- * ownership. Elasticsearch B.V. licenses this file to you under
- * the Apache License, Version 2.0 (the "License"); you may
- * not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-import { PluginInitializerContext } from 'src/core/public';
-import { npSetup, npStart } from 'ui/new_platform';
-
-import { plugin } from './np_ready';
-
-// This is required so some default styles and required scripts/Angular modules are loaded,
-// or the timezone setting is correctly applied.
-import 'ui/autoload/all';
-// Used to run esaggs queries
-import 'uiExports/fieldFormats';
-import 'uiExports/search';
-// Used for kibana_context function
-
-import 'uiExports/savedObjectTypes';
-import 'uiExports/interpreter';
-
-const pluginInstance = plugin({} as PluginInitializerContext);
-
-export const setup = pluginInstance.setup(npSetup.core, npSetup.plugins);
-export const start = pluginInstance.start(npStart.core, npStart.plugins);
diff --git a/test/interpreter_functional/plugins/kbn_tp_run_pipeline/public/np_ready/plugin.ts b/test/interpreter_functional/plugins/kbn_tp_run_pipeline/public/plugin.ts
similarity index 100%
rename from test/interpreter_functional/plugins/kbn_tp_run_pipeline/public/np_ready/plugin.ts
rename to test/interpreter_functional/plugins/kbn_tp_run_pipeline/public/plugin.ts
diff --git a/test/interpreter_functional/plugins/kbn_tp_run_pipeline/public/np_ready/services.ts b/test/interpreter_functional/plugins/kbn_tp_run_pipeline/public/services.ts
similarity index 91%
rename from test/interpreter_functional/plugins/kbn_tp_run_pipeline/public/np_ready/services.ts
rename to test/interpreter_functional/plugins/kbn_tp_run_pipeline/public/services.ts
index a700727d87299..4972911d5894f 100644
--- a/test/interpreter_functional/plugins/kbn_tp_run_pipeline/public/np_ready/services.ts
+++ b/test/interpreter_functional/plugins/kbn_tp_run_pipeline/public/services.ts
@@ -17,7 +17,7 @@
* under the License.
*/
-import { createGetterSetter } from '../../../../../../src/plugins/kibana_utils/public';
+import { createGetterSetter } from '../../../../../src/plugins/kibana_utils/public';
import { ExpressionsStart } from './types';
export const [getExpressions, setExpressions] = createGetterSetter('Expressions');
diff --git a/test/interpreter_functional/plugins/kbn_tp_run_pipeline/public/np_ready/types.ts b/test/interpreter_functional/plugins/kbn_tp_run_pipeline/public/types.ts
similarity index 100%
rename from test/interpreter_functional/plugins/kbn_tp_run_pipeline/public/np_ready/types.ts
rename to test/interpreter_functional/plugins/kbn_tp_run_pipeline/public/types.ts
diff --git a/test/interpreter_functional/plugins/kbn_tp_run_pipeline/tsconfig.json b/test/interpreter_functional/plugins/kbn_tp_run_pipeline/tsconfig.json
new file mode 100644
index 0000000000000..5fcaeafbb0d85
--- /dev/null
+++ b/test/interpreter_functional/plugins/kbn_tp_run_pipeline/tsconfig.json
@@ -0,0 +1,14 @@
+{
+ "extends": "../../../../tsconfig.json",
+ "compilerOptions": {
+ "outDir": "./target",
+ "skipLibCheck": true
+ },
+ "include": [
+ "index.ts",
+ "public/**/*.ts",
+ "public/**/*.tsx",
+ "../../../../typings/**/*",
+ ],
+ "exclude": []
+}
diff --git a/test/interpreter_functional/test_suites/run_pipeline/basic.ts b/test/interpreter_functional/test_suites/run_pipeline/basic.ts
index a2172dd2da1ba..51ad789143c54 100644
--- a/test/interpreter_functional/test_suites/run_pipeline/basic.ts
+++ b/test/interpreter_functional/test_suites/run_pipeline/basic.ts
@@ -113,10 +113,11 @@ export default function({
await expectExpression('partial_test_2', metricExpr, context).toMatchSnapshot()
).toMatchScreenshot();
- const regionMapExpr = `regionmap visConfig='{"metric":{"accessor":1,"format":{"id":"number"}},"bucket":{"accessor":0}}'`;
- await (
- await expectExpression('partial_test_3', regionMapExpr, context).toMatchSnapshot()
- ).toMatchScreenshot();
+ // TODO: should be uncommented when the region map is migrated to the new platform
+ // const regionMapExpr = `regionmap visConfig='{"metric":{"accessor":1,"format":{"id":"number"}},"bucket":{"accessor":0}}'`;
+ // await (
+ // await expectExpression('partial_test_3', regionMapExpr, context).toMatchSnapshot()
+ // ).toMatchScreenshot();
});
});
});
diff --git a/test/interpreter_functional/test_suites/run_pipeline/helpers.ts b/test/interpreter_functional/test_suites/run_pipeline/helpers.ts
index 00693845bb266..2486fb0e1fbd0 100644
--- a/test/interpreter_functional/test_suites/run_pipeline/helpers.ts
+++ b/test/interpreter_functional/test_suites/run_pipeline/helpers.ts
@@ -21,6 +21,17 @@ import expect from '@kbn/expect';
import { ExpressionValue } from 'src/plugins/expressions';
import { FtrProviderContext } from '../../../functional/ftr_provider_context';
+declare global {
+ interface Window {
+ runPipeline: (
+ expressions: string,
+ context?: ExpressionValue,
+ initialContext?: ExpressionValue
+ ) => any;
+ renderPipelineResponse: (context?: ExpressionValue) => Promise;
+ }
+}
+
export type ExpressionResult = any;
export type ExpectExpression = (
@@ -165,7 +176,7 @@ export function expectExpressionProvider({
log.debug('starting to render');
const result = await browser.executeAsync(
(_context: ExpressionResult, done: (renderResult: any) => void) =>
- window.renderPipelineResponse(_context).then(renderResult => {
+ window.renderPipelineResponse(_context).then((renderResult: any) => {
done(renderResult);
return renderResult;
}),
diff --git a/test/plugin_functional/plugins/core_provider_plugin/kibana.json b/test/plugin_functional/plugins/core_provider_plugin/kibana.json
new file mode 100644
index 0000000000000..1d5c5824d6b97
--- /dev/null
+++ b/test/plugin_functional/plugins/core_provider_plugin/kibana.json
@@ -0,0 +1,8 @@
+{
+ "id": "core_provider_plugin",
+ "version": "0.0.1",
+ "kibanaVersion": "kibana",
+ "optionalPlugins": ["core_plugin_a", "core_plugin_b", "licensing"],
+ "server": false,
+ "ui": true
+}
diff --git a/test/plugin_functional/plugins/core_provider_plugin/public/index.ts b/test/plugin_functional/plugins/core_provider_plugin/public/index.ts
index c74928203db56..2f271fe5ef65b 100644
--- a/test/plugin_functional/plugins/core_provider_plugin/public/index.ts
+++ b/test/plugin_functional/plugins/core_provider_plugin/public/index.ts
@@ -16,13 +16,31 @@
* specific language governing permissions and limitations
* under the License.
*/
-import { npSetup, npStart } from 'ui/new_platform';
+import { Plugin, CoreSetup, CoreStart } from 'kibana/public';
import '../types';
-window.__coreProvider = {
- setup: npSetup,
- start: npStart,
- testUtils: {
- delay: (ms: number) => new Promise(res => setTimeout(res, ms)),
- },
-};
+export const plugin = () => new CoreProviderPlugin();
+
+class CoreProviderPlugin implements Plugin {
+ private setupDeps?: { core: CoreSetup; plugins: Record };
+ public setup(core: CoreSetup, plugins: Record) {
+ this.setupDeps = {
+ core,
+ plugins,
+ };
+ }
+
+ public start(core: CoreStart, plugins: Record) {
+ window.__coreProvider = {
+ setup: this.setupDeps!,
+ start: {
+ core,
+ plugins,
+ },
+ testUtils: {
+ delay: (ms: number) => new Promise(res => setTimeout(res, ms)),
+ },
+ };
+ }
+ public stop() {}
+}
diff --git a/test/plugin_functional/plugins/core_provider_plugin/tsconfig.json b/test/plugin_functional/plugins/core_provider_plugin/tsconfig.json
index c29959197958d..baedb5f2f621b 100644
--- a/test/plugin_functional/plugins/core_provider_plugin/tsconfig.json
+++ b/test/plugin_functional/plugins/core_provider_plugin/tsconfig.json
@@ -8,7 +8,7 @@
"index.ts",
"types.ts",
"public/**/*.ts",
- "../../../../typings/**/*",
+ "../../../../typings/**/*"
],
"exclude": []
}
diff --git a/test/plugin_functional/plugins/core_provider_plugin/types.ts b/test/plugin_functional/plugins/core_provider_plugin/types.ts
index bf19578c37baa..cae3b604ecd95 100644
--- a/test/plugin_functional/plugins/core_provider_plugin/types.ts
+++ b/test/plugin_functional/plugins/core_provider_plugin/types.ts
@@ -16,17 +16,17 @@
* specific language governing permissions and limitations
* under the License.
*/
-import { LegacyCoreSetup, LegacyCoreStart } from 'kibana/public';
+import { CoreSetup, CoreStart } from 'kibana/public';
declare global {
interface Window {
__coreProvider: {
setup: {
- core: LegacyCoreSetup;
+ core: CoreSetup;
plugins: Record;
};
start: {
- core: LegacyCoreStart;
+ core: CoreStart;
plugins: Record;
};
testUtils: {
diff --git a/test/plugin_functional/test_suites/core_plugins/application_status.ts b/test/plugin_functional/test_suites/core_plugins/application_status.ts
index 0781cf8a4f5bd..b2c0413c5024b 100644
--- a/test/plugin_functional/test_suites/core_plugins/application_status.ts
+++ b/test/plugin_functional/test_suites/core_plugins/application_status.ts
@@ -57,7 +57,8 @@ export default function({ getService, getPageObjects }: PluginFunctionalProvider
}, i)) as any;
};
- describe('application status management', () => {
+ // FLAKY: https://github.com/elastic/kibana/issues/65423
+ describe.skip('application status management', () => {
beforeEach(async () => {
await PageObjects.common.navigateToApp('app_status_start');
});
diff --git a/test/plugin_functional/test_suites/core_plugins/rendering.ts b/test/plugin_functional/test_suites/core_plugins/rendering.ts
index 097833750bc80..b8e26b8e6ffcb 100644
--- a/test/plugin_functional/test_suites/core_plugins/rendering.ts
+++ b/test/plugin_functional/test_suites/core_plugins/rendering.ts
@@ -40,8 +40,8 @@ export default function({ getService, getPageObjects }: PluginFunctionalProvider
const find = getService('find');
const testSubjects = getService('testSubjects');
- const navigateTo = (path: string) =>
- browser.navigateTo(`${PageObjects.common.getHostPort()}${path}`);
+ const navigateTo = async (path: string) =>
+ await browser.navigateTo(`${PageObjects.common.getHostPort()}${path}`);
const navigateToApp = async (title: string) => {
await appsMenu.clickLink(title);
return browser.execute(() => {
diff --git a/test/plugin_functional/test_suites/core_plugins/ui_plugins.ts b/test/plugin_functional/test_suites/core_plugins/ui_plugins.ts
index 8ddd0ff96ba8f..b2393443989f9 100644
--- a/test/plugin_functional/test_suites/core_plugins/ui_plugins.ts
+++ b/test/plugin_functional/test_suites/core_plugins/ui_plugins.ts
@@ -47,14 +47,6 @@ export default function({ getService, getPageObjects }: PluginFunctionalProvider
await PageObjects.common.navigateToApp('settings');
});
- it('to injectedMetadata service', async () => {
- expect(
- await browser.execute(() => {
- return window.__coreProvider.setup.core.injectedMetadata.getKibanaBuildNumber();
- })
- ).to.be.a('number');
- });
-
it('to start services via coreSetup.getStartServices', async () => {
expect(
await browser.executeAsync(async cb => {
diff --git a/test/scripts/jenkins_build_kibana.sh b/test/scripts/jenkins_build_kibana.sh
index 1f6e09fad19e9..e3f46e7a6ada4 100755
--- a/test/scripts/jenkins_build_kibana.sh
+++ b/test/scripts/jenkins_build_kibana.sh
@@ -6,6 +6,7 @@ echo " -> building kibana platform plugins"
node scripts/build_kibana_platform_plugins \
--oss \
--scan-dir "$KIBANA_DIR/test/plugin_functional/plugins" \
+ --scan-dir "$KIBANA_DIR/test/interpreter_functional/plugins" \
--verbose;
# doesn't persist, also set in kibanaPipeline.groovy
diff --git a/test/scripts/jenkins_xpack_build_kibana.sh b/test/scripts/jenkins_xpack_build_kibana.sh
index 8dc41639fa946..c962b962b1e5e 100755
--- a/test/scripts/jenkins_xpack_build_kibana.sh
+++ b/test/scripts/jenkins_xpack_build_kibana.sh
@@ -5,6 +5,7 @@ source src/dev/ci_setup/setup_env.sh
echo " -> building kibana platform plugins"
node scripts/build_kibana_platform_plugins \
+ --scan-dir "$KIBANA_DIR/test/plugin_functional/plugins" \
--scan-dir "$XPACK_DIR/test/plugin_functional/plugins" \
--scan-dir "$XPACK_DIR/test/functional_with_es_ssl/fixtures/plugins" \
--scan-dir "$XPACK_DIR/test/alerting_api_integration/plugins" \
diff --git a/test/tsconfig.json b/test/tsconfig.json
index 5a3716e620fed..a270144bd49fe 100644
--- a/test/tsconfig.json
+++ b/test/tsconfig.json
@@ -19,6 +19,7 @@
"typings/**/*"
],
"exclude": [
- "plugin_functional/plugins/**/*"
+ "plugin_functional/plugins/**/*",
+ "interpreter_functional/plugins/**/*"
]
}
diff --git a/webpackShims/leaflet.js b/webpackShims/leaflet.js
deleted file mode 100644
index c35076e129533..0000000000000
--- a/webpackShims/leaflet.js
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * Licensed to Elasticsearch B.V. under one or more contributor
- * license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright
- * ownership. Elasticsearch B.V. licenses this file to you under
- * the Apache License, Version 2.0 (the "License"); you may
- * not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-require('../node_modules/leaflet/dist/leaflet.css');
-window.L = module.exports = require('../node_modules/leaflet/dist/leaflet');
-window.L.Browser.touch = false;
-window.L.Browser.pointer = false;
-
-require('../node_modules/leaflet.heat/dist/leaflet-heat.js');
-
-require('../node_modules/leaflet-draw/dist/leaflet.draw.css');
-require('../node_modules/leaflet-draw/dist/leaflet.draw.js');
-
-require('../node_modules/leaflet-responsive-popup/leaflet.responsive.popup.css');
-require('../node_modules/leaflet-responsive-popup/leaflet.responsive.popup.js');
diff --git a/x-pack/legacy/plugins/dashboard_mode/public/dashboard_viewer.js b/x-pack/legacy/plugins/dashboard_mode/public/dashboard_viewer.js
index 532c49803e7b0..746fa693e435e 100644
--- a/x-pack/legacy/plugins/dashboard_mode/public/dashboard_viewer.js
+++ b/x-pack/legacy/plugins/dashboard_mode/public/dashboard_viewer.js
@@ -27,7 +27,6 @@ import 'uiExports/search';
import 'uiExports/shareContextMenuExtensions';
import _ from 'lodash';
import 'ui/autoload/all';
-import 'leaflet';
import { npStart } from 'ui/new_platform';
import { localApplicationService } from 'plugins/kibana/local_application_service';
diff --git a/x-pack/legacy/plugins/maps/index.js b/x-pack/legacy/plugins/maps/index.js
index 40123040764b7..a46cdfe35e32d 100644
--- a/x-pack/legacy/plugins/maps/index.js
+++ b/x-pack/legacy/plugins/maps/index.js
@@ -4,7 +4,6 @@
* you may not use this file except in compliance with the Elastic License.
*/
-import _ from 'lodash';
import mappings from './mappings.json';
import { i18n } from '@kbn/i18n';
import { resolve } from 'path';
@@ -39,23 +38,13 @@ export function maps(kibana) {
},
injectDefaultVars(server) {
const serverConfig = server.config();
- const mapConfig = serverConfig.get('map');
return {
showMapVisualizationTypes: serverConfig.get('xpack.maps.showMapVisualizationTypes'),
showMapsInspectorAdapter: serverConfig.get('xpack.maps.showMapsInspectorAdapter'),
enableVectorTiles: serverConfig.get('xpack.maps.enableVectorTiles'),
preserveDrawingBuffer: serverConfig.get('xpack.maps.preserveDrawingBuffer'),
- isEmsEnabled: mapConfig.includeElasticMapsService,
- emsFontLibraryUrl: mapConfig.emsFontLibraryUrl,
- emsTileLayerId: mapConfig.emsTileLayerId,
- proxyElasticMapsServiceInMaps: mapConfig.proxyElasticMapsServiceInMaps,
- emsFileApiUrl: mapConfig.emsFileApiUrl,
- emsTileApiUrl: mapConfig.emsTileApiUrl,
- emsLandingPageUrl: mapConfig.emsLandingPageUrl,
kbnPkgVersion: serverConfig.get('pkg.version'),
- regionmapLayers: _.get(mapConfig, 'regionmap.layers', []),
- tilemap: _.get(mapConfig, 'tilemap', {}),
};
},
styleSheetPaths: `${__dirname}/public/index.scss`,
@@ -112,14 +101,12 @@ export function maps(kibana) {
licensing: newPlatformPlugins.licensing,
home: newPlatformPlugins.home,
usageCollection: newPlatformPlugins.usageCollection,
+ mapsLegacy: newPlatformPlugins.mapsLegacy,
};
// legacy dependencies
const __LEGACY = {
config: server.config,
- mapConfig() {
- return server.config().get('map');
- },
route: server.route.bind(server),
plugins: {
elasticsearch: server.plugins.elasticsearch,
@@ -132,8 +119,8 @@ export function maps(kibana) {
getInjectedUiAppVars: server.getInjectedUiAppVars,
};
- const mapPluginSetup = new MapPlugin().setup(coreSetup, pluginsSetup, __LEGACY);
- server.expose('getMapConfig', mapPluginSetup.getMapConfig);
+ const mapPlugin = new MapPlugin();
+ mapPlugin.setup(coreSetup, pluginsSetup, __LEGACY);
},
});
}
diff --git a/x-pack/legacy/plugins/maps/server/plugin.js b/x-pack/legacy/plugins/maps/server/plugin.js
index 79f3dcf76b82e..d2d5309606cde 100644
--- a/x-pack/legacy/plugins/maps/server/plugin.js
+++ b/x-pack/legacy/plugins/maps/server/plugin.js
@@ -19,8 +19,9 @@ import { emsBoundariesSpecProvider } from './tutorials/ems';
export class MapPlugin {
setup(core, plugins, __LEGACY) {
- const { featuresPlugin, home, licensing, usageCollection } = plugins;
+ const { featuresPlugin, home, licensing, usageCollection, mapsLegacy } = plugins;
let routesInitialized = false;
+ const mapConfig = mapsLegacy.config;
featuresPlugin.registerFeature({
id: APP_ID,
@@ -58,7 +59,7 @@ export class MapPlugin {
const { state } = license.check('maps', 'basic');
if (state === 'valid' && !routesInitialized) {
routesInitialized = true;
- initRoutes(__LEGACY, license.uid);
+ initRoutes(__LEGACY, license.uid, mapConfig);
}
});
@@ -134,7 +135,7 @@ export class MapPlugin {
home.tutorials.registerTutorial(
emsBoundariesSpecProvider({
prependBasePath: core.http.basePath.prepend,
- emsLandingPageUrl: __LEGACY.mapConfig().emsLandingPageUrl,
+ emsLandingPageUrl: mapConfig.emsLandingPageUrl,
})
);
}
@@ -142,11 +143,5 @@ export class MapPlugin {
__LEGACY.injectUiAppVars(APP_ID, async () => {
return await __LEGACY.getInjectedUiAppVars('kibana');
});
-
- return {
- getMapConfig() {
- return __LEGACY.mapConfig();
- },
- };
}
}
diff --git a/x-pack/legacy/plugins/maps/server/routes.js b/x-pack/legacy/plugins/maps/server/routes.js
index d49f9827e3ea0..6b83f4026f1db 100644
--- a/x-pack/legacy/plugins/maps/server/routes.js
+++ b/x-pack/legacy/plugins/maps/server/routes.js
@@ -31,9 +31,8 @@ import Boom from 'boom';
const ROOT = `/${GIS_API_PATH}`;
-export function initRoutes(server, licenseUid) {
+export function initRoutes(server, licenseUid, mapConfig) {
const serverConfig = server.config();
- const mapConfig = serverConfig.get('map');
let emsClient;
if (mapConfig.includeElasticMapsService) {
diff --git a/x-pack/plugins/actions/server/action_type_registry.test.ts b/x-pack/plugins/actions/server/action_type_registry.test.ts
index 3be2f26557079..a8f50ec3535e2 100644
--- a/x-pack/plugins/actions/server/action_type_registry.test.ts
+++ b/x-pack/plugins/actions/server/action_type_registry.test.ts
@@ -71,6 +71,19 @@ describe('register()', () => {
`);
});
+ test('shallow clones the given action type', () => {
+ const myType: ActionType = {
+ id: 'my-action-type',
+ name: 'My action type',
+ minimumLicenseRequired: 'basic',
+ executor,
+ };
+ const actionTypeRegistry = new ActionTypeRegistry(actionTypeRegistryParams);
+ actionTypeRegistry.register(myType);
+ myType.name = 'Changed';
+ expect(actionTypeRegistry.get('my-action-type').name).toEqual('My action type');
+ });
+
test('throws error if action type already registered', () => {
const actionTypeRegistry = new ActionTypeRegistry(actionTypeRegistryParams);
actionTypeRegistry.register({
diff --git a/x-pack/plugins/actions/server/action_type_registry.ts b/x-pack/plugins/actions/server/action_type_registry.ts
index 723982b11e1cc..73ae49a7e69c2 100644
--- a/x-pack/plugins/actions/server/action_type_registry.ts
+++ b/x-pack/plugins/actions/server/action_type_registry.ts
@@ -91,7 +91,7 @@ export class ActionTypeRegistry {
)
);
}
- this.actionTypes.set(actionType.id, actionType);
+ this.actionTypes.set(actionType.id, { ...actionType });
this.taskManager.registerTaskDefinitions({
[`actions:${actionType.id}`]: {
title: actionType.name,
diff --git a/x-pack/plugins/alerting/server/alert_type_registry.test.ts b/x-pack/plugins/alerting/server/alert_type_registry.test.ts
index f9df390242cd4..f556287703347 100644
--- a/x-pack/plugins/alerting/server/alert_type_registry.test.ts
+++ b/x-pack/plugins/alerting/server/alert_type_registry.test.ts
@@ -72,6 +72,25 @@ describe('register()', () => {
`);
});
+ test('shallow clones the given alert type', () => {
+ const alertType: AlertType = {
+ id: 'test',
+ name: 'Test',
+ actionGroups: [
+ {
+ id: 'default',
+ name: 'Default',
+ },
+ ],
+ defaultActionGroupId: 'default',
+ executor: jest.fn(),
+ };
+ const registry = new AlertTypeRegistry(alertTypeRegistryParams);
+ registry.register(alertType);
+ alertType.name = 'Changed';
+ expect(registry.get('test').name).toEqual('Test');
+ });
+
test('should throw an error if type is already registered', () => {
const registry = new AlertTypeRegistry(alertTypeRegistryParams);
registry.register({
diff --git a/x-pack/plugins/alerting/server/alert_type_registry.ts b/x-pack/plugins/alerting/server/alert_type_registry.ts
index 55e39b6a817db..8bcb4d838ca1b 100644
--- a/x-pack/plugins/alerting/server/alert_type_registry.ts
+++ b/x-pack/plugins/alerting/server/alert_type_registry.ts
@@ -41,7 +41,7 @@ export class AlertTypeRegistry {
);
}
alertType.actionVariables = normalizedActionVariables(alertType.actionVariables);
- this.alertTypes.set(alertType.id, alertType);
+ this.alertTypes.set(alertType.id, { ...alertType });
this.taskManager.registerTaskDefinitions({
[`alerting:${alertType.id}`]: {
title: alertType.name,
diff --git a/x-pack/plugins/apm/common/service_map.ts b/x-pack/plugins/apm/common/service_map.ts
index 2ff30a61499b6..dc457c38a52af 100644
--- a/x-pack/plugins/apm/common/service_map.ts
+++ b/x-pack/plugins/apm/common/service_map.ts
@@ -34,7 +34,6 @@ export interface Connection {
}
export interface ServiceNodeMetrics {
- numInstances: number;
avgMemoryUsage: number | null;
avgCpuUsage: number | null;
avgTransactionDuration: number | null;
diff --git a/x-pack/plugins/apm/public/components/app/Main/__test__/ProvideBreadcrumbs.test.tsx b/x-pack/plugins/apm/public/components/app/Main/ProvideBreadcrumbs.test.tsx
similarity index 94%
rename from x-pack/plugins/apm/public/components/app/Main/__test__/ProvideBreadcrumbs.test.tsx
rename to x-pack/plugins/apm/public/components/app/Main/ProvideBreadcrumbs.test.tsx
index cb983cdffa028..1e3a73acfab57 100644
--- a/x-pack/plugins/apm/public/components/app/Main/__test__/ProvideBreadcrumbs.test.tsx
+++ b/x-pack/plugins/apm/public/components/app/Main/ProvideBreadcrumbs.test.tsx
@@ -5,8 +5,8 @@
*/
import { Location } from 'history';
-import { BreadcrumbRoute, getBreadcrumbs } from '../ProvideBreadcrumbs';
-import { RouteName } from '../route_config/route_names';
+import { BreadcrumbRoute, getBreadcrumbs } from './ProvideBreadcrumbs';
+import { RouteName } from './route_config/route_names';
describe('getBreadcrumbs', () => {
const getTestRoutes = (): BreadcrumbRoute[] => [
diff --git a/x-pack/plugins/apm/public/components/app/Main/UpdateBreadcrumbs.tsx b/x-pack/plugins/apm/public/components/app/Main/UpdateBreadcrumbs.tsx
index 8960af0f21fd2..b4a556c497c1b 100644
--- a/x-pack/plugins/apm/public/components/app/Main/UpdateBreadcrumbs.tsx
+++ b/x-pack/plugins/apm/public/components/app/Main/UpdateBreadcrumbs.tsx
@@ -30,10 +30,18 @@ function getTitleFromBreadCrumbs(breadcrumbs: Breadcrumb[]) {
class UpdateBreadcrumbsComponent extends React.Component {
public updateHeaderBreadcrumbs() {
- const breadcrumbs = this.props.breadcrumbs.map(({ value, match }) => ({
- text: value,
- href: getAPMHref(match.url, this.props.location.search)
- }));
+ const breadcrumbs = this.props.breadcrumbs.map(
+ ({ value, match }, index) => {
+ const isLastBreadcrumbItem =
+ index === this.props.breadcrumbs.length - 1;
+ return {
+ text: value,
+ href: isLastBreadcrumbItem
+ ? undefined // makes the breadcrumb item not clickable
+ : getAPMHref(match.url, this.props.location.search)
+ };
+ }
+ );
document.title = getTitleFromBreadCrumbs(this.props.breadcrumbs);
this.props.core.chrome.setBreadcrumbs(breadcrumbs);
diff --git a/x-pack/plugins/apm/public/components/app/Main/__snapshots__/UpdateBreadcrumbs.test.tsx.snap b/x-pack/plugins/apm/public/components/app/Main/__snapshots__/UpdateBreadcrumbs.test.tsx.snap
index 51bdb63874e63..e7f6cba59318a 100644
--- a/x-pack/plugins/apm/public/components/app/Main/__snapshots__/UpdateBreadcrumbs.test.tsx.snap
+++ b/x-pack/plugins/apm/public/components/app/Main/__snapshots__/UpdateBreadcrumbs.test.tsx.snap
@@ -15,7 +15,7 @@ Array [
"text": "opbeans-node",
},
Object {
- "href": "#/services/opbeans-node/errors?rangeFrom=now-24h&rangeTo=now&refreshPaused=true&refreshInterval=0&kuery=myKuery",
+ "href": undefined,
"text": "Errors",
},
]
@@ -40,7 +40,7 @@ Array [
"text": "Errors",
},
Object {
- "href": "#/services/opbeans-node/errors/myGroupId?rangeFrom=now-24h&rangeTo=now&refreshPaused=true&refreshInterval=0&kuery=myKuery",
+ "href": undefined,
"text": "myGroupId",
},
]
@@ -61,7 +61,7 @@ Array [
"text": "opbeans-node",
},
Object {
- "href": "#/services/opbeans-node/transactions?rangeFrom=now-24h&rangeTo=now&refreshPaused=true&refreshInterval=0&kuery=myKuery",
+ "href": undefined,
"text": "Transactions",
},
]
@@ -86,7 +86,7 @@ Array [
"text": "Transactions",
},
Object {
- "href": "#/services/opbeans-node/transactions/view?rangeFrom=now-24h&rangeTo=now&refreshPaused=true&refreshInterval=0&kuery=myKuery",
+ "href": undefined,
"text": "my-transaction-name",
},
]
@@ -95,7 +95,7 @@ Array [
exports[`UpdateBreadcrumbs Homepage 1`] = `
Array [
Object {
- "href": "#/?rangeFrom=now-24h&rangeTo=now&refreshPaused=true&refreshInterval=0&kuery=myKuery",
+ "href": undefined,
"text": "APM",
},
]
diff --git a/x-pack/plugins/apm/public/components/app/ServiceMap/Popover/Contents.tsx b/x-pack/plugins/apm/public/components/app/ServiceMap/Popover/Contents.tsx
index 7e15d0116b84d..b5bfa63c1bdde 100644
--- a/x-pack/plugins/apm/public/components/app/ServiceMap/Popover/Contents.tsx
+++ b/x-pack/plugins/apm/public/components/app/ServiceMap/Popover/Contents.tsx
@@ -90,11 +90,11 @@ const ANOMALY_DETECTION_TITLE = i18n.translate(
{ defaultMessage: 'Anomaly Detection' }
);
-const ANOMALY_DETECTION_INFO = i18n.translate(
- 'xpack.apm.serviceMap.anomalyDetectionPopoverInfo',
+const ANOMALY_DETECTION_TOOLTIP = i18n.translate(
+ 'xpack.apm.serviceMap.anomalyDetectionPopoverTooltip',
{
defaultMessage:
- 'Display the health of your service by enabling the anomaly detection feature in Machine Learning.'
+ 'Service health indicators are powered by the anomaly detection feature in machine learning'
}
);
@@ -108,11 +108,11 @@ const ANOMALY_DETECTION_LINK = i18n.translate(
{ defaultMessage: 'View anomalies' }
);
-const ANOMALY_DETECTION_ENABLE_TEXT = i18n.translate(
- 'xpack.apm.serviceMap.anomalyDetectionPopoverEnable',
+const ANOMALY_DETECTION_DISABLED_TEXT = i18n.translate(
+ 'xpack.apm.serviceMap.anomalyDetectionPopoverDisabled',
{
defaultMessage:
- 'Enable anomaly detection from the Integrations menu in the Service details view.'
+ 'Display service health indicators by enabling anomaly detection from the Integrations menu in the Service details view.'
}
);
@@ -154,15 +154,18 @@ export function Contents({
{isService && (
-
-
-