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
1c78a3cf
Commit
1c78a3cf
authored
Sep 17, 2020
by
Olena Horal-Koretska
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use gl-icon component for alert system notes
parent
ced482c7
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
19 additions
and
16 deletions
+19
-16
app/assets/javascripts/alert_management/components/system_notes/system_note.vue
.../alert_management/components/system_notes/system_note.vue
+14
-13
app/assets/stylesheets/pages/alert_management/details.scss
app/assets/stylesheets/pages/alert_management/details.scss
+1
-1
spec/frontend/alert_management/components/system_notes/alert_management_system_note_spec.js
...ponents/system_notes/alert_management_system_note_spec.js
+4
-2
No files found.
app/assets/javascripts/alert_management/components/system_notes/system_note.vue
View file @
1c78a3cf
<
script
>
/* eslint-disable vue/no-v-html */
import
{
GlIcon
}
from
'
@gitlab/ui
'
;
import
NoteHeader
from
'
~/notes/components/note_header.vue
'
;
import
{
spriteIcon
}
from
'
~/lib/utils/common_utils
'
;
export
default
{
components
:
{
NoteHeader
,
GlIcon
,
},
props
:
{
note
:
{
...
...
@@ -24,23 +25,23 @@ export default {
} = this.note;
return { ...author, id: id?.split('/').pop() };
},
iconHtml() {
return spriteIcon(this.note?.systemNoteIconName);
},
},
};
</
script
>
<
template
>
<li
:id=
"noteAnchorId"
class=
"timeline-entry note system-note note-wrapper gl-px-0!"
>
<div
class=
"timeline-entry-inner"
>
<div
class=
"timeline-icon"
v-html=
"iconHtml"
></div>
<div
class=
"timeline-content"
>
<div
class=
"note-header"
>
<note-header
:author=
"noteAuthor"
:created-at=
"note.createdAt"
:note-id=
"note.id"
>
<span
v-html=
"note.bodyHtml"
></span>
</note-header>
</div>
<li
:id=
"noteAnchorId"
class=
"timeline-entry note system-note note-wrapper gl-p-0!"
>
<div
class=
"gl-display-inline-flex gl-align-items-center"
>
<div
class=
"gl-display-inline gl-bg-white gl-text-gray-200 gl-border-gray-100 gl-border-1 gl-border-solid gl-rounded-full gl-box-sizing-content-box gl-p-3 gl-mt-n2 gl-mr-6"
>
<gl-icon
:name=
"note.systemNoteIconName"
/>
</div>
<div
class=
"note-header"
>
<note-header
:author=
"noteAuthor"
:created-at=
"note.createdAt"
:note-id=
"note.id"
>
<span
v-html=
"note.bodyHtml"
></span>
</note-header>
</div>
</div>
</li>
...
...
app/assets/stylesheets/pages/alert_management/details.scss
View file @
1c78a3cf
...
...
@@ -33,7 +33,7 @@
}
.
main-notes-list
:
:
before
{
left
:
15px
!
important
;
left
:
$gl-spacing-scale-5
!
important
;
}
.note-header-info
{
...
...
spec/frontend/alert_management/components/system_notes/alert_management_system_note_spec.js
View file @
1c78a3cf
import
{
shallowMount
}
from
'
@vue/test-utils
'
;
import
{
GlIcon
}
from
'
@gitlab/ui
'
;
import
SystemNote
from
'
~/alert_management/components/system_notes/system_note.vue
'
;
import
mockAlerts
from
'
../../mocks/alerts.json
'
;
...
...
@@ -19,6 +20,7 @@ describe('Alert Details System Note', () => {
afterEach
(()
=>
{
if
(
wrapper
)
{
wrapper
.
destroy
();
wrapper
=
null
;
}
});
...
...
@@ -29,10 +31,10 @@ describe('Alert Details System Note', () => {
it
(
'
renders the correct system note
'
,
()
=>
{
const
noteId
=
wrapper
.
find
(
'
.note-wrapper
'
).
attributes
(
'
id
'
);
const
icon
Route
=
wrapper
.
find
(
'
use
'
).
attributes
(
'
href
'
);
const
icon
Name
=
wrapper
.
find
(
GlIcon
).
attributes
(
'
name
'
);
expect
(
noteId
).
toBe
(
'
note_1628
'
);
expect
(
icon
Route
.
includes
(
'
user
'
)).
toBe
(
tru
e
);
expect
(
icon
Name
).
toBe
(
mockAlert
.
notes
.
nodes
[
0
].
systemNoteIconNam
e
);
});
});
});
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