Skip to content

Commit

Permalink
Show connector errors on overview screen (#141001)
Browse files Browse the repository at this point in the history
  • Loading branch information
byronhulcher authored Sep 20, 2022
1 parent 278d057 commit c7ad442
Show file tree
Hide file tree
Showing 8 changed files with 32 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ export interface IngestPipelineParams {
export interface Connector {
api_key_id: string | null;
configuration: ConnectorConfiguration;
error: string | null;
id: string;
index_name: string;
is_native: boolean;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ export const indices: ElasticsearchIndexWithIngestion[] = [
connector: {
api_key_id: null,
configuration: { foo: { label: 'bar', value: 'barbar' } },
error: null,
id: '2',
index_name: 'connector',
is_native: false,
Expand Down Expand Up @@ -75,6 +76,7 @@ export const indices: ElasticsearchIndexWithIngestion[] = [
connector: {
api_key_id: null,
configuration: { foo: { label: 'bar', value: 'barbar' } },
error: null,
id: '4',
index_name: 'connector-crawler',
is_native: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ export const connectorIndex: ConnectorViewIndex = {
connector: {
api_key_id: null,
configuration: { foo: { label: 'bar', value: 'barbar' } },
error: null,
id: '2',
index_name: 'connector',
is_native: false,
Expand Down Expand Up @@ -90,6 +91,7 @@ export const connectorCrawlerIndex: CrawlerViewIndex = {
connector: {
api_key_id: null,
configuration: { foo: { label: 'bar', value: 'barbar' } },
error: null,
id: '4',
index_name: 'connector-crawler',
is_native: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import React from 'react';

import { useValues } from 'kea';

import { EuiSpacer } from '@elastic/eui';
import { EuiCallOut, EuiSpacer, EuiText } from '@elastic/eui';

import { i18n } from '@kbn/i18n';

Expand All @@ -30,6 +30,24 @@ export const SearchIndexOverview: React.FC = () => {
return (
<>
<EuiSpacer />
{isConnectorIndex(indexData) && indexData.connector.error && (
<>
<EuiCallOut
iconType="alert"
color="danger"
title={i18n.translate(
'xpack.enterpriseSearch.content.searchIndex.connectorErrorCallOut.title',
{
defaultMessage: 'Your connector has reported an error',
}
)}
>
<EuiSpacer size="s" />
<EuiText size="s">{indexData.connector.error}</EuiText>
</EuiCallOut>
<EuiSpacer />
</>
)}
{isCrawlerIndex(indexData) ? (
<CrawlerTotalStats />
) : (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ describe('addConnector lib function', () => {
document: {
api_key_id: null,
configuration: {},
error: null,
index_name: 'index_name',
is_native: false,
language: 'fr',
Expand Down Expand Up @@ -215,6 +216,7 @@ describe('addConnector lib function', () => {
document: {
api_key_id: null,
configuration: {},
error: null,
index_name: 'index_name',
is_native: true,
language: null,
Expand Down Expand Up @@ -266,6 +268,7 @@ describe('addConnector lib function', () => {
document: {
api_key_id: null,
configuration: {},
error: null,
index_name: 'search-index_name',
is_native: false,
language: 'en',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ export const addConnector = async (
const document: ConnectorDocument = {
api_key_id: null,
configuration: {},
error: null,
index_name: input.index_name,
is_native: input.is_native,
language: input.language,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ describe('addConnector lib function', () => {
api_key_id: null,
configuration: {},
created_at: null,
error: null,
index_name: 'index_name',
last_seen: null,
last_sync_error: null,
Expand All @@ -58,6 +59,7 @@ describe('addConnector lib function', () => {
api_key_id: null,
configuration: {},
created_at: null,
error: null,
index_name: 'index_name',
last_seen: null,
last_sync_error: null,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ describe('addConnector lib function', () => {
api_key_id: null,
configuration: {},
created_at: null,
error: null,
index_name: 'index_name',
last_seen: null,
last_sync_error: null,
Expand All @@ -60,6 +61,7 @@ describe('addConnector lib function', () => {
api_key_id: null,
configuration: {},
created_at: null,
error: null,
index_name: 'index_name',
last_seen: null,
last_sync_error: null,
Expand Down

0 comments on commit c7ad442

Please sign in to comment.