Commit e658cda8 authored by Kushal Pandya's avatar Kushal Pandya

Merge branch 'tr-alert-column-spacing' into 'master'

Improve alert list spacing

See merge request gitlab-org/gitlab!35400
parents 5435464e 4e2d2482
...@@ -32,7 +32,8 @@ import { ...@@ -32,7 +32,8 @@ import {
} from '../constants'; } from '../constants';
import AlertStatus from './alert_status.vue'; import AlertStatus from './alert_status.vue';
const tdClass = 'table-col gl-display-flex d-md-table-cell gl-align-items-center'; const tdClass =
'table-col gl-display-flex d-md-table-cell gl-align-items-center gl-white-space-nowrap';
const thClass = 'gl-hover-bg-blue-50'; const thClass = 'gl-hover-bg-blue-50';
const bodyTrClass = const bodyTrClass =
'gl-border-1 gl-border-t-solid gl-border-gray-100 gl-hover-bg-blue-50 gl-hover-cursor-pointer gl-hover-border-b-solid gl-hover-border-blue-200'; 'gl-border-1 gl-border-t-solid gl-border-gray-100 gl-hover-bg-blue-50 gl-hover-cursor-pointer gl-hover-border-b-solid gl-hover-border-blue-200';
...@@ -60,40 +61,34 @@ export default { ...@@ -60,40 +61,34 @@ export default {
key: 'severity', key: 'severity',
label: s__('AlertManagement|Severity'), label: s__('AlertManagement|Severity'),
tdClass: `${tdClass} rounded-top text-capitalize`, tdClass: `${tdClass} rounded-top text-capitalize`,
thClass, thClass: `${thClass} gl-w-eighth`,
sortable: true, sortable: true,
}, },
{ {
key: 'startedAt', key: 'startedAt',
label: s__('AlertManagement|Start time'), label: s__('AlertManagement|Start time'),
thClass: `${thClass} js-started-at`, thClass: `${thClass} js-started-at w-15p`,
tdClass,
sortable: true,
},
{
key: 'endedAt',
label: s__('AlertManagement|End time'),
thClass,
tdClass, tdClass,
sortable: true, sortable: true,
}, },
{ {
key: 'title', key: 'title',
label: s__('AlertManagement|Alert'), label: s__('AlertManagement|Alert'),
thClass: `${thClass} w-30p gl-pointer-events-none`, thClass: `${thClass} gl-pointer-events-none`,
tdClass, tdClass,
sortable: false, sortable: false,
}, },
{ {
key: 'eventCount', key: 'eventCount',
label: s__('AlertManagement|Events'), label: s__('AlertManagement|Events'),
thClass: `${thClass} text-right gl-pr-9 w-3rem`, thClass: `${thClass} text-right gl-w-12`,
tdClass: `${tdClass} text-md-right`, tdClass: `${tdClass} text-md-right`,
sortable: true, sortable: true,
}, },
{ {
key: 'assignees', key: 'assignees',
label: s__('AlertManagement|Assignees'), label: s__('AlertManagement|Assignees'),
thClass: 'gl-w-eighth',
tdClass, tdClass,
}, },
{ {
...@@ -377,6 +372,7 @@ export default { ...@@ -377,6 +372,7 @@ export default {
:sort-desc.sync="sortDesc" :sort-desc.sync="sortDesc"
:sort-by.sync="sortBy" :sort-by.sync="sortBy"
sort-icon-left sort-icon-left
fixed
@row-clicked="navigateToAlertDetails" @row-clicked="navigateToAlertDetails"
@sort-changed="fetchSortedData" @sort-changed="fetchSortedData"
> >
...@@ -399,16 +395,12 @@ export default { ...@@ -399,16 +395,12 @@ export default {
<time-ago v-if="item.startedAt" :time="item.startedAt" /> <time-ago v-if="item.startedAt" :time="item.startedAt" />
</template> </template>
<template #cell(endedAt)="{ item }">
<time-ago v-if="item.endedAt" :time="item.endedAt" />
</template>
<template #cell(eventCount)="{ item }"> <template #cell(eventCount)="{ item }">
{{ item.eventCount }} {{ item.eventCount }}
</template> </template>
<template #cell(title)="{ item }"> <template #cell(title)="{ item }">
<div class="gl-max-w-full text-truncate">{{ item.title }}</div> <div class="gl-max-w-full text-truncate" :title="item.title">{{ item.title }}</div>
</template> </template>
<template #cell(assignees)="{ item }"> <template #cell(assignees)="{ item }">
......
...@@ -8,6 +8,7 @@ fragment AlertDetailItem on AlertManagementAlert { ...@@ -8,6 +8,7 @@ fragment AlertDetailItem on AlertManagementAlert {
service service
description description
updatedAt updatedAt
endedAt
details details
notes { notes {
nodes { nodes {
......
...@@ -4,7 +4,6 @@ fragment AlertListItem on AlertManagementAlert { ...@@ -4,7 +4,6 @@ fragment AlertListItem on AlertManagementAlert {
severity severity
status status
startedAt startedAt
endedAt
eventCount eventCount
issueIid issueIid
assignees { assignees {
......
.alert-management-list { .alert-management-list {
// Migrate this to gitlab-ui
.gl-w-12 {
width: $gl-spacing-scale-12;
}
// these styles need to be deleted once GlTable component looks in GitLab same as in @gitlab/ui // these styles need to be deleted once GlTable component looks in GitLab same as in @gitlab/ui
table { table {
color: $gray-700; color: $gray-700;
......
---
title: Improve alert list spacing
merge_request: 35400
author:
type: fixed
...@@ -1951,9 +1951,6 @@ msgstr "" ...@@ -1951,9 +1951,6 @@ msgstr ""
msgid "AlertManagement|Edit" msgid "AlertManagement|Edit"
msgstr "" msgstr ""
msgid "AlertManagement|End time"
msgstr ""
msgid "AlertManagement|Events" msgid "AlertManagement|Events"
msgstr "" msgstr ""
......
...@@ -289,7 +289,6 @@ describe('AlertManagementList', () => { ...@@ -289,7 +289,6 @@ describe('AlertManagementList', () => {
iid: 1, iid: 1,
status: 'acknowledged', status: 'acknowledged',
startedAt: '2020-03-17T23:18:14.996Z', startedAt: '2020-03-17T23:18:14.996Z',
endedAt: '2020-04-17T23:18:14.996Z',
severity: 'high', severity: 'high',
assignees: { nodes: [] }, assignees: { nodes: [] },
}, },
...@@ -300,7 +299,7 @@ describe('AlertManagementList', () => { ...@@ -300,7 +299,7 @@ describe('AlertManagementList', () => {
}, },
loading: false, loading: false,
}); });
expect(findDateFields().length).toBe(2); expect(findDateFields().length).toBe(1);
}); });
it('should not display time ago dates when values not provided', () => { it('should not display time ago dates when values not provided', () => {
...@@ -312,7 +311,6 @@ describe('AlertManagementList', () => { ...@@ -312,7 +311,6 @@ describe('AlertManagementList', () => {
iid: 1, iid: 1,
status: 'acknowledged', status: 'acknowledged',
startedAt: null, startedAt: null,
endedAt: null,
severity: 'high', severity: 'high',
}, },
], ],
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment