Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion x-pack/plugins/enterprise_search/kibana.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"id": "enterpriseSearch",
"version": "kibana",
"kibanaVersion": "kibana",
"requiredPlugins": ["features", "spaces", "security", "licensing", "data", "charts", "infra"],
"requiredPlugins": ["features", "spaces", "security", "licensing", "data", "charts", "infra", "cloud"],
"configPath": ["enterpriseSearch"],
"optionalPlugins": ["usageCollection", "home", "cloud", "customIntegrations"],
"server": true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import {
KibanaPageTemplateSolutionNavAvatar,
NO_DATA_PAGE_TEMPLATE_PROPS,
} from '../../../../../../../../src/plugins/kibana_react/public';
import { Chat } from '../../../../../../cloud/public';
import { APP_SEARCH_PLUGIN, WORKPLACE_SEARCH_PLUGIN } from '../../../../../common/constants';
import { docLinks } from '../../../shared/doc_links';
import { KibanaLogic } from '../../../shared/kibana';
Expand Down Expand Up @@ -173,10 +174,9 @@ export const ProductSelector: React.FC<ProductSelectorProps> = ({
})}
</p>
</EuiText>

<EuiSpacer size="xxl" />

{shouldShowEnterpriseSearchCards ? productCards : insufficientAccessMessage}
<Chat />
</KibanaPageTemplate>
);
};
19 changes: 12 additions & 7 deletions x-pack/plugins/enterprise_search/public/applications/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* 2.0.
*/

import React from 'react';
import React, { FC } from 'react';
import ReactDOM from 'react-dom';
import { Provider } from 'react-redux';
import { Router } from 'react-router-dom';
Expand Down Expand Up @@ -43,6 +43,9 @@ export const renderApp = (
const { publicUrl, errorConnectingMessage, ...initialData } = data;
externalUrl.enterpriseSearchUrl = publicUrl || config.host || '';

const EmptyContext: FC = ({ children }) => <>{children}</>;
const CloudContext = plugins.cloud?.CloudContextProvider || EmptyContext;

resetContext({ createStore: true });
const store = getContext().store;

Expand Down Expand Up @@ -74,12 +77,14 @@ export const renderApp = (
<I18nProvider>
<KibanaThemeProvider theme$={params.theme$}>
<KibanaContextProvider services={{ ...core, ...plugins }}>
<Provider store={store}>
<Router history={params.history}>
<App {...initialData} />
<Toasts />
</Router>
</Provider>
<CloudContext>
<Provider store={store}>
<Router history={params.history}>
<App {...initialData} />
<Toasts />
</Router>
</Provider>
</CloudContext>
</KibanaContextProvider>
</KibanaThemeProvider>
</I18nProvider>,
Expand Down
14 changes: 11 additions & 3 deletions x-pack/plugins/enterprise_search/public/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import {
FeatureCatalogueCategory,
HomePublicPluginSetup,
} from '../../../../src/plugins/home/public';
import { CloudSetup } from '../../cloud/public';
import { CloudSetup, CloudStart } from '../../cloud/public';
import { LicensingPluginStart } from '../../licensing/public';
import { SecurityPluginSetup, SecurityPluginStart } from '../../security/public';

Expand All @@ -47,7 +47,7 @@ interface PluginsSetup {
security: SecurityPluginSetup;
}
export interface PluginsStart {
cloud?: CloudSetup;
cloud?: CloudSetup & CloudStart;
licensing: LicensingPluginStart;
charts: ChartsPluginStart;
data: DataPublicPluginStart;
Expand Down Expand Up @@ -172,10 +172,18 @@ export class EnterpriseSearchPlugin implements Plugin {

public stop() {}

private async getKibanaDeps(core: CoreSetup, params: AppMountParameters, cloud?: CloudSetup) {
private async getKibanaDeps(
core: CoreSetup,
params: AppMountParameters,
cloudSetup?: CloudSetup
) {
// Helper for using start dependencies on mount (instead of setup dependencies)
// and for grouping Kibana-related args together (vs. plugin-specific args)
const [coreStart, pluginsStart] = await core.getStartServices();
const cloud =
cloudSetup && (pluginsStart as PluginsStart).cloud
? { ...cloudSetup, ...(pluginsStart as PluginsStart).cloud }
: undefined;
const plugins = { ...pluginsStart, cloud } as PluginsStart;

return { params, core: coreStart, plugins };
Expand Down