From 6a589312764455102ae4ff4719beda66a189d55e Mon Sep 17 00:00:00 2001 From: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> Date: Thu, 24 Oct 2024 21:11:29 +1100 Subject: [PATCH] [8.16] [Search][Connectors] Update self-managed instructions, copyedit (#197199) (#197576) # Backport This will backport the following commits from `main` to `8.16`: - [[Search][Connectors] Update self-managed instructions, copyedit (#197199)](https://github.com/elastic/kibana/pull/197199) ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) Co-authored-by: Liam Thompson <32779855+leemthompo@users.noreply.github.com> --- .../components/docker_instructions_step.tsx | 122 ++++++++---- .../components/run_from_source_step.tsx | 183 ++++++++++++------ .../connector_detail/deployment.tsx | 4 +- .../manual_configuration_flyout.tsx | 18 +- .../create_connector/start_step.tsx | 9 +- .../search_index/connector/constants.ts | 21 +- .../translations/translations/fr-FR.json | 5 - .../translations/translations/ja-JP.json | 5 - .../translations/translations/zh-CN.json | 5 - 9 files changed, 235 insertions(+), 137 deletions(-) diff --git a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/connector_detail/components/docker_instructions_step.tsx b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/connector_detail/components/docker_instructions_step.tsx index c3415b781c471..46e7998444729 100644 --- a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/connector_detail/components/docker_instructions_step.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/connector_detail/components/docker_instructions_step.tsx @@ -7,7 +7,14 @@ import React, { useEffect } from 'react'; -import { EuiAccordion, EuiAccordionProps, EuiCode, EuiSpacer, EuiText } from '@elastic/eui'; +import { + EuiAccordion, + EuiAccordionProps, + EuiSpacer, + EuiText, + EuiLink, + EuiCode, +} from '@elastic/eui'; import { i18n } from '@kbn/i18n'; import { FormattedMessage } from '@kbn/i18n-react'; @@ -43,6 +50,16 @@ export const DockerInstructionsStep: React.FC = ({ } }, [isWaitingForConnector]); + const configYamlContent = getConnectorTemplate({ + apiKeyData, + connectorData: { id: connectorId, service_type: serviceType }, + host: elasticsearchUrl, + }); + + const escapedConfigYamlContent = configYamlContent.replace(/"/g, '\\"').replace(/\$/g, '\\$'); + + const createConfigCommand = `mkdir -p "$HOME/elastic-connectors" && echo "${escapedConfigYamlContent}" > "$HOME/elastic-connectors/config.yml"`; + return ( <> = ({ forceState={isOpen} buttonContent={ -

+

{i18n.translate( - 'xpack.enterpriseSearch.connectorDeployment.p.downloadConfigurationLabel', + 'xpack.enterpriseSearch.connectorDeployment.dockerInstructionsHeading', { - defaultMessage: - 'You can either download the configuration file manually or run the following command', + defaultMessage: 'Docker instructions', } )} -

+

} > - /connectors' - } - /> + +

+ {i18n.translate('xpack.enterpriseSearch.connectorDeployment.p.dockerInstallationNote', { + defaultMessage: 'Make sure you have Docker installed on your machine.', + })} +

+
+ + +
+ {i18n.translate('xpack.enterpriseSearch.connectorDeployment.p.createConfigFileLabel', { + defaultMessage: 'Create configuration file', + })} +
+

+ {i18n.translate( + 'xpack.enterpriseSearch.connectorDeployment.p.createConfigFileInstructions', + { + defaultMessage: + 'You need a configuration file with your Elasticsearch and connector details. In your terminal, run the following command to create the config.yml file:', + } + )} +

+
+ +

config.yml, + directory: $HOME/elastic-connectors, + }} + /> +

+

+ --output, + exampleConfigLink: ( + + {i18n.translate( + 'xpack.enterpriseSearch.connectorDeployment.exampleConfigLinkText', + { + defaultMessage: 'example config file', + } + )} + + ), }} />

