Skip to content

Commit 7301e12

Browse files
committed
Display a warning badge in case of an error
1 parent 2c2faca commit 7301e12

File tree

1 file changed

+13
-8
lines changed

1 file changed

+13
-8
lines changed

src/plugins/visualize/public/application/utils/get_table_columns.tsx

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919

2020
import React from 'react';
2121
import { History } from 'history';
22-
import { EuiBetaBadge, EuiButton, EuiEmptyPrompt, EuiIcon, EuiLink } from '@elastic/eui';
22+
import { EuiBetaBadge, EuiButton, EuiEmptyPrompt, EuiIcon, EuiLink, EuiBadge } from '@elastic/eui';
2323
import { i18n } from '@kbn/i18n';
2424
import { FormattedMessage } from '@kbn/i18n/react';
2525

@@ -112,13 +112,18 @@ export const getTableColumns = (application: ApplicationStart, history: History)
112112
defaultMessage: 'Type',
113113
}),
114114
sortable: true,
115-
render: (field: string, record: VisualizationListItem) => (
116-
<span>
117-
{renderItemTypeIcon(record)}
118-
{record.typeTitle}
119-
{getBadge(record)}
120-
</span>
121-
),
115+
render: (field: string, record: VisualizationListItem) =>
116+
!record.error ? (
117+
<span>
118+
{renderItemTypeIcon(record)}
119+
{record.typeTitle}
120+
{getBadge(record)}
121+
</span>
122+
) : (
123+
<EuiBadge iconType="alert" color="warning">
124+
{record.error}
125+
</EuiBadge>
126+
),
122127
},
123128
{
124129
field: 'description',

0 commit comments

Comments
 (0)