From b7bf13c6251203188e6df2982df488f449f15cf4 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jos=C3=A9=20Luis=20Gonz=C3=A1lez?=
Date: Wed, 2 Oct 2024 17:05:49 +0200
Subject: [PATCH 1/4] Showing Web Crawler card pointing out to GH repo when no
ent-search node detected
---
.../enterprise_search/common/constants.ts | 4 ++
.../shared/ingestion_card/ingestion_card.tsx | 13 ++++
.../product_selector/ingestion_selector.tsx | 70 +++++++++++++------
.../applications/shared/icons/github_icon.tsx | 32 +++++++++
4 files changed, 97 insertions(+), 22 deletions(-)
create mode 100644 x-pack/plugins/enterprise_search/public/applications/shared/icons/github_icon.tsx
diff --git a/x-pack/plugins/enterprise_search/common/constants.ts b/x-pack/plugins/enterprise_search/common/constants.ts
index 10b472b1efca1..795237ef9b427 100644
--- a/x-pack/plugins/enterprise_search/common/constants.ts
+++ b/x-pack/plugins/enterprise_search/common/constants.ts
@@ -281,5 +281,9 @@ export const PLUGIN_ID = 'enterpriseSearch';
export const CONNECTOR_NATIVE_TYPE = 'native';
export const CONNECTOR_CLIENTS_TYPE = 'connector_clients';
+export const CRAWLER = {
+ github_repo: 'https://github.com/elastic/crawler',
+};
+
// TODO remove this once the connector service types are no longer in "example" state
export const EXAMPLE_CONNECTOR_SERVICE_TYPES = ['opentext_documentum'];
diff --git a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/shared/ingestion_card/ingestion_card.tsx b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/shared/ingestion_card/ingestion_card.tsx
index 0d01eea4e6787..94bbc515f92bd 100644
--- a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/shared/ingestion_card/ingestion_card.tsx
+++ b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/shared/ingestion_card/ingestion_card.tsx
@@ -18,6 +18,8 @@ import {
IconType,
} from '@elastic/eui';
+import { i18n } from '@kbn/i18n';
+
import { EuiLinkTo } from '../../../../shared/react_router_helpers';
interface IngestionCardProps {
@@ -25,6 +27,7 @@ interface IngestionCardProps {
buttonLabel: string;
description: string;
href?: string;
+ isBeta?: boolean;
isDisabled?: boolean;
logo: IconType;
onClick?: () => void;
@@ -37,6 +40,7 @@ export const IngestionCard: React.FC = ({
description,
href,
isDisabled,
+ isBeta,
logo,
onClick,
title,
@@ -44,6 +48,15 @@ export const IngestionCard: React.FC = ({
return (
{
@@ -75,28 +77,52 @@ export const IngestionSelector: React.FC = () => {
{productFeatures.hasWebCrawler && (
-
+ {crawlerDisabled ? (
+
+ ) : (
+
+ )}
)}
{productFeatures.hasConnectors && (
diff --git a/x-pack/plugins/enterprise_search/public/applications/shared/icons/github_icon.tsx b/x-pack/plugins/enterprise_search/public/applications/shared/icons/github_icon.tsx
new file mode 100644
index 0000000000000..0fc9160272838
--- /dev/null
+++ b/x-pack/plugins/enterprise_search/public/applications/shared/icons/github_icon.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; you may not use this file except in compliance with the Elastic License
+ * 2.0.
+ */
+
+import React from 'react';
+
+export const GithubIcon = () => {
+ return (
+
+ );
+};
From 793dd87572e189e5843991e9d38f7a2e7901b4e1 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jos=C3=A9=20Luis=20Gonz=C3=A1lez?=
Date: Tue, 8 Oct 2024 11:45:30 +0200
Subject: [PATCH 2/4] Crawler empty state points out Source code repo when no
ent-search instance running
---
.../connectors/crawler_empty_state.tsx | 45 +++++++++++++------
1 file changed, 32 insertions(+), 13 deletions(-)
diff --git a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/connectors/crawler_empty_state.tsx b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/connectors/crawler_empty_state.tsx
index 8e5b91b94e39b..5a03d0560dfbf 100644
--- a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/connectors/crawler_empty_state.tsx
+++ b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/connectors/crawler_empty_state.tsx
@@ -11,7 +11,9 @@ import { useValues } from 'kea';
import { EuiButton, EuiEmptyPrompt, EuiPanel } from '@elastic/eui';
import { i18n } from '@kbn/i18n';
+import { CRAWLER } from '../../../../../common/constants';
import { HttpLogic } from '../../../shared/http';
+import { GithubIcon } from '../../../shared/icons/github_icon';
import { KibanaLogic } from '../../../shared/kibana';
import { NEW_CRAWLER_PATH } from '../../routes';
@@ -40,19 +42,36 @@ export const CrawlerEmptyState: React.FC = () => {
}
actions={
- KibanaLogic.values.navigateToUrl(NEW_CRAWLER_PATH)}
- >
- {i18n.translate('xpack.enterpriseSearch.crawlerEmptyState.newWebCrawlerButtonLabel', {
- defaultMessage: 'New web crawler',
- })}
-
+ Boolean(errorConnectingMessage) ? (
+
+ {i18n.translate(
+ 'xpack.enterpriseSearch.crawlerEmptyState.openSourceCrawlerButtonLabel',
+ {
+ defaultMessage: 'Source code',
+ }
+ )}
+
+ ) : (
+ KibanaLogic.values.navigateToUrl(NEW_CRAWLER_PATH)}
+ >
+ {i18n.translate('xpack.enterpriseSearch.crawlerEmptyState.newWebCrawlerButtonLabel', {
+ defaultMessage: 'New web crawler',
+ })}
+
+ )
}
/>
From 1417bda1bccf087729c997d985fa6cb24f607bb3 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jos=C3=A9=20Luis=20Gonz=C3=A1lez?=
Date: Tue, 8 Oct 2024 16:00:34 +0200
Subject: [PATCH 3/4] IngestionCard condition content
---
.../product_selector/ingestion_selector.tsx | 82 ++++++++-----------
1 file changed, 36 insertions(+), 46 deletions(-)
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 7845e6aa2138e..e8b6924eb15b4 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
@@ -77,52 +77,42 @@ export const IngestionSelector: React.FC = () => {
{productFeatures.hasWebCrawler && (
- {crawlerDisabled ? (
-
- ) : (
-
- )}
+
)}
{productFeatures.hasConnectors && (
From 51dec6aa1e420764bbacf0067dd89610b3ebaea7 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jos=C3=A9=20Luis=20Gonz=C3=A1lez?=
Date: Fri, 11 Oct 2024 16:04:44 +0200
Subject: [PATCH 4/4] Removing unused i18n elements
---
x-pack/plugins/translations/translations/fr-FR.json | 1 -
x-pack/plugins/translations/translations/ja-JP.json | 1 -
x-pack/plugins/translations/translations/zh-CN.json | 1 -
3 files changed, 3 deletions(-)
diff --git a/x-pack/plugins/translations/translations/fr-FR.json b/x-pack/plugins/translations/translations/fr-FR.json
index b3bf6ee59b413..19e70ae151088 100644
--- a/x-pack/plugins/translations/translations/fr-FR.json
+++ b/x-pack/plugins/translations/translations/fr-FR.json
@@ -17417,7 +17417,6 @@
"xpack.enterpriseSearch.ingestSelector.method.connectors.description": "Extraire, transformer, indexer et synchroniser des données issues d'une source de données tiers.",
"xpack.enterpriseSearch.ingestSelector.method.crawler": "Robot d'indexation",
"xpack.enterpriseSearch.ingestSelector.method.crawler.description": "Découvrir, extraire et indexer du contenu interrogeable provenant de sites web et de bases de connaissances.",
- "xpack.enterpriseSearch.ingestSelector.method.crawlerButtonLabel": "Indexer l'URL",
"xpack.enterpriseSearch.ingestSelector.method.fileUpload": "Charger un fichier",
"xpack.enterpriseSearch.ingestSelector.method.fileUpload.description": "Fichiers texte délimités, tels que CSV et TSV, JSON délimité par une nouvelle ligne.",
"xpack.enterpriseSearch.ingestSelector.method.fileUploadLabel": "Choisir un fichier",
diff --git a/x-pack/plugins/translations/translations/ja-JP.json b/x-pack/plugins/translations/translations/ja-JP.json
index 70f10f96262ae..d14b6ffc1e257 100644
--- a/x-pack/plugins/translations/translations/ja-JP.json
+++ b/x-pack/plugins/translations/translations/ja-JP.json
@@ -17163,7 +17163,6 @@
"xpack.enterpriseSearch.ingestSelector.method.connectors.description": "サードパーティのデータソースからデータを抽出、変換、インデックス化、同期します。",
"xpack.enterpriseSearch.ingestSelector.method.crawler": "Webクローラー",
"xpack.enterpriseSearch.ingestSelector.method.crawler.description": "Webサイトやナレッジベースから検索可能なコンテンツを検出、抽出、インデックス化します。",
- "xpack.enterpriseSearch.ingestSelector.method.crawlerButtonLabel": "クロールURL",
"xpack.enterpriseSearch.ingestSelector.method.fileUpload": "ファイルをアップロード",
"xpack.enterpriseSearch.ingestSelector.method.fileUpload.description": "CSVやTSV、改行区切りのJSONなどの区切られたテキストファイル。",
"xpack.enterpriseSearch.ingestSelector.method.fileUploadLabel": "ファイルを選択",
diff --git a/x-pack/plugins/translations/translations/zh-CN.json b/x-pack/plugins/translations/translations/zh-CN.json
index 2a3f12fe5e6a0..4fce6ea38a0b9 100644
--- a/x-pack/plugins/translations/translations/zh-CN.json
+++ b/x-pack/plugins/translations/translations/zh-CN.json
@@ -17192,7 +17192,6 @@
"xpack.enterpriseSearch.ingestSelector.method.connectors.description": "提取、转换、索引和同步来自第三方数据源的数据。",
"xpack.enterpriseSearch.ingestSelector.method.crawler": "网络爬虫",
"xpack.enterpriseSearch.ingestSelector.method.crawler.description": "发现、提取和索引网站和知识库中的可搜索内容。",
- "xpack.enterpriseSearch.ingestSelector.method.crawlerButtonLabel": "爬网 URL",
"xpack.enterpriseSearch.ingestSelector.method.fileUpload": "上传文件",
"xpack.enterpriseSearch.ingestSelector.method.fileUpload.description": "分隔的文本文件,例如 CSV 和 TSV、换行符分隔的 JSON。",
"xpack.enterpriseSearch.ingestSelector.method.fileUploadLabel": "选择文件",