mirror of
https://github.com/elastic/kibana.git
synced 2025-06-28 11:05:39 -04:00
[Search] Disable crawler on overview without ent-search (#164227)
## Summary This disables the crawler if Enterprise Search is not available on the new overview page.
This commit is contained in:
parent
f1402d682c
commit
8532b996c4
1 changed files with 67 additions and 53 deletions
|
@ -9,6 +9,8 @@ import React from 'react';
|
||||||
|
|
||||||
import { generatePath } from 'react-router-dom';
|
import { generatePath } from 'react-router-dom';
|
||||||
|
|
||||||
|
import { useValues } from 'kea';
|
||||||
|
|
||||||
import { EuiButton, EuiCard, EuiFlexGroup, EuiFlexItem, EuiIcon } from '@elastic/eui';
|
import { EuiButton, EuiCard, EuiFlexGroup, EuiFlexItem, EuiIcon } from '@elastic/eui';
|
||||||
|
|
||||||
import { i18n } from '@kbn/i18n';
|
import { i18n } from '@kbn/i18n';
|
||||||
|
@ -27,13 +29,18 @@ import {
|
||||||
NEW_INDEX_METHOD_PATH,
|
NEW_INDEX_METHOD_PATH,
|
||||||
NEW_INDEX_SELECT_CONNECTOR_PATH,
|
NEW_INDEX_SELECT_CONNECTOR_PATH,
|
||||||
} from '../../../enterprise_search_content/routes';
|
} from '../../../enterprise_search_content/routes';
|
||||||
import { EuiLinkTo } from '../../../shared/react_router_helpers';
|
import { HttpLogic } from '../../../shared/http/http_logic';
|
||||||
|
import { KibanaLogic } from '../../../shared/kibana';
|
||||||
|
import { EuiButtonTo, EuiLinkTo } from '../../../shared/react_router_helpers';
|
||||||
|
|
||||||
const START_LABEL = i18n.translate('xpack.enterpriseSearch.ingestSelector.startButton', {
|
const START_LABEL = i18n.translate('xpack.enterpriseSearch.ingestSelector.startButton', {
|
||||||
defaultMessage: 'Start',
|
defaultMessage: 'Start',
|
||||||
});
|
});
|
||||||
|
|
||||||
export const IngestionSelector: React.FC = () => {
|
export const IngestionSelector: React.FC = () => {
|
||||||
|
const { config, productFeatures } = useValues(KibanaLogic);
|
||||||
|
const { errorConnectingMessage } = useValues(HttpLogic);
|
||||||
|
const crawlerDisabled = Boolean(errorConnectingMessage || !config.host);
|
||||||
return (
|
return (
|
||||||
<EuiFlexGroup>
|
<EuiFlexGroup>
|
||||||
<EuiFlexItem>
|
<EuiFlexItem>
|
||||||
|
@ -61,6 +68,7 @@ export const IngestionSelector: React.FC = () => {
|
||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
</EuiFlexItem>
|
</EuiFlexItem>
|
||||||
|
{productFeatures.hasConnectors && (
|
||||||
<EuiFlexItem>
|
<EuiFlexItem>
|
||||||
<EuiCard
|
<EuiCard
|
||||||
hasBorder
|
hasBorder
|
||||||
|
@ -88,9 +96,12 @@ export const IngestionSelector: React.FC = () => {
|
||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
</EuiFlexItem>
|
</EuiFlexItem>
|
||||||
|
)}
|
||||||
|
{productFeatures.hasWebCrawler && (
|
||||||
<EuiFlexItem>
|
<EuiFlexItem>
|
||||||
<EuiCard
|
<EuiCard
|
||||||
hasBorder
|
hasBorder
|
||||||
|
isDisabled={crawlerDisabled}
|
||||||
icon={<EuiIcon type={crawlerLogo} size="xxl" />}
|
icon={<EuiIcon type={crawlerLogo} size="xxl" />}
|
||||||
textAlign="left"
|
textAlign="left"
|
||||||
title={i18n.translate('xpack.enterpriseSearch.ingestSelector.method.crawler', {
|
title={i18n.translate('xpack.enterpriseSearch.ingestSelector.method.crawler', {
|
||||||
|
@ -104,17 +115,20 @@ export const IngestionSelector: React.FC = () => {
|
||||||
}
|
}
|
||||||
)}
|
)}
|
||||||
footer={
|
footer={
|
||||||
<EuiLinkTo
|
<EuiButtonTo
|
||||||
|
fullWidth
|
||||||
|
isDisabled={crawlerDisabled}
|
||||||
to={generatePath(ENTERPRISE_SEARCH_CONTENT_PLUGIN.URL + NEW_INDEX_METHOD_PATH, {
|
to={generatePath(ENTERPRISE_SEARCH_CONTENT_PLUGIN.URL + NEW_INDEX_METHOD_PATH, {
|
||||||
type: INGESTION_METHOD_IDS.CRAWLER,
|
type: INGESTION_METHOD_IDS.CRAWLER,
|
||||||
})}
|
})}
|
||||||
shouldNotCreateHref
|
shouldNotCreateHref
|
||||||
>
|
>
|
||||||
<EuiButton fullWidth>{START_LABEL}</EuiButton>
|
{START_LABEL}
|
||||||
</EuiLinkTo>
|
</EuiButtonTo>
|
||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
</EuiFlexItem>
|
</EuiFlexItem>
|
||||||
|
)}
|
||||||
</EuiFlexGroup>
|
</EuiFlexGroup>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue