Skip to content

Commit

Permalink
[Enterprise Search] Fix some minor React errors (#150700)
Browse files Browse the repository at this point in the history
## Summary

This fixes two minor React errors that were showing up in the console.
  • Loading branch information
sphilipse authored Feb 9, 2023
1 parent 38cb7b3 commit fc2e95c
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ export const ButtonGroup: React.FC<Props> = ({ onChange, options, selected }) =>
'buttonGroupOption--selected': isSelected,
})}
grow={false}
key={index}
onClick={() => {
onChange(option);
}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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',
},
];

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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>;
};

0 comments on commit fc2e95c

Please sign in to comment.