diff --git a/src/legacy/ui/public/notify/toasts/index.ts b/src/legacy/ui/public/notify/toasts/index.ts new file mode 100644 index 0000000000000..c5e8e3b7ca7a3 --- /dev/null +++ b/src/legacy/ui/public/notify/toasts/index.ts @@ -0,0 +1,20 @@ +/* + * 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 { ToastNotifications } from './toast_notifications'; +export { toastNotifications } from './toasts'; diff --git a/src/legacy/ui/public/notify/toasts/toast_notifications.ts b/src/legacy/ui/public/notify/toasts/toast_notifications.ts new file mode 100644 index 0000000000000..d3ec8edb5d73a --- /dev/null +++ b/src/legacy/ui/public/notify/toasts/toast_notifications.ts @@ -0,0 +1,22 @@ +/* + * 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. + */ +/** + * ToastNotifications is deprecated! Please use npSetup.core.notifications.toasts instead + */ +export { ToastNotifications } from '../../../../../plugins/kibana_legacy/public'; diff --git a/src/legacy/ui/public/notify/toasts.ts b/src/legacy/ui/public/notify/toasts/toasts.ts similarity index 92% rename from src/legacy/ui/public/notify/toasts.ts rename to src/legacy/ui/public/notify/toasts/toasts.ts index 6d2849db32b1b..15be7a7891553 100644 --- a/src/legacy/ui/public/notify/toasts.ts +++ b/src/legacy/ui/public/notify/toasts/toasts.ts @@ -18,6 +18,5 @@ */ import { npSetup } from 'ui/new_platform'; -import { ToastNotifications } from '../../../../plugins/kibana_legacy/public'; - +import { ToastNotifications } from './toast_notifications'; export const toastNotifications = new ToastNotifications(npSetup.core.notifications.toasts); diff --git a/x-pack/legacy/plugins/spaces/public/copy_saved_objects_to_space/components/copy_to_space_flyout.test.tsx b/x-pack/legacy/plugins/spaces/public/copy_saved_objects_to_space/components/copy_to_space_flyout.test.tsx index d21974c5102e8..28011911e212e 100644 --- a/x-pack/legacy/plugins/spaces/public/copy_saved_objects_to_space/components/copy_to_space_flyout.test.tsx +++ b/x-pack/legacy/plugins/spaces/public/copy_saved_objects_to_space/components/copy_to_space_flyout.test.tsx @@ -17,7 +17,7 @@ import { act } from '@testing-library/react'; import { ProcessingCopyToSpace } from './processing_copy_to_space'; import { spacesManagerMock } from '../../spaces_manager/mocks'; import { SpacesManager } from '../../spaces_manager'; -import { ToastNotifications } from '../../../../../../../src/plugins/kibana_legacy/public'; +import { ToastNotifications } from 'ui/notify/toasts/toast_notifications'; jest.mock('../../../../../../../src/legacy/core_plugins/management/public/legacy', () => ({ setup: mockManagementPlugin.createSetupContract(), diff --git a/x-pack/legacy/plugins/spaces/public/copy_saved_objects_to_space/components/copy_to_space_flyout.tsx b/x-pack/legacy/plugins/spaces/public/copy_saved_objects_to_space/components/copy_to_space_flyout.tsx index f2241f373a45a..f486f2f24f13d 100644 --- a/x-pack/legacy/plugins/spaces/public/copy_saved_objects_to_space/components/copy_to_space_flyout.tsx +++ b/x-pack/legacy/plugins/spaces/public/copy_saved_objects_to_space/components/copy_to_space_flyout.tsx @@ -21,7 +21,7 @@ import { import { mapValues } from 'lodash'; import { i18n } from '@kbn/i18n'; import { FormattedMessage } from '@kbn/i18n/react'; -import { ToastNotifications } from '../../../../../../../src/plugins/kibana_legacy/public'; +import { ToastNotifications } from 'ui/notify/toasts/toast_notifications'; import { SavedObjectsManagementRecord } from '../../../../../../../src/legacy/core_plugins/management/public'; import { ProcessedImportResponse,