From 3baa1af7375ae0592aedc9634c31d0ae1a74f7d1 Mon Sep 17 00:00:00 2001 From: saarikabhasi Date: Tue, 30 Apr 2024 13:04:40 -0400 Subject: [PATCH] improve pipelines awareness --- .../components/preprocess_data.tsx | 228 ++++++++++++++++++ packages/kbn-search-api-panels/index.tsx | 1 + .../connector_config/connector_index_name.tsx | 67 ++++- .../application/components/overview.tsx | 77 +++--- .../components/pipeline_manage_button.tsx | 34 +++ .../translations/translations/fr-FR.json | 3 - .../translations/translations/ja-JP.json | 3 - .../translations/translations/zh-CN.json | 3 - 8 files changed, 361 insertions(+), 55 deletions(-) create mode 100644 packages/kbn-search-api-panels/components/preprocess_data.tsx create mode 100644 x-pack/plugins/serverless_search/public/application/components/pipeline_manage_button.tsx diff --git a/packages/kbn-search-api-panels/components/preprocess_data.tsx b/packages/kbn-search-api-panels/components/preprocess_data.tsx new file mode 100644 index 0000000000000..5ea303e16241c --- /dev/null +++ b/packages/kbn-search-api-panels/components/preprocess_data.tsx @@ -0,0 +1,228 @@ +/* + * 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, + EuiSpacer, + EuiText, + EuiThemeProvider, + EuiTitle, + EuiToken, + EuiPanel, + EuiLink, + EuiFlexGrid, +} from '@elastic/eui'; +import { i18n } from '@kbn/i18n'; +import React from 'react'; + +export const PreprocessDataPanel: React.FC = () => { + return ( + + + + + + + + + + +

+ {i18n.translate( + 'searchApiPanels.preprocessData.overview.dataEnrichment.title', + { + defaultMessage: 'Data enrichment', + } + )} +

+
+ + +

+ {i18n.translate( + 'searchApiPanels.preprocessData.overview.dataEnrichment.description', + { + defaultMessage: + 'Add information from external sources or apply transformations to your documents for more contextual, insightful search.', + } + )} +

+
+ + +

+ + {i18n.translate( + 'searchApiPanels.preprocessData.overview.dataEnrichment.learnMore', + { + defaultMessage: 'Learn More', + } + )} + +

+
+
+
+
+ + + + + + + +

+ {i18n.translate('searchApiPanels.pipeline.overview.dataFiltering.title', { + defaultMessage: 'Data filtering', + })} +

+
+ + + {i18n.translate('searchApiPanels.pipeline.overview.dataFiltering.description', { + defaultMessage: + 'Remove fields from documents like sensitive information from documents before indexing.', + })} + + + +

+ + {i18n.translate( + 'searchApiPanels.preprocessData.overview.dataFiltering.learnMore', + { + defaultMessage: 'Learn More', + } + )} + +

+
+
+
+
+ + + + + + + +

+ {i18n.translate('searchApiPanels.pipeline.overview.arrayJsonHandling.title', { + defaultMessage: 'Array/JSON handling', + })} +

+
+ + + {i18n.translate( + 'searchApiPanels.pipeline.overview.arrayJsonHandling.description', + { + defaultMessage: 'Run batch processors, parse JSON data and sort elements.', + } + )} + + + +

+ + {i18n.translate( + 'searchApiPanels.preprocessData.overview.arrayJsonHandling.learnMore', + { + defaultMessage: 'Learn More', + } + )} + +

+
+
+
+
+ + + + + + + +

+ {i18n.translate('searchApiPanels.pipeline.overview.dataTransformation.title', { + defaultMessage: 'Data transformation', + })} +

+
+ + + {i18n.translate( + 'searchApiPanels.pipeline.overview.dataTransformation.description', + { + defaultMessage: + 'Parse information from your documents to ensure they conform to a standardized format.', + } + )} + + + +

+ + {i18n.translate( + 'searchApiPanels.preprocessData.overview.dataTransformation.learnMore', + { + defaultMessage: 'Learn More', + } + )} + +

+
+
+
+
+ + + + + + + +

+ {i18n.translate('searchApiPanels.pipeline.overview.pipelineHandling.title', { + defaultMessage: 'Pipeline handling', + })} +

+
+ + + {i18n.translate( + 'searchApiPanels.pipeline.overview.pipelineHandling.description', + { + defaultMessage: + 'Handle error exceptions, execute another pipeline or reroute document to another index', + } + )} + + + +

+ + {i18n.translate( + 'searchApiPanels.preprocessData.overview.pipelineHandling.learnMore', + { + defaultMessage: 'Learn More', + } + )} + +

+
+
+
+
+
+
+
+ ); +}; diff --git a/packages/kbn-search-api-panels/index.tsx b/packages/kbn-search-api-panels/index.tsx index ada194f6fab46..8ba4b1337e6bf 100644 --- a/packages/kbn-search-api-panels/index.tsx +++ b/packages/kbn-search-api-panels/index.tsx @@ -22,6 +22,7 @@ export * from './components/pipeline_panel'; export * from './components/select_client'; export * from './components/try_in_console_button'; export * from './components/install_client'; +export * from './components/preprocess_data'; export * from './types'; export * from './utils'; diff --git a/x-pack/plugins/serverless_search/public/application/components/connectors/connector_config/connector_index_name.tsx b/x-pack/plugins/serverless_search/public/application/components/connectors/connector_config/connector_index_name.tsx index 58ba4c4250d34..177cc218a4da8 100644 --- a/x-pack/plugins/serverless_search/public/application/components/connectors/connector_config/connector_index_name.tsx +++ b/x-pack/plugins/serverless_search/public/application/components/connectors/connector_config/connector_index_name.tsx @@ -5,11 +5,21 @@ * 2.0. */ -import { EuiButton, EuiFlexGroup, EuiFlexItem, EuiSpacer, EuiText, EuiTitle } from '@elastic/eui'; +import { + EuiButton, + EuiFlexGroup, + EuiFlexItem, + EuiLink, + EuiPanel, + EuiSpacer, + EuiText, + EuiTitle, +} from '@elastic/eui'; import { i18n } from '@kbn/i18n'; import { Connector, ConnectorStatus } from '@kbn/search-connectors'; import React, { useState } from 'react'; import { useQueryClient, useMutation } from '@tanstack/react-query'; +import { FormattedMessage } from '@kbn/i18n-react'; import { isValidIndexName } from '../../../../utils/validate_index_name'; import { SAVE_LABEL } from '../../../../../common/i18n_string'; import { useConnector } from '../../../hooks/api/use_connector'; @@ -80,6 +90,61 @@ export const ConnectorIndexName: React.FC = ({ connecto onChange={(name) => setNewIndexname(name)} /> + + + + +

+ {i18n.translate('xpack.serverlessSearch.connectors.config.preprocessData.title', { + defaultMessage: 'Preprocess your data', + })} +

+
+
+ + +

+ + {i18n.translate( + 'xpack.serverlessSearch.connectors.config.preprocessData.clientIngestionPipeline', + { + defaultMessage: 'search-default-ingestion', + } + )} + , + + ), + }} + /> +

