From d02a27361c3b1eb4d0b1c5e6a844d8e3b7fdce58 Mon Sep 17 00:00:00 2001 From: Tim Sullivan Date: Tue, 7 Jan 2025 07:53:25 -0700 Subject: [PATCH] Preparation for High Contrast Mode, ML domain (#205540) ## Summary **Reviewers: Please test the code paths affected by this PR. See the "Risks" section below.** Part of work for enabling "high contrast mode" in Kibana. See https://github.com/elastic/kibana/issues/205411 **Background:** Kibana will soon have a user profile setting to allow users to enable "high contrast mode." This setting will activate a flag with `` that causes EUI components to render with higher contrast visual elements. Consumer plugins and packages need to be updated selected places where `` is wrapped, to pass the `UserProfileService` service dependency from the CoreStart contract. **NOTE:** **EUI currently does not yet support the high-contrast mode flag**, but support for that is expected to come soon. These first PRs are simply preparing the code by wiring up the `UserProvideService`. ### Checklist Check the PR satisfies following conditions. Reviewers should verify this PR satisfies this list as well. - [X] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios - [X] The PR description includes the appropriate Release Notes section, and the correct `release_note:*` label is applied per the [guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process) ### Risks Does this PR introduce any risks? For example, consider risks like hard to test bugs, performance regression, potential of data loss. Describe the risk, its severity, and mitigation for each identified risk. Invite stakeholders and evaluate how to proceed before merging. - [ ] [medium/high] The implementor of this change did not manually test the affected code paths and relied on type-checking and functional tests to drive the changes. Code owners for this PR need to manually test the affected code paths. - [ ] [medium] The `UserProfileService` dependency comes from the CoreStart contract. If acquiring the service causes synchronous code to become asynchronous, check for race conditions or errors in rendering React components. Code owners for this PR need to manually test the affected code paths. (cherry picked from commit bccf0c99c90d41307d8b2521d43af204c9b614a9) --- .../src/components/date_picker_wrapper.tsx | 3 ++- .../src/hooks/use_date_picker_context.tsx | 12 +++++++++++- .../application/data_drift/data_drift_app_state.tsx | 12 ++++++++++-- .../grid_embeddable/field_stats_wrapper.tsx | 3 ++- .../index_data_visualizer/index_data_visualizer.tsx | 12 ++++++++++-- .../public/app/__mocks__/app_dependencies.tsx | 2 ++ .../transform/public/app/app_dependencies.tsx | 2 ++ .../transform/public/app/mount_management_section.ts | 2 ++ .../create_transform/components/wizard/wizard.tsx | 10 +++++++++- .../platform/plugins/private/transform/tsconfig.json | 3 ++- .../change_point_detection_root.tsx | 10 +++++++++- .../log_categorization_app_state.tsx | 10 +++++++++- .../log_categorization_for_discover_wrapper.tsx | 10 +++++++++- .../components/log_categorization/show_flyout.tsx | 11 +++++++++-- .../log_rate_analysis_app_state.tsx | 10 +++++++++- .../log_rate_analysis_content_wrapper.tsx | 10 +++++++++- .../change_point_chart_initializer.tsx | 10 +++++++++- .../aiops/public/hooks/use_aiops_app_context.ts | 5 +++++ .../shared_components/change_point_detection.tsx | 2 +- .../log_rate_analysis_embeddable_wrapper.tsx | 2 +- .../public/shared_components/pattern_analysis.tsx | 2 +- .../application/aiops/change_point_detection.tsx | 1 + .../public/application/aiops/log_categorization.tsx | 1 + .../public/application/aiops/log_rate_analysis.tsx | 1 + .../plugins/shared/ml/public/application/app.tsx | 12 ++++++++++-- .../model_management/deployment_setup.tsx | 2 +- .../model_management/force_stop_dialog.tsx | 5 ++++- .../single_metric_viewer/single_metric_viewer.tsx | 4 ++-- .../components/log_rate_analysis.tsx | 1 + .../alert_details_app_section/log_rate_analysis.tsx | 1 + .../custom_kql/log_rate_analysis_panel.tsx | 1 + 31 files changed, 146 insertions(+), 26 deletions(-) diff --git a/x-pack/platform/packages/private/ml/date_picker/src/components/date_picker_wrapper.tsx b/x-pack/platform/packages/private/ml/date_picker/src/components/date_picker_wrapper.tsx index bfb20217a43a0..2aabe471efbc5 100644 --- a/x-pack/platform/packages/private/ml/date_picker/src/components/date_picker_wrapper.tsx +++ b/x-pack/platform/packages/private/ml/date_picker/src/components/date_picker_wrapper.tsx @@ -129,6 +129,7 @@ export const DatePickerWrapper: FC = (props) => { notifications: { toasts }, uiSettings: config, uiSettingsKeys, + userProfile, theme, i18n: i18nStart, } = useDatePickerContext(); @@ -221,7 +222,7 @@ export const DatePickerWrapper: FC = (props) => { }} /> , - { theme, i18n: i18nStart } + { theme, i18n: i18nStart, userProfile } ), }, { toastLifeTimeMs: 30000 } diff --git a/x-pack/platform/packages/private/ml/date_picker/src/hooks/use_date_picker_context.tsx b/x-pack/platform/packages/private/ml/date_picker/src/hooks/use_date_picker_context.tsx index e544ad9826226..e59f6790821fb 100644 --- a/x-pack/platform/packages/private/ml/date_picker/src/hooks/use_date_picker_context.tsx +++ b/x-pack/platform/packages/private/ml/date_picker/src/hooks/use_date_picker_context.tsx @@ -9,7 +9,13 @@ import React, { createContext, useContext, type FC, type PropsWithChildren } fro import type { UI_SETTINGS } from '@kbn/data-plugin/common'; import type { DataPublicPluginStart } from '@kbn/data-plugin/public'; -import type { CoreSetup, I18nStart, IUiSettingsClient, ThemeServiceStart } from '@kbn/core/public'; +import type { + CoreSetup, + I18nStart, + IUiSettingsClient, + ThemeServiceStart, + UserProfileService, +} from '@kbn/core/public'; import type { HttpStart } from '@kbn/core/public'; /** @@ -28,6 +34,10 @@ export interface DatePickerDependencies { * notifications service */ notifications: CoreSetup['notifications']; + /** + * Kibana Security User Profile Service + */ + userProfile: UserProfileService; /** * EUI theme */ diff --git a/x-pack/platform/plugins/private/data_visualizer/public/application/data_drift/data_drift_app_state.tsx b/x-pack/platform/plugins/private/data_visualizer/public/application/data_drift/data_drift_app_state.tsx index 24c995ec0652d..e1d525a0250d7 100644 --- a/x-pack/platform/plugins/private/data_visualizer/public/application/data_drift/data_drift_app_state.tsx +++ b/x-pack/platform/plugins/private/data_visualizer/public/application/data_drift/data_drift_app_state.tsx @@ -88,9 +88,17 @@ export const DataDriftDetectionAppState: FC = ( charts, unifiedSearch, }; - const startServices = pick(coreStart, 'analytics', 'i18n', 'theme'); + const startServices = pick(coreStart, 'analytics', 'i18n', 'theme', 'userProfile'); const datePickerDeps = { - ...pick(services, ['data', 'http', 'notifications', 'theme', 'uiSettings', 'i18n']), + ...pick(services, [ + 'data', + 'http', + 'notifications', + 'i18n', + 'theme', + 'userProfile', + 'uiSettings', + ]), uiSettingsKeys: UI_SETTINGS, }; const location = useLocation(); diff --git a/x-pack/platform/plugins/private/data_visualizer/public/application/index_data_visualizer/embeddables/grid_embeddable/field_stats_wrapper.tsx b/x-pack/platform/plugins/private/data_visualizer/public/application/index_data_visualizer/embeddables/grid_embeddable/field_stats_wrapper.tsx index d991f02fb3958..f80766ae1ee78 100644 --- a/x-pack/platform/plugins/private/data_visualizer/public/application/index_data_visualizer/embeddables/grid_embeddable/field_stats_wrapper.tsx +++ b/x-pack/platform/plugins/private/data_visualizer/public/application/index_data_visualizer/embeddables/grid_embeddable/field_stats_wrapper.tsx @@ -150,7 +150,7 @@ const FieldStatisticsWrapper = (props: FieldStatisticTableEmbeddableProps) => { const { overridableServices } = props; const kibanaRenderServices = useMemo( - () => pick(coreStart, 'analytics', 'i18n', 'theme'), + () => pick(coreStart, 'analytics', 'i18n', 'theme', 'userProfile'), // eslint-disable-next-line react-hooks/exhaustive-deps [] ); @@ -168,6 +168,7 @@ const FieldStatisticsWrapper = (props: FieldStatisticTableEmbeddableProps) => { 'notifications', 'theme', 'uiSettings', + 'userProfile', 'i18n', ]), uiSettingsKeys: UI_SETTINGS, diff --git a/x-pack/platform/plugins/private/data_visualizer/public/application/index_data_visualizer/index_data_visualizer.tsx b/x-pack/platform/plugins/private/data_visualizer/public/application/index_data_visualizer/index_data_visualizer.tsx index 68fdc51f92f31..718d764e1c610 100644 --- a/x-pack/platform/plugins/private/data_visualizer/public/application/index_data_visualizer/index_data_visualizer.tsx +++ b/x-pack/platform/plugins/private/data_visualizer/public/application/index_data_visualizer/index_data_visualizer.tsx @@ -329,9 +329,17 @@ export const IndexDataVisualizer: FC = ({ unifiedSearch, }; - const startServices = pick(coreStart, 'analytics', 'i18n', 'theme'); + const startServices = pick(coreStart, 'analytics', 'i18n', 'theme', 'userProfile'); const datePickerDeps: DatePickerDependencies = { - ...pick(services, ['data', 'http', 'notifications', 'theme', 'uiSettings', 'i18n']), + ...pick(services, [ + 'data', + 'http', + 'notifications', + 'theme', + 'uiSettings', + 'userProfile', + 'i18n', + ]), uiSettingsKeys: UI_SETTINGS, showFrozenDataTierChoice, }; diff --git a/x-pack/platform/plugins/private/transform/public/app/__mocks__/app_dependencies.tsx b/x-pack/platform/plugins/private/transform/public/app/__mocks__/app_dependencies.tsx index 49bd43232c9f5..663ac2a9dbc47 100644 --- a/x-pack/platform/plugins/private/transform/public/app/__mocks__/app_dependencies.tsx +++ b/x-pack/platform/plugins/private/transform/public/app/__mocks__/app_dependencies.tsx @@ -27,6 +27,7 @@ import type { AppDependencies } from '../app_dependencies'; import type { SavedObjectsManagementPluginStart } from '@kbn/saved-objects-management-plugin/public'; import { settingsServiceMock } from '@kbn/core-ui-settings-browser-mocks'; import { unifiedSearchPluginMock } from '@kbn/unified-search-plugin/public/mocks'; +import { userProfileServiceMock } from '@kbn/core-user-profile-browser-mocks'; const coreSetup = coreMock.createSetup(); const coreStart = coreMock.createStart(); @@ -92,6 +93,7 @@ const appDependencies: AppDependencies = { storage: { get: jest.fn() } as unknown as Storage, overlays: coreStart.overlays, theme: themeServiceMock.createStartContract(), + userProfile: userProfileServiceMock.createStart(), http: coreSetup.http, history: {} as ScopedHistory, share: { urlGenerators: { getUrlGenerator: jest.fn() } } as unknown as SharePluginStart, diff --git a/x-pack/platform/plugins/private/transform/public/app/app_dependencies.tsx b/x-pack/platform/plugins/private/transform/public/app/app_dependencies.tsx index 9033540ee0d4c..d097b6209052f 100644 --- a/x-pack/platform/plugins/private/transform/public/app/app_dependencies.tsx +++ b/x-pack/platform/plugins/private/transform/public/app/app_dependencies.tsx @@ -18,6 +18,7 @@ import type { SavedObjectsStart, ScopedHistory, ThemeServiceStart, + UserProfileService, } from '@kbn/core/public'; import type { DataPublicPluginStart } from '@kbn/data-plugin/public'; import type { DataViewsPublicPluginStart } from '@kbn/data-views-plugin/public'; @@ -57,6 +58,7 @@ export interface AppDependencies { storage: Storage; overlays: OverlayStart; theme: ThemeServiceStart; + userProfile: UserProfileService; history: ScopedHistory; share: SharePluginStart; spaces?: SpacesPluginStart; diff --git a/x-pack/platform/plugins/private/transform/public/app/mount_management_section.ts b/x-pack/platform/plugins/private/transform/public/app/mount_management_section.ts index 35ae95feb9a44..4fffc76ff4107 100644 --- a/x-pack/platform/plugins/private/transform/public/app/mount_management_section.ts +++ b/x-pack/platform/plugins/private/transform/public/app/mount_management_section.ts @@ -39,6 +39,7 @@ export async function mountManagementSection( i18n, overlays, theme, + userProfile, savedObjects, uiSettings, settings, @@ -79,6 +80,7 @@ export async function mountManagementSection( notifications, overlays, theme, + userProfile, savedObjects, storage: localStorage, uiSettings, diff --git a/x-pack/platform/plugins/private/transform/public/app/sections/create_transform/components/wizard/wizard.tsx b/x-pack/platform/plugins/private/transform/public/app/sections/create_transform/components/wizard/wizard.tsx index 2c078f93627cc..9c723610305ae 100644 --- a/x-pack/platform/plugins/private/transform/public/app/sections/create_transform/components/wizard/wizard.tsx +++ b/x-pack/platform/plugins/private/transform/public/app/sections/create_transform/components/wizard/wizard.tsx @@ -225,7 +225,15 @@ export const Wizard: FC = React.memo(({ cloneConfig, searchItems }) const stepsConfig = [stepDefine, stepDetails, stepCreate]; const datePickerDeps: DatePickerDependencies = { - ...pick(appDependencies, ['data', 'http', 'notifications', 'theme', 'uiSettings', 'i18n']), + ...pick(appDependencies, [ + 'data', + 'http', + 'notifications', + 'theme', + 'uiSettings', + 'userProfile', + 'i18n', + ]), uiSettingsKeys: UI_SETTINGS, showFrozenDataTierChoice: showNodeInfo, }; diff --git a/x-pack/platform/plugins/private/transform/tsconfig.json b/x-pack/platform/plugins/private/transform/tsconfig.json index da992737fba2a..424a0506a6499 100644 --- a/x-pack/platform/plugins/private/transform/tsconfig.json +++ b/x-pack/platform/plugins/private/transform/tsconfig.json @@ -78,7 +78,8 @@ "@kbn/monaco", "@kbn/json-schemas", "@kbn/ml-field-stats-flyout", - "@kbn/ml-validators" + "@kbn/ml-validators", + "@kbn/core-user-profile-browser-mocks" ], "exclude": [ "target/**/*", diff --git a/x-pack/platform/plugins/shared/aiops/public/components/change_point_detection/change_point_detection_root.tsx b/x-pack/platform/plugins/shared/aiops/public/components/change_point_detection/change_point_detection_root.tsx index 420e2b510c62e..392c8f65663df 100644 --- a/x-pack/platform/plugins/shared/aiops/public/components/change_point_detection/change_point_detection_root.tsx +++ b/x-pack/platform/plugins/shared/aiops/public/components/change_point_detection/change_point_detection_root.tsx @@ -65,7 +65,15 @@ export const ChangePointDetectionAppState: FC showFrozenDataTierChoice = true, }) => { const datePickerDeps: DatePickerDependencies = { - ...pick(appContextValue, ['data', 'http', 'notifications', 'theme', 'uiSettings', 'i18n']), + ...pick(appContextValue, [ + 'data', + 'http', + 'notifications', + 'theme', + 'uiSettings', + 'userProfile', + 'i18n', + ]), uiSettingsKeys: UI_SETTINGS, showFrozenDataTierChoice, }; diff --git a/x-pack/platform/plugins/shared/aiops/public/components/log_categorization/log_categorization_app_state.tsx b/x-pack/platform/plugins/shared/aiops/public/components/log_categorization/log_categorization_app_state.tsx index 073316455cb53..5fa57cb2b7e06 100644 --- a/x-pack/platform/plugins/shared/aiops/public/components/log_categorization/log_categorization_app_state.tsx +++ b/x-pack/platform/plugins/shared/aiops/public/components/log_categorization/log_categorization_app_state.tsx @@ -55,7 +55,15 @@ export const LogCategorizationAppState: FC = ({ } const datePickerDeps: DatePickerDependencies = { - ...pick(appContextValue, ['data', 'http', 'notifications', 'theme', 'uiSettings', 'i18n']), + ...pick(appContextValue, [ + 'data', + 'http', + 'notifications', + 'theme', + 'uiSettings', + 'userProfile', + 'i18n', + ]), uiSettingsKeys: UI_SETTINGS, showFrozenDataTierChoice, }; diff --git a/x-pack/platform/plugins/shared/aiops/public/components/log_categorization/log_categorization_for_embeddable/log_categorization_for_discover_wrapper.tsx b/x-pack/platform/plugins/shared/aiops/public/components/log_categorization/log_categorization_for_embeddable/log_categorization_for_discover_wrapper.tsx index 6582ba5333b40..ffdced46592a3 100644 --- a/x-pack/platform/plugins/shared/aiops/public/components/log_categorization/log_categorization_for_embeddable/log_categorization_for_discover_wrapper.tsx +++ b/x-pack/platform/plugins/shared/aiops/public/components/log_categorization/log_categorization_for_embeddable/log_categorization_for_discover_wrapper.tsx @@ -34,7 +34,15 @@ export const LogCategorizationDiscoverWrapper: FC = ({ const casesPermissions = appContextValue.cases?.helpers.canUseCases(); const datePickerDeps: DatePickerDependencies = { - ...pick(appContextValue, ['data', 'http', 'notifications', 'theme', 'uiSettings', 'i18n']), + ...pick(appContextValue, [ + 'data', + 'http', + 'notifications', + 'theme', + 'uiSettings', + 'userProfile', + 'i18n', + ]), uiSettingsKeys: UI_SETTINGS, showFrozenDataTierChoice, }; diff --git a/x-pack/platform/plugins/shared/aiops/public/components/log_rate_analysis/log_rate_analysis_content/log_rate_analysis_content_wrapper.tsx b/x-pack/platform/plugins/shared/aiops/public/components/log_rate_analysis/log_rate_analysis_content/log_rate_analysis_content_wrapper.tsx index 5ba8849474aae..358224d990854 100644 --- a/x-pack/platform/plugins/shared/aiops/public/components/log_rate_analysis/log_rate_analysis_content/log_rate_analysis_content_wrapper.tsx +++ b/x-pack/platform/plugins/shared/aiops/public/components/log_rate_analysis/log_rate_analysis_content/log_rate_analysis_content_wrapper.tsx @@ -80,7 +80,15 @@ export const LogRateAnalysisContentWrapper: FC = ({ } = appContextValue; const datePickerDeps: DatePickerDependencies = { - ...pick(appContextValue, ['data', 'http', 'notifications', 'theme', 'uiSettings', 'i18n']), + ...pick(appContextValue, [ + 'data', + 'http', + 'notifications', + 'theme', + 'uiSettings', + 'userProfile', + 'i18n', + ]), uiSettingsKeys: UI_SETTINGS, }; diff --git a/x-pack/platform/plugins/shared/aiops/public/hooks/use_aiops_app_context.ts b/x-pack/platform/plugins/shared/aiops/public/hooks/use_aiops_app_context.ts index c240ec90bc1df..3710908045e6e 100644 --- a/x-pack/platform/plugins/shared/aiops/public/hooks/use_aiops_app_context.ts +++ b/x-pack/platform/plugins/shared/aiops/public/hooks/use_aiops_app_context.ts @@ -22,6 +22,7 @@ import type { HttpStart, IUiSettingsClient, ThemeServiceStart, + UserProfileService, } from '@kbn/core/public'; import type { LensPublicStart } from '@kbn/lens-plugin/public'; import type { EmbeddableStart } from '@kbn/embeddable-plugin/public'; @@ -90,6 +91,10 @@ export interface AiopsAppContextValue { * Usage collection. */ usageCollection?: UsageCollectionSetup; + /** + * User profile service. + */ + userProfile: UserProfileService; /** * Used to create deep links to other plugins. */ diff --git a/x-pack/platform/plugins/shared/aiops/public/shared_components/change_point_detection.tsx b/x-pack/platform/plugins/shared/aiops/public/shared_components/change_point_detection.tsx index 53997219fd639..97c7b4bf03e15 100644 --- a/x-pack/platform/plugins/shared/aiops/public/shared_components/change_point_detection.tsx +++ b/x-pack/platform/plugins/shared/aiops/public/shared_components/change_point_detection.tsx @@ -101,7 +101,7 @@ const ChangePointDetectionWrapper: FC = ({ }, [coreStart, pluginStart]); const datePickerDeps = { - ...pick(deps, ['data', 'http', 'notifications', 'theme', 'uiSettings', 'i18n']), + ...pick(deps, ['data', 'http', 'notifications', 'theme', 'uiSettings', 'userProfile', 'i18n']), uiSettingsKeys: UI_SETTINGS, }; diff --git a/x-pack/platform/plugins/shared/aiops/public/shared_components/log_rate_analysis_embeddable_wrapper.tsx b/x-pack/platform/plugins/shared/aiops/public/shared_components/log_rate_analysis_embeddable_wrapper.tsx index f08f4f0e68bd9..5a8140b155745 100644 --- a/x-pack/platform/plugins/shared/aiops/public/shared_components/log_rate_analysis_embeddable_wrapper.tsx +++ b/x-pack/platform/plugins/shared/aiops/public/shared_components/log_rate_analysis_embeddable_wrapper.tsx @@ -90,7 +90,7 @@ const LogRateAnalysisEmbeddableWrapperWithDeps: FC }, [coreStart, pluginStart]); const datePickerDeps = { - ...pick(deps, ['data', 'http', 'notifications', 'theme', 'uiSettings', 'i18n']), + ...pick(deps, ['data', 'http', 'notifications', 'theme', 'uiSettings', 'userProfile', 'i18n']), uiSettingsKeys: UI_SETTINGS, }; diff --git a/x-pack/platform/plugins/shared/aiops/public/shared_components/pattern_analysis.tsx b/x-pack/platform/plugins/shared/aiops/public/shared_components/pattern_analysis.tsx index f601474a5707f..3578f7a14570a 100644 --- a/x-pack/platform/plugins/shared/aiops/public/shared_components/pattern_analysis.tsx +++ b/x-pack/platform/plugins/shared/aiops/public/shared_components/pattern_analysis.tsx @@ -98,7 +98,7 @@ const PatternAnalysisWrapper: FC = ({ }, [coreStart, pluginStart]); const datePickerDeps = { - ...pick(deps, ['data', 'http', 'notifications', 'theme', 'uiSettings', 'i18n']), + ...pick(deps, ['data', 'http', 'notifications', 'theme', 'uiSettings', 'userProfile', 'i18n']), uiSettingsKeys: UI_SETTINGS, }; diff --git a/x-pack/platform/plugins/shared/ml/public/application/aiops/change_point_detection.tsx b/x-pack/platform/plugins/shared/ml/public/application/aiops/change_point_detection.tsx index 2d4c06321e8da..f5662677a5ba1 100644 --- a/x-pack/platform/plugins/shared/ml/public/application/aiops/change_point_detection.tsx +++ b/x-pack/platform/plugins/shared/ml/public/application/aiops/change_point_detection.tsx @@ -72,6 +72,7 @@ export const ChangePointDetectionPage: FC = () => { 'uiSettings', 'unifiedSearch', 'usageCollection', + 'userProfile', ]), fieldStats: { useFieldStatsTrigger, FieldStatsFlyoutProvider }, }} diff --git a/x-pack/platform/plugins/shared/ml/public/application/aiops/log_categorization.tsx b/x-pack/platform/plugins/shared/ml/public/application/aiops/log_categorization.tsx index 2dc34ba80a080..6ee92eb71b1d8 100644 --- a/x-pack/platform/plugins/shared/ml/public/application/aiops/log_categorization.tsx +++ b/x-pack/platform/plugins/shared/ml/public/application/aiops/log_categorization.tsx @@ -63,6 +63,7 @@ export const LogCategorizationPage: FC = () => { 'uiActions', 'uiSettings', 'unifiedSearch', + 'userProfile', 'embeddable', 'cases', ]), diff --git a/x-pack/platform/plugins/shared/ml/public/application/aiops/log_rate_analysis.tsx b/x-pack/platform/plugins/shared/ml/public/application/aiops/log_rate_analysis.tsx index 01f4d2d7be74f..2346a128a5a75 100644 --- a/x-pack/platform/plugins/shared/ml/public/application/aiops/log_rate_analysis.tsx +++ b/x-pack/platform/plugins/shared/ml/public/application/aiops/log_rate_analysis.tsx @@ -57,6 +57,7 @@ export const LogRateAnalysisPage: FC = () => { 'theme', 'uiActions', 'uiSettings', + 'userProfile', 'unifiedSearch', 'observabilityAIAssistant', 'embeddable', diff --git a/x-pack/platform/plugins/shared/ml/public/application/app.tsx b/x-pack/platform/plugins/shared/ml/public/application/app.tsx index d2bc17ab210b9..37e1c6e186d1f 100644 --- a/x-pack/platform/plugins/shared/ml/public/application/app.tsx +++ b/x-pack/platform/plugins/shared/ml/public/application/app.tsx @@ -122,9 +122,17 @@ const App: FC = ({ if (!licenseReady || !mlCapabilities) return null; - const startServices = pick(coreStart, 'analytics', 'i18n', 'theme'); + const startServices = pick(coreStart, 'analytics', 'i18n', 'theme', 'userProfile'); const datePickerDeps: DatePickerDependencies = { - ...pick(services, ['data', 'http', 'notifications', 'theme', 'uiSettings', 'i18n']), + ...pick(services, [ + 'data', + 'http', + 'notifications', + 'theme', + 'uiSettings', + 'userProfile', + 'i18n', + ]), uiSettingsKeys: UI_SETTINGS, showFrozenDataTierChoice: !isServerless, }; diff --git a/x-pack/platform/plugins/shared/ml/public/application/model_management/deployment_setup.tsx b/x-pack/platform/plugins/shared/ml/public/application/model_management/deployment_setup.tsx index c5b38feb4c799..72032dbd49768 100644 --- a/x-pack/platform/plugins/shared/ml/public/application/model_management/deployment_setup.tsx +++ b/x-pack/platform/plugins/shared/ml/public/application/model_management/deployment_setup.tsx @@ -840,7 +840,7 @@ export const StartUpdateDeploymentModal: FC = ({ export const getUserInputModelDeploymentParamsProvider = ( overlays: OverlayStart, - startServices: Pick, + startServices: Pick, startModelDeploymentDocUrl: string, cloudInfo: CloudInfo, showNodeInfo: boolean, diff --git a/x-pack/platform/plugins/shared/ml/public/application/model_management/force_stop_dialog.tsx b/x-pack/platform/plugins/shared/ml/public/application/model_management/force_stop_dialog.tsx index 8685ba63b51d5..ffa69d64e6de5 100644 --- a/x-pack/platform/plugins/shared/ml/public/application/model_management/force_stop_dialog.tsx +++ b/x-pack/platform/plugins/shared/ml/public/application/model_management/force_stop_dialog.tsx @@ -219,7 +219,10 @@ export const StopModelDeploymentsConfirmDialog: FC) => + ( + overlays: OverlayStart, + startServices: Pick + ) => async (forceStopModel: NLPModelItem): Promise => { return new Promise(async (resolve, reject) => { try { diff --git a/x-pack/platform/plugins/shared/ml/public/shared_components/single_metric_viewer/single_metric_viewer.tsx b/x-pack/platform/plugins/shared/ml/public/shared_components/single_metric_viewer/single_metric_viewer.tsx index 39f22e2e988db..4f913ba941e5a 100644 --- a/x-pack/platform/plugins/shared/ml/public/shared_components/single_metric_viewer/single_metric_viewer.tsx +++ b/x-pack/platform/plugins/shared/ml/public/shared_components/single_metric_viewer/single_metric_viewer.tsx @@ -124,9 +124,9 @@ const SingleMetricViewerWrapper: FC = ({ const isMounted = useMountedState(); const { mlApi, mlTimeSeriesExplorerService, toastNotificationService } = mlServices; - const startServices = pick(coreStart, 'analytics', 'i18n', 'theme'); + const startServices = pick(coreStart, 'analytics', 'i18n', 'theme', 'userProfile'); const datePickerDeps: DatePickerDependencies = { - ...pick(coreStart, ['http', 'notifications', 'theme', 'uiSettings', 'i18n']), + ...pick(coreStart, ['http', 'notifications', 'theme', 'uiSettings', 'userProfile', 'i18n']), data: pluginStart.data, uiSettingsKeys: UI_SETTINGS, showFrozenDataTierChoice: false, diff --git a/x-pack/solutions/observability/plugins/infra/public/alerting/log_threshold/components/alert_details_app_section/components/log_rate_analysis.tsx b/x-pack/solutions/observability/plugins/infra/public/alerting/log_threshold/components/alert_details_app_section/components/log_rate_analysis.tsx index a399414f24c54..7c25336a15239 100644 --- a/x-pack/solutions/observability/plugins/infra/public/alerting/log_threshold/components/alert_details_app_section/components/log_rate_analysis.tsx +++ b/x-pack/solutions/observability/plugins/infra/public/alerting/log_threshold/components/alert_details_app_section/components/log_rate_analysis.tsx @@ -230,6 +230,7 @@ export const LogRateAnalysis: FC = ({ r 'uiSettings', 'unifiedSearch', 'theme', + 'userProfile', 'lens', 'i18n', ]), diff --git a/x-pack/solutions/observability/plugins/observability/public/components/custom_threshold/components/alert_details_app_section/log_rate_analysis.tsx b/x-pack/solutions/observability/plugins/observability/public/components/custom_threshold/components/alert_details_app_section/log_rate_analysis.tsx index 89e8cc5e2aa6a..45950968cfcd1 100644 --- a/x-pack/solutions/observability/plugins/observability/public/components/custom_threshold/components/alert_details_app_section/log_rate_analysis.tsx +++ b/x-pack/solutions/observability/plugins/observability/public/components/custom_threshold/components/alert_details_app_section/log_rate_analysis.tsx @@ -201,6 +201,7 @@ export function LogRateAnalysis({ alert, dataView, services }: AlertDetailsLogRa 'uiSettings', 'unifiedSearch', 'theme', + 'userProfile', 'lens', 'i18n', ]), diff --git a/x-pack/solutions/observability/plugins/slo/public/components/alert_details/components/custom_panels/custom_kql/log_rate_analysis_panel.tsx b/x-pack/solutions/observability/plugins/slo/public/components/alert_details/components/custom_panels/custom_kql/log_rate_analysis_panel.tsx index 69826dd64dc14..da6d2c6fda884 100644 --- a/x-pack/solutions/observability/plugins/slo/public/components/alert_details/components/custom_panels/custom_kql/log_rate_analysis_panel.tsx +++ b/x-pack/solutions/observability/plugins/slo/public/components/alert_details/components/custom_panels/custom_kql/log_rate_analysis_panel.tsx @@ -302,6 +302,7 @@ export function LogRateAnalysisPanel({ slo, alert, rule }: Props) { 'uiSettings', 'unifiedSearch', 'theme', + 'userProfile', 'lens', 'i18n', ]),