Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[8.16] [Ent Search Plugin] Fix loading initial plugin data, save kbn version in kea, fix connector img version (#199777) #200528

Merged
merged 1 commit into from
Nov 18, 2024
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
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ export const mockKibanaValues = {
indexMappingComponent: null,
isCloud: false,
isSidebarEnabled: true,
kibanaVersion: null,
lens: {
EmbeddableComponent: jest.fn(),
stateHelperApi: jest.fn().mockResolvedValue({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,14 @@ export interface DockerInstructionsStepProps {
hasApiKey: boolean;
isWaitingForConnector: boolean;
serviceType: string;
connectorVersion: string;
}
export const DockerInstructionsStep: React.FC<DockerInstructionsStepProps> = ({
connectorId,
isWaitingForConnector,
serviceType,
apiKeyData,
connectorVersion,
}) => {
const [isOpen, setIsOpen] = React.useState<EuiAccordionProps['forceState']>('open');
const { elasticsearchUrl } = useCloudDetails();
Expand Down Expand Up @@ -163,7 +165,7 @@ export const DockerInstructionsStep: React.FC<DockerInstructionsStepProps> = ({
showTopBar={false}
languageType="bash"
codeSnippet={getRunFromDockerSnippet({
version: '8.15.0',
version: connectorVersion,
})}
/>
</EuiAccordion>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand All @@ -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);
Expand Down Expand Up @@ -199,6 +201,7 @@ export const ConnectorDeployment: React.FC = () => {
serviceType={connector.service_type ?? ''}
isWaitingForConnector={isWaitingForConnector}
apiKeyData={apiKey}
connectorVersion={kibanaVersion ?? ''}
/>
)}
</>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ export const renderApp = (
history,
indexMappingComponent,
isSidebarEnabled,
kibanaVersion,
lens,
ml,
navigateToUrl,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ export interface KibanaLogicProps {
history: ScopedHistory;
indexMappingComponent?: React.FC<IndexMappingProps>;
isSidebarEnabled: boolean;
kibanaVersion?: string;
lens?: LensPublicStart;
ml?: MlPluginStart;
navigateToUrl: RequiredFieldsOnly<ApplicationStart['navigateToUrl']>;
Expand Down Expand Up @@ -92,6 +93,7 @@ export interface KibanaValues {
indexMappingComponent: React.FC<IndexMappingProps> | null;
isCloud: boolean;
isSidebarEnabled: boolean;
kibanaVersion: string | null;
lens: LensPublicStart | null;
ml: MlPluginStart | null;
navigateToUrl(path: string, options?: CreateHrefOptions): Promise<void>;
Expand Down Expand Up @@ -130,6 +132,7 @@ export const KibanaLogic = kea<MakeLogicType<KibanaValues>>({
history: [props.history, {}],
indexMappingComponent: [props.indexMappingComponent || null, {}],
isSidebarEnabled: [props.isSidebarEnabled, {}],
kibanaVersion: [props.kibanaVersion || null, {}],
lens: [props.lens || null, {}],
ml: [props.ml || null, {}],
navigateToUrl: [
Expand Down
1 change: 0 additions & 1 deletion x-pack/plugins/enterprise_search/public/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down