diff --git a/x-pack/plugins/enterprise_search/public/applications/__mocks__/kea_logic/kibana_logic.mock.ts b/x-pack/plugins/enterprise_search/public/applications/__mocks__/kea_logic/kibana_logic.mock.ts index 9b37c661d923a..5548228b9b64c 100644 --- a/x-pack/plugins/enterprise_search/public/applications/__mocks__/kea_logic/kibana_logic.mock.ts +++ b/x-pack/plugins/enterprise_search/public/applications/__mocks__/kea_logic/kibana_logic.mock.ts @@ -47,6 +47,7 @@ export const mockKibanaValues = { indexMappingComponent: null, isCloud: false, isSidebarEnabled: true, + kibanaVersion: null, lens: { EmbeddableComponent: jest.fn(), stateHelperApi: jest.fn().mockResolvedValue({ diff --git a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/connector_detail/components/docker_instructions_step.tsx b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/connector_detail/components/docker_instructions_step.tsx index 46e7998444729..ea5b59c4d3263 100644 --- a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/connector_detail/components/docker_instructions_step.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/connector_detail/components/docker_instructions_step.tsx @@ -34,12 +34,14 @@ export interface DockerInstructionsStepProps { hasApiKey: boolean; isWaitingForConnector: boolean; serviceType: string; + connectorVersion: string; } export const DockerInstructionsStep: React.FC = ({ connectorId, isWaitingForConnector, serviceType, apiKeyData, + connectorVersion, }) => { const [isOpen, setIsOpen] = React.useState('open'); const { elasticsearchUrl } = useCloudDetails(); @@ -163,7 +165,7 @@ export const DockerInstructionsStep: React.FC = ({ showTopBar={false} languageType="bash" codeSnippet={getRunFromDockerSnippet({ - version: '8.15.0', + version: connectorVersion, })} /> diff --git a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/connector_detail/deployment.tsx b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/connector_detail/deployment.tsx index 2a617a87df8bc..7bf1f101cc71a 100644 --- a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/connector_detail/deployment.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/connector_detail/deployment.tsx @@ -30,6 +30,7 @@ import { ConnectorStatus } from '@kbn/search-connectors'; import { Status } from '../../../../../common/types/api'; +import { KibanaLogic } from '../../../shared/kibana'; import { GetApiKeyByIdLogic } from '../../api/api_key/get_api_key_by_id_api_logic'; import { GenerateConnectorApiKeyApiLogic } from '../../api/connector/generate_connector_api_key_api_logic'; @@ -48,6 +49,7 @@ export const ConnectorDeployment: React.FC = () => { const [selectedDeploymentMethod, setSelectedDeploymentMethod] = useState<'docker' | 'source'>( 'docker' ); + const { kibanaVersion } = useValues(KibanaLogic); const { generatedData, isGenerateLoading } = useValues(DeploymentLogic); const { index, isLoading, connector, connectorId } = useValues(ConnectorViewLogic); const { fetchConnector } = useActions(ConnectorViewLogic); @@ -199,6 +201,7 @@ export const ConnectorDeployment: React.FC = () => { serviceType={connector.service_type ?? ''} isWaitingForConnector={isWaitingForConnector} apiKeyData={apiKey} + connectorVersion={kibanaVersion ?? ''} /> )} diff --git a/x-pack/plugins/enterprise_search/public/applications/index.tsx b/x-pack/plugins/enterprise_search/public/applications/index.tsx index 717379d433dd1..fe3e7a84147ba 100644 --- a/x-pack/plugins/enterprise_search/public/applications/index.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/index.tsx @@ -119,6 +119,7 @@ export const renderApp = ( history, indexMappingComponent, isSidebarEnabled, + kibanaVersion, lens, ml, navigateToUrl, diff --git a/x-pack/plugins/enterprise_search/public/applications/shared/kibana/kibana_logic.ts b/x-pack/plugins/enterprise_search/public/applications/shared/kibana/kibana_logic.ts index 592e20f25f382..b404d0e8fb65d 100644 --- a/x-pack/plugins/enterprise_search/public/applications/shared/kibana/kibana_logic.ts +++ b/x-pack/plugins/enterprise_search/public/applications/shared/kibana/kibana_logic.ts @@ -60,6 +60,7 @@ export interface KibanaLogicProps { history: ScopedHistory; indexMappingComponent?: React.FC; isSidebarEnabled: boolean; + kibanaVersion?: string; lens?: LensPublicStart; ml?: MlPluginStart; navigateToUrl: RequiredFieldsOnly; @@ -94,6 +95,7 @@ export interface KibanaValues { indexMappingComponent: React.FC | null; isCloud: boolean; isSidebarEnabled: boolean; + kibanaVersion: string | null; lens: LensPublicStart | null; ml: MlPluginStart | null; navigateToUrl(path: string, options?: CreateHrefOptions): Promise; @@ -133,6 +135,7 @@ export const KibanaLogic = kea>({ history: [props.history, {}], indexMappingComponent: [props.indexMappingComponent || null, {}], isSidebarEnabled: [props.isSidebarEnabled, {}], + kibanaVersion: [props.kibanaVersion || null, {}], lens: [props.lens || null, {}], ml: [props.ml || null, {}], navigateToUrl: [ diff --git a/x-pack/plugins/enterprise_search/public/plugin.ts b/x-pack/plugins/enterprise_search/public/plugin.ts index 1eb3384d4f9e3..4d2c66eee2e93 100644 --- a/x-pack/plugins/enterprise_search/public/plugin.ts +++ b/x-pack/plugins/enterprise_search/public/plugin.ts @@ -199,7 +199,6 @@ export class EnterpriseSearchPlugin implements Plugin { this.esConfig = { elasticsearch_host: ELASTICSEARCH_URL_PLACEHOLDER }; } - if (!this.config.host) return; // No API to call if (this.hasInitialized) return; // We've already made an initial call try {