From d3c3ebee0e8c84528b40afa0431a4c6cd71f92eb Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Efe=20G=C3=BCrkan=20YALAMAN?=
Date: Mon, 31 Jul 2023 15:19:06 +0200
Subject: [PATCH 01/17] Move serverless panels to a separate shareable package
---
package.json | 1 +
packages/kbn-serverless-api-panels/README.md | 3 +
.../components/code_box.scss | 3 +
.../components/code_box.tsx | 144 +++++++++++++++++
.../components/github_link.tsx | 32 ++++
.../components}/ingest_data.tsx | 21 ++-
.../components}/install_client.tsx | 32 +++-
.../components}/integrations_panel.tsx | 28 +++-
.../components}/language_client_panel.tsx | 16 +-
.../components}/overview_panel.tsx | 7 +-
.../components}/select_client.scss | 0
.../components}/select_client.tsx | 18 ++-
.../components/try_in_console_button.tsx | 46 ++++++
.../kbn-serverless-api-panels/constants.ts | 16 ++
packages/kbn-serverless-api-panels/index.tsx | 67 ++++++++
.../kbn-serverless-api-panels/jest.config.js | 13 ++
.../kbn-serverless-api-panels/kibana.jsonc | 5 +
.../languages/console.ts | 37 +++++
.../languages/curl.ts | 68 ++++++++
.../kbn-serverless-api-panels/languages/go.ts | 105 ++++++++++++
.../languages/javascript.ts | 118 ++++++++++++++
.../languages/languages.ts | 26 +++
.../languages/php.ts | 149 ++++++++++++++++++
.../languages/python.ts | 71 +++++++++
.../languages/ruby.ts | 62 ++++++++
.../languages/types.ts | 44 ++++++
.../kbn-serverless-api-panels/package.json | 6 +
.../kbn-serverless-api-panels/tsconfig.json | 21 +++
tsconfig.base.json | 2 +
.../application/components/indexing_api.tsx | 7 +-
.../application/components/overview.tsx | 75 ++++-----
.../overview_panels/ingest_data.scss | 3 -
yarn.lock | 4 +
33 files changed, 1167 insertions(+), 83 deletions(-)
create mode 100644 packages/kbn-serverless-api-panels/README.md
create mode 100644 packages/kbn-serverless-api-panels/components/code_box.scss
create mode 100644 packages/kbn-serverless-api-panels/components/code_box.tsx
create mode 100644 packages/kbn-serverless-api-panels/components/github_link.tsx
rename {x-pack/plugins/serverless_search/public/application/components/overview_panels => packages/kbn-serverless-api-panels/components}/ingest_data.tsx (89%)
rename {x-pack/plugins/serverless_search/public/application/components/overview_panels => packages/kbn-serverless-api-panels/components}/install_client.tsx (80%)
rename {x-pack/plugins/serverless_search/public/application/components/overview_panels => packages/kbn-serverless-api-panels/components}/integrations_panel.tsx (88%)
rename {x-pack/plugins/serverless_search/public/application/components/overview_panels => packages/kbn-serverless-api-panels/components}/language_client_panel.tsx (83%)
rename {x-pack/plugins/serverless_search/public/application/components/overview_panels => packages/kbn-serverless-api-panels/components}/overview_panel.tsx (88%)
rename {x-pack/plugins/serverless_search/public/application/components/overview_panels => packages/kbn-serverless-api-panels/components}/select_client.scss (100%)
rename {x-pack/plugins/serverless_search/public/application/components/overview_panels => packages/kbn-serverless-api-panels/components}/select_client.tsx (89%)
create mode 100644 packages/kbn-serverless-api-panels/components/try_in_console_button.tsx
create mode 100644 packages/kbn-serverless-api-panels/constants.ts
create mode 100644 packages/kbn-serverless-api-panels/index.tsx
create mode 100644 packages/kbn-serverless-api-panels/jest.config.js
create mode 100644 packages/kbn-serverless-api-panels/kibana.jsonc
create mode 100644 packages/kbn-serverless-api-panels/languages/console.ts
create mode 100644 packages/kbn-serverless-api-panels/languages/curl.ts
create mode 100644 packages/kbn-serverless-api-panels/languages/go.ts
create mode 100644 packages/kbn-serverless-api-panels/languages/javascript.ts
create mode 100644 packages/kbn-serverless-api-panels/languages/languages.ts
create mode 100644 packages/kbn-serverless-api-panels/languages/php.ts
create mode 100644 packages/kbn-serverless-api-panels/languages/python.ts
create mode 100644 packages/kbn-serverless-api-panels/languages/ruby.ts
create mode 100644 packages/kbn-serverless-api-panels/languages/types.ts
create mode 100644 packages/kbn-serverless-api-panels/package.json
create mode 100644 packages/kbn-serverless-api-panels/tsconfig.json
delete mode 100644 x-pack/plugins/serverless_search/public/application/components/overview_panels/ingest_data.scss
diff --git a/package.json b/package.json
index 53f5526bf73dd..d09c630512c95 100644
--- a/package.json
+++ b/package.json
@@ -623,6 +623,7 @@
"@kbn/server-http-tools": "link:packages/kbn-server-http-tools",
"@kbn/server-route-repository": "link:packages/kbn-server-route-repository",
"@kbn/serverless": "link:x-pack/plugins/serverless",
+ "@kbn/serverless-api-panels": "link:packages/kbn-serverless-api-panels",
"@kbn/serverless-observability": "link:x-pack/plugins/serverless_observability",
"@kbn/serverless-project-switcher": "link:packages/serverless/project_switcher",
"@kbn/serverless-search": "link:x-pack/plugins/serverless_search",
diff --git a/packages/kbn-serverless-api-panels/README.md b/packages/kbn-serverless-api-panels/README.md
new file mode 100644
index 0000000000000..0d1518711c9f2
--- /dev/null
+++ b/packages/kbn-serverless-api-panels/README.md
@@ -0,0 +1,3 @@
+# @kbn/serverless-api-panels
+
+Empty package generated by @kbn/generate
diff --git a/packages/kbn-serverless-api-panels/components/code_box.scss b/packages/kbn-serverless-api-panels/components/code_box.scss
new file mode 100644
index 0000000000000..b04dbe0ffba42
--- /dev/null
+++ b/packages/kbn-serverless-api-panels/components/code_box.scss
@@ -0,0 +1,3 @@
+.serverlessSearchCodeBoxPanel {
+ border-top: $euiBorderThin $euiColorLightShade;
+}
diff --git a/packages/kbn-serverless-api-panels/components/code_box.tsx b/packages/kbn-serverless-api-panels/components/code_box.tsx
new file mode 100644
index 0000000000000..7eb3df40e18c2
--- /dev/null
+++ b/packages/kbn-serverless-api-panels/components/code_box.tsx
@@ -0,0 +1,144 @@
+/*
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
+ * or more contributor license agreements. Licensed under the Elastic License
+ * 2.0 and the Server Side Public License, v 1; you may not use this file except
+ * in compliance with, at your election, the Elastic License 2.0 or the Server
+ * Side Public License, v 1.
+ */
+
+import {
+ EuiButtonEmpty,
+ EuiCodeBlock,
+ EuiContextMenuItem,
+ EuiContextMenuPanel,
+ EuiCopy,
+ EuiFlexGroup,
+ EuiFlexItem,
+ EuiHorizontalRule,
+ EuiPanel,
+ EuiPopover,
+ EuiThemeProvider,
+} from '@elastic/eui';
+import { i18n } from '@kbn/i18n';
+import React, { useState } from 'react';
+import { consoleDefinition } from '../languages/console';
+import { LanguageDefinition, LanguageDefinitionSnippetArguments } from '../languages/types';
+import { TryInConsoleButton } from './try_in_console_button';
+import './code_box.scss';
+
+interface CodeBoxProps {
+ languages: LanguageDefinition[];
+ code: keyof LanguageDefinition;
+ codeArgs: LanguageDefinitionSnippetArguments;
+ // overrides the language type for syntax highlighting
+ languageType?: string;
+ selectedLanguage: LanguageDefinition;
+ setSelectedLanguage: (language: LanguageDefinition) => void;
+ http: any;
+ pluginId: string;
+ useKibanaServicesHook: any;
+}
+
+const getCodeSnippet = (
+ language: Partial,
+ key: keyof LanguageDefinition,
+ args: LanguageDefinitionSnippetArguments
+): string => {
+ const snippetVal = language[key];
+ if (snippetVal === undefined) return '';
+ if (typeof snippetVal === 'string') return snippetVal;
+ return snippetVal(args);
+};
+
+export const CodeBox: React.FC = ({
+ code,
+ codeArgs,
+ languages,
+ languageType,
+ selectedLanguage,
+ setSelectedLanguage,
+ http,
+ pluginId,
+ useKibanaServicesHook,
+}) => {
+ const [isPopoverOpen, setIsPopoverOpen] = useState(false);
+ const items = languages.map((language) => (
+ {
+ setSelectedLanguage(language);
+ setIsPopoverOpen(false);
+ }}
+ >
+ {language.name}
+
+ ));
+
+ const button = (
+
+ setIsPopoverOpen(!isPopoverOpen)}
+ >
+ {selectedLanguage.name}
+
+
+ );
+ const codeSnippet = getCodeSnippet(selectedLanguage, code, codeArgs);
+ const showTryInConsole = code in consoleDefinition;
+
+ return (
+
+
+
+
+
+ setIsPopoverOpen(false)}
+ panelPaddingSize="none"
+ anchorPosition="downLeft"
+ >
+
+
+
+
+
+
+ {(copy) => (
+
+ {i18n.translate('xpack.serverlessSearch.codeBox.copyButtonLabel', {
+ defaultMessage: 'Copy',
+ })}
+
+ )}
+
+
+ {showTryInConsole && (
+
+
+
+ )}
+
+
+
+ {codeSnippet}
+
+
+
+ );
+};
diff --git a/packages/kbn-serverless-api-panels/components/github_link.tsx b/packages/kbn-serverless-api-panels/components/github_link.tsx
new file mode 100644
index 0000000000000..b89bfd36ae611
--- /dev/null
+++ b/packages/kbn-serverless-api-panels/components/github_link.tsx
@@ -0,0 +1,32 @@
+/*
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
+ * or more contributor license agreements. Licensed under the Elastic License
+ * 2.0 and the Server Side Public License, v 1; you may not use this file except
+ * in compliance with, at your election, the Elastic License 2.0 or the Server
+ * Side Public License, v 1.
+ */
+
+import { EuiFlexGroup, EuiFlexItem, EuiIcon, EuiText, EuiLink } from '@elastic/eui';
+import React from 'react';
+
+export const GithubLink: React.FC<{
+ label: string;
+ href: string;
+ http: any;
+ pluginId: string;
+}> = ({ label, href, http, pluginId }) => {
+ return (
+
+
+
+
+
+
+
+ {label}
+
+
+
+
+ );
+};
diff --git a/x-pack/plugins/serverless_search/public/application/components/overview_panels/ingest_data.tsx b/packages/kbn-serverless-api-panels/components/ingest_data.tsx
similarity index 89%
rename from x-pack/plugins/serverless_search/public/application/components/overview_panels/ingest_data.tsx
rename to packages/kbn-serverless-api-panels/components/ingest_data.tsx
index 6dd7459b91783..f67941abd39e1 100644
--- a/x-pack/plugins/serverless_search/public/application/components/overview_panels/ingest_data.tsx
+++ b/packages/kbn-serverless-api-panels/components/ingest_data.tsx
@@ -1,15 +1,15 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
- * 2.0; you may not use this file except in compliance with the Elastic License
- * 2.0.
+ * 2.0 and the Server Side Public License, v 1; you may not use this file except
+ * in compliance with, at your election, the Elastic License 2.0 or the Server
+ * Side Public License, v 1.
*/
import { EuiCheckableCard, EuiFormFieldset, EuiSpacer, EuiText, EuiTitle } from '@elastic/eui';
import { i18n } from '@kbn/i18n';
import React, { useState } from 'react';
-import { docLinks } from '../../../../common/doc_links';
-import { CodeBox } from '../code_box';
+import { CodeBox } from './code_box';
import { languageDefinitions } from '../languages/languages';
import { LanguageDefinition, LanguageDefinitionSnippetArguments } from '../languages/types';
import { OverviewPanel } from './overview_panel';
@@ -19,12 +19,20 @@ interface IngestDataProps {
codeArguments: LanguageDefinitionSnippetArguments;
selectedLanguage: LanguageDefinition;
setSelectedLanguage: (language: LanguageDefinition) => void;
+ docLinks: any;
+ http: any;
+ pluginId: string;
+ useKibanaServicesHook: any;
}
export const IngestData: React.FC = ({
codeArguments,
selectedLanguage,
setSelectedLanguage,
+ docLinks,
+ http,
+ pluginId,
+ useKibanaServicesHook,
}) => {
const [selectedIngestMethod, setSelectedIngestMethod] = useState<
'ingestViaApi' | 'ingestViaIntegration'
@@ -43,9 +51,12 @@ export const IngestData: React.FC = ({
languages={languageDefinitions}
selectedLanguage={selectedLanguage}
setSelectedLanguage={setSelectedLanguage}
+ http={http}
+ pluginId={pluginId}
+ useKibanaServicesHook={useKibanaServicesHook}
/>
) : (
-
+
)
}
links={[
diff --git a/x-pack/plugins/serverless_search/public/application/components/overview_panels/install_client.tsx b/packages/kbn-serverless-api-panels/components/install_client.tsx
similarity index 80%
rename from x-pack/plugins/serverless_search/public/application/components/overview_panels/install_client.tsx
rename to packages/kbn-serverless-api-panels/components/install_client.tsx
index 259644074ba12..72cccc1774cef 100644
--- a/x-pack/plugins/serverless_search/public/application/components/overview_panels/install_client.tsx
+++ b/packages/kbn-serverless-api-panels/components/install_client.tsx
@@ -1,14 +1,15 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
- * 2.0; you may not use this file except in compliance with the Elastic License
- * 2.0.
+ * 2.0 and the Server Side Public License, v 1; you may not use this file except
+ * in compliance with, at your election, the Elastic License 2.0 or the Server
+ * Side Public License, v 1.
*/
import { EuiSpacer, EuiCallOut, EuiText } from '@elastic/eui';
import { i18n } from '@kbn/i18n';
import React from 'react';
-import { CodeBox } from '../code_box';
+import { CodeBox } from './code_box';
import { languageDefinitions } from '../languages/languages';
import { OverviewPanel } from './overview_panel';
import {
@@ -16,15 +17,22 @@ import {
Languages,
LanguageDefinitionSnippetArguments,
} from '../languages/types';
-import { GithubLink } from '../shared/github_link';
+import { GithubLink } from './github_link';
interface InstallClientProps {
codeArguments: LanguageDefinitionSnippetArguments;
language: LanguageDefinition;
setSelectedLanguage: (language: LanguageDefinition) => void;
+ http: any;
+ pluginId: string;
+ useKibanaServicesHook: any;
}
-const Link: React.FC<{ language: Languages }> = ({ language }) => {
+const Link: React.FC<{ language: Languages; http: any; pluginId: string }> = ({
+ language,
+ http,
+ pluginId,
+}) => {
switch (language) {
case Languages.CURL:
return (
@@ -33,6 +41,8 @@ const Link: React.FC<{ language: Languages }> = ({ language }) => {
label={i18n.translate('xpack.serverlessSearch.githubLink.curl.label', {
defaultMessage: 'curl',
})}
+ http={http}
+ pluginId={pluginId}
/>
);
case Languages.JAVASCRIPT:
@@ -42,6 +52,8 @@ const Link: React.FC<{ language: Languages }> = ({ language }) => {
label={i18n.translate('xpack.serverlessSearch.githubLink.javascript.label', {
defaultMessage: 'elasticsearch',
})}
+ http={http}
+ pluginId={pluginId}
/>
);
case Languages.RUBY:
@@ -51,6 +63,8 @@ const Link: React.FC<{ language: Languages }> = ({ language }) => {
label={i18n.translate('xpack.serverlessSearch.githubLink.ruby.label', {
defaultMessage: 'elasticsearch-ruby',
})}
+ http={http}
+ pluginId={pluginId}
/>
);
}
@@ -61,6 +75,9 @@ export const InstallClientPanel: React.FC = ({
codeArguments,
language,
setSelectedLanguage,
+ http,
+ pluginId,
+ useKibanaServicesHook,
}) => {
return (
= ({
languages={languageDefinitions}
selectedLanguage={language}
setSelectedLanguage={setSelectedLanguage}
+ http={http}
+ pluginId={pluginId}
+ useKibanaServicesHook={useKibanaServicesHook}
/>
-
+
{
+export interface IntegrationsPanelProps {
+ docLinks: any;
+ http: any;
+ pluginId: string;
+}
+
+export const IntegrationsPanel: React.FC = ({
+ docLinks,
+ http,
+ pluginId,
+}) => {
return (
@@ -63,6 +73,8 @@ export const IntegrationsPanel: React.FC = () => {
label={i18n.translate('xpack.serverlessSearch.ingestData.logstashLink', {
defaultMessage: 'Logstash',
})}
+ http={http}
+ pluginId={pluginId}
/>
@@ -103,6 +115,8 @@ export const IntegrationsPanel: React.FC = () => {
label={i18n.translate('xpack.serverlessSearch.ingestData.beatsLink', {
defaultMessage: 'beats',
})}
+ http={http}
+ pluginId={pluginId}
/>
@@ -143,6 +157,8 @@ export const IntegrationsPanel: React.FC = () => {
label={i18n.translate('xpack.serverlessSearch.ingestData.connectorsPythonLink', {
defaultMessage: 'connectors-python',
})}
+ http={http}
+ pluginId={pluginId}
/>
diff --git a/x-pack/plugins/serverless_search/public/application/components/overview_panels/language_client_panel.tsx b/packages/kbn-serverless-api-panels/components/language_client_panel.tsx
similarity index 83%
rename from x-pack/plugins/serverless_search/public/application/components/overview_panels/language_client_panel.tsx
rename to packages/kbn-serverless-api-panels/components/language_client_panel.tsx
index ebadfdbb61a84..c04e925aa8160 100644
--- a/x-pack/plugins/serverless_search/public/application/components/overview_panels/language_client_panel.tsx
+++ b/packages/kbn-serverless-api-panels/components/language_client_panel.tsx
@@ -1,9 +1,11 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
- * 2.0; you may not use this file except in compliance with the Elastic License
- * 2.0.
+ * 2.0 and the Server Side Public License, v 1; you may not use this file except
+ * in compliance with, at your election, the Elastic License 2.0 or the Server
+ * Side Public License, v 1.
*/
+
import {
EuiFlexGroup,
EuiFlexItem,
@@ -15,23 +17,25 @@ import {
} from '@elastic/eui';
import React from 'react';
-import { PLUGIN_ID } from '../../../../common';
-import { useKibanaServices } from '../../hooks/use_kibana';
import { LanguageDefinition } from '../languages/types';
import './select_client.scss';
+
interface SelectClientProps {
language: LanguageDefinition;
setSelectedLanguage: (language: LanguageDefinition) => void;
isSelectedLanguage: boolean;
+ http: any;
+ pluginId: string;
}
export const LanguageClientPanel: React.FC = ({
language,
setSelectedLanguage,
isSelectedLanguage,
+ http,
+ pluginId,
}) => {
const { euiTheme } = useEuiTheme();
- const { http } = useKibanaServices();
return (
@@ -51,7 +55,7 @@ export const LanguageClientPanel: React.FC = ({
diff --git a/x-pack/plugins/serverless_search/public/application/components/overview_panels/overview_panel.tsx b/packages/kbn-serverless-api-panels/components/overview_panel.tsx
similarity index 88%
rename from x-pack/plugins/serverless_search/public/application/components/overview_panels/overview_panel.tsx
rename to packages/kbn-serverless-api-panels/components/overview_panel.tsx
index def3f1e4c9359..7c1208f7a4e51 100644
--- a/x-pack/plugins/serverless_search/public/application/components/overview_panels/overview_panel.tsx
+++ b/packages/kbn-serverless-api-panels/components/overview_panel.tsx
@@ -1,8 +1,9 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
- * 2.0; you may not use this file except in compliance with the Elastic License
- * 2.0.
+ * 2.0 and the Server Side Public License, v 1; you may not use this file except
+ * in compliance with, at your election, the Elastic License 2.0 or the Server
+ * Side Public License, v 1.
*/
import {
@@ -15,7 +16,7 @@ import {
EuiLink,
} from '@elastic/eui';
import React from 'react';
-import { LEARN_MORE_LABEL } from '../../../../common/i18n_string';
+import { LEARN_MORE_LABEL } from '../constants';
interface OverviewPanelProps {
description?: React.ReactNode | string;
diff --git a/x-pack/plugins/serverless_search/public/application/components/overview_panels/select_client.scss b/packages/kbn-serverless-api-panels/components/select_client.scss
similarity index 100%
rename from x-pack/plugins/serverless_search/public/application/components/overview_panels/select_client.scss
rename to packages/kbn-serverless-api-panels/components/select_client.scss
diff --git a/x-pack/plugins/serverless_search/public/application/components/overview_panels/select_client.tsx b/packages/kbn-serverless-api-panels/components/select_client.tsx
similarity index 89%
rename from x-pack/plugins/serverless_search/public/application/components/overview_panels/select_client.tsx
rename to packages/kbn-serverless-api-panels/components/select_client.tsx
index 7d78a54f8e1c7..2e4e1bc409861 100644
--- a/x-pack/plugins/serverless_search/public/application/components/overview_panels/select_client.tsx
+++ b/packages/kbn-serverless-api-panels/components/select_client.tsx
@@ -1,8 +1,9 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
- * 2.0; you may not use this file except in compliance with the Elastic License
- * 2.0.
+ * 2.0 and the Server Side Public License, v 1; you may not use this file except
+ * in compliance with, at your election, the Elastic License 2.0 or the Server
+ * Side Public License, v 1.
*/
import { EuiCallOut, EuiFlexGroup, EuiFlexItem, EuiLink, EuiSpacer, EuiText } from '@elastic/eui';
@@ -10,14 +11,19 @@ import { i18n } from '@kbn/i18n';
import { FormattedMessage } from '@kbn/i18n-react';
import React from 'react';
-import { useKibanaServices } from '../../hooks/use_kibana';
import { OverviewPanel } from './overview_panel';
-import { docLinks } from '../../../../common/doc_links';
import './select_client.scss';
-export const SelectClientPanel: React.FC = ({ children }) => {
- const { http } = useKibanaServices();
+export interface SelectClientPanelProps {
+ docLinks: any;
+ http: any;
+}
+export const SelectClientPanel: React.FC = ({
+ docLinks,
+ children,
+ http,
+}) => {
return (
{
+ const {
+ application,
+ share: { url },
+ } = useKibanaServicesHook();
+ const canShowDevtools = !!application?.capabilities?.dev_tools?.show;
+ if (!canShowDevtools || !url) return null;
+
+ const devToolsDataUri = compressToEncodedURIComponent(request);
+ const consolePreviewLink = url.locators.get('CONSOLE_APP_LOCATOR')?.useUrl(
+ {
+ loadFrom: `data:text/plain,${devToolsDataUri}`,
+ },
+ undefined,
+ [request]
+ );
+ if (!consolePreviewLink) return null;
+
+ return (
+
+
+
+ );
+};
diff --git a/packages/kbn-serverless-api-panels/constants.ts b/packages/kbn-serverless-api-panels/constants.ts
new file mode 100644
index 0000000000000..a947b9f282ed9
--- /dev/null
+++ b/packages/kbn-serverless-api-panels/constants.ts
@@ -0,0 +1,16 @@
+/*
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
+ * or more contributor license agreements. Licensed under the Elastic License
+ * 2.0 and the Server Side Public License, v 1; you may not use this file except
+ * in compliance with, at your election, the Elastic License 2.0 or the Server
+ * Side Public License, v 1.
+ */
+
+import { i18n } from '@kbn/i18n';
+
+export const LEARN_MORE_LABEL: string = i18n.translate('xpack.serverlessSearch.panels.learnMore', {
+ defaultMessage: 'Learn more',
+});
+export const API_KEY_PLACEHOLDER = 'your_api_key';
+export const ELASTICSEARCH_URL_PLACEHOLDER = 'https://your_deployment_url';
+export const INDEX_NAME_PLACEHOLDER = 'index_name';
diff --git a/packages/kbn-serverless-api-panels/index.tsx b/packages/kbn-serverless-api-panels/index.tsx
new file mode 100644
index 0000000000000..e965d77373e24
--- /dev/null
+++ b/packages/kbn-serverless-api-panels/index.tsx
@@ -0,0 +1,67 @@
+/*
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
+ * or more contributor license agreements. Licensed under the Elastic License
+ * 2.0 and the Server Side Public License, v 1; you may not use this file except
+ * in compliance with, at your election, the Elastic License 2.0 or the Server
+ * Side Public License, v 1.
+ */
+
+import React from 'react';
+import { EuiFlexGroup, EuiFlexItem, EuiTitle, EuiSpacer, EuiImage, EuiText } from '@elastic/eui';
+import { i18n } from '@kbn/i18n';
+
+export * from './components/code_box';
+export * from './components/github_link';
+export * from './components/ingest_data';
+export * from './components/integrations_panel';
+export * from './components/language_client_panel';
+export * from './components/overview_panel';
+export * from './components/select_client';
+export * from './components/try_in_console_button';
+export * from './components/install_client';
+
+export interface WelcomeBannerProps {
+ userProfile: any;
+ assetBasePath: string;
+}
+
+export const WelcomeBanner: React.FC = ({ userProfile, assetBasePath }) => (
+
+
+ {/* Reversing column direction here so screenreaders keep h1 as the first element */}
+
+
+
+
+ {i18n.translate('xpack.serverlessSearch.header.title', {
+ defaultMessage: 'Get started with Elasticsearch',
+ })}
+
+
+
+
+
+
+ {i18n.translate('xpack.serverlessSearch.header.greeting.title', {
+ defaultMessage: 'Hi {name}!',
+ values: { name: userProfile.user.full_name || userProfile.user.username },
+ })}
+
+
+
+
+
+
+ {i18n.translate('xpack.serverlessSearch.header.description', {
+ defaultMessage:
+ "Set up your programming language client, ingest some data, and you'll be ready to start searching within minutes.",
+ })}
+
+
+
+
+
+
+
+
+);
diff --git a/packages/kbn-serverless-api-panels/jest.config.js b/packages/kbn-serverless-api-panels/jest.config.js
new file mode 100644
index 0000000000000..017133e5a568f
--- /dev/null
+++ b/packages/kbn-serverless-api-panels/jest.config.js
@@ -0,0 +1,13 @@
+/*
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
+ * or more contributor license agreements. Licensed under the Elastic License
+ * 2.0 and the Server Side Public License, v 1; you may not use this file except
+ * in compliance with, at your election, the Elastic License 2.0 or the Server
+ * Side Public License, v 1.
+ */
+
+module.exports = {
+ preset: '@kbn/test',
+ rootDir: '../..',
+ roots: ['/packages/kbn-serverless-api-panels'],
+};
diff --git a/packages/kbn-serverless-api-panels/kibana.jsonc b/packages/kbn-serverless-api-panels/kibana.jsonc
new file mode 100644
index 0000000000000..c0d0e0b44ec12
--- /dev/null
+++ b/packages/kbn-serverless-api-panels/kibana.jsonc
@@ -0,0 +1,5 @@
+{
+ "type": "shared-common",
+ "id": "@kbn/serverless-api-panels",
+ "owner": "@elastic/enterprise-search-frontend"
+}
diff --git a/packages/kbn-serverless-api-panels/languages/console.ts b/packages/kbn-serverless-api-panels/languages/console.ts
new file mode 100644
index 0000000000000..be3dc9e9e862a
--- /dev/null
+++ b/packages/kbn-serverless-api-panels/languages/console.ts
@@ -0,0 +1,37 @@
+/*
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
+ * or more contributor license agreements. Licensed under the Elastic License
+ * 2.0 and the Server Side Public License, v 1; you may not use this file except
+ * in compliance with, at your election, the Elastic License 2.0 or the Server
+ * Side Public License, v 1.
+ */
+import { INDEX_NAME_PLACEHOLDER } from '../constants';
+import { LanguageDefinition } from './types';
+
+export const consoleDefinition: Partial = {
+ buildSearchQuery: `POST /books/_search?pretty
+{
+ "query": {
+ "query_string": {
+ "query": "snow"
+ }
+ }
+}`,
+ ingestData: `POST _bulk?pretty
+{ "index" : { "_index" : "books" } }
+{"name": "Snow Crash", "author": "Neal Stephenson", "release_date": "1992-06-01", "page_count": 470}
+{ "index" : { "_index" : "books" } }
+{"name": "Revelation Space", "author": "Alastair Reynolds", "release_date": "2000-03-15", "page_count": 585}
+{ "index" : { "_index" : "books" } }
+{"name": "1984", "author": "George Orwell", "release_date": "1985-06-01", "page_count": 328}
+{ "index" : { "_index" : "books" } }
+{"name": "Fahrenheit 451", "author": "Ray Bradbury", "release_date": "1953-10-15", "page_count": 227}
+{ "index" : { "_index" : "books" } }
+{"name": "Brave New World", "author": "Aldous Huxley", "release_date": "1932-06-01", "page_count": 268}
+{ "index" : { "_index" : "books" } }
+{"name": "The Handmaid's Tale", "author": "Margaret Atwood", "release_date": "1985-06-01", "page_count": 311}`,
+ ingestDataIndex: ({ indexName }) => `POST _bulk?pretty
+ { "index" : { "_index" : "${indexName ?? INDEX_NAME_PLACEHOLDER}" } }
+ {"name": "foo", "title": "bar"}
+`,
+};
diff --git a/packages/kbn-serverless-api-panels/languages/curl.ts b/packages/kbn-serverless-api-panels/languages/curl.ts
new file mode 100644
index 0000000000000..a49c8c0d2bda1
--- /dev/null
+++ b/packages/kbn-serverless-api-panels/languages/curl.ts
@@ -0,0 +1,68 @@
+/*
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
+ * or more contributor license agreements. Licensed under the Elastic License
+ * 2.0 and the Server Side Public License, v 1; you may not use this file except
+ * in compliance with, at your election, the Elastic License 2.0 or the Server
+ * Side Public License, v 1.
+ */
+
+import { i18n } from '@kbn/i18n';
+import { LanguageDefinition, Languages } from './types';
+
+// TODO replace
+const apiIntro = 'REPLACE ME';
+
+export const curlDefinition: LanguageDefinition = {
+ buildSearchQuery: `curl -X POST "\$\{ES_URL\}/books/_search?pretty" \\
+ -H "Authorization: ApiKey "\$\{API_KEY\}"" \\
+ -H "Content-Type: application/json" \\
+ -d'
+{
+ "query": {
+ "query_string": {
+ "query": "snow"
+ }
+ }
+}'`,
+ configureClient: ({ apiKey, url }) => `export ES_URL="${url}"
+export API_KEY="${apiKey}"`,
+ docLink: apiIntro,
+ iconType: 'curl.svg',
+ id: Languages.CURL,
+ ingestData: `curl -X POST "\$\{ES_URL\}/_bulk?pretty" \\
+ -H "Authorization: ApiKey "\$\{API_KEY\}"" \\
+ -H "Content-Type: application/json" \\
+ -d'
+{ "index" : { "_index" : "books" } }
+{"name": "Snow Crash", "author": "Neal Stephenson", "release_date": "1992-06-01", "page_count": 470}
+{ "index" : { "_index" : "books" } }
+{"name": "Revelation Space", "author": "Alastair Reynolds", "release_date": "2000-03-15", "page_count": 585}
+{ "index" : { "_index" : "books" } }
+{"name": "1984", "author": "George Orwell", "release_date": "1985-06-01", "page_count": 328}
+{ "index" : { "_index" : "books" } }
+{"name": "Fahrenheit 451", "author": "Ray Bradbury", "release_date": "1953-10-15", "page_count": 227}
+{ "index" : { "_index" : "books" } }
+{"name": "Brave New World", "author": "Aldous Huxley", "release_date": "1932-06-01", "page_count": 268}
+{ "index" : { "_index" : "books" } }
+{"name": "The Handmaid'"'"'s Tale", "author": "Margaret Atwood", "release_date": "1985-06-01", "page_count": 311}
+'`,
+ ingestDataIndex: ({ apiKey, url, indexName }) => `curl -X POST ${url}/_bulk?pretty \\
+ -H "Authorization: ApiKey ${apiKey}" \\
+ -H "Content-Type: application/json" \\
+ -d'
+{ "index" : { "_index" : "${indexName ?? 'index_name'}" } }
+{"name": "foo", "title": "bar" }
+`,
+ installClient: `# if cURL is not already installed on your system
+# then install it with the package manager of your choice
+
+# example
+brew install curl`,
+ name: i18n.translate('xpack.serverlessSearch.languages.cURL', {
+ defaultMessage: 'cURL',
+ }),
+ languageStyling: 'shell',
+ testConnection: `curl "\$\{ES_URL\}" \\
+ -H "Authorization: ApiKey "\$\{API_KEY\}"" \\
+ -H "Content-Type: application/json"`,
+};
diff --git a/packages/kbn-serverless-api-panels/languages/go.ts b/packages/kbn-serverless-api-panels/languages/go.ts
new file mode 100644
index 0000000000000..8551137df87b3
--- /dev/null
+++ b/packages/kbn-serverless-api-panels/languages/go.ts
@@ -0,0 +1,105 @@
+/*
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
+ * or more contributor license agreements. Licensed under the Elastic License
+ * 2.0 and the Server Side Public License, v 1; you may not use this file except
+ * in compliance with, at your election, the Elastic License 2.0 or the Server
+ * Side Public License, v 1.
+ */
+
+import { i18n } from '@kbn/i18n';
+import { LanguageDefinition, Languages } from './types';
+
+// TODO replace me
+const docLinks = {
+ goAdvancedConfig: '123123',
+ goBasicConfig: 'a123123',
+ goClient: '1123123',
+};
+
+export const goDefinition: LanguageDefinition = {
+ advancedConfig: docLinks.goAdvancedConfig,
+ basicConfig: docLinks.goBasicConfig,
+ buildSearchQuery: `searchResp, err := es.Search().
+ Index("books").
+ Q("snow").
+ Do(context.Background())
+
+fmt.Println(searchResp, err)`,
+ configureClient: ({ url, apiKey }) => `import (
+ "context"
+ "fmt"
+ "log"
+ "strings"
+
+ "github.com/elastic/elasticsearch-serverless-go"
+)
+
+func main() {
+ cfg := elasticsearch.Config{
+ Address: "${url}",
+ APIKey: "${apiKey}",
+ }
+ es, err := elasticsearch.NewClient(cfg)
+ if err != nil {
+ log.Fatalf("Error creating the client: %s", err)
+ }
+}`,
+ docLink: docLinks.goClient,
+ iconType: 'go.svg',
+ id: Languages.GO,
+ ingestData: `ingestResult, err := es.Bulk().
+ Index("books").
+ Raw(strings.NewReader(\`
+{"index":{"_id":"9780553351927"}}
+{"name":"Snow Crash","author":"Neal Stephenson","release_date":"1992-06-01","page_count": 470}
+{ "index": { "_id": "9780441017225"}}
+{"name": "Revelation Space", "author": "Alastair Reynolds", "release_date": "2000-03-15", "page_count": 585}
+{ "index": { "_id": "9780451524935"}}
+{"name": "1984", "author": "George Orwell", "release_date": "1985-06-01", "page_count": 328}
+{ "index": { "_id": "9781451673319"}}
+{"name": "Fahrenheit 451", "author": "Ray Bradbury", "release_date": "1953-10-15", "page_count": 227}
+{ "index": { "_id": "9780060850524"}}
+{"name": "Brave New World", "author": "Aldous Huxley", "release_date": "1932-06-01", "page_count": 268}
+{ "index": { "_id": "9780385490818"}}
+{"name": "The Handmaid's Tale", "author": "Margaret Atwood", "release_date": "1985-06-01", "page_count": 311}\n\`)).
+ Do(context.Background())
+
+fmt.Println(ingestResult, err)`,
+ ingestDataIndex: ({ apiKey, url, indexName }) => `import (
+ "context"
+ "fmt"
+ "log"
+ "strings"
+
+ "github.com/elastic/elasticsearch-serverless-go"
+)
+
+func main() {
+ cfg := elasticsearch.Config{
+ Address: "${url}",
+ APIKey: "${apiKey}",
+ }
+ es, err := elasticsearch.NewClient(cfg)
+ if err != nil {
+ log.Fatalf("Error creating the client: %s", err)
+ }
+ res, err := es.Bulk().
+ Index("${indexName}").
+ Raw(strings.NewReader(\`
+{ "index": { "_id": "1"}}
+{"name": "foo", "title": "bar"}\n\`)).
+ Do(context.Background())
+
+ fmt.Println(res, err)
+}`,
+ installClient: 'go get -u github.com/elastic/elasticsearch-serverless-go@latest',
+ name: i18n.translate('xpack.serverlessSearch.languages.go', {
+ defaultMessage: 'Go',
+ }),
+ testConnection: `infores, err := es.Info().Do(context.Background())
+if err != nil {
+ log.Fatalf("Error getting response: %s", err)
+}
+
+fmt.Println(infores)`,
+};
diff --git a/packages/kbn-serverless-api-panels/languages/javascript.ts b/packages/kbn-serverless-api-panels/languages/javascript.ts
new file mode 100644
index 0000000000000..3297222c5c49a
--- /dev/null
+++ b/packages/kbn-serverless-api-panels/languages/javascript.ts
@@ -0,0 +1,118 @@
+/*
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
+ * or more contributor license agreements. Licensed under the Elastic License
+ * 2.0 and the Server Side Public License, v 1; you may not use this file except
+ * in compliance with, at your election, the Elastic License 2.0 or the Server
+ * Side Public License, v 1.
+ */
+
+import { i18n } from '@kbn/i18n';
+import { LanguageDefinition, Languages } from './types';
+
+const docLinks = {
+ jsAdvancedConfig: '',
+ jsApiReference: '',
+ jsBasicConfig: '',
+ jsClient: '',
+};
+
+export const javascriptDefinition: LanguageDefinition = {
+ advancedConfig: docLinks.jsAdvancedConfig,
+ apiReference: docLinks.jsApiReference,
+ basicConfig: docLinks.jsBasicConfig,
+ buildSearchQuery: `// Let's search!
+const searchResult = await client.search({
+ index: 'my-index-name',
+ q: '9HY9SWR'
+});
+
+console.log(searchResult.hits.hits)
+`,
+ configureClient: ({ url, apiKey }) => `const { Client } = require('@elastic/elasticsearch');
+const client = new Client({
+node: '${url}',
+auth: {
+ apiKey: '${apiKey}'
+}
+});`,
+ docLink: docLinks.jsClient,
+ iconType: 'javascript.svg',
+ id: Languages.JAVASCRIPT,
+ ingestData: `// Sample flight data
+const dataset = [
+{'flight': '9HY9SWR', 'price': 841.2656419677076, 'delayed': false},
+{'flight': 'X98CCZO', 'price': 882.9826615595518, 'delayed': false},
+{'flight': 'UFK2WIZ', 'price': 190.6369038508356, 'delayed': true},
+];
+
+// Index with the bulk helper
+const result = await client.helpers.bulk({
+datasource: dataset,
+onDocument (doc) {
+ return { index: { _index: 'my-index-name' }};
+}
+});
+
+console.log(result);
+/**
+{
+total: 3,
+failed: 0,
+retry: 0,
+successful: 3,
+noop: 0,
+time: 421,
+bytes: 293,
+aborted: false
+}
+*/`,
+ ingestDataIndex: ({
+ apiKey,
+ url,
+ indexName,
+ }) => `const { Client } = require('@elastic/elasticsearch');
+const client = new Client({
+ node: '${url}',
+ auth: {
+ apiKey: '${apiKey}'
+ }
+});
+const dataset = [
+ {'name': 'foo', 'title': 'bar'},
+];
+
+// Index with the bulk helper
+const result = await client.helpers.bulk({
+ datasource: dataset,
+ onDocument (doc) {
+ return { index: { _index: '${indexName ?? 'index_name'}' }};
+ }
+});
+console.log(result);
+`,
+ installClient: 'npm install @elastic/elasticsearch@8',
+ name: i18n.translate('xpack.serverlessSearch.languages.javascript', {
+ defaultMessage: 'JavaScript',
+ }),
+ testConnection: `const resp = await client.info();
+
+console.log(resp);
+/**
+{
+name: 'instance-0000000000',
+cluster_name: 'd9dcd35d12fe46dfaa28ec813f65d57b',
+cluster_uuid: 'iln8jaivThSezhTkzp0Knw',
+version: {
+ build_flavor: 'default',
+ build_type: 'docker',
+ build_hash: 'c94b4700cda13820dad5aa74fae6db185ca5c304',
+ build_date: '2022-10-24T16:54:16.433628434Z',
+ build_snapshot: false,
+ lucene_version: '9.4.1',
+ minimum_wire_compatibility_version: '7.17.0',
+ minimum_index_compatibility_version: '7.0.0'
+},
+tagline: 'You Know, for Search'
+}
+*/`,
+};
diff --git a/packages/kbn-serverless-api-panels/languages/languages.ts b/packages/kbn-serverless-api-panels/languages/languages.ts
new file mode 100644
index 0000000000000..2a73149397152
--- /dev/null
+++ b/packages/kbn-serverless-api-panels/languages/languages.ts
@@ -0,0 +1,26 @@
+/*
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
+ * or more contributor license agreements. Licensed under the Elastic License
+ * 2.0 and the Server Side Public License, v 1; you may not use this file except
+ * in compliance with, at your election, the Elastic License 2.0 or the Server
+ * Side Public License, v 1.
+ */
+
+import { curlDefinition } from './curl';
+import { goDefinition } from './go';
+import { javascriptDefinition } from './javascript';
+import { phpDefinition } from './php';
+import { pythonDefinition } from './python';
+import { rubyDefinition } from './ruby';
+import { Languages, LanguageDefinition } from './types';
+
+const languageDefinitionRecords: Partial> = {
+ [Languages.CURL]: curlDefinition,
+ [Languages.PYTHON]: pythonDefinition,
+ [Languages.JAVASCRIPT]: javascriptDefinition,
+ [Languages.PHP]: phpDefinition,
+ [Languages.GO]: goDefinition,
+ [Languages.RUBY]: rubyDefinition,
+};
+
+export const languageDefinitions: LanguageDefinition[] = Object.values(languageDefinitionRecords);
diff --git a/packages/kbn-serverless-api-panels/languages/php.ts b/packages/kbn-serverless-api-panels/languages/php.ts
new file mode 100644
index 0000000000000..d15c816db7eba
--- /dev/null
+++ b/packages/kbn-serverless-api-panels/languages/php.ts
@@ -0,0 +1,149 @@
+/*
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
+ * or more contributor license agreements. Licensed under the Elastic License
+ * 2.0 and the Server Side Public License, v 1; you may not use this file except
+ * in compliance with, at your election, the Elastic License 2.0 or the Server
+ * Side Public License, v 1.
+ */
+
+import { i18n } from '@kbn/i18n';
+import { INDEX_NAME_PLACEHOLDER } from '../constants';
+import { LanguageDefinition, Languages } from './types';
+
+const docLinks = {
+ phpAdvancedConfig: '',
+ phpBasicConfig: '',
+ phpClient: '',
+};
+
+export const phpDefinition: LanguageDefinition = {
+ advancedConfig: docLinks.phpAdvancedConfig,
+ basicConfig: docLinks.phpBasicConfig,
+ buildSearchQuery: `$params = [
+ 'index' => 'books',
+ 'body' => [
+ 'q' => 'snow'
+ ]
+];
+
+$response = $client->search($params);
+print_r($response->asArray());`,
+ configureClient: ({ url, apiKey }) => `$client = ClientBuilder::create()
+ ->setHosts(['${url}'])
+ ->setApiKey('${apiKey}')
+ ->build();`,
+ docLink: docLinks.phpClient,
+ iconType: 'php.svg',
+ id: Languages.PHP,
+ ingestData: `$params = [
+'body' => [
+[
+'index' => [
+'_index' => 'books',
+'_id' => '9780553351927',
+],
+],
+[
+'name' => 'Snow Crash',
+'author' => 'Neal Stephenson',
+'release_date' => '1992-06-01',
+'page_count' => 470,
+],
+[
+'index' => [
+'_index' => 'books',
+'_id' => '9780441017225',
+],
+],
+[
+'name' => 'Revelation Space',
+'author' => 'Alastair Reynolds',
+'release_date' => '2000-03-15',
+'page_count' => 585,
+],
+[
+'index' => [
+'_index' => 'books',
+'_id' => '9780451524935',
+],
+],
+[
+'name' => '1984',
+'author' => 'George Orwell',
+'release_date' => '1985-06-01',
+'page_count' => 328,
+],
+[
+'index' => [
+'_index' => 'books',
+'_id' => '9781451673319',
+],
+],
+[
+'name' => 'Fahrenheit 451',
+'author' => 'Ray Bradbury',
+'release_date' => '1953-10-15',
+'page_count' => 227,
+],
+[
+'index' => [
+'_index' => 'books',
+'_id' => '9780060850524',
+],
+],
+[
+'name' => 'Brave New World',
+'author' => 'Aldous Huxley',
+'release_date' => '1932-06-01',
+'page_count' => 268,
+],
+[
+'index' => [
+'_index' => 'books',
+'_id' => '9780385490818',
+],
+],
+[
+'name' => 'The Handmaid\'s Tale',
+'author' => 'Margaret Atwood',
+'release_date' => '1985-06-01',
+'page_count' => 311,
+],
+],
+];
+
+$response = $client->bulk($params);
+echo $response->getStatusCode();
+echo (string) $response->getBody();`,
+ ingestDataIndex: ({ apiKey, url, indexName }) => `$client = ClientBuilder::create()
+ ->setHosts(['${url}'])
+ ->setApiKey('${apiKey}')
+ ->build();
+
+$params = [
+'body' => [
+[
+'index' => [
+'_index' => '${indexName ?? INDEX_NAME_PLACEHOLDER}',
+'_id' => '1',
+],
+],
+[
+'name' => 'foo',
+'title' => 'bar',
+],
+],
+];
+
+$response = $client->bulk($params);
+echo $response->getStatusCode();
+echo (string) $response->getBody();
+`,
+ installClient: 'composer require elasticsearch/elasticsearch',
+ name: i18n.translate('xpack.serverlessSearch.languages.php', {
+ defaultMessage: 'PHP',
+ }),
+ testConnection: `$response = $client->info();
+echo $response->getStatusCode();
+echo (string) $response->getBody();`,
+};
diff --git a/packages/kbn-serverless-api-panels/languages/python.ts b/packages/kbn-serverless-api-panels/languages/python.ts
new file mode 100644
index 0000000000000..8ea7b805e2d8d
--- /dev/null
+++ b/packages/kbn-serverless-api-panels/languages/python.ts
@@ -0,0 +1,71 @@
+/*
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
+ * or more contributor license agreements. Licensed under the Elastic License
+ * 2.0 and the Server Side Public License, v 1; you may not use this file except
+ * in compliance with, at your election, the Elastic License 2.0 or the Server
+ * Side Public License, v 1.
+ */
+
+import { i18n } from '@kbn/i18n';
+import { LanguageDefinition, Languages } from './types';
+import { INDEX_NAME_PLACEHOLDER } from '../constants';
+
+const docLinks = {
+ pythonAdvancedConfig: '',
+ pythonBasicConfig: '',
+ pythonClient: '',
+};
+
+export const pythonDefinition: LanguageDefinition = {
+ advancedConfig: docLinks.pythonAdvancedConfig,
+ basicConfig: docLinks.pythonBasicConfig,
+ buildSearchQuery: `client.search(index="books", q="snow")`,
+ configureClient: ({ url, apiKey }) => `from elasticsearch import Elasticsearch
+
+client = Elasticsearch(
+ "${url}",
+ api_key="${apiKey}"
+)`,
+ docLink: docLinks.pythonClient,
+ iconType: 'python.svg',
+ id: Languages.PYTHON,
+ ingestData: `documents = [
+ { "index": { "_index": "books", "_id": "9780553351927"}},
+ {"name": "Snow Crash", "author": "Neal Stephenson", "release_date": "1992-06-01", "page_count": 470},
+ { "index": { "_index": "books", "_id": "9780441017225"}},
+ {"name": "Revelation Space", "author": "Alastair Reynolds", "release_date": "2000-03-15", "page_count": 585},
+ { "index": { "_index": "books", "_id": "9780451524935"}},
+ {"name": "1984", "author": "George Orwell", "release_date": "1985-06-01", "page_count": 328},
+ { "index": { "_index": "books", "_id": "9781451673319"}},
+ {"name": "Fahrenheit 451", "author": "Ray Bradbury", "release_date": "1953-10-15", "page_count": 227},
+ { "index": { "_index": "books", "_id": "9780060850524"}},
+ {"name": "Brave New World", "author": "Aldous Huxley", "release_date": "1932-06-01", "page_count": 268},
+ { "index": { "_index": "books", "_id": "9780385490818"}},
+ {"name": "The Handmaid's Tale", "author": "Margaret Atwood", "release_date": "1985-06-01", "page_count": 311},
+]
+
+client.bulk(operations=documents)`,
+ ingestDataIndex: ({ apiKey, url, indexName }) => `from elasticsearch import Elasticsearch
+
+client = Elasticsearch(
+ "${url}",
+ api_key="${apiKey}"
+)
+
+documents = [
+ {"index": {"_index": "${indexName ?? INDEX_NAME_PLACEHOLDER}"}},
+ {"name": "foo", "title": "bar"},
+]
+
+client.bulk(operations=documents)
+`,
+ installClient: `python -m pip install elasticsearch
+
+# If your application uses async/await in Python you can install with the async extra
+# python -m pip install elasticsearch[async]
+ `,
+ name: i18n.translate('xpack.serverlessSearch.languages.python', {
+ defaultMessage: 'Python',
+ }),
+ testConnection: `client.info()`,
+};
diff --git a/packages/kbn-serverless-api-panels/languages/ruby.ts b/packages/kbn-serverless-api-panels/languages/ruby.ts
new file mode 100644
index 0000000000000..7da4ef475a451
--- /dev/null
+++ b/packages/kbn-serverless-api-panels/languages/ruby.ts
@@ -0,0 +1,62 @@
+/*
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
+ * or more contributor license agreements. Licensed under the Elastic License
+ * 2.0 and the Server Side Public License, v 1; you may not use this file except
+ * in compliance with, at your election, the Elastic License 2.0 or the Server
+ * Side Public License, v 1.
+ */
+
+import { i18n } from '@kbn/i18n';
+import { INDEX_NAME_PLACEHOLDER } from '../constants';
+import { LanguageDefinition, Languages } from './types';
+
+const docLinks = {
+ rubyAdvancedConfig: '',
+ rubyExamples: '',
+ rubyBasicConfig: '',
+ rubyClient: '',
+};
+
+export const rubyDefinition: LanguageDefinition = {
+ advancedConfig: docLinks.rubyAdvancedConfig,
+ apiReference: docLinks.rubyExamples,
+ buildSearchQuery: `client.search(index: 'books', q: 'snow')`,
+ configureClient: ({ url, apiKey }) => `client = ElasticsearchServerless::Client.new(
+ api_key: '${apiKey}',
+ url: '${url}'
+)
+`,
+ basicConfig: docLinks.rubyBasicConfig,
+ docLink: docLinks.rubyClient,
+ iconType: 'ruby.svg',
+ id: Languages.RUBY,
+ ingestData: `documents = [
+ { index: { _index: 'books', data: {name: "Snow Crash", "author": "Neal Stephenson", "release_date": "1992-06-01", "page_count": 470} } },
+ { index: { _index: 'books', data: {name: "Revelation Space", "author": "Alastair Reynolds", "release_date": "2000-03-15", "page_count": 585} } },
+ { index: { _index: 'books', data: {name: "1984", "author": "George Orwell", "release_date": "1985-06-01", "page_count": 328} } },
+ { index: { _index: 'books', data: {name: "Fahrenheit 451", "author": "Ray Bradbury", "release_date": "1953-10-15", "page_count": 227} } },
+ { index: { _index: 'books', data: {name: "Brave New World", "author": "Aldous Huxley", "release_date": "1932-06-01", "page_count": 268} } },
+ { index: { _index: 'books', data: {name: "The Handmaid's Tale", "author": "Margaret Atwood", "release_date": "1985-06-01", "page_count": 311} } }
+]
+client.bulk(body: documents)`,
+ ingestDataIndex: ({ apiKey, url, indexName }) => `client = ElasticsearchServerless::Client.new(
+ api_key: '${apiKey}',
+ url: '${url}'
+)
+
+documents = [
+ { index: { _index: '${
+ indexName ?? INDEX_NAME_PLACEHOLDER
+ }', data: {name: "foo", "title": "bar"} } },
+]
+client.bulk(body: documents)
+`,
+ installClient: `# Requires Ruby version 3.0 or higher
+
+# From the project's root directory:$ gem build elasticsearch-serverless.gemspec
+$ gem install elasticsearch-serverless-x.x.x.gem`,
+ name: i18n.translate('xpack.serverlessSearch.languages.ruby', {
+ defaultMessage: 'Ruby',
+ }),
+ testConnection: `client.info`,
+};
diff --git a/packages/kbn-serverless-api-panels/languages/types.ts b/packages/kbn-serverless-api-panels/languages/types.ts
new file mode 100644
index 0000000000000..1d35f440673de
--- /dev/null
+++ b/packages/kbn-serverless-api-panels/languages/types.ts
@@ -0,0 +1,44 @@
+/*
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
+ * or more contributor license agreements. Licensed under the Elastic License
+ * 2.0 and the Server Side Public License, v 1; you may not use this file except
+ * in compliance with, at your election, the Elastic License 2.0 or the Server
+ * Side Public License, v 1.
+ */
+
+export enum Languages {
+ JAVA = 'java',
+ JAVASCRIPT = 'javascript',
+ RUBY = 'ruby',
+ GO = 'go',
+ DOTNET = 'dotnet',
+ PHP = 'php',
+ PERL = 'perl',
+ PYTHON = 'python',
+ RUST = 'rust',
+ CURL = 'curl',
+}
+
+export interface LanguageDefinitionSnippetArguments {
+ url: string;
+ apiKey: string;
+ indexName?: string;
+}
+
+type CodeSnippet = string | ((args: LanguageDefinitionSnippetArguments) => string);
+export interface LanguageDefinition {
+ advancedConfig?: string;
+ apiReference?: string;
+ basicConfig?: string;
+ configureClient: CodeSnippet;
+ docLink: string;
+ iconType: string;
+ id: Languages;
+ ingestData: CodeSnippet;
+ ingestDataIndex: CodeSnippet;
+ installClient: string;
+ languageStyling?: string;
+ name: string;
+ buildSearchQuery: CodeSnippet;
+ testConnection: CodeSnippet;
+}
diff --git a/packages/kbn-serverless-api-panels/package.json b/packages/kbn-serverless-api-panels/package.json
new file mode 100644
index 0000000000000..18a036162a011
--- /dev/null
+++ b/packages/kbn-serverless-api-panels/package.json
@@ -0,0 +1,6 @@
+{
+ "name": "@kbn/serverless-api-panels",
+ "private": true,
+ "version": "1.0.0",
+ "license": "SSPL-1.0 OR Elastic License 2.0"
+}
\ No newline at end of file
diff --git a/packages/kbn-serverless-api-panels/tsconfig.json b/packages/kbn-serverless-api-panels/tsconfig.json
new file mode 100644
index 0000000000000..f12dc7ee3b3ec
--- /dev/null
+++ b/packages/kbn-serverless-api-panels/tsconfig.json
@@ -0,0 +1,21 @@
+{
+ "extends": "../../tsconfig.base.json",
+ "compilerOptions": {
+ "outDir": "target/types",
+ "types": [
+ "jest",
+ "node",
+ "react"
+ ]
+ },
+ "include": [
+ "**/*.ts",
+ "**/*.tsx",
+ ],
+ "exclude": [
+ "target/**/*"
+ ],
+ "kbn_references": [
+ "@kbn/i18n"
+ ]
+}
diff --git a/tsconfig.base.json b/tsconfig.base.json
index 12504320663e3..64ac1083dc8c7 100644
--- a/tsconfig.base.json
+++ b/tsconfig.base.json
@@ -1236,6 +1236,8 @@
"@kbn/server-route-repository/*": ["packages/kbn-server-route-repository/*"],
"@kbn/serverless": ["x-pack/plugins/serverless"],
"@kbn/serverless/*": ["x-pack/plugins/serverless/*"],
+ "@kbn/serverless-api-panels": ["packages/kbn-serverless-api-panels"],
+ "@kbn/serverless-api-panels/*": ["packages/kbn-serverless-api-panels/*"],
"@kbn/serverless-observability": ["x-pack/plugins/serverless_observability"],
"@kbn/serverless-observability/*": ["x-pack/plugins/serverless_observability/*"],
"@kbn/serverless-project-switcher": ["packages/serverless/project_switcher"],
diff --git a/x-pack/plugins/serverless_search/public/application/components/indexing_api.tsx b/x-pack/plugins/serverless_search/public/application/components/indexing_api.tsx
index eb34e345be142..939b28d8c5073 100644
--- a/x-pack/plugins/serverless_search/public/application/components/indexing_api.tsx
+++ b/x-pack/plugins/serverless_search/public/application/components/indexing_api.tsx
@@ -23,7 +23,9 @@ import {
import { i18n } from '@kbn/i18n';
import { FormattedMessage } from '@kbn/i18n-react';
import { useQuery } from '@tanstack/react-query';
+import { OverviewPanel, LanguageClientPanel } from '@kbn/serverless-api-panels';
+import { PLUGIN_ID } from '../../../common';
import { IndexData, FetchIndicesResult } from '../../../common/types';
import { FETCH_INDICES_PATH } from '../routes';
import { API_KEY_PLACEHOLDER, ELASTICSEARCH_URL_PLACEHOLDER } from '../constants';
@@ -33,9 +35,6 @@ import { javascriptDefinition } from './languages/javascript';
import { languageDefinitions } from './languages/languages';
import { LanguageDefinition, LanguageDefinitionSnippetArguments } from './languages/types';
-import { OverviewPanel } from './overview_panels/overview_panel';
-import { LanguageClientPanel } from './overview_panels/language_client_panel';
-
const NoIndicesContent = () => (
<>
@@ -200,6 +199,8 @@ export const ElasticsearchIndexingApi = () => {
language={language}
setSelectedLanguage={setSelectedLanguage}
isSelectedLanguage={selectedLanguage === language}
+ http={http}
+ pluginId={PLUGIN_ID}
/>
))}
diff --git a/x-pack/plugins/serverless_search/public/application/components/overview.tsx b/x-pack/plugins/serverless_search/public/application/components/overview.tsx
index a683f64820785..53a0cf1ee20bc 100644
--- a/x-pack/plugins/serverless_search/public/application/components/overview.tsx
+++ b/x-pack/plugins/serverless_search/public/application/components/overview.tsx
@@ -19,22 +19,26 @@ import {
EuiTitle,
} from '@elastic/eui';
import { i18n } from '@kbn/i18n';
+import {
+ WelcomeBanner,
+ IngestData,
+ SelectClientPanel,
+ OverviewPanel,
+ CodeBox,
+ LanguageClientPanel,
+ InstallClientPanel,
+} from '@kbn/serverless-api-panels';
+
import React, { useMemo, useState } from 'react';
import { docLinks } from '../../../common/doc_links';
import { PLUGIN_ID } from '../../../common';
import { useKibanaServices } from '../hooks/use_kibana';
import { API_KEY_PLACEHOLDER, ELASTICSEARCH_URL_PLACEHOLDER } from '../constants';
-import { CodeBox } from './code_box';
import { javascriptDefinition } from './languages/javascript';
import { languageDefinitions } from './languages/languages';
import { LanguageDefinition, LanguageDefinitionSnippetArguments } from './languages/types';
-import { InstallClientPanel } from './overview_panels/install_client';
-import { OverviewPanel } from './overview_panels/overview_panel';
import './overview.scss';
-import { IngestData } from './overview_panels/ingest_data';
-import { SelectClientPanel } from './overview_panels/select_client';
import { ApiKeyPanel } from './api_key/api_key';
-import { LanguageClientPanel } from './overview_panels/language_client_panel';
export const ElasticsearchOverview = () => {
const [selectedLanguage, setSelectedLanguage] =
@@ -59,54 +63,19 @@ export const ElasticsearchOverview = () => {
-
-
- {/* Reversing column direction here so screenreaders keep h1 as the first element */}
-
-
-
-
- {i18n.translate('xpack.serverlessSearch.header.title', {
- defaultMessage: 'Get started with Elasticsearch',
- })}
-
-
-
-
-
-
- {i18n.translate('xpack.serverlessSearch.header.greeting.title', {
- defaultMessage: 'Hi {name}!',
- values: { name: userProfile.user.full_name || userProfile.user.username },
- })}
-
-
-
-
-
-
- {i18n.translate('xpack.serverlessSearch.header.description', {
- defaultMessage:
- "Set up your programming language client, ingest some data, and you'll be ready to start searching within minutes.",
- })}
-
-
-
-
-
-
-
-
+
-
+
{languageDefinitions.map((language, index) => (
))}
@@ -118,6 +87,9 @@ export const ElasticsearchOverview = () => {
codeArguments={codeSnippetArguments}
language={selectedLanguage}
setSelectedLanguage={setSelectedLanguage}
+ useKibanaServicesHook={useKibanaServices}
+ http={http}
+ pluginId={PLUGIN_ID}
/>
@@ -152,6 +124,9 @@ export const ElasticsearchOverview = () => {
languages={languageDefinitions}
selectedLanguage={selectedLanguage}
setSelectedLanguage={setSelectedLanguage}
+ http={http}
+ pluginId={PLUGIN_ID}
+ useKibanaServicesHook={useKibanaServices}
/>
}
links={[
@@ -200,6 +175,9 @@ export const ElasticsearchOverview = () => {
languages={languageDefinitions}
selectedLanguage={selectedLanguage}
setSelectedLanguage={setSelectedLanguage}
+ http={http}
+ pluginId={PLUGIN_ID}
+ useKibanaServicesHook={useKibanaServices}
/>
}
links={[]}
@@ -213,6 +191,10 @@ export const ElasticsearchOverview = () => {
codeArguments={codeSnippetArguments}
selectedLanguage={selectedLanguage}
setSelectedLanguage={setSelectedLanguage}
+ http={http}
+ docLinks={docLinks}
+ pluginId={PLUGIN_ID}
+ useKibanaServicesHook={useKibanaServices}
/>
@@ -228,6 +210,9 @@ export const ElasticsearchOverview = () => {
languages={languageDefinitions}
selectedLanguage={selectedLanguage}
setSelectedLanguage={setSelectedLanguage}
+ http={http}
+ pluginId={PLUGIN_ID}
+ useKibanaServicesHook={useKibanaServices}
/>
}
links={[]}
diff --git a/x-pack/plugins/serverless_search/public/application/components/overview_panels/ingest_data.scss b/x-pack/plugins/serverless_search/public/application/components/overview_panels/ingest_data.scss
deleted file mode 100644
index ff48f49cfaf9e..0000000000000
--- a/x-pack/plugins/serverless_search/public/application/components/overview_panels/ingest_data.scss
+++ /dev/null
@@ -1,3 +0,0 @@
-.serverlessSearchIntegrationsPanel {
- background-color: $euiColorDarkestShade;
-}
diff --git a/yarn.lock b/yarn.lock
index 952c808afb066..88e8398b6c3e4 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -5301,6 +5301,10 @@
version "0.0.0"
uid ""
+"@kbn/serverless-api-panels@link:packages/kbn-serverless-api-panels":
+ version "0.0.0"
+ uid ""
+
"@kbn/serverless-observability@link:x-pack/plugins/serverless_observability":
version "0.0.0"
uid ""
From c6899084b627200e5dbdfae6b37097cee348dfe5 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Efe=20G=C3=BCrkan=20YALAMAN?=
Date: Thu, 3 Aug 2023 15:34:01 +0200
Subject: [PATCH 02/17] Add getting started components to enterprise search
---
.../components/code_box.tsx | 19 +-
.../components/github_link.tsx | 6 +-
.../components/ingest_data.tsx | 17 +-
.../components/install_client.tsx | 85 +--
.../components/integrations_panel.tsx | 6 +-
.../components/language_client_panel.tsx | 15 +-
.../components/overview_panel.tsx | 10 +-
.../components/select_client.tsx | 94 ++--
.../components/try_in_console_button.tsx | 16 +-
packages/kbn-serverless-api-panels/index.tsx | 27 +-
.../getting_started/getting_started.tsx | 306 +++++++++++
.../manage_api_keys_popover/popover.tsx | 86 ---
.../search_index/generate_api_key_panel.tsx | 110 +---
.../assets/search_header.svg | 9 +
.../product_selector/ingestion_selector.tsx | 120 +++++
.../product_selector/product_selector.scss | 8 +
.../product_selector/product_selector.tsx | 165 ++++--
.../public/applications/index.tsx | 4 +-
.../shared/kibana/kibana_logic.ts | 3 +
.../public/assets/client_libraries/curl.svg | 6 +
.../public/assets/client_libraries/github.svg | 3 +
.../public/assets/client_libraries/index.ts | 2 +
.../public/assets/images/api-cloud.svg | 498 ++++++++++++++++++
.../public/assets/images/search-connector.svg | 365 +++++++++++++
.../public/assets/images/search-crawler.svg | 415 +++++++++++++++
.../enterprise_search/public/plugin.ts | 5 +-
.../application/components/overview.tsx | 24 +-
.../components/search-connector.svg | 365 +++++++++++++
28 files changed, 2413 insertions(+), 376 deletions(-)
create mode 100644 x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/components/getting_started/getting_started.tsx
delete mode 100644 x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/components/manage_api_keys_popover/popover.tsx
create mode 100644 x-pack/plugins/enterprise_search/public/applications/enterprise_search_overview/assets/search_header.svg
create mode 100644 x-pack/plugins/enterprise_search/public/applications/enterprise_search_overview/components/product_selector/ingestion_selector.tsx
create mode 100644 x-pack/plugins/enterprise_search/public/applications/enterprise_search_overview/components/product_selector/product_selector.scss
create mode 100644 x-pack/plugins/enterprise_search/public/assets/client_libraries/curl.svg
create mode 100644 x-pack/plugins/enterprise_search/public/assets/client_libraries/github.svg
create mode 100644 x-pack/plugins/enterprise_search/public/assets/images/api-cloud.svg
create mode 100644 x-pack/plugins/enterprise_search/public/assets/images/search-connector.svg
create mode 100644 x-pack/plugins/enterprise_search/public/assets/images/search-crawler.svg
create mode 100644 x-pack/plugins/serverless_search/public/application/components/search-connector.svg
diff --git a/packages/kbn-serverless-api-panels/components/code_box.tsx b/packages/kbn-serverless-api-panels/components/code_box.tsx
index 7eb3df40e18c2..e3ae11ea14bd8 100644
--- a/packages/kbn-serverless-api-panels/components/code_box.tsx
+++ b/packages/kbn-serverless-api-panels/components/code_box.tsx
@@ -6,6 +6,8 @@
* Side Public License, v 1.
*/
+import React, { useState } from 'react';
+
import {
EuiButtonEmpty,
EuiCodeBlock,
@@ -20,7 +22,10 @@ import {
EuiThemeProvider,
} from '@elastic/eui';
import { i18n } from '@kbn/i18n';
-import React, { useState } from 'react';
+import type { HttpStart } from '@kbn/core-http-browser';
+import type { ApplicationStart } from '@kbn/core-application-browser';
+import type { SharePluginStart } from '@kbn/share-plugin/public';
+
import { consoleDefinition } from '../languages/console';
import { LanguageDefinition, LanguageDefinitionSnippetArguments } from '../languages/types';
import { TryInConsoleButton } from './try_in_console_button';
@@ -34,9 +39,10 @@ interface CodeBoxProps {
languageType?: string;
selectedLanguage: LanguageDefinition;
setSelectedLanguage: (language: LanguageDefinition) => void;
- http: any;
+ http: HttpStart;
pluginId: string;
- useKibanaServicesHook: any;
+ application?: ApplicationStart;
+ sharePlugin: SharePluginStart;
}
const getCodeSnippet = (
@@ -59,9 +65,11 @@ export const CodeBox: React.FC = ({
setSelectedLanguage,
http,
pluginId,
- useKibanaServicesHook,
+ application,
+ sharePlugin,
}) => {
const [isPopoverOpen, setIsPopoverOpen] = useState(false);
+
const items = languages.map((language) => (
= ({
)}
diff --git a/packages/kbn-serverless-api-panels/components/github_link.tsx b/packages/kbn-serverless-api-panels/components/github_link.tsx
index b89bfd36ae611..19c7a83ed2de3 100644
--- a/packages/kbn-serverless-api-panels/components/github_link.tsx
+++ b/packages/kbn-serverless-api-panels/components/github_link.tsx
@@ -6,13 +6,15 @@
* Side Public License, v 1.
*/
-import { EuiFlexGroup, EuiFlexItem, EuiIcon, EuiText, EuiLink } from '@elastic/eui';
import React from 'react';
+import { EuiFlexGroup, EuiFlexItem, EuiIcon, EuiText, EuiLink } from '@elastic/eui';
+import { HttpStart } from '@kbn/core-http-browser';
+
export const GithubLink: React.FC<{
label: string;
href: string;
- http: any;
+ http: HttpStart;
pluginId: string;
}> = ({ label, href, http, pluginId }) => {
return (
diff --git a/packages/kbn-serverless-api-panels/components/ingest_data.tsx b/packages/kbn-serverless-api-panels/components/ingest_data.tsx
index f67941abd39e1..375e54a55881c 100644
--- a/packages/kbn-serverless-api-panels/components/ingest_data.tsx
+++ b/packages/kbn-serverless-api-panels/components/ingest_data.tsx
@@ -6,9 +6,13 @@
* Side Public License, v 1.
*/
+import React, { useState } from 'react';
+
import { EuiCheckableCard, EuiFormFieldset, EuiSpacer, EuiText, EuiTitle } from '@elastic/eui';
import { i18n } from '@kbn/i18n';
-import React, { useState } from 'react';
+import type { HttpStart } from '@kbn/core-http-browser';
+import type { ApplicationStart } from '@kbn/core-application-browser';
+import type { SharePluginStart } from '@kbn/share-plugin/public';
import { CodeBox } from './code_box';
import { languageDefinitions } from '../languages/languages';
import { LanguageDefinition, LanguageDefinitionSnippetArguments } from '../languages/types';
@@ -20,9 +24,10 @@ interface IngestDataProps {
selectedLanguage: LanguageDefinition;
setSelectedLanguage: (language: LanguageDefinition) => void;
docLinks: any;
- http: any;
+ http: HttpStart;
pluginId: string;
- useKibanaServicesHook: any;
+ application?: ApplicationStart;
+ sharePlugin: SharePluginStart;
}
export const IngestData: React.FC = ({
@@ -32,7 +37,8 @@ export const IngestData: React.FC = ({
docLinks,
http,
pluginId,
- useKibanaServicesHook,
+ application,
+ sharePlugin,
}) => {
const [selectedIngestMethod, setSelectedIngestMethod] = useState<
'ingestViaApi' | 'ingestViaIntegration'
@@ -53,7 +59,8 @@ export const IngestData: React.FC = ({
setSelectedLanguage={setSelectedLanguage}
http={http}
pluginId={pluginId}
- useKibanaServicesHook={useKibanaServicesHook}
+ application={application}
+ sharePlugin={sharePlugin}
/>
) : (
diff --git a/packages/kbn-serverless-api-panels/components/install_client.tsx b/packages/kbn-serverless-api-panels/components/install_client.tsx
index 72cccc1774cef..fe777bf094483 100644
--- a/packages/kbn-serverless-api-panels/components/install_client.tsx
+++ b/packages/kbn-serverless-api-panels/components/install_client.tsx
@@ -6,9 +6,13 @@
* Side Public License, v 1.
*/
+import React from 'react';
+
import { EuiSpacer, EuiCallOut, EuiText } from '@elastic/eui';
import { i18n } from '@kbn/i18n';
-import React from 'react';
+import type { HttpStart } from '@kbn/core-http-browser';
+import type { ApplicationStart } from '@kbn/core-application-browser';
+import type { SharePluginStart } from '@kbn/share-plugin/public';
import { CodeBox } from './code_box';
import { languageDefinitions } from '../languages/languages';
import { OverviewPanel } from './overview_panel';
@@ -23,12 +27,14 @@ interface InstallClientProps {
codeArguments: LanguageDefinitionSnippetArguments;
language: LanguageDefinition;
setSelectedLanguage: (language: LanguageDefinition) => void;
- http: any;
+ http: HttpStart;
pluginId: string;
- useKibanaServicesHook: any;
+ application?: ApplicationStart;
+ sharePlugin: SharePluginStart;
+ isPanelLeft?: boolean;
}
-const Link: React.FC<{ language: Languages; http: any; pluginId: string }> = ({
+const Link: React.FC<{ language: Languages; http: HttpStart; pluginId: string }> = ({
language,
http,
pluginId,
@@ -77,8 +83,43 @@ export const InstallClientPanel: React.FC = ({
setSelectedLanguage,
http,
pluginId,
- useKibanaServicesHook,
+ application,
+ sharePlugin,
+ isPanelLeft = true,
}) => {
+ const panelContent = (
+ <>
+
+
+
+
+
+
+ {i18n.translate('xpack.serverlessSearch.apiCallout.content', {
+ defaultMessage:
+ 'Console enables you to call Elasticsearch and Kibana REST APIs directly, without needing to install a language client.',
+ })}
+
+
+ >
+ );
return (
= ({
title={i18n.translate('xpack.serverlessSearch.installClient.title', {
defaultMessage: 'Install a client',
})}
- leftPanelContent={
- <>
-
-
-
-
-
-
- {i18n.translate('xpack.serverlessSearch.apiCallout.content', {
- defaultMessage:
- 'Console enables you to call Elasticsearch and Kibana REST APIs directly, without needing to install a language client.',
- })}
-
-
- >
- }
+ leftPanelContent={isPanelLeft ? panelContent : undefined}
+ rightPanelContent={!isPanelLeft ? panelContent : undefined}
/>
);
};
diff --git a/packages/kbn-serverless-api-panels/components/integrations_panel.tsx b/packages/kbn-serverless-api-panels/components/integrations_panel.tsx
index 0842dc646549d..c3b6744301dd3 100644
--- a/packages/kbn-serverless-api-panels/components/integrations_panel.tsx
+++ b/packages/kbn-serverless-api-panels/components/integrations_panel.tsx
@@ -6,6 +6,8 @@
* Side Public License, v 1.
*/
+import React from 'react';
+
import {
EuiThemeProvider,
EuiPanel,
@@ -17,14 +19,14 @@ import {
EuiText,
EuiLink,
} from '@elastic/eui';
+import { HttpStart } from '@kbn/core-http-browser';
import { i18n } from '@kbn/i18n';
-import React from 'react';
import { LEARN_MORE_LABEL } from '../constants';
import { GithubLink } from './github_link';
export interface IntegrationsPanelProps {
docLinks: any;
- http: any;
+ http: HttpStart;
pluginId: string;
}
diff --git a/packages/kbn-serverless-api-panels/components/language_client_panel.tsx b/packages/kbn-serverless-api-panels/components/language_client_panel.tsx
index c04e925aa8160..702f8eeec0be3 100644
--- a/packages/kbn-serverless-api-panels/components/language_client_panel.tsx
+++ b/packages/kbn-serverless-api-panels/components/language_client_panel.tsx
@@ -6,6 +6,8 @@
* Side Public License, v 1.
*/
+import React from 'react';
+
import {
EuiFlexGroup,
EuiFlexItem,
@@ -16,7 +18,8 @@ import {
useEuiTheme,
} from '@elastic/eui';
-import React from 'react';
+import type { HttpStart } from '@kbn/core-http-browser';
+
import { LanguageDefinition } from '../languages/types';
import './select_client.scss';
@@ -24,8 +27,9 @@ interface SelectClientProps {
language: LanguageDefinition;
setSelectedLanguage: (language: LanguageDefinition) => void;
isSelectedLanguage: boolean;
- http: any;
- pluginId: string;
+ http: HttpStart;
+ pluginId?: string;
+ src?: string;
}
export const LanguageClientPanel: React.FC = ({
@@ -34,6 +38,7 @@ export const LanguageClientPanel: React.FC = ({
isSelectedLanguage,
http,
pluginId,
+ src,
}) => {
const { euiTheme } = useEuiTheme();
@@ -55,7 +60,9 @@ export const LanguageClientPanel: React.FC = ({
diff --git a/packages/kbn-serverless-api-panels/components/overview_panel.tsx b/packages/kbn-serverless-api-panels/components/overview_panel.tsx
index 7c1208f7a4e51..811836ad514f5 100644
--- a/packages/kbn-serverless-api-panels/components/overview_panel.tsx
+++ b/packages/kbn-serverless-api-panels/components/overview_panel.tsx
@@ -6,6 +6,8 @@
* Side Public License, v 1.
*/
+import React from 'react';
+
import {
EuiFlexGroup,
EuiFlexItem,
@@ -15,13 +17,13 @@ import {
EuiTitle,
EuiLink,
} from '@elastic/eui';
-import React from 'react';
import { LEARN_MORE_LABEL } from '../constants';
interface OverviewPanelProps {
description?: React.ReactNode | string;
- leftPanelContent: React.ReactNode;
+ leftPanelContent?: React.ReactNode;
links?: Array<{ label: string; href: string }>;
+ rightPanelContent?: React.ReactNode;
title: string;
}
@@ -30,13 +32,14 @@ export const OverviewPanel: React.FC = ({
description,
leftPanelContent,
links,
+ rightPanelContent,
title,
}) => {
return (
<>
- {leftPanelContent}
+ {leftPanelContent && {leftPanelContent} }
@@ -63,6 +66,7 @@ export const OverviewPanel: React.FC = ({
) : null}
+ {rightPanelContent && {rightPanelContent} }
>
diff --git a/packages/kbn-serverless-api-panels/components/select_client.tsx b/packages/kbn-serverless-api-panels/components/select_client.tsx
index 2e4e1bc409861..88b5b5f780543 100644
--- a/packages/kbn-serverless-api-panels/components/select_client.tsx
+++ b/packages/kbn-serverless-api-panels/components/select_client.tsx
@@ -6,24 +6,70 @@
* Side Public License, v 1.
*/
+import React from 'react';
+
import { EuiCallOut, EuiFlexGroup, EuiFlexItem, EuiLink, EuiSpacer, EuiText } from '@elastic/eui';
import { i18n } from '@kbn/i18n';
import { FormattedMessage } from '@kbn/i18n-react';
-import React from 'react';
+import type { HttpStart } from '@kbn/core-http-browser';
import { OverviewPanel } from './overview_panel';
import './select_client.scss';
export interface SelectClientPanelProps {
docLinks: any;
- http: any;
+ http: HttpStart;
+ isPanelLeft?: boolean;
}
export const SelectClientPanel: React.FC = ({
docLinks,
children,
http,
+ isPanelLeft = true,
}) => {
+ const panelContent = (
+ <>
+
+
+
+
+ {i18n.translate('xpack.serverlessSearch.selectClient.heading', {
+ defaultMessage: 'Choose one',
+ })}
+
+
+
+
+
+
+ {children}
+
+
+
+
+ {i18n.translate('xpack.serverlessSearch.selectClient.callout.description', {
+ defaultMessage:
+ 'With Console, you can get started right away with our REST API’s. No installation required. ',
+ })}
+
+
+
+ {i18n.translate('xpack.serverlessSearch.selectClient.callout.link', {
+ defaultMessage: 'Try Console now',
+ })}
+
+
+
+
+ >
+ );
return (
= ({
}}
/>
}
- leftPanelContent={
- <>
-
-
-
-
- {i18n.translate('xpack.serverlessSearch.selectClient.heading', {
- defaultMessage: 'Choose one',
- })}
-
-
-
-
-
-
- {children}
-
-
-
-
- {i18n.translate('xpack.serverlessSearch.selectClient.callout.description', {
- defaultMessage:
- 'With Console, you can get started right away with our REST API’s. No installation required. ',
- })}
-
-
-
- {i18n.translate('xpack.serverlessSearch.selectClient.callout.link', {
- defaultMessage: 'Try Console now',
- })}
-
-
-
-
- >
- }
+ leftPanelContent={isPanelLeft ? panelContent : undefined}
+ rightPanelContent={!isPanelLeft ? panelContent : undefined}
links={[
{
href: docLinks.elasticsearchClients,
diff --git a/packages/kbn-serverless-api-panels/components/try_in_console_button.tsx b/packages/kbn-serverless-api-panels/components/try_in_console_button.tsx
index ac907220a8131..04d420592db19 100644
--- a/packages/kbn-serverless-api-panels/components/try_in_console_button.tsx
+++ b/packages/kbn-serverless-api-panels/components/try_in_console_button.tsx
@@ -9,19 +9,23 @@
import React from 'react';
import { EuiButtonEmpty } from '@elastic/eui';
+import type { ApplicationStart } from '@kbn/core-application-browser';
+import type { SharePluginStart } from '@kbn/share-plugin/public';
import { FormattedMessage } from '@kbn/i18n-react';
import { compressToEncodedURIComponent } from 'lz-string';
export interface TryInConsoleButtonProps {
request: string;
- useKibanaServicesHook: any;
+ application?: ApplicationStart;
+ sharePlugin: SharePluginStart;
}
-export const TryInConsoleButton = ({ request, useKibanaServicesHook }: TryInConsoleButtonProps) => {
- const {
- application,
- share: { url },
- } = useKibanaServicesHook();
+export const TryInConsoleButton = ({
+ request,
+ application,
+ sharePlugin,
+}: TryInConsoleButtonProps) => {
+ const { url } = sharePlugin;
const canShowDevtools = !!application?.capabilities?.dev_tools?.show;
if (!canShowDevtools || !url) return null;
diff --git a/packages/kbn-serverless-api-panels/index.tsx b/packages/kbn-serverless-api-panels/index.tsx
index e965d77373e24..0b4fb9039077e 100644
--- a/packages/kbn-serverless-api-panels/index.tsx
+++ b/packages/kbn-serverless-api-panels/index.tsx
@@ -22,10 +22,17 @@ export * from './components/install_client';
export interface WelcomeBannerProps {
userProfile: any;
- assetBasePath: string;
+ assetBasePath?: string;
+ image?: string;
+ showDescription?: boolean;
}
-export const WelcomeBanner: React.FC = ({ userProfile, assetBasePath }) => (
+export const WelcomeBanner: React.FC = ({
+ userProfile,
+ assetBasePath,
+ image,
+ showDescription = true,
+}) => (
{/* Reversing column direction here so screenreaders keep h1 as the first element */}
@@ -51,17 +58,19 @@ export const WelcomeBanner: React.FC = ({ userProfile, asset
-
- {i18n.translate('xpack.serverlessSearch.header.description', {
- defaultMessage:
- "Set up your programming language client, ingest some data, and you'll be ready to start searching within minutes.",
- })}
-
+ {showDescription && (
+
+ {i18n.translate('xpack.serverlessSearch.header.description', {
+ defaultMessage:
+ "Set up your programming language client, ingest some data, and you'll be ready to start searching within minutes.",
+ })}
+
+ )}
-
+
);
diff --git a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/components/getting_started/getting_started.tsx b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/components/getting_started/getting_started.tsx
new file mode 100644
index 0000000000000..6661d6c877824
--- /dev/null
+++ b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/components/getting_started/getting_started.tsx
@@ -0,0 +1,306 @@
+/*
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
+ * or more contributor license agreements. Licensed under the Elastic License
+ * 2.0; you may not use this file except in compliance with the Elastic License
+ * 2.0.
+ */
+
+import React, { useState } from 'react';
+
+import { css } from '@emotion/react';
+import { useActions, useValues } from 'kea';
+
+import {
+ EuiButton,
+ EuiCodeBlock,
+ EuiFlexGroup,
+ EuiFlexItem,
+ EuiPanel,
+ EuiSplitPanel,
+ EuiText,
+ EuiThemeProvider,
+ EuiTitle,
+} from '@elastic/eui';
+
+import { i18n } from '@kbn/i18n';
+import { useKibana } from '@kbn/kibana-react-plugin/public';
+import {
+ SelectClientPanel,
+ LanguageClientPanel,
+ InstallClientPanel,
+ OverviewPanel,
+ CodeBox,
+} from '@kbn/serverless-api-panels';
+
+import { javascriptDefinition } from '@kbn/serverless-api-panels/languages/javascript';
+import { languageDefinitions } from '@kbn/serverless-api-panels/languages/languages';
+import { LanguageDefinition } from '@kbn/serverless-api-panels/languages/types';
+
+import { KibanaDeps } from '../../../../../../../common/types';
+
+import { icons } from '../../../../../../assets/client_libraries';
+import { useCloudDetails } from '../../../../../shared/cloud_details/cloud_details';
+import { docLinks } from '../../../../../shared/doc_links';
+
+import { HttpLogic } from '../../../../../shared/http';
+import { KibanaLogic } from '../../../../../shared/kibana';
+import { IndexViewLogic } from '../../index_view_logic';
+import { OverviewLogic } from '../../overview.logic';
+import { GenerateApiKeyModal } from '../generate_api_key_modal/modal';
+
+export const APIGettingStarted = () => {
+ const { http } = useValues(HttpLogic);
+ const { apiKey, isGenerateModalOpen } = useValues(OverviewLogic);
+ const { openGenerateModal, closeGenerateModal } = useActions(OverviewLogic);
+ const { indexName } = useValues(IndexViewLogic);
+ const { services } = useKibana();
+
+ const cloudContext = useCloudDetails();
+ const DEFAULT_URL = 'https://localhost:9200';
+
+ const codeArgs = {
+ apiKey,
+ url: cloudContext.elasticsearchUrl || DEFAULT_URL,
+ };
+
+ const [selectedLanguage, setSelectedLanguage] =
+ useState(javascriptDefinition);
+ return (
+ <>
+ {isGenerateModalOpen && (
+
+ )}
+
+ {languageDefinitions.map((language, index) => (
+
+
+
+ ))}
+
+
+
+
+
+
+
+ Generate an API key
+
+
+ Your private, unique identifier for authentication and authorization.
+
+
+
+
+
+
+
+
+ {i18n.translate(
+ 'xpack.enterpriseSearch.content.overview.documementExample.generateApiKeyButton.createNew',
+ { defaultMessage: 'New' }
+ )}
+
+
+
+
+
+
+ KibanaLogic.values.navigateToUrl('/app/management/security/api_keys', {
+ shouldNotCreateHref: true,
+ })
+ }
+ >
+
+
+ {i18n.translate(
+ 'xpack.enterpriseSearch.content.overview.documementExample.generateApiKeyButton.viewAll',
+ { defaultMessage: 'Manage' }
+ )}
+
+
+
+
+
+
+
+
+ }
+ links={[]}
+ title={'Generate an API key'}
+ />
+
+
+
+
+ {i18n.translate('xpack.serverlessSearch.apiKey.stepTwoDescription', {
+ defaultMessage: 'Unique identifier for specific project. ',
+ })}
+
+
+
+
+
+ {'cloudid'}
+
+
+
+
+ }
+ links={[]}
+ title={'Copy your Cloud ID'}
+ />
+
+
+ }
+ links={[
+ ...(selectedLanguage.basicConfig
+ ? [
+ {
+ href: selectedLanguage.basicConfig,
+ label: i18n.translate('xpack.serverlessSearch.configureClient.basicConfigLabel', {
+ defaultMessage: 'Basic configuration',
+ }),
+ },
+ ]
+ : []),
+ ...(selectedLanguage.advancedConfig
+ ? [
+ {
+ href: selectedLanguage.advancedConfig,
+ label: i18n.translate(
+ 'xpack.serverlessSearch.configureClient.advancedConfigLabel',
+ {
+ defaultMessage: 'Advanced configuration',
+ }
+ ),
+ },
+ ]
+ : []),
+ ]}
+ title={i18n.translate('xpack.serverlessSearch.configureClient.title', {
+ defaultMessage: 'Configure your client',
+ })}
+ />
+
+
+ }
+ links={[]}
+ title={i18n.translate('xpack.serverlessSearch.testConnection.title', {
+ defaultMessage: 'Test your connection',
+ })}
+ />
+
+ }
+ links={[]}
+ title={'Ingest Data'}
+ />
+
+
+ }
+ links={[]}
+ title={i18n.translate('xpack.serverlessSearch.searchQuery.title', {
+ defaultMessage: 'Build your first search query',
+ })}
+ />
+ >
+ );
+};
diff --git a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/components/manage_api_keys_popover/popover.tsx b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/components/manage_api_keys_popover/popover.tsx
deleted file mode 100644
index e6385096c754d..0000000000000
--- a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/components/manage_api_keys_popover/popover.tsx
+++ /dev/null
@@ -1,86 +0,0 @@
-/*
- * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
- * or more contributor license agreements. Licensed under the Elastic License
- * 2.0; you may not use this file except in compliance with the Elastic License
- * 2.0.
- */
-
-import React from 'react';
-
-import { useActions, useValues } from 'kea';
-
-import {
- EuiPopover,
- EuiButton,
- EuiContextMenuPanel,
- EuiContextMenuItem,
- EuiText,
-} from '@elastic/eui';
-
-import { i18n } from '@kbn/i18n';
-
-import { KibanaLogic } from '../../../../../shared/kibana';
-
-import { IndexViewLogic } from '../../index_view_logic';
-import { OverviewLogic } from '../../overview.logic';
-
-export const ManageKeysPopover: React.FC = () => {
- const { isManageKeysPopoverOpen } = useValues(OverviewLogic);
- const { ingestionMethod } = useValues(IndexViewLogic);
- const { toggleManageApiKeyPopover, openGenerateModal } = useActions(OverviewLogic);
-
- return (
-
- {i18n.translate(
- 'xpack.enterpriseSearch.content.overview.documentExample.generateApiKeyButton.label',
- { defaultMessage: 'Manage API keys' }
- )}
-
- }
- >
-
- KibanaLogic.values.navigateToUrl('/app/management/security/api_keys', {
- shouldNotCreateHref: true,
- })
- }
- >
-
-
- {i18n.translate(
- 'xpack.enterpriseSearch.content.overview.documementExample.generateApiKeyButton.viewAll',
- { defaultMessage: 'View all API keys' }
- )}
-
-
- ,
-
-
-
- {i18n.translate(
- 'xpack.enterpriseSearch.content.overview.documementExample.generateApiKeyButton.createNew',
- { defaultMessage: 'Create a new API key' }
- )}
-
-
- ,
- ]}
- />
-
- );
-};
diff --git a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/generate_api_key_panel.tsx b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/generate_api_key_panel.tsx
index 0de71b834b6f0..806dbacec6350 100644
--- a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/generate_api_key_panel.tsx
+++ b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/generate_api_key_panel.tsx
@@ -5,45 +5,24 @@
* 2.0.
*/
-import React, { useState } from 'react';
+import React from 'react';
import { useActions, useValues } from 'kea';
-import {
- EuiEmptyPrompt,
- EuiFlexGroup,
- EuiFlexItem,
- EuiLink,
- EuiPanel,
- EuiSwitch,
- EuiText,
- EuiTitle,
-} from '@elastic/eui';
+import { EuiEmptyPrompt, EuiFlexGroup, EuiFlexItem, EuiPanel } from '@elastic/eui';
import { i18n } from '@kbn/i18n';
-import { FormattedMessage } from '@kbn/i18n-react';
-import { docLinks } from '../../../shared/doc_links';
-import { DOCUMENTS_API_JSON_EXAMPLE } from '../new_index/constants';
-
-import { SettingsLogic } from '../settings/settings_logic';
-
-import { ClientLibrariesPopover } from './components/client_libraries_popover/popover';
-import { CurlRequest } from './components/curl_request/curl_request';
import { GenerateApiKeyModal } from './components/generate_api_key_modal/modal';
-import { ManageKeysPopover } from './components/manage_api_keys_popover/popover';
+import { APIGettingStarted } from './components/getting_started/getting_started';
import { IndexViewLogic } from './index_view_logic';
import { OverviewLogic } from './overview.logic';
export const GenerateApiKeyPanel: React.FC = () => {
- const { apiKey, isGenerateModalOpen } = useValues(OverviewLogic);
- const { indexName, ingestionMethod, isHiddenIndex } = useValues(IndexViewLogic);
+ const { isGenerateModalOpen } = useValues(OverviewLogic);
+ const { indexName, isHiddenIndex } = useValues(IndexViewLogic);
const { closeGenerateModal } = useActions(OverviewLogic);
- const { defaultPipeline } = useValues(SettingsLogic);
-
- const [optimizedRequest, setOptimizedRequest] = useState(true);
-
return (
<>
{isGenerateModalOpen && (
@@ -71,84 +50,7 @@ export const GenerateApiKeyPanel: React.FC = () => {
}
/>
) : (
-
-
-
-
-
-
-
-
- {i18n.translate(
- 'xpack.enterpriseSearch.content.overview.documentExample.title',
- { defaultMessage: 'Adding documents to your index' }
- )}
-
-
-
-
-
-
-
- {i18n.translate(
- 'xpack.enterpriseSearch.content.overview.documentExample.description.clientsLink',
- { defaultMessage: 'programming language clients' }
- )}
-
- ),
- documentation: (
-
- {i18n.translate(
- 'xpack.enterpriseSearch.content.overview.documentExample.description.documentationLink',
- { defaultMessage: 'documentation' }
- )}
-
- ),
- }}
- />
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- setOptimizedRequest(event.target.checked)}
- label={i18n.translate(
- 'xpack.enterpriseSearch.content.overview.optimizedRequest.label',
- { defaultMessage: 'View Search optimized request' }
- )}
- checked={optimizedRequest}
- />
-
-
-
-
-
+
)}
diff --git a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_overview/assets/search_header.svg b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_overview/assets/search_header.svg
new file mode 100644
index 0000000000000..c11980cc595b8
--- /dev/null
+++ b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_overview/assets/search_header.svg
@@ -0,0 +1,9 @@
+
+
+
+
+
+
+
+
+
diff --git a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_overview/components/product_selector/ingestion_selector.tsx b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_overview/components/product_selector/ingestion_selector.tsx
new file mode 100644
index 0000000000000..db5042dafc302
--- /dev/null
+++ b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_overview/components/product_selector/ingestion_selector.tsx
@@ -0,0 +1,120 @@
+/*
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
+ * or more contributor license agreements. Licensed under the Elastic License
+ * 2.0; you may not use this file except in compliance with the Elastic License
+ * 2.0.
+ */
+
+import React from 'react';
+
+import { generatePath } from 'react-router-dom';
+
+import { EuiButton, EuiCard, EuiFlexGroup, EuiFlexItem, EuiIcon } from '@elastic/eui';
+
+import { i18n } from '@kbn/i18n';
+
+import {
+ ENTERPRISE_SEARCH_CONTENT_PLUGIN,
+ INGESTION_METHOD_IDS,
+} from '../../../../../common/constants';
+
+import apiLogo from '../../../../assets/images/api-cloud.svg';
+import connectorLogo from '../../../../assets/images/search-connector.svg';
+import crawlerLogo from '../../../../assets/images/search-crawler.svg';
+
+import {
+ NEW_API_PATH,
+ NEW_INDEX_METHOD_PATH,
+ NEW_INDEX_SELECT_CONNECTOR_PATH,
+} from '../../../enterprise_search_content/routes';
+import { EuiLinkTo } from '../../../shared/react_router_helpers';
+
+const START_LABEL = i18n.translate('xpack.enterpriseSearch.ingestSelector.startButton', {
+ defaultMessage: 'Start',
+});
+
+export const IngestionSelector: React.FC = () => {
+ return (
+
+
+ }
+ textAlign="left"
+ title={i18n.translate('xpack.enterpriseSearch.ingestSelector.method.api', {
+ defaultMessage: 'API',
+ })}
+ description={i18n.translate(
+ 'xpack.enterpriseSearch.ingestSelector.method.api.description',
+ {
+ defaultMessage:
+ 'Add documents programmatically by connecting with the API using your preferred language client.',
+ }
+ )}
+ footer={
+
+ {START_LABEL}
+
+ }
+ />
+
+
+ }
+ textAlign="left"
+ title={i18n.translate('xpack.enterpriseSearch.ingestSelector.method.connectors', {
+ defaultMessage: 'Connectors',
+ })}
+ description={i18n.translate(
+ 'xpack.enterpriseSearch.ingestSelector.method.connectors.description',
+ {
+ defaultMessage:
+ 'Extract, transform, index and sync data from a third-party data source.',
+ }
+ )}
+ footer={
+
+ {START_LABEL}
+
+ }
+ />
+
+
+ }
+ textAlign="left"
+ title={i18n.translate('xpack.enterpriseSearch.ingestSelector.method.crawler', {
+ defaultMessage: 'Web Crawler',
+ })}
+ description={i18n.translate(
+ 'xpack.enterpriseSearch.ingestSelector.method.crawler.description',
+ {
+ defaultMessage:
+ 'Discover, extract, and index searchable content from websites and knowledge bases.',
+ }
+ )}
+ footer={
+
+ {START_LABEL}
+
+ }
+ />
+
+
+ );
+};
diff --git a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_overview/components/product_selector/product_selector.scss b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_overview/components/product_selector/product_selector.scss
new file mode 100644
index 0000000000000..8d02868008375
--- /dev/null
+++ b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_overview/components/product_selector/product_selector.scss
@@ -0,0 +1,8 @@
+.entSearchProductSelectorHeader {
+ background-color: $euiColorPrimary;
+}
+
+.entSearchProductSelectorHeader > div {
+ padding-bottom: 0;
+ padding-top: 0;
+}
diff --git a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_overview/components/product_selector/product_selector.tsx b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_overview/components/product_selector/product_selector.tsx
index 400d5f572ae4d..53192516fa753 100644
--- a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_overview/components/product_selector/product_selector.tsx
+++ b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_overview/components/product_selector/product_selector.tsx
@@ -9,9 +9,17 @@ import React from 'react';
import { useValues } from 'kea';
-import { EuiFlexGroup, EuiFlexItem, EuiSpacer, EuiTitle } from '@elastic/eui';
+import {
+ EuiFlexGroup,
+ EuiFlexItem,
+ EuiPageTemplate,
+ EuiSpacer,
+ EuiText,
+ EuiTitle,
+} from '@elastic/eui';
import { Chat } from '@kbn/cloud-chat-plugin/public';
import { i18n } from '@kbn/i18n';
+import { WelcomeBanner } from '@kbn/serverless-api-panels';
import { AddContentEmptyPrompt } from '../../../shared/add_content_empty_prompt';
import { ErrorStateCallout } from '../../../shared/error_state';
@@ -20,79 +28,126 @@ import { KibanaLogic } from '../../../shared/kibana';
import { SetSearchChrome as SetPageChrome } from '../../../shared/kibana_chrome';
import { SendEnterpriseSearchTelemetry as SendTelemetry } from '../../../shared/telemetry';
+import headerImage from '../../assets/search_header.svg';
+
import { EnterpriseSearchOverviewPageTemplate } from '../layout';
import { SetupGuideCta } from '../setup_guide';
import { TrialCallout } from '../trial_callout';
import { BehavioralAnalyticsProductCard } from './behavioral_analytics_product_card';
import { ElasticsearchProductCard } from './elasticsearch_product_card';
+import { IngestionSelector } from './ingestion_selector';
import { SearchApplicationsProductCard } from './search_applications_product_card';
+import './product_selector.scss';
+
export const ProductSelector: React.FC = () => {
- const { config } = useValues(KibanaLogic);
+ const { config, userProfile } = useValues(KibanaLogic);
const { errorConnectingMessage } = useValues(HttpLogic);
const showErrorConnecting = !!(config.host && errorConnectingMessage);
// The create index flow does not work without ent-search, when content is updated
// to no longer rely on ent-search we can always show the Add Content component
- const showAddContent = config.host && !errorConnectingMessage;
+ const showAddContent = false && config.host && !errorConnectingMessage;
return (
-
-
-
-
- {showAddContent && (
- <>
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {i18n.translate('xpack.enterpriseSearch.overview.title', {
+ defaultMessage: 'Ingest your content',
+ })}
+
+
+
+
+
+ {i18n.translate('xpack.enterpriseSearch.overview.description', {
+ defaultMessage:
+ 'The first step in building your search experience is to create a search-optimized Elasticsearch index and import your content into it. Elasticsearch offers several user-friendly options you can choose from that best match your technical expertise and data sources.',
+ })}
+
+
+
+
+
+
+ {showAddContent && (
+ <>
+
+
+ >
+ )}
+ {showErrorConnecting && (
+ <>
+
+
+ >
+ )}
+
+
+
+
+ {i18n.translate('xpack.enterpriseSearch.overview.createCustom.title', {
+ defaultMessage: 'Create a custom search experience',
})}
- buttonLabel={i18n.translate('xpack.enterpriseSearch.overview.emptyPromptButtonLabel', {
- defaultMessage: 'Create an Elasticsearch index',
+
+
+
+
+
+ {i18n.translate('xpack.enterpriseSearch.overview.createCustom.description', {
+ defaultMessage:
+ 'Once your Elasticsearch index is created and populated, you are ready to get the full power of Elasticsearch and accelerate building search applications with plentiful out-of-the-box tools and multiple language clients, all backed by a robust and fully consumable set of APIs.',
})}
- />
-
- >
- )}
- {showErrorConnecting && (
- <>
-
-
- >
- )}
-
-
- {i18n.translate('xpack.enterpriseSearch.overview.productSelector.title', {
- defaultMessage: "What's next?",
- })}
-
-
-
-
-
-
-
-
-
-
-
-
-
- {!config.host && config.canDeployEntSearch && (
+
+
+
+
+
+
-
+
- )}
-
-
-
+
+
+
+
+
+
+ {!config.host && config.canDeployEntSearch && (
+
+
+
+ )}
+
+
+
+ >
);
};
diff --git a/x-pack/plugins/enterprise_search/public/applications/index.tsx b/x-pack/plugins/enterprise_search/public/applications/index.tsx
index 1d9ae419f5a76..0cee920d4ff7f 100644
--- a/x-pack/plugins/enterprise_search/public/applications/index.tsx
+++ b/x-pack/plugins/enterprise_search/public/applications/index.tsx
@@ -66,7 +66,7 @@ export const renderApp = (
const { history } = params;
const { application, chrome, http, uiSettings } = core;
const { capabilities, navigateToUrl } = application;
- const { charts, cloud, guidedOnboarding, lens, security, share } = plugins;
+ const { charts, cloud, guidedOnboarding, lens, security, share, userProfile } = plugins;
const entCloudHost = getCloudEnterpriseSearchHost(plugins.cloud);
externalUrl.enterpriseSearchUrl = publicUrl || entCloudHost || config.host || '';
@@ -84,7 +84,6 @@ export const renderApp = (
resetContext({ createStore: true });
const store = getContext().store;
-
const unmountKibanaLogic = mountKibanaLogic({
application,
capabilities,
@@ -109,6 +108,7 @@ export const renderApp = (
setDocTitle: chrome.docTitle.change,
share,
uiSettings,
+ userProfile,
});
const unmountLicensingLogic = mountLicensingLogic({
canManageLicense: core.application.capabilities.management?.stack?.license_management,
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 d816c747e5027..c79ad565b2eb7 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
@@ -21,6 +21,7 @@ import {
import { DataPublicPluginStart } from '@kbn/data-plugin/public';
import { GuidedOnboardingPluginStart } from '@kbn/guided-onboarding-plugin/public';
import { LensPublicStart } from '@kbn/lens-plugin/public';
+import { GetUserProfileResponse, UserProfileData } from '@kbn/security-plugin/common';
import { SecurityPluginStart } from '@kbn/security-plugin/public';
import { SharePluginStart } from '@kbn/share-plugin/public';
@@ -53,6 +54,7 @@ interface KibanaLogicProps {
setDocTitle(title: string): void;
share: SharePluginStart;
uiSettings: IUiSettingsClient;
+ userProfile: GetUserProfileResponse;
}
export interface KibanaValues extends Omit {
@@ -93,6 +95,7 @@ export const KibanaLogic = kea>({
setDocTitle: [props.setDocTitle, {}],
share: [props.share, {}],
uiSettings: [props.uiSettings, {}],
+ userProfile: [props.userProfile, {}],
}),
selectors: ({ selectors }) => ({
isCloud: [() => [selectors.cloud], (cloud?: Partial) => !!cloud?.isCloudEnabled],
diff --git a/x-pack/plugins/enterprise_search/public/assets/client_libraries/curl.svg b/x-pack/plugins/enterprise_search/public/assets/client_libraries/curl.svg
new file mode 100644
index 0000000000000..e922b12283f7d
--- /dev/null
+++ b/x-pack/plugins/enterprise_search/public/assets/client_libraries/curl.svg
@@ -0,0 +1,6 @@
+
+
+
+
+
+
diff --git a/x-pack/plugins/enterprise_search/public/assets/client_libraries/github.svg b/x-pack/plugins/enterprise_search/public/assets/client_libraries/github.svg
new file mode 100644
index 0000000000000..94fb8d1ae09a9
--- /dev/null
+++ b/x-pack/plugins/enterprise_search/public/assets/client_libraries/github.svg
@@ -0,0 +1,3 @@
+
+
+
diff --git a/x-pack/plugins/enterprise_search/public/assets/client_libraries/index.ts b/x-pack/plugins/enterprise_search/public/assets/client_libraries/index.ts
index 0e0e774aa5bba..87cde9fe97244 100644
--- a/x-pack/plugins/enterprise_search/public/assets/client_libraries/index.ts
+++ b/x-pack/plugins/enterprise_search/public/assets/client_libraries/index.ts
@@ -5,6 +5,7 @@
* 2.0.
*/
+import curl from './curl.svg';
import dotnet from './dotnet.svg';
import go from './go.svg';
import java from './java.svg';
@@ -16,6 +17,7 @@ import ruby from './ruby.svg';
import rust from './rust.svg';
export const icons = {
+ curl,
dotnet,
go,
java,
diff --git a/x-pack/plugins/enterprise_search/public/assets/images/api-cloud.svg b/x-pack/plugins/enterprise_search/public/assets/images/api-cloud.svg
new file mode 100644
index 0000000000000..96ec0e633d734
--- /dev/null
+++ b/x-pack/plugins/enterprise_search/public/assets/images/api-cloud.svg
@@ -0,0 +1,498 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/x-pack/plugins/enterprise_search/public/assets/images/search-connector.svg b/x-pack/plugins/enterprise_search/public/assets/images/search-connector.svg
new file mode 100644
index 0000000000000..ea1a85904bd72
--- /dev/null
+++ b/x-pack/plugins/enterprise_search/public/assets/images/search-connector.svg
@@ -0,0 +1,365 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/x-pack/plugins/enterprise_search/public/assets/images/search-crawler.svg b/x-pack/plugins/enterprise_search/public/assets/images/search-crawler.svg
new file mode 100644
index 0000000000000..76fc74b74ea57
--- /dev/null
+++ b/x-pack/plugins/enterprise_search/public/assets/images/search-crawler.svg
@@ -0,0 +1,415 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/x-pack/plugins/enterprise_search/public/plugin.ts b/x-pack/plugins/enterprise_search/public/plugin.ts
index 615805190a3bf..fb5e25c4f4f4f 100644
--- a/x-pack/plugins/enterprise_search/public/plugin.ts
+++ b/x-pack/plugins/enterprise_search/public/plugin.ts
@@ -22,6 +22,7 @@ import { GuidedOnboardingPluginStart } from '@kbn/guided-onboarding-plugin/publi
import type { HomePublicPluginSetup } from '@kbn/home-plugin/public';
import { LensPublicStart } from '@kbn/lens-plugin/public';
import { LicensingPluginStart } from '@kbn/licensing-plugin/public';
+import { GetUserProfileResponse, UserProfileData } from '@kbn/security-plugin/common';
import { SecurityPluginSetup, SecurityPluginStart } from '@kbn/security-plugin/public';
import { SharePluginStart } from '@kbn/share-plugin/public';
@@ -65,6 +66,7 @@ export interface PluginsStart {
licensing: LicensingPluginStart;
security: SecurityPluginStart;
share: SharePluginStart;
+ userProfile: GetUserProfileResponse;
}
export class EnterpriseSearchPlugin implements Plugin {
@@ -100,7 +102,8 @@ export class EnterpriseSearchPlugin implements Plugin {
cloudSetup && (pluginsStart as PluginsStart).cloud
? { ...cloudSetup, ...(pluginsStart as PluginsStart).cloud }
: undefined;
- const plugins = { ...pluginsStart, cloud } as PluginsStart;
+ const userProfile = await (pluginsStart as PluginsStart).security.authc.getCurrentUser();
+ const plugins = { ...pluginsStart, cloud, userProfile } as PluginsStart;
coreStart.chrome
.getChromeStyle$()
diff --git a/x-pack/plugins/serverless_search/public/application/components/overview.tsx b/x-pack/plugins/serverless_search/public/application/components/overview.tsx
index 53a0cf1ee20bc..4fdb6d620764f 100644
--- a/x-pack/plugins/serverless_search/public/application/components/overview.tsx
+++ b/x-pack/plugins/serverless_search/public/application/components/overview.tsx
@@ -44,12 +44,9 @@ export const ElasticsearchOverview = () => {
const [selectedLanguage, setSelectedLanguage] =
useState(javascriptDefinition);
const [clientApiKey, setClientApiKey] = useState(API_KEY_PLACEHOLDER);
- const {
- application: { navigateToApp },
- cloud,
- http,
- userProfile,
- } = useKibanaServices();
+ const { application, cloud, http, userProfile, share } = useKibanaServices();
+ const { navigateToApp } = application;
+
const elasticsearchURL = useMemo(() => {
return cloud?.elasticsearchUrl ?? ELASTICSEARCH_URL_PLACEHOLDER;
}, [cloud]);
@@ -87,9 +84,10 @@ export const ElasticsearchOverview = () => {
codeArguments={codeSnippetArguments}
language={selectedLanguage}
setSelectedLanguage={setSelectedLanguage}
- useKibanaServicesHook={useKibanaServices}
http={http}
pluginId={PLUGIN_ID}
+ application={application}
+ sharePlugin={share}
/>
@@ -126,7 +124,8 @@ export const ElasticsearchOverview = () => {
setSelectedLanguage={setSelectedLanguage}
http={http}
pluginId={PLUGIN_ID}
- useKibanaServicesHook={useKibanaServices}
+ application={application}
+ sharePlugin={share}
/>
}
links={[
@@ -177,7 +176,8 @@ export const ElasticsearchOverview = () => {
setSelectedLanguage={setSelectedLanguage}
http={http}
pluginId={PLUGIN_ID}
- useKibanaServicesHook={useKibanaServices}
+ application={application}
+ sharePlugin={share}
/>
}
links={[]}
@@ -194,7 +194,8 @@ export const ElasticsearchOverview = () => {
http={http}
docLinks={docLinks}
pluginId={PLUGIN_ID}
- useKibanaServicesHook={useKibanaServices}
+ application={application}
+ sharePlugin={share}
/>
@@ -212,7 +213,8 @@ export const ElasticsearchOverview = () => {
setSelectedLanguage={setSelectedLanguage}
http={http}
pluginId={PLUGIN_ID}
- useKibanaServicesHook={useKibanaServices}
+ application={application}
+ sharePlugin={share}
/>
}
links={[]}
diff --git a/x-pack/plugins/serverless_search/public/application/components/search-connector.svg b/x-pack/plugins/serverless_search/public/application/components/search-connector.svg
new file mode 100644
index 0000000000000..ea1a85904bd72
--- /dev/null
+++ b/x-pack/plugins/serverless_search/public/application/components/search-connector.svg
@@ -0,0 +1,365 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
From 67361c3da3972b83a74323e58b8d0143b3b50567 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Efe=20G=C3=BCrkan=20YALAMAN?=
Date: Mon, 7 Aug 2023 18:48:48 +0200
Subject: [PATCH 03/17] review changes part
---
package.json | 2 +-
packages/kbn-search-api-panels/README.md | 3 +
.../components/code_box.scss | 0
.../components/code_box.tsx | 34 ++---
.../components/github_link.tsx | 0
.../components/ingest_data.tsx | 17 ++-
.../components/install_client.tsx | 21 ++-
.../components/integrations_panel.tsx | 0
.../components/language_client_panel.tsx | 2 +-
.../components/overview_panel.tsx | 0
.../components/select_client.scss | 0
.../components/select_client.tsx | 0
.../components/try_in_console_button.tsx | 0
.../constants.ts | 0
.../index.tsx | 2 +
.../jest.config.js | 2 +-
.../kibana.jsonc | 2 +-
.../package.json | 2 +-
.../tsconfig.json | 0
.../types.ts | 0
packages/kbn-serverless-api-panels/README.md | 3 -
tsconfig.base.json | 4 +-
.../getting_started/getting_started.tsx | 69 +++++----
.../getting_started}/languages/console.ts | 11 +-
.../getting_started/languages/constants.ts | 10 ++
.../getting_started}/languages/curl.ts | 12 +-
.../getting_started}/languages/go.ts | 14 +-
.../getting_started}/languages/javascript.ts | 14 +-
.../getting_started}/languages/languages.ts | 8 +-
.../getting_started}/languages/php.ts | 17 +--
.../getting_started}/languages/python.ts | 16 +-
.../getting_started}/languages/ruby.ts | 17 +--
.../getting_started/languages/utils.ts | 23 +++
.../search_index/generate_api_key_panel.tsx | 2 +-
.../product_selector/product_selector.tsx | 2 +-
.../application/components/code_box.scss | 3 -
.../application/components/code_box.tsx | 137 ------------------
.../application/components/indexing_api.tsx | 22 ++-
.../components/languages/console.ts | 2 +-
.../application/components/languages/curl.ts | 2 +-
.../application/components/languages/go.ts | 2 +-
.../components/languages/javascript.ts | 2 +-
.../components/languages/languages.ts | 3 +-
.../application/components/languages/php.ts | 2 +-
.../components/languages/python.ts | 2 +-
.../application/components/languages/ruby.ts | 2 +-
.../application/components/languages/types.ts | 43 ------
.../application/components/languages/utils.ts | 22 +++
.../application/components/overview.tsx | 36 +++--
.../components/shared/github_link.tsx | 29 ----
.../components/try_in_console_button.tsx | 45 ------
yarn.lock | 8 +-
52 files changed, 234 insertions(+), 437 deletions(-)
create mode 100644 packages/kbn-search-api-panels/README.md
rename packages/{kbn-serverless-api-panels => kbn-search-api-panels}/components/code_box.scss (100%)
rename packages/{kbn-serverless-api-panels => kbn-search-api-panels}/components/code_box.tsx (83%)
rename packages/{kbn-serverless-api-panels => kbn-search-api-panels}/components/github_link.tsx (100%)
rename packages/{kbn-serverless-api-panels => kbn-search-api-panels}/components/ingest_data.tsx (93%)
rename packages/{kbn-serverless-api-panels => kbn-search-api-panels}/components/install_client.tsx (92%)
rename packages/{kbn-serverless-api-panels => kbn-search-api-panels}/components/integrations_panel.tsx (100%)
rename packages/{kbn-serverless-api-panels => kbn-search-api-panels}/components/language_client_panel.tsx (97%)
rename packages/{kbn-serverless-api-panels => kbn-search-api-panels}/components/overview_panel.tsx (100%)
rename packages/{kbn-serverless-api-panels => kbn-search-api-panels}/components/select_client.scss (100%)
rename packages/{kbn-serverless-api-panels => kbn-search-api-panels}/components/select_client.tsx (100%)
rename packages/{kbn-serverless-api-panels => kbn-search-api-panels}/components/try_in_console_button.tsx (100%)
rename packages/{kbn-serverless-api-panels => kbn-search-api-panels}/constants.ts (100%)
rename packages/{kbn-serverless-api-panels => kbn-search-api-panels}/index.tsx (99%)
rename packages/{kbn-serverless-api-panels => kbn-search-api-panels}/jest.config.js (87%)
rename packages/{kbn-serverless-api-panels => kbn-search-api-panels}/kibana.jsonc (67%)
rename packages/{kbn-serverless-api-panels => kbn-search-api-panels}/package.json (69%)
rename packages/{kbn-serverless-api-panels => kbn-search-api-panels}/tsconfig.json (100%)
rename packages/{kbn-serverless-api-panels/languages => kbn-search-api-panels}/types.ts (100%)
delete mode 100644 packages/kbn-serverless-api-panels/README.md
rename {packages/kbn-serverless-api-panels => x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/components/getting_started}/languages/console.ts (82%)
create mode 100644 x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/components/getting_started/languages/constants.ts
rename {packages/kbn-serverless-api-panels => x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/components/getting_started}/languages/curl.ts (88%)
rename {packages/kbn-serverless-api-panels => x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/components/getting_started}/languages/go.ts (88%)
rename {packages/kbn-serverless-api-panels => x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/components/getting_started}/languages/javascript.ts (88%)
rename {packages/kbn-serverless-api-panels => x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/components/getting_started}/languages/languages.ts (77%)
rename {packages/kbn-serverless-api-panels => x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/components/getting_started}/languages/php.ts (87%)
rename {packages/kbn-serverless-api-panels => x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/components/getting_started}/languages/python.ts (85%)
rename {packages/kbn-serverless-api-panels => x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/components/getting_started}/languages/ruby.ts (84%)
create mode 100644 x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/components/getting_started/languages/utils.ts
delete mode 100644 x-pack/plugins/serverless_search/public/application/components/code_box.scss
delete mode 100644 x-pack/plugins/serverless_search/public/application/components/code_box.tsx
delete mode 100644 x-pack/plugins/serverless_search/public/application/components/languages/types.ts
create mode 100644 x-pack/plugins/serverless_search/public/application/components/languages/utils.ts
delete mode 100644 x-pack/plugins/serverless_search/public/application/components/shared/github_link.tsx
delete mode 100644 x-pack/plugins/serverless_search/public/application/components/try_in_console_button.tsx
diff --git a/package.json b/package.json
index d09c630512c95..40b73d83efe19 100644
--- a/package.json
+++ b/package.json
@@ -591,6 +591,7 @@
"@kbn/screenshot-mode-plugin": "link:src/plugins/screenshot_mode",
"@kbn/screenshotting-example-plugin": "link:x-pack/examples/screenshotting_example",
"@kbn/screenshotting-plugin": "link:x-pack/plugins/screenshotting",
+ "@kbn/search-api-panels": "link:packages/kbn-search-api-panels",
"@kbn/search-examples-plugin": "link:examples/search_examples",
"@kbn/searchprofiler-plugin": "link:x-pack/plugins/searchprofiler",
"@kbn/security-plugin": "link:x-pack/plugins/security",
@@ -623,7 +624,6 @@
"@kbn/server-http-tools": "link:packages/kbn-server-http-tools",
"@kbn/server-route-repository": "link:packages/kbn-server-route-repository",
"@kbn/serverless": "link:x-pack/plugins/serverless",
- "@kbn/serverless-api-panels": "link:packages/kbn-serverless-api-panels",
"@kbn/serverless-observability": "link:x-pack/plugins/serverless_observability",
"@kbn/serverless-project-switcher": "link:packages/serverless/project_switcher",
"@kbn/serverless-search": "link:x-pack/plugins/serverless_search",
diff --git a/packages/kbn-search-api-panels/README.md b/packages/kbn-search-api-panels/README.md
new file mode 100644
index 0000000000000..dba35349a6787
--- /dev/null
+++ b/packages/kbn-search-api-panels/README.md
@@ -0,0 +1,3 @@
+# @kbn/search-api-panels
+
+Empty package generated by @kbn/generate
\ No newline at end of file
diff --git a/packages/kbn-serverless-api-panels/components/code_box.scss b/packages/kbn-search-api-panels/components/code_box.scss
similarity index 100%
rename from packages/kbn-serverless-api-panels/components/code_box.scss
rename to packages/kbn-search-api-panels/components/code_box.scss
diff --git a/packages/kbn-serverless-api-panels/components/code_box.tsx b/packages/kbn-search-api-panels/components/code_box.tsx
similarity index 83%
rename from packages/kbn-serverless-api-panels/components/code_box.tsx
rename to packages/kbn-search-api-panels/components/code_box.tsx
index e3ae11ea14bd8..2534d893cea87 100644
--- a/packages/kbn-serverless-api-panels/components/code_box.tsx
+++ b/packages/kbn-search-api-panels/components/code_box.tsx
@@ -26,15 +26,13 @@ import type { HttpStart } from '@kbn/core-http-browser';
import type { ApplicationStart } from '@kbn/core-application-browser';
import type { SharePluginStart } from '@kbn/share-plugin/public';
-import { consoleDefinition } from '../languages/console';
-import { LanguageDefinition, LanguageDefinitionSnippetArguments } from '../languages/types';
+import { LanguageDefinition } from '../types';
import { TryInConsoleButton } from './try_in_console_button';
import './code_box.scss';
interface CodeBoxProps {
languages: LanguageDefinition[];
- code: keyof LanguageDefinition;
- codeArgs: LanguageDefinitionSnippetArguments;
+ codeSnippet: string;
// overrides the language type for syntax highlighting
languageType?: string;
selectedLanguage: LanguageDefinition;
@@ -43,30 +41,20 @@ interface CodeBoxProps {
pluginId: string;
application?: ApplicationStart;
sharePlugin: SharePluginStart;
+ showTryInConsole: boolean;
}
-const getCodeSnippet = (
- language: Partial,
- key: keyof LanguageDefinition,
- args: LanguageDefinitionSnippetArguments
-): string => {
- const snippetVal = language[key];
- if (snippetVal === undefined) return '';
- if (typeof snippetVal === 'string') return snippetVal;
- return snippetVal(args);
-};
-
export const CodeBox: React.FC = ({
- code,
- codeArgs,
- languages,
+ application,
+ codeSnippet,
+ http,
languageType,
+ languages,
+ pluginId,
selectedLanguage,
setSelectedLanguage,
- http,
- pluginId,
- application,
sharePlugin,
+ showTryInConsole,
}) => {
const [isPopoverOpen, setIsPopoverOpen] = useState(false);
@@ -98,8 +86,6 @@ export const CodeBox: React.FC = ({
);
- const codeSnippet = getCodeSnippet(selectedLanguage, code, codeArgs);
- const showTryInConsole = code in consoleDefinition;
return (
@@ -132,7 +118,7 @@ export const CodeBox: React.FC = ({
{showTryInConsole && (
diff --git a/packages/kbn-serverless-api-panels/components/github_link.tsx b/packages/kbn-search-api-panels/components/github_link.tsx
similarity index 100%
rename from packages/kbn-serverless-api-panels/components/github_link.tsx
rename to packages/kbn-search-api-panels/components/github_link.tsx
diff --git a/packages/kbn-serverless-api-panels/components/ingest_data.tsx b/packages/kbn-search-api-panels/components/ingest_data.tsx
similarity index 93%
rename from packages/kbn-serverless-api-panels/components/ingest_data.tsx
rename to packages/kbn-search-api-panels/components/ingest_data.tsx
index 375e54a55881c..bbe1ca3d8c0bb 100644
--- a/packages/kbn-serverless-api-panels/components/ingest_data.tsx
+++ b/packages/kbn-search-api-panels/components/ingest_data.tsx
@@ -14,13 +14,12 @@ import type { HttpStart } from '@kbn/core-http-browser';
import type { ApplicationStart } from '@kbn/core-application-browser';
import type { SharePluginStart } from '@kbn/share-plugin/public';
import { CodeBox } from './code_box';
-import { languageDefinitions } from '../languages/languages';
-import { LanguageDefinition, LanguageDefinitionSnippetArguments } from '../languages/types';
+import { LanguageDefinition } from '../types';
import { OverviewPanel } from './overview_panel';
import { IntegrationsPanel } from './integrations_panel';
interface IngestDataProps {
- codeArguments: LanguageDefinitionSnippetArguments;
+ codeSnippet: string;
selectedLanguage: LanguageDefinition;
setSelectedLanguage: (language: LanguageDefinition) => void;
docLinks: any;
@@ -28,10 +27,12 @@ interface IngestDataProps {
pluginId: string;
application?: ApplicationStart;
sharePlugin: SharePluginStart;
+ languages: LanguageDefinition[];
+ showTryInConsole: boolean;
}
export const IngestData: React.FC = ({
- codeArguments,
+ codeSnippet,
selectedLanguage,
setSelectedLanguage,
docLinks,
@@ -39,6 +40,8 @@ export const IngestData: React.FC = ({
pluginId,
application,
sharePlugin,
+ languages,
+ showTryInConsole,
}) => {
const [selectedIngestMethod, setSelectedIngestMethod] = useState<
'ingestViaApi' | 'ingestViaIntegration'
@@ -52,9 +55,9 @@ export const IngestData: React.FC = ({
leftPanelContent={
selectedIngestMethod === 'ingestViaApi' ? (
void;
http: HttpStart;
@@ -32,6 +28,7 @@ interface InstallClientProps {
application?: ApplicationStart;
sharePlugin: SharePluginStart;
isPanelLeft?: boolean;
+ languages: LanguageDefinition[];
}
const Link: React.FC<{ language: Languages; http: HttpStart; pluginId: string }> = ({
@@ -78,8 +75,10 @@ const Link: React.FC<{ language: Languages; http: HttpStart; pluginId: string }>
};
export const InstallClientPanel: React.FC = ({
- codeArguments,
+ codeSnippet,
+ showTryInConsole,
language,
+ languages,
setSelectedLanguage,
http,
pluginId,
@@ -90,10 +89,10 @@ export const InstallClientPanel: React.FC = ({
const panelContent = (
<>
/packages/kbn-serverless-api-panels'],
+ roots: ['/packages/kbn-search-api-panels'],
};
diff --git a/packages/kbn-serverless-api-panels/kibana.jsonc b/packages/kbn-search-api-panels/kibana.jsonc
similarity index 67%
rename from packages/kbn-serverless-api-panels/kibana.jsonc
rename to packages/kbn-search-api-panels/kibana.jsonc
index c0d0e0b44ec12..96c4e5beacf23 100644
--- a/packages/kbn-serverless-api-panels/kibana.jsonc
+++ b/packages/kbn-search-api-panels/kibana.jsonc
@@ -1,5 +1,5 @@
{
"type": "shared-common",
- "id": "@kbn/serverless-api-panels",
+ "id": "@kbn/search-api-panels",
"owner": "@elastic/enterprise-search-frontend"
}
diff --git a/packages/kbn-serverless-api-panels/package.json b/packages/kbn-search-api-panels/package.json
similarity index 69%
rename from packages/kbn-serverless-api-panels/package.json
rename to packages/kbn-search-api-panels/package.json
index 18a036162a011..8bc3c22474800 100644
--- a/packages/kbn-serverless-api-panels/package.json
+++ b/packages/kbn-search-api-panels/package.json
@@ -1,5 +1,5 @@
{
- "name": "@kbn/serverless-api-panels",
+ "name": "@kbn/search-api-panels",
"private": true,
"version": "1.0.0",
"license": "SSPL-1.0 OR Elastic License 2.0"
diff --git a/packages/kbn-serverless-api-panels/tsconfig.json b/packages/kbn-search-api-panels/tsconfig.json
similarity index 100%
rename from packages/kbn-serverless-api-panels/tsconfig.json
rename to packages/kbn-search-api-panels/tsconfig.json
diff --git a/packages/kbn-serverless-api-panels/languages/types.ts b/packages/kbn-search-api-panels/types.ts
similarity index 100%
rename from packages/kbn-serverless-api-panels/languages/types.ts
rename to packages/kbn-search-api-panels/types.ts
diff --git a/packages/kbn-serverless-api-panels/README.md b/packages/kbn-serverless-api-panels/README.md
deleted file mode 100644
index 0d1518711c9f2..0000000000000
--- a/packages/kbn-serverless-api-panels/README.md
+++ /dev/null
@@ -1,3 +0,0 @@
-# @kbn/serverless-api-panels
-
-Empty package generated by @kbn/generate
diff --git a/tsconfig.base.json b/tsconfig.base.json
index 64ac1083dc8c7..444d638401e80 100644
--- a/tsconfig.base.json
+++ b/tsconfig.base.json
@@ -1170,6 +1170,8 @@
"@kbn/screenshotting-example-plugin/*": ["x-pack/examples/screenshotting_example/*"],
"@kbn/screenshotting-plugin": ["x-pack/plugins/screenshotting"],
"@kbn/screenshotting-plugin/*": ["x-pack/plugins/screenshotting/*"],
+ "@kbn/search-api-panels": ["packages/kbn-search-api-panels"],
+ "@kbn/search-api-panels/*": ["packages/kbn-search-api-panels/*"],
"@kbn/search-examples-plugin": ["examples/search_examples"],
"@kbn/search-examples-plugin/*": ["examples/search_examples/*"],
"@kbn/searchprofiler-plugin": ["x-pack/plugins/searchprofiler"],
@@ -1236,8 +1238,6 @@
"@kbn/server-route-repository/*": ["packages/kbn-server-route-repository/*"],
"@kbn/serverless": ["x-pack/plugins/serverless"],
"@kbn/serverless/*": ["x-pack/plugins/serverless/*"],
- "@kbn/serverless-api-panels": ["packages/kbn-serverless-api-panels"],
- "@kbn/serverless-api-panels/*": ["packages/kbn-serverless-api-panels/*"],
"@kbn/serverless-observability": ["x-pack/plugins/serverless_observability"],
"@kbn/serverless-observability/*": ["x-pack/plugins/serverless_observability/*"],
"@kbn/serverless-project-switcher": ["packages/serverless/project_switcher"],
diff --git a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/components/getting_started/getting_started.tsx b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/components/getting_started/getting_started.tsx
index 6661d6c877824..babe9f990a99f 100644
--- a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/components/getting_started/getting_started.tsx
+++ b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/components/getting_started/getting_started.tsx
@@ -30,11 +30,9 @@ import {
InstallClientPanel,
OverviewPanel,
CodeBox,
-} from '@kbn/serverless-api-panels';
+} from '@kbn/search-api-panels';
-import { javascriptDefinition } from '@kbn/serverless-api-panels/languages/javascript';
-import { languageDefinitions } from '@kbn/serverless-api-panels/languages/languages';
-import { LanguageDefinition } from '@kbn/serverless-api-panels/languages/types';
+import { LanguageDefinition } from '@kbn/search-api-panels';
import { KibanaDeps } from '../../../../../../../common/types';
@@ -48,6 +46,10 @@ import { IndexViewLogic } from '../../index_view_logic';
import { OverviewLogic } from '../../overview.logic';
import { GenerateApiKeyModal } from '../generate_api_key_modal/modal';
+import { javascriptDefinition } from './languages/javascript';
+import { languageDefinitions } from './languages/languages';
+import { getCodeSnippet, showTryInConsole } from './languages/utils';
+
export const APIGettingStarted = () => {
const { http } = useValues(HttpLogic);
const { apiKey, isGenerateModalOpen } = useValues(OverviewLogic);
@@ -70,6 +72,9 @@ export const APIGettingStarted = () => {
{isGenerateModalOpen && (
)}
+
+ Getting Started with Elastic API
+
{languageDefinitions.map((language, index) => (
@@ -84,14 +89,16 @@ export const APIGettingStarted = () => {
))}
{
})}
rightPanelContent={
{
links={[
...(selectedLanguage.basicConfig
? [
- {
- href: selectedLanguage.basicConfig,
- label: i18n.translate('xpack.serverlessSearch.configureClient.basicConfigLabel', {
- defaultMessage: 'Basic configuration',
- }),
- },
- ]
+ {
+ href: selectedLanguage.basicConfig,
+ label: i18n.translate('xpack.serverlessSearch.configureClient.basicConfigLabel', {
+ defaultMessage: 'Basic configuration',
+ }),
+ },
+ ]
: []),
...(selectedLanguage.advancedConfig
? [
- {
- href: selectedLanguage.advancedConfig,
- label: i18n.translate(
- 'xpack.serverlessSearch.configureClient.advancedConfigLabel',
- {
- defaultMessage: 'Advanced configuration',
- }
- ),
- },
- ]
+ {
+ href: selectedLanguage.advancedConfig,
+ label: i18n.translate(
+ 'xpack.serverlessSearch.configureClient.advancedConfigLabel',
+ {
+ defaultMessage: 'Advanced configuration',
+ }
+ ),
+ },
+ ]
: []),
]}
title={i18n.translate('xpack.serverlessSearch.configureClient.title', {
@@ -243,9 +250,9 @@ export const APIGettingStarted = () => {
})}
rightPanelContent={
{
description={'Add data to your data stream or index to make it searchable'}
rightPanelContent={
{
})}
rightPanelContent={
= {
buildSearchQuery: `POST /books/_search?pretty
diff --git a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/components/getting_started/languages/constants.ts b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/components/getting_started/languages/constants.ts
new file mode 100644
index 0000000000000..b0b122fa01b5c
--- /dev/null
+++ b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/components/getting_started/languages/constants.ts
@@ -0,0 +1,10 @@
+/*
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
+ * or more contributor license agreements. Licensed under the Elastic License
+ * 2.0; you may not use this file except in compliance with the Elastic License
+ * 2.0.
+ */
+
+export const API_KEY_PLACEHOLDER = 'your_api_key';
+export const ELASTICSEARCH_URL_PLACEHOLDER = 'https://your_deployment_url';
+export const INDEX_NAME_PLACEHOLDER = 'index_name';
diff --git a/packages/kbn-serverless-api-panels/languages/curl.ts b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/components/getting_started/languages/curl.ts
similarity index 88%
rename from packages/kbn-serverless-api-panels/languages/curl.ts
rename to x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/components/getting_started/languages/curl.ts
index a49c8c0d2bda1..8d856ec1893da 100644
--- a/packages/kbn-serverless-api-panels/languages/curl.ts
+++ b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/components/getting_started/languages/curl.ts
@@ -1,16 +1,14 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
- * 2.0 and the Server Side Public License, v 1; you may not use this file except
- * in compliance with, at your election, the Elastic License 2.0 or the Server
- * Side Public License, v 1.
+ * 2.0; you may not use this file except in compliance with the Elastic License
+ * 2.0.
*/
import { i18n } from '@kbn/i18n';
-import { LanguageDefinition, Languages } from './types';
+import { Languages, LanguageDefinition } from '@kbn/search-api-panels';
-// TODO replace
-const apiIntro = 'REPLACE ME';
+import { docLinks } from '../../../../../../shared/doc_links';
export const curlDefinition: LanguageDefinition = {
buildSearchQuery: `curl -X POST "\$\{ES_URL\}/books/_search?pretty" \\
@@ -26,7 +24,7 @@ export const curlDefinition: LanguageDefinition = {
}'`,
configureClient: ({ apiKey, url }) => `export ES_URL="${url}"
export API_KEY="${apiKey}"`,
- docLink: apiIntro,
+ docLink: docLinks.apiIntro,
iconType: 'curl.svg',
id: Languages.CURL,
ingestData: `curl -X POST "\$\{ES_URL\}/_bulk?pretty" \\
diff --git a/packages/kbn-serverless-api-panels/languages/go.ts b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/components/getting_started/languages/go.ts
similarity index 88%
rename from packages/kbn-serverless-api-panels/languages/go.ts
rename to x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/components/getting_started/languages/go.ts
index 8551137df87b3..e00a142ac256b 100644
--- a/packages/kbn-serverless-api-panels/languages/go.ts
+++ b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/components/getting_started/languages/go.ts
@@ -1,20 +1,14 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
- * 2.0 and the Server Side Public License, v 1; you may not use this file except
- * in compliance with, at your election, the Elastic License 2.0 or the Server
- * Side Public License, v 1.
+ * 2.0; you may not use this file except in compliance with the Elastic License
+ * 2.0.
*/
import { i18n } from '@kbn/i18n';
-import { LanguageDefinition, Languages } from './types';
+import { Languages, LanguageDefinition } from '@kbn/search-api-panels';
-// TODO replace me
-const docLinks = {
- goAdvancedConfig: '123123',
- goBasicConfig: 'a123123',
- goClient: '1123123',
-};
+import { docLinks } from '../../../../../../shared/doc_links';
export const goDefinition: LanguageDefinition = {
advancedConfig: docLinks.goAdvancedConfig,
diff --git a/packages/kbn-serverless-api-panels/languages/javascript.ts b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/components/getting_started/languages/javascript.ts
similarity index 88%
rename from packages/kbn-serverless-api-panels/languages/javascript.ts
rename to x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/components/getting_started/languages/javascript.ts
index 3297222c5c49a..16f94e7939b29 100644
--- a/packages/kbn-serverless-api-panels/languages/javascript.ts
+++ b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/components/getting_started/languages/javascript.ts
@@ -1,20 +1,14 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
- * 2.0 and the Server Side Public License, v 1; you may not use this file except
- * in compliance with, at your election, the Elastic License 2.0 or the Server
- * Side Public License, v 1.
+ * 2.0; you may not use this file except in compliance with the Elastic License
+ * 2.0.
*/
import { i18n } from '@kbn/i18n';
-import { LanguageDefinition, Languages } from './types';
+import { Languages, LanguageDefinition } from '@kbn/search-api-panels';
-const docLinks = {
- jsAdvancedConfig: '',
- jsApiReference: '',
- jsBasicConfig: '',
- jsClient: '',
-};
+import { docLinks } from '../../../../../../shared/doc_links';
export const javascriptDefinition: LanguageDefinition = {
advancedConfig: docLinks.jsAdvancedConfig,
diff --git a/packages/kbn-serverless-api-panels/languages/languages.ts b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/components/getting_started/languages/languages.ts
similarity index 77%
rename from packages/kbn-serverless-api-panels/languages/languages.ts
rename to x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/components/getting_started/languages/languages.ts
index 2a73149397152..754b1c3386f8f 100644
--- a/packages/kbn-serverless-api-panels/languages/languages.ts
+++ b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/components/getting_started/languages/languages.ts
@@ -1,18 +1,18 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
- * 2.0 and the Server Side Public License, v 1; you may not use this file except
- * in compliance with, at your election, the Elastic License 2.0 or the Server
- * Side Public License, v 1.
+ * 2.0; you may not use this file except in compliance with the Elastic License
+ * 2.0.
*/
+import { Languages, LanguageDefinition } from '@kbn/search-api-panels';
+
import { curlDefinition } from './curl';
import { goDefinition } from './go';
import { javascriptDefinition } from './javascript';
import { phpDefinition } from './php';
import { pythonDefinition } from './python';
import { rubyDefinition } from './ruby';
-import { Languages, LanguageDefinition } from './types';
const languageDefinitionRecords: Partial> = {
[Languages.CURL]: curlDefinition,
diff --git a/packages/kbn-serverless-api-panels/languages/php.ts b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/components/getting_started/languages/php.ts
similarity index 87%
rename from packages/kbn-serverless-api-panels/languages/php.ts
rename to x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/components/getting_started/languages/php.ts
index d15c816db7eba..84bfd4ae0fa64 100644
--- a/packages/kbn-serverless-api-panels/languages/php.ts
+++ b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/components/getting_started/languages/php.ts
@@ -1,20 +1,17 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
- * 2.0 and the Server Side Public License, v 1; you may not use this file except
- * in compliance with, at your election, the Elastic License 2.0 or the Server
- * Side Public License, v 1.
+ * 2.0; you may not use this file except in compliance with the Elastic License
+ * 2.0.
*/
import { i18n } from '@kbn/i18n';
-import { INDEX_NAME_PLACEHOLDER } from '../constants';
-import { LanguageDefinition, Languages } from './types';
+import { Languages, LanguageDefinition } from '@kbn/search-api-panels';
+
+import { docLinks } from '../../../../../../shared/doc_links';
+
+import { INDEX_NAME_PLACEHOLDER } from './constants';
-const docLinks = {
- phpAdvancedConfig: '',
- phpBasicConfig: '',
- phpClient: '',
-};
export const phpDefinition: LanguageDefinition = {
advancedConfig: docLinks.phpAdvancedConfig,
diff --git a/packages/kbn-serverless-api-panels/languages/python.ts b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/components/getting_started/languages/python.ts
similarity index 85%
rename from packages/kbn-serverless-api-panels/languages/python.ts
rename to x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/components/getting_started/languages/python.ts
index 8ea7b805e2d8d..b64165c0cce75 100644
--- a/packages/kbn-serverless-api-panels/languages/python.ts
+++ b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/components/getting_started/languages/python.ts
@@ -1,20 +1,16 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
- * 2.0 and the Server Side Public License, v 1; you may not use this file except
- * in compliance with, at your election, the Elastic License 2.0 or the Server
- * Side Public License, v 1.
+ * 2.0; you may not use this file except in compliance with the Elastic License
+ * 2.0.
*/
import { i18n } from '@kbn/i18n';
-import { LanguageDefinition, Languages } from './types';
-import { INDEX_NAME_PLACEHOLDER } from '../constants';
+import { Languages, LanguageDefinition } from '@kbn/search-api-panels';
-const docLinks = {
- pythonAdvancedConfig: '',
- pythonBasicConfig: '',
- pythonClient: '',
-};
+import { docLinks } from '../../../../../../shared/doc_links';
+
+import { INDEX_NAME_PLACEHOLDER } from './constants';
export const pythonDefinition: LanguageDefinition = {
advancedConfig: docLinks.pythonAdvancedConfig,
diff --git a/packages/kbn-serverless-api-panels/languages/ruby.ts b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/components/getting_started/languages/ruby.ts
similarity index 84%
rename from packages/kbn-serverless-api-panels/languages/ruby.ts
rename to x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/components/getting_started/languages/ruby.ts
index 7da4ef475a451..61b3d6bb30871 100644
--- a/packages/kbn-serverless-api-panels/languages/ruby.ts
+++ b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/components/getting_started/languages/ruby.ts
@@ -1,21 +1,16 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
- * 2.0 and the Server Side Public License, v 1; you may not use this file except
- * in compliance with, at your election, the Elastic License 2.0 or the Server
- * Side Public License, v 1.
+ * 2.0; you may not use this file except in compliance with the Elastic License
+ * 2.0.
*/
import { i18n } from '@kbn/i18n';
-import { INDEX_NAME_PLACEHOLDER } from '../constants';
-import { LanguageDefinition, Languages } from './types';
+import { Languages, LanguageDefinition } from '@kbn/search-api-panels';
-const docLinks = {
- rubyAdvancedConfig: '',
- rubyExamples: '',
- rubyBasicConfig: '',
- rubyClient: '',
-};
+import { docLinks } from '../../../../../../shared/doc_links';
+
+import { INDEX_NAME_PLACEHOLDER } from './constants';
export const rubyDefinition: LanguageDefinition = {
advancedConfig: docLinks.rubyAdvancedConfig,
diff --git a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/components/getting_started/languages/utils.ts b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/components/getting_started/languages/utils.ts
new file mode 100644
index 0000000000000..f973099a0947e
--- /dev/null
+++ b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/components/getting_started/languages/utils.ts
@@ -0,0 +1,23 @@
+/*
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
+ * or more contributor license agreements. Licensed under the Elastic License
+ * 2.0; you may not use this file except in compliance with the Elastic License
+ * 2.0.
+ */
+
+import { LanguageDefinition, LanguageDefinitionSnippetArguments } from '@kbn/search-api-panels';
+
+import { consoleDefinition } from './console';
+
+export const showTryInConsole = (code: keyof LanguageDefinition) => code in consoleDefinition;
+
+export const getCodeSnippet = (
+ language: Partial,
+ key: keyof LanguageDefinition,
+ args: LanguageDefinitionSnippetArguments
+): string => {
+ const snippetVal = language[key];
+ if (snippetVal === undefined) return '';
+ if (typeof snippetVal === 'string') return snippetVal;
+ return snippetVal(args);
+};
diff --git a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/generate_api_key_panel.tsx b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/generate_api_key_panel.tsx
index 806dbacec6350..c22d305f1e93a 100644
--- a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/generate_api_key_panel.tsx
+++ b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/generate_api_key_panel.tsx
@@ -30,7 +30,7 @@ export const GenerateApiKeyPanel: React.FC = () => {
)}
-
+
{isHiddenIndex ? (
void;
-}
-
-const getCodeSnippet = (
- language: Partial,
- key: keyof LanguageDefinition,
- args: LanguageDefinitionSnippetArguments
-): string => {
- const snippetVal = language[key];
- if (snippetVal === undefined) return '';
- if (typeof snippetVal === 'string') return snippetVal;
- return snippetVal(args);
-};
-
-export const CodeBox: React.FC = ({
- code,
- codeArgs,
- languages,
- languageType,
- selectedLanguage,
- setSelectedLanguage,
-}) => {
- const [isPopoverOpen, setIsPopoverOpen] = useState(false);
- const { http } = useKibanaServices();
- const items = languages.map((language) => (
- {
- setSelectedLanguage(language);
- setIsPopoverOpen(false);
- }}
- >
- {language.name}
-
- ));
-
- const button = (
-
- setIsPopoverOpen(!isPopoverOpen)}
- >
- {selectedLanguage.name}
-
-
- );
- const codeSnippet = getCodeSnippet(selectedLanguage, code, codeArgs);
- const showTryInConsole = code in consoleDefinition;
-
- return (
-
-
-
-
-
- setIsPopoverOpen(false)}
- panelPaddingSize="none"
- anchorPosition="downLeft"
- >
-
-
-
-
-
-
- {(copy) => (
-
- {i18n.translate('xpack.serverlessSearch.codeBox.copyButtonLabel', {
- defaultMessage: 'Copy',
- })}
-
- )}
-
-
- {showTryInConsole && (
-
-
-
- )}
-
-
-
- {codeSnippet}
-
-
-
- );
-};
diff --git a/x-pack/plugins/serverless_search/public/application/components/indexing_api.tsx b/x-pack/plugins/serverless_search/public/application/components/indexing_api.tsx
index 939b28d8c5073..35674a82695b2 100644
--- a/x-pack/plugins/serverless_search/public/application/components/indexing_api.tsx
+++ b/x-pack/plugins/serverless_search/public/application/components/indexing_api.tsx
@@ -23,17 +23,20 @@ import {
import { i18n } from '@kbn/i18n';
import { FormattedMessage } from '@kbn/i18n-react';
import { useQuery } from '@tanstack/react-query';
-import { OverviewPanel, LanguageClientPanel } from '@kbn/serverless-api-panels';
+import { OverviewPanel, LanguageClientPanel, CodeBox } from '@kbn/search-api-panels';
+import type {
+ LanguageDefinition,
+ LanguageDefinitionSnippetArguments,
+} from '@kbn/search-api-panels';
import { PLUGIN_ID } from '../../../common';
import { IndexData, FetchIndicesResult } from '../../../common/types';
import { FETCH_INDICES_PATH } from '../routes';
import { API_KEY_PLACEHOLDER, ELASTICSEARCH_URL_PLACEHOLDER } from '../constants';
import { useKibanaServices } from '../hooks/use_kibana';
-import { CodeBox } from './code_box';
import { javascriptDefinition } from './languages/javascript';
import { languageDefinitions } from './languages/languages';
-import { LanguageDefinition, LanguageDefinitionSnippetArguments } from './languages/types';
+import { getCodeSnippet, showTryInConsole } from './languages/utils';
const NoIndicesContent = () => (
<>
@@ -114,7 +117,7 @@ const IndicesContent = ({
};
export const ElasticsearchIndexingApi = () => {
- const { cloud, http } = useKibanaServices();
+ const { cloud, http, share } = useKibanaServices();
const [selectedLanguage, setSelectedLanguage] =
useState(javascriptDefinition);
const [indexSearchQuery, setIndexSearchQuery] = useState(undefined);
@@ -207,11 +210,18 @@ export const ElasticsearchIndexingApi = () => {
>
}
diff --git a/x-pack/plugins/serverless_search/public/application/components/languages/console.ts b/x-pack/plugins/serverless_search/public/application/components/languages/console.ts
index c2fceaae4f85b..d234262d93f13 100644
--- a/x-pack/plugins/serverless_search/public/application/components/languages/console.ts
+++ b/x-pack/plugins/serverless_search/public/application/components/languages/console.ts
@@ -5,8 +5,8 @@
* 2.0.
*/
+import { LanguageDefinition } from '@kbn/search-api-panels';
import { INDEX_NAME_PLACEHOLDER } from '../../constants';
-import { LanguageDefinition } from './types';
export const consoleDefinition: Partial = {
buildSearchQuery: `POST /books/_search?pretty
diff --git a/x-pack/plugins/serverless_search/public/application/components/languages/curl.ts b/x-pack/plugins/serverless_search/public/application/components/languages/curl.ts
index cc98b35c87696..a0ed0f89723c9 100644
--- a/x-pack/plugins/serverless_search/public/application/components/languages/curl.ts
+++ b/x-pack/plugins/serverless_search/public/application/components/languages/curl.ts
@@ -5,9 +5,9 @@
* 2.0.
*/
+import { Languages, LanguageDefinition } from '@kbn/search-api-panels';
import { i18n } from '@kbn/i18n';
import { docLinks } from '../../../../common/doc_links';
-import { LanguageDefinition, Languages } from './types';
export const curlDefinition: LanguageDefinition = {
buildSearchQuery: `curl -X POST "\$\{ES_URL\}/books/_search?pretty" \\
diff --git a/x-pack/plugins/serverless_search/public/application/components/languages/go.ts b/x-pack/plugins/serverless_search/public/application/components/languages/go.ts
index f7cd2b3ac2cdc..00e70f7ce7a99 100644
--- a/x-pack/plugins/serverless_search/public/application/components/languages/go.ts
+++ b/x-pack/plugins/serverless_search/public/application/components/languages/go.ts
@@ -6,8 +6,8 @@
*/
import { i18n } from '@kbn/i18n';
+import { Languages, LanguageDefinition } from '@kbn/search-api-panels';
import { docLinks } from '../../../../common/doc_links';
-import { LanguageDefinition, Languages } from './types';
export const goDefinition: LanguageDefinition = {
advancedConfig: docLinks.goAdvancedConfig,
diff --git a/x-pack/plugins/serverless_search/public/application/components/languages/javascript.ts b/x-pack/plugins/serverless_search/public/application/components/languages/javascript.ts
index d2ed8c016df85..bac5452ca5105 100644
--- a/x-pack/plugins/serverless_search/public/application/components/languages/javascript.ts
+++ b/x-pack/plugins/serverless_search/public/application/components/languages/javascript.ts
@@ -5,9 +5,9 @@
* 2.0.
*/
+import { Languages, LanguageDefinition } from '@kbn/search-api-panels';
import { i18n } from '@kbn/i18n';
import { docLinks } from '../../../../common/doc_links';
-import { LanguageDefinition, Languages } from './types';
export const javascriptDefinition: LanguageDefinition = {
advancedConfig: docLinks.jsAdvancedConfig,
diff --git a/x-pack/plugins/serverless_search/public/application/components/languages/languages.ts b/x-pack/plugins/serverless_search/public/application/components/languages/languages.ts
index 38b7cf2beacb0..754b1c3386f8f 100644
--- a/x-pack/plugins/serverless_search/public/application/components/languages/languages.ts
+++ b/x-pack/plugins/serverless_search/public/application/components/languages/languages.ts
@@ -5,13 +5,14 @@
* 2.0.
*/
+import { Languages, LanguageDefinition } from '@kbn/search-api-panels';
+
import { curlDefinition } from './curl';
import { goDefinition } from './go';
import { javascriptDefinition } from './javascript';
import { phpDefinition } from './php';
import { pythonDefinition } from './python';
import { rubyDefinition } from './ruby';
-import { Languages, LanguageDefinition } from './types';
const languageDefinitionRecords: Partial> = {
[Languages.CURL]: curlDefinition,
diff --git a/x-pack/plugins/serverless_search/public/application/components/languages/php.ts b/x-pack/plugins/serverless_search/public/application/components/languages/php.ts
index 5e6824dc174b2..a13a1ea9b7177 100644
--- a/x-pack/plugins/serverless_search/public/application/components/languages/php.ts
+++ b/x-pack/plugins/serverless_search/public/application/components/languages/php.ts
@@ -6,9 +6,9 @@
*/
import { i18n } from '@kbn/i18n';
+import { Languages, LanguageDefinition } from '@kbn/search-api-panels';
import { docLinks } from '../../../../common/doc_links';
import { INDEX_NAME_PLACEHOLDER } from '../../constants';
-import { LanguageDefinition, Languages } from './types';
export const phpDefinition: LanguageDefinition = {
advancedConfig: docLinks.phpAdvancedConfig,
diff --git a/x-pack/plugins/serverless_search/public/application/components/languages/python.ts b/x-pack/plugins/serverless_search/public/application/components/languages/python.ts
index 9f5031a0993ca..4fa3da0323868 100644
--- a/x-pack/plugins/serverless_search/public/application/components/languages/python.ts
+++ b/x-pack/plugins/serverless_search/public/application/components/languages/python.ts
@@ -6,8 +6,8 @@
*/
import { i18n } from '@kbn/i18n';
+import { Languages, LanguageDefinition } from '@kbn/search-api-panels';
import { docLinks } from '../../../../common/doc_links';
-import { LanguageDefinition, Languages } from './types';
import { INDEX_NAME_PLACEHOLDER } from '../../constants';
export const pythonDefinition: LanguageDefinition = {
diff --git a/x-pack/plugins/serverless_search/public/application/components/languages/ruby.ts b/x-pack/plugins/serverless_search/public/application/components/languages/ruby.ts
index b6b8ce3c24428..4339d5f8261cc 100644
--- a/x-pack/plugins/serverless_search/public/application/components/languages/ruby.ts
+++ b/x-pack/plugins/serverless_search/public/application/components/languages/ruby.ts
@@ -6,9 +6,9 @@
*/
import { i18n } from '@kbn/i18n';
+import { Languages, LanguageDefinition } from '@kbn/search-api-panels';
import { docLinks } from '../../../../common/doc_links';
import { INDEX_NAME_PLACEHOLDER } from '../../constants';
-import { LanguageDefinition, Languages } from './types';
export const rubyDefinition: LanguageDefinition = {
advancedConfig: docLinks.rubyAdvancedConfig,
diff --git a/x-pack/plugins/serverless_search/public/application/components/languages/types.ts b/x-pack/plugins/serverless_search/public/application/components/languages/types.ts
deleted file mode 100644
index 7849b800fc1a0..0000000000000
--- a/x-pack/plugins/serverless_search/public/application/components/languages/types.ts
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
- * or more contributor license agreements. Licensed under the Elastic License
- * 2.0; you may not use this file except in compliance with the Elastic License
- * 2.0.
- */
-
-export enum Languages {
- JAVA = 'java',
- JAVASCRIPT = 'javascript',
- RUBY = 'ruby',
- GO = 'go',
- DOTNET = 'dotnet',
- PHP = 'php',
- PERL = 'perl',
- PYTHON = 'python',
- RUST = 'rust',
- CURL = 'curl',
-}
-
-export interface LanguageDefinitionSnippetArguments {
- url: string;
- apiKey: string;
- indexName?: string;
-}
-
-type CodeSnippet = string | ((args: LanguageDefinitionSnippetArguments) => string);
-export interface LanguageDefinition {
- advancedConfig?: string;
- apiReference?: string;
- basicConfig?: string;
- configureClient: CodeSnippet;
- docLink: string;
- iconType: string;
- id: Languages;
- ingestData: CodeSnippet;
- ingestDataIndex: CodeSnippet;
- installClient: string;
- languageStyling?: string;
- name: string;
- buildSearchQuery: CodeSnippet;
- testConnection: CodeSnippet;
-}
diff --git a/x-pack/plugins/serverless_search/public/application/components/languages/utils.ts b/x-pack/plugins/serverless_search/public/application/components/languages/utils.ts
new file mode 100644
index 0000000000000..84f575ea0cc02
--- /dev/null
+++ b/x-pack/plugins/serverless_search/public/application/components/languages/utils.ts
@@ -0,0 +1,22 @@
+/*
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
+ * or more contributor license agreements. Licensed under the Elastic License
+ * 2.0; you may not use this file except in compliance with the Elastic License
+ * 2.0.
+ */
+
+import { LanguageDefinition, LanguageDefinitionSnippetArguments } from '@kbn/search-api-panels';
+import { consoleDefinition } from './console';
+
+export const showTryInConsole = (code: keyof LanguageDefinition) => code in consoleDefinition;
+
+export const getCodeSnippet = (
+ language: Partial,
+ key: keyof LanguageDefinition,
+ args: LanguageDefinitionSnippetArguments
+): string => {
+ const snippetVal = language[key];
+ if (snippetVal === undefined) return '';
+ if (typeof snippetVal === 'string') return snippetVal;
+ return snippetVal(args);
+};
diff --git a/x-pack/plugins/serverless_search/public/application/components/overview.tsx b/x-pack/plugins/serverless_search/public/application/components/overview.tsx
index 4fdb6d620764f..79652e78e815e 100644
--- a/x-pack/plugins/serverless_search/public/application/components/overview.tsx
+++ b/x-pack/plugins/serverless_search/public/application/components/overview.tsx
@@ -27,18 +27,22 @@ import {
CodeBox,
LanguageClientPanel,
InstallClientPanel,
-} from '@kbn/serverless-api-panels';
+} from '@kbn/search-api-panels';
import React, { useMemo, useState } from 'react';
+import type {
+ LanguageDefinition,
+ LanguageDefinitionSnippetArguments,
+} from '@kbn/search-api-panels';
import { docLinks } from '../../../common/doc_links';
import { PLUGIN_ID } from '../../../common';
import { useKibanaServices } from '../hooks/use_kibana';
import { API_KEY_PLACEHOLDER, ELASTICSEARCH_URL_PLACEHOLDER } from '../constants';
import { javascriptDefinition } from './languages/javascript';
import { languageDefinitions } from './languages/languages';
-import { LanguageDefinition, LanguageDefinitionSnippetArguments } from './languages/types';
import './overview.scss';
import { ApiKeyPanel } from './api_key/api_key';
+import { getCodeSnippet, showTryInConsole } from './languages/utils';
export const ElasticsearchOverview = () => {
const [selectedLanguage, setSelectedLanguage] =
@@ -81,7 +85,9 @@ export const ElasticsearchOverview = () => {
{
})}
leftPanelContent={
{
})}
leftPanelContent={
{
{
})}
leftPanelContent={
= ({ label, href }) => {
- const { http } = useKibanaServices();
- return (
-
-
-
-
-
-
-
- {label}
-
-
-
-
- );
-};
diff --git a/x-pack/plugins/serverless_search/public/application/components/try_in_console_button.tsx b/x-pack/plugins/serverless_search/public/application/components/try_in_console_button.tsx
deleted file mode 100644
index 9426e8f31ea78..0000000000000
--- a/x-pack/plugins/serverless_search/public/application/components/try_in_console_button.tsx
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
- * or more contributor license agreements. Licensed under the Elastic License
- * 2.0; you may not use this file except in compliance with the Elastic License
- * 2.0.
- */
-import React from 'react';
-
-import { EuiButtonEmpty } from '@elastic/eui';
-
-import { FormattedMessage } from '@kbn/i18n-react';
-import { compressToEncodedURIComponent } from 'lz-string';
-
-import { useKibanaServices } from '../hooks/use_kibana';
-
-export interface TryInConsoleButtonProps {
- request: string;
-}
-export const TryInConsoleButton = ({ request }: TryInConsoleButtonProps) => {
- const {
- application,
- share: { url },
- } = useKibanaServices();
- const canShowDevtools = !!application?.capabilities?.dev_tools?.show;
- if (!canShowDevtools || !url) return null;
-
- const devToolsDataUri = compressToEncodedURIComponent(request);
- const consolePreviewLink = url.locators.get('CONSOLE_APP_LOCATOR')?.useUrl(
- {
- loadFrom: `data:text/plain,${devToolsDataUri}`,
- },
- undefined,
- [request]
- );
- if (!consolePreviewLink) return null;
-
- return (
-
-
-
- );
-};
diff --git a/yarn.lock b/yarn.lock
index 88e8398b6c3e4..7271a49cc380a 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -5173,6 +5173,10 @@
version "0.0.0"
uid ""
+"@kbn/search-api-panels@link:packages/kbn-search-api-panels":
+ version "0.0.0"
+ uid ""
+
"@kbn/search-examples-plugin@link:examples/search_examples":
version "0.0.0"
uid ""
@@ -5301,10 +5305,6 @@
version "0.0.0"
uid ""
-"@kbn/serverless-api-panels@link:packages/kbn-serverless-api-panels":
- version "0.0.0"
- uid ""
-
"@kbn/serverless-observability@link:x-pack/plugins/serverless_observability":
version "0.0.0"
uid ""
From 2e186f3ea84c1e3573117b234bc0abfaced916d8 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Efe=20G=C3=BCrkan=20YALAMAN?=
Date: Tue, 8 Aug 2023 14:45:20 +0200
Subject: [PATCH 04/17] Overview panel visual props
---
.../components/install_client.tsx | 5 +-
.../components/overview_panel.tsx | 5 +-
.../components/select_client.tsx | 13 ++++-
.../getting_started/getting_started.tsx | 48 ++++++++++++-------
.../search_index/generate_api_key_panel.tsx | 2 +-
5 files changed, 51 insertions(+), 22 deletions(-)
diff --git a/packages/kbn-search-api-panels/components/install_client.tsx b/packages/kbn-search-api-panels/components/install_client.tsx
index 28e0a76512df0..f5c0eceb42470 100644
--- a/packages/kbn-search-api-panels/components/install_client.tsx
+++ b/packages/kbn-search-api-panels/components/install_client.tsx
@@ -8,7 +8,7 @@
import React from 'react';
-import { EuiSpacer, EuiCallOut, EuiText } from '@elastic/eui';
+import { EuiSpacer, EuiCallOut, EuiText, EuiPanelProps } from '@elastic/eui';
import { i18n } from '@kbn/i18n';
import type { HttpStart } from '@kbn/core-http-browser';
import type { ApplicationStart } from '@kbn/core-application-browser';
@@ -29,6 +29,7 @@ interface InstallClientProps {
sharePlugin: SharePluginStart;
isPanelLeft?: boolean;
languages: LanguageDefinition[];
+ overviewPanelProps?: Partial;
}
const Link: React.FC<{ language: Languages; http: HttpStart; pluginId: string }> = ({
@@ -85,6 +86,7 @@ export const InstallClientPanel: React.FC = ({
application,
sharePlugin,
isPanelLeft = true,
+ overviewPanelProps,
}) => {
const panelContent = (
<>
@@ -139,6 +141,7 @@ export const InstallClientPanel: React.FC = ({
})}
leftPanelContent={isPanelLeft ? panelContent : undefined}
rightPanelContent={!isPanelLeft ? panelContent : undefined}
+ overviewPanelProps={overviewPanelProps}
/>
);
};
diff --git a/packages/kbn-search-api-panels/components/overview_panel.tsx b/packages/kbn-search-api-panels/components/overview_panel.tsx
index 811836ad514f5..56501fab19e37 100644
--- a/packages/kbn-search-api-panels/components/overview_panel.tsx
+++ b/packages/kbn-search-api-panels/components/overview_panel.tsx
@@ -16,6 +16,7 @@ import {
EuiPanel,
EuiTitle,
EuiLink,
+ EuiPanelProps,
} from '@elastic/eui';
import { LEARN_MORE_LABEL } from '../constants';
@@ -25,6 +26,7 @@ interface OverviewPanelProps {
links?: Array<{ label: string; href: string }>;
rightPanelContent?: React.ReactNode;
title: string;
+ overviewPanelProps?: Partial;
}
export const OverviewPanel: React.FC = ({
@@ -34,6 +36,7 @@ export const OverviewPanel: React.FC = ({
links,
rightPanelContent,
title,
+ overviewPanelProps,
}) => {
return (
<>
@@ -41,7 +44,7 @@ export const OverviewPanel: React.FC = ({
{leftPanelContent && {leftPanelContent} }
-
+
{title}
diff --git a/packages/kbn-search-api-panels/components/select_client.tsx b/packages/kbn-search-api-panels/components/select_client.tsx
index 88b5b5f780543..3f7836bf90e10 100644
--- a/packages/kbn-search-api-panels/components/select_client.tsx
+++ b/packages/kbn-search-api-panels/components/select_client.tsx
@@ -8,7 +8,15 @@
import React from 'react';
-import { EuiCallOut, EuiFlexGroup, EuiFlexItem, EuiLink, EuiSpacer, EuiText } from '@elastic/eui';
+import {
+ EuiCallOut,
+ EuiFlexGroup,
+ EuiFlexItem,
+ EuiLink,
+ EuiPanelProps,
+ EuiSpacer,
+ EuiText,
+} from '@elastic/eui';
import { i18n } from '@kbn/i18n';
import { FormattedMessage } from '@kbn/i18n-react';
@@ -20,6 +28,7 @@ export interface SelectClientPanelProps {
docLinks: any;
http: HttpStart;
isPanelLeft?: boolean;
+ overviewPanelProps?: Partial;
}
export const SelectClientPanel: React.FC = ({
@@ -27,6 +36,7 @@ export const SelectClientPanel: React.FC = ({
children,
http,
isPanelLeft = true,
+ overviewPanelProps,
}) => {
const panelContent = (
<>
@@ -106,6 +116,7 @@ export const SelectClientPanel: React.FC = ({
title={i18n.translate('xpack.serverlessSearch.selectClient.title', {
defaultMessage: 'Select your client',
})}
+ overviewPanelProps={overviewPanelProps}
/>
);
};
diff --git a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/components/getting_started/getting_started.tsx b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/components/getting_started/getting_started.tsx
index babe9f990a99f..52e1d0eb32f50 100644
--- a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/components/getting_started/getting_started.tsx
+++ b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/components/getting_started/getting_started.tsx
@@ -75,7 +75,12 @@ export const APIGettingStarted = () => {
Getting Started with Elastic API
-
+
{languageDefinitions.map((language, index) => (
{
application={services.application}
sharePlugin={services.share}
isPanelLeft={false}
+ overviewPanelProps={{ color: 'plain', hasShadow: false }}
/>
{
}
links={[]}
title={'Generate an API key'}
+ overviewPanelProps={{ color: 'plain', hasShadow: false }}
/>
{
}
links={[]}
title={'Copy your Cloud ID'}
+ overviewPanelProps={{ color: 'plain', hasShadow: false }}
/>
{
links={[
...(selectedLanguage.basicConfig
? [
- {
- href: selectedLanguage.basicConfig,
- label: i18n.translate('xpack.serverlessSearch.configureClient.basicConfigLabel', {
- defaultMessage: 'Basic configuration',
- }),
- },
- ]
+ {
+ href: selectedLanguage.basicConfig,
+ label: i18n.translate('xpack.serverlessSearch.configureClient.basicConfigLabel', {
+ defaultMessage: 'Basic configuration',
+ }),
+ },
+ ]
: []),
...(selectedLanguage.advancedConfig
? [
- {
- href: selectedLanguage.advancedConfig,
- label: i18n.translate(
- 'xpack.serverlessSearch.configureClient.advancedConfigLabel',
- {
- defaultMessage: 'Advanced configuration',
- }
- ),
- },
- ]
+ {
+ href: selectedLanguage.advancedConfig,
+ label: i18n.translate(
+ 'xpack.serverlessSearch.configureClient.advancedConfigLabel',
+ {
+ defaultMessage: 'Advanced configuration',
+ }
+ ),
+ },
+ ]
: []),
]}
title={i18n.translate('xpack.serverlessSearch.configureClient.title', {
defaultMessage: 'Configure your client',
})}
+ overviewPanelProps={{ color: 'plain', hasShadow: false }}
/>
{
title={i18n.translate('xpack.serverlessSearch.testConnection.title', {
defaultMessage: 'Test your connection',
})}
+ overviewPanelProps={{ color: 'plain', hasShadow: false }}
/>
{
}
links={[]}
title={'Ingest Data'}
+ overviewPanelProps={{ color: 'plain', hasShadow: false }}
/>
{
title={i18n.translate('xpack.serverlessSearch.searchQuery.title', {
defaultMessage: 'Build your first search query',
})}
+ overviewPanelProps={{ color: 'plain', hasShadow: false }}
/>
>
);
diff --git a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/generate_api_key_panel.tsx b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/generate_api_key_panel.tsx
index c22d305f1e93a..f1470f37bc8f0 100644
--- a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/generate_api_key_panel.tsx
+++ b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/generate_api_key_panel.tsx
@@ -30,7 +30,7 @@ export const GenerateApiKeyPanel: React.FC = () => {
)}
-
+
{isHiddenIndex ? (
Date: Tue, 8 Aug 2023 16:40:49 +0200
Subject: [PATCH 05/17] fix i18n setup
---
.i18nrc.json | 1 +
.../components/code_box.tsx | 4 +-
.../components/ingest_data.tsx | 27 +++++-----
.../components/install_client.tsx | 16 +++---
.../components/integrations_panel.tsx | 25 +++++----
.../components/select_client.tsx | 39 ++++++++------
.../components/try_in_console_button.tsx | 2 +-
packages/kbn-search-api-panels/constants.ts | 9 ++--
packages/kbn-search-api-panels/index.tsx | 6 +--
.../getting_started/getting_started.tsx | 18 +++----
.../getting_started/languages/curl.ts | 2 +-
.../getting_started/languages/go.ts | 2 +-
.../getting_started/languages/javascript.ts | 2 +-
.../getting_started/languages/php.ts | 2 +-
.../getting_started/languages/python.ts | 2 +-
.../getting_started/languages/ruby.ts | 2 +-
.../product_selector/product_selector.tsx | 28 ++++++----
.../translations/translations/fr-FR.json | 52 +------------------
.../translations/translations/ja-JP.json | 52 +------------------
.../translations/translations/zh-CN.json | 52 +------------------
20 files changed, 109 insertions(+), 234 deletions(-)
diff --git a/.i18nrc.json b/.i18nrc.json
index 8ae8df0439409..81a2c823adefa 100644
--- a/.i18nrc.json
+++ b/.i18nrc.json
@@ -92,6 +92,7 @@
"server": "src/legacy/server",
"share": "src/plugins/share",
"sharedUXPackages": "packages/shared-ux",
+ "searchApiPanels": "packages/kbn-search-api-panels/",
"securitySolutionPackages": "x-pack/packages/security-solution",
"serverlessPackages": "packages/serverless",
"coloring": "packages/kbn-coloring/src",
diff --git a/packages/kbn-search-api-panels/components/code_box.tsx b/packages/kbn-search-api-panels/components/code_box.tsx
index 2534d893cea87..55b8915328285 100644
--- a/packages/kbn-search-api-panels/components/code_box.tsx
+++ b/packages/kbn-search-api-panels/components/code_box.tsx
@@ -74,7 +74,7 @@ export const CodeBox: React.FC = ({
const button = (
= ({
{(copy) => (
- {i18n.translate('xpack.serverlessSearch.codeBox.copyButtonLabel', {
+ {i18n.translate('searchApiPanels.welcomeBanner.codeBox.copyButtonLabel', {
defaultMessage: 'Copy',
})}
diff --git a/packages/kbn-search-api-panels/components/ingest_data.tsx b/packages/kbn-search-api-panels/components/ingest_data.tsx
index bbe1ca3d8c0bb..9f82b91e76159 100644
--- a/packages/kbn-search-api-panels/components/ingest_data.tsx
+++ b/packages/kbn-search-api-panels/components/ingest_data.tsx
@@ -48,7 +48,7 @@ export const IngestData: React.FC = ({
>('ingestViaApi');
return (
= ({
? [
{
href: selectedLanguage.apiReference,
- label: i18n.translate('xpack.serverlessSearch.ingestData.clientDocLink', {
+ label: i18n.translate('searchApiPanels.welcomeBanner.ingestData.clientDocLink', {
defaultMessage: '{languageName} API reference',
values: { languageName: selectedLanguage.name },
}),
@@ -83,18 +83,18 @@ export const IngestData: React.FC = ({
: []),
{
href: docLinks.integrations,
- label: i18n.translate('xpack.serverlessSearch.ingestData.integrationsLink', {
+ label: i18n.translate('searchApiPanels.welcomeBanner.ingestData.integrationsLink', {
defaultMessage: 'About Integrations',
}),
},
]}
- title={i18n.translate('xpack.serverlessSearch.ingestData.title', {
+ title={i18n.translate('searchApiPanels.welcomeBanner.ingestData.title', {
defaultMessage: 'Ingest data',
})}
>
= ({
label={
- {i18n.translate('xpack.serverlessSearch.ingestData.ingestApiLabel', {
+ {i18n.translate('searchApiPanels.welcomeBanner.ingestData.ingestApiLabel', {
defaultMessage: 'Ingest via API',
})}
@@ -117,7 +117,7 @@ export const IngestData: React.FC = ({
onChange={() => setSelectedIngestMethod('ingestViaApi')}
>
- {i18n.translate('xpack.serverlessSearch.ingestData.ingestApiDescription', {
+ {i18n.translate('searchApiPanels.welcomeBanner.ingestData.ingestApiDescription', {
defaultMessage:
'The most flexible way to index data, enabling full control over your customization and optimization options.',
})}
@@ -130,7 +130,7 @@ export const IngestData: React.FC = ({
label={
- {i18n.translate('xpack.serverlessSearch.ingestData.ingestIntegrationLabel', {
+ {i18n.translate('searchApiPanels.welcomeBanner.ingestData.ingestIntegrationLabel', {
defaultMessage: 'Ingest via integration',
})}
@@ -141,10 +141,13 @@ export const IngestData: React.FC = ({
onChange={() => setSelectedIngestMethod('ingestViaIntegration')}
>
- {i18n.translate('xpack.serverlessSearch.ingestData.ingestIntegrationDescription', {
- defaultMessage:
- 'Specialized ingestion tools optimized for transforming data and shipping it to Elasticsearch.',
- })}
+ {i18n.translate(
+ 'searchApiPanels.welcomeBanner.ingestData.ingestIntegrationDescription',
+ {
+ defaultMessage:
+ 'Specialized ingestion tools optimized for transforming data and shipping it to Elasticsearch.',
+ }
+ )}
diff --git a/packages/kbn-search-api-panels/components/install_client.tsx b/packages/kbn-search-api-panels/components/install_client.tsx
index f5c0eceb42470..9083cf902f885 100644
--- a/packages/kbn-search-api-panels/components/install_client.tsx
+++ b/packages/kbn-search-api-panels/components/install_client.tsx
@@ -42,7 +42,7 @@ const Link: React.FC<{ language: Languages; http: HttpStart; pluginId: string }>
return (
return (
return (
= ({
- {i18n.translate('xpack.serverlessSearch.apiCallout.content', {
+ {i18n.translate('searchApiPanels.welcomeBanner.apiCallout.content', {
defaultMessage:
'Console enables you to call Elasticsearch and Kibana REST APIs directly, without needing to install a language client.',
})}
@@ -123,20 +123,20 @@ export const InstallClientPanel: React.FC = ({
);
return (
= ({
- {i18n.translate('xpack.serverlessSearch.ingestData.logstashTitle', {
+ {i18n.translate('searchApiPanels.welcomeBanner.ingestData.logstashTitle', {
defaultMessage: 'Logstash',
})}
@@ -54,7 +54,7 @@ export const IntegrationsPanel: React.FC = ({
- {i18n.translate('xpack.serverlessSearch.ingestData.logstashDescription', {
+ {i18n.translate('searchApiPanels.welcomeBanner.ingestData.logstashDescription', {
defaultMessage:
'Add data to your data stream or index to make it searchable. Choose an ingestion method that fits your application and workflow.',
})}
@@ -72,7 +72,7 @@ export const IntegrationsPanel: React.FC = ({
= ({
- {i18n.translate('xpack.serverlessSearch.ingestData.beatsTitle', {
+ {i18n.translate('searchApiPanels.welcomeBanner.ingestData.beatsTitle', {
defaultMessage: 'Beats',
})}
- {i18n.translate('xpack.serverlessSearch.ingestData.beatsDescription', {
+ {i18n.translate('searchApiPanels.welcomeBanner.ingestData.beatsDescription', {
defaultMessage:
'Lightweight, single-purpose data shippers for Elasticsearch. Use Beats to send operational data from your servers.',
})}
@@ -114,7 +114,7 @@ export const IntegrationsPanel: React.FC = ({
= ({
- {i18n.translate('xpack.serverlessSearch.ingestData.connectorsTitle', {
+ {i18n.translate('searchApiPanels.welcomeBanner.ingestData.connectorsTitle', {
defaultMessage: 'Connector Client',
})}
- {i18n.translate('xpack.serverlessSearch.ingestData.connectorsDescription', {
+ {i18n.translate('searchApiPanels.welcomeBanner.ingestData.connectorsDescription', {
defaultMessage:
'Specialized integrations for syncing data from third-party sources to Elasticsearch. Use Elastic Connectors to sync content from a range of databases and object stores.',
})}
@@ -156,9 +156,12 @@ export const IntegrationsPanel: React.FC = ({
diff --git a/packages/kbn-search-api-panels/components/select_client.tsx b/packages/kbn-search-api-panels/components/select_client.tsx
index 3f7836bf90e10..1875b3f1b8ef0 100644
--- a/packages/kbn-search-api-panels/components/select_client.tsx
+++ b/packages/kbn-search-api-panels/components/select_client.tsx
@@ -44,7 +44,7 @@ export const SelectClientPanel: React.FC = ({
- {i18n.translate('xpack.serverlessSearch.selectClient.heading', {
+ {i18n.translate('searchApiPanels.welcomeBanner.selectClient.heading', {
defaultMessage: 'Choose one',
})}
@@ -57,21 +57,21 @@ export const SelectClientPanel: React.FC = ({
- {i18n.translate('xpack.serverlessSearch.selectClient.callout.description', {
+ {i18n.translate('searchApiPanels.welcomeBanner.selectClient.callout.description', {
defaultMessage:
'With Console, you can get started right away with our REST API’s. No installation required. ',
})}
- {i18n.translate('xpack.serverlessSearch.selectClient.callout.link', {
+ {i18n.translate('searchApiPanels.welcomeBanner.selectClient.callout.link', {
defaultMessage: 'Try Console now',
})}
@@ -84,14 +84,17 @@ export const SelectClientPanel: React.FC = ({
- {i18n.translate('xpack.serverlessSearch.selectClient.description.console.link', {
- defaultMessage: 'Console',
- })}
+ {i18n.translate(
+ 'searchApiPanels.welcomeBanner.selectClient.description.console.link',
+ {
+ defaultMessage: 'Console',
+ }
+ )}
),
}}
@@ -102,18 +105,24 @@ export const SelectClientPanel: React.FC = ({
links={[
{
href: docLinks.elasticsearchClients,
- label: i18n.translate('xpack.serverlessSearch.selectClient.elasticsearchClientDocLink', {
- defaultMessage: 'Elasticsearch clients ',
- }),
+ label: i18n.translate(
+ 'searchApiPanels.welcomeBanner.selectClient.elasticsearchClientDocLink',
+ {
+ defaultMessage: 'Elasticsearch clients ',
+ }
+ ),
},
{
href: docLinks.kibanaRunApiInConsole,
- label: i18n.translate('xpack.serverlessSearch.selectClient.apiRequestConsoleDocLink', {
- defaultMessage: 'Run API requests in Console ',
- }),
+ label: i18n.translate(
+ 'searchApiPanels.welcomeBanner.selectClient.apiRequestConsoleDocLink',
+ {
+ defaultMessage: 'Run API requests in Console ',
+ }
+ ),
},
]}
- title={i18n.translate('xpack.serverlessSearch.selectClient.title', {
+ title={i18n.translate('searchApiPanels.welcomeBanner.selectClient.title', {
defaultMessage: 'Select your client',
})}
overviewPanelProps={overviewPanelProps}
diff --git a/packages/kbn-search-api-panels/components/try_in_console_button.tsx b/packages/kbn-search-api-panels/components/try_in_console_button.tsx
index 04d420592db19..35f6ef5d00184 100644
--- a/packages/kbn-search-api-panels/components/try_in_console_button.tsx
+++ b/packages/kbn-search-api-panels/components/try_in_console_button.tsx
@@ -42,7 +42,7 @@ export const TryInConsoleButton = ({
return (
diff --git a/packages/kbn-search-api-panels/constants.ts b/packages/kbn-search-api-panels/constants.ts
index a947b9f282ed9..dda3028ac96af 100644
--- a/packages/kbn-search-api-panels/constants.ts
+++ b/packages/kbn-search-api-panels/constants.ts
@@ -8,9 +8,12 @@
import { i18n } from '@kbn/i18n';
-export const LEARN_MORE_LABEL: string = i18n.translate('xpack.serverlessSearch.panels.learnMore', {
- defaultMessage: 'Learn more',
-});
+export const LEARN_MORE_LABEL: string = i18n.translate(
+ 'searchApiPanels.welcomeBanner.panels.learnMore',
+ {
+ defaultMessage: 'Learn more',
+ }
+);
export const API_KEY_PLACEHOLDER = 'your_api_key';
export const ELASTICSEARCH_URL_PLACEHOLDER = 'https://your_deployment_url';
export const INDEX_NAME_PLACEHOLDER = 'index_name';
diff --git a/packages/kbn-search-api-panels/index.tsx b/packages/kbn-search-api-panels/index.tsx
index 9a7b778fef186..92c314481b0a4 100644
--- a/packages/kbn-search-api-panels/index.tsx
+++ b/packages/kbn-search-api-panels/index.tsx
@@ -42,7 +42,7 @@ export const WelcomeBanner: React.FC = ({
- {i18n.translate('xpack.serverlessSearch.header.title', {
+ {i18n.translate('searchApiPanels.welcomeBanner.header.title', {
defaultMessage: 'Get started with Elasticsearch',
})}
@@ -51,7 +51,7 @@ export const WelcomeBanner: React.FC = ({
- {i18n.translate('xpack.serverlessSearch.header.greeting.title', {
+ {i18n.translate('searchApiPanels.welcomeBanner.header.greeting.title', {
defaultMessage: 'Hi {name}!',
values: { name: userProfile.user.full_name || userProfile.user.username },
})}
@@ -62,7 +62,7 @@ export const WelcomeBanner: React.FC = ({
{showDescription && (
- {i18n.translate('xpack.serverlessSearch.header.description', {
+ {i18n.translate('searchApiPanels.welcomeBanner.header.description', {
defaultMessage:
"Set up your programming language client, ingest some data, and you'll be ready to start searching within minutes.",
})}
diff --git a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/components/getting_started/getting_started.tsx b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/components/getting_started/getting_started.tsx
index 52e1d0eb32f50..045b126fa7d40 100644
--- a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/components/getting_started/getting_started.tsx
+++ b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/components/getting_started/getting_started.tsx
@@ -178,7 +178,7 @@ export const APIGettingStarted = () => {
- {i18n.translate('xpack.serverlessSearch.apiKey.stepTwoDescription', {
+ {i18n.translate('xpack.enterpriseSearch.apiKey.stepTwoDescription', {
defaultMessage: 'Unique identifier for specific project. ',
})}
@@ -205,7 +205,7 @@ export const APIGettingStarted = () => {
/>
{
? [
{
href: selectedLanguage.basicConfig,
- label: i18n.translate('xpack.serverlessSearch.configureClient.basicConfigLabel', {
+ label: i18n.translate('xpack.enterpriseSearch.configureClient.basicConfigLabel', {
defaultMessage: 'Basic configuration',
}),
},
@@ -237,7 +237,7 @@ export const APIGettingStarted = () => {
{
href: selectedLanguage.advancedConfig,
label: i18n.translate(
- 'xpack.serverlessSearch.configureClient.advancedConfigLabel',
+ 'xpack.enterpriseSearch.configureClient.advancedConfigLabel',
{
defaultMessage: 'Advanced configuration',
}
@@ -246,14 +246,14 @@ export const APIGettingStarted = () => {
]
: []),
]}
- title={i18n.translate('xpack.serverlessSearch.configureClient.title', {
+ title={i18n.translate('xpack.enterpriseSearch.configureClient.title', {
defaultMessage: 'Configure your client',
})}
overviewPanelProps={{ color: 'plain', hasShadow: false }}
/>
{
/>
}
links={[]}
- title={i18n.translate('xpack.serverlessSearch.testConnection.title', {
+ title={i18n.translate('xpack.enterpriseSearch.testConnection.title', {
defaultMessage: 'Test your connection',
})}
overviewPanelProps={{ color: 'plain', hasShadow: false }}
@@ -297,7 +297,7 @@ export const APIGettingStarted = () => {
/>
{
/>
}
links={[]}
- title={i18n.translate('xpack.serverlessSearch.searchQuery.title', {
+ title={i18n.translate('xpack.enterpriseSearch.searchQuery.title', {
defaultMessage: 'Build your first search query',
})}
overviewPanelProps={{ color: 'plain', hasShadow: false }}
diff --git a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/components/getting_started/languages/curl.ts b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/components/getting_started/languages/curl.ts
index 8d856ec1893da..04240ebb44dff 100644
--- a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/components/getting_started/languages/curl.ts
+++ b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/components/getting_started/languages/curl.ts
@@ -56,7 +56,7 @@ export API_KEY="${apiKey}"`,
# example
brew install curl`,
- name: i18n.translate('xpack.serverlessSearch.languages.cURL', {
+ name: i18n.translate('xpack.enterpriseSearch.languages.cURL', {
defaultMessage: 'cURL',
}),
languageStyling: 'shell',
diff --git a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/components/getting_started/languages/go.ts b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/components/getting_started/languages/go.ts
index e00a142ac256b..fa147e46905a6 100644
--- a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/components/getting_started/languages/go.ts
+++ b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/components/getting_started/languages/go.ts
@@ -87,7 +87,7 @@ func main() {
fmt.Println(res, err)
}`,
installClient: 'go get -u github.com/elastic/elasticsearch-serverless-go@latest',
- name: i18n.translate('xpack.serverlessSearch.languages.go', {
+ name: i18n.translate('xpack.enterpriseSearch.languages.go', {
defaultMessage: 'Go',
}),
testConnection: `infores, err := es.Info().Do(context.Background())
diff --git a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/components/getting_started/languages/javascript.ts b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/components/getting_started/languages/javascript.ts
index 16f94e7939b29..573aebea2b940 100644
--- a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/components/getting_started/languages/javascript.ts
+++ b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/components/getting_started/languages/javascript.ts
@@ -85,7 +85,7 @@ const result = await client.helpers.bulk({
console.log(result);
`,
installClient: 'npm install @elastic/elasticsearch@8',
- name: i18n.translate('xpack.serverlessSearch.languages.javascript', {
+ name: i18n.translate('xpack.enterpriseSearch.languages.javascript', {
defaultMessage: 'JavaScript',
}),
testConnection: `const resp = await client.info();
diff --git a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/components/getting_started/languages/php.ts b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/components/getting_started/languages/php.ts
index 84bfd4ae0fa64..2878b822475af 100644
--- a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/components/getting_started/languages/php.ts
+++ b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/components/getting_started/languages/php.ts
@@ -137,7 +137,7 @@ echo $response->getStatusCode();
echo (string) $response->getBody();
`,
installClient: 'composer require elasticsearch/elasticsearch',
- name: i18n.translate('xpack.serverlessSearch.languages.php', {
+ name: i18n.translate('xpack.enterpriseSearch.languages.php', {
defaultMessage: 'PHP',
}),
testConnection: `$response = $client->info();
diff --git a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/components/getting_started/languages/python.ts b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/components/getting_started/languages/python.ts
index b64165c0cce75..56df9fdab9f65 100644
--- a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/components/getting_started/languages/python.ts
+++ b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/components/getting_started/languages/python.ts
@@ -60,7 +60,7 @@ client.bulk(operations=documents)
# If your application uses async/await in Python you can install with the async extra
# python -m pip install elasticsearch[async]
`,
- name: i18n.translate('xpack.serverlessSearch.languages.python', {
+ name: i18n.translate('xpack.enterpriseSearch.languages.python', {
defaultMessage: 'Python',
}),
testConnection: `client.info()`,
diff --git a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/components/getting_started/languages/ruby.ts b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/components/getting_started/languages/ruby.ts
index 61b3d6bb30871..c580777982937 100644
--- a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/components/getting_started/languages/ruby.ts
+++ b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/components/getting_started/languages/ruby.ts
@@ -50,7 +50,7 @@ client.bulk(body: documents)
# From the project's root directory:$ gem build elasticsearch-serverless.gemspec
$ gem install elasticsearch-serverless-x.x.x.gem`,
- name: i18n.translate('xpack.serverlessSearch.languages.ruby', {
+ name: i18n.translate('xpack.enterpriseSearch.languages.ruby', {
defaultMessage: 'Ruby',
}),
testConnection: `client.info`,
diff --git a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_overview/components/product_selector/product_selector.tsx b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_overview/components/product_selector/product_selector.tsx
index ecb661321f833..a5559bae0005e 100644
--- a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_overview/components/product_selector/product_selector.tsx
+++ b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_overview/components/product_selector/product_selector.tsx
@@ -69,7 +69,7 @@ export const ProductSelector: React.FC = () => {
- {i18n.translate('xpack.enterpriseSearch.overview.title', {
+ {i18n.translate('xpack.enterpriseSearch.productSelector.overview.title', {
defaultMessage: 'Ingest your content',
})}
@@ -77,7 +77,7 @@ export const ProductSelector: React.FC = () => {
- {i18n.translate('xpack.enterpriseSearch.overview.description', {
+ {i18n.translate('xpack.enterpriseSearch.productSelector.overview.description', {
defaultMessage:
'The first step in building your search experience is to create a search-optimized Elasticsearch index and import your content into it. Elasticsearch offers several user-friendly options you can choose from that best match your technical expertise and data sources.',
})}
@@ -90,11 +90,14 @@ export const ProductSelector: React.FC = () => {
{showAddContent && (
<>
{
- {i18n.translate('xpack.enterpriseSearch.overview.createCustom.title', {
+ {i18n.translate('xpack.enterpriseSearch.productSelector.overview.createCustom.title', {
defaultMessage: 'Create a custom search experience',
})}
@@ -121,10 +124,13 @@ export const ProductSelector: React.FC = () => {
- {i18n.translate('xpack.enterpriseSearch.overview.createCustom.description', {
- defaultMessage:
- 'Once your Elasticsearch index is created and populated, you are ready to get the full power of Elasticsearch and accelerate building search applications with plentiful out-of-the-box tools and multiple language clients, all backed by a robust and fully consumable set of APIs.',
- })}
+ {i18n.translate(
+ 'xpack.enterpriseSearch.productSelector.overview.createCustom.description',
+ {
+ defaultMessage:
+ 'Once your Elasticsearch index is created and populated, you are ready to get the full power of Elasticsearch and accelerate building search applications with plentiful out-of-the-box tools and multiple language clients, all backed by a robust and fully consumable set of APIs.',
+ }
+ )}
diff --git a/x-pack/plugins/translations/translations/fr-FR.json b/x-pack/plugins/translations/translations/fr-FR.json
index fafb56aed9727..152514e314bf2 100644
--- a/x-pack/plugins/translations/translations/fr-FR.json
+++ b/x-pack/plugins/translations/translations/fr-FR.json
@@ -12154,7 +12154,6 @@
"xpack.enterpriseSearch.content.newIndex.newSearchIndexTemplate.isInvalid.error": "{indexName} n'est pas un nom d'index valide",
"xpack.enterpriseSearch.content.newIndex.newSearchIndexTemplate.nameInputHelpText.lineOne": "Votre index sera nommé : {indexName}",
"xpack.enterpriseSearch.content.newIndex.steps.buildConnector.confirmModal.description": "Un index supprimé appelé {indexName} était, à l'origine, lié à une configuration de connecteur. Voulez-vous remplacer cette configuration de connecteur par la nouvelle ?",
- "xpack.enterpriseSearch.content.overview.documentExample.description.text": "Générez une clé API et lisez la {documentation} concernant l’envoi de documents au point de terminaison de l’API Elasticsearch. Utilisez des {clients} Elastic pour une intégration rationalisée.",
"xpack.enterpriseSearch.content.searchIndex.documents.documentList.description": "Affichage de {results} sur {total}. Nombre maximal de résultats de recherche de {maximum} documents.",
"xpack.enterpriseSearch.content.searchIndex.documents.documentList.pagination.itemsPerPage": "Documents par page : {docPerPage}",
"xpack.enterpriseSearch.content.searchIndex.documents.documentList.paginationOptions.option": "{docCount} documents",
@@ -13770,10 +13769,6 @@
"xpack.enterpriseSearch.content.overview.documentExample.clientLibraries.python": "Python",
"xpack.enterpriseSearch.content.overview.documentExample.clientLibraries.ruby": "Ruby",
"xpack.enterpriseSearch.content.overview.documentExample.clientLibraries.rust": "Rust",
- "xpack.enterpriseSearch.content.overview.documentExample.description.clientsLink": "clients de langages de programmation",
- "xpack.enterpriseSearch.content.overview.documentExample.description.documentationLink": "documentation",
- "xpack.enterpriseSearch.content.overview.documentExample.generateApiKeyButton.label": "Gérer les clés d'API",
- "xpack.enterpriseSearch.content.overview.documentExample.title": "Ajout de documents à votre index",
"xpack.enterpriseSearch.content.overview.emptyPrompt.body": "Nous déconseillons l'ajout de documents à un index géré en externe.",
"xpack.enterpriseSearch.content.overview.emptyPrompt.title": "Index géré en externe",
"xpack.enterpriseSearch.content.overview.generateApiKeyModal.apiKeyWarning": "Elastic ne stocke pas les clés d’API. Une fois la clé générée, vous ne pourrez la visualiser qu'une seule fois. Veillez à l'enregistrer dans un endroit sûr. Si vous n'y avez plus accès, vous devrez générer une nouvelle clé d’API à partir de cet écran.",
@@ -13783,7 +13778,6 @@
"xpack.enterpriseSearch.content.overview.generateApiKeyModal.info": "Avant de pouvoir commencer à publier des documents dans votre index Elasticsearch, vous devez créer au moins une clé d’API.",
"xpack.enterpriseSearch.content.overview.generateApiKeyModal.learnMore": "En savoir plus sur les clés d’API",
"xpack.enterpriseSearch.content.overview.generateApiKeyModal.title": "Générer une clé d’API",
- "xpack.enterpriseSearch.content.overview.optimizedRequest.label": "Afficher la requête optimisée d'Enterprise Search",
"xpack.enterpriseSearch.content.searchIndex.cancelSyncs.successMessage": "Annulation réussie des synchronisations",
"xpack.enterpriseSearch.content.searchIndex.configurationTabLabel": "Configuration",
"xpack.enterpriseSearch.content.searchIndex.connectorErrorCallOut.title": "Votre connecteur a rapporté une erreur",
@@ -14411,8 +14405,6 @@
"xpack.enterpriseSearch.overview.elasticsearchResources.gettingStarted": "Prise en main d'Elasticsearch",
"xpack.enterpriseSearch.overview.elasticsearchResources.searchUi": "Search UI pour Elasticsearch",
"xpack.enterpriseSearch.overview.elasticsearchResources.title": "Ressources",
- "xpack.enterpriseSearch.overview.emptyPromptButtonLabel": "Créer un index Elasticsearch",
- "xpack.enterpriseSearch.overview.emptyPromptTitle": "Ajouter des données et démarrer les recherches",
"xpack.enterpriseSearch.overview.emptyState.buttonTitle": "Ajouter un contenu dans Enterprise Search",
"xpack.enterpriseSearch.overview.emptyState.footerLinkTitle": "En savoir plus",
"xpack.enterpriseSearch.overview.emptyState.heading": "Ajouter un contenu dans Enterprise Search",
@@ -14438,8 +14430,6 @@
"xpack.enterpriseSearch.overview.iconRow.sharePoint.title": "Microsoft SharePoint",
"xpack.enterpriseSearch.overview.iconRow.sharePoint.tooltip": "Indexer des contenus depuis Microsoft SharePoint",
"xpack.enterpriseSearch.overview.navTitle": "Aperçu",
- "xpack.enterpriseSearch.overview.pageTitle": "Bienvenue dans Enterprise Search",
- "xpack.enterpriseSearch.overview.productSelector.title": "Des expériences de recherche pour chaque cas d'utilisation",
"xpack.enterpriseSearch.overview.searchIndices.image.altText": "Illustration d'index de recherche",
"xpack.enterpriseSearch.overview.setupCta.description": "Ajoutez des fonctions de recherche à votre application ou à votre organisation interne avec Elastic App Search et Workplace Search. Regardez la vidéo pour savoir ce qu'il est possible de faire lorsque la recherche est facilitée.",
"xpack.enterpriseSearch.passwordLabel": "Mot de passe",
@@ -34754,12 +34744,6 @@
"xpack.securitySolution.zeek.shrDescription": "L'équipe de réponse a envoyé un SYN ACK suivi d'un FIN, pas de SYN de la part de l'initiateur",
"xpack.serverlessSearch.apiKey.activeKeys": "Vous avez {number} clés actives.",
"xpack.serverlessSearch.apiKey.expiresHelpText": "Cette clé d’API expirera le {expirationDate}",
- "xpack.serverlessSearch.header.greeting.title": "Bonjour {name} !",
- "xpack.serverlessSearch.ingestData.clientDocLink": "Référence d’API {languageName}",
- "xpack.serverlessSearch.installClient.clientDocLink": "Documentation du client {languageName}",
- "xpack.serverlessSearch.selectClient.description": "Elastic construit et assure la maintenance des clients dans plusieurs langues populaires et notre communauté a contribué à beaucoup d'autres. Sélectionnez votre client linguistique favori or explorez la {console} pour commencer.",
- "xpack.serverlessSearch.apiCallout.content": "La console vous permet d’appeler directement les API REST d’Elasticsearch et de Kibana, sans avoir à installer de client de langage.",
- "xpack.serverlessSearch.apiCallOut.title": "Appeler l’API depuis la console",
"xpack.serverlessSearch.apiKey.apiKeyStepDescription": "Cette clé ne s’affichera qu’une fois, conservez-la donc en lieu sûr. Nous ne conservons pas vos clés d’API, vous devrez donc générer une clé de remplacement si vous la perdez.",
"xpack.serverlessSearch.apiKey.apiKeyStepTitle": "Stocker cette clé d'API",
"xpack.serverlessSearch.apiKey.description": "Vous aurez besoin de ces identifiants uniques pour vous connecter en toute sécurité à votre projet Elasticsearch.",
@@ -34792,8 +34776,6 @@
"xpack.serverlessSearch.apiKey.userFieldLabel": "Utilisateur",
"xpack.serverlessSearch.back": "Retour",
"xpack.serverlessSearch.cancel": "Annuler",
- "xpack.serverlessSearch.codeBox.copyButtonLabel": "Copier",
- "xpack.serverlessSearch.codeBox.selectAriaLabel": "Sélectionner un langage de programmation",
"xpack.serverlessSearch.configureClient.advancedConfigLabel": "Configuration avancée",
"xpack.serverlessSearch.configureClient.basicConfigLabel": "Configuration de base",
"xpack.serverlessSearch.configureClient.description": "Initialiser votre client avec votre clé d’API et votre identifiant de cloud uniques",
@@ -34814,30 +34796,7 @@
"xpack.serverlessSearch.footer.searchUI.description": "L’interface utilisateur Search est une bibliothèque JavaScript libre et gratuite maintenue par Elastic pour un développement rapide d’expériences de recherche modernes et attrayantes.",
"xpack.serverlessSearch.footer.searchUI.title": "Créer une interface utilisateur avec Search UI",
"xpack.serverlessSearch.footer.title": "Et ensuite ?",
- "xpack.serverlessSearch.githubLink.curl.label": "curl",
- "xpack.serverlessSearch.githubLink.javascript.label": "elasticsearch",
- "xpack.serverlessSearch.githubLink.ruby.label": "elasticsearch-ruby",
- "xpack.serverlessSearch.header.description": "Configurez votre client de langage de programmation, ingérez des données, et vous serez prêt à commencer vos recherches en quelques minutes.",
"xpack.serverlessSearch.header.title": "Lancez-vous avec Elasticsearch",
- "xpack.serverlessSearch.ingestData.beatsDescription": "Des agents légers conçus pour le transfert de données pour Elasticsearch. Utilisez Beats pour envoyer des données opérationnelles depuis vos serveurs.",
- "xpack.serverlessSearch.ingestData.beatsLink": "beats",
- "xpack.serverlessSearch.ingestData.beatsTitle": "Beats",
- "xpack.serverlessSearch.ingestData.connectorsDescription": "Des intégrations spécialisées pour synchroniser des données de sources tierces avec Elasticsearch. Utilisez des connecteurs Elastic pour synchroniser du contenu d’une plage de bases de données et de stockage d’objets.",
- "xpack.serverlessSearch.ingestData.connectorsPythonLink": "connecteurs-python",
- "xpack.serverlessSearch.ingestData.connectorsTitle": "Client de connecteur",
- "xpack.serverlessSearch.ingestData.description": "Ajoutez des données à votre flux de données ou à votre index pour les rendre interrogeables. Choisissez une méthode d’ingestion qui correspond à votre application et à votre workflow.",
- "xpack.serverlessSearch.ingestData.ingestApiDescription": "La façon la plus flexible d’indexer des données, ce qui vous donne un contrôle total sur vos options de personnalisation et d’optimisation.",
- "xpack.serverlessSearch.ingestData.ingestApiLabel": "Ingérer via une API",
- "xpack.serverlessSearch.ingestData.ingestIntegrationDescription": "Des outils d’ingestion spécialisés optimisés pour transformer des données et les transférer à Elasticsearch.",
- "xpack.serverlessSearch.ingestData.ingestIntegrationLabel": "Ingérer via l’intégration",
- "xpack.serverlessSearch.ingestData.ingestLegendLabel": "Sélectionner une méthode d'ingestion",
- "xpack.serverlessSearch.ingestData.integrationsLink": "À propos des intégrations",
- "xpack.serverlessSearch.ingestData.logstashDescription": "Ajoutez des données à votre flux de données ou à votre index pour les rendre interrogeables. Choisissez une méthode d’ingestion qui correspond à votre application et à votre workflow.",
- "xpack.serverlessSearch.ingestData.logstashLink": "Logstash",
- "xpack.serverlessSearch.ingestData.logstashTitle": "Logstash",
- "xpack.serverlessSearch.ingestData.title": "Ingérer des données",
- "xpack.serverlessSearch.installClient.description": "Elastic construit et assure la maintenance des clients dans plusieurs langues populaires et notre communauté a contribué à beaucoup d'autres. Installez votre client de langage favori pour commencer.",
- "xpack.serverlessSearch.installClient.title": "Installer un client",
"xpack.serverlessSearch.invalidJsonError": "JSON non valide",
"xpack.serverlessSearch.languages.cURL": "cURL",
"xpack.serverlessSearch.languages.javascript": "JavaScript / Node.js",
@@ -34855,17 +34814,8 @@
"xpack.serverlessSearch.required": "Obligatoire",
"xpack.serverlessSearch.searchQuery.description": "Vous êtes maintenant prêt à expérimenter la recherche et l'exécution d'agrégations sur vos données Elasticsearch.",
"xpack.serverlessSearch.searchQuery.title": "Créer votre première requête de recherche",
- "xpack.serverlessSearch.selectClient.apiRequestConsoleDocLink": "Exécuter des requêtes d’API dans la console ",
- "xpack.serverlessSearch.selectClient.callout.description": "Avec la console, vous pouvez directement commencer à utiliser nos API REST. Aucune installation n’est requise. ",
- "xpack.serverlessSearch.selectClient.callout.link": "Essayez la console maintenant",
- "xpack.serverlessSearch.selectClient.callout.title": "Lancez-vous dans la console",
- "xpack.serverlessSearch.selectClient.description.console.link": "Console",
- "xpack.serverlessSearch.selectClient.elasticsearchClientDocLink": "Clients d'Elasticsearch ",
- "xpack.serverlessSearch.selectClient.heading": "Choisissez-en un",
- "xpack.serverlessSearch.selectClient.title": "Sélectionner votre client",
"xpack.serverlessSearch.testConnection.description": "Envoyez une requête de test pour confirmer que votre client de langage et votre instance Elasticsearch sont opérationnels.",
"xpack.serverlessSearch.testConnection.title": "Tester votre connexion",
- "xpack.serverlessSearch.tryInConsoleButton": "Essayer dans la console",
"xpack.sessionView.alertFilteredCountStatusLabel": " Affichage de {count} alertes",
"xpack.sessionView.alertTotalCountStatusLabel": "Affichage de {count} alertes",
"xpack.sessionView.processTree.loadMore": "Afficher les {pageSize} événements suivants",
@@ -40467,4 +40417,4 @@
"xpack.painlessLab.walkthroughButtonLabel": "Présentation",
"xpack.serverlessObservability.nav.getStarted": "Démarrer"
}
-}
\ No newline at end of file
+}
diff --git a/x-pack/plugins/translations/translations/ja-JP.json b/x-pack/plugins/translations/translations/ja-JP.json
index 66ea13be17908..1c5dcabfa5292 100644
--- a/x-pack/plugins/translations/translations/ja-JP.json
+++ b/x-pack/plugins/translations/translations/ja-JP.json
@@ -12168,7 +12168,6 @@
"xpack.enterpriseSearch.content.newIndex.newSearchIndexTemplate.isInvalid.error": "{indexName}は無効なインデックス名です",
"xpack.enterpriseSearch.content.newIndex.newSearchIndexTemplate.nameInputHelpText.lineOne": "インデックスは次の名前になります:{indexName}",
"xpack.enterpriseSearch.content.newIndex.steps.buildConnector.confirmModal.description": "削除されたインデックス{indexName}は、既存のコネクター構成に関連付けられていました。既存のコネクター構成を新しいコネクター構成で置き換えますか?",
- "xpack.enterpriseSearch.content.overview.documentExample.description.text": "APIキーを生成し、ドキュメントをElasticsearch APIエンドポイントに送信する方法に関する{documentation}を読みます。統合を合理化するには、Elastic {clients}を使用します。",
"xpack.enterpriseSearch.content.searchIndex.documents.documentList.description": "{total}件中{results}件を表示中。{maximum}ドキュメントが検索結果の最大数です。",
"xpack.enterpriseSearch.content.searchIndex.documents.documentList.pagination.itemsPerPage": "毎秒あたりのドキュメント:{docPerPage}",
"xpack.enterpriseSearch.content.searchIndex.documents.documentList.paginationOptions.option": "{docCount}ドキュメント",
@@ -13784,10 +13783,6 @@
"xpack.enterpriseSearch.content.overview.documentExample.clientLibraries.python": "Python",
"xpack.enterpriseSearch.content.overview.documentExample.clientLibraries.ruby": "Ruby",
"xpack.enterpriseSearch.content.overview.documentExample.clientLibraries.rust": "Rust",
- "xpack.enterpriseSearch.content.overview.documentExample.description.clientsLink": "プログラミング言語クライアント",
- "xpack.enterpriseSearch.content.overview.documentExample.description.documentationLink": "ドキュメンテーション",
- "xpack.enterpriseSearch.content.overview.documentExample.generateApiKeyButton.label": "APIキーの管理",
- "xpack.enterpriseSearch.content.overview.documentExample.title": "ドキュメントをインデックスに追加しています",
"xpack.enterpriseSearch.content.overview.emptyPrompt.body": "外部で管理されているインデックスにはドキュメントを追加しないようにすることをお勧めします。",
"xpack.enterpriseSearch.content.overview.emptyPrompt.title": "外部で管理されているインデックス",
"xpack.enterpriseSearch.content.overview.generateApiKeyModal.apiKeyWarning": "ElasticはAPIキーを保存しません。生成後は、1回だけキーを表示できます。必ず安全に保管してください。アクセスできなくなった場合は、この画面から新しいAPIキーを生成する必要があります。",
@@ -13797,7 +13792,6 @@
"xpack.enterpriseSearch.content.overview.generateApiKeyModal.info": "ElasticsearchドキュメントをElasticsearchインデックスに送信する前に、少なくとも1つのAPIキーを作成する必要があります。",
"xpack.enterpriseSearch.content.overview.generateApiKeyModal.learnMore": "APIキーの詳細",
"xpack.enterpriseSearch.content.overview.generateApiKeyModal.title": "APIキーを生成",
- "xpack.enterpriseSearch.content.overview.optimizedRequest.label": "エンタープライズ サーチで最適化されたリクエストを表示",
"xpack.enterpriseSearch.content.searchIndex.cancelSyncs.successMessage": "同期が正常にキャンセルされました",
"xpack.enterpriseSearch.content.searchIndex.configurationTabLabel": "構成",
"xpack.enterpriseSearch.content.searchIndex.connectorErrorCallOut.title": "コネクターでエラーが発生しました",
@@ -14425,8 +14419,6 @@
"xpack.enterpriseSearch.overview.elasticsearchResources.gettingStarted": "Elasticsearchを使い始める",
"xpack.enterpriseSearch.overview.elasticsearchResources.searchUi": "ElasticsearchのUIを検索",
"xpack.enterpriseSearch.overview.elasticsearchResources.title": "リソース",
- "xpack.enterpriseSearch.overview.emptyPromptButtonLabel": "Elasticsearchインデックスを作成",
- "xpack.enterpriseSearch.overview.emptyPromptTitle": "データを追加して検索を開始",
"xpack.enterpriseSearch.overview.emptyState.buttonTitle": "コンテンツをエンタープライズ サーチに追加",
"xpack.enterpriseSearch.overview.emptyState.footerLinkTitle": "詳細",
"xpack.enterpriseSearch.overview.emptyState.heading": "コンテンツをエンタープライズ サーチに追加",
@@ -14452,8 +14444,6 @@
"xpack.enterpriseSearch.overview.iconRow.sharePoint.title": "Microsoft SharePoint",
"xpack.enterpriseSearch.overview.iconRow.sharePoint.tooltip": "Microsoft SharePointのコンテンツにインデックスを作成",
"xpack.enterpriseSearch.overview.navTitle": "概要",
- "xpack.enterpriseSearch.overview.pageTitle": "エンタープライズ サーチへようこそ",
- "xpack.enterpriseSearch.overview.productSelector.title": "すべてのユースケースの検索エクスペリエンス",
"xpack.enterpriseSearch.overview.searchIndices.image.altText": "検索インデックスの例",
"xpack.enterpriseSearch.overview.setupCta.description": "Elastic App Search および Workplace Search を使用して、アプリまたは社内組織に検索を追加できます。検索が簡単になるとどのような利点があるのかについては、動画をご覧ください。",
"xpack.enterpriseSearch.passwordLabel": "パスワード",
@@ -34753,12 +34743,6 @@
"xpack.securitySolution.zeek.shrDescription": "レスポンダーがFINに続きSYNを送信しました。接続元からSYN-ACKはありません",
"xpack.serverlessSearch.apiKey.activeKeys": "{number}個のアクティブなキーがあります。",
"xpack.serverlessSearch.apiKey.expiresHelpText": "このAPIキーは{expirationDate}に有効期限切れになります",
- "xpack.serverlessSearch.header.greeting.title": "{name}様",
- "xpack.serverlessSearch.ingestData.clientDocLink": "{languageName}APIリファレンス",
- "xpack.serverlessSearch.installClient.clientDocLink": "{languageName}クライアントドキュメント",
- "xpack.serverlessSearch.selectClient.description": "Elasticは複数の一般的な言語でクライアントを構築および保守します。Elasticのコミュニティはさらに多くを提供しています。お気に入りの言語クライアントを選択するか、{console}を起動して開始します。",
- "xpack.serverlessSearch.apiCallout.content": "Consoleを使用すると、言語クライアントをインストールせずに、ElasticsearchとKibanaのREST APIを直接呼び出すことができます。",
- "xpack.serverlessSearch.apiCallOut.title": "コンソールでAPIを呼び出し",
"xpack.serverlessSearch.apiKey.apiKeyStepDescription": "このキーは一度しか表示されないため、安全な場所に保存しておいてください。当社はお客様のAPIキーを保存しません。キーを紛失した場合は、代替キーを生成する必要があります。",
"xpack.serverlessSearch.apiKey.apiKeyStepTitle": "このAPIキーを保存",
"xpack.serverlessSearch.apiKey.description": "Elasticsearchプロジェクトに安全に接続するには、これらの一意の識別子が必要です。",
@@ -34791,8 +34775,6 @@
"xpack.serverlessSearch.apiKey.userFieldLabel": "ユーザー",
"xpack.serverlessSearch.back": "戻る",
"xpack.serverlessSearch.cancel": "キャンセル",
- "xpack.serverlessSearch.codeBox.copyButtonLabel": "コピー",
- "xpack.serverlessSearch.codeBox.selectAriaLabel": "プログラミング言語を選択",
"xpack.serverlessSearch.configureClient.advancedConfigLabel": "高度な構成",
"xpack.serverlessSearch.configureClient.basicConfigLabel": "基本構成",
"xpack.serverlessSearch.configureClient.description": "一意のAPIキーとCloud IDでクライアントを初期化",
@@ -34813,30 +34795,7 @@
"xpack.serverlessSearch.footer.searchUI.description": "Search UIはElasticが管理している無料のオープンソースJavaScriptライブラリで、モダンで魅力的な検索エクスペリエンスをすばやく開発できます。",
"xpack.serverlessSearch.footer.searchUI.title": "Search UIでユーザーインターフェースを構築",
"xpack.serverlessSearch.footer.title": "次のステップ",
- "xpack.serverlessSearch.githubLink.curl.label": "curl",
- "xpack.serverlessSearch.githubLink.javascript.label": "elasticsearch",
- "xpack.serverlessSearch.githubLink.ruby.label": "elasticsearch-ruby",
- "xpack.serverlessSearch.header.description": "プログラミング言語のクライアントを設定し、データを取り込めば、数分で検索を開始できます。",
"xpack.serverlessSearch.header.title": "Elasticsearchをはじめよう",
- "xpack.serverlessSearch.ingestData.beatsDescription": "Elasticsearch向けの軽量の、専用データ転送機能。Beatsを使用して、サーバーから運用データを送信します。",
- "xpack.serverlessSearch.ingestData.beatsLink": "beats",
- "xpack.serverlessSearch.ingestData.beatsTitle": "ビート",
- "xpack.serverlessSearch.ingestData.connectorsDescription": "サードパーティのソースからElasticsearchにデータを同期するための特別な統合。Elasticコネクターを使って、さまざまなデータベースやオブジェクトストアからコンテンツを同期できます。",
- "xpack.serverlessSearch.ingestData.connectorsPythonLink": "connectors-python",
- "xpack.serverlessSearch.ingestData.connectorsTitle": "コネクタークライアント",
- "xpack.serverlessSearch.ingestData.description": "データストリームやインデックスにデータを追加して、データを検索可能にします。アプリケーションとワークフローに合ったインジェスト方法を選択します。",
- "xpack.serverlessSearch.ingestData.ingestApiDescription": "データをインデックス化する最も柔軟な方法で、カスタマイズや最適化オプションを完全に制御できます。",
- "xpack.serverlessSearch.ingestData.ingestApiLabel": "API経由でインジェスト",
- "xpack.serverlessSearch.ingestData.ingestIntegrationDescription": "データを変換してElasticsearchに送信するために最適化された専用のインジェストツール。",
- "xpack.serverlessSearch.ingestData.ingestIntegrationLabel": "統合経由でインジェスト",
- "xpack.serverlessSearch.ingestData.ingestLegendLabel": "インジェスチョン方法を選択",
- "xpack.serverlessSearch.ingestData.integrationsLink": "統合について",
- "xpack.serverlessSearch.ingestData.logstashDescription": "データストリームやインデックスにデータを追加して、データを検索可能にします。アプリケーションとワークフローに合ったインジェスト方法を選択します。",
- "xpack.serverlessSearch.ingestData.logstashLink": "Logstash",
- "xpack.serverlessSearch.ingestData.logstashTitle": "Logstash",
- "xpack.serverlessSearch.ingestData.title": "データをインジェスト",
- "xpack.serverlessSearch.installClient.description": "Elasticは複数の一般的な言語でクライアントを構築および保守します。Elasticのコミュニティはさらに多くを提供しています。開始するには、お気に入りの言語クライアントをインストールします。",
- "xpack.serverlessSearch.installClient.title": "クライアントをインスト-ル",
"xpack.serverlessSearch.invalidJsonError": "無効なJSON",
"xpack.serverlessSearch.languages.cURL": "cURL",
"xpack.serverlessSearch.languages.javascript": "JavaScript / Node.js",
@@ -34854,17 +34813,8 @@
"xpack.serverlessSearch.required": "必須",
"xpack.serverlessSearch.searchQuery.description": "これで、Elasticsearchデータの検索や集約の実験を始める準備が整いました。",
"xpack.serverlessSearch.searchQuery.title": "最初の検索クエリを作成",
- "xpack.serverlessSearch.selectClient.apiRequestConsoleDocLink": "コンソールでAPIリクエストを実行 ",
- "xpack.serverlessSearch.selectClient.callout.description": "コンソールでは、REST APIを使用してすぐに開始できます。インストールは不要です。",
- "xpack.serverlessSearch.selectClient.callout.link": "今すぐコンソールを試す",
- "xpack.serverlessSearch.selectClient.callout.title": "今すぐコンソールで試す",
- "xpack.serverlessSearch.selectClient.description.console.link": "コンソール",
- "xpack.serverlessSearch.selectClient.elasticsearchClientDocLink": "Elasticsearchクライアント ",
- "xpack.serverlessSearch.selectClient.heading": "1つ選択",
- "xpack.serverlessSearch.selectClient.title": "クライアントを選択",
"xpack.serverlessSearch.testConnection.description": "テストリクエストを送信して、言語クライアントとElasticsearchインスタンスが起動し、実行中であることを確認してください。",
"xpack.serverlessSearch.testConnection.title": "接続をテスト",
- "xpack.serverlessSearch.tryInConsoleButton": "コンソールで試す",
"xpack.sessionView.alertFilteredCountStatusLabel": " {count}件のアラートを表示中",
"xpack.sessionView.alertTotalCountStatusLabel": "{count}件のアラートを表示中",
"xpack.sessionView.processTree.loadMore": "{pageSize}次のイベントを表示",
@@ -40458,4 +40408,4 @@
"xpack.painlessLab.walkthroughButtonLabel": "実地検証",
"xpack.serverlessObservability.nav.getStarted": "使ってみる"
}
-}
\ No newline at end of file
+}
diff --git a/x-pack/plugins/translations/translations/zh-CN.json b/x-pack/plugins/translations/translations/zh-CN.json
index 7b86064bc4322..9fe7f8e5a4a85 100644
--- a/x-pack/plugins/translations/translations/zh-CN.json
+++ b/x-pack/plugins/translations/translations/zh-CN.json
@@ -12168,7 +12168,6 @@
"xpack.enterpriseSearch.content.newIndex.newSearchIndexTemplate.isInvalid.error": "{indexName} 为无效索引名称",
"xpack.enterpriseSearch.content.newIndex.newSearchIndexTemplate.nameInputHelpText.lineOne": "您的索引将命名为:{indexName}",
"xpack.enterpriseSearch.content.newIndex.steps.buildConnector.confirmModal.description": "名为 {indexName} 的已删除索引最初绑定到现有连接器配置。是否要将现有连接器配置替换成新的?",
- "xpack.enterpriseSearch.content.overview.documentExample.description.text": "生成 API 密钥并阅读{documentation},了解如何将文档发布到 Elasticsearch API 终端。将 Elastic {clients} 用于精简集成。",
"xpack.enterpriseSearch.content.searchIndex.documents.documentList.description": "显示 {results} 个,共 {total} 个。搜索结果最多包含 {maximum} 个文档。",
"xpack.enterpriseSearch.content.searchIndex.documents.documentList.pagination.itemsPerPage": "每页文档数:{docPerPage}",
"xpack.enterpriseSearch.content.searchIndex.documents.documentList.paginationOptions.option": "{docCount} 个文档",
@@ -13784,10 +13783,6 @@
"xpack.enterpriseSearch.content.overview.documentExample.clientLibraries.python": "Python",
"xpack.enterpriseSearch.content.overview.documentExample.clientLibraries.ruby": "Ruby",
"xpack.enterpriseSearch.content.overview.documentExample.clientLibraries.rust": "Rust",
- "xpack.enterpriseSearch.content.overview.documentExample.description.clientsLink": "编程语言客户端",
- "xpack.enterpriseSearch.content.overview.documentExample.description.documentationLink": "文档",
- "xpack.enterpriseSearch.content.overview.documentExample.generateApiKeyButton.label": "管理 API 密钥",
- "xpack.enterpriseSearch.content.overview.documentExample.title": "正在添加文档到您的索引",
"xpack.enterpriseSearch.content.overview.emptyPrompt.body": "不建议将文档添加到外部管理的索引。",
"xpack.enterpriseSearch.content.overview.emptyPrompt.title": "外部管理的索引",
"xpack.enterpriseSearch.content.overview.generateApiKeyModal.apiKeyWarning": "Elastic 不会存储 API 密钥。一旦生成,您只能查看密钥一次。请确保将其保存在某个安全位置。如果失去它的访问权限,您需要从此屏幕生成新的 API 密钥。",
@@ -13797,7 +13792,6 @@
"xpack.enterpriseSearch.content.overview.generateApiKeyModal.info": "在开始将文档发布到 Elasticsearch 索引之前,您至少需要创建一个 API 密钥。",
"xpack.enterpriseSearch.content.overview.generateApiKeyModal.learnMore": "进一步了解 API 密钥",
"xpack.enterpriseSearch.content.overview.generateApiKeyModal.title": "生成 API 密钥",
- "xpack.enterpriseSearch.content.overview.optimizedRequest.label": "查看 Enterprise Search 优化的请求",
"xpack.enterpriseSearch.content.searchIndex.cancelSyncs.successMessage": "已成功取消同步",
"xpack.enterpriseSearch.content.searchIndex.configurationTabLabel": "配置",
"xpack.enterpriseSearch.content.searchIndex.connectorErrorCallOut.title": "您的连接器报告了错误",
@@ -14425,8 +14419,6 @@
"xpack.enterpriseSearch.overview.elasticsearchResources.gettingStarted": "Elasticsearch 入门",
"xpack.enterpriseSearch.overview.elasticsearchResources.searchUi": "Elasticsearch 的搜索 UI",
"xpack.enterpriseSearch.overview.elasticsearchResources.title": "资源",
- "xpack.enterpriseSearch.overview.emptyPromptButtonLabel": "创建 Elasticsearch 索引",
- "xpack.enterpriseSearch.overview.emptyPromptTitle": "添加数据并开始搜索",
"xpack.enterpriseSearch.overview.emptyState.buttonTitle": "将内容添加到 Enterprise Search",
"xpack.enterpriseSearch.overview.emptyState.footerLinkTitle": "了解详情",
"xpack.enterpriseSearch.overview.emptyState.heading": "将内容添加到 Enterprise Search",
@@ -14452,8 +14444,6 @@
"xpack.enterpriseSearch.overview.iconRow.sharePoint.title": "Microsoft SharePoint",
"xpack.enterpriseSearch.overview.iconRow.sharePoint.tooltip": "索引来自 Microsoft SharePoint 的内容",
"xpack.enterpriseSearch.overview.navTitle": "概览",
- "xpack.enterpriseSearch.overview.pageTitle": "欢迎使用 Enterprise Search",
- "xpack.enterpriseSearch.overview.productSelector.title": "每个用例的搜索体验",
"xpack.enterpriseSearch.overview.searchIndices.image.altText": "搜索索引图示",
"xpack.enterpriseSearch.overview.setupCta.description": "通过 Elastic App Search 和 Workplace Search,将搜索添加到您的应用或内部组织中。观看视频,了解方便易用的搜索功能可以帮您做些什么。",
"xpack.enterpriseSearch.passwordLabel": "密码",
@@ -34749,12 +34739,6 @@
"xpack.securitySolution.zeek.shrDescription": "响应方已发送 SYN ACK,后跟 FIN,发起方未发送 SYN",
"xpack.serverlessSearch.apiKey.activeKeys": "您有 {number} 个活动密钥。",
"xpack.serverlessSearch.apiKey.expiresHelpText": "此 API 密钥将于 {expirationDate}到期",
- "xpack.serverlessSearch.header.greeting.title": "{name}您好!",
- "xpack.serverlessSearch.ingestData.clientDocLink": "{languageName} API 参考",
- "xpack.serverlessSearch.installClient.clientDocLink": "{languageName} 客户端文档",
- "xpack.serverlessSearch.selectClient.description": "Elastic 以几种流行语言构建和维护客户端,我们的社区也做出了许多贡献。选择您常用的语言客户端或深入分析 {console} 以开始使用。",
- "xpack.serverlessSearch.apiCallout.content": "使用 Console,您可以直接调用 Elasticsearch 和 Kibana REST API,而无需安装语言客户端。",
- "xpack.serverlessSearch.apiCallOut.title": "通过 Console 调用 API",
"xpack.serverlessSearch.apiKey.apiKeyStepDescription": "此密钥仅显示一次,因此请将其保存到某个安全位置。我们不存储您的 API 密钥,因此,如果您丢失了密钥,则需要生成替代密钥。",
"xpack.serverlessSearch.apiKey.apiKeyStepTitle": "存储此 API 密钥",
"xpack.serverlessSearch.apiKey.description": "您需要这些唯一标识符才能安全连接到 Elasticsearch 项目。",
@@ -34787,8 +34771,6 @@
"xpack.serverlessSearch.apiKey.userFieldLabel": "用户",
"xpack.serverlessSearch.back": "返回",
"xpack.serverlessSearch.cancel": "取消",
- "xpack.serverlessSearch.codeBox.copyButtonLabel": "复制",
- "xpack.serverlessSearch.codeBox.selectAriaLabel": "选择编程语言",
"xpack.serverlessSearch.configureClient.advancedConfigLabel": "高级配置",
"xpack.serverlessSearch.configureClient.basicConfigLabel": "基本配置",
"xpack.serverlessSearch.configureClient.description": "使用唯一 API 密钥和云 ID 对客户端进行初始化",
@@ -34809,30 +34791,7 @@
"xpack.serverlessSearch.footer.searchUI.description": "搜索 UI 是一个由 Elastic 维护的免费开源 JavaScript 库,用于快速打造现代、富于吸引力的搜索体验。",
"xpack.serverlessSearch.footer.searchUI.title": "通过搜索 UI 构建用户界面",
"xpack.serverlessSearch.footer.title": "后续操作",
- "xpack.serverlessSearch.githubLink.curl.label": "curl",
- "xpack.serverlessSearch.githubLink.javascript.label": "Elasticsearch",
- "xpack.serverlessSearch.githubLink.ruby.label": "elasticsearch-ruby",
- "xpack.serverlessSearch.header.description": "设置您的编程语言客户端,采集一些数据,如此即可在数分钟内开始搜索。",
"xpack.serverlessSearch.header.title": "Elasticsearch 入门",
- "xpack.serverlessSearch.ingestData.beatsDescription": "用于 Elasticsearch 的轻量级、单一用途数据采集器。使用 Beats 从您的服务器发送运营数据。",
- "xpack.serverlessSearch.ingestData.beatsLink": "Beats",
- "xpack.serverlessSearch.ingestData.beatsTitle": "Beats",
- "xpack.serverlessSearch.ingestData.connectorsDescription": "用于将数据从第三方源同步到 Elasticsearch 的专用集成。使用 Elastic 连接器同步来自一系列数据库和对象存储的内容。",
- "xpack.serverlessSearch.ingestData.connectorsPythonLink": "connectors-python",
- "xpack.serverlessSearch.ingestData.connectorsTitle": "连接器客户端",
- "xpack.serverlessSearch.ingestData.description": "将数据添加到数据流或索引,使其可进行搜索。选择适合您的应用程序和工作流的集成方法。",
- "xpack.serverlessSearch.ingestData.ingestApiDescription": "最灵活的数据索引方法,允许您全面控制定制和优化选项。",
- "xpack.serverlessSearch.ingestData.ingestApiLabel": "通过 API 采集",
- "xpack.serverlessSearch.ingestData.ingestIntegrationDescription": "针对转换数据并将其传输到 Elasticsearch 而优化的专用采集工具。",
- "xpack.serverlessSearch.ingestData.ingestIntegrationLabel": "通过集成采集",
- "xpack.serverlessSearch.ingestData.ingestLegendLabel": "选择采集方法",
- "xpack.serverlessSearch.ingestData.integrationsLink": "关于集成",
- "xpack.serverlessSearch.ingestData.logstashDescription": "将数据添加到数据流或索引,使其可进行搜索。选择适合您的应用程序和工作流的集成方法。",
- "xpack.serverlessSearch.ingestData.logstashLink": "Logstash",
- "xpack.serverlessSearch.ingestData.logstashTitle": "Logstash",
- "xpack.serverlessSearch.ingestData.title": "采集数据",
- "xpack.serverlessSearch.installClient.description": "Elastic 以几种流行语言构建和维护客户端,我们的社区也做出了许多贡献。安装您常用的语言客户端以开始使用。",
- "xpack.serverlessSearch.installClient.title": "安装客户端",
"xpack.serverlessSearch.invalidJsonError": "JSON 无效",
"xpack.serverlessSearch.languages.cURL": "cURL",
"xpack.serverlessSearch.languages.javascript": "JavaScript/Node.js",
@@ -34850,17 +34809,8 @@
"xpack.serverlessSearch.required": "必需",
"xpack.serverlessSearch.searchQuery.description": "现在您已做好准备,可以开始体验搜索并对您的 Elasticsearch 数据执行聚合。",
"xpack.serverlessSearch.searchQuery.title": "构建您的首个搜索查询",
- "xpack.serverlessSearch.selectClient.apiRequestConsoleDocLink": "在 Console 中运行 API 请求 ",
- "xpack.serverlessSearch.selectClient.callout.description": "借助 Console,您可以立即开始使用我们的 REST API。无需进行安装。",
- "xpack.serverlessSearch.selectClient.callout.link": "立即试用 Console",
- "xpack.serverlessSearch.selectClient.callout.title": "立即在 Console 中试用",
- "xpack.serverlessSearch.selectClient.description.console.link": "控制台",
- "xpack.serverlessSearch.selectClient.elasticsearchClientDocLink": "Elasticsearch 客户端 ",
- "xpack.serverlessSearch.selectClient.heading": "选择一个",
- "xpack.serverlessSearch.selectClient.title": "选择客户端",
"xpack.serverlessSearch.testConnection.description": "发送测试请求,以确认您的语言客户端和 Elasticsearch 实例已启动并正在运行。",
"xpack.serverlessSearch.testConnection.title": "测试您的连接",
- "xpack.serverlessSearch.tryInConsoleButton": "在 Console 中试用",
"xpack.sessionView.alertFilteredCountStatusLabel": " 正在显示 {count} 个告警",
"xpack.sessionView.alertTotalCountStatusLabel": "正在显示 {count} 个告警",
"xpack.sessionView.processTree.loadMore": "显示 {pageSize} 个后续事件",
@@ -40452,4 +40402,4 @@
"xpack.painlessLab.walkthroughButtonLabel": "指导",
"xpack.serverlessObservability.nav.getStarted": "开始使用"
}
-}
\ No newline at end of file
+}
From 4c535a8f888f5fff08bd43cacdb8d46ee6a15821 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Efe=20G=C3=BCrkan=20YALAMAN?=
Date: Tue, 8 Aug 2023 21:01:44 +0200
Subject: [PATCH 06/17] Fix doclinks for clients
---
.../getting_started/getting_started.tsx | 196 ++++++++++++------
.../getting_started/languages/go.ts | 4 +-
.../getting_started/languages/javascript.ts | 5 +-
.../getting_started/languages/php.ts | 5 +-
.../getting_started/languages/python.ts | 4 +-
.../getting_started/languages/ruby.ts | 5 +-
.../product_selector/product_selector.tsx | 2 +-
.../plugins/enterprise_search/tsconfig.json | 1 +
8 files changed, 143 insertions(+), 79 deletions(-)
diff --git a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/components/getting_started/getting_started.tsx b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/components/getting_started/getting_started.tsx
index 045b126fa7d40..efe0964d13aff 100644
--- a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/components/getting_started/getting_started.tsx
+++ b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/components/getting_started/getting_started.tsx
@@ -16,6 +16,7 @@ import {
EuiFlexGroup,
EuiFlexItem,
EuiPanel,
+ EuiSpacer,
EuiSplitPanel,
EuiText,
EuiThemeProvider,
@@ -50,15 +51,17 @@ import { javascriptDefinition } from './languages/javascript';
import { languageDefinitions } from './languages/languages';
import { getCodeSnippet, showTryInConsole } from './languages/utils';
+const DEFAULT_URL = 'https://localhost:9200';
+
export const APIGettingStarted = () => {
const { http } = useValues(HttpLogic);
const { apiKey, isGenerateModalOpen } = useValues(OverviewLogic);
const { openGenerateModal, closeGenerateModal } = useActions(OverviewLogic);
const { indexName } = useValues(IndexViewLogic);
const { services } = useKibana();
+ const { isCloud } = useValues(KibanaLogic);
const cloudContext = useCloudDetails();
- const DEFAULT_URL = 'https://localhost:9200';
const codeArgs = {
apiKey,
@@ -73,7 +76,11 @@ export const APIGettingStarted = () => {
)}
- Getting Started with Elastic API
+
+ {i18n.translate('xpack.enterpriseSearch.content.overview.gettingStarted.pageTitle', {
+ defaultMessage: 'Getting Started with Elastic API',
+ })}
+
{
/>
-
- Generate an API key
+
+
+ {i18n.translate(
+ 'xpack.enterpriseSearch.content.overview.gettingStarted.generateApiKeyPanel.apiKeytitle',
+ {
+ defaultMessage: 'Generate an API key',
+ }
+ )}
+
+
- Your private, unique identifier for authentication and authorization.
+ {i18n.translate(
+ 'xpack.enterpriseSearch.content.overview.gettingStarted.generateApiKeyPanel.apiKeydesc',
+ {
+ defaultMessage:
+ 'Your private, unique identifier for authentication and authorization.',
+ }
+ )}
@@ -168,19 +193,58 @@ export const APIGettingStarted = () => {
}
links={[]}
- title={'Generate an API key'}
+ title={i18n.translate(
+ 'xpack.enterpriseSearch.content.overview.gettingStarted.generateApiKeyPanel.panelTitle',
+ {
+ defaultMessage: 'Generate an API key',
+ }
+ )}
overviewPanelProps={{ color: 'plain', hasShadow: false }}
/>
+
+
+ {isCloud
+ ? i18n.translate(
+ 'xpack.enterpriseSearch.content.overview.gettingStarted.cloudId.cloudTitle',
+ {
+ defaultMessage: 'Store your unique Cloud ID',
+ }
+ )
+ : i18n.translate(
+ 'xpack.enterpriseSearch.content.overview.gettingStarted.cloudId.elasticTitle',
+ {
+ defaultMessage: 'Store your elasticsearch URL',
+ }
+ )}
+
+
- {i18n.translate('xpack.enterpriseSearch.apiKey.stepTwoDescription', {
- defaultMessage: 'Unique identifier for specific project. ',
- })}
+ {i18n.translate(
+ 'xpack.enterpriseSearch.content.overview.gettingStarted.cloudId.desc',
+ {
+ defaultMessage: 'Unique identifier for your deployment. ',
+ }
+ )}
@@ -193,21 +257,38 @@ export const APIGettingStarted = () => {
overflow-wrap: anywhere;
`}
>
- {'cloudid'}
+ {codeArgs.url}
}
links={[]}
- title={'Copy your Cloud ID'}
+ title={
+ isCloud
+ ? i18n.translate(
+ 'xpack.enterpriseSearch.overview.gettingStarted.cloudId.panelTitleCloud',
+ {
+ defaultMessage: 'Copy your Cloud ID',
+ }
+ )
+ : i18n.translate(
+ 'xpack.enterpriseSearch.overview.gettingStarted.cloudId.panelTitleElastic',
+ {
+ defaultMessage: 'Copy your elasticsearch URL',
+ }
+ )
+ }
overviewPanelProps={{ color: 'plain', hasShadow: false }}
/>
{
sharePlugin={services.share}
/>
}
- links={[
- ...(selectedLanguage.basicConfig
- ? [
- {
- href: selectedLanguage.basicConfig,
- label: i18n.translate('xpack.enterpriseSearch.configureClient.basicConfigLabel', {
- defaultMessage: 'Basic configuration',
- }),
- },
- ]
- : []),
- ...(selectedLanguage.advancedConfig
- ? [
- {
- href: selectedLanguage.advancedConfig,
- label: i18n.translate(
- 'xpack.enterpriseSearch.configureClient.advancedConfigLabel',
- {
- defaultMessage: 'Advanced configuration',
- }
- ),
- },
- ]
- : []),
- ]}
- title={i18n.translate('xpack.enterpriseSearch.configureClient.title', {
- defaultMessage: 'Configure your client',
- })}
+ links={[]}
+ title={i18n.translate(
+ 'xpack.enterpriseSearch.overview.gettingStarted.configureClient.title',
+ {
+ defaultMessage: 'Configure your client',
+ }
+ )}
overviewPanelProps={{ color: 'plain', hasShadow: false }}
/>
{
/>
}
links={[]}
- title={i18n.translate('xpack.enterpriseSearch.testConnection.title', {
- defaultMessage: 'Test your connection',
- })}
+ title={i18n.translate(
+ 'xpack.enterpriseSearch.overview.gettingStarted.testConnection.title',
+ {
+ defaultMessage: 'Test your connection',
+ }
+ )}
overviewPanelProps={{ color: 'plain', hasShadow: false }}
/>
{
/>
}
links={[]}
- title={'Ingest Data'}
+ title={i18n.translate('xpack.enterpriseSearch.overview.gettingStarted.ingestData.title', {
+ defaultMessage: 'Ingest Data',
+ })}
overviewPanelProps={{ color: 'plain', hasShadow: false }}
/>
{
/>
}
links={[]}
- title={i18n.translate('xpack.enterpriseSearch.searchQuery.title', {
+ title={i18n.translate('xpack.enterpriseSearch.overview.gettingStarted.searchQuery.title', {
defaultMessage: 'Build your first search query',
})}
overviewPanelProps={{ color: 'plain', hasShadow: false }}
diff --git a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/components/getting_started/languages/go.ts b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/components/getting_started/languages/go.ts
index fa147e46905a6..cf32c3bbed76e 100644
--- a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/components/getting_started/languages/go.ts
+++ b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/components/getting_started/languages/go.ts
@@ -11,8 +11,6 @@ import { Languages, LanguageDefinition } from '@kbn/search-api-panels';
import { docLinks } from '../../../../../../shared/doc_links';
export const goDefinition: LanguageDefinition = {
- advancedConfig: docLinks.goAdvancedConfig,
- basicConfig: docLinks.goBasicConfig,
buildSearchQuery: `searchResp, err := es.Search().
Index("books").
Q("snow").
@@ -38,7 +36,7 @@ func main() {
log.Fatalf("Error creating the client: %s", err)
}
}`,
- docLink: docLinks.goClient,
+ docLink: docLinks.clientsGoIndex,
iconType: 'go.svg',
id: Languages.GO,
ingestData: `ingestResult, err := es.Bulk().
diff --git a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/components/getting_started/languages/javascript.ts b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/components/getting_started/languages/javascript.ts
index 573aebea2b940..fd3f4086a6e8e 100644
--- a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/components/getting_started/languages/javascript.ts
+++ b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/components/getting_started/languages/javascript.ts
@@ -11,9 +11,6 @@ import { Languages, LanguageDefinition } from '@kbn/search-api-panels';
import { docLinks } from '../../../../../../shared/doc_links';
export const javascriptDefinition: LanguageDefinition = {
- advancedConfig: docLinks.jsAdvancedConfig,
- apiReference: docLinks.jsApiReference,
- basicConfig: docLinks.jsBasicConfig,
buildSearchQuery: `// Let's search!
const searchResult = await client.search({
index: 'my-index-name',
@@ -29,7 +26,7 @@ auth: {
apiKey: '${apiKey}'
}
});`,
- docLink: docLinks.jsClient,
+ docLink: docLinks.clientsJsIntro,
iconType: 'javascript.svg',
id: Languages.JAVASCRIPT,
ingestData: `// Sample flight data
diff --git a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/components/getting_started/languages/php.ts b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/components/getting_started/languages/php.ts
index 2878b822475af..00c6b0f5a382c 100644
--- a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/components/getting_started/languages/php.ts
+++ b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/components/getting_started/languages/php.ts
@@ -12,10 +12,7 @@ import { docLinks } from '../../../../../../shared/doc_links';
import { INDEX_NAME_PLACEHOLDER } from './constants';
-
export const phpDefinition: LanguageDefinition = {
- advancedConfig: docLinks.phpAdvancedConfig,
- basicConfig: docLinks.phpBasicConfig,
buildSearchQuery: `$params = [
'index' => 'books',
'body' => [
@@ -29,7 +26,7 @@ print_r($response->asArray());`,
->setHosts(['${url}'])
->setApiKey('${apiKey}')
->build();`,
- docLink: docLinks.phpClient,
+ docLink: docLinks.clientsPhpOverview,
iconType: 'php.svg',
id: Languages.PHP,
ingestData: `$params = [
diff --git a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/components/getting_started/languages/python.ts b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/components/getting_started/languages/python.ts
index 56df9fdab9f65..e0f0defd801d3 100644
--- a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/components/getting_started/languages/python.ts
+++ b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/components/getting_started/languages/python.ts
@@ -13,8 +13,6 @@ import { docLinks } from '../../../../../../shared/doc_links';
import { INDEX_NAME_PLACEHOLDER } from './constants';
export const pythonDefinition: LanguageDefinition = {
- advancedConfig: docLinks.pythonAdvancedConfig,
- basicConfig: docLinks.pythonBasicConfig,
buildSearchQuery: `client.search(index="books", q="snow")`,
configureClient: ({ url, apiKey }) => `from elasticsearch import Elasticsearch
@@ -22,7 +20,7 @@ client = Elasticsearch(
"${url}",
api_key="${apiKey}"
)`,
- docLink: docLinks.pythonClient,
+ docLink: docLinks.clientsPythonOverview,
iconType: 'python.svg',
id: Languages.PYTHON,
ingestData: `documents = [
diff --git a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/components/getting_started/languages/ruby.ts b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/components/getting_started/languages/ruby.ts
index c580777982937..a30ba12bf205c 100644
--- a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/components/getting_started/languages/ruby.ts
+++ b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/components/getting_started/languages/ruby.ts
@@ -13,16 +13,13 @@ import { docLinks } from '../../../../../../shared/doc_links';
import { INDEX_NAME_PLACEHOLDER } from './constants';
export const rubyDefinition: LanguageDefinition = {
- advancedConfig: docLinks.rubyAdvancedConfig,
- apiReference: docLinks.rubyExamples,
buildSearchQuery: `client.search(index: 'books', q: 'snow')`,
configureClient: ({ url, apiKey }) => `client = ElasticsearchServerless::Client.new(
api_key: '${apiKey}',
url: '${url}'
)
`,
- basicConfig: docLinks.rubyBasicConfig,
- docLink: docLinks.rubyClient,
+ docLink: docLinks.clientsRubyOverview,
iconType: 'ruby.svg',
id: Languages.RUBY,
ingestData: `documents = [
diff --git a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_overview/components/product_selector/product_selector.tsx b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_overview/components/product_selector/product_selector.tsx
index a5559bae0005e..7c9ace4f3b15d 100644
--- a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_overview/components/product_selector/product_selector.tsx
+++ b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_overview/components/product_selector/product_selector.tsx
@@ -128,7 +128,7 @@ export const ProductSelector: React.FC = () => {
'xpack.enterpriseSearch.productSelector.overview.createCustom.description',
{
defaultMessage:
- 'Once your Elasticsearch index is created and populated, you are ready to get the full power of Elasticsearch and accelerate building search applications with plentiful out-of-the-box tools and multiple language clients, all backed by a robust and fully consumable set of APIs.',
+ 'Once your Elasticsearch index is created and populated, you are ready to get the full power of Elasticsearch and accelerate building search applications using plentiful out-of-the-box tools and multiple language clients, all backed by a robust and fully consumable set of APIs.',
}
)}
diff --git a/x-pack/plugins/enterprise_search/tsconfig.json b/x-pack/plugins/enterprise_search/tsconfig.json
index 39758cb511103..25cc264924d47 100644
--- a/x-pack/plugins/enterprise_search/tsconfig.json
+++ b/x-pack/plugins/enterprise_search/tsconfig.json
@@ -62,5 +62,6 @@
"@kbn/logs-shared-plugin",
"@kbn/share-plugin",
"@kbn/core-saved-objects-migration-server-internal",
+ "@kbn/search-api-panels",
]
}
From 8c94446c0b662b744fa46ac54873e932bcbcee8a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Efe=20G=C3=BCrkan=20YALAMAN?=
Date: Tue, 8 Aug 2023 22:32:03 +0200
Subject: [PATCH 07/17] DocLinks overhaul
---
.../components/select_client.tsx | 2 +-
.../getting_started/getting_started.tsx | 11 +-
.../getting_started/languages/console.ts | 6 -
.../getting_started/languages/curl.ts | 10 +-
.../getting_started/languages/go.ts | 38 +---
.../getting_started/languages/javascript.ts | 91 ++++-----
.../getting_started/languages/php.ts | 183 ++++++++----------
.../getting_started/languages/python.ts | 17 +-
.../getting_started/languages/ruby.ts | 20 +-
.../shared/doc_links/doc_links.ts | 6 +
10 files changed, 138 insertions(+), 246 deletions(-)
diff --git a/packages/kbn-search-api-panels/components/select_client.tsx b/packages/kbn-search-api-panels/components/select_client.tsx
index 1875b3f1b8ef0..1e9a3d294f760 100644
--- a/packages/kbn-search-api-panels/components/select_client.tsx
+++ b/packages/kbn-search-api-panels/components/select_client.tsx
@@ -25,7 +25,7 @@ import { OverviewPanel } from './overview_panel';
import './select_client.scss';
export interface SelectClientPanelProps {
- docLinks: any;
+ docLinks: { elasticsearchClients: string; kibanaRunApiInConsole: string };
http: HttpStart;
isPanelLeft?: boolean;
overviewPanelProps?: Partial;
diff --git a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/components/getting_started/getting_started.tsx b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/components/getting_started/getting_started.tsx
index efe0964d13aff..15d6108de4cd8 100644
--- a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/components/getting_started/getting_started.tsx
+++ b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/components/getting_started/getting_started.tsx
@@ -83,7 +83,10 @@ export const APIGettingStarted = () => {
{
rightPanelContent={
-
-
+
+
{isCloud
? i18n.translate(
'xpack.enterpriseSearch.content.overview.gettingStarted.cloudId.cloudTitle',
@@ -236,7 +239,7 @@ export const APIGettingStarted = () => {
defaultMessage: 'Store your elasticsearch URL',
}
)}
-
+
{i18n.translate(
diff --git a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/components/getting_started/languages/console.ts b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/components/getting_started/languages/console.ts
index 3d2a624b5788a..afb685441e89f 100644
--- a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/components/getting_started/languages/console.ts
+++ b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/components/getting_started/languages/console.ts
@@ -7,8 +7,6 @@
import { LanguageDefinition } from '@kbn/search-api-panels';
-import { INDEX_NAME_PLACEHOLDER } from './constants';
-
export const consoleDefinition: Partial = {
buildSearchQuery: `POST /books/_search?pretty
{
@@ -31,8 +29,4 @@ export const consoleDefinition: Partial = {
{"name": "Brave New World", "author": "Aldous Huxley", "release_date": "1932-06-01", "page_count": 268}
{ "index" : { "_index" : "books" } }
{"name": "The Handmaid's Tale", "author": "Margaret Atwood", "release_date": "1985-06-01", "page_count": 311}`,
- ingestDataIndex: ({ indexName }) => `POST _bulk?pretty
- { "index" : { "_index" : "${indexName ?? INDEX_NAME_PLACEHOLDER}" } }
- {"name": "foo", "title": "bar"}
-`,
};
diff --git a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/components/getting_started/languages/curl.ts b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/components/getting_started/languages/curl.ts
index 04240ebb44dff..607b85c7c6e7c 100644
--- a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/components/getting_started/languages/curl.ts
+++ b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/components/getting_started/languages/curl.ts
@@ -24,7 +24,7 @@ export const curlDefinition: LanguageDefinition = {
}'`,
configureClient: ({ apiKey, url }) => `export ES_URL="${url}"
export API_KEY="${apiKey}"`,
- docLink: docLinks.apiIntro,
+ docLink: docLinks.restApis,
iconType: 'curl.svg',
id: Languages.CURL,
ingestData: `curl -X POST "\$\{ES_URL\}/_bulk?pretty" \\
@@ -44,13 +44,7 @@ export API_KEY="${apiKey}"`,
{ "index" : { "_index" : "books" } }
{"name": "The Handmaid'"'"'s Tale", "author": "Margaret Atwood", "release_date": "1985-06-01", "page_count": 311}
'`,
- ingestDataIndex: ({ apiKey, url, indexName }) => `curl -X POST ${url}/_bulk?pretty \\
- -H "Authorization: ApiKey ${apiKey}" \\
- -H "Content-Type: application/json" \\
- -d'
-{ "index" : { "_index" : "${indexName ?? 'index_name'}" } }
-{"name": "foo", "title": "bar" }
-`,
+ ingestDataIndex: '',
installClient: `# if cURL is not already installed on your system
# then install it with the package manager of your choice
diff --git a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/components/getting_started/languages/go.ts b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/components/getting_started/languages/go.ts
index cf32c3bbed76e..d75841a9ba1db 100644
--- a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/components/getting_started/languages/go.ts
+++ b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/components/getting_started/languages/go.ts
@@ -57,41 +57,15 @@ func main() {
Do(context.Background())
fmt.Println(ingestResult, err)`,
- ingestDataIndex: ({ apiKey, url, indexName }) => `import (
- "context"
- "fmt"
- "log"
- "strings"
-
- "github.com/elastic/elasticsearch-serverless-go"
-)
-
-func main() {
- cfg := elasticsearch.Config{
- Address: "${url}",
- APIKey: "${apiKey}",
- }
- es, err := elasticsearch.NewClient(cfg)
- if err != nil {
- log.Fatalf("Error creating the client: %s", err)
- }
- res, err := es.Bulk().
- Index("${indexName}").
- Raw(strings.NewReader(\`
-{ "index": { "_id": "1"}}
-{"name": "foo", "title": "bar"}\n\`)).
- Do(context.Background())
-
- fmt.Println(res, err)
-}`,
- installClient: 'go get -u github.com/elastic/elasticsearch-serverless-go@latest',
+ ingestDataIndex: '',
+ installClient: 'go get github.com/elastic/go-elasticsearch/v8@latest',
name: i18n.translate('xpack.enterpriseSearch.languages.go', {
defaultMessage: 'Go',
}),
testConnection: `infores, err := es.Info().Do(context.Background())
-if err != nil {
- log.Fatalf("Error getting response: %s", err)
-}
+ if err != nil {
+ log.Fatalf("Error getting response: %s", err)
+ }
-fmt.Println(infores)`,
+ fmt.Println(infores)`,
};
diff --git a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/components/getting_started/languages/javascript.ts b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/components/getting_started/languages/javascript.ts
index fd3f4086a6e8e..033dc9b3169df 100644
--- a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/components/getting_started/languages/javascript.ts
+++ b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/components/getting_started/languages/javascript.ts
@@ -21,66 +21,43 @@ console.log(searchResult.hits.hits)
`,
configureClient: ({ url, apiKey }) => `const { Client } = require('@elastic/elasticsearch');
const client = new Client({
-node: '${url}',
-auth: {
- apiKey: '${apiKey}'
-}
+ node: '${url}',
+ auth: {
+ apiKey: '${apiKey}'
+ }
});`,
docLink: docLinks.clientsJsIntro,
iconType: 'javascript.svg',
id: Languages.JAVASCRIPT,
ingestData: `// Sample flight data
const dataset = [
-{'flight': '9HY9SWR', 'price': 841.2656419677076, 'delayed': false},
-{'flight': 'X98CCZO', 'price': 882.9826615595518, 'delayed': false},
-{'flight': 'UFK2WIZ', 'price': 190.6369038508356, 'delayed': true},
+ {'flight': '9HY9SWR', 'price': 841.2656419677076, 'delayed': false},
+ {'flight': 'X98CCZO', 'price': 882.9826615595518, 'delayed': false},
+ {'flight': 'UFK2WIZ', 'price': 190.6369038508356, 'delayed': true},
];
// Index with the bulk helper
const result = await client.helpers.bulk({
-datasource: dataset,
-onDocument (doc) {
- return { index: { _index: 'my-index-name' }};
-}
+ datasource: dataset,
+ onDocument (doc) {
+ return { index: { _index: 'my-index-name' }};
+ }
});
console.log(result);
/**
{
-total: 3,
-failed: 0,
-retry: 0,
-successful: 3,
-noop: 0,
-time: 421,
-bytes: 293,
-aborted: false
+ total: 3,
+ failed: 0,
+ retry: 0,
+ successful: 3,
+ noop: 0,
+ time: 421,
+ bytes: 293,
+ aborted: false
}
*/`,
- ingestDataIndex: ({
- apiKey,
- url,
- indexName,
- }) => `const { Client } = require('@elastic/elasticsearch');
-const client = new Client({
- node: '${url}',
- auth: {
- apiKey: '${apiKey}'
- }
-});
-const dataset = [
- {'name': 'foo', 'title': 'bar'},
-];
-
-// Index with the bulk helper
-const result = await client.helpers.bulk({
- datasource: dataset,
- onDocument (doc) {
- return { index: { _index: '${indexName ?? 'index_name'}' }};
- }
-});
-console.log(result);
-`,
+ ingestDataIndex: '',
installClient: 'npm install @elastic/elasticsearch@8',
name: i18n.translate('xpack.enterpriseSearch.languages.javascript', {
defaultMessage: 'JavaScript',
@@ -90,20 +67,20 @@ console.log(result);
console.log(resp);
/**
{
-name: 'instance-0000000000',
-cluster_name: 'd9dcd35d12fe46dfaa28ec813f65d57b',
-cluster_uuid: 'iln8jaivThSezhTkzp0Knw',
-version: {
- build_flavor: 'default',
- build_type: 'docker',
- build_hash: 'c94b4700cda13820dad5aa74fae6db185ca5c304',
- build_date: '2022-10-24T16:54:16.433628434Z',
- build_snapshot: false,
- lucene_version: '9.4.1',
- minimum_wire_compatibility_version: '7.17.0',
- minimum_index_compatibility_version: '7.0.0'
-},
-tagline: 'You Know, for Search'
+ name: 'instance-0000000000',
+ cluster_name: 'd9dcd35d12fe46dfaa28ec813f65d57b',
+ cluster_uuid: 'iln8jaivThSezhTkzp0Knw',
+ version: {
+ build_flavor: 'default',
+ build_type: 'docker',
+ build_hash: 'c94b4700cda13820dad5aa74fae6db185ca5c304',
+ build_date: '2022-10-24T16:54:16.433628434Z',
+ build_snapshot: false,
+ lucene_version: '9.4.1',
+ minimum_wire_compatibility_version: '7.17.0',
+ minimum_index_compatibility_version: '7.0.0'
+ },
+ tagline: 'You Know, for Search'
}
*/`,
};
diff --git a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/components/getting_started/languages/php.ts b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/components/getting_started/languages/php.ts
index 00c6b0f5a382c..6b1abcae27954 100644
--- a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/components/getting_started/languages/php.ts
+++ b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/components/getting_started/languages/php.ts
@@ -10,8 +10,6 @@ import { Languages, LanguageDefinition } from '@kbn/search-api-panels';
import { docLinks } from '../../../../../../shared/doc_links';
-import { INDEX_NAME_PLACEHOLDER } from './constants';
-
export const phpDefinition: LanguageDefinition = {
buildSearchQuery: `$params = [
'index' => 'books',
@@ -30,109 +28,86 @@ print_r($response->asArray());`,
iconType: 'php.svg',
id: Languages.PHP,
ingestData: `$params = [
-'body' => [
-[
-'index' => [
-'_index' => 'books',
-'_id' => '9780553351927',
-],
-],
-[
-'name' => 'Snow Crash',
-'author' => 'Neal Stephenson',
-'release_date' => '1992-06-01',
-'page_count' => 470,
-],
-[
-'index' => [
-'_index' => 'books',
-'_id' => '9780441017225',
-],
-],
-[
-'name' => 'Revelation Space',
-'author' => 'Alastair Reynolds',
-'release_date' => '2000-03-15',
-'page_count' => 585,
-],
-[
-'index' => [
-'_index' => 'books',
-'_id' => '9780451524935',
-],
-],
-[
-'name' => '1984',
-'author' => 'George Orwell',
-'release_date' => '1985-06-01',
-'page_count' => 328,
-],
-[
-'index' => [
-'_index' => 'books',
-'_id' => '9781451673319',
-],
-],
-[
-'name' => 'Fahrenheit 451',
-'author' => 'Ray Bradbury',
-'release_date' => '1953-10-15',
-'page_count' => 227,
-],
-[
-'index' => [
-'_index' => 'books',
-'_id' => '9780060850524',
-],
-],
-[
-'name' => 'Brave New World',
-'author' => 'Aldous Huxley',
-'release_date' => '1932-06-01',
-'page_count' => 268,
-],
-[
-'index' => [
-'_index' => 'books',
-'_id' => '9780385490818',
-],
-],
-[
-'name' => 'The Handmaid\'s Tale',
-'author' => 'Margaret Atwood',
-'release_date' => '1985-06-01',
-'page_count' => 311,
-],
-],
-];
-
-$response = $client->bulk($params);
-echo $response->getStatusCode();
-echo (string) $response->getBody();`,
- ingestDataIndex: ({ apiKey, url, indexName }) => `$client = ClientBuilder::create()
- ->setHosts(['${url}'])
- ->setApiKey('${apiKey}')
- ->build();
+ 'body' => [
+ [
+ 'index' => [
+ '_index' => 'books',
+ '_id' => '9780553351927',
+ ],
+ ],
+ [
+ 'name' => 'Snow Crash',
+ 'author' => 'Neal Stephenson',
+ 'release_date' => '1992-06-01',
+ 'page_count' => 470,
+ ],
+ [
+ 'index' => [
+ '_index' => 'books',
+ '_id' => '9780441017225',
+ ],
+ ],
+ [
+ 'name' => 'Revelation Space',
+ 'author' => 'Alastair Reynolds',
+ 'release_date' => '2000-03-15',
+ 'page_count' => 585,
+ ],
+ [
+ 'index' => [
+ '_index' => 'books',
+ '_id' => '9780451524935',
+ ],
+ ],
+ [
+ 'name' => '1984',
+ 'author' => 'George Orwell',
+ 'release_date' => '1985-06-01',
+ 'page_count' => 328,
+ ],
+ [
+ 'index' => [
+ '_index' => 'books',
+ '_id' => '9781451673319',
+ ],
+ ],
+ [
+ 'name' => 'Fahrenheit 451',
+ 'author' => 'Ray Bradbury',
+ 'release_date' => '1953-10-15',
+ 'page_count' => 227,
+ ],
+ [
+ 'index' => [
+ '_index' => 'books',
+ '_id' => '9780060850524',
+ ],
+ ],
+ [
+ 'name' => 'Brave New World',
+ 'author' => 'Aldous Huxley',
+ 'release_date' => '1932-06-01',
+ 'page_count' => 268,
+ ],
+ [
+ 'index' => [
+ '_index' => 'books',
+ '_id' => '9780385490818',
+ ],
+ ],
+ [
+ 'name' => 'The Handmaid\'s Tale',
+ 'author' => 'Margaret Atwood',
+ 'release_date' => '1985-06-01',
+ 'page_count' => 311,
+ ],
+ ],
+ ];
-$params = [
-'body' => [
-[
-'index' => [
-'_index' => '${indexName ?? INDEX_NAME_PLACEHOLDER}',
-'_id' => '1',
-],
-],
-[
-'name' => 'foo',
-'title' => 'bar',
-],
-],
-];
-
-$response = $client->bulk($params);
-echo $response->getStatusCode();
-echo (string) $response->getBody();
-`,
+ $response = $client->bulk($params);
+ echo $response->getStatusCode();
+ echo (string) $response->getBody();`,
+ ingestDataIndex: '',
installClient: 'composer require elasticsearch/elasticsearch',
name: i18n.translate('xpack.enterpriseSearch.languages.php', {
defaultMessage: 'PHP',
diff --git a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/components/getting_started/languages/python.ts b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/components/getting_started/languages/python.ts
index e0f0defd801d3..c9d5ba67b26e4 100644
--- a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/components/getting_started/languages/python.ts
+++ b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/components/getting_started/languages/python.ts
@@ -10,8 +10,6 @@ import { Languages, LanguageDefinition } from '@kbn/search-api-panels';
import { docLinks } from '../../../../../../shared/doc_links';
-import { INDEX_NAME_PLACEHOLDER } from './constants';
-
export const pythonDefinition: LanguageDefinition = {
buildSearchQuery: `client.search(index="books", q="snow")`,
configureClient: ({ url, apiKey }) => `from elasticsearch import Elasticsearch
@@ -39,20 +37,7 @@ client = Elasticsearch(
]
client.bulk(operations=documents)`,
- ingestDataIndex: ({ apiKey, url, indexName }) => `from elasticsearch import Elasticsearch
-
-client = Elasticsearch(
- "${url}",
- api_key="${apiKey}"
-)
-
-documents = [
- {"index": {"_index": "${indexName ?? INDEX_NAME_PLACEHOLDER}"}},
- {"name": "foo", "title": "bar"},
-]
-
-client.bulk(operations=documents)
-`,
+ ingestDataIndex: '',
installClient: `python -m pip install elasticsearch
# If your application uses async/await in Python you can install with the async extra
diff --git a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/components/getting_started/languages/ruby.ts b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/components/getting_started/languages/ruby.ts
index a30ba12bf205c..6706323c96772 100644
--- a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/components/getting_started/languages/ruby.ts
+++ b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/components/getting_started/languages/ruby.ts
@@ -10,8 +10,6 @@ import { Languages, LanguageDefinition } from '@kbn/search-api-panels';
import { docLinks } from '../../../../../../shared/doc_links';
-import { INDEX_NAME_PLACEHOLDER } from './constants';
-
export const rubyDefinition: LanguageDefinition = {
buildSearchQuery: `client.search(index: 'books', q: 'snow')`,
configureClient: ({ url, apiKey }) => `client = ElasticsearchServerless::Client.new(
@@ -31,22 +29,8 @@ export const rubyDefinition: LanguageDefinition = {
{ index: { _index: 'books', data: {name: "The Handmaid's Tale", "author": "Margaret Atwood", "release_date": "1985-06-01", "page_count": 311} } }
]
client.bulk(body: documents)`,
- ingestDataIndex: ({ apiKey, url, indexName }) => `client = ElasticsearchServerless::Client.new(
- api_key: '${apiKey}',
- url: '${url}'
-)
-
-documents = [
- { index: { _index: '${
- indexName ?? INDEX_NAME_PLACEHOLDER
- }', data: {name: "foo", "title": "bar"} } },
-]
-client.bulk(body: documents)
-`,
- installClient: `# Requires Ruby version 3.0 or higher
-
-# From the project's root directory:$ gem build elasticsearch-serverless.gemspec
-$ gem install elasticsearch-serverless-x.x.x.gem`,
+ ingestDataIndex: '',
+ installClient: `$ gem install elasticsearch -v x.x.x`,
name: i18n.translate('xpack.enterpriseSearch.languages.ruby', {
defaultMessage: 'Ruby',
}),
diff --git a/x-pack/plugins/enterprise_search/public/applications/shared/doc_links/doc_links.ts b/x-pack/plugins/enterprise_search/public/applications/shared/doc_links/doc_links.ts
index c61deecb811d0..1b3492e719792 100644
--- a/x-pack/plugins/enterprise_search/public/applications/shared/doc_links/doc_links.ts
+++ b/x-pack/plugins/enterprise_search/public/applications/shared/doc_links/doc_links.ts
@@ -82,6 +82,7 @@ class DocLinks {
public connectorsSharepoint: string;
public connectorsSharepointOnline: string;
public connectorsWorkplaceSearch: string;
+ public consoleGuide: string;
public crawlerExtractionRules: string;
public crawlerManaging: string;
public crawlerOverview: string;
@@ -114,6 +115,7 @@ class DocLinks {
public mlDocumentEnrichment: string;
public pluginsIngestAttachment: string;
public queryDsl: string;
+ public restApis: string;
public rrf: string;
public searchApplications: string;
public searchApplicationsSearch: string;
@@ -238,6 +240,7 @@ class DocLinks {
this.connectorsSharepoint = '';
this.connectorsSharepointOnline = '';
this.connectorsWorkplaceSearch = '';
+ this.consoleGuide = '';
this.crawlerExtractionRules = '';
this.crawlerManaging = '';
this.crawlerOverview = '';
@@ -270,6 +273,7 @@ class DocLinks {
this.mlDocumentEnrichment = '';
this.pluginsIngestAttachment = '';
this.queryDsl = '';
+ this.restApis = '';
this.rrf = '';
this.searchUIAppSearch = '';
this.searchUIElasticsearch = '';
@@ -396,6 +400,7 @@ class DocLinks {
this.connectorsSharepoint = docLinks.links.enterpriseSearch.connectorsSharepoint;
this.connectorsSharepointOnline = docLinks.links.enterpriseSearch.connectorsSharepointOnline;
this.connectorsWorkplaceSearch = docLinks.links.enterpriseSearch.connectorsWorkplaceSearch;
+ this.consoleGuide = docLinks.links.console.guide;
this.crawlerExtractionRules = docLinks.links.enterpriseSearch.crawlerExtractionRules;
this.crawlerManaging = docLinks.links.enterpriseSearch.crawlerManaging;
this.crawlerOverview = docLinks.links.enterpriseSearch.crawlerOverview;
@@ -428,6 +433,7 @@ class DocLinks {
this.mlDocumentEnrichment = docLinks.links.enterpriseSearch.mlDocumentEnrichment;
this.pluginsIngestAttachment = docLinks.links.plugins.ingestAttachment;
this.queryDsl = docLinks.links.query.queryDsl;
+ this.restApis = docLinks.links.apis.restApis;
this.rrf = docLinks.links.elasticsearch.rrf;
this.searchUIAppSearch = docLinks.links.searchUI.appSearch;
this.searchUIElasticsearch = docLinks.links.searchUI.elasticsearch;
From 4d9efb5ca4fbff12027c9e0df4ab5aa6a6203393 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Efe=20G=C3=BCrkan=20YALAMAN?=
Date: Wed, 9 Aug 2023 00:51:03 +0200
Subject: [PATCH 08/17] Overview overhaul
---
.../components/product_card/product_card.tsx | 67 ++++------------
.../app_search_product_card.tsx | 40 ++++++++++
.../behavioral_analytics_product_card.tsx | 32 ++------
.../elasticsearch_product_card.tsx | 76 ++-----------------
.../enterprise_search_product_card.tsx | 36 +++++++++
.../product_selector.test.tsx | 18 -----
.../product_selector/product_selector.tsx | 32 +-------
.../search_applications_product_card.tsx | 38 +++-------
.../workplace_search_product_card.tsx | 40 ++++++++++
.../translations/translations/fr-FR.json | 8 --
.../translations/translations/ja-JP.json | 8 --
.../translations/translations/zh-CN.json | 8 --
12 files changed, 161 insertions(+), 242 deletions(-)
create mode 100644 x-pack/plugins/enterprise_search/public/applications/enterprise_search_overview/components/product_selector/app_search_product_card.tsx
create mode 100644 x-pack/plugins/enterprise_search/public/applications/enterprise_search_overview/components/product_selector/enterprise_search_product_card.tsx
create mode 100644 x-pack/plugins/enterprise_search/public/applications/enterprise_search_overview/components/product_selector/workplace_search_product_card.tsx
diff --git a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_overview/components/product_card/product_card.tsx b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_overview/components/product_card/product_card.tsx
index 959992ca4b270..8e81d530e02bb 100644
--- a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_overview/components/product_card/product_card.tsx
+++ b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_overview/components/product_card/product_card.tsx
@@ -14,9 +14,6 @@ import {
EuiFlexGroup,
EuiFlexItem,
EuiIcon,
- EuiLink,
- EuiListGroup,
- EuiListGroupItem,
EuiPanel,
EuiSpacer,
EuiText,
@@ -25,30 +22,22 @@ import {
IconSize,
} from '@elastic/eui';
-import { i18n } from '@kbn/i18n';
-
import { EuiButtonTo, EuiButtonEmptyTo } from '../../../shared/react_router_helpers';
import { TelemetryLogic } from '../../../shared/telemetry';
import './product_card.scss';
-interface ProductResourceLink {
- label: string;
- to: string;
-}
-
export interface ProductCardProps {
cta?: string;
description: string;
emptyCta?: boolean;
- features: string[];
hasBorder?: boolean;
hasShadow?: boolean;
icon: IconType;
iconSize?: IconSize;
name: string;
productId: string;
- resourceLinks: ProductResourceLink[];
+ rightPanelItems?: React.ReactNode[];
url?: string;
}
@@ -56,14 +45,13 @@ export const ProductCard: React.FC = ({
cta,
description,
emptyCta = false,
- features,
hasBorder,
hasShadow,
icon,
iconSize,
productId,
+ rightPanelItems,
name,
- resourceLinks,
url,
}) => {
const { sendEnterpriseSearchTelemetry } = useActions(TelemetryLogic);
@@ -86,8 +74,8 @@ export const ProductCard: React.FC = ({
- {description}
-
+ {description}{' '}
+ {' '}
{cta && url && (
@@ -122,42 +110,19 @@ export const ProductCard: React.FC
= ({
)}
-
-
- {features.map((item: string, index: number) => (
- }
- />
- ))}
-
-
-
-
-
- {i18n.translate('xpack.enterpriseSearch.productCard.resourcesTitle', {
- defaultMessage: 'Resources',
+ {rightPanelItems ? (
+
+
+ {rightPanelItems.map((rightPanelItem) => {
+ return {rightPanelItem} ;
})}
-
-
-
-
- {resourceLinks.map((resource, index) => (
-
-
- {resource.label}
-
-
- ))}
-
-
+
+
+ ) : null}
);
diff --git a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_overview/components/product_selector/app_search_product_card.tsx b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_overview/components/product_selector/app_search_product_card.tsx
new file mode 100644
index 0000000000000..f8dac98f048ad
--- /dev/null
+++ b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_overview/components/product_selector/app_search_product_card.tsx
@@ -0,0 +1,40 @@
+/*
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
+ * or more contributor license agreements. Licensed under the Elastic License
+ * 2.0; you may not use this file except in compliance with the Elastic License
+ * 2.0.
+ */
+
+import React from 'react';
+
+import { i18n } from '@kbn/i18n';
+
+import { APP_SEARCH_PLUGIN } from '../../../../../common/constants';
+import { ProductCard } from '../product_card';
+
+export interface AppSearchProductCardProps {
+ hasBorder: boolean;
+ hasShadow: boolean;
+}
+
+export const AppSearchProductCard: React.FC = ({
+ hasBorder = true,
+ hasShadow = true,
+}) => (
+
+);
diff --git a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_overview/components/product_selector/behavioral_analytics_product_card.tsx b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_overview/components/product_selector/behavioral_analytics_product_card.tsx
index 52d5f1ab3d5d6..31761b2e88502 100644
--- a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_overview/components/product_selector/behavioral_analytics_product_card.tsx
+++ b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_overview/components/product_selector/behavioral_analytics_product_card.tsx
@@ -10,12 +10,18 @@ import React from 'react';
import { i18n } from '@kbn/i18n';
import { ANALYTICS_PLUGIN } from '../../../../../common/constants';
-import { docLinks } from '../../../shared/doc_links';
import baLogo from '../../assets/behavioral_analytics_logo.svg';
import { ProductCard } from '../product_card';
-export const BehavioralAnalyticsProductCard = () => (
+export interface BehavioralAnalyticsProductCard {
+ hasBorder: boolean;
+ hasShadow: boolean;
+}
+
+export const BehavioralAnalyticsProductCard = ({ hasBorder = true, hasShadow = true }) => (
(
'Dashboards and tools for visualizing end-user behavior and measuring the performance of your search applications',
})}
emptyCta
- features={[
- i18n.translate('xpack.enterpriseSearch.behavioralAnalytics.features.tracking', {
- defaultMessage: "Track users' searching and clicking behavior",
- }),
- i18n.translate('xpack.enterpriseSearch.behavioralAnalytics.features.dashboard', {
- defaultMessage: 'Search management dashboards',
- }),
- i18n.translate('xpack.enterpriseSearch.behavioralAnalytics.features.contentGaps', {
- defaultMessage: 'Identify gaps in your content',
- }),
- ]}
icon={baLogo}
iconSize="l"
name={ANALYTICS_PLUGIN.NAME}
productId={ANALYTICS_PLUGIN.ID}
- resourceLinks={[
- {
- label: i18n.translate(
- 'xpack.enterpriseSearch.behavioralAnalytics.resources.gettingStartedLabel',
- {
- defaultMessage: 'Getting started with Behavioral Analytics',
- }
- ),
- to: docLinks.behavioralAnalytics,
- },
- ]}
url={ANALYTICS_PLUGIN.URL}
/>
);
diff --git a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_overview/components/product_selector/elasticsearch_product_card.tsx b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_overview/components/product_selector/elasticsearch_product_card.tsx
index 70d5f2765b4cc..3c0609bcf5788 100644
--- a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_overview/components/product_selector/elasticsearch_product_card.tsx
+++ b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_overview/components/product_selector/elasticsearch_product_card.tsx
@@ -7,17 +7,15 @@
import React from 'react';
-import { useValues } from 'kea';
-
import { i18n } from '@kbn/i18n';
-import { ELASTICSEARCH_PLUGIN, SEARCH_EXPERIENCES_PLUGIN } from '../../../../../common/constants';
-import { docLinks } from '../../../shared/doc_links';
-import { HttpLogic } from '../../../shared/http';
+import { ELASTICSEARCH_PLUGIN } from '../../../../../common/constants';
import { ProductCard } from '../product_card';
+import { BehavioralAnalyticsProductCard } from './behavioral_analytics_product_card';
+import { SearchApplicationsProductCard } from './search_applications_product_card';
+
export const ElasticsearchProductCard = () => {
- const { http } = useValues(HttpLogic);
return (
{
defaultMessage:
'Ideal for bespoke applications, Elasticsearch helps you build highly customizable search and offers many different ingestion methods.',
})}
- features={[
- i18n.translate('xpack.enterpriseSearch.elasticsearch.features.integrate', {
- defaultMessage: 'Integrate with databases, websites, and more',
- }),
- i18n.translate('xpack.enterpriseSearch.elasticsearch.features.buildTooling', {
- defaultMessage: 'Build custom tooling',
- }),
- i18n.translate('xpack.enterpriseSearch.elasticsearch.features.buildSearchExperiences', {
- defaultMessage: 'Build custom search experiences',
- }),
- i18n.translate('xpack.enterpriseSearch.elasticsearch.features.esre', {
- defaultMessage: 'The Elasticsearch Relevance Engine™ (ESRE)',
- }),
- ]}
icon="logoElasticsearch"
name={ELASTICSEARCH_PLUGIN.NAME}
productId={ELASTICSEARCH_PLUGIN.ID}
- resourceLinks={[
- {
- label: i18n.translate(
- 'xpack.enterpriseSearch.elasticsearch.resources.gettingStartedLabel',
- {
- defaultMessage: 'Getting started with Elasticsearch',
- }
- ),
- to: docLinks.start,
- },
- {
- label: i18n.translate(
- 'xpack.enterpriseSearch.elasticsearch.resources.createNewIndexLabel',
- {
- defaultMessage: 'Create a new index',
- }
- ),
- to: docLinks.start,
- },
- {
- label: i18n.translate(
- 'xpack.enterpriseSearch.elasticsearch.resources.languageClientLabel',
- {
- defaultMessage: 'Set up a language client',
- }
- ),
- to: docLinks.languageClients,
- },
- {
- label: i18n.translate('xpack.enterpriseSearch.elasticsearch.resources.searchUILabel', {
- defaultMessage: 'Search UI for Elasticsearch',
- }),
- to: docLinks.searchUIElasticsearch,
- },
- {
- label: i18n.translate('xpack.enterpriseSearch.elasticsearch.resources.elserLabel', {
- defaultMessage: 'ELSER text expansion',
- }),
- to: docLinks.elser,
- },
- {
- label: i18n.translate(
- 'xpack.enterpriseSearch.elasticsearch.resources.searchExperiencesLabel',
- {
- defaultMessage: 'Search Experiences',
- }
- ),
- to: http.basePath.prepend(SEARCH_EXPERIENCES_PLUGIN.URL),
- },
+ rightPanelItems={[
+ ,
+ ,
]}
/>
);
diff --git a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_overview/components/product_selector/enterprise_search_product_card.tsx b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_overview/components/product_selector/enterprise_search_product_card.tsx
new file mode 100644
index 0000000000000..b53203aade931
--- /dev/null
+++ b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_overview/components/product_selector/enterprise_search_product_card.tsx
@@ -0,0 +1,36 @@
+/*
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
+ * or more contributor license agreements. Licensed under the Elastic License
+ * 2.0; you may not use this file except in compliance with the Elastic License
+ * 2.0.
+ */
+
+import React from 'react';
+
+import { i18n } from '@kbn/i18n';
+
+import {
+ ENTERPRISE_SEARCH_PRODUCT_NAME,
+ ENTERPRISE_SEARCH_CONTENT_PLUGIN,
+} from '../../../../../common/constants';
+import { ProductCard } from '../product_card';
+
+import { AppSearchProductCard } from './app_search_product_card';
+import { WorkplaceSearchProductCard } from './workplace_search_product_card';
+
+export const EnterpriseSearchProductCard = () => (
+ ,
+ ,
+ ]}
+ />
+);
diff --git a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_overview/components/product_selector/product_selector.test.tsx b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_overview/components/product_selector/product_selector.test.tsx
index a1b2b80618c3f..6d29c73077a78 100644
--- a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_overview/components/product_selector/product_selector.test.tsx
+++ b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_overview/components/product_selector/product_selector.test.tsx
@@ -11,7 +11,6 @@ import React from 'react';
import { shallow } from 'enzyme';
-import { AddContentEmptyPrompt } from '../../../shared/add_content_empty_prompt';
import { ErrorStateCallout } from '../../../shared/error_state';
import { SetupGuideCta } from '../setup_guide';
@@ -58,23 +57,6 @@ describe('ProductSelector', () => {
expect(wrapper.find(ErrorStateCallout)).toHaveLength(1);
});
- it('renders add content', () => {
- setMockValues({ config: { canDeployEntSearch: true, host: 'localhost' } });
- const wrapper = shallow( );
-
- expect(wrapper.find(AddContentEmptyPrompt)).toHaveLength(1);
- });
-
- it('does not render add content when theres a connection error', () => {
- setMockValues({
- config: { canDeployEntSearch: true, host: 'localhost' },
- errorConnectingMessage: '502 Bad Gateway',
- });
- const wrapper = shallow( );
-
- expect(wrapper.find(AddContentEmptyPrompt)).toHaveLength(0);
- });
-
describe('access checks when host is set', () => {
beforeEach(() => {
setMockValues({ config: { canDeployEntSearch: true, host: 'localhost' } });
diff --git a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_overview/components/product_selector/product_selector.tsx b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_overview/components/product_selector/product_selector.tsx
index 7c9ace4f3b15d..25d0947370e2a 100644
--- a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_overview/components/product_selector/product_selector.tsx
+++ b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_overview/components/product_selector/product_selector.tsx
@@ -21,7 +21,6 @@ import { Chat } from '@kbn/cloud-chat-plugin/public';
import { i18n } from '@kbn/i18n';
import { WelcomeBanner } from '@kbn/search-api-panels';
-import { AddContentEmptyPrompt } from '../../../shared/add_content_empty_prompt';
import { ErrorStateCallout } from '../../../shared/error_state';
import { HttpLogic } from '../../../shared/http';
import { KibanaLogic } from '../../../shared/kibana';
@@ -34,10 +33,9 @@ import { EnterpriseSearchOverviewPageTemplate } from '../layout';
import { SetupGuideCta } from '../setup_guide';
import { TrialCallout } from '../trial_callout';
-import { BehavioralAnalyticsProductCard } from './behavioral_analytics_product_card';
import { ElasticsearchProductCard } from './elasticsearch_product_card';
+import { EnterpriseSearchProductCard } from './enterprise_search_product_card';
import { IngestionSelector } from './ingestion_selector';
-import { SearchApplicationsProductCard } from './search_applications_product_card';
import './product_selector.scss';
@@ -48,11 +46,10 @@ export const ProductSelector: React.FC = () => {
const showErrorConnecting = !!(config.host && errorConnectingMessage);
// The create index flow does not work without ent-search, when content is updated
// to no longer rely on ent-search we can always show the Add Content component
- const showAddContent = false && config.host && !errorConnectingMessage;
return (
<>
-
+
@@ -65,7 +62,6 @@ export const ProductSelector: React.FC = () => {
/>
-
@@ -87,25 +83,6 @@ export const ProductSelector: React.FC = () => {
- {showAddContent && (
- <>
-
-
- >
- )}
{showErrorConnecting && (
<>
@@ -141,10 +118,7 @@ export const ProductSelector: React.FC = () => {
-
-
-
-
+
{!config.host && config.canDeployEntSearch && (
diff --git a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_overview/components/product_selector/search_applications_product_card.tsx b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_overview/components/product_selector/search_applications_product_card.tsx
index e85645445449a..582387697d426 100644
--- a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_overview/components/product_selector/search_applications_product_card.tsx
+++ b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_overview/components/product_selector/search_applications_product_card.tsx
@@ -10,12 +10,21 @@ import React from 'react';
import { i18n } from '@kbn/i18n';
import { APPLICATIONS_PLUGIN } from '../../../../../common/constants';
-import { docLinks } from '../../../shared/doc_links';
import searchAppLogo from '../../assets/search_applications_logo.svg';
import { ProductCard } from '../product_card';
-export const SearchApplicationsProductCard = () => (
+export interface SearchApplicationProductCardProps {
+ hasBorder: boolean;
+ hasShadow: boolean;
+}
+
+export const SearchApplicationsProductCard: React.FC = ({
+ hasBorder = true,
+ hasShadow = true,
+}) => (
(
'Search Applications help make your Elasticsearch data easily searchable for end users',
})}
emptyCta
- features={[
- i18n.translate('xpack.enterpriseSearch.searchApplications.features.queries', {
- defaultMessage: 'Build queries using search templates and DLS',
- }),
- i18n.translate('xpack.enterpriseSearch.searchApplications.features.indices', {
- defaultMessage: 'Combine your Elasticsearch indices',
- }),
- i18n.translate('xpack.enterpriseSearch.searchApplications.features.docsExplorer', {
- defaultMessage: 'Easily preview your search results',
- }),
- i18n.translate('xpack.enterpriseSearch.searchApplications.features.api', {
- defaultMessage: 'Elasticsearch Search Application API',
- }),
- ]}
icon={searchAppLogo}
iconSize="l"
name={APPLICATIONS_PLUGIN.NAV_TITLE}
productId={APPLICATIONS_PLUGIN.ID}
- resourceLinks={[
- {
- label: i18n.translate(
- 'xpack.enterpriseSearch.searchApplications.resources.gettingStartedLabel',
- {
- defaultMessage: 'Getting started with Search Applications',
- }
- ),
- to: docLinks.searchApplications,
- },
- ]}
url={APPLICATIONS_PLUGIN.URL}
/>
);
diff --git a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_overview/components/product_selector/workplace_search_product_card.tsx b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_overview/components/product_selector/workplace_search_product_card.tsx
new file mode 100644
index 0000000000000..6139d7a2f2b2c
--- /dev/null
+++ b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_overview/components/product_selector/workplace_search_product_card.tsx
@@ -0,0 +1,40 @@
+/*
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
+ * or more contributor license agreements. Licensed under the Elastic License
+ * 2.0; you may not use this file except in compliance with the Elastic License
+ * 2.0.
+ */
+
+import React from 'react';
+
+import { i18n } from '@kbn/i18n';
+
+import { WORKPLACE_SEARCH_PLUGIN } from '../../../../../common/constants';
+import { ProductCard } from '../product_card';
+
+export interface WorkplaceSearchProductCardProps {
+ hasBorder: boolean;
+ hasShadow: boolean;
+}
+
+export const WorkplaceSearchProductCard: React.FC = ({
+ hasBorder = true,
+ hasShadow = true,
+}) => (
+
+);
diff --git a/x-pack/plugins/translations/translations/fr-FR.json b/x-pack/plugins/translations/translations/fr-FR.json
index 152514e314bf2..d051f831ec6ab 100644
--- a/x-pack/plugins/translations/translations/fr-FR.json
+++ b/x-pack/plugins/translations/translations/fr-FR.json
@@ -14161,16 +14161,9 @@
"xpack.enterpriseSearch.curations.settings.licenseUpgradeLink": "En savoir plus sur les mises à niveau incluses dans la licence",
"xpack.enterpriseSearch.curations.settings.start30DayTrialButtonLabel": "Démarrer un essai gratuit de 30 jours",
"xpack.enterpriseSearch.descriptionLabel": "Description",
- "xpack.enterpriseSearch.elasticsearch.features.buildSearchExperiences": "Créer des expériences de recherche personnalisées",
- "xpack.enterpriseSearch.elasticsearch.features.buildTooling": "Créer des outils personnalisés",
- "xpack.enterpriseSearch.elasticsearch.features.integrate": "Intégrer à des bases de données, des sites web, etc.",
"xpack.enterpriseSearch.elasticsearch.productCardDescription": "Idéal pour les applications sur mesure, Elasticsearch vous aide à créer des recherches hautement personnalisables et offre de nombreuses méthodes d'ingestion différentes.",
"xpack.enterpriseSearch.elasticsearch.productDescription": "Outils de bas niveau pour la création d'expériences performantes et pertinentes.",
"xpack.enterpriseSearch.elasticsearch.productName": "Elasticsearch",
- "xpack.enterpriseSearch.elasticsearch.resources.createNewIndexLabel": "Créer un nouvel index",
- "xpack.enterpriseSearch.elasticsearch.resources.gettingStartedLabel": "Prise en main d'Elasticsearch",
- "xpack.enterpriseSearch.elasticsearch.resources.languageClientLabel": "Configurer un client de langage",
- "xpack.enterpriseSearch.elasticsearch.resources.searchUILabel": "Search UI pour Elasticsearch",
"xpack.enterpriseSearch.emailLabel": "E-mail",
"xpack.enterpriseSearch.emptyState.description": "Votre contenu est stocké dans un index Elasticsearch. Commencez par créer un index Elasticsearch et sélectionnez une méthode d'ingestion. Les options comprennent le robot d'indexation Elastic, les intégrations de données tierces ou l'utilisation des points de terminaison d'API Elasticsearch.",
"xpack.enterpriseSearch.emptyState.description.line2": "Qu’il s’agisse de créer une expérience de recherche avec App Search ou Elasticsearch, vous pouvez commencer ici.",
@@ -14433,7 +14426,6 @@
"xpack.enterpriseSearch.overview.searchIndices.image.altText": "Illustration d'index de recherche",
"xpack.enterpriseSearch.overview.setupCta.description": "Ajoutez des fonctions de recherche à votre application ou à votre organisation interne avec Elastic App Search et Workplace Search. Regardez la vidéo pour savoir ce qu'il est possible de faire lorsque la recherche est facilitée.",
"xpack.enterpriseSearch.passwordLabel": "Mot de passe",
- "xpack.enterpriseSearch.productCard.resourcesTitle": "Ressources",
"xpack.enterpriseSearch.productSelectorCalloutTitle": "Mettez à niveau pour obtenir des fonctionnalités de niveau entreprise pour votre équipe",
"xpack.enterpriseSearch.readOnlyMode.warning": "Enterprise Search est en mode de lecture seule. Vous ne pourrez pas effectuer de changements tels que création, modification ou suppression.",
"xpack.enterpriseSearch.roleMapping.addRoleMappingButtonLabel": "Ajouter un mapping",
diff --git a/x-pack/plugins/translations/translations/ja-JP.json b/x-pack/plugins/translations/translations/ja-JP.json
index 1c5dcabfa5292..48c2af601467c 100644
--- a/x-pack/plugins/translations/translations/ja-JP.json
+++ b/x-pack/plugins/translations/translations/ja-JP.json
@@ -14175,16 +14175,9 @@
"xpack.enterpriseSearch.curations.settings.licenseUpgradeLink": "ライセンスアップグレードの詳細",
"xpack.enterpriseSearch.curations.settings.start30DayTrialButtonLabel": "30 日間のトライアルの開始",
"xpack.enterpriseSearch.descriptionLabel": "説明",
- "xpack.enterpriseSearch.elasticsearch.features.buildSearchExperiences": "カスタム検索エクスペリエンスを構築",
- "xpack.enterpriseSearch.elasticsearch.features.buildTooling": "カスタムツールを作成",
- "xpack.enterpriseSearch.elasticsearch.features.integrate": "データベース、Webサイトなどを統合",
"xpack.enterpriseSearch.elasticsearch.productCardDescription": "カスタムアプリケーションに最適なElasticsearchでは、非常にカスタマイズ性の高い検索を構築し、多数の異なるインジェスチョン方法を利用できます。",
"xpack.enterpriseSearch.elasticsearch.productDescription": "高パフォーマンスで関連性の高い検索エクスペリエンスを作成するための低レベルのツール。",
"xpack.enterpriseSearch.elasticsearch.productName": "Elasticsearch",
- "xpack.enterpriseSearch.elasticsearch.resources.createNewIndexLabel": "新しいインデックスを作成",
- "xpack.enterpriseSearch.elasticsearch.resources.gettingStartedLabel": "Elasticsearchを使い始める",
- "xpack.enterpriseSearch.elasticsearch.resources.languageClientLabel": "言語クライアントのセットアップ",
- "xpack.enterpriseSearch.elasticsearch.resources.searchUILabel": "ElasticsearchのUIを検索",
"xpack.enterpriseSearch.emailLabel": "メール",
"xpack.enterpriseSearch.emptyState.description": "コンテンツはElasticsearchインデックスに保存されます。まず、Elasticsearchインデックスを作成し、インジェスチョン方法を選択します。オプションには、Elastic Webクローラー、サードパーティデータ統合、Elasticsearch APIエンドポイントの使用があります。",
"xpack.enterpriseSearch.emptyState.description.line2": "App SearchまたはElasticsearchのどちらで検索エクスペリエンスを構築しても、これが最初のステップです。",
@@ -14447,7 +14440,6 @@
"xpack.enterpriseSearch.overview.searchIndices.image.altText": "検索インデックスの例",
"xpack.enterpriseSearch.overview.setupCta.description": "Elastic App Search および Workplace Search を使用して、アプリまたは社内組織に検索を追加できます。検索が簡単になるとどのような利点があるのかについては、動画をご覧ください。",
"xpack.enterpriseSearch.passwordLabel": "パスワード",
- "xpack.enterpriseSearch.productCard.resourcesTitle": "リソース",
"xpack.enterpriseSearch.productSelectorCalloutTitle": "チームのためのエンタープライズレベルの機能を実現できるようにアップグレード",
"xpack.enterpriseSearch.readOnlyMode.warning": "エンタープライズ サーチは読み取り専用モードです。作成、編集、削除などの変更を実行できません。",
"xpack.enterpriseSearch.roleMapping.addRoleMappingButtonLabel": "マッピングを追加",
diff --git a/x-pack/plugins/translations/translations/zh-CN.json b/x-pack/plugins/translations/translations/zh-CN.json
index 9fe7f8e5a4a85..55da576f10230 100644
--- a/x-pack/plugins/translations/translations/zh-CN.json
+++ b/x-pack/plugins/translations/translations/zh-CN.json
@@ -14175,16 +14175,9 @@
"xpack.enterpriseSearch.curations.settings.licenseUpgradeLink": "详细了解许可证升级",
"xpack.enterpriseSearch.curations.settings.start30DayTrialButtonLabel": "开始为期 30 天的试用",
"xpack.enterpriseSearch.descriptionLabel": "描述",
- "xpack.enterpriseSearch.elasticsearch.features.buildSearchExperiences": "构建定制搜索体验",
- "xpack.enterpriseSearch.elasticsearch.features.buildTooling": "构建定制工具",
- "xpack.enterpriseSearch.elasticsearch.features.integrate": "集成数据库、网站等",
"xpack.enterpriseSearch.elasticsearch.productCardDescription": "适用于专门定制的应用程序,Elasticsearch 将帮助您构建高度可定制的搜索,并提供许多不同的采集方法。",
"xpack.enterpriseSearch.elasticsearch.productDescription": "用于打造高效、相关的搜索体验的低级工具。",
"xpack.enterpriseSearch.elasticsearch.productName": "Elasticsearch",
- "xpack.enterpriseSearch.elasticsearch.resources.createNewIndexLabel": "创建新索引",
- "xpack.enterpriseSearch.elasticsearch.resources.gettingStartedLabel": "Elasticsearch 入门",
- "xpack.enterpriseSearch.elasticsearch.resources.languageClientLabel": "设置语言客户端",
- "xpack.enterpriseSearch.elasticsearch.resources.searchUILabel": "Elasticsearch 的搜索 UI",
"xpack.enterpriseSearch.emailLabel": "电子邮件",
"xpack.enterpriseSearch.emptyState.description": "您的内容存储在 Elasticsearch 索引中。通过创建 Elasticsearch 索引并选择采集方法开始使用。选项包括 Elastic 网络爬虫、第三方数据集成或使用 Elasticsearch API 终端。",
"xpack.enterpriseSearch.emptyState.description.line2": "无论是使用 App Search 还是 Elasticsearch 构建搜索体验,您都可以从此处立即开始。",
@@ -14447,7 +14440,6 @@
"xpack.enterpriseSearch.overview.searchIndices.image.altText": "搜索索引图示",
"xpack.enterpriseSearch.overview.setupCta.description": "通过 Elastic App Search 和 Workplace Search,将搜索添加到您的应用或内部组织中。观看视频,了解方便易用的搜索功能可以帮您做些什么。",
"xpack.enterpriseSearch.passwordLabel": "密码",
- "xpack.enterpriseSearch.productCard.resourcesTitle": "资源",
"xpack.enterpriseSearch.productSelectorCalloutTitle": "进行升级以便为您的团队获取企业级功能",
"xpack.enterpriseSearch.readOnlyMode.warning": "企业搜索处于只读模式。您将无法执行更改,例如创建、编辑或删除。",
"xpack.enterpriseSearch.roleMapping.addRoleMappingButtonLabel": "添加映射",
From c471fbd425e06058c2593947f0f146950b946360 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Efe=20G=C3=BCrkan=20YALAMAN?=
Date: Wed, 9 Aug 2023 01:44:57 +0200
Subject: [PATCH 09/17] Fix tests
---
.../__mocks__/kea_logic/kibana_logic.mock.ts | 1 +
.../product_card/product_card.test.tsx | 40 +++++++++++--------
.../components/product_card/product_card.tsx | 2 +-
.../product_selector.test.tsx | 9 ++---
.../public/applications/index.test.tsx | 1 +
5 files changed, 30 insertions(+), 23 deletions(-)
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 d9413b7a4e66c..9861c90608ce2 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
@@ -61,6 +61,7 @@ export const mockKibanaValues = {
setDocTitle: jest.fn(),
share: sharePluginMock.createStartContract(),
uiSettings: uiSettingsServiceMock.createStartContract(),
+ userProfile: {},
};
jest.mock('../../shared/kibana', () => ({
diff --git a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_overview/components/product_card/product_card.test.tsx b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_overview/components/product_card/product_card.test.tsx
index acac9b2df20de..349b5cb0a935c 100644
--- a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_overview/components/product_card/product_card.test.tsx
+++ b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_overview/components/product_card/product_card.test.tsx
@@ -13,7 +13,7 @@ import { shallow } from 'enzyme';
import { snakeCase } from 'lodash';
-import { EuiListGroup, EuiPanel } from '@elastic/eui';
+import { EuiPanel } from '@elastic/eui';
import { EuiButtonTo, EuiButtonEmptyTo } from '../../../shared/react_router_helpers';
@@ -22,20 +22,10 @@ import { ProductCard, ProductCardProps } from './product_card';
const MOCK_VALUES: ProductCardProps = {
cta: 'Click me',
description: 'Mock description',
- features: ['first feature', 'second feature'],
icon: 'logoElasticsearch',
name: 'Mock product',
productId: 'mockProduct',
- resourceLinks: [
- {
- label: 'Link one',
- to: 'https://www.elastic.co/guide/one',
- },
- {
- label: 'Link twwo',
- to: 'https://www.elastic.co/guide/two',
- },
- ],
+ rightPanelItems: [
,
],
url: '/app/mock_app',
};
@@ -49,10 +39,8 @@ describe('ProductCard', () => {
const card = wrapper.find(EuiPanel);
expect(card.find('h3').text()).toEqual(MOCK_VALUES.name);
- expect(card.find(EuiListGroup).children()).toHaveLength(MOCK_VALUES.features.length);
- expect(card.find('[data-test-subj="productCard-resources"]').text()).toEqual('Resources');
- expect(card.find('[data-test-subj="productCard-resourceLinks"]').children()).toHaveLength(
- MOCK_VALUES.resourceLinks.length
+ expect(card.find('[data-test-subj="productCard-rightPanelItems"]').children()).toHaveLength(
+ MOCK_VALUES.rightPanelItems?.length ?? -1
);
const button = card.find(EuiButtonEmptyTo);
@@ -69,6 +57,26 @@ describe('ProductCard', () => {
});
});
+ it('renders a product card without panel', () => {
+ const wrapper = shallow( );
+ const card = wrapper.find(EuiPanel);
+
+ expect(card.find('[data-test-subj="productCard-rightPanelItems"]')).toHaveLength(0);
+
+ const button = card.find(EuiButtonEmptyTo);
+
+ expect(button).toHaveLength(1);
+ expect(button.prop('to')).toEqual(MOCK_VALUES.url);
+ expect(card.find(EuiButtonTo)).toHaveLength(0);
+
+ button.simulate('click');
+
+ expect(mockTelemetryActions.sendEnterpriseSearchTelemetry).toHaveBeenCalledWith({
+ action: 'clicked',
+ metric: snakeCase(MOCK_VALUES.productId),
+ });
+ });
+
it('renders an empty cta', () => {
const wrapper = shallow( );
const card = wrapper.find(EuiPanel);
diff --git a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_overview/components/product_card/product_card.tsx b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_overview/components/product_card/product_card.tsx
index 8e81d530e02bb..3ba5fa2e1f52c 100644
--- a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_overview/components/product_card/product_card.tsx
+++ b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_overview/components/product_card/product_card.tsx
@@ -115,7 +115,7 @@ export const ProductCard: React.FC = ({
{rightPanelItems.map((rightPanelItem) => {
return {rightPanelItem} ;
diff --git a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_overview/components/product_selector/product_selector.test.tsx b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_overview/components/product_selector/product_selector.test.tsx
index 6d29c73077a78..8a37008c2d695 100644
--- a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_overview/components/product_selector/product_selector.test.tsx
+++ b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_overview/components/product_selector/product_selector.test.tsx
@@ -16,9 +16,8 @@ import { ErrorStateCallout } from '../../../shared/error_state';
import { SetupGuideCta } from '../setup_guide';
import { TrialCallout } from '../trial_callout';
-import { BehavioralAnalyticsProductCard } from './behavioral_analytics_product_card';
import { ElasticsearchProductCard } from './elasticsearch_product_card';
-import { SearchApplicationsProductCard } from './search_applications_product_card';
+import { EnterpriseSearchProductCard } from './enterprise_search_product_card';
import { ProductSelector } from '.';
@@ -28,8 +27,7 @@ describe('ProductSelector', () => {
const wrapper = shallow( );
expect(wrapper.find(ElasticsearchProductCard)).toHaveLength(1);
- expect(wrapper.find(SearchApplicationsProductCard)).toHaveLength(1);
- expect(wrapper.find(BehavioralAnalyticsProductCard)).toHaveLength(1);
+ expect(wrapper.find(EnterpriseSearchProductCard)).toHaveLength(1);
expect(wrapper.find(SetupGuideCta)).toHaveLength(1);
});
@@ -66,8 +64,7 @@ describe('ProductSelector', () => {
const wrapper = shallow( );
expect(wrapper.find(ElasticsearchProductCard)).toHaveLength(1);
- expect(wrapper.find(SearchApplicationsProductCard)).toHaveLength(1);
- expect(wrapper.find(BehavioralAnalyticsProductCard)).toHaveLength(1);
+ expect(wrapper.find(EnterpriseSearchProductCard)).toHaveLength(1);
expect(wrapper.find(SetupGuideCta)).toHaveLength(0);
});
});
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 6f8a8df2d9ef8..1f81e0642033f 100644
--- a/x-pack/plugins/enterprise_search/public/applications/index.test.tsx
+++ b/x-pack/plugins/enterprise_search/public/applications/index.test.tsx
@@ -38,6 +38,7 @@ describe('renderApp', () => {
licensing: licensingMock.createStart(),
security: securityMock.createStart(),
share: sharePluginMock.createStartContract(),
+ userProfile: {},
},
} as any;
const pluginData = {
From 20a83669f58c9f83a2381214fb813c6b86894bc7 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Efe=20G=C3=BCrkan=20YALAMAN?=
Date: Wed, 9 Aug 2023 02:20:57 +0200
Subject: [PATCH 10/17] Fix filenames
---
.../components/product_selector/ingestion_selector.tsx | 6 +++---
.../public/assets/images/{api-cloud.svg => api_cloud.svg} | 0
.../images/{search-connector.svg => search_connector.svg} | 0
.../images/{search-crawler.svg => search_crawler.svg} | 0
4 files changed, 3 insertions(+), 3 deletions(-)
rename x-pack/plugins/enterprise_search/public/assets/images/{api-cloud.svg => api_cloud.svg} (100%)
rename x-pack/plugins/enterprise_search/public/assets/images/{search-connector.svg => search_connector.svg} (100%)
rename x-pack/plugins/enterprise_search/public/assets/images/{search-crawler.svg => search_crawler.svg} (100%)
diff --git a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_overview/components/product_selector/ingestion_selector.tsx b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_overview/components/product_selector/ingestion_selector.tsx
index db5042dafc302..8758506edd9b6 100644
--- a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_overview/components/product_selector/ingestion_selector.tsx
+++ b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_overview/components/product_selector/ingestion_selector.tsx
@@ -18,9 +18,9 @@ import {
INGESTION_METHOD_IDS,
} from '../../../../../common/constants';
-import apiLogo from '../../../../assets/images/api-cloud.svg';
-import connectorLogo from '../../../../assets/images/search-connector.svg';
-import crawlerLogo from '../../../../assets/images/search-crawler.svg';
+import apiLogo from '../../../../assets/images/api_cloud.svg';
+import connectorLogo from '../../../../assets/images/search_connector.svg';
+import crawlerLogo from '../../../../assets/images/search_crawler.svg';
import {
NEW_API_PATH,
diff --git a/x-pack/plugins/enterprise_search/public/assets/images/api-cloud.svg b/x-pack/plugins/enterprise_search/public/assets/images/api_cloud.svg
similarity index 100%
rename from x-pack/plugins/enterprise_search/public/assets/images/api-cloud.svg
rename to x-pack/plugins/enterprise_search/public/assets/images/api_cloud.svg
diff --git a/x-pack/plugins/enterprise_search/public/assets/images/search-connector.svg b/x-pack/plugins/enterprise_search/public/assets/images/search_connector.svg
similarity index 100%
rename from x-pack/plugins/enterprise_search/public/assets/images/search-connector.svg
rename to x-pack/plugins/enterprise_search/public/assets/images/search_connector.svg
diff --git a/x-pack/plugins/enterprise_search/public/assets/images/search-crawler.svg b/x-pack/plugins/enterprise_search/public/assets/images/search_crawler.svg
similarity index 100%
rename from x-pack/plugins/enterprise_search/public/assets/images/search-crawler.svg
rename to x-pack/plugins/enterprise_search/public/assets/images/search_crawler.svg
From 5ef3e441bbe549de60eeae660978855a25cb4732 Mon Sep 17 00:00:00 2001
From: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Date: Wed, 9 Aug 2023 00:27:19 +0000
Subject: [PATCH 11/17] [CI] Auto-commit changed files from 'node
scripts/lint_ts_projects --fix'
---
packages/kbn-search-api-panels/tsconfig.json | 6 +++++-
x-pack/plugins/serverless_search/tsconfig.json | 1 +
2 files changed, 6 insertions(+), 1 deletion(-)
diff --git a/packages/kbn-search-api-panels/tsconfig.json b/packages/kbn-search-api-panels/tsconfig.json
index f12dc7ee3b3ec..82fd44f2cbb32 100644
--- a/packages/kbn-search-api-panels/tsconfig.json
+++ b/packages/kbn-search-api-panels/tsconfig.json
@@ -16,6 +16,10 @@
"target/**/*"
],
"kbn_references": [
- "@kbn/i18n"
+ "@kbn/i18n",
+ "@kbn/core-http-browser",
+ "@kbn/core-application-browser",
+ "@kbn/share-plugin",
+ "@kbn/i18n-react"
]
}
diff --git a/x-pack/plugins/serverless_search/tsconfig.json b/x-pack/plugins/serverless_search/tsconfig.json
index 91a3f465ca4c6..5e1624175f763 100644
--- a/x-pack/plugins/serverless_search/tsconfig.json
+++ b/x-pack/plugins/serverless_search/tsconfig.json
@@ -30,5 +30,6 @@
"@kbn/ml-plugin",
"@kbn/management-cards-navigation",
"@kbn/core-elasticsearch-server",
+ "@kbn/search-api-panels",
]
}
From c0dd8d6a4d6e2c9cc6bb189202b5a3be69b33852 Mon Sep 17 00:00:00 2001
From: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Date: Wed, 9 Aug 2023 00:33:11 +0000
Subject: [PATCH 12/17] [CI] Auto-commit changed files from 'node
scripts/generate codeowners'
---
.github/CODEOWNERS | 1 +
1 file changed, 1 insertion(+)
diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS
index dfcda878c2e4e..3157d602b30cb 100644
--- a/.github/CODEOWNERS
+++ b/.github/CODEOWNERS
@@ -588,6 +588,7 @@ examples/screenshot_mode_example @elastic/kibana-app-services
src/plugins/screenshot_mode @elastic/appex-sharedux
x-pack/examples/screenshotting_example @elastic/appex-sharedux
x-pack/plugins/screenshotting @elastic/kibana-reporting-services
+packages/kbn-search-api-panels @elastic/enterprise-search-frontend
examples/search_examples @elastic/kibana-data-discovery
x-pack/plugins/searchprofiler @elastic/platform-deployment-management
x-pack/test/security_api_integration/packages/helpers @elastic/kibana-core
From 1f0a7ed77e9e503238a3d4c7f4cbe32f0cecbd5c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Efe=20G=C3=BCrkan=20YALAMAN?=
Date: Wed, 9 Aug 2023 12:53:48 +0200
Subject: [PATCH 13/17] Remove leftover file
---
.../components/search-connector.svg | 365 ------------------
1 file changed, 365 deletions(-)
delete mode 100644 x-pack/plugins/serverless_search/public/application/components/search-connector.svg
diff --git a/x-pack/plugins/serverless_search/public/application/components/search-connector.svg b/x-pack/plugins/serverless_search/public/application/components/search-connector.svg
deleted file mode 100644
index ea1a85904bd72..0000000000000
--- a/x-pack/plugins/serverless_search/public/application/components/search-connector.svg
+++ /dev/null
@@ -1,365 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
From 4a23b8cd9f0efadb2bcac7e727ea11ce9c35f514 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Efe=20G=C3=BCrkan=20YALAMAN?=
Date: Wed, 9 Aug 2023 13:41:57 +0200
Subject: [PATCH 14/17] Use correct endpoint for userprofile
---
packages/kbn-search-api-panels/index.tsx | 7 ++++++-
.../components/product_selector/product_selector.tsx | 6 +-----
x-pack/plugins/enterprise_search/public/plugin.ts | 2 +-
3 files changed, 8 insertions(+), 7 deletions(-)
diff --git a/packages/kbn-search-api-panels/index.tsx b/packages/kbn-search-api-panels/index.tsx
index 92c314481b0a4..4b43c41f0bf86 100644
--- a/packages/kbn-search-api-panels/index.tsx
+++ b/packages/kbn-search-api-panels/index.tsx
@@ -23,7 +23,12 @@ export * from './components/install_client';
export * from './types';
export interface WelcomeBannerProps {
- userProfile: any;
+ userProfile: {
+ user: {
+ full_name?: string;
+ username?: string;
+ };
+ };
assetBasePath?: string;
image?: string;
showDescription?: boolean;
diff --git a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_overview/components/product_selector/product_selector.tsx b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_overview/components/product_selector/product_selector.tsx
index 25d0947370e2a..e3652563cb601 100644
--- a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_overview/components/product_selector/product_selector.tsx
+++ b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_overview/components/product_selector/product_selector.tsx
@@ -55,11 +55,7 @@ export const ProductSelector: React.FC = () => {
-
+
diff --git a/x-pack/plugins/enterprise_search/public/plugin.ts b/x-pack/plugins/enterprise_search/public/plugin.ts
index fb5e25c4f4f4f..e0b86110125fb 100644
--- a/x-pack/plugins/enterprise_search/public/plugin.ts
+++ b/x-pack/plugins/enterprise_search/public/plugin.ts
@@ -102,7 +102,7 @@ export class EnterpriseSearchPlugin implements Plugin {
cloudSetup && (pluginsStart as PluginsStart).cloud
? { ...cloudSetup, ...(pluginsStart as PluginsStart).cloud }
: undefined;
- const userProfile = await (pluginsStart as PluginsStart).security.authc.getCurrentUser();
+ const userProfile = await (pluginsStart as PluginsStart).security.userProfiles.getCurrent();
const plugins = { ...pluginsStart, cloud, userProfile } as PluginsStart;
coreStart.chrome
From 1e914cc05a6d30760a7fafbfff857d6b3af6377d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Efe=20G=C3=BCrkan=20YALAMAN?=
Date: Wed, 9 Aug 2023 14:41:56 +0200
Subject: [PATCH 15/17] Fix test
---
packages/kbn-search-api-panels/index.tsx | 2 +-
.../enterprise_search/public/applications/index.test.tsx | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/packages/kbn-search-api-panels/index.tsx b/packages/kbn-search-api-panels/index.tsx
index 4b43c41f0bf86..d3781084eacae 100644
--- a/packages/kbn-search-api-panels/index.tsx
+++ b/packages/kbn-search-api-panels/index.tsx
@@ -58,7 +58,7 @@ export const WelcomeBanner: React.FC = ({
{i18n.translate('searchApiPanels.welcomeBanner.header.greeting.title', {
defaultMessage: 'Hi {name}!',
- values: { name: userProfile.user.full_name || userProfile.user.username },
+ values: { name: userProfile?.user?.full_name || userProfile?.user?.username },
})}
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 1f81e0642033f..81f092bb4dea5 100644
--- a/x-pack/plugins/enterprise_search/public/applications/index.test.tsx
+++ b/x-pack/plugins/enterprise_search/public/applications/index.test.tsx
@@ -38,7 +38,7 @@ describe('renderApp', () => {
licensing: licensingMock.createStart(),
security: securityMock.createStart(),
share: sharePluginMock.createStartContract(),
- userProfile: {},
+ userProfile: { user: {} },
},
} as any;
const pluginData = {
From afc81bba0dc47525bedf2c5fb7b6f8c2793e7ff6 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Efe=20G=C3=BCrkan=20YALAMAN?=
Date: Wed, 9 Aug 2023 15:30:38 +0200
Subject: [PATCH 16/17] Update
x-pack/plugins/enterprise_search/public/applications/enterprise_search_overview/components/product_selector/product_selector.tsx
Co-authored-by: Liam Thompson <32779855+leemthompo@users.noreply.github.com>
---
.../components/product_selector/product_selector.tsx | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_overview/components/product_selector/product_selector.tsx b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_overview/components/product_selector/product_selector.tsx
index e3652563cb601..7be1cdd12578b 100644
--- a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_overview/components/product_selector/product_selector.tsx
+++ b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_overview/components/product_selector/product_selector.tsx
@@ -101,7 +101,7 @@ export const ProductSelector: React.FC = () => {
'xpack.enterpriseSearch.productSelector.overview.createCustom.description',
{
defaultMessage:
- 'Once your Elasticsearch index is created and populated, you are ready to get the full power of Elasticsearch and accelerate building search applications using plentiful out-of-the-box tools and multiple language clients, all backed by a robust and fully consumable set of APIs.',
+ 'Once your index is created and populated, you'll be ready to use the full power of Elasticsearch. Build search applications using our out-of-the-box tools and programming language clients, all backed by a robust set of APIs.',
}
)}
From 4b697bf46788f301deee678abd6b8bc6ac1f6742 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Efe=20G=C3=BCrkan=20YALAMAN?=
Date: Wed, 9 Aug 2023 16:15:36 +0200
Subject: [PATCH 17/17] fix unterminated string issue
---
.../components/product_selector/product_selector.tsx | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_overview/components/product_selector/product_selector.tsx b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_overview/components/product_selector/product_selector.tsx
index 7be1cdd12578b..001d34c1c5ad6 100644
--- a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_overview/components/product_selector/product_selector.tsx
+++ b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_overview/components/product_selector/product_selector.tsx
@@ -101,7 +101,7 @@ export const ProductSelector: React.FC = () => {
'xpack.enterpriseSearch.productSelector.overview.createCustom.description',
{
defaultMessage:
- 'Once your index is created and populated, you'll be ready to use the full power of Elasticsearch. Build search applications using our out-of-the-box tools and programming language clients, all backed by a robust set of APIs.',
+ "Once your index is created and populated, you'll be ready to use the full power of Elasticsearch. Build search applications using our out-of-the-box tools and programming language clients, all backed by a robust set of APIs.",
}
)}