- config.yml, - }} - /> - - - - + +
+ {i18n.translate('xpack.enterpriseSearch.connectorDeployment.p.runContainerLabel', { + defaultMessage: 'Run container', + })} +

{i18n.translate( 'xpack.enterpriseSearch.connectorDeployment.p.runTheFollowingCommandLabel', { - defaultMessage: - 'Run the following command in your terminal. Make sure you have Docker installed on your machine', + defaultMessage: 'Run the following command to start the container:', } )}

diff --git a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/connector_detail/components/run_from_source_step.tsx b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/connector_detail/components/run_from_source_step.tsx index 07df59597fa75..1c2775dafd54a 100644 --- a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/connector_detail/components/run_from_source_step.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/connector_detail/components/run_from_source_step.tsx @@ -19,6 +19,7 @@ import { EuiIcon, EuiSpacer, EuiText, + EuiLink, } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; @@ -54,65 +55,102 @@ export const RunFromSourceStep: React.FC = ({ return ( <> - -

- {i18n.translate( - 'xpack.enterpriseSearch.connectorDeployment.p.addTheFollowingConfigurationLabel', - { - defaultMessage: 'Clone or download the repo to your local machine', - } - )} -

-
- - git clone https://github.com/elastic/connectors    - {i18n.translate('xpack.enterpriseSearch.connectorDeployment.orLabel', { - defaultMessage: 'or', - })} -     - - - - {i18n.translate('xpack.enterpriseSearch.connectorDeployment.goToSourceButtonLabel', { - defaultMessage: 'Go to Source', - })} - - - - - - - setIsOpen(isOpen === 'closed' ? 'open' : 'closed')} forceState={isOpen} buttonContent={ - -

- - {i18n.translate( - 'xpack.enterpriseSearch.connectorDeployment.configYamlCodeBlockLabel', - { defaultMessage: 'config.yml' } - )} - - ), - }} - /> -

+ +
+ {i18n.translate('xpack.enterpriseSearch.connectorDeployment.runFromSourceTitle', { + defaultMessage: 'Run connector service from source', + })} +
} > + + +
+ {i18n.translate('xpack.enterpriseSearch.connectorDeployment.p.cloneRepositoryLabel', { + defaultMessage: 'Clone the repository', + })} +
+

+ {i18n.translate( + 'xpack.enterpriseSearch.connectorDeployment.p.addTheFollowingConfigurationLabel', + { + defaultMessage: 'First, you need to clone or download the repo:', + } + )} +

+
+ + git clone https://github.com/elastic/connectors    + {i18n.translate('xpack.enterpriseSearch.connectorDeployment.orLabel', { + defaultMessage: 'or', + })} +     + + + + {i18n.translate('xpack.enterpriseSearch.connectorDeployment.goToSourceButtonLabel', { + defaultMessage: 'Download source', + })} + + + + + + + +
+ {i18n.translate('xpack.enterpriseSearch.connectorDeployment.p.createConfigFileLabel', { + defaultMessage: 'Create configuration file', + })} +
+

+ {i18n.translate('xpack.enterpriseSearch.connectorDeployment.p.navigateToRootLabel', { + defaultMessage: + 'Navigate to the root of your cloned repository and create a configuration file:', + })} +

+
+ + + + +
+ {i18n.translate('xpack.enterpriseSearch.connectorDeployment.p.populateConfigLabel', { + defaultMessage: 'Populate configuration file', + })} +
+

+ + {i18n.translate( + 'xpack.enterpriseSearch.connectorDeployment.configYamlCodeBlockLabel', + { defaultMessage: 'config.yml' } + )} + + ), + }} + /> +

+
= ({ host: elasticsearchUrl, })} /> - +

