Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
d84e96cc
Commit
d84e96cc
authored
May 05, 2020
by
Natalia Tepluhina
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch '214528' into 'master'
Add severity icon for list view See merge request gitlab-org/gitlab!30472
parents
40b6f344
4067da0b
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
61 additions
and
1 deletion
+61
-1
app/assets/javascripts/alert_management/components/alert_management_list.vue
...pts/alert_management/components/alert_management_list.vue
+14
-0
app/assets/stylesheets/pages/alerts_list.scss
app/assets/stylesheets/pages/alerts_list.scss
+24
-0
changelogs/unreleased/214528.yml
changelogs/unreleased/214528.yml
+5
-0
spec/frontend/alert_management/components/alert_management_list_spec.js
...alert_management/components/alert_management_list_spec.js
+18
-1
No files found.
app/assets/javascripts/alert_management/components/alert_management_list.vue
View file @
d84e96cc
...
@@ -5,6 +5,7 @@ import {
...
@@ -5,6 +5,7 @@ import {
GlLoadingIcon
,
GlLoadingIcon
,
GlTable
,
GlTable
,
GlAlert
,
GlAlert
,
GlIcon
,
GlNewDropdown
,
GlNewDropdown
,
GlNewDropdownItem
,
GlNewDropdownItem
,
}
from
'
@gitlab/ui
'
;
}
from
'
@gitlab/ui
'
;
...
@@ -64,6 +65,7 @@ export default {
...
@@ -64,6 +65,7 @@ export default {
TimeAgo
,
TimeAgo
,
GlNewDropdown
,
GlNewDropdown
,
GlNewDropdownItem
,
GlNewDropdownItem
,
GlIcon
,
},
},
props
:
{
props
:
{
projectPath
:
{
projectPath
:
{
...
@@ -144,6 +146,18 @@ export default {
...
@@ -144,6 +146,18 @@ export default {
fixed
fixed
stacked=
"md"
stacked=
"md"
>
>
<template
#cell(severity)=
"
{ item }">
<div
class=
"d-inline-flex align-items-center justify-content-between"
>
<gl-icon
class=
"mr-2"
:size=
"12"
:name=
"`severity-$
{item.severity.toLowerCase()}`"
:class="`icon-${item.severity.toLowerCase()}`"
/>
{{
item
.
severity
}}
</div>
</
template
>
<
template
#cell(startedAt)=
"{ item }"
>
<
template
#cell(startedAt)=
"{ item }"
>
<time-ago
:time=
"item.startedAt"
/>
<time-ago
:time=
"item.startedAt"
/>
</
template
>
</
template
>
...
...
app/assets/stylesheets/pages/alerts_list.scss
View file @
d84e96cc
.alert-management-list
{
.alert-management-list
{
.icon-critical
{
color
:
$red-800
;
}
.icon-high
{
color
:
$red-600
;
}
.icon-medium
{
color
:
$orange-400
;
}
.icon-low
{
color
:
$orange-300
;
}
.icon-info
{
color
:
$blue-400
;
}
.icon-unknown
{
color
:
$gray-400
;
}
// 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
;
...
...
changelogs/unreleased/214528.yml
0 → 100644
View file @
d84e96cc
---
title
:
Add severity icons for alert management
merge_request
:
30472
author
:
type
:
changed
spec/frontend/alert_management/components/alert_management_list_spec.js
View file @
d84e96cc
import
{
mount
}
from
'
@vue/test-utils
'
;
import
{
mount
}
from
'
@vue/test-utils
'
;
import
{
GlEmptyState
,
GlTable
,
GlAlert
,
GlLoadingIcon
,
GlNewDropdown
}
from
'
@gitlab/ui
'
;
import
{
GlEmptyState
,
GlTable
,
GlAlert
,
GlLoadingIcon
,
GlNewDropdown
,
GlIcon
}
from
'
@gitlab/ui
'
;
import
AlertManagementList
from
'
~/alert_management/components/alert_management_list.vue
'
;
import
AlertManagementList
from
'
~/alert_management/components/alert_management_list.vue
'
;
import
mockAlerts
from
'
../mocks/alerts.json
'
;
import
mockAlerts
from
'
../mocks/alerts.json
'
;
...
@@ -113,5 +113,22 @@ describe('AlertManagementList', () => {
...
@@ -113,5 +113,22 @@ describe('AlertManagementList', () => {
});
});
expect
(
findStatusDropdown
().
exists
()).
toBe
(
true
);
expect
(
findStatusDropdown
().
exists
()).
toBe
(
true
);
});
});
it
(
'
shows correct severity icons
'
,
()
=>
{
mountComponent
({
props
:
{
alertManagementEnabled
:
true
,
userCanEnableAlertManagement
:
true
},
data
:
{
alerts
:
mockAlerts
,
errored
:
false
},
loading
:
false
,
});
return
wrapper
.
vm
.
$nextTick
().
then
(()
=>
{
expect
(
wrapper
.
find
(
GlTable
).
exists
()).
toBe
(
true
);
expect
(
findAlertsTable
()
.
find
(
GlIcon
)
.
classes
(
'
icon-critical
'
),
).
toBe
(
true
);
});
});
});
});
});
});
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment