Skip to content

Commit

Permalink
[ML] Add key prop to error messages map
Browse files Browse the repository at this point in the history
  • Loading branch information
peteharverson committed Mar 16, 2020
1 parent d8926e2 commit d3df262
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -159,13 +159,14 @@ export const ExpandedRow: FC<Props> = ({ item }) => {
defaultMessage: 'State',
}),
items: Object.entries(stateValues).map(([stateKey, stateValue]) => {
if (stateKey.toString() === 'state') {
const title = stateKey.toString();
if (title === 'state') {
return {
title: stateKey.toString(),
title,
description: getTaskStateBadge(getItemDescription(stateValue)),
};
}
return { title: stateKey.toString(), description: getItemDescription(stateValue) };
return { title, description: getItemDescription(stateValue) };
}),
position: 'left',
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* you may not use this file except in compliance with the Elastic License.
*/

import React, { FC } from 'react';
import React, { Fragment, FC } from 'react';

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

Expand All @@ -18,7 +18,7 @@ export const Messages: FC<Props> = ({ messages }) => {
return (
<>
{messages.map((requestMessage, i) => (
<>
<Fragment key={i}>
<EuiCallOut
title={requestMessage.message}
color={requestMessage.error !== undefined ? 'danger' : 'primary'}
Expand All @@ -32,7 +32,7 @@ export const Messages: FC<Props> = ({ messages }) => {
)}
</EuiCallOut>
<EuiSpacer size="s" />
</>
</Fragment>
))}
</>
);
Expand Down

0 comments on commit d3df262

Please sign in to comment.