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
b0e9cc0d
Commit
b0e9cc0d
authored
Sep 21, 2020
by
Olena Horal-Koretska
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Surface Alert number GFM reference in highlight bar on Incidents
parent
a20a8552
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
30 additions
and
7 deletions
+30
-7
app/assets/javascripts/issue_show/components/incidents/highlight_bar.vue
...scripts/issue_show/components/incidents/highlight_bar.vue
+15
-5
changelogs/unreleased/230841-update-alert-gfm-like-reference.yml
...ogs/unreleased/230841-update-alert-gfm-like-reference.yml
+5
-0
locale/gitlab.pot
locale/gitlab.pot
+3
-0
spec/frontend/issue_show/components/incidents/highlight_bar_spec.js
...end/issue_show/components/incidents/highlight_bar_spec.js
+7
-2
No files found.
app/assets/javascripts/issue_show/components/incidents/highlight_bar.vue
View file @
b0e9cc0d
<
script
>
import
{
GlLink
}
from
'
@gitlab/ui
'
;
import
{
GlLink
,
GlTooltipDirective
,
GlSprintf
}
from
'
@gitlab/ui
'
;
import
{
formatDate
}
from
'
~/lib/utils/datetime_utility
'
;
export
default
{
components
:
{
GlLink
,
GlSprintf
,
},
directives
:
{
GlTooltip
:
GlTooltipDirective
,
},
props
:
{
alert
:
{
...
...
@@ -24,17 +28,23 @@ export default {
<div
class=
"gl-border-solid gl-border-1 gl-border-gray-100 gl-p-5 gl-mb-3 gl-rounded-base gl-display-flex gl-justify-content-space-between"
>
<div
class=
"
text-truncate
gl-pr-3"
>
<div
class=
"gl-pr-3"
>
<span
class=
"gl-font-weight-bold"
>
{{
s__
(
'
HighlightBar|Original alert:
'
)
}}
</span>
<gl-link
:href=
"alert.detailsUrl"
>
{{
alert
.
title
}}
</gl-link>
<gl-link
v-gl-tooltip
:title=
"alert.title"
:href=
"alert.detailsUrl"
>
<gl-sprintf
:message=
"__('Alert #%
{alertId}')">
<template
#alertId
>
<span>
{{
alert
.
iid
}}
</span>
</
template
>
</gl-sprintf>
</gl-link>
</div>
<div
class=
"gl-pr-3
gl-white-space-nowrap
"
>
<div
class=
"gl-pr-3"
>
<span
class=
"gl-font-weight-bold"
>
{{ s__('HighlightBar|Alert start time:') }}
</span>
{{ startTime }}
</div>
<div
class=
"gl-white-space-nowrap"
>
<div>
<span
class=
"gl-font-weight-bold"
>
{{ s__('HighlightBar|Alert events:') }}
</span>
<span>
{{ alert.eventCount }}
</span>
</div>
...
...
changelogs/unreleased/230841-update-alert-gfm-like-reference.yml
0 → 100644
View file @
b0e9cc0d
---
title
:
Surface Alert number GFM reference in highlight bar
merge_request
:
42832
author
:
type
:
changed
locale/gitlab.pot
View file @
b0e9cc0d
...
...
@@ -2168,6 +2168,9 @@ msgid_plural "Alerts"
msgstr[0] ""
msgstr[1] ""
msgid "Alert #%{alertId}"
msgstr ""
msgid "AlertManagement|Acknowledged"
msgstr ""
...
...
spec/frontend/issue_show/components/incidents/highlight_bar_spec.js
View file @
b0e9cc0d
import
{
shallowMount
}
from
'
@vue/test-utils
'
;
import
{
GlLink
}
from
'
@gitlab/ui
'
;
import
{
GlLink
,
GlSprintf
}
from
'
@gitlab/ui
'
;
import
HighlightBar
from
'
~/issue_show/components/incidents/highlight_bar.vue
'
;
import
{
formatDate
}
from
'
~/lib/utils/datetime_utility
'
;
...
...
@@ -9,6 +9,7 @@ describe('Highlight Bar', () => {
let
wrapper
;
const
alert
=
{
iid
:
1
,
startedAt
:
'
2020-05-29T10:39:22Z
'
,
detailsUrl
:
'
http://127.0.0.1:3000/root/unique-alerts/-/alert_management/1/details
'
,
eventCount
:
1
,
...
...
@@ -20,6 +21,9 @@ describe('Highlight Bar', () => {
propsData
:
{
alert
,
},
stubs
:
{
GlSprintf
,
},
});
};
...
...
@@ -39,7 +43,8 @@ describe('Highlight Bar', () => {
it
(
'
renders a link to the alert page
'
,
()
=>
{
expect
(
findLink
().
exists
()).
toBe
(
true
);
expect
(
findLink
().
attributes
(
'
href
'
)).
toBe
(
alert
.
detailsUrl
);
expect
(
findLink
().
text
()).
toContain
(
alert
.
title
);
expect
(
findLink
().
attributes
(
'
title
'
)).
toBe
(
alert
.
title
);
expect
(
findLink
().
text
()).
toBe
(
`Alert #
${
alert
.
iid
}
`
);
});
it
(
'
renders formatted start time of the alert
'
,
()
=>
{
...
...
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