Migrates search example mountReactNode to kibana-react toMountPoint (#137633)

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
This commit is contained in:
Christiane (Tina) Heiligers 2022-08-01 07:52:20 -07:00 committed by GitHub
parent fb9ae97a23
commit 44738f2439
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 5 deletions

View file

@ -1,7 +1,10 @@
# search_examples
> An awesome Kibana plugin
Small demos of search functionality.
To run this example, ensure you have data to search against (for example, the sample datasets) and start kibana with the `--run-examples` flag.
---
## Development

View file

@ -34,7 +34,7 @@ import {
import { lastValueFrom } from 'rxjs';
import { CoreStart } from '@kbn/core/public';
import { mountReactNode } from '@kbn/core/public/utils';
import { toMountPoint } from '@kbn/kibana-react-plugin/public';
import { NavigationPublicPluginStart } from '@kbn/navigation-plugin/public';
import {
@ -232,7 +232,7 @@ export const SearchExamplesApp = ({
notifications.toasts.addSuccess(
{
title: 'Query result',
text: mountReactNode(message),
text: toMountPoint(message),
},
{
toastLifeTimeMs: 300000,
@ -241,7 +241,7 @@ export const SearchExamplesApp = ({
if (res.warning) {
notifications.toasts.addWarning({
title: 'Warning',
text: mountReactNode(res.warning),
text: toMountPoint(res.warning),
});
}
} else if (isErrorResponse(res)) {
@ -315,7 +315,7 @@ export const SearchExamplesApp = ({
notifications.toasts.addSuccess(
{
title: 'Query result',
text: mountReactNode(message),
text: toMountPoint(message),
},
{
toastLifeTimeMs: 300000,