[Enterprise Search] Fix some minor React errors (#150700)

## Summary

This fixes two minor React errors that were showing up in the console.
This commit is contained in:
Sander Philipse 2023-02-09 15:42:13 +01:00 committed by GitHub
parent 38cb7b3fd2
commit fc2e95cab1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 10 additions and 6 deletions

View file

@ -46,6 +46,7 @@ export const ButtonGroup: React.FC<Props> = ({ onChange, options, selected }) =>
'buttonGroupOption--selected': isSelected,
})}
grow={false}
key={index}
onClick={() => {
onChange(option);
}}

View file

@ -52,14 +52,17 @@ export const NameAndDescriptionStats: React.FC = () => {
description: <EditDescription label={NAME_LABEL} onClick={() => setIsFlyoutVisible(true)} />,
isLoading: hideStats,
title: indexData.connector.name,
descriptionElement: 'div',
titleElement: 'div',
},
{
description: (
<EditDescription label={DESCRIPTION_LABEL} onClick={() => setIsFlyoutVisible(true)} />
),
descriptionElement: 'div',
isLoading: hideStats,
title: <EuiText size="s">{indexData.connector.description || ''}</EuiText>,
titleElement: 'p',
titleElement: 'div',
},
];

View file

@ -131,17 +131,17 @@ export const PipelineJSONBadges: React.FC = () => {
}
const badges: JSX.Element[] = [];
if (isManagedPipeline(pipeline)) {
badges.push(<ManagedPipelineBadge />);
badges.push(<ManagedPipelineBadge key="managed-pipeline" />);
} else {
badges.push(<UnmanagedPipelineBadge />);
badges.push(<UnmanagedPipelineBadge key="unmanaged-pipeline" />);
}
if (pipelineName === DEFAULT_PIPELINE_NAME) {
badges.push(<SharedPipelineBadge />);
badges.push(<SharedPipelineBadge key="shared-pipeline" />);
}
if (pipelineName?.endsWith('@ml-inference')) {
badges.push(<MlInferenceBadge />);
badges.push(<MlInferenceBadge key="inference-pipeline" />);
} else if (pipelineName?.includes(indexName)) {
badges.push(<IndexPipelineBadge />);
badges.push(<IndexPipelineBadge key="index-pipeline" />);
}
return <EuiBadgeGroup gutterSize="s">{badges}</EuiBadgeGroup>;
};