[8.6] [Enterprise Search] Show only connector error on config page (#146880) (#146890)

# Backport

This will backport the following commits from `main` to `8.6`:
- [[Enterprise Search] Show only connector error on config page
(#146880)](https://github.com/elastic/kibana/pull/146880)

<!--- Backport version: 8.9.7 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT [{"author":{"name":"Sander
Philipse","email":"94373878+sphilipse@users.noreply.github.com"},"sourceCommit":{"committedDate":"2022-12-02T14:46:26Z","message":"[Enterprise
Search] Show only connector error on config page (#146880)\n\nThis
removes synchronization errors from the connector
configuration\r\nscreen, showing only connector
errors.","sha":"215c567baa146da28aac3923083060dc8ef53275","branchLabelMapping":{"^v8.7.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:fix","Team:EnterpriseSearch","v8.6.0","v8.7.0"],"number":146880,"url":"https://github.com/elastic/kibana/pull/146880","mergeCommit":{"message":"[Enterprise
Search] Show only connector error on config page (#146880)\n\nThis
removes synchronization errors from the connector
configuration\r\nscreen, showing only connector
errors.","sha":"215c567baa146da28aac3923083060dc8ef53275"}},"sourceBranch":"main","suggestedTargetBranches":["8.6"],"targetPullRequestStates":[{"branch":"8.6","label":"v8.6.0","labelRegex":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v8.7.0","labelRegex":"^v8.7.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/146880","number":146880,"mergeCommit":{"message":"[Enterprise
Search] Show only connector error on config page (#146880)\n\nThis
removes synchronization errors from the connector
configuration\r\nscreen, showing only connector
errors.","sha":"215c567baa146da28aac3923083060dc8ef53275"}}]}]
BACKPORT-->

Co-authored-by: Sander Philipse <94373878+sphilipse@users.noreply.github.com>
This commit is contained in:
Kibana Machine 2022-12-02 10:49:19 -05:00 committed by GitHub
parent 63473d511c
commit 8a58292881
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 8 deletions

View file

@ -26,7 +26,7 @@ import { ConnectorConfigurationForm } from './connector_configuration_form';
import { ConnectorConfigurationLogic } from './connector_configuration_logic';
export const ConnectorConfigurationConfig: React.FC = ({ children }) => {
const { error } = useValues(IndexViewLogic);
const { connectorError } = useValues(IndexViewLogic);
const { configView, isEditing } = useValues(ConnectorConfigurationLogic);
const { setIsEditing } = useActions(ConnectorConfigurationLogic);
@ -68,7 +68,7 @@ export const ConnectorConfigurationConfig: React.FC = ({ children }) => {
)
)}
</EuiFlexItem>
{!!error && (
{!!connectorError && (
<EuiFlexItem>
<EuiCallOut
color="danger"
@ -79,7 +79,7 @@ export const ConnectorConfigurationConfig: React.FC = ({ children }) => {
}
)}
>
<EuiText size="s">{error}</EuiText>
<EuiText size="s">{connectorError}</EuiText>
</EuiCallOut>
</EuiFlexItem>
)}

View file

@ -68,6 +68,7 @@ export interface IndexViewActions {
export interface IndexViewValues {
connector: Connector | undefined;
connectorError: string | undefined;
connectorId: string | null;
error: string | undefined;
fetchIndexApiData: typeof CachedFetchIndexApiLogic.values.fetchIndexApiData;
@ -204,16 +205,17 @@ export const IndexViewLogic = kea<MakeLogicType<IndexViewValues, IndexViewAction
? index.connector
: undefined,
],
connectorError: [
() => [selectors.connector],
(connector: Connector | undefined) => connector?.error,
],
connectorId: [
() => [selectors.indexData],
(index) => (isConnectorViewIndex(index) ? index.connector.id : null),
],
error: [
() => [selectors.indexData],
(index: ElasticsearchViewIndex) =>
isConnectorViewIndex(index)
? index.connector.error || index.connector.last_sync_error
: null,
() => [selectors.connector],
(connector: Connector | undefined) => connector?.error || connector?.last_sync_error || null,
],
hasAdvancedFilteringFeature: [
() => [selectors.connector],