Skip to content

Commit

Permalink
Update widths on columns in Alert Detail view (#83823)
Browse files Browse the repository at this point in the history
* Update widths on columns

* Add custom class for truncation fix

* Use euiTruncate mixin and shrink column width of status column

* Update imports to fix checks

Co-authored-by: Kibana Machine <[email protected]>
  • Loading branch information
mdefazio and kibanamachine authored Dec 8, 2020
1 parent caa14d4 commit 0a0ead8
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
// Add truncation to heath status

.actionsInstanceList__health {
width: 100%;

.euiFlexItem:last-of-type {
@include euiTextTruncate;
min-width: 0;
width: 85%;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import {
withBulkAlertOperations,
} from '../../common/components/with_bulk_alert_api_operations';
import { DEFAULT_SEARCH_PAGE_SIZE } from '../../../constants';
import './alert_instances.scss';

type AlertInstancesProps = {
alert: Alert;
Expand All @@ -46,6 +47,7 @@ export const alertInstancesTableColumns = (
),
sortable: false,
truncateText: true,
width: '45%',
'data-test-subj': 'alertInstancesTableCell-instance',
render: (value: string) => {
return (
Expand All @@ -61,10 +63,10 @@ export const alertInstancesTableColumns = (
'xpack.triggersActionsUI.sections.alertDetails.alertInstancesList.columns.status',
{ defaultMessage: 'Status' }
),
width: '100px',
width: '15%',
render: (value: AlertInstanceListItemStatus, instance: AlertInstanceListItem) => {
return (
<EuiHealth color={value.healthColor}>
<EuiHealth color={value.healthColor} className="actionsInstanceList__health">
{value.label}
{value.actionGroup ? ` (${value.actionGroup})` : ``}
</EuiHealth>
Expand All @@ -75,7 +77,7 @@ export const alertInstancesTableColumns = (
},
{
field: 'start',
width: '200px',
width: '190px',
render: (value: Date | undefined, instance: AlertInstanceListItem) => {
return value ? moment(value).format('D MMM YYYY @ HH:mm:ss') : '';
},
Expand All @@ -88,7 +90,6 @@ export const alertInstancesTableColumns = (
},
{
field: 'duration',
align: CENTER_ALIGNMENT,
render: (value: number, instance: AlertInstanceListItem) => {
return value ? durationAsString(moment.duration(value)) : '';
},
Expand All @@ -97,7 +98,7 @@ export const alertInstancesTableColumns = (
{ defaultMessage: 'Duration' }
),
sortable: false,
width: '100px',
width: '80px',
'data-test-subj': 'alertInstancesTableCell-duration',
},
{
Expand Down Expand Up @@ -192,6 +193,7 @@ export function AlertInstances({
columns={alertInstancesTableColumns(onMuteAction, readOnly)}
data-test-subj="alertInstancesList"
tableLayout="fixed"
className="alertInstancesList"
/>
</Fragment>
);
Expand Down

0 comments on commit 0a0ead8

Please sign in to comment.