From 7d39c8a1411756b1b1a21c17dadfe87d2726bca7 Mon Sep 17 00:00:00 2001 From: Timothy Sullivan Date: Tue, 27 May 2025 16:28:51 -0700 Subject: [PATCH 1/5] [SharedUX] use core.rendering service for Reporting menus, clean up share modal API --- .../panel_actions/get_csv_panel_action.tsx | 26 +-- .../public/share/share_context_menu/index.ts | 5 +- .../register_csv_modal_reporting.tsx | 93 +++++----- .../register_pdf_png_modal_reporting.tsx | 174 +++++++++--------- .../reporting_panel_content.tsx | 9 +- .../top_nav/share/show_share_modal.tsx | 3 +- .../top_nav/app_menu_actions/get_share.tsx | 3 +- .../share/public/components/context/index.tsx | 4 - .../public/components/share_tabs.test.tsx | 6 - .../public/services/share_menu_manager.tsx | 67 +++---- .../plugins/shared/share/public/types.ts | 3 +- .../plugins/shared/share/tsconfig.json | 1 + .../utils/get_top_nav_config.tsx | 1 - .../private/reporting/public/plugin.ts | 5 +- .../plugins/private/reporting/public/types.ts | 5 +- .../lens/public/app_plugin/lens_top_nav.tsx | 3 - 16 files changed, 194 insertions(+), 214 deletions(-) diff --git a/src/platform/packages/private/kbn-reporting/get_csv_panel_actions/panel_actions/get_csv_panel_action.tsx b/src/platform/packages/private/kbn-reporting/get_csv_panel_actions/panel_actions/get_csv_panel_action.tsx index 3af5b969febe4..56e712e895646 100644 --- a/src/platform/packages/private/kbn-reporting/get_csv_panel_actions/panel_actions/get_csv_panel_action.tsx +++ b/src/platform/packages/private/kbn-reporting/get_csv_panel_actions/panel_actions/get_csv_panel_action.tsx @@ -9,13 +9,7 @@ import { firstValueFrom, Observable } from 'rxjs'; -import { - AnalyticsServiceStart, - CoreSetup, - CoreStart, - I18nStart, - NotificationsSetup, -} from '@kbn/core/public'; +import { CoreSetup, CoreStart, NotificationsSetup } from '@kbn/core/public'; import { DataPublicPluginStart, type SerializedSearchSourceFields } from '@kbn/data-plugin/public'; import { loadSharingDataHelpers, @@ -64,10 +58,7 @@ type StartServices = [ Pick< CoreStart, // required for modules that render React - | 'analytics' - | 'i18n' - | 'theme' - | 'userProfile' + | 'rendering' // used extensively in Reporting share panel action | 'application' | 'uiSettings' @@ -86,8 +77,6 @@ interface Params { interface ExecutionParams { searchModeParams: CsvSearchModeParams; title: string; - analytics: AnalyticsServiceStart; - i18nStart: I18nStart; } type GetCsvActionApi = HasType & @@ -168,7 +157,7 @@ export class ReportingCsvPanelAction implements ActionDefinition { - const [startServices] = await firstValueFrom(this.startServices$); + const [{ rendering }] = await firstValueFrom(this.startServices$); const { searchModeParams, title } = params; const { reportType, decoratedJobParams } = getSearchCsvJobParams({ apiClient: this.apiClient, @@ -182,7 +171,7 @@ export class ReportingCsvPanelAction implements ActionDefinition, diff --git a/src/platform/packages/private/kbn-reporting/public/share/share_context_menu/register_csv_modal_reporting.tsx b/src/platform/packages/private/kbn-reporting/public/share/share_context_menu/register_csv_modal_reporting.tsx index 2b5bc38aa91ce..64b998f96230a 100644 --- a/src/platform/packages/private/kbn-reporting/public/share/share_context_menu/register_csv_modal_reporting.tsx +++ b/src/platform/packages/private/kbn-reporting/public/share/share_context_menu/register_csv_modal_reporting.tsx @@ -28,7 +28,6 @@ export const reportingCsvExportProvider = ({ const getShareMenuItems = ({ objectType, sharingData, - toasts, }: ShareContext): ReturnType => { const licenseCheck = checkLicense(license.check('reporting', 'basic')); const licenseToolTipContent = licenseCheck.message; @@ -76,50 +75,56 @@ export const reportingCsvExportProvider = ({ title: sharingData.title as string, }); - return apiClient - .createReportingShareJob(reportType, decoratedJobParams) - .then(() => firstValueFrom(startServices$)) - .then(([startServices]) => { - toasts.addSuccess({ - title: intl.formatMessage( - { - id: 'reporting.share.modalContent.successfullyQueuedReportNotificationTitle', - defaultMessage: 'Queued report for {objectType}', - }, - { objectType } - ), - text: toMountPoint( - - - - ), - }} - />, - startServices - ), - 'data-test-subj': 'queueReportSuccess', - }); - }) - .catch((error) => { - toasts.addError(error, { - title: intl.formatMessage({ - id: 'reporting.share.modalContent.notification.reportingErrorTitle', - defaultMessage: 'Unable to create report', - }), - toastMessage: ( - // eslint-disable-next-line react/no-danger - - ) as unknown as string, + return firstValueFrom(startServices$).then(([startServices]) => { + const { + notifications: { toasts }, + rendering, + } = startServices; + + return apiClient + .createReportingShareJob(reportType, decoratedJobParams) + .then(() => { + toasts.addSuccess({ + title: intl.formatMessage( + { + id: 'reporting.share.modalContent.successfullyQueuedReportNotificationTitle', + defaultMessage: 'Queued report for {objectType}', + }, + { objectType } + ), + text: toMountPoint( + + + + ), + }} + />, + rendering + ), + 'data-test-subj': 'queueReportSuccess', + }); + }) + .catch((error) => { + toasts.addError(error, { + title: intl.formatMessage({ + id: 'reporting.share.modalContent.notification.reportingErrorTitle', + defaultMessage: 'Unable to create report', + }), + toastMessage: ( + // eslint-disable-next-line react/no-danger + + ) as unknown as string, + }); }); - }); + }); }; const panelTitle = i18n.translate('reporting.share.contextMenu.export.csvReportsButtonLabel', { diff --git a/src/platform/packages/private/kbn-reporting/public/share/share_context_menu/register_pdf_png_modal_reporting.tsx b/src/platform/packages/private/kbn-reporting/public/share/share_context_menu/register_pdf_png_modal_reporting.tsx index 95c04265d39f5..6bbb737833394 100644 --- a/src/platform/packages/private/kbn-reporting/public/share/share_context_menu/register_pdf_png_modal_reporting.tsx +++ b/src/platform/packages/private/kbn-reporting/public/share/share_context_menu/register_pdf_png_modal_reporting.tsx @@ -52,7 +52,6 @@ export const reportingPDFExportProvider = ({ onClose, shareableUrl, shareableUrlForSavedObject, - toasts, ...shareOpts }: ShareContext): ReturnType => { const { enableLinks, showLinks, message } = checkLicense(license.check('reporting', 'gold')); @@ -103,47 +102,52 @@ export const reportingPDFExportProvider = ({ ...getJobParams({ ...jobProviderOptions, optimizedForPrinting }, 'printablePdfV2')(), }); - return apiClient - .createReportingJob('printablePdfV2', decoratedJobParams) - .then(() => firstValueFrom(startServices$)) - .then(([startServices]) => { - toasts.addSuccess({ - title: intl.formatMessage( - { - id: 'reporting.share.modalContent.successfullyQueuedReportNotificationTitle', - defaultMessage: 'Queued report for {objectType}', - }, - { objectType } - ), - text: toMountPoint( - - - - ), - }} - />, - startServices - ), - 'data-test-subj': 'queueReportSuccess', + return firstValueFrom(startServices$).then(([startServices]) => { + const { + notifications: { toasts }, + rendering, + } = startServices; + return apiClient + .createReportingJob('printablePdfV2', decoratedJobParams) + .then(() => { + toasts.addSuccess({ + title: intl.formatMessage( + { + id: 'reporting.share.modalContent.successfullyQueuedReportNotificationTitle', + defaultMessage: 'Queued report for {objectType}', + }, + { objectType } + ), + text: toMountPoint( + + + + ), + }} + />, + rendering + ), + 'data-test-subj': 'queueReportSuccess', + }); + }) + .catch((error: any) => { + toasts.addError(error, { + title: intl.formatMessage({ + id: 'reporting.share.modalContent.notification.reportingErrorTitle', + defaultMessage: 'Unable to create report', + }), + toastMessage: error.body?.message, + }); }); - }) - .catch((error: any) => { - toasts.addError(error, { - title: intl.formatMessage({ - id: 'reporting.share.modalContent.notification.reportingErrorTitle', - defaultMessage: 'Unable to create report', - }), - toastMessage: error.body?.message, - }); - }); + }); }; const generateExportUrlPDF = ({ optimizedForPrinting }: ExportGenerationOpts) => { @@ -192,7 +196,6 @@ export const reportingPNGExportProvider = ({ onClose, shareableUrl, shareableUrlForSavedObject, - toasts, ...shareOpts }: ShareContext): ReturnType | null => { const { enableLinks, showLinks, message } = checkLicense(license.check('reporting', 'gold')); @@ -250,47 +253,54 @@ export const reportingPNGExportProvider = ({ const decoratedJobParams = apiClient.getDecoratedJobParams({ ...getJobParams(jobProviderOptions, 'pngV2')(), }); - return apiClient - .createReportingJob('pngV2', decoratedJobParams) - .then(() => firstValueFrom(startServices$)) - .then(([startServices]) => { - toasts.addSuccess({ - title: intl.formatMessage( - { - id: 'reporting.share.modalContent.successfullyQueuedReportNotificationTitle', - defaultMessage: 'Queued report for {objectType}', - }, - { objectType } - ), - text: toMountPoint( - - - - ), - }} - />, - startServices - ), - 'data-test-subj': 'queueReportSuccess', - }); - }) - .catch((error: any) => { - toasts.addError(error, { - title: intl.formatMessage({ - id: 'reporting.share.modalContent.notification.reportingErrorTitle', - defaultMessage: 'Unable to create report', - }), - toastMessage: error.body?.message, + + return firstValueFrom(startServices$).then(([startServices]) => { + const { + notifications: { toasts }, + rendering, + } = startServices; + + return apiClient + .createReportingJob('pngV2', decoratedJobParams) + .then(() => { + toasts.addSuccess({ + title: intl.formatMessage( + { + id: 'reporting.share.modalContent.successfullyQueuedReportNotificationTitle', + defaultMessage: 'Queued report for {objectType}', + }, + { objectType } + ), + text: toMountPoint( + + + + ), + }} + />, + rendering + ), + 'data-test-subj': 'queueReportSuccess', + }); + }) + .catch((error: any) => { + toasts.addError(error, { + title: intl.formatMessage({ + id: 'reporting.share.modalContent.notification.reportingErrorTitle', + defaultMessage: 'Unable to create report', + }), + toastMessage: error.body?.message, + }); }); - }); + }); }; return { diff --git a/src/platform/packages/private/kbn-reporting/public/share/share_context_menu/reporting_panel_content/reporting_panel_content.tsx b/src/platform/packages/private/kbn-reporting/public/share/share_context_menu/reporting_panel_content/reporting_panel_content.tsx index 97fcec8c598c7..38ca43cacf2a4 100644 --- a/src/platform/packages/private/kbn-reporting/public/share/share_context_menu/reporting_panel_content/reporting_panel_content.tsx +++ b/src/platform/packages/private/kbn-reporting/public/share/share_context_menu/reporting_panel_content/reporting_panel_content.tsx @@ -291,9 +291,12 @@ class ReportingPanelContentUi extends Component private createReportingJob = async () => { const { startServices$, apiClient, intl } = this.props; const [coreStart] = await Rx.firstValueFrom(startServices$); - const decoratedJobParams = apiClient.getDecoratedJobParams(this.props.getJobParams()); - const { toasts } = coreStart.notifications; + const { + rendering, + notifications: { toasts }, + } = coreStart; + const decoratedJobParams = apiClient.getDecoratedJobParams(this.props.getJobParams()); this.setState({ isCreatingReportJob: true }); try { @@ -321,7 +324,7 @@ class ReportingPanelContentUi extends Component ), }} />, - coreStart + rendering ), 'data-test-subj': 'queueReportSuccess', }); diff --git a/src/platform/plugins/shared/dashboard/public/dashboard_app/top_nav/share/show_share_modal.tsx b/src/platform/plugins/shared/dashboard/public/dashboard_app/top_nav/share/show_share_modal.tsx index b886bd070415c..fa15ee9da1383 100644 --- a/src/platform/plugins/shared/dashboard/public/dashboard_app/top_nav/share/show_share_modal.tsx +++ b/src/platform/plugins/shared/dashboard/public/dashboard_app/top_nav/share/show_share_modal.tsx @@ -22,7 +22,7 @@ import { DashboardLocatorParams } from '../../../../common'; import { convertPanelMapToPanelsArray } from '../../../../common/lib/dashboard_panel_converters'; import { SharedDashboardState } from '../../../../common/types'; import { getDashboardBackupService } from '../../../services/dashboard_backup_service'; -import { coreServices, dataService, shareService } from '../../../services/kibana_services'; +import { dataService, shareService } from '../../../services/kibana_services'; import { getDashboardCapabilities } from '../../../utils/get_dashboard_capabilities'; import { DASHBOARD_STATE_STORAGE_KEY } from '../../../utils/urls'; import { shareModalStrings } from '../../_dashboard_app_strings'; @@ -221,7 +221,6 @@ export function ShowShareModal({ params: locatorParams, }, }, - toasts: coreServices.notifications.toasts, shareableUrlLocatorParams: { locator: shareService.url.locators.get( DASHBOARD_APP_LOCATOR diff --git a/src/platform/plugins/shared/discover/public/application/main/components/top_nav/app_menu_actions/get_share.tsx b/src/platform/plugins/shared/discover/public/application/main/components/top_nav/app_menu_actions/get_share.tsx index ab2509a69c826..5afebcabcfc02 100644 --- a/src/platform/plugins/shared/discover/public/application/main/components/top_nav/app_menu_actions/get_share.tsx +++ b/src/platform/plugins/shared/discover/public/application/main/components/top_nav/app_menu_actions/get_share.tsx @@ -54,7 +54,7 @@ export const getShareAppMenuItem = ({ isEsqlMode ); - const { locator, notifications } = services; + const { locator } = services; const appState = stateContainer.appState.getState(); const { timefilter } = services.data.query.timefilter; const timeRange = timefilter.getTime(); @@ -142,7 +142,6 @@ export const getShareAppMenuItem = ({ onClose: () => { anchorElement?.focus(); }, - toasts: notifications.toasts, }); }, }, diff --git a/src/platform/plugins/shared/share/public/components/context/index.tsx b/src/platform/plugins/shared/share/public/components/context/index.tsx index 48a7d4b2af8fd..ff21a9bf39b01 100644 --- a/src/platform/plugins/shared/share/public/components/context/index.tsx +++ b/src/platform/plugins/shared/share/public/components/context/index.tsx @@ -7,8 +7,6 @@ * License v3.0 only", or the "Server Side Public License, v 1". */ -import { ThemeServiceSetup } from '@kbn/core-theme-browser'; -import { I18nStart } from '@kbn/core/public'; import React, { type PropsWithChildren, createContext, useContext } from 'react'; import type { ShareConfigs, ShareTypes, ShowShareMenuOptions } from '../../types'; @@ -16,8 +14,6 @@ import type { ShareConfigs, ShareTypes, ShowShareMenuOptions } from '../../types export interface IShareContext extends Omit { onClose: () => void; shareMenuItems: ShareConfigs[]; - theme: ThemeServiceSetup; - i18n: I18nStart; } const ShareTabsContext = createContext(null); diff --git a/src/platform/plugins/shared/share/public/components/share_tabs.test.tsx b/src/platform/plugins/shared/share/public/components/share_tabs.test.tsx index d11c4024e12c9..03bb67317691f 100644 --- a/src/platform/plugins/shared/share/public/components/share_tabs.test.tsx +++ b/src/platform/plugins/shared/share/public/components/share_tabs.test.tsx @@ -20,9 +20,6 @@ import { BrowserShortUrlClientFactoryCreateParams, BrowserShortUrlClientFactory, } from '../url_service/short_urls/short_url_client_factory'; -import { themeServiceMock } from '@kbn/core-theme-browser-mocks'; -import { i18nServiceMock } from '@kbn/core-i18n-browser-mocks'; -import { toastsServiceMock } from '@kbn/core-notifications-browser-mocks/src/toasts_service.mock'; const navigate = jest.fn(async () => {}); const getUrl = jest.fn( async (location: KibanaLocation, params: LocatorGetUrlParams): Promise => { @@ -66,7 +63,6 @@ const mockShareContext: IShareContext = { }, ], allowShortUrl: true, - theme: themeServiceMock.createStartContract(), objectTypeMeta: { title: 'title', config: { @@ -79,8 +75,6 @@ const mockShareContext: IShareContext = { sharingData: { title: 'title', url: 'url' }, isDirty: false, onClose: jest.fn(), - toasts: toastsServiceMock.createStartContract(), - i18n: i18nServiceMock.createStartContract(), }; const mockGenerateExport = jest.fn(); diff --git a/src/platform/plugins/shared/share/public/services/share_menu_manager.tsx b/src/platform/plugins/shared/share/public/services/share_menu_manager.tsx index 342a817934df3..e213cadecff0a 100644 --- a/src/platform/plugins/shared/share/public/services/share_menu_manager.tsx +++ b/src/platform/plugins/shared/share/public/services/share_menu_manager.tsx @@ -10,9 +10,10 @@ import React from 'react'; import ReactDOM from 'react-dom'; import { toMountPoint } from '@kbn/react-kibana-mount'; -import { CoreStart, ThemeServiceStart, UserProfileService } from '@kbn/core/public'; -import { ShowShareMenuOptions } from '../types'; -import { ShareRegistry } from './share_menu_registry'; +import type { CoreStart } from '@kbn/core/public'; +import type { RenderingService } from '@kbn/core-rendering-browser'; +import type { ShowShareMenuOptions } from '../types'; +import type { ShareRegistry } from './share_menu_registry'; import type { ShareConfigs } from '../types'; import { ShareMenu } from '../components/share_tabs'; @@ -45,13 +46,15 @@ export class ShareMenuManager { onClose, }); - this.toggleShareContextMenu({ - ...options, - onClose, - menuItems, - publicAPIEnabled: !isServerless, - ...core, - }); + this.toggleShareContextMenu( + { + ...options, + onClose, + menuItems, + publicAPIEnabled: !isServerless, + }, + core.rendering + ); }, }; } @@ -61,27 +64,26 @@ export class ShareMenuManager { this.isOpen = false; }; - private toggleShareContextMenu({ - anchorElement, - allowShortUrl, - objectId, - objectType, - objectTypeMeta, - sharingData, - menuItems, - shareableUrl, - shareableUrlLocatorParams, - onClose, - isDirty, - publicAPIEnabled, - ...startServices - }: ShowShareMenuOptions & { - menuItems: ShareConfigs[]; - onClose: () => void; - userProfile: UserProfileService; - theme: ThemeServiceStart; - i18n: CoreStart['i18n']; - }) { + private toggleShareContextMenu( + { + anchorElement, + allowShortUrl, + objectId, + objectType, + objectTypeMeta, + sharingData, + menuItems, + shareableUrl, + shareableUrlLocatorParams, + onClose, + isDirty, + publicAPIEnabled, + }: ShowShareMenuOptions & { + menuItems: ShareConfigs[]; + onClose: () => void; + }, + rendering: RenderingService + ) { if (this.isOpen) { onClose(); return; @@ -110,10 +112,9 @@ export class ShareMenuManager { onClose(); unmount(); }, - ...startServices, }} />, - startServices + rendering ); const openModal = () => { diff --git a/src/platform/plugins/shared/share/public/types.ts b/src/platform/plugins/shared/share/public/types.ts index ba29082f02e91..14ef1841787af 100644 --- a/src/platform/plugins/shared/share/public/types.ts +++ b/src/platform/plugins/shared/share/public/types.ts @@ -11,7 +11,7 @@ import type { ComponentType, ReactNode } from 'react'; import type { InjectedIntl } from '@kbn/i18n-react'; import { EuiContextMenuPanelDescriptor } from '@elastic/eui'; import { EuiContextMenuPanelItemDescriptorEntry } from '@elastic/eui/src/components/context_menu/context_menu'; -import type { Capabilities, ToastsSetup } from '@kbn/core/public'; +import type { Capabilities } from '@kbn/core/public'; import type { EuiIconProps } from '@elastic/eui'; import type { UrlService, LocatorPublic } from '../common/url_service'; import type { BrowserShortUrlClientFactoryCreateParams } from './url_service/short_urls/short_url_client_factory'; @@ -271,7 +271,6 @@ export interface ShareContext { sharingData: { [key: string]: unknown }; isDirty: boolean; onClose: () => void; - toasts: ToastsSetup; } /** diff --git a/src/platform/plugins/shared/share/tsconfig.json b/src/platform/plugins/shared/share/tsconfig.json index 839a25b846a3a..ade524a01cd20 100644 --- a/src/platform/plugins/shared/share/tsconfig.json +++ b/src/platform/plugins/shared/share/tsconfig.json @@ -27,6 +27,7 @@ "@kbn/core-notifications-browser-mocks", "@kbn/core-user-profile-browser", "@kbn/datemath", + "@kbn/core-rendering-browser", ], "exclude": [ "target/**/*", diff --git a/src/platform/plugins/shared/visualizations/public/visualize_app/utils/get_top_nav_config.tsx b/src/platform/plugins/shared/visualizations/public/visualize_app/utils/get_top_nav_config.tsx index 7af9d942c7020..67c2c02a9803f 100644 --- a/src/platform/plugins/shared/visualizations/public/visualize_app/utils/get_top_nav_config.tsx +++ b/src/platform/plugins/shared/visualizations/public/visualize_app/utils/get_top_nav_config.tsx @@ -427,7 +427,6 @@ export const getTopNavConfig = ( }, }, isDirty: hasUnappliedChanges || hasUnsavedChanges, - toasts: toastNotifications, }); } }, diff --git a/x-pack/platform/plugins/private/reporting/public/plugin.ts b/x-pack/platform/plugins/private/reporting/public/plugin.ts index 7426ec3509fec..60fbe13084102 100644 --- a/x-pack/platform/plugins/private/reporting/public/plugin.ts +++ b/x-pack/platform/plugins/private/reporting/public/plugin.ts @@ -115,11 +115,8 @@ export class ReportingPublicPlugin return [ { application: start.application, - analytics: start.analytics, - i18n: start.i18n, - theme: start.theme, - userProfile: start.userProfile, notifications: start.notifications, + rendering: start.rendering, uiSettings: start.uiSettings, }, ...rest, diff --git a/x-pack/platform/plugins/private/reporting/public/types.ts b/x-pack/platform/plugins/private/reporting/public/types.ts index c4b9b5e931c53..986cbcdab06fa 100644 --- a/x-pack/platform/plugins/private/reporting/public/types.ts +++ b/x-pack/platform/plugins/private/reporting/public/types.ts @@ -17,10 +17,7 @@ export type StartServices = [ Pick< CoreStart, // required for modules that render React - | 'analytics' - | 'i18n' - | 'theme' - | 'userProfile' + | 'rendering' // used extensively in Reporting plugin | 'application' | 'notifications' diff --git a/x-pack/platform/plugins/shared/lens/public/app_plugin/lens_top_nav.tsx b/x-pack/platform/plugins/shared/lens/public/app_plugin/lens_top_nav.tsx index abf420d780064..37afb0d36bc1b 100644 --- a/x-pack/platform/plugins/shared/lens/public/app_plugin/lens_top_nav.tsx +++ b/x-pack/platform/plugins/shared/lens/public/app_plugin/lens_top_nav.tsx @@ -322,7 +322,6 @@ export const LensTopNavMenu = ({ dataViewFieldEditor, dataViewEditor, dataViews: dataViewsService, - notifications, } = useKibana().services; const { @@ -705,7 +704,6 @@ export const LensTopNavMenu = ({ onClose: () => { anchorElement?.focus(); }, - toasts: notifications.toasts, }); }, }, @@ -857,7 +855,6 @@ export const LensTopNavMenu = ({ uiSettings, isOnTextBasedMode, lensStore, - notifications.toasts, startServices, ]); From acee1a3ae7f1ae7c62343ee34462621bff9a744b Mon Sep 17 00:00:00 2001 From: kibanamachine <42973632+kibanamachine@users.noreply.github.com> Date: Wed, 28 May 2025 21:43:36 +0000 Subject: [PATCH 2/5] [CI] Auto-commit changed files from 'node scripts/yarn_deduplicate' --- src/platform/plugins/shared/share/tsconfig.json | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/platform/plugins/shared/share/tsconfig.json b/src/platform/plugins/shared/share/tsconfig.json index ade524a01cd20..5304feedd116c 100644 --- a/src/platform/plugins/shared/share/tsconfig.json +++ b/src/platform/plugins/shared/share/tsconfig.json @@ -20,11 +20,7 @@ "@kbn/shared-ux-prompt-not-found", "@kbn/react-kibana-mount", "@kbn/shared-ux-tabbed-modal", - "@kbn/core-theme-browser", "@kbn/test-jest-helpers", - "@kbn/core-theme-browser-mocks", - "@kbn/core-i18n-browser-mocks", - "@kbn/core-notifications-browser-mocks", "@kbn/core-user-profile-browser", "@kbn/datemath", "@kbn/core-rendering-browser", From ad0734537915b3a41ca293dba0142ae3ccbf39df Mon Sep 17 00:00:00 2001 From: kibanamachine <42973632+kibanamachine@users.noreply.github.com> Date: Tue, 3 Jun 2025 20:32:48 +0000 Subject: [PATCH 3/5] [CI] Auto-commit changed files from 'node scripts/yarn_deduplicate' --- src/platform/plugins/shared/share/tsconfig.json | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/platform/plugins/shared/share/tsconfig.json b/src/platform/plugins/shared/share/tsconfig.json index 703812b6cd005..ecbf350e3a722 100644 --- a/src/platform/plugins/shared/share/tsconfig.json +++ b/src/platform/plugins/shared/share/tsconfig.json @@ -23,7 +23,10 @@ "@kbn/core-user-profile-browser", "@kbn/datemath", "@kbn/licensing-plugin", - "@kbn/core-rendering-browser" + "@kbn/core-rendering-browser", + "@kbn/core-theme-browser-mocks", + "@kbn/core-i18n-browser-mocks", + "@kbn/core-notifications-browser-mocks" ], "exclude": ["target/**/*"] } From 87afd592955c134b84ccc6988b148c2920b47dd3 Mon Sep 17 00:00:00 2001 From: Timothy Sullivan Date: Tue, 3 Jun 2025 15:18:52 -0700 Subject: [PATCH 4/5] fix ts --- .../components/export_popover/export_popover.test.tsx | 6 ------ 1 file changed, 6 deletions(-) diff --git a/src/platform/plugins/shared/share/public/components/export_popover/export_popover.test.tsx b/src/platform/plugins/shared/share/public/components/export_popover/export_popover.test.tsx index 27749eb362c92..9e6c968a78b4c 100644 --- a/src/platform/plugins/shared/share/public/components/export_popover/export_popover.test.tsx +++ b/src/platform/plugins/shared/share/public/components/export_popover/export_popover.test.tsx @@ -11,10 +11,7 @@ import React from 'react'; import { render, screen } from '@testing-library/react'; import { userEvent } from '@testing-library/user-event'; import { __IntlProvider as IntlProvider } from '@kbn/i18n-react'; -import { themeServiceMock } from '@kbn/core-theme-browser-mocks'; -import { i18nServiceMock } from '@kbn/core-i18n-browser-mocks'; import { waitForEuiPopoverOpen } from '@elastic/eui/lib/test/rtl'; -import { toastsServiceMock } from '@kbn/core-notifications-browser-mocks/src/toasts_service.mock'; import { ExportMenu } from './export_popover'; import type { IShareContext } from '../context'; @@ -40,7 +37,6 @@ const mockShareContext: IShareContext = { }, ], allowShortUrl: true, - theme: themeServiceMock.createStartContract(), objectTypeMeta: { title: 'title', config: { @@ -53,8 +49,6 @@ const mockShareContext: IShareContext = { sharingData: { title: 'title', url: 'url' }, isDirty: false, onClose: jest.fn(), - toasts: toastsServiceMock.createStartContract(), - i18n: i18nServiceMock.createStartContract(), }; function ExportPopoverRender() { From 197f54b2a071136a219fb06a8c9a0ee307988bd8 Mon Sep 17 00:00:00 2001 From: kibanamachine <42973632+kibanamachine@users.noreply.github.com> Date: Tue, 3 Jun 2025 22:28:28 +0000 Subject: [PATCH 5/5] [CI] Auto-commit changed files from 'node scripts/notice' --- src/platform/plugins/shared/share/tsconfig.json | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/platform/plugins/shared/share/tsconfig.json b/src/platform/plugins/shared/share/tsconfig.json index ecbf350e3a722..4fe2d828a1db5 100644 --- a/src/platform/plugins/shared/share/tsconfig.json +++ b/src/platform/plugins/shared/share/tsconfig.json @@ -24,9 +24,6 @@ "@kbn/datemath", "@kbn/licensing-plugin", "@kbn/core-rendering-browser", - "@kbn/core-theme-browser-mocks", - "@kbn/core-i18n-browser-mocks", - "@kbn/core-notifications-browser-mocks" ], "exclude": ["target/**/*"] }