plugin
export at the root of a plugin's public
directory should conform to this interface. |
| [PluginOpaqueId](./kibana-plugin-public.pluginopaqueid.md) | |
| [RecursiveReadonly](./kibana-plugin-public.recursivereadonly.md) | |
| [SavedObjectAttribute](./kibana-plugin-public.savedobjectattribute.md) | Type definition for a Saved Object attribute value |
| [SavedObjectAttributeSingle](./kibana-plugin-public.savedobjectattributesingle.md) | Don't use this type, it's simply a helper type for [SavedObjectAttribute](./kibana-plugin-public.savedobjectattribute.md) |
| [SavedObjectsClientContract](./kibana-plugin-public.savedobjectsclientcontract.md) | SavedObjectsClientContract as implemented by the [SavedObjectsClient](./kibana-plugin-public.savedobjectsclient.md) |
+| [Toast](./kibana-plugin-public.toast.md) | |
| [ToastInput](./kibana-plugin-public.toastinput.md) | Inputs for [IToasts](./kibana-plugin-public.itoasts.md) APIs. |
| [ToastInputFields](./kibana-plugin-public.toastinputfields.md) | Allowed fields for [ToastInput](./kibana-plugin-public.toastinput.md). |
| [ToastsSetup](./kibana-plugin-public.toastssetup.md) | [IToasts](./kibana-plugin-public.itoasts.md) |
| [ToastsStart](./kibana-plugin-public.toastsstart.md) | [IToasts](./kibana-plugin-public.itoasts.md) |
| [UiSettingsClientContract](./kibana-plugin-public.uisettingsclientcontract.md) | Client-side client that provides access to the advanced settings stored in elasticsearch. The settings provide control over the behavior of the Kibana application. For example, a user can specify how to display numeric or date fields. Users can adjust the settings via Management UI. [UiSettingsClient](./kibana-plugin-public.uisettingsclient.md) |
+| [UnmountCallback](./kibana-plugin-public.unmountcallback.md) | A function that will unmount the element previously mounted by the associated [MountPoint](./kibana-plugin-public.mountpoint.md) |
diff --git a/docs/development/core/public/kibana-plugin-public.mountpoint.md b/docs/development/core/public/kibana-plugin-public.mountpoint.md
new file mode 100644
index 0000000000000..58f407904a576
--- /dev/null
+++ b/docs/development/core/public/kibana-plugin-public.mountpoint.md
@@ -0,0 +1,13 @@
+
+
+[Home](./index.md) > [kibana-plugin-public](./kibana-plugin-public.md) > [MountPoint](./kibana-plugin-public.mountpoint.md)
+
+## MountPoint type
+
+A function that should mount DOM content inside the provided container element and return a handler to unmount it.
+
+Signature:
+
+```typescript
+export declare type MountPoint = (element: HTMLElement) => UnmountCallback;
+```
diff --git a/docs/development/core/public/kibana-plugin-public.overlaybannermount.md b/docs/development/core/public/kibana-plugin-public.overlaybannermount.md
deleted file mode 100644
index 0fd0aca652cf0..0000000000000
--- a/docs/development/core/public/kibana-plugin-public.overlaybannermount.md
+++ /dev/null
@@ -1,13 +0,0 @@
-
-
-[Home](./index.md) > [kibana-plugin-public](./kibana-plugin-public.md) > [OverlayBannerMount](./kibana-plugin-public.overlaybannermount.md)
-
-## OverlayBannerMount type
-
-A function that will mount the banner inside the provided element.
-
-Signature:
-
-```typescript
-export declare type OverlayBannerMount = (element: HTMLElement) => OverlayBannerUnmount;
-```
diff --git a/docs/development/core/public/kibana-plugin-public.overlaybannersstart.add.md b/docs/development/core/public/kibana-plugin-public.overlaybannersstart.add.md
index 8c3e874804e08..8ce59d5d9ca78 100644
--- a/docs/development/core/public/kibana-plugin-public.overlaybannersstart.add.md
+++ b/docs/development/core/public/kibana-plugin-public.overlaybannersstart.add.md
@@ -9,14 +9,14 @@ Add a new banner
Signature:
```typescript
-add(mount: OverlayBannerMount, priority?: number): string;
+add(mount: MountPoint, priority?: number): string;
```
## Parameters
| Parameter | Type | Description |
| --- | --- | --- |
-| mount | OverlayBannerMount
| |
+| mount | MountPoint
| |
| priority | number
| |
Returns:
diff --git a/docs/development/core/public/kibana-plugin-public.overlaybannersstart.replace.md b/docs/development/core/public/kibana-plugin-public.overlaybannersstart.replace.md
index 8f624c285b180..a8f6915ea9bb7 100644
--- a/docs/development/core/public/kibana-plugin-public.overlaybannersstart.replace.md
+++ b/docs/development/core/public/kibana-plugin-public.overlaybannersstart.replace.md
@@ -9,7 +9,7 @@ Replace a banner in place
Signature:
```typescript
-replace(id: string | undefined, mount: OverlayBannerMount, priority?: number): string;
+replace(id: string | undefined, mount: MountPoint, priority?: number): string;
```
## Parameters
@@ -17,7 +17,7 @@ replace(id: string | undefined, mount: OverlayBannerMount, priority?: number): s
| Parameter | Type | Description |
| --- | --- | --- |
| id | string | undefined
| |
-| mount | OverlayBannerMount
| |
+| mount | MountPoint
| |
| priority | number
| |
Returns:
diff --git a/docs/development/core/public/kibana-plugin-public.overlaybannerunmount.md b/docs/development/core/public/kibana-plugin-public.overlaybannerunmount.md
deleted file mode 100644
index c9a7c2b8fee92..0000000000000
--- a/docs/development/core/public/kibana-plugin-public.overlaybannerunmount.md
+++ /dev/null
@@ -1,13 +0,0 @@
-
-
-[Home](./index.md) > [kibana-plugin-public](./kibana-plugin-public.md) > [OverlayBannerUnmount](./kibana-plugin-public.overlaybannerunmount.md)
-
-## OverlayBannerUnmount type
-
-A function that will unmount the banner from the element.
-
-Signature:
-
-```typescript
-export declare type OverlayBannerUnmount = () => void;
-```
diff --git a/docs/development/core/public/kibana-plugin-public.toast.md b/docs/development/core/public/kibana-plugin-public.toast.md
new file mode 100644
index 0000000000000..0cbbf29df073a
--- /dev/null
+++ b/docs/development/core/public/kibana-plugin-public.toast.md
@@ -0,0 +1,13 @@
+
+
+[Home](./index.md) > [kibana-plugin-public](./kibana-plugin-public.md) > [Toast](./kibana-plugin-public.toast.md)
+
+## Toast type
+
+Signature:
+
+```typescript
+export declare type Toast = ToastInputFields & {
+ id: string;
+};
+```
diff --git a/docs/development/core/public/kibana-plugin-public.toastinput.md b/docs/development/core/public/kibana-plugin-public.toastinput.md
index 75f12b3d94561..9dd20b5899f3a 100644
--- a/docs/development/core/public/kibana-plugin-public.toastinput.md
+++ b/docs/development/core/public/kibana-plugin-public.toastinput.md
@@ -9,5 +9,5 @@ Inputs for [IToasts](./kibana-plugin-public.itoasts.md) APIs.
Signature:
```typescript
-export declare type ToastInput = string | ToastInputFields | PromiseToast
| a returned by |
+| toastOrId | Toast | string
| a [Toast](./kibana-plugin-public.toast.md) returned by [ToastsApi.add()](./kibana-plugin-public.toastsapi.add.md) or its id |
Returns:
diff --git a/docs/development/core/public/kibana-plugin-public.unmountcallback.md b/docs/development/core/public/kibana-plugin-public.unmountcallback.md
new file mode 100644
index 0000000000000..f44562120c9ee
--- /dev/null
+++ b/docs/development/core/public/kibana-plugin-public.unmountcallback.md
@@ -0,0 +1,13 @@
+
+
+[Home](./index.md) > [kibana-plugin-public](./kibana-plugin-public.md) > [UnmountCallback](./kibana-plugin-public.unmountcallback.md)
+
+## UnmountCallback type
+
+A function that will unmount the element previously mounted by the associated [MountPoint](./kibana-plugin-public.mountpoint.md)
+
+Signature:
+
+```typescript
+export declare type UnmountCallback = () => void;
+```
diff --git a/src/core/public/index.ts b/src/core/public/index.ts
index e0c3425a859f3..78254ff96f35a 100644
--- a/src/core/public/index.ts
+++ b/src/core/public/index.ts
@@ -118,13 +118,7 @@ export {
InterceptedHttpResponse,
} from './http';
-export {
- OverlayStart,
- OverlayBannerMount,
- OverlayBannerUnmount,
- OverlayBannersStart,
- OverlayRef,
-} from './overlays';
+export { OverlayStart, OverlayBannersStart, OverlayRef } from './overlays';
export {
Toast,
@@ -137,6 +131,8 @@ export {
ErrorToastOptions,
} from './notifications';
+export { MountPoint, UnmountCallback } from './types';
+
/**
* Core services exposed to the `Plugin` setup lifecycle
*
diff --git a/src/core/public/notifications/toasts/__snapshots__/global_toast_list.test.tsx.snap b/src/core/public/notifications/toasts/__snapshots__/global_toast_list.test.tsx.snap
index 29b289592b2ef..ca09d4a14bd7a 100644
--- a/src/core/public/notifications/toasts/__snapshots__/global_toast_list.test.tsx.snap
+++ b/src/core/public/notifications/toasts/__snapshots__/global_toast_list.test.tsx.snap
@@ -3,7 +3,7 @@
exports[`renders matching snapshot 1`] = `
{warningText}
{i18n.translate(
'xpack.apm.serviceDetails.enableAnomalyDetectionPanel.jobCreationFailedNotificationText',
@@ -105,7 +106,7 @@ export class MachineLearningFlyout extends Component
{i18n.translate(
'xpack.apm.serviceDetails.enableAnomalyDetectionPanel.jobCreatedNotificationText',
diff --git a/x-pack/legacy/plugins/apm/public/components/app/ServiceDetails/ServiceIntegrations/WatcherFlyout.tsx b/x-pack/legacy/plugins/apm/public/components/app/ServiceDetails/ServiceIntegrations/WatcherFlyout.tsx
index 291208b2d9032..d52c869b95872 100644
--- a/x-pack/legacy/plugins/apm/public/components/app/ServiceDetails/ServiceIntegrations/WatcherFlyout.tsx
+++ b/x-pack/legacy/plugins/apm/public/components/app/ServiceDetails/ServiceIntegrations/WatcherFlyout.tsx
@@ -30,6 +30,7 @@ import { padLeft, range } from 'lodash';
import moment from 'moment-timezone';
import React, { Component } from 'react';
import styled from 'styled-components';
+import { toMountPoint } from '../../../../../../../../../src/plugins/kibana_react/public';
import { KibanaCoreContext } from '../../../../../../observability/public';
import { IUrlParams } from '../../../../context/UrlParamsContext/types';
import { KibanaLink } from '../../../shared/Links/KibanaLink';
@@ -219,7 +220,7 @@ export class WatcherFlyout extends Component<
defaultMessage: 'Watch creation failed'
}
),
- text: (
+ text: toMountPoint(
{i18n.translate(
'xpack.apm.serviceDetails.enableErrorReportsPanel.watchCreationFailedNotificationText',
@@ -243,7 +244,7 @@ export class WatcherFlyout extends Component<
defaultMessage: 'New watch created!'
}
),
- text: (
+ text: toMountPoint(
{i18n.translate(
'xpack.apm.serviceDetails.enableErrorReportsPanel.watchCreatedNotificationText',
diff --git a/x-pack/legacy/plugins/apm/public/components/app/ServiceOverview/index.tsx b/x-pack/legacy/plugins/apm/public/components/app/ServiceOverview/index.tsx
index b696af040223b..0702e092a714f 100644
--- a/x-pack/legacy/plugins/apm/public/components/app/ServiceOverview/index.tsx
+++ b/x-pack/legacy/plugins/apm/public/components/app/ServiceOverview/index.tsx
@@ -9,6 +9,7 @@ import { EuiLink } from '@elastic/eui';
import { i18n } from '@kbn/i18n';
import React, { useEffect, useMemo } from 'react';
import url from 'url';
+import { toMountPoint } from '../../../../../../../../src/plugins/kibana_react/public';
import { useFetcher } from '../../../hooks/useFetcher';
import { NoServicesMessage } from './NoServicesMessage';
import { ServiceList } from './ServiceList';
@@ -55,7 +56,7 @@ export function ServiceOverview() {
defaultMessage:
'Legacy data was detected within the selected time range'
}),
- text: (
+ text: toMountPoint(
{i18n.translate('xpack.apm.serviceOverview.toastText', {
defaultMessage:
diff --git a/x-pack/legacy/plugins/apm/public/hooks/useFetcher.tsx b/x-pack/legacy/plugins/apm/public/hooks/useFetcher.tsx
index ba74b0175ff71..bc6382841be3f 100644
--- a/x-pack/legacy/plugins/apm/public/hooks/useFetcher.tsx
+++ b/x-pack/legacy/plugins/apm/public/hooks/useFetcher.tsx
@@ -8,6 +8,7 @@ import React, { useContext, useEffect, useState, useMemo } from 'react';
import { idx } from '@kbn/elastic-idx';
import { i18n } from '@kbn/i18n';
import { IHttpFetchError } from 'src/core/public';
+import { toMountPoint } from '../../../../../../src/plugins/kibana_react/public';
import { LoadingIndicatorContext } from '../context/LoadingIndicatorContext';
import { useComponentId } from './useComponentId';
import { useKibanaCore } from '../../../observability/public';
@@ -92,7 +93,7 @@ export function useFetcher
-
-
+
+
-
+
-
-
+
+
-
+
{i18n.translate('xpack.apm.fetcher.error.status', {
diff --git a/x-pack/legacy/plugins/infra/public/hooks/use_http_request.tsx b/x-pack/legacy/plugins/infra/public/hooks/use_http_request.tsx
index 9ed72e656c45a..a54780267f1c1 100644
--- a/x-pack/legacy/plugins/infra/public/hooks/use_http_request.tsx
+++ b/x-pack/legacy/plugins/infra/public/hooks/use_http_request.tsx
@@ -10,6 +10,7 @@ import { toastNotifications } from 'ui/notify';
import { i18n } from '@kbn/i18n';
import { idx } from '@kbn/elastic-idx/target';
import { KFetchError } from 'ui/kfetch/kfetch_error';
+import { toMountPoint } from '../../../../../../src/plugins/kibana_react/public';
import { useTrackedPromise } from '../utils/use_tracked_promise';
export function useHTTPRequest
{i18n.translate('xpack.infra.useHTTPRequest.error.status', {
diff --git a/x-pack/legacy/plugins/monitoring/public/components/cluster/listing/listing.js b/x-pack/legacy/plugins/monitoring/public/components/cluster/listing/listing.js
index 7124faa3bf052..6f96c11d1de60 100644
--- a/x-pack/legacy/plugins/monitoring/public/components/cluster/listing/listing.js
+++ b/x-pack/legacy/plugins/monitoring/public/components/cluster/listing/listing.js
@@ -24,6 +24,7 @@ import { EuiMonitoringTable } from 'plugins/monitoring/components/table';
import { AlertsIndicator } from 'plugins/monitoring/components/cluster/listing/alerts_indicator';
import { FormattedMessage } from '@kbn/i18n/react';
import { i18n } from '@kbn/i18n';
+import { toMountPoint } from '../../../../../../../../src/plugins/kibana_react/public';
import { STANDALONE_CLUSTER_CLUSTER_UUID } from '../../../../common/constants';
const IsClusterSupported = ({ isSupported, children }) => {
@@ -271,14 +272,14 @@ const licenseWarning = (scope, { title, text }) => {
const handleClickIncompatibleLicense = (scope, clusterName) => {
licenseWarning(scope, {
- title: (
+ title: toMountPoint(