mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 01:38:56 -04:00
[Enterprise Search]Disable syncs for native connectors when EnterpriseSearch is down (#169671)
## Summary Disable syncs when Enterprise Search is down for native connectors. <img width="1227" alt="Screenshot 2023-10-24 at 17 15 00" src="d1bca68a
-a746-4ee3-9dbd-a79ab1cac205"> <img width="1546" alt="Screenshot 2023-10-24 at 17 15 07" src="48aea67f
-d857-4bd8-bbfc-c1fd35eac7a9"> <img width="1235" alt="Screenshot 2023-10-24 at 17 15 32" src="7e45c0cd
-2551-4cca-a040-84ab959c81ac"> <img width="1244" alt="Screenshot 2023-10-24 at 17 15 20" src="bceb8792
-5a4f-487b-a8f1-0d6758473e49"> ### Checklist Delete any items that are not applicable to this PR. - [x] Any text added follows [EUI's writing guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses sentence case text and includes [i18n support](https://github.com/elastic/kibana/blob/main/packages/kbn-i18n/README.md) - [ ] [Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html) was added for features that require explanation or tutorials - [ ] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios - [x] Any UI touched in this PR is usable by keyboard only (learn more about [keyboard accessibility](https://webaim.org/techniques/keyboard/)) - [x] Any UI touched in this PR does not create any new axe failures (run axe in browser: [FF](https://addons.mozilla.org/en-US/firefox/addon/axe-devtools/), [Chrome](https://chrome.google.com/webstore/detail/axe-web-accessibility-tes/lhdoppojpmngadmnindnejefpokejbdd?hl=en-US)) - [x] This renders correctly on smaller devices using a responsive layout. (You can test this [in your browser](https://www.browserstack.com/guide/responsive-testing-on-local-server))
This commit is contained in:
parent
eaddc54f6c
commit
980162b0b0
2 changed files with 46 additions and 6 deletions
|
@ -23,6 +23,7 @@ import {
|
|||
import { i18n } from '@kbn/i18n';
|
||||
|
||||
import { Status } from '../../../../../../../common/types/api';
|
||||
import { HttpLogic } from '../../../../../shared/http';
|
||||
import { KibanaLogic } from '../../../../../shared/kibana';
|
||||
import { CancelSyncsApiLogic } from '../../../../api/connector/cancel_syncs_api_logic';
|
||||
import { IngestionStatus } from '../../../../types';
|
||||
|
@ -30,8 +31,9 @@ import { CancelSyncsLogic } from '../../connector/cancel_syncs_logic';
|
|||
import { IndexViewLogic } from '../../index_view_logic';
|
||||
|
||||
export const SyncsContextMenu: React.FC = () => {
|
||||
const { productFeatures } = useValues(KibanaLogic);
|
||||
const { config, productFeatures } = useValues(KibanaLogic);
|
||||
const {
|
||||
connector,
|
||||
hasDocumentLevelSecurityFeature,
|
||||
hasIncrementalSyncFeature,
|
||||
ingestionMethod,
|
||||
|
@ -43,7 +45,7 @@ export const SyncsContextMenu: React.FC = () => {
|
|||
const { cancelSyncs } = useActions(CancelSyncsLogic);
|
||||
const { status } = useValues(CancelSyncsApiLogic);
|
||||
const { startSync, startIncrementalSync, startAccessControlSync } = useActions(IndexViewLogic);
|
||||
const { connector } = useValues(IndexViewLogic);
|
||||
const { errorConnectingMessage } = useValues(HttpLogic);
|
||||
|
||||
const [isPopoverOpen, setPopover] = useState(false);
|
||||
const togglePopover = () => setPopover(!isPopoverOpen);
|
||||
|
@ -75,6 +77,13 @@ export const SyncsContextMenu: React.FC = () => {
|
|||
const shouldShowIncrementalSync =
|
||||
productFeatures.hasIncrementalSyncEnabled && hasIncrementalSyncFeature;
|
||||
|
||||
const isEnterpriseSearchNotAvailable = Boolean(
|
||||
config.host && config.canDeployEntSearch && errorConnectingMessage
|
||||
);
|
||||
const isSyncsDisabled =
|
||||
(connector?.is_native && isEnterpriseSearchNotAvailable) ||
|
||||
ingestionStatus === IngestionStatus.INCOMPLETE;
|
||||
|
||||
const panels: EuiContextMenuProps['panels'] = [
|
||||
{
|
||||
id: 0,
|
||||
|
@ -86,7 +95,7 @@ export const SyncsContextMenu: React.FC = () => {
|
|||
// @ts-ignore - data-* attributes are applied but doesn't exist on types
|
||||
'data-telemetry-id': `entSearchContent-${ingestionMethod}-header-sync-startSync`,
|
||||
'data-test-subj': `entSearchContent-${ingestionMethod}-header-sync-startSync`,
|
||||
disabled: ingestionStatus === IngestionStatus.INCOMPLETE,
|
||||
disabled: isSyncsDisabled,
|
||||
icon: 'play',
|
||||
name: i18n.translate('xpack.enterpriseSearch.index.header.more.fullSync', {
|
||||
defaultMessage: 'Full Content',
|
||||
|
@ -105,7 +114,7 @@ export const SyncsContextMenu: React.FC = () => {
|
|||
'entSearchContent-${ingestionMethod}-header-sync-more-incrementalSync',
|
||||
'data-test-subj':
|
||||
'entSearchContent-${ingestionMethod}-header-sync-more-incrementalSync',
|
||||
disabled: ingestionStatus === IngestionStatus.INCOMPLETE,
|
||||
disabled: isSyncsDisabled,
|
||||
icon: 'play',
|
||||
name: i18n.translate('xpack.enterpriseSearch.index.header.more.incrementalSync', {
|
||||
defaultMessage: 'Incremental Content',
|
||||
|
@ -126,8 +135,7 @@ export const SyncsContextMenu: React.FC = () => {
|
|||
'data-test-subj':
|
||||
'entSearchContent-${ingestionMethod}-header-sync-more-accessControlSync',
|
||||
disabled: Boolean(
|
||||
ingestionStatus === IngestionStatus.INCOMPLETE ||
|
||||
connector?.configuration.use_document_level_security?.value
|
||||
isSyncsDisabled || !connector?.configuration.use_document_level_security?.value
|
||||
),
|
||||
icon: 'play',
|
||||
name: i18n.translate('xpack.enterpriseSearch.index.header.more.accessControlSync', {
|
||||
|
|
|
@ -10,6 +10,7 @@ import React from 'react';
|
|||
import { useValues } from 'kea';
|
||||
|
||||
import {
|
||||
EuiCallOut,
|
||||
EuiFlexGroup,
|
||||
EuiFlexItem,
|
||||
EuiIcon,
|
||||
|
@ -25,7 +26,9 @@ import { i18n } from '@kbn/i18n';
|
|||
|
||||
import { BetaConnectorCallout } from '../../../../../shared/beta/beta_connector_callout';
|
||||
import { docLinks } from '../../../../../shared/doc_links';
|
||||
import { HttpLogic } from '../../../../../shared/http';
|
||||
import { CONNECTOR_ICONS } from '../../../../../shared/icons/connector_icons';
|
||||
import { KibanaLogic } from '../../../../../shared/kibana';
|
||||
|
||||
import { hasConfiguredConfiguration } from '../../../../utils/has_configured_configuration';
|
||||
import { isConnectorIndex } from '../../../../utils/indices';
|
||||
|
@ -40,6 +43,8 @@ import { ResearchConfiguration } from './research_configuration';
|
|||
|
||||
export const NativeConnectorConfiguration: React.FC = () => {
|
||||
const { index } = useValues(IndexViewLogic);
|
||||
const { config } = useValues(KibanaLogic);
|
||||
const { errorConnectingMessage } = useValues(HttpLogic);
|
||||
|
||||
if (!isConnectorIndex(index)) {
|
||||
return <></>;
|
||||
|
@ -95,6 +100,33 @@ export const NativeConnectorConfiguration: React.FC = () => {
|
|||
</EuiFlexItem>
|
||||
</EuiFlexGroup>
|
||||
<EuiSpacer />
|
||||
{config.host && config.canDeployEntSearch && errorConnectingMessage && (
|
||||
<>
|
||||
<EuiCallOut
|
||||
color="warning"
|
||||
size="m"
|
||||
title={i18n.translate(
|
||||
'xpack.enterpriseSearch.content.indices.configurationConnector.nativeConnector.entSearchWarning.title',
|
||||
{
|
||||
defaultMessage: 'No running Enterprise Search instance detected',
|
||||
}
|
||||
)}
|
||||
iconType="warning"
|
||||
>
|
||||
<p>
|
||||
{i18n.translate(
|
||||
'xpack.enterpriseSearch.content.indices.configurationConnector.nativeConnector.entSearchWarning.text',
|
||||
{
|
||||
defaultMessage:
|
||||
'Native connectors require a running Enterprise Search instance to sync content from source.',
|
||||
}
|
||||
)}
|
||||
</p>
|
||||
</EuiCallOut>
|
||||
|
||||
<EuiSpacer />
|
||||
</>
|
||||
)}
|
||||
<EuiSteps
|
||||
steps={[
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue