Skip to content

Commit d3df262

Browse files
committed
[ML] Add key prop to error messages map
1 parent d8926e2 commit d3df262

File tree

2 files changed

+7
-6
lines changed
  • x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_management/components

2 files changed

+7
-6
lines changed

x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_management/components/analytics_list/expanded_row.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -159,13 +159,14 @@ export const ExpandedRow: FC<Props> = ({ item }) => {
159159
defaultMessage: 'State',
160160
}),
161161
items: Object.entries(stateValues).map(([stateKey, stateValue]) => {
162-
if (stateKey.toString() === 'state') {
162+
const title = stateKey.toString();
163+
if (title === 'state') {
163164
return {
164-
title: stateKey.toString(),
165+
title,
165166
description: getTaskStateBadge(getItemDescription(stateValue)),
166167
};
167168
}
168-
return { title: stateKey.toString(), description: getItemDescription(stateValue) };
169+
return { title, description: getItemDescription(stateValue) };
169170
}),
170171
position: 'left',
171172
};

x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_management/components/create_analytics_form/messages.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* you may not use this file except in compliance with the Elastic License.
55
*/
66

7-
import React, { FC } from 'react';
7+
import React, { Fragment, FC } from 'react';
88

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

@@ -18,7 +18,7 @@ export const Messages: FC<Props> = ({ messages }) => {
1818
return (
1919
<>
2020
{messages.map((requestMessage, i) => (
21-
<>
21+
<Fragment key={i}>
2222
<EuiCallOut
2323
title={requestMessage.message}
2424
color={requestMessage.error !== undefined ? 'danger' : 'primary'}
@@ -32,7 +32,7 @@ export const Messages: FC<Props> = ({ messages }) => {
3232
)}
3333
</EuiCallOut>
3434
<EuiSpacer size="s" />
35-
</>
35+
</Fragment>
3636
))}
3737
</>
3838
);

0 commit comments

Comments
 (0)