From 359ac089de749c792fb1910229e94d5155d67921 Mon Sep 17 00:00:00 2001 From: Alexey Antonov Date: Thu, 12 Dec 2024 16:10:06 +0200 Subject: [PATCH] fix: [Search:AppSearch:Engines page]Data from page disappears after clicking on Last updated date (#201768) Closes: #200545 Closes: [#8911](https://github.com/elastic/search-team/issues/8911) ## Description When user clicks date button it should activate correct action, or open the new page. In this case, all data disappears from the page which is unexpected. Found while testing for accessibility, but applicable to all users. ## What was changed?: 1. Since LogsStream still uses `euiStyled`, and we use it in multiple places, we need to set up `EuiThemeProvider` and `CellActionsProvider`. ## Screen: image --------- Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com> --- x-pack/plugins/enterprise_search/kibana.jsonc | 1 + .../public/applications/index.test.tsx | 2 + .../public/applications/index.tsx | 58 +++++++++++-------- .../enterprise_search/public/plugin.ts | 4 +- .../plugins/enterprise_search/tsconfig.json | 2 + 5 files changed, 42 insertions(+), 25 deletions(-) diff --git a/x-pack/plugins/enterprise_search/kibana.jsonc b/x-pack/plugins/enterprise_search/kibana.jsonc index 1d378a8e95d8d..a484cf625c0ae 100644 --- a/x-pack/plugins/enterprise_search/kibana.jsonc +++ b/x-pack/plugins/enterprise_search/kibana.jsonc @@ -21,6 +21,7 @@ "logsDataAccess", "esUiShared", "navigation", + "uiActions" ], "optionalPlugins": [ "customIntegrations", diff --git a/x-pack/plugins/enterprise_search/public/applications/index.test.tsx b/x-pack/plugins/enterprise_search/public/applications/index.test.tsx index 1866d568af62f..81827172acc6d 100644 --- a/x-pack/plugins/enterprise_search/public/applications/index.test.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/index.test.tsx @@ -26,6 +26,7 @@ import { mlPluginMock } from '@kbn/ml-plugin/public/mocks'; import { navigationPluginMock } from '@kbn/navigation-plugin/public/mocks'; import { securityMock } from '@kbn/security-plugin/public/mocks'; import { sharePluginMock } from '@kbn/share-plugin/public/mocks'; +import { uiActionsPluginMock } from '@kbn/ui-actions-plugin/public/mocks'; import { AppSearch } from './app_search'; import { EnterpriseSearchOverview } from './enterprise_search_overview'; @@ -52,6 +53,7 @@ describe('renderApp', () => { security: securityMock.createStart(), share: sharePluginMock.createStartContract(), ml: mlPluginMock.createStartContract(), + uiActions: uiActionsPluginMock.createStartContract(), user: {}, }, updateSideNavDefinition: jest.fn(), diff --git a/x-pack/plugins/enterprise_search/public/applications/index.tsx b/x-pack/plugins/enterprise_search/public/applications/index.tsx index d934932dd163f..273bf1726cc51 100644 --- a/x-pack/plugins/enterprise_search/public/applications/index.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/index.tsx @@ -14,8 +14,11 @@ import { Store } from 'redux'; import { of } from 'rxjs'; +import { CellActionsProvider } from '@kbn/cell-actions'; + import { AppMountParameters, CoreStart } from '@kbn/core/public'; import { I18nProvider } from '@kbn/i18n-react'; +import { EuiThemeProvider } from '@kbn/kibana-react-plugin/common'; import { KibanaContextProvider } from '@kbn/kibana-react-plugin/public'; import { KibanaThemeProvider } from '@kbn/react-kibana-context-theme'; @@ -146,34 +149,41 @@ export const renderApp = ( http, readOnlyMode, }); + const unmountFlashMessagesLogic = mountFlashMessagesLogic({ notifications }); ReactDOM.render( - - - - - - - - - + + + + + + + + + + + + + , params.element diff --git a/x-pack/plugins/enterprise_search/public/plugin.ts b/x-pack/plugins/enterprise_search/public/plugin.ts index b80af39c40da7..0f90f60d29749 100644 --- a/x-pack/plugins/enterprise_search/public/plugin.ts +++ b/x-pack/plugins/enterprise_search/public/plugin.ts @@ -23,7 +23,6 @@ import { AppStatus, } from '@kbn/core/public'; import { DataPublicPluginStart } from '@kbn/data-plugin/public'; - import { GuidedOnboardingPluginStart } from '@kbn/guided-onboarding-plugin/public'; import type { HomePublicPluginSetup } from '@kbn/home-plugin/public'; import { i18n } from '@kbn/i18n'; @@ -38,6 +37,7 @@ import type { SearchNavigationPluginStart } from '@kbn/search-navigation/public' import { SearchPlaygroundPluginStart } from '@kbn/search-playground/public'; import { SecurityPluginSetup, SecurityPluginStart } from '@kbn/security-plugin/public'; import { SharePluginSetup, SharePluginStart } from '@kbn/share-plugin/public'; +import { UiActionsSetup, UiActionsStart } from '@kbn/ui-actions-plugin/public'; import { ANALYTICS_PLUGIN, @@ -82,6 +82,7 @@ interface PluginsSetup { licensing: LicensingPluginStart; security?: SecurityPluginSetup; share?: SharePluginSetup; + uiActions: UiActionsSetup; } export interface PluginsStart { @@ -100,6 +101,7 @@ export interface PluginsStart { searchPlayground?: SearchPlaygroundPluginStart; security?: SecurityPluginStart; share?: SharePluginStart; + uiActions: UiActionsStart; } export interface ESConfig { diff --git a/x-pack/plugins/enterprise_search/tsconfig.json b/x-pack/plugins/enterprise_search/tsconfig.json index bd716c8ac169f..f06262024ce68 100644 --- a/x-pack/plugins/enterprise_search/tsconfig.json +++ b/x-pack/plugins/enterprise_search/tsconfig.json @@ -84,5 +84,7 @@ "@kbn/core-security-server-mocks", "@kbn/unsaved-changes-prompt", "@kbn/search-navigation", + "@kbn/cell-actions", + "@kbn/ui-actions-plugin", ] }