Skip to content

Commit

Permalink
fix: [Search:AppSearch:Engines page]Data from page disappears after c…
Browse files Browse the repository at this point in the history
…licking on Last updated date (#201768)

Closes: #200545
Closes: [#8911](elastic/search-team#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: 

<img width="1226" alt="image"
src="https://github.com/user-attachments/assets/cab55d3b-b694-4228-a0a2-7cfa9e0ac16d">

---------

Co-authored-by: kibanamachine <[email protected]>
  • Loading branch information
alexwizp and kibanamachine authored Dec 12, 2024
1 parent 4455087 commit 359ac08
Show file tree
Hide file tree
Showing 5 changed files with 42 additions and 25 deletions.
1 change: 1 addition & 0 deletions x-pack/plugins/enterprise_search/kibana.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
"logsDataAccess",
"esUiShared",
"navigation",
"uiActions"
],
"optionalPlugins": [
"customIntegrations",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand All @@ -52,6 +53,7 @@ describe('renderApp', () => {
security: securityMock.createStart(),
share: sharePluginMock.createStartContract(),
ml: mlPluginMock.createStartContract(),
uiActions: uiActionsPluginMock.createStartContract(),
user: {},
},
updateSideNavDefinition: jest.fn(),
Expand Down
58 changes: 34 additions & 24 deletions x-pack/plugins/enterprise_search/public/applications/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -146,34 +149,41 @@ export const renderApp = (
http,
readOnlyMode,
});

const unmountFlashMessagesLogic = mountFlashMessagesLogic({ notifications });
ReactDOM.render(
<I18nProvider>
<KibanaThemeProvider theme={{ theme$: params.theme$ }}>
<KibanaContextProvider
services={{
...core,
...plugins,
}}
>
<CloudContext>
<Provider store={store}>
<Router history={params.history}>
<App
access={productAccess}
appSearch={appSearch}
configuredLimits={configuredLimits}
enterpriseSearchVersion={enterpriseSearchVersion}
features={features}
kibanaVersion={kibanaVersion}
readOnlyMode={readOnlyMode}
searchOAuth={searchOAuth}
workplaceSearch={workplaceSearch}
/>
</Router>
</Provider>
</CloudContext>
</KibanaContextProvider>
<EuiThemeProvider darkMode={core.theme.getTheme().darkMode}>
<KibanaContextProvider
services={{
...core,
...plugins,
}}
>
<CellActionsProvider
getTriggerCompatibleActions={plugins.uiActions.getTriggerCompatibleActions}
>
<CloudContext>
<Provider store={store}>
<Router history={params.history}>
<App
access={productAccess}
appSearch={appSearch}
configuredLimits={configuredLimits}
enterpriseSearchVersion={enterpriseSearchVersion}
features={features}
kibanaVersion={kibanaVersion}
readOnlyMode={readOnlyMode}
searchOAuth={searchOAuth}
workplaceSearch={workplaceSearch}
/>
</Router>
</Provider>
</CloudContext>
</CellActionsProvider>
</KibanaContextProvider>
</EuiThemeProvider>
</KibanaThemeProvider>
</I18nProvider>,
params.element
Expand Down
4 changes: 3 additions & 1 deletion x-pack/plugins/enterprise_search/public/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand All @@ -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,
Expand Down Expand Up @@ -82,6 +82,7 @@ interface PluginsSetup {
licensing: LicensingPluginStart;
security?: SecurityPluginSetup;
share?: SharePluginSetup;
uiActions: UiActionsSetup;
}

export interface PluginsStart {
Expand All @@ -100,6 +101,7 @@ export interface PluginsStart {
searchPlayground?: SearchPlaygroundPluginStart;
security?: SecurityPluginStart;
share?: SharePluginStart;
uiActions: UiActionsStart;
}

export interface ESConfig {
Expand Down
2 changes: 2 additions & 0 deletions x-pack/plugins/enterprise_search/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -84,5 +84,7 @@
"@kbn/core-security-server-mocks",
"@kbn/unsaved-changes-prompt",
"@kbn/search-navigation",
"@kbn/cell-actions",
"@kbn/ui-actions-plugin",
]
}

0 comments on commit 359ac08

Please sign in to comment.