Skip to content

Commit

Permalink
[Search][Stack] Web Crawlers coming soon pages (elastic#205718)
Browse files Browse the repository at this point in the history
## Summary

This PR shows the `SearchEmptyPrompts` for the Web Crawlers section in
Stack in Stack 9.0 as we do in ES3 due to Web Crawlers will not be
available as Elastic Managed since this version. We are also leveraging
as shared code as possible consuming the `@kbn/search-shared-ui`
content.

![CleanShot 2025-01-07 at 12 08
36@2x](https://github.com/user-attachments/assets/6483fa0b-21ee-40fa-b749-3a04e0732c92)

![CleanShot 2025-01-07 at 12 09
00@2x](https://github.com/user-attachments/assets/91f3bf8f-6b33-4e7f-9e24-b7844bb60768)
  • Loading branch information
JoseLuisGJ authored and CAWilson94 committed Jan 10, 2025
1 parent 7ad4025 commit 6c2c32c
Show file tree
Hide file tree
Showing 13 changed files with 401 additions and 149 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17073,7 +17073,6 @@
"xpack.enterpriseSearch.connectors.more.ariaLabel": "Plus d'options",
"xpack.enterpriseSearch.connectors.newConnectorButtonLabel": "Nouveau connecteur",
"xpack.enterpriseSearch.connectors.newConnectorsClientButtonLabel": "Nouveau connecteur autogéré",
"xpack.enterpriseSearch.connectors.newCrawlerButtonLabel": "Nouveau robot d'indexation",
"xpack.enterpriseSearch.connectors.newNativeConnectorButtonLabel": "Nouveau connecteur géré par Elastic",
"xpack.enterpriseSearch.connectors.title": "Connecteurs Elasticsearch",
"xpack.enterpriseSearch.connectorsTable.euiSearchBar.filterConnectorsLabel": "Filtrer les connecteurs",
Expand Down Expand Up @@ -17998,10 +17997,6 @@
"xpack.enterpriseSearch.crawler.startCrawlContextMenu.crawlCustomSettingsMenuLabel": "Indexation avec des paramètres personnalisés",
"xpack.enterpriseSearch.crawler.startCrawlContextMenu.reapplyCrawlRulesMenuLabel": "Réappliquer les règles d'indexation",
"xpack.enterpriseSearch.crawler.urlComboBox.invalidUrlErrorMessage": "Veuillez entrer une URL valide",
"xpack.enterpriseSearch.crawlerEmptyState.h2.createYourFirstWebLabel": "Créer votre premier robot d'indexation",
"xpack.enterpriseSearch.crawlerEmptyState.newWebCrawlerButtonLabel": "Nouveau robot d'indexation",
"xpack.enterpriseSearch.crawlerEmptyState.openSourceCrawlerButtonLabel": "Code source",
"xpack.enterpriseSearch.crawlerEmptyState.p.discoverExtractAndIndexLabel": "Découvrir, extraire et indexer du contenu interrogeable provenant de sites web et de bases de connaissances",
"xpack.enterpriseSearch.crawlers.title": "Robot d'indexation Elasticsearch",
"xpack.enterpriseSearch.createConnector..breadcrumb": "Nouveau connecteur",
"xpack.enterpriseSearch.createConnector..title": "Créer un connecteur",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16934,7 +16934,6 @@
"xpack.enterpriseSearch.connectors.more.ariaLabel": "その他のオプション",
"xpack.enterpriseSearch.connectors.newConnectorButtonLabel": "新しいコネクター",
"xpack.enterpriseSearch.connectors.newConnectorsClientButtonLabel": "新しいセルフマネージドコネクター",
"xpack.enterpriseSearch.connectors.newCrawlerButtonLabel": "新しいWebクローラー",
"xpack.enterpriseSearch.connectors.newNativeConnectorButtonLabel": "新しいElasticマネージドコネクター",
"xpack.enterpriseSearch.connectors.title": "Elasticsearchコネクター",
"xpack.enterpriseSearch.connectorsTable.euiSearchBar.filterConnectorsLabel": "コネクターをフィルター",
Expand Down Expand Up @@ -17858,10 +17857,6 @@
"xpack.enterpriseSearch.crawler.startCrawlContextMenu.crawlCustomSettingsMenuLabel": "カスタム設定でクロール",
"xpack.enterpriseSearch.crawler.startCrawlContextMenu.reapplyCrawlRulesMenuLabel": "クローリングルールを再適用",
"xpack.enterpriseSearch.crawler.urlComboBox.invalidUrlErrorMessage": "有効なURLを入力してください",
"xpack.enterpriseSearch.crawlerEmptyState.h2.createYourFirstWebLabel": "最初のWebクローラーを作成",
"xpack.enterpriseSearch.crawlerEmptyState.newWebCrawlerButtonLabel": "新しいWebクローラー",
"xpack.enterpriseSearch.crawlerEmptyState.openSourceCrawlerButtonLabel": "ソースコード",
"xpack.enterpriseSearch.crawlerEmptyState.p.discoverExtractAndIndexLabel": "Webサイトやナレッジベースから検索可能なコンテンツを検出、抽出、インデックス化します",
"xpack.enterpriseSearch.crawlers.title": "Elasticsearch Webクローラー",
"xpack.enterpriseSearch.createConnector..breadcrumb": "新しいコネクター",
"xpack.enterpriseSearch.createConnector..title": "コネクターを作成する",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16639,7 +16639,6 @@
"xpack.enterpriseSearch.connectors.more.ariaLabel": "更多选项",
"xpack.enterpriseSearch.connectors.newConnectorButtonLabel": "新连接器",
"xpack.enterpriseSearch.connectors.newConnectorsClientButtonLabel": "全新自管型连接器",
"xpack.enterpriseSearch.connectors.newCrawlerButtonLabel": "新网络爬虫",
"xpack.enterpriseSearch.connectors.newNativeConnectorButtonLabel": "全新 Elastic 托管连接器",
"xpack.enterpriseSearch.connectors.title": "Elasticsearch 连接器",
"xpack.enterpriseSearch.connectorsTable.euiSearchBar.filterConnectorsLabel": "筛选连接器",
Expand Down Expand Up @@ -17558,10 +17557,6 @@
"xpack.enterpriseSearch.crawler.startCrawlContextMenu.crawlCustomSettingsMenuLabel": "使用定制设置执行爬网",
"xpack.enterpriseSearch.crawler.startCrawlContextMenu.reapplyCrawlRulesMenuLabel": "重新应用爬网规则",
"xpack.enterpriseSearch.crawler.urlComboBox.invalidUrlErrorMessage": "请输入有效 URL",
"xpack.enterpriseSearch.crawlerEmptyState.h2.createYourFirstWebLabel": "创建您的首个网络爬虫",
"xpack.enterpriseSearch.crawlerEmptyState.newWebCrawlerButtonLabel": "新网络爬虫",
"xpack.enterpriseSearch.crawlerEmptyState.openSourceCrawlerButtonLabel": "源代码",
"xpack.enterpriseSearch.crawlerEmptyState.p.discoverExtractAndIndexLabel": "发现、提取和索引网站和知识库中的可搜索内容",
"xpack.enterpriseSearch.crawlers.title": "Elasticsearch 网络爬虫",
"xpack.enterpriseSearch.createConnector..breadcrumb": "新连接器",
"xpack.enterpriseSearch.createConnector..title": "创建连接器",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,20 +16,21 @@ import {
EuiContextMenuPanel,
EuiFlexGroup,
EuiFlexItem,
EuiLink,
EuiPopover,
EuiSearchBar,
EuiSpacer,
EuiText,
EuiTitle,
} from '@elastic/eui';

import { i18n } from '@kbn/i18n';
import { FormattedMessage } from '@kbn/i18n-react';

import { HttpLogic } from '../../../shared/http';
import { LEARN_MORE_LINK } from '../../../shared/constants';
import { KibanaLogic } from '../../../shared/kibana';
import { handlePageChange } from '../../../shared/table_pagination';
import {
NEW_CRAWLER_PATH,
NEW_INDEX_SELECT_CONNECTOR_CLIENTS_PATH,
NEW_INDEX_SELECT_CONNECTOR_NATIVE_PATH,
NEW_INDEX_SELECT_CONNECTOR_PATH,
Expand All @@ -41,9 +42,10 @@ import { DefaultSettingsFlyout } from '../settings/default_settings_flyout';
import { ConnectorStats } from './connector_stats';
import { ConnectorsLogic } from './connectors_logic';
import { ConnectorsTable } from './connectors_table';
import { CrawlerEmptyState } from './crawler_empty_state';
import { CreateConnector } from './create_connector';
import { DeleteConnectorModal } from './delete_connector_modal';
import { ElasticManagedWebCrawlerEmptyPrompt } from './elastic_managed_web_crawler_empty_prompt';
import { SelfManagedWebCrawlerEmptyPrompt } from './self_managed_web_crawler_empty_prompt';

export const connectorsBreadcrumbs = [
i18n.translate('xpack.enterpriseSearch.content.connectors.breadcrumb', {
Expand All @@ -59,12 +61,12 @@ export const crawlersBreadcrumbs = [

export interface ConnectorsProps {
isCrawler: boolean;
isCrawlerSelfManaged?: boolean;
}
export const Connectors: React.FC<ConnectorsProps> = ({ isCrawler }) => {
export const Connectors: React.FC<ConnectorsProps> = ({ isCrawler, isCrawlerSelfManaged }) => {
const { fetchConnectors, onPaginate, setIsFirstRequest, openDeleteModal } =
useActions(ConnectorsLogic);
const { data, isLoading, searchParams, isEmpty, connectors } = useValues(ConnectorsLogic);
const { errorConnectingMessage } = useValues(HttpLogic);
const [searchQuery, setSearchValue] = useState('');
const [showMoreOptionsPopover, setShowMoreOptionsPopover] = useState<boolean>(false);
const [showDefaultSettingsFlyout, setShowDefaultSettingsFlyout] = useState<boolean>(false);
Expand Down Expand Up @@ -95,6 +97,29 @@ export const Connectors: React.FC<ConnectorsProps> = ({ isCrawler }) => {
: i18n.translate('xpack.enterpriseSearch.crawlers.title', {
defaultMessage: 'Elastic Web Crawler',
}),
description: [
<EuiText>
<p>
<FormattedMessage
id="xpack.enterpriseSearch.webcrawlers.headerContent"
defaultMessage="Discover extract and index searchable content from websites and knowledge bases {learnMoreLink}"
values={{
learnMoreLink: (
<EuiLink
data-test-subj="entSearchContentConnectorsLearnMoreLink"
external
target="_blank"
href={'https://github.com/elastic/crawler'}
>
{LEARN_MORE_LINK}
</EuiLink>
),
}}
/>
</p>
</EuiText>,
],

rightSideGroupProps: {
gutterSize: 's',
responsive: false,
Expand Down Expand Up @@ -199,52 +224,26 @@ export const Connectors: React.FC<ConnectorsProps> = ({ isCrawler }) => {
]
: []),
]
: [
<EuiButton
data-test-subj="entSearchContent-crawlers-newCrawlerButton"
data-telemetry-id="entSearchContent-crawlers-newCrawlerButton"
disabled={Boolean(errorConnectingMessage)}
key="newCrawler"
color="primary"
iconType="plusInCircle"
fill
onClick={() => {
KibanaLogic.values.navigateToUrl(NEW_CRAWLER_PATH);
}}
>
{i18n.translate('xpack.enterpriseSearch.connectors.newCrawlerButtonLabel', {
defaultMessage: 'New web crawler',
})}
</EuiButton>,
...(productFeatures.hasDefaultIngestPipeline
? [
<EuiButton
color="primary"
data-test-subj="entSearchContent-connectors-defaultSettingsPopover"
data-telemetry-id="entSearchContent-connectors-defaultSettingsPopover"
onClick={() => setShowDefaultSettingsFlyout(true)}
>
{i18n.translate(
'xpack.enterpriseSearch.content.searchIndices.defaultSettings',
{
defaultMessage: 'Default settings',
}
)}
</EuiButton>,
]
: []),
],
: undefined,
}}
>
{productFeatures.hasDefaultIngestPipeline && showDefaultSettingsFlyout && (
<DefaultSettingsFlyout closeFlyout={() => setShowDefaultSettingsFlyout(false)} />
)}
<ConnectorStats isCrawler={isCrawler} />
<EuiSpacer />
{!isCrawler && (
<>
<ConnectorStats isCrawler={isCrawler} />
<EuiSpacer />
</>
)}

<EuiFlexGroup direction="column">
{isEmpty && isCrawler ? (
<CrawlerEmptyState />
isCrawlerSelfManaged ? (
<SelfManagedWebCrawlerEmptyPrompt />
) : (
<ElasticManagedWebCrawlerEmptyPrompt />
)
) : (
<>
<EuiFlexItem>
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import React from 'react';

import { Routes, Route } from '@kbn/shared-ux-router';

import { CRAWLERS_PATH, NEW_CRAWLER_PATH } from '../../routes';
import { CRAWLERS_PATH, CRAWLERS_ELASTIC_MANAGED_PATH, NEW_CRAWLER_PATH } from '../../routes';
import { NewSearchIndexPage } from '../new_index/new_search_index_page';

import { Connectors } from './connectors';
Expand All @@ -20,8 +20,11 @@ export const CrawlersRouter: React.FC = () => {
<Route path={NEW_CRAWLER_PATH}>
<NewSearchIndexPage type="crawler" />
</Route>
<Route path={CRAWLERS_PATH}>
<Connectors isCrawler />
<Route exact path={CRAWLERS_PATH}>
<Connectors isCrawler isCrawlerSelfManaged />
</Route>
<Route exact path={CRAWLERS_ELASTIC_MANAGED_PATH}>
<Connectors isCrawler isCrawlerSelfManaged={false} />
</Route>
</Routes>
);
Expand Down
Loading

0 comments on commit 6c2c32c

Please sign in to comment.