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
4067da0b
Commit
4067da0b
authored
May 05, 2020
by
David O'Regan
Committed by
Natalia Tepluhina
May 05, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add severity icon for list view
parent
c752700b
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 @
4067da0b
...
...
@@ -5,6 +5,7 @@ import {
GlLoadingIcon
,
GlTable
,
GlAlert
,
GlIcon
,
GlNewDropdown
,
GlNewDropdownItem
,
}
from
'
@gitlab/ui
'
;
...
...
@@ -64,6 +65,7 @@ export default {
TimeAgo
,
GlNewDropdown
,
GlNewDropdownItem
,
GlIcon
,
},
props
:
{
projectPath
:
{
...
...
@@ -144,6 +146,18 @@ export default {
fixed
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 }"
>
<time-ago
:time=
"item.startedAt"
/>
</
template
>
...
...
app/assets/stylesheets/pages/alerts_list.scss
View file @
4067da0b
.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
table
{
color
:
$gray-700
;
...
...
changelogs/unreleased/214528.yml
0 → 100644
View file @
4067da0b
---
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 @
4067da0b
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
mockAlerts
from
'
../mocks/alerts.json
'
;
...
...
@@ -113,5 +113,22 @@ describe('AlertManagementList', () => {
});
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