+
+
+ + +

+ + {i18n.translate( + 'xpack.serverlessSearch.connectors.config.preprocessDataTitle.learnMore', + { + defaultMessage: 'Learn More', + } + )} + +

+
+
+
+
+ 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 3fcf7bc2d5cd6..fd953436cbd32 100644 --- a/x-pack/plugins/serverless_search/public/application/components/overview.tsx +++ b/x-pack/plugins/serverless_search/public/application/components/overview.tsx @@ -12,13 +12,11 @@ import { EuiFlexGroup, EuiFlexItem, EuiIcon, - EuiLink, EuiPageTemplate, EuiPanel, EuiText, } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n-react'; import { WelcomeBanner, IngestData, @@ -28,6 +26,7 @@ import { InstallClientPanel, getLanguageDefinitionCodeSnippet, getConsoleRequest, + PreprocessDataPanel, } from '@kbn/search-api-panels'; import React, { useEffect, useMemo, useState, FC, PropsWithChildren } from 'react'; @@ -36,7 +35,7 @@ import type { LanguageDefinitionSnippetArguments, } from '@kbn/search-api-panels'; import { useLocation } from 'react-router-dom'; -import { CloudDetailsPanel, PipelinePanel } from '@kbn/search-api-panels'; +import { CloudDetailsPanel } from '@kbn/search-api-panels'; import { docLinks } from '../../../common/doc_links'; import { useKibanaServices } from '../hooks/use_kibana'; import { useAssetBasePath } from '../hooks/use_asset_base_path'; @@ -53,6 +52,7 @@ import { ApiKeyPanel } from './api_key/api_key'; import { ConnectorIngestionPanel } from './connectors_ingestion'; import { PipelineButtonOverview } from './pipeline_button_overview'; import { SelectClientCallouts } from './select_client_callouts'; +import { PipelineManageButton } from './pipeline_manage_button'; export const ElasticsearchOverview = () => { const [selectedLanguage, setSelectedLanguage] = useState(javaDefinition); @@ -237,6 +237,34 @@ export const ElasticsearchOverview = () => { })} /> + + } + links={[]} + title={i18n.translate('xpack.serverlessSearch.preprocessData.title', { + defaultMessage: + 'Preprocess your data by enriching, transforming or filtering with pipelines', + })} + children={ + + + + + + + + + } + /> + { })} /> - - - {i18n.translate( - 'xpack.serverlessSearch.pipeline.description.ingestPipelinesLink.link', - { - defaultMessage: 'ingest pipelines', - } - )} - - ), - }} - /> - } - leftPanelContent={ - - } - links={[]} - title={i18n.translate('xpack.serverlessSearch.pipeline.title', { - defaultMessage: 'Transform and enrich your data', - })} - children={} - /> - + { + const { http } = useKibanaServices(); + + return ( + <> + + + + {i18n.translate('xpack.serverlessSearch.pipeline.description.manageButtonLabel', { + defaultMessage: 'Manage pipeline', + })} + + + + ); +}; diff --git a/x-pack/plugins/translations/translations/fr-FR.json b/x-pack/plugins/translations/translations/fr-FR.json index 60c21cfc74cdd..495f2d05df881 100644 --- a/x-pack/plugins/translations/translations/fr-FR.json +++ b/x-pack/plugins/translations/translations/fr-FR.json @@ -38250,7 +38250,6 @@ "xpack.serverlessSearch.indexManagement.indexDetails.overview.emptyPrompt.api.body": "Personnalisez ces variables en fonction de votre contenu. Pour un guide d'installation complet, consultez notre guide {getStartedLink}.", "xpack.serverlessSearch.indexManagement.indexDetails.overview.emptyPrompt.body": "Alimentez votre index avec des données en utilisant {logstashLink}, {beatsLink}, {connectorsLink} ou RESTful {apiCallsLink}.", "xpack.serverlessSearch.indexManagement.indexDetails.overview.storagePanel.documentCount": "{documentCount} documents / {deletedCount} supprimés", - "xpack.serverlessSearch.pipeline.description": "Utilisez {ingestPipelinesLink} pour préparer vos données avant leur indexation dans Elasticsearch, ce qui est souvent plus facile que le post-traitement. Utilisez n'importe quelle combinaison de processeurs d'ingestion pour ajouter, supprimer ou transformer les champs dans vos documents.", "xpack.serverlessSearch.searchConnectors.configurationConnector.config.documentation.description": "Ce connecteur prend en charge plusieurs méthodes d'authentification. Demandez à votre administrateur les informations d'identification correctes pour la connexion. {documentationUrl}", "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", @@ -38424,8 +38423,6 @@ "xpack.serverlessSearch.overview.footer.links.inviteUsers": "Inviter d'autres utilisateurs", "xpack.serverlessSearch.overview.footer.title": "Tirez pleinement partie de vos données", "xpack.serverlessSearch.pipeline.description.createButtonLabel": "Créer un pipeline", - "xpack.serverlessSearch.pipeline.description.ingestPipelinesLink.link": "pipelines d'ingestion", - "xpack.serverlessSearch.pipeline.title": "Transformer et enrichir vos données", "xpack.serverlessSearch.required": "Obligatoire", "xpack.serverlessSearch.save": "Enregistrer", "xpack.serverlessSearch.searchConnectors.configurationConnector.config.documentation.link": "Documentation", diff --git a/x-pack/plugins/translations/translations/ja-JP.json b/x-pack/plugins/translations/translations/ja-JP.json index 6ea7973b93a11..91497a0e2a0ed 100644 --- a/x-pack/plugins/translations/translations/ja-JP.json +++ b/x-pack/plugins/translations/translations/ja-JP.json @@ -38218,7 +38218,6 @@ "xpack.serverlessSearch.indexManagement.indexDetails.overview.emptyPrompt.api.body": "これらの変数をコンテンツに合わせてカスタマイズします。詳細なセットアップガイドについては、{getStartedLink}ガイドをご覧ください。", "xpack.serverlessSearch.indexManagement.indexDetails.overview.emptyPrompt.body": "{logstashLink}、{beatsLink}、{connectorsLink}、またはRESTful {apiCallsLink}を使用して、データにインデックスを入力します。", "xpack.serverlessSearch.indexManagement.indexDetails.overview.storagePanel.documentCount": "{documentCount}件のドキュメント / {deletedCount}削除済み", - "xpack.serverlessSearch.pipeline.description": "{ingestPipelinesLink}を使うと、Elasticsearchにインデックス化される前にデータを前処理することができます。通常、これは後処理よりも大幅に簡単です。インジェストプロセッサーを自由に組み合わせて、ドキュメント内のフィールドを追加、削除、変換できます。", "xpack.serverlessSearch.searchConnectors.configurationConnector.config.documentation.description": "このコネクターは複数の認証方法をサポートします。正しい接続資格情報については、管理者に確認してください。{documentationUrl}", "xpack.serverlessSearch.apiKey.apiKeyStepDescription": "このキーは一度しか表示されないため、安全な場所に保存しておいてください。当社はお客様のAPIキーを保存しません。キーを紛失した場合は、代替キーを生成する必要があります。", "xpack.serverlessSearch.apiKey.apiKeyStepTitle": "このAPIキーを保存", @@ -38392,8 +38391,6 @@ "xpack.serverlessSearch.overview.footer.links.inviteUsers": "その他のユーザーを招待", "xpack.serverlessSearch.overview.footer.title": "実際のデータで作業しよう", "xpack.serverlessSearch.pipeline.description.createButtonLabel": "パイプラインを作成", - "xpack.serverlessSearch.pipeline.description.ingestPipelinesLink.link": "インジェストパイプライン", - "xpack.serverlessSearch.pipeline.title": "データの変換とエンリッチ", "xpack.serverlessSearch.required": "必須", "xpack.serverlessSearch.save": "保存", "xpack.serverlessSearch.searchConnectors.configurationConnector.config.documentation.link": "ドキュメント", diff --git a/x-pack/plugins/translations/translations/zh-CN.json b/x-pack/plugins/translations/translations/zh-CN.json index 4742b2168dc60..ed1ac55730fe2 100644 --- a/x-pack/plugins/translations/translations/zh-CN.json +++ b/x-pack/plugins/translations/translations/zh-CN.json @@ -38262,7 +38262,6 @@ "xpack.serverlessSearch.indexManagement.indexDetails.overview.emptyPrompt.api.body": "定制这些变量以匹配您的内容。如需完整的设置指南,请访问我们的{getStartedLink}指南。", "xpack.serverlessSearch.indexManagement.indexDetails.overview.emptyPrompt.body": "使用 {logstashLink}、{beatsLink}、{connectorsLink} 或 RESTful {apiCallsLink} 为您的索引填充数据。", "xpack.serverlessSearch.indexManagement.indexDetails.overview.storagePanel.documentCount": "{documentCount} 个文档/{deletedCount} 个已删除", - "xpack.serverlessSearch.pipeline.description": "使用 {ingestPipelinesLink} 在将您的数据索引到 Elasticsearch 之前预处理这些数据,这通常比后期处理更加方便。使用采集处理器的任意组合在您的文档中添加、删除或转换字段。", "xpack.serverlessSearch.searchConnectors.configurationConnector.config.documentation.description": "此连接器支持几种身份验证方法。请联系管理员获取正确的连接凭据。{documentationUrl}", "xpack.serverlessSearch.apiKey.apiKeyStepDescription": "此密钥仅显示一次,因此请将其保存到某个安全位置。我们不存储您的 API 密钥,因此,如果您丢失了密钥,则需要生成替代密钥。", "xpack.serverlessSearch.apiKey.apiKeyStepTitle": "存储此 API 密钥", @@ -38436,8 +38435,6 @@ "xpack.serverlessSearch.overview.footer.links.inviteUsers": "邀请更多用户", "xpack.serverlessSearch.overview.footer.title": "充分利用您的数据", "xpack.serverlessSearch.pipeline.description.createButtonLabel": "创建管道", - "xpack.serverlessSearch.pipeline.description.ingestPipelinesLink.link": "采集管道", - "xpack.serverlessSearch.pipeline.title": "转换和扩充数据", "xpack.serverlessSearch.required": "必需", "xpack.serverlessSearch.save": "保存", "xpack.serverlessSearch.searchConnectors.configurationConnector.config.documentation.link": "文档",