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
312fa4c4
Commit
312fa4c4
authored
Mar 04, 2021
by
David O'Regan
Committed by
Simon Knox
Mar 04, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Feat(incidents): add issue state to alerts table
Show the current status of an linked issue in the alerts table
parent
1ece9271
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
25 additions
and
4 deletions
+25
-4
app/assets/javascripts/alert_management/components/alert_management_table.vue
...ts/alert_management/components/alert_management_table.vue
+1
-1
app/assets/javascripts/vue_shared/alert_details/components/alert_details.vue
...pts/vue_shared/alert_details/components/alert_details.vue
+3
-1
changelogs/unreleased/alert-incident-url-follow.yml
changelogs/unreleased/alert-incident-url-follow.yml
+5
-0
spec/frontend/alert_management/components/alert_management_table_spec.js
...lert_management/components/alert_management_table_spec.js
+1
-1
spec/frontend/vue_shared/alert_details/alert_details_spec.js
spec/frontend/vue_shared/alert_details/alert_details_spec.js
+15
-1
No files found.
app/assets/javascripts/alert_management/components/alert_management_table.vue
View file @
312fa4c4
...
...
@@ -225,7 +225,7 @@ export default {
getIssueMeta
({
issue
:
{
iid
,
state
}
})
{
return
{
state
:
state
===
'
closed
'
?
`(
${
this
.
$options
.
i18n
.
closed
}
)`
:
''
,
link
:
joinPaths
(
'
/
'
,
this
.
projectPath
,
'
-
'
,
'
issues
'
,
iid
),
link
:
joinPaths
(
'
/
'
,
this
.
projectPath
,
'
-
'
,
'
issues
/incident
'
,
iid
),
};
},
tbodyTrClass
(
item
)
{
...
...
app/assets/javascripts/vue_shared/alert_details/components/alert_details.vue
View file @
312fa4c4
...
...
@@ -222,7 +222,9 @@ export default {
});
},
incidentPath
(
issueId
)
{
return
joinPaths
(
this
.
projectIssuesPath
,
issueId
);
return
this
.
isThreatMonitoringPage
?
joinPaths
(
this
.
projectIssuesPath
,
issueId
)
:
joinPaths
(
this
.
projectIssuesPath
,
'
incident
'
,
issueId
);
},
trackPageViews
()
{
const
{
category
,
action
}
=
this
.
trackAlertsDetailsViewsOptions
;
...
...
changelogs/unreleased/alert-incident-url-follow.yml
0 → 100644
View file @
312fa4c4
---
title
:
Allow alert to link to incidents
merge_request
:
55426
author
:
type
:
changed
spec/frontend/alert_management/components/alert_management_table_spec.js
View file @
312fa4c4
...
...
@@ -251,7 +251,7 @@ describe('AlertManagementTable', () => {
const
tooltip
=
getBinding
(
issueField
.
element
,
'
gl-tooltip
'
);
expect
(
issueField
.
text
()).
toBe
(
`#1 (closed)`
);
expect
(
issueField
.
attributes
(
'
href
'
)).
toBe
(
'
/gitlab-org/gitlab/-/issues/1
'
);
expect
(
issueField
.
attributes
(
'
href
'
)).
toBe
(
'
/gitlab-org/gitlab/-/issues/
incident/
1
'
);
expect
(
issueField
.
attributes
(
'
title
'
)).
toBe
(
'
My test issue
'
);
expect
(
tooltip
).
not
.
toBe
(
undefined
);
});
...
...
spec/frontend/vue_shared/alert_details/alert_details_spec.js
View file @
312fa4c4
...
...
@@ -188,6 +188,18 @@ describe('AlertDetails', () => {
});
expect
(
findMetricsTab
().
exists
()).
toBe
(
false
);
});
it
(
'
should display "View incident" button that links the issues page when incident exists
'
,
()
=>
{
const
iid
=
'
3
'
;
mountComponent
({
data
:
{
alert
:
{
...
mockAlert
,
issue
:
{
iid
}
},
sidebarStatus
:
false
},
provide
:
{
isThreatMonitoringPage
:
true
},
});
expect
(
findViewIncidentBtn
().
exists
()).
toBe
(
true
);
expect
(
findViewIncidentBtn
().
attributes
(
'
href
'
)).
toBe
(
joinPaths
(
projectIssuesPath
,
iid
));
expect
(
findCreateIncidentBtn
().
exists
()).
toBe
(
false
);
});
});
describe
(
'
Create incident from alert
'
,
()
=>
{
...
...
@@ -198,7 +210,9 @@ describe('AlertDetails', () => {
});
expect
(
findViewIncidentBtn
().
exists
()).
toBe
(
true
);
expect
(
findViewIncidentBtn
().
attributes
(
'
href
'
)).
toBe
(
joinPaths
(
projectIssuesPath
,
iid
));
expect
(
findViewIncidentBtn
().
attributes
(
'
href
'
)).
toBe
(
joinPaths
(
projectIssuesPath
,
'
incident
'
,
iid
),
);
expect
(
findCreateIncidentBtn
().
exists
()).
toBe
(
false
);
});
...
...
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