- {i18n.translate('xpack.enterpriseSearch.connectorDeployment.p.compileAndRunLabel', { - defaultMessage: 'Compile and run', + + {i18n.translate( + 'xpack.enterpriseSearch.connectorDeployment.exampleConfigFileLinkLabel', + { defaultMessage: 'example file' } + )} + + ), + }} + /> +

+
+ + +
+ {i18n.translate('xpack.enterpriseSearch.connectorDeployment.p.compileAndRunTitle', { + defaultMessage: 'Run the connector service', })} +
+

+ {i18n.translate( + 'xpack.enterpriseSearch.connectorDeployment.p.compileAndRunInstructions', + { + defaultMessage: 'Finally, compile and run the connector service source code:', + } + )}

- + = ({ make run `} /> +
); diff --git a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/connector_detail/deployment.tsx b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/connector_detail/deployment.tsx index e3bd0e867af3d..2a617a87df8bc 100644 --- a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/connector_detail/deployment.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/connector_detail/deployment.tsx @@ -134,7 +134,7 @@ export const ConnectorDeployment: React.FC = () => { @@ -176,7 +176,7 @@ export const ConnectorDeployment: React.FC = () => { title: i18n.translate( 'xpack.enterpriseSearch.content.connector_detail.configurationConnector.steps.generateApiKey.title', { - defaultMessage: 'Configure index and API key', + defaultMessage: 'Create index and generate API key', } ), titleSize: 'xs', diff --git a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/connectors/create_connector/components/manual_configuration_flyout.tsx b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/connectors/create_connector/components/manual_configuration_flyout.tsx index 6fc80ec3a81f1..98bea7ed62f70 100644 --- a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/connectors/create_connector/components/manual_configuration_flyout.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/connectors/create_connector/components/manual_configuration_flyout.tsx @@ -41,7 +41,14 @@ import { SelfManagePreference } from '../create_connector'; const CLI_LABEL = i18n.translate( 'xpack.enterpriseSearch.createConnector.manualConfiguration.cliLabel', { - defaultMessage: 'CLI', + defaultMessage: 'Command-line interface', + } +); + +const CLI_LINK_TEXT = i18n.translate( + 'xpack.enterpriseSearch.createConnector.manualConfiguration.cliLinkText', + { + defaultMessage: 'Connectors CLI', } ); @@ -87,7 +94,7 @@ export const ManualConfigurationFlyout: React.FC

@@ -142,7 +149,7 @@ export const ManualConfigurationFlyout: React.FC 'xpack.enterpriseSearch.createConnector.manualConfiguration.p.connectorNameDescription', { defaultMessage: - 'You will be redirected to the connector page to configure the rest of your connector', + "You'll be redirected to the connector page to complete your configuration.", } )}

@@ -199,7 +206,7 @@ export const ManualConfigurationFlyout: React.FC

target="_blank" external > - {CLI_LABEL} + {CLI_LINK_TEXT} ), myIndex: my-index, + configFile: config.yml, }} />

diff --git a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/connectors/create_connector/start_step.tsx b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/connectors/create_connector/start_step.tsx index 633ea8f58d25c..b66a5653351bd 100644 --- a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/connectors/create_connector/start_step.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/connectors/create_connector/start_step.tsx @@ -142,7 +142,7 @@ export const StartStep: React.FC = ({

{i18n.translate('xpack.enterpriseSearch.createConnector.startStep.h4.setUpLabel', { - defaultMessage: 'Set up', + defaultMessage: 'Setup', })}

@@ -152,8 +152,7 @@ export const StartStep: React.FC = ({ {i18n.translate( 'xpack.enterpriseSearch.createConnector.startStep.p.whereDoYouWantLabel', { - defaultMessage: - 'Where do you want to store the connector and how do you want to manage it?', + defaultMessage: 'Choose how to deploy and manage your connector:', } )}

@@ -185,7 +184,7 @@ export const StartStep: React.FC = ({ id={selfManagedRadioButtonId} label={i18n.translate( 'xpack.enterpriseSearch.createConnector.startStep.euiRadio.selfManagedLabel', - { defaultMessage: 'Self managed' } + { defaultMessage: 'Self-managed' } )} checked={selfManagePreference === 'selfManaged'} onChange={() => onSelfManagePreferenceChange('selfManaged')} @@ -223,7 +222,7 @@ export const StartStep: React.FC = ({ 'xpack.enterpriseSearch.createConnector.startStep.p.youWillStartTheLabel', { defaultMessage: - 'You will start the process of creating a new index, API key, and a Web Crawler Connector ID manually. Optionally you can bring your own configuration as well.', + "We'll automatically configure your index, API key, and connector ID. Alternatively, create these manually and use a custom configuration.", } )}

diff --git a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/connector/constants.ts b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/connector/constants.ts index 3962bbb888d6e..65120d78cec84 100644 --- a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/connector/constants.ts +++ b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/connector/constants.ts @@ -35,17 +35,10 @@ export const getConnectorTemplate = ({ api_key: "${apiKeyData?.encoded || ''}" `; -export const getRunFromDockerSnippet = ({ version }: { version: string }) => dedent` -docker run \\ - - -v "/connectors-config:/config" \ # NOTE: change absolute path to match where config.yml is located on your machine - --tty \\ - - --rm \\ - - docker.elastic.co/enterprise-search/elastic-connectors:${version} \\ - - /app/bin/elastic-ingest \\ - - -c /config/config.yml # Path to your configuration file in the container -`; +export const getRunFromDockerSnippet = ({ version }: { version: string }) => `docker run \\ +-v "$HOME/elastic-connectors:/config" \\ +--tty \\ +--rm \\ +docker.elastic.co/enterprise-search/elastic-connectors:${version} \\ +/app/bin/elastic-ingest \\ +-c /config/config.yml`; diff --git a/x-pack/plugins/translations/translations/fr-FR.json b/x-pack/plugins/translations/translations/fr-FR.json index 9a5048f827097..3c79aad120c8b 100644 --- a/x-pack/plugins/translations/translations/fr-FR.json +++ b/x-pack/plugins/translations/translations/fr-FR.json @@ -16308,11 +16308,6 @@ "xpack.enterpriseSearch.connectorDeployment.indexCreatedFlexItemLabel": "Index créé", "xpack.enterpriseSearch.connectorDeployment.orLabel": "ou", "xpack.enterpriseSearch.connectorDeployment.p.addTheFollowingConfigurationLabel": "Cloner ou télécharger le référentiel sur votre machine locale", - "xpack.enterpriseSearch.connectorDeployment.p.changeOutputPathLabel": "Modifiez la valeur d'argument {output} pour le chemin auquel vous voulez enregistrer le fichier de configuration.", - "xpack.enterpriseSearch.connectorDeployment.p.compileAndRunLabel": "Compiler et exécuter", - "xpack.enterpriseSearch.connectorDeployment.p.downloadConfigurationLabel": "Vous pouvez soit télécharger le fichier de configuration manuellement, soit exécuter la commande suivante", - "xpack.enterpriseSearch.connectorDeployment.p.editConfigLabel": "Modifiez le fichier {configYaml} et fournissez la configuration suivante", - "xpack.enterpriseSearch.connectorDeployment.p.editConfigYamlLabel": "Modifiez le fichier {configYaml} et fournissez les informations de connexion suivantes", "xpack.enterpriseSearch.connectorDeployment.p.runTheFollowingCommandLabel": "Exécutez la commande suivante dans votre terminal. Assurez-vous que Docker est installé sur votre machine", "xpack.enterpriseSearch.connectorDescriptionBadge.client.chooseADataSourceLabel": "Choisissez une source de données à synchroniser", "xpack.enterpriseSearch.connectorDescriptionBadge.client.configureConnectorLabel": "Déployez le code du connecteur sur votre propre infrastructure en l'exécutant depuis la source ou à l'aide de Docker", diff --git a/x-pack/plugins/translations/translations/ja-JP.json b/x-pack/plugins/translations/translations/ja-JP.json index 7fdf4a32efdfc..018f27bfc8013 100644 --- a/x-pack/plugins/translations/translations/ja-JP.json +++ b/x-pack/plugins/translations/translations/ja-JP.json @@ -16054,11 +16054,6 @@ "xpack.enterpriseSearch.connectorDeployment.indexCreatedFlexItemLabel": "インデックスが作成されました", "xpack.enterpriseSearch.connectorDeployment.orLabel": "または", "xpack.enterpriseSearch.connectorDeployment.p.addTheFollowingConfigurationLabel": "リポジトリを複製するか、ローカルコンピューターにダウンロード", - "xpack.enterpriseSearch.connectorDeployment.p.changeOutputPathLabel": "{output}引数値を、構成ファイルを保存するパスに変更します。", - "xpack.enterpriseSearch.connectorDeployment.p.compileAndRunLabel": "コンパイルして実行", - "xpack.enterpriseSearch.connectorDeployment.p.downloadConfigurationLabel": "手動で構成ファイルをダウンロードするか、次のコマンドを実行できます", - "xpack.enterpriseSearch.connectorDeployment.p.editConfigLabel": "{configYaml}ファイルを編集し、次の構成を入力", - "xpack.enterpriseSearch.connectorDeployment.p.editConfigYamlLabel": "{configYaml}ファイルを編集し、次の資格情報を入力", "xpack.enterpriseSearch.connectorDeployment.p.runTheFollowingCommandLabel": "ターミナルで次のコマンドを実行します。コンピューターにDockerがインストールされていることを確認します", "xpack.enterpriseSearch.connectorDescriptionBadge.client.chooseADataSourceLabel": "同期したいデータソースを選択します。", "xpack.enterpriseSearch.connectorDescriptionBadge.client.configureConnectorLabel": "ソースから実行するか、Dockerを使用して、独自のインフラにコネクターコードをデプロイします。", diff --git a/x-pack/plugins/translations/translations/zh-CN.json b/x-pack/plugins/translations/translations/zh-CN.json index f3dd9709b8d44..e8eece2c396d4 100644 --- a/x-pack/plugins/translations/translations/zh-CN.json +++ b/x-pack/plugins/translations/translations/zh-CN.json @@ -16083,11 +16083,6 @@ "xpack.enterpriseSearch.connectorDeployment.indexCreatedFlexItemLabel": "索引已创建", "xpack.enterpriseSearch.connectorDeployment.orLabel": "或", "xpack.enterpriseSearch.connectorDeployment.p.addTheFollowingConfigurationLabel": "克隆此存储库或将其下载到本地计算机", - "xpack.enterpriseSearch.connectorDeployment.p.changeOutputPathLabel": "将 {output} 参数值更改为要在其中保存配置文件的路径。", - "xpack.enterpriseSearch.connectorDeployment.p.compileAndRunLabel": "编译并运行", - "xpack.enterpriseSearch.connectorDeployment.p.downloadConfigurationLabel": "您可以手动下载配置文件,也可以运行以下命令", - "xpack.enterpriseSearch.connectorDeployment.p.editConfigLabel": "编辑 {configYaml} 文件并提供以下配置", - "xpack.enterpriseSearch.connectorDeployment.p.editConfigYamlLabel": "编辑 {configYaml} 文件并提供后续凭据", "xpack.enterpriseSearch.connectorDeployment.p.runTheFollowingCommandLabel": "在终端中运行以下命令。确保已在计算机上安装 Docker", "xpack.enterpriseSearch.connectorDescriptionBadge.client.chooseADataSourceLabel": "选择要同步的数据源", "xpack.enterpriseSearch.connectorDescriptionBadge.client.configureConnectorLabel": "通过从源运行或使用 Docker 在您自己的基础设施上部署连接器代码",